Develop > Controller layer > Application developer > Support globalization > Globalized catalog content > Globalized tools framework


Address and name formatting in the tools

Address and name formatting in the WebSphere Commerce tools uses XML files to encapsulate the address or name format control information. The XML files contain address or name control information such as what fields are required, the number of lines that constitute an address or name format, the sequence and nature of address or name attributes that must display on one line, and so on.

The following is a high-level description of the address or name format approach that WebSphere Commerce tools follows:


Procedure

  1. Create an XML file to hold the address format information. For example:

    <de_DE>
    <line0 elements="nickName"/>
    <line1 elements="title,space,firstName,space,lastName"/>
    <line2 elements="address1,space,address2,space,address3"/>
    <line3 elements="postalCode,space,city"/>
    <line4 elements="region,comma,space,country"/>
    <line5 elements="phoneNumber"/>
    </de_DE>
    

    For a sample implementation, refer to:

    • WC_INSTALL/xml/tools/order/addressFormats.xml

    • WC_USER/xml/tools/order/addressFormats.xml

    • WC_INSTALL\xml\tools\order\addressFormats.xml

    • workspace_dir\wc\xml\tools\order\addressFormats.xml

  2. Use the tools framework XMLUtil.get(Hashtable tree, String path) to parse the XML file. This method is one of the utility classes to read and write XML files and strings contained in the tools framework. When reading XML files and strings, these parsers turn the XML data into a hashtable.

  3. Use the address format control information stored in the hashtable created in the previous step, to display the formatted address attributes to the end user as shown in the following example: WC_EAR\CommerceAccelerator.war\tools\order\OrderBillingAddressPage.jsp.


Related concepts

Globalized tools framework

Cultural considerations

Localized store assets


Related tasks

Create a globalized store

Create a new display format

Name and address formatting

Related reference

Globalization tips

massload utility (Server environment)


+

Search Tips   |   Advanced Search