InfoCenter Home >
6: Administer applications >
6.6: Tools and resources quick reference >
6.6.0: About user assistance >
6.6.0.2: Command line administration >
6.6.0.2.1: XMLConfig command line interface for XML configuration >
6.6.0.2.1.3: XMLConfig - Using the tool programmatically

6.6.0.2.1.3: XMLConfig - Using the tool programmatically

The XMLConfig class is structured so that you can use it programmatically to retrieve information as Document or Element. The import/export facility can thus be included in a Java program, as well as being operated from a command line.

Creating platform-neutral configurations

For import and partial export operations, a variable substitution operation is performed on the input XML document, allowing you to create platform-neutral XML documents. The following variables are available:

$server_root$
Replace with the product installation directory, such as C:\WebSphere\AppServer on Windows NT. (This variable is not available for use on iSeries.)
$psep$
Replace with the path separator as specified in the operating system JDK.
  • On Windows NT, it is ; (semicolon)
  • On the UNIX platforms and Linux, it is : (colon)
$dsep$
Replace with the directory separator as specified in the operating system JDK.
  • On Windows NT, it is \ (backward slash)
  • On the UNIX platforms and Linux, it is / (forward slash)

Security XML configurations

In Version 4.0, you can enter your own custom user registry entries (key/value pairs). All user-defined keys must be delimited with a special prefix, Custom_. When you use the product GUI to add custom entries, the product adds the prefix for you. However, if you want to configure custom entries programmatically, you must add the prefix yourself.

The following example sets these properties:

groupsFile = c:\temp\groups.props
db_URL = jdbc:db2:customDB

A complete stanza for security configuration follows. The markup that corresponds to the needed property settings is shown in bold.

<security-config security-cache-timeout="150" security-enabled="true">
<app-security-defaults>
<realm-name>Default</realm-name>
<challenge-type ssl-enabled="false">
<basic-challenge/>
</challenge-type>
</app-security-defaults>
<auth-mechanism>
<ltpa-config>
<ltpa-password>{xor}B7rj9Lrj77rj7Q==</ltpa-password>
<ltpa-timeout>1200000</ltpa-timeout>
<custom-ur-config>
<user-id>bob</user-id>
<password>{xor}PTA9bg==</password>
<attribute name="Custom_groupsFile" value="c:/temp/groups.props"/>
<attribute name="Custom_db_URL" value="jdbc:db2:customDB"/>
</custom-ur-config>
</ltpa-config>
</auth-mechanism>
</security-config>

Javadoc for the tool

It is recommended that you refer to the Javadoc for the latest programmatic use of XMLConfig, and refer to the exported XML for the sample markup for repository objects.

Javadoc for the com.ibm.websphere.xmlconfig class and all of the related object classes resides in the apidocs directory:

installation_root\web\apidocs\package_and_class_name

See the package summary file for a list of class names, such as ApplicationServerConfig. The Javadoc is labeled by the class name preceded by the package name, com.ibm.websphere.

Go to previous article: XMLConfig grammar Go to next article: Troubleshooting XMLConfig

 

 
Go to previous article: XMLConfig grammar Go to next article: Troubleshooting XMLConfig