The RefinementMenu
cartridge, which presents valid follow-on refinement queries to the shopper for a particular dimension, does not reference a StartEndDateValidator
component out of the box. A StartEndDateValidator
component verifies that a refinement dimension value has a valid start and end date in order to be displayed. An application module can include this type of verification by overriding the startEndDateValidator
property of the /atg/endeca/assembler/cartridge/handler/RefinementMenu
component, for example:
# Validate refinement dimension values by start/end date. startEndDateValidator=/atg/store/collections/validator/StartEndDateValidator
The StartEndDateValidator
component shown in this example is located in the Commerce Accelerator Base
module and contains the following configuration:
$class=atg.service.collections.validator.StartEndDateValidator currentDate=/atg/dynamo/service/CurrentDate startDatePropertyName=startDate endDatePropertyName=endDate
The RefinementMenu
component included in the B2CStore
also overrides the rangeFilterBuilders
and skuPropertyNames
properties to add the following application-specific SKU date range filtering:
# Endeca SKU DateRangeFilter list builder. rangeFilterBuilders=\ /atg/endeca/assembler/cartridge/manager/filter/\ RefinementMenuSkuDateRangeFilterBuilder # SKU dimension names that should use SKU range filters. This # ensures that when all of a product's SKUs contain invalid date(s), only # the SKU refinements will be affected. skuPropertyNames=\ clothing-sku.color,\ clothing-sku.size,\ furniture-sku.woodFinish
With this configuration, the StoreRefinementMenuHandler.preprocess()
method checks to see if the refinement menu dimension currently being processed is in the skuPropertyNames
list. If so, the method adds the RefinementMenuSkuDateRangeFilterBuilder
to the NavigationState
component’s FilterState
so that the dimension being processed is filtered by sku.startDate
and sku.endDate
.