As mentioned previously, you can use configuration paths and property appending to customize a set of configuration files without actually modifying those files.

This is very important when dealing with the ATG distribution. The ATG platform comes with its own set of configuration files that start up various components. You may want to customize a few property settings, such as document root or the ports of some of the servers. You may also wish to add some of your own components.

ATG products come configured to recognize the config directory found in the distribution. If you want to change any configuration settings, you should not modify the properties files in this directory. If you change settings this way, your changes will be overwritten each time you install a new ATG platform distribution.

To prevent this from happening, ATG establishes separate configuration layers. The config directory defines the base configuration layer. The default configuration path also includes a separate configuration layer defined by the localconfig directory. When you start up your application, the CONFIGPATH is passed to the Nucleus service. The default CONFIGPATH is config/config.jar:localconfig. Nucleus examines the CONFIGPATH to determine which configuration properties to apply. Nucleus locates configuration properties by first accessing the config/config.jar. Then Nucleus accesses the localconfig directory to gather property values stored there. The result is a combination of property values found in the files. If the same property value is defined in more than one properties files, then the value defined last in the configuration path is the value that is used. Thus, values found later in the configuration path override values found earlier.

Configuration paths enable you to start with a base configuration, then override certain properties files without modifying properties files in the base configuration. Properties files you want to override can then be placed in the local configuration directory without changing the base configuration directory.

You can view all of the configuration layers that affect a given component by viewing the Configuration tab in the ATG Control Center Component Editor for that component. For example, if you open the Configuration tab for the Configuration component that configures your Dynamo server, you see that there are two different Configuration.properties files: a Dynamo base configuration file in the config directory and a local configuration file in the localconfig directory. This two-level system lets you preserve your local configuration settings when you install a new version of the ATG platform.

For example, say that you want to change the port number that the ATG platform uses for Remote Method Invocation (RMI). This port number is set in the Configuration.properties file in the base configuration layer:

rmiPort=8860

You might be tempted to go in and change this number, but this would make your configuration vulnerable to new ATG platform updates. Instead, make this change in the local configuration directory, in <ATG2007.3dir>/home/localconfig/atg/dynamo/Configuration.properties. You can edit the RMI port number property to read like this:

rmiPort=8862

Then, when you start your application, Nucleus takes the value for the rmiPort property from the last directory in your configuration path, localconfig.

If you edit properties files by hand, remember to use the += appending operator when you want to add something to a list. A common use of this operator is to add a component to the initialServices list in Initial.properties if you have a component that you want created when your application starts up. In this case, use the += operator to specify that you want your component to be added to the list, instead of replacing the list.

When you use the Components window to modify properties, by default you edit the local configuration layer in the localconfig directory. You can change the configuration layer by selecting Open Component in Layer from the File menu of the Components window. The Components window does not allow you to change properties of Nucleus components in the Dynamo Base configuration layer.

 
loading table of contents...