public class PriceListPairVariantProducer extends GenericService implements VariantProducer
Modifier and Type | Class and Description |
---|---|
class |
PriceListPairVariantProducer.PriceListsData
The data about available PriceLists.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
protected java.lang.String |
mLanguagesPropertyName |
static java.lang.String |
PRICE_LIST_IDS_KEY
The context attribute for the pricelistIds ("price list pair", even
though it may only contain a list price list ID if there is no sale
price) for the current product.
|
static java.lang.String |
PRICE_LISTS_DATA_KEY
The global context attribute for the PriceListData for the
current indexing run.
|
static java.lang.String |
PRICE_LISTS_IDS_INDEX_KEY
The context attribute for the current price list pair's index into
the PriceListData's priceListIdArray().
|
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
PriceListPairVariantProducer() |
Modifier and Type | Method and Description |
---|---|
protected void |
addPriceListLanguages(java.lang.String pPriceListId,
java.util.List<java.lang.String> pLanguages,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> pPriceListLanguages)
Add a list of languages to the price list to languages map for a price list.
|
protected PriceListPairVariantProducer.PriceListsData |
createPriceListsData()
Create a new instance of PriceListsData, which will be
store as a global attribute on the Context object.
|
void |
determinePriceLists(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.
|
protected java.util.List<java.lang.String> |
getLanguagesForSite(Site pSite)
This method returns a list of language codes for a site.
|
java.lang.String |
getLanguagesPropertyName() |
PriceListManager |
getPriceListManager() |
java.lang.String |
getPriceListPairUniqueParamName()
Get the site unique parameter name.
|
char |
getSeparator()
Returns property mSeparator.
|
SiteContextManager |
getSiteContextManager() |
protected java.util.Set<java.lang.String> |
getSiteIdsForPriceListPairs(Context pContext)
Return the set of SiteIDs from which to calculate PriceListPairs.
|
protected boolean |
isPricelistRelevant(Context pContext,
PriceListPairVariantProducer.PriceListsData pPriceListsData,
RepositoryItem pItem,
java.lang.String pLanguage,
java.util.List<java.lang.String> pPriceListIds)
Return whether the current pricelist pair represented by pPriceListId
is relevant to the current indexing context.
|
protected void |
populatePriceListsData(Context pContext,
PriceListPairVariantProducer.PriceListsData pPriceListData)
Populate the PriceListData object pPriceListData by calculating
current approriate pricelists and associated languages and setting
the relevant properties of PriceListData.
|
boolean |
prepareNextVariant(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 |
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) |
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
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static java.lang.String CLASS_VERSION
public static final java.lang.String PRICE_LIST_IDS_KEY
public static final java.lang.String PRICE_LISTS_DATA_KEY
public static final java.lang.String PRICE_LISTS_IDS_INDEX_KEY
protected java.lang.String mLanguagesPropertyName
public PriceListManager getPriceListManager()
public void setPriceListManager(PriceListManager pPriceListManager)
pPriceListManager
- Sets a new PriceListManager component.public SiteContextManager getSiteContextManager()
public void setSiteContextManager(SiteContextManager pSiteContextManager)
mSiteContextManager
- the mSiteContextManager to setpublic void setPriceListPairUniqueParamName(java.lang.String pPriceListPairUniqueParamName)
public java.lang.String getPriceListPairUniqueParamName()
public void setSeparator(char pSeparator)
public char getSeparator()
public java.lang.String getLanguagesPropertyName()
public void setLanguagesPropertyName(java.lang.String pLanguagesPropertyName)
pLanguagesPropertyName
- the String to setpublic boolean prepareNextVariant(Context pContext, java.lang.String pPropertyName, RepositoryItem pItem, int pIndex, java.util.Map pUniqueParams)
prepareNextVariant
in interface VariantProducer
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.protected PriceListPairVariantProducer.PriceListsData createPriceListsData()
public void determinePriceLists(Context pContext, java.lang.String pPropertyName, RepositoryItem pItem, int pIndex, java.util.Map pUniqueParams)
protected void populatePriceListsData(Context pContext, PriceListPairVariantProducer.PriceListsData pPriceListData) throws RepositoryException, SiteContextException
pContext
- the current indexing context.pPriceListData
- the price list data object to populate.RepositoryException
SiteContextException
protected void addPriceListLanguages(java.lang.String pPriceListId, java.util.List<java.lang.String> pLanguages, java.util.Map<java.lang.String,java.util.List<java.lang.String>> pPriceListLanguages)
pPriceListId
- price list idpLanguages
- languages to add to map of price list to languagespPriceListLanguages
- map of price list to languagesprotected java.util.Set<java.lang.String> getSiteIdsForPriceListPairs(Context pContext)
protected boolean isPricelistRelevant(Context pContext, PriceListPairVariantProducer.PriceListsData pPriceListsData, RepositoryItem pItem, java.lang.String pLanguage, java.util.List<java.lang.String> pPriceListIds)
pContext
- the current indexing context.pLanguage
- the current language being indexed (as calculated
from the currentDocumentLocale of pContext).pPriceListData
- the PriceListData representing available
pricelist pairs and associated language information.pPriceListIds
- the pair of pricelist IDs in questionpItem
- the current repository item on whose behalf a variant
is being produced.protected java.util.List<java.lang.String> getLanguagesForSite(Site pSite)