Defining properties files and bundle keys for user interface text

Include text on the Management Center user interface, such as in the main work area (list, properties, or calendar views), search, explorer view, menu, message, and help text.

Rather than hard-coding user interface text in the OpenLaszlo class files or definition files, include all text in resource properties files, and associate the files with resource keys. This way, you maintain the user interface code in one area (the OpenLaszlo fileIntroduced in Feature Pack 2 or definition file) and the text in another (properties file). This is particularly useful if you have text that will change often, or if you support globalization in your coding (that is, support translating the user interface text to various languages).

Before you begin

Before defining resource bundles, see wcfResourceBundle.


  1. Navigate to this directory: WCDE_installdir\LOBTools\src\com\your_company_name\Management_Center_component\client\lobtools\properties.
  2. Create a properties file using any text editor. The file name should have a .properties extension and you should create one for each language, if you will have text in multiple languages (for example for English text, and for French text).
    Within this file, list all the user interface text and associate a unique key for each string of text. For example, to include three tabs (called A, B, and C), on a the properties view for an object, include something similar to this:
  3. Create a resource bundle to associate with the keys:
    1. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
    2. In the Enterprise Explorer view, expand LOBTools > WebContent > WEB-INF > src > lzx > your_company_name > Management_Center_component, where Management_Center_component is the name of your new custom tool.
    3. Create an OpenLaszlo library file with this syntax: Management_Center_componentResourceBundle.lzx. For example, MyCompanyResourceBundle. This file must be added to the apprpriate extensions library file. Examples include, MarketingExtensionsLibrary.lzx and FoundationsExtensionsLibrary.lzx
    4. Within the resource bundle library file, define a class that extends wcfResourceBundle. It is recommended that the class name follow this naming convention: three-character Management Center component code in lower caseResourceBundle. For example, extMyToolResourceBundle. When you create new OpenLaszlo classes, it is recommended that you prefix the class names with ext so that they are clearly identified as extensions.
      Specify the resource bundle base name and define an instance of lzx/commerce/foundation/restricted/ResourceBundle.lzx/wcfResourceBundleKey for every key in the properties file. Create in the same path used in step 1. Instantiate the resource bundle class and specify a unique identifier that can be used to refer to the resource bundle. For example:
      <class name="extMyResourceBundle" extends="wcfResourceBundle"
        <wcfResourceBundleKey name="keyA"/> 
        <wcfResourceBundleKey name="keyB"/> 
        <wcfResourceBundleKey name="keyC"/> 
      <extMyResourceBundle id="myResources"/> 
      The name of the resource bundle class.
      The id used to reference the resource class in the object definition. For example, displayName="${myResources. ... }".
  4. Update your Management Center tool definitions to use the resource bundle keys. The following example demonstrates the declaration of an object definition display name that retrieves the text from a resource bundle:
    WebSphere Commerce Version Pack 1
    <class name="extMyObjectDefinition" extends="wcfPrimaryObjectDefinition"
    Introduced in Feature Pack 2
    <PrimaryObjectDefinition definitionName="MyObjectDefinition"

What to do next

After you complete your work:
  1. Right-click LOBTools Project; then click Build OpenLaszlo Project to produce an updated ManagementCenter.swf file under the WCDE_installdir\workspace\LOBTools\WebContent directory. This setting is the default environment setting.
  2. Test your work by viewing them in the Management Center, using this URL: https://hostname:8000/lobtools.
  3. Deploy your files to your production environment.