atg.projects.store.assembler.cartridge.handler
Class StoreRefinementMenuHandler

java.lang.Object
  extended by com.endeca.infront.cartridge.NavigationCartridgeHandler<com.endeca.infront.cartridge.RefinementMenuConfig,com.endeca.infront.cartridge.RefinementMenu>
      extended by com.endeca.infront.cartridge.RefinementMenuHandler
          extended by atg.commerce.endeca.assembler.cartridge.handler.CategoryMenuHandler
              extended by atg.projects.store.assembler.cartridge.handler.StoreRefinementMenuHandler
All Implemented Interfaces:
com.endeca.infront.assembler.CartridgeHandler<com.endeca.infront.cartridge.RefinementMenuConfig>

public class StoreRefinementMenuHandler
extends atg.commerce.endeca.assembler.cartridge.handler.CategoryMenuHandler

Extends RefinementMenuHandler to override preprocess method to use CategoryToDimensionAttributeAliasManager to get the source name for attribute alias. Process method is overridden to update unlocalized category names to localized ones.

Version:
$Id: //hosting-blueprint/B2CBlueprint/version/10.2.1/Endeca/Assembler/src/atg/projects/store/assembler/cartridge/handler/StoreRefinementMenuHandler.java#4 $$Change: 798401 $
Author:
Yekaterina Kostenevich

Field Summary
static java.lang.String CLASS_VERSION
          Class version string.
protected static java.lang.String DISPLAY_NAME_PROPERTY
           
protected static java.lang.String DISPLAY_NAME_PROPERTY_ALIAS
           
protected  com.endeca.infront.navigation.model.FilterState mNavigationFilterState
          This will hold the main navigation filter state when a temporary filter state is being used.
protected  StoreCartridgeTools mStoreCartridgeTools
           
 
Fields inherited from class atg.commerce.endeca.assembler.cartridge.handler.CategoryMenuHandler
sLogger
 
Constructor Summary
StoreRefinementMenuHandler()
           
 
Method Summary
protected  com.endeca.infront.cartridge.RefinementMenu filterCategoryFacetsByDate(com.endeca.infront.cartridge.RefinementMenu pCategoryRefinementMenu)
          Filter the category refinements by validating their start/end dates.
 java.lang.String findLocalizedLabel(java.util.Map<java.lang.String,java.lang.String> pProperties, java.lang.String pLabel, java.lang.String pDisplayNameProperty)
          Looks for localized label for refinements.
 atg.commerce.catalog.CatalogTools getCatalogTools()
           
 java.lang.String getCategoryIdPropertyName()
           
 atg.search.record.alias.AttributeAliasManager getLocaleAttributeAliasManager()
           
 atg.endeca.assembler.navigation.filter.RangeFilterBuilder[] getRangeFilterBuilders()
           
 java.util.List<java.lang.String> getSkuPropertyNames()
           
 StartEndDateValidator getStartEndDateValidator()
           
 StoreCartridgeTools getStoreCartridgeTools()
           
 void preprocess(com.endeca.infront.cartridge.RefinementMenuConfig pCartridgeConfig)
          Determine the source property name for aliased display name property before calling super.preprocess method.
 com.endeca.infront.cartridge.RefinementMenu process(com.endeca.infront.cartridge.RefinementMenuConfig pCartridgeConfig)
          Creates a new RefinementMenu with localized category labels.
 void setCatalogTools(atg.commerce.catalog.CatalogTools pCatalogTools)
           
 void setCategoryIdPropertyName(java.lang.String pCategoryIdPropertyName)
          Sets mCategoryDimensionName
 void setLocaleAttributeAliasManager(atg.search.record.alias.AttributeAliasManager pLocaleAttributeAliasManager)
           
 void setRangeFilterBuilders(atg.endeca.assembler.navigation.filter.RangeFilterBuilder[] pRangeFilterBuilders)
           
 void setSkuPropertyNames(java.util.List<java.lang.String> pSkuPropertyNames)
           
 void setStartEndDateValidator(StartEndDateValidator pStartEndDateValidator)
           
 void setStoreCartridgeTools(StoreCartridgeTools pStoreCartridgeTools)
           
protected  com.endeca.infront.cartridge.RefinementMenuConfig wrapConfig(com.endeca.infront.assembler.ContentItem pContentItem)
          Create a new StoreRefinementMenuConfig using the passed in ContentItem.
 
Methods inherited from class atg.commerce.endeca.assembler.cartridge.handler.CategoryMenuHandler
filterFacets, getCatalogFilterBuilder, getCatalogsPropertyName, getCategoryDimensionName, getSeparator, getSiteFilterBuilder, getSitesPropertyName, isRelevant, setCatalogFilterBuilder, setCatalogsPropertyName, setCategoryDimensionName, setSeparator, setSiteFilterBuilder, setSitesPropertyName
 
Methods inherited from class com.endeca.infront.cartridge.NavigationCartridgeHandler
createMdexRequest, dispatchNavigationEventInformation, executeMdexRequest, executeMdexRequest, getActionPathProvider, getContentItemInitializer, getMdexRequestBroker, getNavigationState, initialize, populateNavigationPathDefaults, setActionPathProvider, setContentItemInitializer, setMdexRequestBroker, setNavigationState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string.

See Also:
Constant Field Values

DISPLAY_NAME_PROPERTY

protected static final java.lang.String DISPLAY_NAME_PROPERTY
See Also:
Constant Field Values

DISPLAY_NAME_PROPERTY_ALIAS

protected static final java.lang.String DISPLAY_NAME_PROPERTY_ALIAS
See Also:
Constant Field Values

mNavigationFilterState

protected com.endeca.infront.navigation.model.FilterState mNavigationFilterState
This will hold the main navigation filter state when a temporary filter state is being used.


mStoreCartridgeTools

protected StoreCartridgeTools mStoreCartridgeTools
Constructor Detail

StoreRefinementMenuHandler

public StoreRefinementMenuHandler()
Method Detail

getLocaleAttributeAliasManager

public atg.search.record.alias.AttributeAliasManager getLocaleAttributeAliasManager()
Returns:
the Manager component used to determine the source property for the display name aliased property.

setLocaleAttributeAliasManager

public void setLocaleAttributeAliasManager(atg.search.record.alias.AttributeAliasManager pLocaleAttributeAliasManager)
Parameters:
pLocaledAttributeAliasManager - - The localeAttributeAliasResolver to set.

getCategoryIdPropertyName

public java.lang.String getCategoryIdPropertyName()

setCategoryIdPropertyName

public void setCategoryIdPropertyName(java.lang.String pCategoryIdPropertyName)
Sets mCategoryDimensionName


setSkuPropertyNames

public void setSkuPropertyNames(java.util.List<java.lang.String> pSkuPropertyNames)
Parameters:
pSkuPropertyNames - - List of SKU dimension property 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.

getSkuPropertyNames

public java.util.List<java.lang.String> getSkuPropertyNames()
Returns:
the list of SKU dimension property 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.

setStartEndDateValidator

public void setStartEndDateValidator(StartEndDateValidator pStartEndDateValidator)
Parameters:
pStartEndDateValidator - - The start/end date validator.

getStartEndDateValidator

public StartEndDateValidator getStartEndDateValidator()
Returns:
the start/end date validator.

setCatalogTools

public void setCatalogTools(atg.commerce.catalog.CatalogTools pCatalogTools)
Parameters:
pCatalogTools - - The catalog tools.

getCatalogTools

public atg.commerce.catalog.CatalogTools getCatalogTools()
Returns:
the catalog tools.

getRangeFilterBuilders

public atg.endeca.assembler.navigation.filter.RangeFilterBuilder[] getRangeFilterBuilders()
Returns:
an array of RangeFilterBuilders.

setRangeFilterBuilders

public void setRangeFilterBuilders(atg.endeca.assembler.navigation.filter.RangeFilterBuilder[] pRangeFilterBuilders)
Parameters:
pRangeFilterBuilders - - An array of RangeFilterBuilders. -

getStoreCartridgeTools

public StoreCartridgeTools getStoreCartridgeTools()
Returns:
the StoreCartridgeTools helper component.

setStoreCartridgeTools

public void setStoreCartridgeTools(StoreCartridgeTools pStoreCartridgeTools)
Parameters:
pStoreCartridgeTools - - the StoreCartridgeTools helper component.

wrapConfig

protected com.endeca.infront.cartridge.RefinementMenuConfig wrapConfig(com.endeca.infront.assembler.ContentItem pContentItem)
Create a new StoreRefinementMenuConfig using the passed in ContentItem.

Overrides:
wrapConfig in class com.endeca.infront.cartridge.RefinementMenuHandler
Parameters:
pContentItem - - The cartridge content item to be wrapped.
Returns:
a new RefinementMenu configuration.

preprocess

public void preprocess(com.endeca.infront.cartridge.RefinementMenuConfig pCartridgeConfig)
                throws com.endeca.infront.assembler.CartridgeHandlerException
Determine the source property name for aliased display name property before calling super.preprocess method.

Specified by:
preprocess in interface com.endeca.infront.assembler.CartridgeHandler<com.endeca.infront.cartridge.RefinementMenuConfig>
Overrides:
preprocess in class com.endeca.infront.cartridge.RefinementMenuHandler
Parameters:
pCartridgeConfig - - The RefinementMenu cartridge configuration.
Throws:
com.endeca.infront.assembler.CartridgeHandlerException - if an error occurs that is scoped to an individual cartridge instance. This exception will not halt the entire assembly process, which occurs across multiple cartridges; instead, this exception will be packaged in the overall response model. If an unchecked exception is thrown, then the entire assembly process will be halted.

process

public com.endeca.infront.cartridge.RefinementMenu process(com.endeca.infront.cartridge.RefinementMenuConfig pCartridgeConfig)
                                                    throws com.endeca.infront.assembler.CartridgeHandlerException
Creates a new RefinementMenu with localized category labels. Also ensures that menu only includes category refinements with valid start/end dates.

Specified by:
process in interface com.endeca.infront.assembler.CartridgeHandler<com.endeca.infront.cartridge.RefinementMenuConfig>
Overrides:
process in class atg.commerce.endeca.assembler.cartridge.handler.CategoryMenuHandler
Parameters:
pCartridgeConfig - - The cartridge configuration for the RefinementMenu.
Throws:
com.endeca.infront.assembler.CartridgeHandlerException - if an error occurs that is scoped to an individual cartridge instance. This exception will not halt the entire assembly process, which occurs across multiple cartridges; instead, this exception will be packaged in the overall response model. If an unchecked exception is thrown, then the entire assembly process will be halted.

filterCategoryFacetsByDate

protected com.endeca.infront.cartridge.RefinementMenu filterCategoryFacetsByDate(com.endeca.infront.cartridge.RefinementMenu pCategoryRefinementMenu)
                                                                          throws com.endeca.infront.assembler.CartridgeHandlerException
Filter the category refinements by validating their start/end dates. If a category refinement's start date is in the future or it's end date is in the past, it won't be included in the refinement menu.

Parameters:
pCategoryRefinementMenu - - The refinement menu consisting of category refinements.
Returns:
a RefinementMenu containing all of the category refinements that have valid start/end dates. If this handler's StartEndDateValidator is null, no start/end date validation will occur and the pCategoryRefinementMenu will just be returned.
Throws:
com.endeca.infront.assembler.CartridgeHandlerException

findLocalizedLabel

public java.lang.String findLocalizedLabel(java.util.Map<java.lang.String,java.lang.String> pProperties,
                                           java.lang.String pLabel,
                                           java.lang.String pDisplayNameProperty)
Looks for localized label for refinements.

Parameters:
pProperties - - The properties of current refinement.
pLabel - - The non-localized label of refinement.
pDisplayNameProperty - - The localized display name property.
Returns:
a localized label.