Dividing the Configuration File

The curam-config.xml file can be divided into manageable chunks. If you like, you can take one part of the configuration and save it in a file with a different name. Taking the previous address format configuration as an example, you can create a file with the following contents:

Figure 1. Sample address-config.xml File
<APP_CONFIG>
  <ADDRESS_CONFIG>
    <LOCALE_MAPPING LOCALE="en_US"
                       ADDRESS_FORMAT_NAME="US">
    <ADDRESS_FORMAT NAME="US" COUNTRY_CODE="US">
      <ADDRESS_ELEMENT NAME="ADD1"
                          LABEL="Custom.Label.Address.1"
                          MANDATORY="true"/>
      <ADDRESS_ELEMENT NAME="ADD2"
                    LABEL="Custom.Label.Address.2" />
      <ADDRESS_ELEMENT NAME="CITY"
                    LABEL="Custom.Label.City" />
      <ADDRESS_ELEMENT NAME="STATE"
                    LABEL="Custom.Label.State"
                    CODETABLE="AddressState"
                    MANDATORY="true"/>
      <ADDRESS_ELEMENT NAME="ZIP"
                    LABEL="Custom.Label.Zip" />
    </ADDRESS_FORMAT>
  </ADDRESS_CONFIG>
</APP_CONFIG>

You would then save this with a file name that ends with -config.xml anywhere within your component, say, address-config.xml. Note that the file must have the same APP_CONFIG root element as the full curam-config.xml file. As long as you follow these conventions, all of your configuration files will be merged into a single address-config.xml file at build time.

Configuration File Names: Two naming patterns are used for most configuration files. Some use the pattern XConfig.xml and others X-config.xml, where "X" is some prefix. For example, ImageMapConfig.xml and address-config.xml. The former pattern indicates a standalone configuration file that is not related to other configuration files. The latter pattern indicates that the file is really just part of the curam-config.xml file.