Working with variable map properties files

You can use properties files to create, modify, or delete property-value pairs in variable maps.

Before you begin

Determine the changes that you want to make to your variable map.

Start the wsadmin scripting tool. To start wsadmin using the Jython language, run the wsadmin -lang jython command from the bin directory of the server profile.

About this task

Using a properties file, you can create, modify, or delete one or more variable substitution entries in a variable map.

Run administrative commands using wsadmin to create or change a properties file for a variable map, validate the variable substitution entries, and apply them to your configuration.

Table 1. Actions for variable map properties . You can create, modify, and delete properties and values in variable maps.
Action Procedure
create Not applicable
modify Edit property values in the variable map properties file and then run the applyConfigProperties command to modify the values of existing variables.
delete Not applicable
create Property Edit the variable map properties file and then run the applyConfigProperties command to create a variable substitution entry.
delete Property Run the deleteConfigProperties command to delete an existing variable substitution entry. The properties file must contain only the properties to be deleted.

Optionally, you can use interactive mode with the commands:

AdminTask.command_name('-interactive')

Procedure

  • Modify an existing properties file.
    1. Obtain a properties file for the variable map that you want to change.

      You can extract a properties file for a VariableMap object using the extractConfigProperties command.

    2. Open the properties file in an editor and change the properties as needed.

      Modify the Environment Variables section to match your system and set any property value that needs to be changed. To specify a variable substitution entry, edit the AttributeInfo value and properties values. An example VariableMap properties file follows:

      #
      # Header 
      #
      ResourceType=VariableMap
      ImplementingResourceType=VariableMap
      ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:VariableMap=
      AttributeInfo=entries(symbolicName,value)
      
      #
      #Properties
      #
      SERVER_LOG_ROOT=${LOG_ROOT}/!{serverName}
      WAS_SERVER_NAME=!{serverName}
      
      #
      EnvironmentVariablesSection
      #
      #Environment Variables
      cellName=myCell04
      nodeName=myNode
      serverName=myServer
    3. Run the applyConfigProperties command to create or change a VariableMap configuration.

      Running the applyConfigProperties command applies the properties file to the configuration. In this Jython example, the optional -reportFileName parameter produces a report named report.txt:

      AdminTask.applyConfigProperties(['-propertiesFileName myObjectType.props -reportFileName report.txt'])
  • If you no longer need a variable substitution entry, you can delete the entry.

    To delete a variable substitution entry, specify only the entry to be deleted in the properties file and then run the deleteConfigProperties command; for example:

    AdminTask.deleteConfigProperties('[-propertiesFileName myObjectType.props -reportFileName report.txt]') 

Results

You can use the properties file to configure and manage the variable map properties.

What to do next

Save the changes to your configuration.