In some cases, you may want to output the values of a property for some repository items of a certain type but not for others of that type. For example, you may want to output the value of the longDescription property of most product items, but omit this property for a few specific product items.

The Oracle Commerce Platform includes an interface, atg.repository.search.indexing.IndexingPropertyFilter, for filtering properties of specific repository items. This interface defines a single method:

filterOutputProperties(RepositoryItem pItem,
  OutputProperty[] pOutputProperties)

This method is used to implement the logic that determines which property values to exclude from output records.

The Oracle Commerce Platform also includes a class that implements this interface, atg.repository.search.indexing.filter.GSAPropertyFilter. This class has two properties that are used to specify the property values to exclude:

Commerce Reference Store includes a component of this class, /atg/commerce/endeca/index/GSAPropertyFilter, that is configured as follows:

idToType=rootCategory=category,\
         homeStoreRootCategory=category
propsToFilter=allAncestors.displayName

To apply a GSAPropertyFilter component to an item type, you use the filter attribute of the item element in the EndecaIndexingOutputConfig definition file. For example, Commerce Reference Store adds this attribute to the ancestorCategories item specification in the definition file of the ProductCatalogOutputConfig component:

<item is-multi="true" property-name="ancestorCategories"
  filter="/atg/commerce/endeca/index/GSAPropertyFilter">

The filterOutputProperties() method of the GSAPropertyFilter class examines the idToType property to see which repository items to filter. In Commerce Reference Store, the property is configured so that filtering is done for the category items whose IDs are rootCategory and homeStoreRootCategory. It then uses the value of the component’s propsToFilter property to determine which properties to exclude the values of. propsToFilter is set to allAncestors.displayName, so the value of this property is not output for the rootCategory and homeStoreRootCategory categories. (This is done to address a problem in Commerce Reference Store where searching for “root” would return every product in the catalog repository, because that word appears in the value of the displayName property of both items, and every product has one of these categories as an ancestor category.)

You can create other components of class GSAPropertyFilter and configure the idToType and propsToFilter properties to filter different item types and properties, or you can implement different filtering logic by writing your own class that implements the IndexingPropertyFilter interface.


Copyright © 1997, 2017 Oracle and/or its affiliates. All rights reserved. Legal Notices