Service module configuration

Configuration data for BOD service modules is organized into base, and custom configuration. Configuration files are loaded before the service module can process service requests. The configuration class loader automatically discovers the configuration directories, by following certain naming conventions. Base (or bootstrap) configuration enables basic service module functionality. It contains the configuration data provided with the WebSphere Commerce service modules. We can also create custom configuration to add new functionality or customize existing functions. To change or extend this configuration, we must place you configuration in the workspace_dir\WC\xml\config\servicemodulename-ext\ directory with the configuration files named as the same as those we want to change or extend.

Note: Whether the configuration overwrites the default configuration or extends it depends on the function that uses that configuration.


Configuration file loading

When resolving configuration, custom configuration always takes precedence over base configuration. Depending on the load policy (extend versus override), the base configuration is either parsed or skipped. The load policy is specified in the parser class implementation. We can check whether the policy is overridable by calling the isOverridable() method.

For more complex configuration data structures, that cannot easily be represented as name-value pairs (for example, heavily structured, nested data), we can provide our own configuration file and configuration parser. This requires more work from the developer, but is completely flexible - any kind of configuration file can be read, parsed, and retrieved in your service module Java code. If we are writing our own configuration parser, must extend from the AbstractConfigurationImpl abstract class.

During development, you may want to modify and reload configuration, without having to restart the server. To enable volatile reloading for all service modules, create an empty .reloadconfig file in xml/config/com.ibm.commerce.foundation/. This will cause every service module to check the timestamps on its configuration files, each time it is called. Configuration files that have changed from the time that they were last loaded will get re-parsed. Also, if a configuration file was added or removed, all files in the same directory are reloaded. To enable volatile reloading for a particular service module, create an empty .reloadconfig file under the service module configuration directory . For example, xml/config/com.myco.myservicemodule. Volatile reloading will only be enabled for that service module.


Naming conventions

The configuration loader uses directory names to discover a service module's bootstrap and custom configurations.

In both cases above, servicemodulename represents the name of your service module or the WebSphere Commerce service module we are configuring. Configuration file names follow a strict naming convention – these names are used by the configuration loader.

Every service module contains the following files:

Note: The configuration files are guided by an XSD (XML Schema Definition). The XSD provides documentation describing the purpose of each configuration file. The XSD is located in the xml/config/xsd directory. By observing the XML file in an editor, we can use the XSD to determine the respective supported elements, as well as the annotation about the configuration.


Configuration files

The following configuration files are typically used for BOD-based services:

The following configuration files are typically used for SOI-based services: