atg.commerce.search.refinement.admin
Class RefinementConfigurationCollector

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

public abstract class RefinementConfigurationCollector
extends java.lang.Object

Base class for catalog refinement configuration collectors.


Nested Class Summary
 class RefinementConfigurationCollector.CollectorHelperBean
           
 
Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  java.util.Map mConfigurationToElements
           
protected  java.util.Map mElementSourceMap
           
protected  java.util.Map mElementsToConfigurations
           
protected  java.util.Map mExistingNameMap
           
protected  boolean mHasRepositoryUpdatePermissions
          Determines whether the collector can also update target repositories
protected  atg.commerce.search.refinement.admin.RefinementGenerationDeploymentHelper mRefinementGenerationDeploymentHelper
          Used to determine repository id's when refinement generation is run during a switched deployment
protected  Repository mRefinementRepository
          Gets the refinement repository from the property manager.
 
Constructor Summary
RefinementConfigurationCollector()
           
 
Method Summary
protected  void addToElementSources(RefinementElement pElement, RepositoryItemDescriptor pItemDescriptor, java.lang.String pSourceItemId)
          Add the RefinementElement to the element source map.
 void addToMap(java.util.Set pRefinementElements, RefinementConfigurationContainer pRefinementConfigurationContainer)
          If the refinement configuration is already associated with a collection of elements, remove the association, and associate it with the collection of elements that includes the new elements.
 java.lang.String getCategoryChildCategoriesPropertyName()
          Gets the name of the property of the category item descriptor that contains the collection of child categories.
 java.lang.String getCategoryRefineConfigPropertyName()
          Gets the name of the property of the category item descriptor that contains the refineConfig.
 CommerceRefinementConfigurationPropertyManager getCommerceRefinementConfigurationPropertyManager()
          Gets the commerce refinement configuration manager.
 java.util.Set getConfigurationsForElements(java.util.Collection pElements)
          Get the collection of refinement configuration repository item ids whose refinement elements are the given collection of element ids.
 java.util.Map getConfigurationsToElements()
          Gets the map if configuration id to Set of element ids.
 java.util.Set getElementsForConfiguration(RefinementConfigurationContainer pRefinementConfigurationContainer)
          Get the collection of element ids for a given configuration id.
 java.util.Map getElementSourceMap()
          Gets the map of RefinementElements to ElementSource objects.
 java.util.Map getElementsToConfigurations()
          Gets the Map of List of element ids to Set of configuration containers.
 java.util.Map getExistingNameMap()
          Gets the map of element ids to the name of an existing refinement cofiguration with those elements.
 java.lang.String getGlobalMappingValue()
          Gets the mapping value of the global refinement configuration.
 RepositoryItem getGlobalRefinementConfiguration()
          Get the repository item that is considered "global".
protected  Query getGlobalRefinementConfigurationQuery()
          Gets the query that can return the global refinement configuration.
 java.util.Collection getGlobalRefinementElements()
          Get the collection of refinement elements for the global refinement confuguration.
 ApplicationLogging getLog()
          Gets the application logging component that will be used for logging.
 java.lang.Boolean getPropagateFacetInheritanceFlagsValues()
           
protected  RefinementElement getRefinementElementForItem(RepositoryItem pItem)
          Get a refinement element object for the given refinement element repository item.
 RefinementElementPropertyManager getRefinementElementPropertyManager()
          Gets the refinement element property manager.
 atg.commerce.search.refinement.admin.RefinementGenerationDeploymentHelper getRefinementGenerationDeploymentHelper()
           
 MutableRepository getRefinementRepository()
           
 boolean isHasRepositoryUpdatePermissions()
           
 java.util.Collection itemsToIds(java.util.Collection pSource)
          Return a collection of repository item ids for a given collection of repository items.
protected  void mergeRefinements(java.util.Set<RefinementElement> pExistingRefinements, java.util.Collection pNewRefinements)
          Updates a set of RefinementElement's ensuring that the set does not contain multiple RefinementElement's defined using the same "property" value e.g.
 void processGlobal()
          Add the global element set to the confiugration maps.
 void resetMaps()
          Reset the elements to configurations map, and the configuration to elements map.
 void setCategoryChildCategoriesPropertyName(java.lang.String pCategoryChildCategoriesPropertyName)
          Sets the name of the property of the category item descriptor that contains the collection of child categories.
 void setCategoryRefineConfigPropertyName(java.lang.String pCategoryRefineConfigPropertyName)
          Sets the name of the property of the category item descriptor that contains the refineConfig.
 void setCommerceRefinementConfigurationPropertyManager(CommerceRefinementConfigurationPropertyManager pManager)
          Sets the commerce refinement configuration manager.
 void setGlobalMappingValue(java.lang.String pGlobalMappingValue)
          Sets the mapping value of the global refinement configuration.
 void setHasRepositoryUpdatePermissions(boolean pHasRepositoryUpdatePermissions)
           
 void setLog(ApplicationLogging pLog)
          Sets the application logging component that will be used for logging.
 void setPropagateFacetInheritanceFlagsValues(java.lang.Boolean propagateFacetInheritanceFlagsValues)
           
 void setRefinementElementPropertyManager(RefinementElementPropertyManager pManager)
          Sets the refinement element property manager.
 void setRefinementGenerationDeploymentHelper(atg.commerce.search.refinement.admin.RefinementGenerationDeploymentHelper pRefinementGenerationDeploymentHelper)
           
 void setRefinementRepository(MutableRepository pRefinementRepository)
           
 
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


mElementsToConfigurations

protected java.util.Map mElementsToConfigurations

mConfigurationToElements

protected java.util.Map mConfigurationToElements

mElementSourceMap

protected java.util.Map mElementSourceMap

mExistingNameMap

protected java.util.Map mExistingNameMap

mRefinementRepository

protected Repository mRefinementRepository
Gets the refinement repository from the property manager.


mHasRepositoryUpdatePermissions

protected boolean mHasRepositoryUpdatePermissions
Determines whether the collector can also update target repositories


mRefinementGenerationDeploymentHelper

protected atg.commerce.search.refinement.admin.RefinementGenerationDeploymentHelper mRefinementGenerationDeploymentHelper
Used to determine repository id's when refinement generation is run during a switched deployment

Constructor Detail

RefinementConfigurationCollector

public RefinementConfigurationCollector()
Method Detail

getElementsToConfigurations

public java.util.Map getElementsToConfigurations()
Gets the Map of List of element ids to Set of configuration containers.


getConfigurationsToElements

public java.util.Map getConfigurationsToElements()
Gets the map if configuration id to Set of element ids.


getElementSourceMap

public java.util.Map getElementSourceMap()
Gets the map of RefinementElements to ElementSource objects. This tells the UI where a particular element was first encountered.


getExistingNameMap

public java.util.Map getExistingNameMap()
Gets the map of element ids to the name of an existing refinement cofiguration with those elements.


setCommerceRefinementConfigurationPropertyManager

public void setCommerceRefinementConfigurationPropertyManager(CommerceRefinementConfigurationPropertyManager pManager)
Sets the commerce refinement configuration manager.


getCommerceRefinementConfigurationPropertyManager

public CommerceRefinementConfigurationPropertyManager getCommerceRefinementConfigurationPropertyManager()
Gets the commerce refinement configuration manager.


setCategoryRefineConfigPropertyName

public void setCategoryRefineConfigPropertyName(java.lang.String pCategoryRefineConfigPropertyName)
Sets the name of the property of the category item descriptor that contains the refineConfig.


getCategoryRefineConfigPropertyName

public java.lang.String getCategoryRefineConfigPropertyName()
Gets the name of the property of the category item descriptor that contains the refineConfig.


getPropagateFacetInheritanceFlagsValues

public java.lang.Boolean getPropagateFacetInheritanceFlagsValues()

setPropagateFacetInheritanceFlagsValues

public void setPropagateFacetInheritanceFlagsValues(java.lang.Boolean propagateFacetInheritanceFlagsValues)

setCategoryChildCategoriesPropertyName

public void setCategoryChildCategoriesPropertyName(java.lang.String pCategoryChildCategoriesPropertyName)
Sets the name of the property of the category item descriptor that contains the collection of child categories.


getCategoryChildCategoriesPropertyName

public java.lang.String getCategoryChildCategoriesPropertyName()
Gets the name of the property of the category item descriptor that contains the collection of child categories.


setLog

public void setLog(ApplicationLogging pLog)
Sets the application logging component that will be used for logging.


getLog

public ApplicationLogging getLog()
Gets the application logging component that will be used for logging.


setGlobalMappingValue

public void setGlobalMappingValue(java.lang.String pGlobalMappingValue)
Sets the mapping value of the global refinement configuration.


getGlobalMappingValue

public java.lang.String getGlobalMappingValue()
Gets the mapping value of the global refinement configuration.


setRefinementElementPropertyManager

public void setRefinementElementPropertyManager(RefinementElementPropertyManager pManager)
Sets the refinement element property manager.


getRefinementElementPropertyManager

public RefinementElementPropertyManager getRefinementElementPropertyManager()
Gets the refinement element property manager.


getRefinementRepository

public MutableRepository getRefinementRepository()

setRefinementRepository

public void setRefinementRepository(MutableRepository pRefinementRepository)

isHasRepositoryUpdatePermissions

public boolean isHasRepositoryUpdatePermissions()

setHasRepositoryUpdatePermissions

public void setHasRepositoryUpdatePermissions(boolean pHasRepositoryUpdatePermissions)

getRefinementGenerationDeploymentHelper

public atg.commerce.search.refinement.admin.RefinementGenerationDeploymentHelper getRefinementGenerationDeploymentHelper()

setRefinementGenerationDeploymentHelper

public void setRefinementGenerationDeploymentHelper(atg.commerce.search.refinement.admin.RefinementGenerationDeploymentHelper pRefinementGenerationDeploymentHelper)

getGlobalRefinementConfigurationQuery

protected Query getGlobalRefinementConfigurationQuery()
                                               throws RepositoryException
Gets the query that can return the global refinement configuration.

Throws:
RepositoryException

getGlobalRefinementConfiguration

public RepositoryItem getGlobalRefinementConfiguration()
                                                throws RepositoryException
Get the repository item that is considered "global". Issues a warning if more than one is found, adds a new one if none is found.

Throws:
RepositoryException

getGlobalRefinementElements

public java.util.Collection getGlobalRefinementElements()
                                                 throws RepositoryException
Get the collection of refinement elements for the global refinement confuguration.

Throws:
RepositoryException

processGlobal

public void processGlobal()
                   throws RepositoryException
Add the global element set to the confiugration maps.

Throws:
RepositoryException

addToElementSources

protected void addToElementSources(RefinementElement pElement,
                                   RepositoryItemDescriptor pItemDescriptor,
                                   java.lang.String pSourceItemId)
Add the RefinementElement to the element source map.


itemsToIds

public java.util.Collection itemsToIds(java.util.Collection pSource)
Return a collection of repository item ids for a given collection of repository items.


addToMap

public void addToMap(java.util.Set pRefinementElements,
                     RefinementConfigurationContainer pRefinementConfigurationContainer)
If the refinement configuration is already associated with a collection of elements, remove the association, and associate it with the collection of elements that includes the new elements.


getConfigurationsForElements

public java.util.Set getConfigurationsForElements(java.util.Collection pElements)
Get the collection of refinement configuration repository item ids whose refinement elements are the given collection of element ids.


getElementsForConfiguration

public java.util.Set getElementsForConfiguration(RefinementConfigurationContainer pRefinementConfigurationContainer)
                                          throws RepositoryException
Get the collection of element ids for a given configuration id.

Throws:
RepositoryException

resetMaps

public void resetMaps()
Reset the elements to configurations map, and the configuration to elements map.


getRefinementElementForItem

protected RefinementElement getRefinementElementForItem(RepositoryItem pItem)
                                                 throws RepositoryException
Get a refinement element object for the given refinement element repository item.

Parameters:
pItem - - Refinement Repository Item
Returns:
RefinementElement for given Refinement Repository Item
Throws:
RepositoryException

mergeRefinements

protected void mergeRefinements(java.util.Set<RefinementElement> pExistingRefinements,
                                java.util.Collection pNewRefinements)
Updates a set of RefinementElement's ensuring that the set does not contain multiple RefinementElement's defined using the same "property" value e.g. $repositoryId.

Parameters:
pExistingRefinements - - set of RefinementElement's to update
pNewRefinements - - Collection of new facets. Can contain either RefinementElement's or RepositoryItem's.
Throws:
RepositoryException