Addresses

The ADDRESS_DATA domain type maps to a tag for entering and displaying addresses. Although the user sees several fields, addresses are stored as a single string field. Each of the fields displayed as part of the out-of-the-box address are text input fields except for the state field which is drop-down field.

To parse the address and display it, the elements that make up the address have to be defined in the curam-config.xml file. Different address configurations for different locales in the Cúram application can be defined. Addresses demonstrates how to set this configuration using the ADDRESS_CONFIG element.

Figure 1. Address Configuration in curam config xml
<ADDRESS_CONFIG>
  <LOCALE_MAPPING LOCALE="en_US"
          ADDRESS_FORMAT_NAME="US"/>
  <LOCALE_MAPPING LOCALE="en_GB"
          ADDRESS_FORMAT_NAME="UK"/>
  <ADDRESS_FORMAT NAME="US" COUNTRY_CODE="US">
    <ADDRESS_ELEMENT LABEL="Address.Label.AptSuite"
                     NAME="ADD1"/>
    <ADDRESS_ELEMENT LABEL="Address.Label.Street.1"
                     NAME="ADD2"/>
    <ADDRESS_ELEMENT LABEL="Address.Label.Street.2"
                     NAME="ADD3"/>
    <ADDRESS_ELEMENT LABEL="Address.Label.City"
                     NAME="CITY"/>
    <ADDRESS_ELEMENT CODETABLE="AddressState"
                     LABEL="Address.Label.State"
                     NAME="STATE"/>
    <ADDRESS_ELEMENT LABEL="Address.Label.Zip"
                     NAME="ZIP"/>
  </ADDRESS_FORMAT>

  <ADDRESS_FORMAT NAME="UK" COUNTRY_CODE="GBR">
    <ADDRESS_ELEMENT LABEL="Address.Label.Address.1"
                     MANDATORY="true" NAME="ADD1"/>
    <ADDRESS_ELEMENT LABEL="Address.Label.Address.2"
                     NAME="ADD2"/>
    <ADDRESS_ELEMENT LABEL="Address.Label.Address.3"
                     NAME="ADD3"/>
    <ADDRESS_ELEMENT LABEL="Address.Label.Address.4"
                     NAME="ADD4"/>
    <ADDRESS_ELEMENT LABEL="Address.Label.County"
                     NAME="ADD5"/>
    <ADDRESS_ELEMENT LABEL="Address.Label.City"
                     NAME="CITY"/>
    <ADDRESS_ELEMENT LABEL="Address.Label.PostCode"
                     NAME="POSTCODE"/>
    <ADDRESS_ELEMENT CODETABLE="Country"
                     LABEL="Address.Label.Country"
                     NAME="COUNTRY"/>
  </ADDRESS_FORMAT>
</ADDRESS_CONFIG>

The ADDRESS_CONFIG element is built using multiple LOCALE_MAPPING and ADDRESS_FORMAT elements. In Cúram application deployments with multiple locales, a developer may wish to use a different address format for each locale. To do this we use the LOCALE_MAPPING element. This element contains a LOCALE attribute which defines the locale and an ADDRESS_FORMAT_NAME attribute which defines the ADDRESS_FORMAT element to be mapped. By default, the OOTB Cúram application has a number of ADDRESS_FORMAT elements defined which are mapped to specific locales. As these locales are already mapped it is not required to define LOCALE_MAPPING elements for them, however customers are free to modify these or create new configuration(s) as per their implementation needs. Figure 76 above illustrates how the LOCALE_MAPPING element is used for the US and UK address formats. The following address formats and their corresponding locale mappings are available OOTB.

Table 1. Address Format configurations

Address Format Name

Locale Mapping

US

en_US

UK

en_GB

DE

de

CA

en_CA

KR

ko

JP

ja

TW

zh_TW

CN

zh_CN

The ADDRESS_FORMAT has an optional COUNTRY_CODE attribute which is used in the address header when an address is first created. If it is not set, the COUNTRY_CODE defaults to GBR when the address format specified is UK and to US for everything else. The COUNTRY_CODE is not used by the infrastructure. It is one of the fields in the address string used by the application, but infrastructure provides an initial value for it.

The ADDRESS_FORMAT elements contain ADDRESS_ELEMENT elements which defines the fields in the address tag. The ADDRESS_ELEMENT element has a LABEL attribute which refers to properties contained in the CDEJResources.properties file. The address is then built using ADDRESS_ELEMENT tags which must be given a name and label. Note that a code table can also be specified for each ADDRESS_ELEMENT. When a code table is specified, a drop-down list will display the code table entries and the default code will be pre-selected.

The optional MANDATORY attribute specifies if an address element is required to be filled in. The Mandatory indicator is an asterisk beside the field label as shown in the example above. Please note, that in order for MANDATORY settings in curam-config.xml to work, the field supplying the address data should be marked mandatory in application model.