atg.commerce.search.refinement.admin
Class CommerceRefinementConfigurationCollector

java.lang.Object
  extended by atg.commerce.search.refinement.admin.RefinementConfigurationCollector
      extended by atg.commerce.search.refinement.admin.CommerceRefinementConfigurationCollector
Direct Known Subclasses:
CustomRefinementConfigurationCollector

public class CommerceRefinementConfigurationCollector
extends RefinementConfigurationCollector

This class is responsible for walking the catalog structure, and creating a set of CommerceRefinementConfiguration objects to be converted to XML.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String REPOSITORY_NOT_MUTABLE_MSG
           
 
Fields inherited from class atg.commerce.search.refinement.admin.RefinementConfigurationCollector
mConfigurationToElements, mElementSourceMap, mElementsToConfigurations, mExistingNameMap
 
Constructor Summary
CommerceRefinementConfigurationCollector()
           
 
Method Summary
protected  void addAdditionalElements(RepositoryItem pRefineConfig, java.util.Set pElements)
           
protected  boolean canInheritParentFacetInheritanceFlags(RepositoryItem pRefineConfig)
          Determine whether this refine-config can inherit the values of its "parent" refine-config's facet inheritance flags.
protected  void createOrUpdateCategoryRefineConfig(RepositoryItem pCategory, RepositoryItem pParentRefineConfig, RefinementConfigurationContainer rcc)
           
protected  RefinementConfigurationContainer getRefineConfigContainerForCategory(RepositoryItem pCategory, RepositoryItem pParentRefineConfig, java.util.Set pPath)
           
protected  boolean hasLocalRefineElements(RepositoryItem pRefineConfig)
          Determines whether the refine config was manually created.
 void processCategory(RepositoryItem pCategory, java.util.Set pParentCategoryElementIds, java.util.Set pPath, RepositoryItem pParentRefineConfig)
          Add the category's refinement elements to the configuration maps, and recurse down the category tree.
 void processCategory(RepositoryItem pCategory, java.util.Set pParentCategoryElementIds, java.util.Set pPath, RepositoryItem pParentRefineConfig, java.lang.String pPrefix)
          Add the category's refinement elements to the configuration maps, and recurse down the category tree.
protected  void processCategoryChildren(RepositoryItem pCategory, java.util.Set pParentAndLocalREs, java.util.Set pPath, java.lang.String pPrefix)
          Deal with the children of a category.
protected  java.lang.Boolean resolveInheritValues(RefinementConfigurationContainer pContainer, java.lang.Boolean pChildValue, java.lang.Boolean pParentValue)
          Resolves the inheritance value to use.
protected  void updateInheritFlags(RefinementConfigurationContainer pContainer, RepositoryItem pRefineConfig, RepositoryItem pParentRefineConfig)
          Handles updates to the inheritance flags.
 
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, itemsToIds, processGlobal, resetMaps, setCategoryChildCategoriesPropertyName, setCategoryRefineConfigPropertyName, setCommerceRefinementConfigurationPropertyManager, setGlobalMappingValue, setLog, setPropagateFacetInheritanceFlagsValues
 
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


REPOSITORY_NOT_MUTABLE_MSG

public static final java.lang.String REPOSITORY_NOT_MUTABLE_MSG
See Also:
Constant Field Values
Constructor Detail

CommerceRefinementConfigurationCollector

public CommerceRefinementConfigurationCollector()
Method Detail

processCategory

public void processCategory(RepositoryItem pCategory,
                            java.util.Set pParentCategoryElementIds,
                            java.util.Set pPath,
                            RepositoryItem pParentRefineConfig)
                     throws RepositoryException
Add the category's refinement elements to the configuration maps, and recurse down the category tree.

Parameters:
pCategory - the category repository item to process
pParentCategoryElementIds - the collection of refinement element ids to be inherited by this category
pPath - the set of categories that have already been processed higher in the recursion hierarchy. This allows category hierarchies with loops to finish processing.
pParentRefineConfig - the parent's refine config.
Throws:
RepositoryException

processCategory

public void processCategory(RepositoryItem pCategory,
                            java.util.Set pParentCategoryElementIds,
                            java.util.Set pPath,
                            RepositoryItem pParentRefineConfig,
                            java.lang.String pPrefix)
                     throws RepositoryException
Add the category's refinement elements to the configuration maps, and recurse down the category tree.

Parameters:
pCategory - the category repository item to process
pParentCategoryElementIds - the collection of refinement element ids to be inherited by this category
pPath - the set of categories that have already been processed higher in the recursion hierarchy. This allows category hierarchies with loops to finish processing.
pParentRefineConfig - the parent's refine config.
Throws:
RepositoryException

processCategoryChildren

protected void processCategoryChildren(RepositoryItem pCategory,
                                       java.util.Set pParentAndLocalREs,
                                       java.util.Set pPath,
                                       java.lang.String pPrefix)
                                throws RepositoryException
Deal with the children of a category.

Throws:
RepositoryException

getRefineConfigContainerForCategory

protected RefinementConfigurationContainer getRefineConfigContainerForCategory(RepositoryItem pCategory,
                                                                               RepositoryItem pParentRefineConfig,
                                                                               java.util.Set pPath)
                                                                        throws RepositoryException
Parameters:
pCategory -
pParentRefineConfig -
pPath -
Returns:
Throws:
RepositoryException

createOrUpdateCategoryRefineConfig

protected void createOrUpdateCategoryRefineConfig(RepositoryItem pCategory,
                                                  RepositoryItem pParentRefineConfig,
                                                  RefinementConfigurationContainer rcc)
                                           throws RepositoryException
Parameters:
pCategory -
pParentRefineConfig -
rcc -
Throws:
RepositoryException

addAdditionalElements

protected void addAdditionalElements(RepositoryItem pRefineConfig,
                                     java.util.Set pElements)

canInheritParentFacetInheritanceFlags

protected boolean canInheritParentFacetInheritanceFlags(RepositoryItem pRefineConfig)
Determine whether this refine-config can inherit the values of its "parent" refine-config's facet inheritance flags. We only allow such inheritance if the mPropagateFacetInheritanceFlagsValues flag is true and the refine-config was automatically generated

Parameters:
pRefineConfig - The refine-config to check
Returns:
true if parent flag values can be inherited, false otherwise

hasLocalRefineElements

protected boolean hasLocalRefineElements(RepositoryItem pRefineConfig)
Determines whether the refine config was manually created.

Parameters:
pRefineConfig - The refine config to check
Returns:
true if manually created, false otherwise.

updateInheritFlags

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

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

resolveInheritValues

protected java.lang.Boolean resolveInheritValues(RefinementConfigurationContainer pContainer,
                                                 java.lang.Boolean pChildValue,
                                                 java.lang.Boolean pParentValue)
                                          throws RepositoryException
Resolves the inheritance value to use.

Parameters:
pChildValue -
pParentValue -
Returns:
Throws:
RepositoryException