Each collection filtering class relies on the base abstract class atg.service.collections.filter.CachedCollectionFilter for the ability to filter collections. This class is designed to receive a collection, remove items from the collection, and create a result set. It’s possible to pass a Profile to this class so that subclasses can use Profile property values as filter conditions. This class is also capable of caching the filtered resultant collection.

When you want to filter objects in a collection, you use a subclass of CachedCollectionFilter. ATG 2007.3 comes with a subclass called StartEndDateFilter that limits a collection by removing objects that are inactive. You can find an instance of it in /atg/registry/CollectionFilters/StartEndDateFilter and a servlet bean for accessing it from a JSP in /atg/collections/filter/droplet/StartEndDateFilterDroplet.

A second subclass called ChainedFilter lets you chain several filters together so the resultant collection contains items that meet the conditions of all filters in the chain. There are no sample components in ATG Relationship Management, but ATG Commerce includes a sample filtering component and servlet bean. See the Filtering Collections of Products chapter of the ATG Commerce Guide to Setting Up a Store for details about this and other components of CachedCollectionFilter.

loading table of contents...