Defining user interface text in Management Center

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. You can customize the messages and labels that display in Management Center to make the text that display more appropriate for your own business users.

Include all message text, such as error messages, in resource properties files, which associate the files with resource keys instead of hardcoding user interface text in definition files. This way, you maintain your user interface code in definition files and your user interface text in properties file. Message definitions then include a resource key to identify the resource bundle definition that identifies the properties file that includes the approprate message text to use. By including all of your user interface text in properties files, you can make it easier to later update or replace text and to translate text.

Procedure

  1. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
  2. Expand LOBTools > Java Resources > src
  3. Create an extension package to extend the appropriate com.ibm.commerce.component.client.lobtools.properties package, where component is the name of the Management Center component. Name your extension package com.mycompany.commerce.component.client.lobtools.properties, where mycompany is the name of your company.
  4. Within your custom com.mycompany.commerce.component.client.lobtools.properties package, create a properties file. Name the file with the same name as the properties file that includes the text for the messages that you want to change. The file name should have a .properties file extension. Create separate properties files for each language that your site needs to support.
    • The properties files that are named with the format ComponentLOB_locale.properties include the list of keys and text for all user interface elements within the Management Center tool for that component in the specified language.
    • The files that are named with the format ComponentLOBErrorMessages_locale.properties include the list of keys and text for all error messages that display in Management Center for the component in the specified language.
  5. If you are adding text for a new message, open your new file for editing and add the ext for your new messages into the file. Associate the text with a unique key in the format key=value. Include the key name in the definition for the message, which you must define within a definition file, to indicate the text to use.
    For example, the following key and text value combination sets the text for an error message in the Catalogs tool.
    CatalogGroup._ERR_DULPLICATE_IDENTIFIER_FOR_CHANGE=The specified code already exists. Type in a new code.
  6. If you are changing or replacing the text for existing messages, copy the existing key and text combination into your new properties file and then edit the text.
    1. Expand LOBTools > Java Resources > src > com.ibm.commerce.component.client.lobtools.properties, where component is the name of the Management Center component.
    2. Open and review the properties file that contains the text that you want to change. Do not edit this properties file.
    3. Within the properties files that you are reviewing, identify and copy the key-text combination that you want to change.
    4. Open your new properties file for editing, and paste the key-text name combination that you copied into your new file. Edit the key-text combination to set your preferred text.
  7. Create a resource bundle to define the resource bundle definition for identifying the properties file. Include the definition name in your message definitions to indicate the properties files that include the text for the messages.
    1. Expand LOBTools > WebContent > WEB-INF > src > xml > mycompany > component
      If the mycompany directory does not exist, you must create this extension directory to include your custom resource bundle files.
    2. Create a resource bundle file to define the association to the appropriate properties files. Use the format componentResourceBundle.xml to name your file.
      For example, CatalogManagementResourceBundle.xml is the resource bundle file for the catalog component.
    3. Open your new file for editing and include the definition for the resource bundle definition that identifies the properties file to use.
      For example, the following definition, defines the properties file for the catalog component properties files
      
      <Definitions>
        <ResourceBundle baseName="com.mycompany.commerce.catalog.client.lobtools.properties.CatalogLOB" 
         definitionName="cmc/catalog/CatalogResources" singletonDefinition="true"/>
      </Definitions>
  8. Add the dependency for your custom resource bundle to any definition file that includes definitions that reference the properties in any of your custom properties files.
    1. Open the definition file or files that requires the dependency to be added.
    2. Add the dependency for your resource bundle in the format <dependency localName="" moduleName=""/>.
      For example, the following code snippet shows the addition of a dependency into an object definitions file for a resource bundle that is named "CatalogManagementResourceBundle.xml" resource bundle.
      
      <Definitions>
        <ObjectProperties definitionName="cmc/catalog/ProductProperties">
          <dependency localName="foundationResources" moduleName="cmc/foundation/FoundationResources"/>
          <dependency localName="catalogResources" moduleName="cmc/catalog/CatalogResources"/>
          <dependency localName="CatalogManagementResourceBundle" moduleName="cmc/catalog/CatalogManagementResourceBundle"/>
          <!-- This is the set of tabs to display on the Product properties view -->
          <PropertyTabs name="tabs">
          ...
          </PropertyTabs>
        </ObjectProperties>
      </Definitions>
  9. Save and publish your changes.