Changing the display name for a business object

The Management Center framework uses the display name of a business object when that business object is shown in the Management Center user interface.For example, business object display names are used in tree node labels and properties view titles.

Procedure

  1. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
  2. Complete one of the following steps:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1In the Enterprise Explorer view, expand LOBTools > WebContent > WEB-INF > src > lzx > commerce > Management_Center_component > objectDefinitions, where Management_Center_component is the name of the tool you want to customize. The characteristics of business objects are defined in the wcfObjectDefinition class. The displayNameProperty and displayNameObjectPath attributes identify the business object property that the Management Center framework uses as the business object display name.
    • Introduced in Feature Pack 2In the Enterprise Explorer view, expand LOBTools > WebContent > config > commerce > Management_Center_component > objectDefinitions, where Management_Center_component is the name of the tool you want to customize. The characteristics of business objects are defined in the wcfObjectDefinition class. The displayNameProperty and displayNameObjectPath attributes identify the business object property that the Management Center framework uses as the business object display name.
  3. Update the displayNameProperty and displayNameObjectPath attributes to change the display name property that displays in tree nodes and properties view titles.
    For example, the default property that is used as the display name for Catalog categories is identifier. The following code snippet shows the default attribute settings for this display name property:
    WebSphere Commerce Version 7.0.0.0Feature Pack 1
    <class name="catBaseCatalogGroupPrimaryObjectDefinition" extends="wcfPrimaryObjectDefinition" 
    isBaseDefinition="true" 
    displayNameProperty="identifier" 
    ... 
    Introduced in Feature Pack 2
    <PrimaryObjectDefinition compatibleObjectTypes="SalesCatalogGroup"
    	definitionName="catBaseCatalogGroupPrimaryObjectDefinition" 		detailsViewHeaderText="${catalogResources.UtilityPaneHeaderText}"
    	displayName="${catalogResources.masterCategory_DisplayName}"
    	displayNameProperty="identifier"
    	…
    To change the display name from identifier to the name of the category, change the displayNameProperty attribute to name and set the displayNameObjectPath attribute to CatalogGroupDescription. The following code snippet shows the attribute settings for the displayNameObjectPath property:WebSphere Commerce Version 7.0.0.0Feature Pack 1
    <class name="catBaseCatalogGroupPrimaryObjectDefinition" extends="wcfPrimaryObjectDefinition" 
    isBaseDefinition="true" 
    displayNameProperty="name" 
    displayNameObjectPath="CatalogGroupDescription" 
    ... 
    Introduced in Feature Pack 2
    <PrimaryObjectDefinition compatibleObjectTypes="SalesCatalogGroup"
    	definitionName="catBaseCatalogGroupPrimaryObjectDefinition" 			detailsViewHeaderText="${catalogResources.UtilityPaneHeaderText}"
    	displayName="${catalogResources.masterCategory_DisplayName}"
    	displayNameProperty="name"
    	displayNameObjectPath="CatalogGroupDescription"
    	…
  4. Optional: Introduced in Feature Pack 2To change the display name that appears in the Utilities view for the business object:
    1. In the Enterprise Explorer view, expand LOBTools > WebContent > config > commerce > Catalog > listViewDefinitions. Right-click the CategorySearchGrid.def file and open the file for editing.
    2. Locate the following code in the file:
      <!--- 
           This definition displays the identification characteristics of a list of the {@link CatalogGroup} objects.  
           It is used in the utilities pane search tab. 
      --> 
      
      <ObjectGrid definitionName="catCategoryUtilitiesSearchGrid" preferenceKey="catCategoryUtilitiesSearchGrid"> 
        <GridIconTypeImage name="typeIcon" propertyName="null" required="true" text="${foundationResources.utilitiesGrid_type}" width="100"/> 
        <GridDisplayName name="displayName" propertyName="null" showLongDisplayName="true" text="${catalogResources.UtilityPaneHeaderText}" width="170"/> 
        <GridText name="categoryName" objectPath="CatalogGroupDescription" propertyName="name" text="${catalogResources.namePrompt}" visible="false" width="170"/> 
        <GridImage name="tImage" objectPath="CatalogGroupDescription" propertyName="tImage" sortable="false" text="${catalogResources.productThumbnail_ColumnHeader}" visible="false"/> 
      </ObjectGrid>
    3. Replace the line of code that specifies that the text displayed in the Utilities view for a business object is the display name of the business object, with code that specifies to use the value set for the property name as the text instead.
      For example, to set the display name as the identifier, Replace the following line of code
       <GridDisplayName name="displayName" propertyName="null" showLongDisplayName="true" text="${catalogResources.UtilityPaneHeaderText}" width="170"/>
      with the following line of code:
      <GridText name="displayName" propertyName="identifier" text="${catalogResources.UtilityPaneHeaderText}" width="170"/>  
    4. Save your changes and close the file.

What to do next

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