atg.commerce.search.producer
Class CustomCatalogVariantProducer

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.search.producer.CustomCatalogVariantProducer
All Implemented Interfaces:
IndexConstants, 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, atg.repository.search.indexing.producer.UpdateFromRequestVariantProducer, atg.repository.search.indexing.VariantProducer, java.util.EventListener

public class CustomCatalogVariantProducer
extends GenericService
implements atg.repository.search.indexing.VariantProducer, atg.repository.search.indexing.producer.UpdateFromRequestVariantProducer, IndexConstants

A VariantProducer that produces a variant for each ancestor catalog of the indexing document item type.

See Also:
atg.repository.search.index.producer.VariantProducer

Nested Class Summary
 
Nested classes/interfaces inherited from interface atg.repository.search.indexing.producer.UpdateFromRequestVariantProducer
atg.repository.search.indexing.producer.UpdateFromRequestVariantProducer.UpdateAndRestoreRequestStateHelper<T,E extends java.lang.Throwable>
 
Field Summary
static java.lang.String CLASS_VERSION
           
protected  CatalogProperties mCatalogProperties
           
protected  boolean mEnableCatalogVariants
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.commerce.search.IndexConstants
CATALOG_ATTR, CATALOGS_ITER_ATTR
 
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
CustomCatalogVariantProducer()
           
 
Method Summary
protected  java.util.Collection getAncestorCatalogs(atg.repository.search.indexing.Context pContext, RepositoryItem pItem, java.util.Map<java.lang.String,java.lang.String> pUniqueParams)
          Gets the ancestor catalogs for the given item type.
protected  java.util.Collection getAncestorCatalogsForCategory(atg.repository.search.indexing.Context pContext, RepositoryItem pCategory, RepositoryItemDescriptor pBaseItemDescriptor, java.util.Map<java.lang.String,java.lang.String> pUniqueParams)
          Gets the ancestor catalogs for the given category.
protected  java.util.Collection getAncestorCatalogsForProduct(atg.repository.search.indexing.Context pContext, RepositoryItem pProduct, RepositoryItemDescriptor pBaseItemDescriptor, java.util.Map<java.lang.String,java.lang.String> pUniqueParams)
          Gets the ancestor catalogs for the given category.
protected  java.util.Collection getAncestorCatalogsForSku(atg.repository.search.indexing.Context pContext, RepositoryItem pSku, RepositoryItemDescriptor pBaseItemDescriptor, java.util.Map<java.lang.String,java.lang.String> pUniqueParams)
          Gets the ancestor catalogs for the given category.
 java.lang.String getCatalogProfilePropertyName()
          Returns property catalogProfilePropertyName.
 CatalogProperties getCatalogProperties()
          Gets the CatalogProperties object that holds meta-data about the names of item-descriptors and property-descriptors used in custom catalogs.
 boolean isEnableCatalogVariants()
          Gets the enableCatalogVariants property.
 boolean prepareNextVariant(atg.repository.search.indexing.Context pContext, java.lang.String pPropertyName, RepositoryItem pItem, int pIndex, java.util.Map pUniqueParams)
          Get the next variant.
 void restoreRequestState(DynamoHttpServletRequest pRequest, java.lang.Object pRestoreObject)
           
 void setCatalogProfilePropertyName(java.lang.String pCatalogProfilePropertyName)
          Sets property catalogProfilePropertyName.
 void setCatalogProperties(CatalogProperties pCatalogProperties)
          Sets the CatalogProperties object that holds meta-data about the names of item-descriptors and property-descriptors used in custom catalogs.
 void setEnableCatalogVariants(boolean pEnableCatalogVariants)
          Sets the enableCatalogVariants property.
 void updateContextToReflectRequest(atg.repository.search.indexing.Context pContext, DynamoHttpServletRequest pRequest, java.util.Map<java.lang.String,java.lang.String> pUniqueParams)
           
 java.lang.Object updateRequestStateFromParameterMap(DynamoHttpServletRequest pRequest, atg.repository.search.indexing.IndexingOutputConfig pIndexingOutputConfig, java.util.Map<java.lang.String,java.lang.String> pUniqueParams)
           
 
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 java.lang.String CLASS_VERSION

mEnableCatalogVariants

protected boolean mEnableCatalogVariants

mCatalogProperties

protected CatalogProperties mCatalogProperties
Constructor Detail

CustomCatalogVariantProducer

public CustomCatalogVariantProducer()
Method Detail

setCatalogProfilePropertyName

public void setCatalogProfilePropertyName(java.lang.String pCatalogProfilePropertyName)
Sets property catalogProfilePropertyName. Name of the catalog property of the user profile. Used by updateContextToReflectRequest.


getCatalogProfilePropertyName

public java.lang.String getCatalogProfilePropertyName()
Returns property catalogProfilePropertyName. Name of the catalog property of the user profile. Used by updateContextToReflectRequest.


isEnableCatalogVariants

public boolean isEnableCatalogVariants()
Gets the enableCatalogVariants property. If true, calls to prepareNextVariant will return a variant for each ancestor catalog.

This property accessor is used to index multiple versions of products when they contain catalog specific values in their info objects. If your custom catalog definition does not include any catalog specific properties, then catalog variant generation should be disabled. If you add any catalog specific properties that you would like to index, then you should set enableCatalogVariants to 'true' so that a product document is generated for each of the catalogs it is contained in.


setEnableCatalogVariants

public void setEnableCatalogVariants(boolean pEnableCatalogVariants)
Sets the enableCatalogVariants property. If true, calls to prepareNextVariant will return a variant for each ancestor catalog.


getCatalogProperties

public CatalogProperties getCatalogProperties()
Gets the CatalogProperties object that holds meta-data about the names of item-descriptors and property-descriptors used in custom catalogs.


setCatalogProperties

public void setCatalogProperties(CatalogProperties pCatalogProperties)
Sets the CatalogProperties object that holds meta-data about the names of item-descriptors and property-descriptors used in custom catalogs.


prepareNextVariant

public boolean prepareNextVariant(atg.repository.search.indexing.Context pContext,
                                  java.lang.String pPropertyName,
                                  RepositoryItem pItem,
                                  int pIndex,
                                  java.util.Map pUniqueParams)
Get the next variant. This method sets up the different variants of a catalog item based on the ancestor catalogs of a product. Each time this method is called by the loader, it will get the next ancestorCatalog from the product and set it to a context attribute. It will then return true. Once each ancestorCatalog of the product has been visited, this method will return false when called.

Specified by:
prepareNextVariant in interface atg.repository.search.indexing.VariantProducer
Parameters:
pContext - the current context.
pPropertyName - the name of the property in question
pItem - the original context item.
pIndex - the index of the variant
pUniqueParams - the parameters that will be added to the items URI. Keys and values should all be strings.

getAncestorCatalogs

protected java.util.Collection getAncestorCatalogs(atg.repository.search.indexing.Context pContext,
                                                   RepositoryItem pItem,
                                                   java.util.Map<java.lang.String,java.lang.String> pUniqueParams)
Gets the ancestor catalogs for the given item type.


getAncestorCatalogsForCategory

protected java.util.Collection getAncestorCatalogsForCategory(atg.repository.search.indexing.Context pContext,
                                                              RepositoryItem pCategory,
                                                              RepositoryItemDescriptor pBaseItemDescriptor,
                                                              java.util.Map<java.lang.String,java.lang.String> pUniqueParams)
Gets the ancestor catalogs for the given category.


getAncestorCatalogsForProduct

protected java.util.Collection getAncestorCatalogsForProduct(atg.repository.search.indexing.Context pContext,
                                                             RepositoryItem pProduct,
                                                             RepositoryItemDescriptor pBaseItemDescriptor,
                                                             java.util.Map<java.lang.String,java.lang.String> pUniqueParams)
Gets the ancestor catalogs for the given category.


getAncestorCatalogsForSku

protected java.util.Collection getAncestorCatalogsForSku(atg.repository.search.indexing.Context pContext,
                                                         RepositoryItem pSku,
                                                         RepositoryItemDescriptor pBaseItemDescriptor,
                                                         java.util.Map<java.lang.String,java.lang.String> pUniqueParams)
Gets the ancestor catalogs for the given category.


updateContextToReflectRequest

public void updateContextToReflectRequest(atg.repository.search.indexing.Context pContext,
                                          DynamoHttpServletRequest pRequest,
                                          java.util.Map<java.lang.String,java.lang.String> pUniqueParams)
Specified by:
updateContextToReflectRequest in interface atg.repository.search.indexing.producer.UpdateFromRequestVariantProducer

updateRequestStateFromParameterMap

public java.lang.Object updateRequestStateFromParameterMap(DynamoHttpServletRequest pRequest,
                                                           atg.repository.search.indexing.IndexingOutputConfig pIndexingOutputConfig,
                                                           java.util.Map<java.lang.String,java.lang.String> pUniqueParams)
Specified by:
updateRequestStateFromParameterMap in interface atg.repository.search.indexing.producer.UpdateFromRequestVariantProducer

restoreRequestState

public void restoreRequestState(DynamoHttpServletRequest pRequest,
                                java.lang.Object pRestoreObject)
Specified by:
restoreRequestState in interface atg.repository.search.indexing.producer.UpdateFromRequestVariantProducer