The ATG platform includes a filtering class, atg.service.collections.filter.ValidatorFilter, that is used to filter a collection of repository items. Components of this class, which is a subclass of atg.service.collections.filter.CachedCollectionFilter, can be passed to a servlet bean to execute the filtering operation.

In addition, Commerce Reference Store includes the atg.projects.store.collections.filter.ItemValidatorFilter class, which is a subclass of ValidatorFilter that also implements the atg.service.filter.ItemFilter interface. Components of this class can be passed to a servlet bean to filter items returned for slots.

Commerce Reference Store uses these classes to filter products, promotional items, and other repository items based on various criteria, such as site groups and start and end dates. These classes have a validators property that can be set to an array of components of classes that implement the atg.service.collections.validator.CollectionObjectValidator interface. The validator components evaluate items such as promotions and catalog items to determine if they are valid for inclusion on sites.

For example, a ValidatorFilter component, /atg/store/collections/filter/PromotionFilter, is used by the /atg/store/droplet/PromotionFilterDroplet (of class atg.projects.store.droplet.PromotionFilterDroplet) to filter promotions. The PromotionFilter component’s validators property is set to an array of components of classes that implement the atg.service.collections.validator.CollectionObjectValidator interface. The PromotionFilter.validators property is set to:

validators=\
/atg/store/collections/validator/PromotionSiteValidator,\
/atg/store/collections/validator/PromotionDateValidator

PromotionSiteValidator determines whether a promotion is valid based on whether the site it is associated with is in the same cart sharing group as the current site. PromotionDateValidator determines whether a promotion is valid based on the whether the current date is between the start date and end date for the promotion. (See the Promotionschapter for more information about these components.) In order for a promotion to be validated, it must be considered valid by all components listed in the validators property.

In addition to ValidationFilter and ItemValidationFilter, a number of other Commerce Reference Store classes can be configured to use validators. For example, the atg.projects.store.catalog.CatalogNavigationService class has a validators property that lists components for evaluating which categories to include.

On pages that return results from the Endeca MDEX, Endeca range filters are used to filter out items with invalid start and end dates. See the Range Filtering section of the Using Cartridges chapter for more information.


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