Catalog filter customization: Customizing matching rules

You can configure the matching rules for catalog filter conditions. Matching rules connect the data types of the catalog entry properties, or attribute dictionary attributes using String, Integer and Float data types. With customization you can additional matching rules.


This example procedure outlines the high-level steps to create a matching rule, contains. The conditions are based on attributes and properties using the String type, the matches are partial.
  1. Define the matching rule in the Management Center user interface:
    • LOBTools\WebContent\config\commerce\price\objectDefinitions\CatalogFilterAttributeReferenceObjectDefinition.def
    • LOBTools\WebContent\config\commerce\price\objectDefinitions\CatalogFilterCatentPropertyChildObjectDefinition.def

    In these files, find the <wcfPropertyDefinition propertyName="operator"> .

    Append the following code.

    <wcfPropertyDefinition propertyName="operator" displayName="${cftCatalogFilterResources.catalogFilterAttributeOperator}" required="true">
    	// This matching rule only applied to String type property or attribute
    	<PropertyValue displayName="${extCatalogFilterResources.catalogFilterOperatorStringContains}" value="STRING_CONTAINS">
    			<EnablementCondition conditionId="stringCondition" enablementValue="String" propertyName="attrType" />
    </ wcfPropertyDefinition>
  2. Customize the runtime code to support the new matching rule. The catalog filter runtime code builds a search expression based a catalog filter the condition is composed in this expression. Build a search engine specific expression snippet for the new matching rule.
    In summary:
    1. Create a class such as com.mycompany.catalogfilter.GetContainsStringExpressionCmdImpl that implements the interface and extends from
    2. Implement the logic for building your "contains" condition expression within performExecute method. The caller calls method setCondition to condition information including the attribute or property field name, the matching rule and values in a data object of type Provide the output to the caller in the method getExpression (the format is whose format is search engine specific).
    3. Using the following SQL statement as a guide, register the class implementation in the command registry:
      values(0, '', NULL, 'com.mycompany.catalogfilter.GetContainsStringExpressionCmdImpl', NULL, NULL, 'Local', NULL);