Adding language-sensitive properties in the Catalogs tool

In this lesson, you add language-sensitive care instructions as an editible property for products in the Catalogs tool. After you complete the following steps, this property displays on the warranty tab that you created in a previous lesson.

Procedure

  1. In the Enterprise Explorer view, expand LOBTools > WebContent > WEB-INF > src > xml > commerce > catalog > propertiesViews
  2. Open the CatalogPropertyPane.xml file for editing.
  3. Locate the following code, which defines the warranty tab pane content that you defined in a previous lesson.
    
    <PropertyPane definitionName="cmc/catalog/WarrantyPane">
      <dependency localName="ExtCatalogResources" moduleName="cmc/catalog/ExtCatalogResources"/>
      <PropertyGroup groupTitle="${ExtCatalogResources.productWarranty_GroupTitleForWarranty}" open="true">
        <PropertyCombobox promptText="${ExtCatalogResources.productWarranty_WarrantyTermPrompt}" propertyName="x_warterm" width="200"/>
        <PropertyCombobox promptText="${ExtCatalogResources.productWarranty_WarrantyTypePrompt}" propertyName="x_wartype" width="200"/>
      </PropertyGroup>
    </PropertyPane>
    
  4. Add the following property group and property input text definitions for the language-sensitive care instruction property within the warranty property pane definition.
    This new code creates a multiple line text editor to contain care instruction information. By default, the values that are stored in the XCAREINSTRUCTION table display in this text editor. The text is editable and any changes that a user makes to the text persist to the database.
       
    <PropertyGroup groupTitle="${ExtCatalogResources.productWarranty_GroupTitleForOthers}" name="CareInstrID" open="true">
      <PropertyInputMultiLineText objectPath="CatalogEntryDescription" promptText="${ExtCatalogResources.productWarranty_OtherPrompt}" 
       propertyName="xdesc_careinstruction"/>
    </PropertyGroup>
    
    Where:
    objectPath
    The relative path from from the current object to a child object. If the property that is being defined applies to the current object, you do not need to specify an objectPath attribute. In this example, the care instruction applies to the CatalogEntryDescription object, so the attribute must be specified.

    To enable the data service layer to populate data within the CatalogEntryDescription noun attribute element, the XCAREINSTRUCTION table has a foreign key to the CATENTDESC table. For more information, see Customizing the WebSphere Commerce schema.

    propertyName
    The property name for the care instruction attribute, such as "xdesc_careinstruction". The property name is defined when you customize the persistence layer and business object manager.
    • x represents the UserData that is found at the root of the object.
    • xdesc_ represents the UserData that is part of changeable attribute part.
    • careinstruction is the value for the logical property name in the wc-business-object-mediator file.
    Your updated warranty property pane definition can resemble the following code snippet.
    
    <PropertyPane definitionName="cmc/catalog/WarrantyPane">
      <dependency localName="ExtCatalogResources" moduleName="cmc/catalog/ExtCatalogResources"/>
      <PropertyGroup groupTitle="${ExtCatalogResources.productWarranty_GroupTitleForWarranty}" open="true">
        <PropertyCombobox promptText="${ExtCatalogResources.productWarranty_WarrantyTermPrompt}" propertyName="x_warterm" width="200"/>
        <PropertyCombobox promptText="${ExtCatalogResources.productWarranty_WarrantyTypePrompt}" propertyName="x_wartype" width="200"/>
      </PropertyGroup>
      <PropertyGroup groupTitle="${ExtCatalogResources.productWarranty_GroupTitleForOthers}" name="CareInstrID" open="true">
        <PropertyInputMultiLineText objectPath="CatalogEntryDescription" promptText="${ExtCatalogResources.productWarranty_OtherPrompt}" 
         propertyName="xdesc_careinstruction"/>
      </PropertyGroup>
    </PropertyPane>
    
  5. Save and close the file.