Introduced in Feature Pack 2

Customizing the Business Object Mediator to include custom data

Introduced in Feature Pack 2 In this lesson, the Business Object Mediator is modified to map the new columns to the user data field of the CatalogEntryView noun. As a result, the search results in the Madisons starter store include the newly added external ratings data.

About this task

Procedure

  1. Navigate to the com.ibm.commerce.catalog-ext directory. You must create this directory if it does not already exist.
    • WC/xml/config/com.ibm.commerce.catalog-ext
  2. Open the wc-business-object-mediator.xml file. You must create this file if it does not already exist.

    For an example of BOM configuration changes, see the tutorial: Adding new properties to a WebSphere Commerce service using the data service layer.

  3. Add the following mapping in bold:
    
    <_config:object logicalType="com.ibm.commerce.catalog.facade.datatypes.CatalogNavigationViewType"
    physicalType="com.ibm.commerce.catalog.facade.server.services.search.metadata.solr.SolrCatalogNavigationViewImpl">
    <_config:mediator interfaceName="com.ibm.commerce.foundation.server.services.dataaccess.bom.mediator.ReadBusinessObjectMediator"
    className="com.ibm.commerce.catalog.facade.server.services.dataaccess.bom.mediator.solr.SolrReadCatalogNavigationViewMediator">
    <_config:mediator-properties>
    
    <_config:mediator-property name="CatalogEntryView/UserData[(Name='Rating')]" value="customerRanking_display" />
    
    </_config:mediator-properties>
    
    </_config:mediator>
    </_config:object>
    
    Note: The property value is configured to be customerRanking_display as a tfloat for computation purposes.
  4. Save your changes and close the file.

Results