atg.search.query.config
Class SearchConfigNameService

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.search.query.config.SearchConfigNameService
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class SearchConfigNameService
extends GenericService

This service perform traversing the dimension tree to find a search config item based on the customers details stored in the DynamoHttpServletRequest object.


Field Summary
static java.lang.String APPLICATION_PROP
           
static java.lang.String CLASS_VERSION
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
SearchConfigNameService()
           
 
Method Summary
 java.lang.String getApplication()
          Returns application name.
 Repository getRefinementRepository()
          Returns refinement repository.
protected  RepositoryItem getRootTreeNode()
           
 atg.repository.search.testing.SearchAssetTools getSearchAssetTools()
          Returns SearchAssetTools that is used to handle assets.
 java.lang.String getSearchConfigName(DynamoHttpServletRequest pRequest)
          Returns search config name.
 java.util.Map<java.lang.String,java.lang.String> getSearchConfigurationDimensionValues(RepositoryItem pSearchConfig, boolean pUseDeployedOnlyAssets)
          Gets a map of dimension service name to dimension value for a given search configuration.
 SearchConfigurationPropertyManager getSearchConfigurationPropertyManager()
          Returns SearchConfigurationPropertyMananger that provides getters and setters for refinement repository items
 SearchDimensionManagerService getSearchDimensionManagerService()
          Returns SearchDimensionManagerService that is used to obtain references to the dimension services.
 boolean isSearchDimensionTreeContainsService(java.lang.String pDimensionServiceName)
          Return true if Search Dimension Tree contains Dimension Service, otherwise return false
protected  void populateMapForDimensionNode(java.util.Map<java.lang.String,java.lang.String> pMap, RepositoryItem pNode)
          Recursive method to traverse back up the tree collection dimension service to values.
 void setApplication(java.lang.String pApplication)
          Sets new application name.
 void setRefinementRepository(Repository pRefinementRepository)
          Sets refinement repository.
 void setSearchAssetTools(atg.repository.search.testing.SearchAssetTools pSearchAssetTools)
          Sets new SearchAssetTools.
 void setSearchConfigurationPropertyManager(SearchConfigurationPropertyManager pSearchConfigurationPropertyManager)
          Sets SearchConfigurationPropertyManager.
 void setSearchDimensionManagerService(SearchDimensionManagerService pSearchDimensionManagerService)
          Sets new SearchDimensionManagerService.
 java.util.List<VisitedSearchDimensionNode> traverseSearchDimensionTree(RepositoryItem pProfile, java.util.HashMap<java.lang.String,java.lang.String> pDimensionValueMap, boolean pForceDeployedAssetsOnly)
          Method to traverse down the dimension tree to try and find a matching search config based on the given profile and dimension values.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
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
See Also:
Constant Field Values

APPLICATION_PROP

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

SearchConfigNameService

public SearchConfigNameService()
Method Detail

getApplication

public java.lang.String getApplication()
Returns application name.

Returns:
application name

setApplication

public void setApplication(java.lang.String pApplication)
Sets new application name.

Parameters:
pApplication - Application name

getRefinementRepository

public Repository getRefinementRepository()
Returns refinement repository.

Returns:
RefinementRepository

setRefinementRepository

public void setRefinementRepository(Repository pRefinementRepository)
Sets refinement repository.

Parameters:
pRefinementRepository - Repository

getSearchConfigurationPropertyManager

public SearchConfigurationPropertyManager getSearchConfigurationPropertyManager()
Returns SearchConfigurationPropertyMananger that provides getters and setters for refinement repository items

Returns:
SearchConfigurationPropertyManager

setSearchConfigurationPropertyManager

public void setSearchConfigurationPropertyManager(SearchConfigurationPropertyManager pSearchConfigurationPropertyManager)
Sets SearchConfigurationPropertyManager.

Parameters:
pSearchConfigurationPropertyManager - new SearchConfigurationPropertyManager

getSearchDimensionManagerService

public SearchDimensionManagerService getSearchDimensionManagerService()
Returns SearchDimensionManagerService that is used to obtain references to the dimension services.

Returns:
SearchDimensionManagerService

setSearchDimensionManagerService

public void setSearchDimensionManagerService(SearchDimensionManagerService pSearchDimensionManagerService)
Sets new SearchDimensionManagerService.

Parameters:
pSearchDimensionManagerService - SearchDimensionManagerService

getSearchAssetTools

public atg.repository.search.testing.SearchAssetTools getSearchAssetTools()
Returns SearchAssetTools that is used to handle assets.

Returns:
SearchAssetTools

setSearchAssetTools

public void setSearchAssetTools(atg.repository.search.testing.SearchAssetTools pSearchAssetTools)
Sets new SearchAssetTools.

Parameters:
pSearchAssetTools - SearchAssetTools

getSearchConfigName

public java.lang.String getSearchConfigName(DynamoHttpServletRequest pRequest)
Returns search config name. Constructing the search config name involves traversing the dimension tree to find a search config item based on the customers details stored in the DynamoHttpServletRequest object.

The dimension tree must be traversed until a dimensionFolder is reached that contains a searchConfig matching the customer request. The tree is traversed starting from the root dimension node as pointed to by the dimensionTreeInfo for the application, i.e. dimensionTreeInfo.rootDimensionNode. This rootDimensionNode is usually a dimensionFolder however it is possible to set up the system without a dimension tree and instead just have a single searchConfig item. In this case the rootDimensionNode will point to the single searchConfig item and it is this item that should be used for the customer request. However in the normal case the rootDimensionNode points to the start of the dimension tree and is a dimensionFolder item. Every dimensionFolder item may contain an ordered list of searchConfig items in the searchConfigs property or an ordered list of child dimensionFolder items in the childDimensionFolders property.

Parameters:
pRequest - current DynamoHttpServletRequest
Returns:
id of the searchConfig repository item

getSearchConfigurationDimensionValues

public java.util.Map<java.lang.String,java.lang.String> getSearchConfigurationDimensionValues(RepositoryItem pSearchConfig,
                                                                                              boolean pUseDeployedOnlyAssets)
Gets a map of dimension service name to dimension value for a given search configuration. Traverses back up the dimension tree collecting values.

Parameters:
pSearchConfig - RepositoryItem search config
pUseDeployedOnlyAssets - true if only deployed assets should be used
Returns:
Map of String dimension service name to String dimension value

traverseSearchDimensionTree

public java.util.List<VisitedSearchDimensionNode> traverseSearchDimensionTree(RepositoryItem pProfile,
                                                                              java.util.HashMap<java.lang.String,java.lang.String> pDimensionValueMap,
                                                                              boolean pForceDeployedAssetsOnly)
Method to traverse down the dimension tree to try and find a matching search config based on the given profile and dimension values.

Parameters:
pProfile - RepositoryItem profile to use
pDimensionValueMap - HashMap of dimension service name to value to use
pForceDeployedAssetsOnly - true to only use deployed assets
Returns:
List of VisitedSearchDimensionNode or null if there is a problem

isSearchDimensionTreeContainsService

public boolean isSearchDimensionTreeContainsService(java.lang.String pDimensionServiceName)
Return true if Search Dimension Tree contains Dimension Service, otherwise return false

Parameters:
pDimensionServiceName - Dimension Service Name
Returns:
true if Search Dimension Tree contains Dimension Service, otherwise false

populateMapForDimensionNode

protected void populateMapForDimensionNode(java.util.Map<java.lang.String,java.lang.String> pMap,
                                           RepositoryItem pNode)
Recursive method to traverse back up the tree collection dimension service to values.

Parameters:
pMap - Map of service name to value to populate
pNode - Current dimensionNode RepositoryItem

getRootTreeNode

protected RepositoryItem getRootTreeNode()