atg.commerce.search.refinement.admin
Class CustomRefinementConfigurationCollector

java.lang.Object
  extended by atg.commerce.search.refinement.admin.RefinementConfigurationCollector
      extended by atg.commerce.search.refinement.admin.CommerceRefinementConfigurationCollector
          extended by atg.commerce.search.refinement.admin.CustomRefinementConfigurationCollector

public class CustomRefinementConfigurationCollector
extends CommerceRefinementConfigurationCollector

Extension of CommerceRefinementConfigurationCollector that can process custom catalogs.


Nested Class Summary
 
Nested classes/interfaces inherited from class atg.commerce.search.refinement.admin.RefinementConfigurationCollector
RefinementConfigurationCollector.CollectorHelperBean
 
Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  Repository mCatalogRepository
          Gets the catalog repository.
protected  java.util.Map<RepositoryItem,java.util.Set<java.lang.String>> mCategoryCatalogFacetsMap
          Map of category RepositoryItem to set of associated refine elements, specifically those refine elements that have been inherited by the category from parent/ancestor catalogs.
protected  java.util.Map<RepositoryItem,java.util.Set<RefinementConfigurationContainer>> mCategoryRefineConfigContainerMap
          Map of category RepositoryItem to set of associated RefinementConfigurationContainers.
 
Fields inherited from class atg.commerce.search.refinement.admin.CommerceRefinementConfigurationCollector
REPOSITORY_NOT_MUTABLE_MSG
 
Fields inherited from class atg.commerce.search.refinement.admin.RefinementConfigurationCollector
mConfigurationToElements, mElementSourceMap, mElementsToConfigurations, mExistingNameMap, mHasRepositoryUpdatePermissions, mRefinementGenerationDeploymentHelper, mRefinementRepository
 
Constructor Summary
CustomRefinementConfigurationCollector()
           
 
Method Summary
protected  void addAdditionalElements(RepositoryItem pCategory, RefinementConfigurationContainer pRefinementConfigurationContainer, java.util.Set pElements, RefinementConfigurationCollector.CollectorHelperBean pColHelper)
           
 void clearCategoryCatalogFacetsMap()
          Clears the Map which stores the inherited catalog facets for each root catalog->category association.
protected  MutableRepositoryItem createCategoryInfoItem(RepositoryItem pParentItem, MutableRepository pRepository)
           
protected  java.util.Set getAllRootCategoriesForCatalog(RepositoryItem pCatalog, java.util.Set pVisited, java.util.Set pSeedCategories)
          Gets the root categories for the catalog, and all of its subcatalogs.
 java.lang.String getCatalogChildCatalogsPropertyName()
          Gets the property name of a catalog that designates its child catalogs.
 java.lang.String getCatalogRefineConfigPropertyName()
          Gets the catalog property name that contains the refinement configuration item.
 Repository getCatalogRepository()
          Gets the catalog repository
 java.lang.String getCatalogRootCategoriesPropertyName()
          Gets the name of the root categories property of the catalog item.
 java.lang.String getCategoryChildCatalogsPropertyName()
          Gets the property name of a category that designated its child catalogs.
 java.lang.String getCategoryInfoCatalogPropertyName()
          Gets the name of the category-info catalog property.
 java.lang.String getCategoryInfoCategoryItemPropertyName()
          Gets the name of the category-info category item property.
 java.lang.String getCategoryInfoItemDescriptorName()
          Gets the name of the category info item descriptor.
 java.lang.String getCategoryInfoRefineConfigPropertyName()
          Gets the name of the category-info refine config property.
 RepositoryItem getCurrentRootCatalog()
          get CurrentRootCatalog
 CustomCatalogTools getCustomCatalogTools()
          Gets the custom catalog tools component.
 CustomRefinementConfigurationPropertyManager getCustomRefinementConfigurationPropertyManager()
           
protected  RefinementConfigurationContainer getRefineConfigContainerForCategory(RepositoryItem pCategory, RepositoryItem pParentRefineConfig, java.util.Set pPath)
          Use the "current category" field to look up, via the catalog info items, the proper refinement configuration.
protected  RefinementConfigurationContainer getRefineConfigForCatalog(RepositoryItem pCatalog, RepositoryItem pParentRefineConfig, java.util.Set pPath)
          Gets the refinement configuration container for the give catalog item.
protected  void processCatalog(RepositoryItem pCatalog, java.util.Set pPath, RepositoryItem pParentRefineConfig)
          Process a catalog item, recursing into subcatalogs and root categories as necessary.
protected  void processCatalog(RepositoryItem pCatalog, java.util.Set pParentCategoryElementIds, java.util.Set pPath, RepositoryItem pParentRefineConfig, RefinementConfigurationCollector.CollectorHelperBean pCollectorHelperBean)
          Process a catalog item, recursing into subcatalogs and root categories as necessary.
protected  void processCategoryChildren(RepositoryItem pCategory, java.util.Set pParentAndLocalREs, java.util.Set pPath, RefinementConfigurationCollector.CollectorHelperBean pCollectorHelperBean)
          Process child categories, then child catalogs.
 void setCatalogChildCatalogsPropertyName(java.lang.String pCatalogChildCatalogsPropertyName)
          Sets the property name of a catalog that designates its child catalogs.
 void setCatalogRefineConfigPropertyName(java.lang.String pCatalogRefineConfigPropertyName)
          Sets the catalog property name that contains the refinement configuration item.
 void setCatalogRepository(Repository pCatalogRepository)
           
 void setCatalogRootCategoriesPropertyName(java.lang.String pCatalogRootCategoriesPropertyName)
          Sets the name of the root categories property of the catalog item.
 void setCategoryChildCatalogsPropertyName(java.lang.String pCategoryChildCatalogsPropertyName)
          Sets the property name of a category that designated its child catalogs.
 void setCategoryInfoCatalogPropertyName(java.lang.String pCategoryInfoCatalogPropertyName)
          Sets the name of the category-info catalog property.
 void setCategoryInfoCategoryItemPropertyName(java.lang.String pCategoryInfoCategoryItemPropertyName)
          Sets the name of the category-info category item property.
 void setCategoryInfoItemDescriptorName(java.lang.String pCategoryInfoItemDescriptorName)
          Sets the name of the category info item descriptor.
 void setCategoryInfoRefineConfigPropertyName(java.lang.String pCategoryInfoRefineConfigPropertyName)
          Sets the name of the category-info refine config property.
 void setCurrentRootCatalog(RepositoryItem pCurrentRootCatalog)
          set CurrentRootCatalog
 void setCustomCatalogTools(CustomCatalogTools pCustomCatalogTools)
          Sets the custom catalog tools component.
protected  void updateInheritFlags(RefinementConfigurationContainer pContainer, RepositoryItem pRefineConfig, RepositoryItem pParentRefineConfig)
          Handles updates to the inheritance flags.
 
Methods inherited from class atg.commerce.search.refinement.admin.CommerceRefinementConfigurationCollector
canInheritParentFacetInheritanceFlags, createOrUpdateCategoryRefineConfig, createRefineConfigRepositoryItem, hasLocalRefineElements, processCategory, processCategory, resolveInheritValues
 
Methods inherited from class atg.commerce.search.refinement.admin.RefinementConfigurationCollector
addToElementSources, addToMap, getCategoryChildCategoriesPropertyName, getCategoryRefineConfigPropertyName, getCommerceRefinementConfigurationPropertyManager, getConfigurationsForElements, getConfigurationsToElements, getElementsForConfiguration, getElementSourceMap, getElementsToConfigurations, getExistingNameMap, getGlobalMappingValue, getGlobalRefinementConfiguration, getGlobalRefinementConfigurationQuery, getGlobalRefinementElements, getLog, getPropagateFacetInheritanceFlagsValues, getRefinementElementForItem, getRefinementElementPropertyManager, getRefinementGenerationDeploymentHelper, getRefinementRepository, isHasRepositoryUpdatePermissions, itemsToIds, mergeRefinements, processGlobal, resetMaps, setCategoryChildCategoriesPropertyName, setCategoryRefineConfigPropertyName, setCommerceRefinementConfigurationPropertyManager, setGlobalMappingValue, setHasRepositoryUpdatePermissions, setLog, setPropagateFacetInheritanceFlagsValues, setRefinementElementPropertyManager, setRefinementGenerationDeploymentHelper, setRefinementRepository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


mCatalogRepository

protected Repository mCatalogRepository
Gets the catalog repository.


mCategoryCatalogFacetsMap

protected java.util.Map<RepositoryItem,java.util.Set<java.lang.String>> mCategoryCatalogFacetsMap
Map of category RepositoryItem to set of associated refine elements, specifically those refine elements that have been inherited by the category from parent/ancestor catalogs. The set of inheritable catalog refinements should be static across all catalog-scopes within which the category is present.


mCategoryRefineConfigContainerMap

protected java.util.Map<RepositoryItem,java.util.Set<RefinementConfigurationContainer>> mCategoryRefineConfigContainerMap
Map of category RepositoryItem to set of associated RefinementConfigurationContainers. This is used to help determine those entries in the superclass mConfigurationToElements map that may need updating after a category has been processed in the context of a different root catalog (and consequently may have inherited some additional catalog facets).

Constructor Detail

CustomRefinementConfigurationCollector

public CustomRefinementConfigurationCollector()
Method Detail

getCatalogRefineConfigPropertyName

public java.lang.String getCatalogRefineConfigPropertyName()
Gets the catalog property name that contains the refinement configuration item.


setCatalogRefineConfigPropertyName

public void setCatalogRefineConfigPropertyName(java.lang.String pCatalogRefineConfigPropertyName)
Sets the catalog property name that contains the refinement configuration item.


getCatalogChildCatalogsPropertyName

public java.lang.String getCatalogChildCatalogsPropertyName()
Gets the property name of a catalog that designates its child catalogs.


setCatalogChildCatalogsPropertyName

public void setCatalogChildCatalogsPropertyName(java.lang.String pCatalogChildCatalogsPropertyName)
Sets the property name of a catalog that designates its child catalogs.


getCategoryChildCatalogsPropertyName

public java.lang.String getCategoryChildCatalogsPropertyName()
Gets the property name of a category that designated its child catalogs.


setCategoryChildCatalogsPropertyName

public void setCategoryChildCatalogsPropertyName(java.lang.String pCategoryChildCatalogsPropertyName)
Sets the property name of a category that designated its child catalogs.


getCustomCatalogTools

public CustomCatalogTools getCustomCatalogTools()
Gets the custom catalog tools component.


setCustomCatalogTools

public void setCustomCatalogTools(CustomCatalogTools pCustomCatalogTools)
Sets the custom catalog tools component.


getCatalogRepository

public Repository getCatalogRepository()
Gets the catalog repository


setCatalogRepository

public void setCatalogRepository(Repository pCatalogRepository)

getCatalogRootCategoriesPropertyName

public java.lang.String getCatalogRootCategoriesPropertyName()
Gets the name of the root categories property of the catalog item.


setCatalogRootCategoriesPropertyName

public void setCatalogRootCategoriesPropertyName(java.lang.String pCatalogRootCategoriesPropertyName)
Sets the name of the root categories property of the catalog item.


getCategoryInfoItemDescriptorName

public java.lang.String getCategoryInfoItemDescriptorName()
Gets the name of the category info item descriptor.


setCategoryInfoItemDescriptorName

public void setCategoryInfoItemDescriptorName(java.lang.String pCategoryInfoItemDescriptorName)
Sets the name of the category info item descriptor.


getCategoryInfoCatalogPropertyName

public java.lang.String getCategoryInfoCatalogPropertyName()
Gets the name of the category-info catalog property.


setCategoryInfoCatalogPropertyName

public void setCategoryInfoCatalogPropertyName(java.lang.String pCategoryInfoCatalogPropertyName)
Sets the name of the category-info catalog property.


getCategoryInfoCategoryItemPropertyName

public java.lang.String getCategoryInfoCategoryItemPropertyName()
Gets the name of the category-info category item property.


setCategoryInfoCategoryItemPropertyName

public void setCategoryInfoCategoryItemPropertyName(java.lang.String pCategoryInfoCategoryItemPropertyName)
Sets the name of the category-info category item property.


getCategoryInfoRefineConfigPropertyName

public java.lang.String getCategoryInfoRefineConfigPropertyName()
Gets the name of the category-info refine config property.


setCategoryInfoRefineConfigPropertyName

public void setCategoryInfoRefineConfigPropertyName(java.lang.String pCategoryInfoRefineConfigPropertyName)
Sets the name of the category-info refine config property.


getCustomRefinementConfigurationPropertyManager

public CustomRefinementConfigurationPropertyManager getCustomRefinementConfigurationPropertyManager()

setCurrentRootCatalog

public void setCurrentRootCatalog(RepositoryItem pCurrentRootCatalog)
set CurrentRootCatalog

Parameters:
pCurrentRootCatalog - the CurrentRootCatalog

getCurrentRootCatalog

public RepositoryItem getCurrentRootCatalog()
get CurrentRootCatalog

Returns:
the CurrentRootCatalog

getRefineConfigForCatalog

protected RefinementConfigurationContainer getRefineConfigForCatalog(RepositoryItem pCatalog,
                                                                     RepositoryItem pParentRefineConfig,
                                                                     java.util.Set pPath)
                                                              throws RepositoryException
Gets the refinement configuration container for the give catalog item.

Throws:
RepositoryException

processCatalog

protected void processCatalog(RepositoryItem pCatalog,
                              java.util.Set pPath,
                              RepositoryItem pParentRefineConfig)
                       throws RepositoryException
Process a catalog item, recursing into subcatalogs and root categories as necessary.

Throws:
RepositoryException

processCatalog

protected void processCatalog(RepositoryItem pCatalog,
                              java.util.Set pParentCategoryElementIds,
                              java.util.Set pPath,
                              RepositoryItem pParentRefineConfig,
                              RefinementConfigurationCollector.CollectorHelperBean pCollectorHelperBean)
                       throws RepositoryException
Process a catalog item, recursing into subcatalogs and root categories as necessary.

Throws:
RepositoryException

getRefineConfigContainerForCategory

protected RefinementConfigurationContainer getRefineConfigContainerForCategory(RepositoryItem pCategory,
                                                                               RepositoryItem pParentRefineConfig,
                                                                               java.util.Set pPath)
                                                                        throws RepositoryException
Use the "current category" field to look up, via the catalog info items, the proper refinement configuration. If there is no catalog-info refine-config for this catalog-category then we need to create one using the category refine-config.

Overrides:
getRefineConfigContainerForCategory in class CommerceRefinementConfigurationCollector
Returns:
Throws:
RepositoryException

getAllRootCategoriesForCatalog

protected java.util.Set getAllRootCategoriesForCatalog(RepositoryItem pCatalog,
                                                       java.util.Set pVisited,
                                                       java.util.Set pSeedCategories)
                                                throws RepositoryException
Gets the root categories for the catalog, and all of its subcatalogs. This method can be called with pVisitied and pSeedCategories as null- they will be created if necessary.

Throws:
RepositoryException

processCategoryChildren

protected void processCategoryChildren(RepositoryItem pCategory,
                                       java.util.Set pParentAndLocalREs,
                                       java.util.Set pPath,
                                       RefinementConfigurationCollector.CollectorHelperBean pCollectorHelperBean)
                                throws RepositoryException
Process child categories, then child catalogs.

Overrides:
processCategoryChildren in class CommerceRefinementConfigurationCollector
Throws:
RepositoryException

addAdditionalElements

protected void addAdditionalElements(RepositoryItem pCategory,
                                     RefinementConfigurationContainer pRefinementConfigurationContainer,
                                     java.util.Set pElements,
                                     RefinementConfigurationCollector.CollectorHelperBean pColHelper)
                              throws RepositoryException
Overrides:
addAdditionalElements in class CommerceRefinementConfigurationCollector
Throws:
RepositoryException

updateInheritFlags

protected void updateInheritFlags(RefinementConfigurationContainer pContainer,
                                  RepositoryItem pRefineConfig,
                                  RepositoryItem pParentRefineConfig)
                           throws RepositoryException
Handles updates to the inheritance flags.

Overrides:
updateInheritFlags in class CommerceRefinementConfigurationCollector
Parameters:
pContainer - The refine config container.
pRefineConfig - The refine config to be updated
pParentRefineConfig - The parent refine config to retrieve inheritance values from.
Throws:
RepositoryException

clearCategoryCatalogFacetsMap

public void clearCategoryCatalogFacetsMap()
Clears the Map which stores the inherited catalog facets for each root catalog->category association. This map should be cleared each time a new root catalog is processed so that so that catalog facets don't cross over from one root catalog tree to another.


createCategoryInfoItem

protected MutableRepositoryItem createCategoryInfoItem(RepositoryItem pParentItem,
                                                       MutableRepository pRepository)
                                                throws RepositoryException
Parameters:
pParentItem -
pRepository -
Returns:
Throws:
RepositoryException