atg.projects.store.assembler.navigation
Class StoreNavigationStateProcessor

java.lang.Object
  extended by atg.projects.store.assembler.navigation.StoreNavigationStateProcessor
All Implemented Interfaces:
atg.endeca.assembler.navigation.NavigationStateProcessor
Direct Known Subclasses:
StorePreviewNavigationStateProcessor

public class StoreNavigationStateProcessor
extends java.lang.Object
implements atg.endeca.assembler.navigation.NavigationStateProcessor

The navigation state is processed to determine if it represents a user catalog navigation and if so, a user segment is added to the user state object. This user segment is used within Experience Manager to route the user to the search results page or category page accordingly.

Version:
$Id: //hosting-blueprint/B2CBlueprint/version/10.2.1/Endeca/Assembler/src/atg/projects/store/assembler/navigation/StoreNavigationStateProcessor.java#4 $$Change: 803210 $
Author:
ckearney

Field Summary
static java.lang.String CLASS_VERSION
          Class version string.
protected  StoreCatalogTools mCatalogTools
           
protected  java.util.List<java.lang.String> mIgnoredRangeFilters
           
 
Constructor Summary
StoreNavigationStateProcessor()
           
 
Method Summary
protected  void addCatalogUserState(com.endeca.infront.navigation.NavigationState pNavigationState)
           Add the CategoryNavigation user segment.
 CatalogNavigationService getCatalogNavigation()
           
 StoreCatalogTools getCatalogTools()
           
protected  atg.repository.RepositoryItem getCategory(java.lang.String pCategoryId)
          Get category by its id
 atg.commerce.endeca.cache.DimensionValueCacheTools getDimensionValueCacheTools()
           
 java.util.List<java.lang.String> getIgnoredRangeFilters()
           
 java.lang.String getUserSegment()
           
 com.endeca.infront.navigation.UserState getUserState()
           
protected  boolean isCategoryOnCurentSite(java.lang.String pRepositoryId)
          Retrieves category item using its repository id and checks whether the category belongs to current site.
 void process(com.endeca.infront.navigation.NavigationState pNavigationState)
          Process the navigation state to determine if it represents a user catalog navigation and update the details on the catalog navigation tracking component and set the user segment on the user state for routing the user to the category page.
 void setCatalogNavigation(CatalogNavigationService pCatalogNavigationService)
           
 void setCatalogTools(StoreCatalogTools pCatalogTools)
           
 void setDimensionValueCacheTools(atg.commerce.endeca.cache.DimensionValueCacheTools pDimensionValueCacheTools)
           
 void setIgnoredRangeFilters(java.util.List<java.lang.String> pIgnoredRangeFilters)
           
 void setUserSegment(java.lang.String pUserSegment)
           
 void setUserState(com.endeca.infront.navigation.UserState pUserState)
           
protected  void updateCatalogNavigation(java.lang.String pCategoryId, java.util.List<java.lang.String> pAncestors)
          Update the catalog navigation component.
 
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

mIgnoredRangeFilters

protected java.util.List<java.lang.String> mIgnoredRangeFilters

mCatalogTools

protected StoreCatalogTools mCatalogTools
Constructor Detail

StoreNavigationStateProcessor

public StoreNavigationStateProcessor()
Method Detail

setUserSegment

public void setUserSegment(java.lang.String pUserSegment)
Parameters:
pUserSegment - - The user segment to set on the user state and used within Experience Manager to control routing the user to the category page instead of the search results page.

getUserSegment

public java.lang.String getUserSegment()
Returns:
the user segment to set on the user state and used within Experience Manager to control routing the user to the category page instead of the search results page.

setUserState

public void setUserState(com.endeca.infront.navigation.UserState pUserState)
Parameters:
pUserState - - The userState object used to hold the user segment for use within Experience Manager to control routing the user to the category page instead of the search results page.

getUserState

public com.endeca.infront.navigation.UserState getUserState()
Returns:
the userState object used to hold the user segment for use within Experience Manager to control routing the user to the category page instead of the search results page.

setDimensionValueCacheTools

public void setDimensionValueCacheTools(atg.commerce.endeca.cache.DimensionValueCacheTools pDimensionValueCacheTools)
Parameters:
pDimensionValueCacheTools - - The utility class for access to the ATG<->Endeca catalog cache.

getDimensionValueCacheTools

public atg.commerce.endeca.cache.DimensionValueCacheTools getDimensionValueCacheTools()
Returns:
the utility class for access to the ATG<->Endeca catalog cache.

setCatalogNavigation

public void setCatalogNavigation(CatalogNavigationService pCatalogNavigationService)
Parameters:
pCatalogNavigationService - - The component used to track users catalog navigation.

getCatalogNavigation

public CatalogNavigationService getCatalogNavigation()
Returns:
the component used to track users catalog navigation.

setIgnoredRangeFilters

public void setIgnoredRangeFilters(java.util.List<java.lang.String> pIgnoredRangeFilters)
Parameters:
pIgnoredRangeFilters - - The range filters to ignore when determining whether to add the CatalogNavigation user segment or not.

getIgnoredRangeFilters

public java.util.List<java.lang.String> getIgnoredRangeFilters()
Returns:
the range filters to ignore when determining whether to add the CatalogNavigation user segment or not.

setCatalogTools

public void setCatalogTools(StoreCatalogTools pCatalogTools)
Parameters:
pCatalogTools - - The CatalogTools object to use when looking up products, categories and skus.

getCatalogTools

public StoreCatalogTools getCatalogTools()
Returns:
the CatalogTools object to use when looking up products, categories and skus.

process

public void process(com.endeca.infront.navigation.NavigationState pNavigationState)
Process the navigation state to determine if it represents a user catalog navigation and update the details on the catalog navigation tracking component and set the user segment on the user state for routing the user to the category page.

Specified by:
process in interface atg.endeca.assembler.navigation.NavigationStateProcessor

isCategoryOnCurentSite

protected boolean isCategoryOnCurentSite(java.lang.String pRepositoryId)
Retrieves category item using its repository id and checks whether the category belongs to current site.

Parameters:
pRepositoryId - the category repository id
Returns:
true is category if on current site. False otherwise.

getCategory

protected atg.repository.RepositoryItem getCategory(java.lang.String pCategoryId)
Get category by its id

Parameters:
pCategoryId - the category to retrive
Returns:
category repository item

updateCatalogNavigation

protected void updateCatalogNavigation(java.lang.String pCategoryId,
                                       java.util.List<java.lang.String> pAncestors)
Update the catalog navigation component.

Parameters:
pCategoryId - The categoryId to set as the last browsed category.
pAncestors - The ancestor category ids.

addCatalogUserState

protected void addCatalogUserState(com.endeca.infront.navigation.NavigationState pNavigationState)

Add the CategoryNavigation user segment. We only do this when there are no search filters or range filters. This is because we only want to land on the category page when only a category is selected.

The 'ignoredRangeFilters' property used in this method defines a list of range filters to ignore when determining whether to add the CatalogNavigation segment or not.

Parameters:
pNavigationState - - The NavigationState object that holds the current search/range filters.