atg.commerce.search.refinement.custom
Class CustomCatalogFacetSearchTools

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.repository.search.refinement.FacetSearchTools
              extended by atg.commerce.search.refinement.CommerceFacetSearchTools
                  extended by atg.commerce.search.refinement.custom.CustomCatalogFacetSearchTools
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, SearchRedirectProcessor, SearchRequestProcessor, SearchResponseProcessor, java.util.EventListener

public class CustomCatalogFacetSearchTools
extends CommerceFacetSearchTools


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.commerce.search.refinement.CommerceFacetSearchTools
SEARCH_TESTING_RC_NAME_PREFIX
 
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
CustomCatalogFacetSearchTools()
          Constructs an instanceof CustomCatalogFacetSearchTools
 
Method Summary
 RepositoryItem findCategory(java.lang.String pCategoryId)
          find a category by id.
 java.lang.String[] getAdditionalConstraints()
          Logic here is that if the queryByCatalog property is false then we don't include create any catalog constraints.
 java.lang.String getCatalogConstraintFormat()
           
 java.lang.String getCatalogId()
           
 java.lang.String[] getCatalogIds()
           
 RefinementConfiguration getCatalogRefineConfig(FacetTrail pTrail, QueryRequest pRequest)
          get the refine config
 atg.commerce.search.producer.CustomCatalogCategoriesPropertyAccessor getCatalogSpecificIdPropertyAccessor()
           
 java.lang.String getCatalogSpecificIdPropertyName()
           
protected  java.lang.String getDefaultCatalogRepositoryId()
           
protected  java.util.List getDerivedRefineElements(RepositoryItem pCategory)
          Gets the total collection of refine elements for the given category.
protected  java.lang.String getIdForDocSetPath(FacetTrail pTrail)
           
protected  java.lang.String getIdPropertyNameForDocSetPath()
           
 boolean getQueryByCatalog()
           
 RefinementConfiguration getRefineConfig(RepositoryItem pCategoryItem)
          Gets the refine config for the given category based on the current catalog.
protected  java.lang.String getSearchTestingRefineConfigName(RepositoryItem pSourceItem, java.lang.String pPrefix)
          Generate refine-config name for search query executed from Search Testing UI.
protected  RepositoryItem getSourceItem(RepositoryItem pCategory)
          Gets the source item for a refine config.
 java.util.List<java.lang.String> reorderCategories(java.util.List<java.lang.String> pCategoryIds)
           
 void setCatalogConstraintFormat(java.lang.String pCatalogConstraintFormat)
           
 void setCatalogId(java.lang.String catalogId)
           
 void setCatalogIds(java.lang.String[] pCatalogIds)
           
 void setCatalogSpecificIdPropertyAccessor(atg.commerce.search.producer.CustomCatalogCategoriesPropertyAccessor catalogSpecificIdPropertyAccessor)
           
 void setCatalogSpecificIdPropertyName(java.lang.String pCatalogSpecificPropertyId)
           
 void setCategoryId(java.lang.String pCategoryId)
           
 void setQueryByCatalog(boolean pQueryByCatalog)
           
 
Methods inherited from class atg.commerce.search.refinement.CommerceFacetSearchTools
addCategoryConstraint, convertRefineValue, determineCommerceRefineConfigName, determineDocSetPath, getCatalogTools, getCategoryId, getCategoryIdPropertyName, getCommerceRefinementConfiguration, getCommerceRefinementConfigurationPropertyManager, getDocSetPathFormat, getFacetSourceGenerator, getGlobalRefineConfig, getGlobalRefineConfigName, getLastCategoryFacetValueInTrail, getLastCategoryRefineConfig, isCategoryFacet, isEligibleFacetValue, isEnableUnverifiedCategoryLookup, isSkipAncestorsToCategoriesInTrail, processSearchRequest, removeAncestorCategoriesFromFacetValues, setCatalogTools, setCategoryIdPropertyName, setCommerceRefinementConfigurationPropertyManager, setDocSetPathFormat, setEnableUnverifiedCategoryLookup, setFacetSourceGenerator, setGlobalRefineConfigName, setSkipAncestorsToCategoriesInTrail
 
Methods inherited from class atg.repository.search.refinement.FacetSearchTools
containsConstraint, createConstraint, createConstraints, createDocSetConstraint, createFacetDocSetConstraint, createFacetDocSetConstraint, createFacetTrail, createFacetTrail, createFacetTrail, createQueryRequest, createSession, determineQuestionText, determineRefineConfigMap, determineRefineConfigName, escapeAsterisk, getAllFacets, getCurrentFacetTrail, getDefaultFacetPriority, getFacetManager, getFacets, getFacetTrail, getFacetTrailTools, getMinMatchingDocsCount, getQueryRequest, getRedirect, getRefineConfig, getRefineConfigXMLGenerator, getSearchClient, getSearchRequest, getTestingMode, handleAutoRedirect, isIncludeOverflowAndUnderflowRangeValues, isSkipValuesAlreadyInTrail, mergeConstraints, processFacetTrail, processFacetTrail, processSearchResponse, search, search, search, setAllFacets, setDefaultFacetPriority, setFacetManager, setFacets, setFacetTrail, setFacetTrailTools, setIncludeOverflowAndUnderflowRangeValues, setMinMatchingDocsCount, setQueryRequest, setRefineConfig, setRefineConfigXMLGenerator, setSearchClient, setSearchRequest, setSkipValuesAlreadyInTrail, setTestingMode
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, 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, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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 java.lang.String CLASS_VERSION
Class version string

Constructor Detail

CustomCatalogFacetSearchTools

public CustomCatalogFacetSearchTools()
Constructs an instanceof CustomCatalogFacetSearchTools

Method Detail

setCatalogConstraintFormat

public void setCatalogConstraintFormat(java.lang.String pCatalogConstraintFormat)

getCatalogConstraintFormat

public java.lang.String getCatalogConstraintFormat()

getCatalogSpecificIdPropertyAccessor

public atg.commerce.search.producer.CustomCatalogCategoriesPropertyAccessor getCatalogSpecificIdPropertyAccessor()

setCatalogSpecificIdPropertyAccessor

public void setCatalogSpecificIdPropertyAccessor(atg.commerce.search.producer.CustomCatalogCategoriesPropertyAccessor catalogSpecificIdPropertyAccessor)

getCatalogId

public java.lang.String getCatalogId()

setCatalogId

public void setCatalogId(java.lang.String catalogId)

getCatalogSpecificIdPropertyName

public java.lang.String getCatalogSpecificIdPropertyName()

setCatalogSpecificIdPropertyName

public void setCatalogSpecificIdPropertyName(java.lang.String pCatalogSpecificPropertyId)

setCategoryId

public void setCategoryId(java.lang.String pCategoryId)
Overrides:
setCategoryId in class CommerceFacetSearchTools

getCatalogIds

public java.lang.String[] getCatalogIds()

setCatalogIds

public void setCatalogIds(java.lang.String[] pCatalogIds)

getQueryByCatalog

public boolean getQueryByCatalog()

setQueryByCatalog

public void setQueryByCatalog(boolean pQueryByCatalog)

getCatalogRefineConfig

public RefinementConfiguration getCatalogRefineConfig(FacetTrail pTrail,
                                                      QueryRequest pRequest)
get the refine config

Overrides:
getCatalogRefineConfig in class CommerceFacetSearchTools

getRefineConfig

public RefinementConfiguration getRefineConfig(RepositoryItem pCategoryItem)
Gets the refine config for the given category based on the current catalog.

Overrides:
getRefineConfig in class CommerceFacetSearchTools
Parameters:
pCategoryItem - The category item to retrieve the refine config for.
Returns:
The refine config for the category and current catalog, if defined, otherwise the super method is called.
See Also:
CommerceFacetSearchTools

getAdditionalConstraints

public java.lang.String[] getAdditionalConstraints()
Logic here is that if the queryByCatalog property is false then we don't include create any catalog constraints. If queryByCatalog == true then if the constrainingCatalogs property is non-null we create constraints using the property values. If there more than 1 the constraints are wrapped in an OR-ed ConstraintsGroup. If constrainingCatalogs is null or empty we create a single catalog constraint based on the user/thread default catalog. The combined array of superclass created and locally created stringified constraints are returned by this method.

Overrides:
getAdditionalConstraints in class FacetSearchTools

getSourceItem

protected RepositoryItem getSourceItem(RepositoryItem pCategory)
Gets the source item for a refine config. For custom catalogs this will be the passed in category item or if this is null then the current catalog item.

Overrides:
getSourceItem in class CommerceFacetSearchTools
Parameters:
pCategory - RepositoryItem category
Returns:
RepositoryItem source

getDerivedRefineElements

protected java.util.List getDerivedRefineElements(RepositoryItem pCategory)
Gets the total collection of refine elements for the given category. Attempts to use the current users catalog to get the catalog facets too.

Overrides:
getDerivedRefineElements in class CommerceFacetSearchTools
Parameters:
pCategory - RepositoryItem category to use
Returns:
Collection of facets

findCategory

public RepositoryItem findCategory(java.lang.String pCategoryId)
                            throws RepositoryException
find a category by id. don't verify the catalog if we're in testing mode

Overrides:
findCategory in class CommerceFacetSearchTools
Throws:
RepositoryException

getIdPropertyNameForDocSetPath

protected java.lang.String getIdPropertyNameForDocSetPath()
Overrides:
getIdPropertyNameForDocSetPath in class CommerceFacetSearchTools
Returns:

getIdForDocSetPath

protected java.lang.String getIdForDocSetPath(FacetTrail pTrail)
Overrides:
getIdForDocSetPath in class CommerceFacetSearchTools
Returns:

reorderCategories

public java.util.List<java.lang.String> reorderCategories(java.util.List<java.lang.String> pCategoryIds)
Overrides:
reorderCategories in class CommerceFacetSearchTools

getSearchTestingRefineConfigName

protected java.lang.String getSearchTestingRefineConfigName(RepositoryItem pSourceItem,
                                                            java.lang.String pPrefix)
Description copied from class: CommerceFacetSearchTools
Generate refine-config name for search query executed from Search Testing UI. Should be of the form:- testing-category[categoryId] or testing-catalog[catalogId]_category[categoryId] where Custom Catalogs used

Overrides:
getSearchTestingRefineConfigName in class CommerceFacetSearchTools
Returns:

getDefaultCatalogRepositoryId

protected java.lang.String getDefaultCatalogRepositoryId()
Returns:
default catalog repositoryId for the current user