atg.commerce.endeca.index.producer
Class PriceListPairVariantProducer

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.endeca.index.producer.PriceListPairVariantProducer
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, atg.repository.search.indexing.VariantProducer, java.util.EventListener

public class PriceListPairVariantProducer
extends GenericService
implements atg.repository.search.indexing.VariantProducer

This class creates sets of pricelists for given sites. One variant is produced for each distinct set of pricelists.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  java.lang.String mLanguagesPropertyName
           
protected  java.util.Map<java.lang.String,java.util.List<java.lang.String>> mPriceListLanguages
           
static java.lang.String PRICE_LIST_IDS_KEY
           
 
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
PriceListPairVariantProducer()
           
 
Method Summary
 void determinePriceLists(atg.repository.search.indexing.Context pContext, java.lang.String pPropertyName, RepositoryItem pItem, int pIndex, java.util.Map pUniqueParams)
          Determine price lists based on the context, specifically on the set of sites Pricelists are stored in mPriceListIdArray If pricelists are not in use, mPriceListIdArray is empty This method should be overridden when price lists are determined otherwise This method has the same parameters as method prepareNextVariant
protected  java.util.List<java.lang.String> getLanguagesForSite(atg.multisite.SiteRepositoryImpl pSite)
          This method returns a list of language codes for a site It is repository dependent and used if property languagesPropertyName is undefined (null) If used, this method should be overwritten in a subclass
 java.lang.String getLanguagesPropertyName()
           
 java.util.List<java.lang.String>[] getPriceListIdArray()
          Get the site unique parameter name.
 PriceListManager getPriceListManager()
           
 java.lang.String getPriceListPairUniqueParamName()
          Get the site unique parameter name.
 char getSeparator()
          Returns property mSeparator.
 SiteContextManager getSiteContextManager()
           
 boolean prepareNextVariant(atg.repository.search.indexing.Context pContext, java.lang.String pPropertyName, RepositoryItem pItem, int pIndex, java.util.Map pUniqueParams)
          Get the next (perhaps only) variant.
 void setLanguagesPropertyName(java.lang.String pLanguagesPropertyName)
           
 void setPriceListIdArray(java.util.List<java.lang.String>[] pPriceListIdArray)
          Set the site unique parameter name.
 void setPriceListManager(PriceListManager pPriceListManager)
           
 void setPriceListPairUniqueParamName(java.lang.String pPriceListPairUniqueParamName)
          Set the site unique parameter name.
 void setSeparator(char pSeparator)
          Sets property mSeparator.
 void setSiteContextManager(SiteContextManager pSiteContextManager)
           
 
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
Class version string


PRICE_LIST_IDS_KEY

public static final java.lang.String PRICE_LIST_IDS_KEY
See Also:
Constant Field Values

mLanguagesPropertyName

protected java.lang.String mLanguagesPropertyName

mPriceListLanguages

protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> mPriceListLanguages
Constructor Detail

PriceListPairVariantProducer

public PriceListPairVariantProducer()
Method Detail

getPriceListManager

public PriceListManager getPriceListManager()
Returns:
PriceListManager Get the PriceListManager component.

setPriceListManager

public void setPriceListManager(PriceListManager pPriceListManager)
Parameters:
pPriceListManager - Sets a new PriceListManager component.

getSiteContextManager

public SiteContextManager getSiteContextManager()
Returns:
the mSiteContextManager

setSiteContextManager

public void setSiteContextManager(SiteContextManager pSiteContextManager)
Parameters:
mSiteContextManager - the mSiteContextManager to set

setPriceListPairUniqueParamName

public void setPriceListPairUniqueParamName(java.lang.String pPriceListPairUniqueParamName)
Set the site unique parameter name.


getPriceListPairUniqueParamName

public java.lang.String getPriceListPairUniqueParamName()
Get the site unique parameter name.


setPriceListIdArray

public void setPriceListIdArray(java.util.List<java.lang.String>[] pPriceListIdArray)
Set the site unique parameter name.


getPriceListIdArray

public java.util.List<java.lang.String>[] getPriceListIdArray()
Get the site unique parameter name.


setSeparator

public void setSeparator(char pSeparator)
Sets property mSeparator.


getSeparator

public char getSeparator()
Returns property mSeparator.


getLanguagesPropertyName

public java.lang.String getLanguagesPropertyName()
Returns:
the String

setLanguagesPropertyName

public void setLanguagesPropertyName(java.lang.String pLanguagesPropertyName)
Parameters:
pLanguagesPropertyName - the String to set

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 (perhaps only) variant. This method is invoked before values for a given document are obtained. A minimal implementation would return true once per item.

Specified by:
prepareNextVariant in interface atg.repository.search.indexing.VariantProducer
Parameters:
pContext - The current context. Contains the current URL, the stack of parent items, etc.
pPropertyName - the name of the property that corresponds to pItem. For a top-level item, will be null.
pItem - the document-level (is-document) repository item.
pIndex - the index/count for the variant. This index only applies to the current set of parents.
pUniqueParams - the parameters that will be added to the item's URI to differentiate it from other documents representing the same repository item. Keys and values should all be strings.
Returns:
True if the next variant was prepared and a document should be generated. False if no document should be generated.

determinePriceLists

public void determinePriceLists(atg.repository.search.indexing.Context pContext,
                                java.lang.String pPropertyName,
                                RepositoryItem pItem,
                                int pIndex,
                                java.util.Map pUniqueParams)
Determine price lists based on the context, specifically on the set of sites Pricelists are stored in mPriceListIdArray If pricelists are not in use, mPriceListIdArray is empty This method should be overridden when price lists are determined otherwise This method has the same parameters as method prepareNextVariant


getLanguagesForSite

protected java.util.List<java.lang.String> getLanguagesForSite(atg.multisite.SiteRepositoryImpl pSite)
This method returns a list of language codes for a site It is repository dependent and used if property languagesPropertyName is undefined (null) If used, this method should be overwritten in a subclass