public class ItemSalesPriceCalculator extends GenericService implements ItemSchemePriceCalculator, ItemPriceSourceHandler
ItemSchemePriceCalculator
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
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 |
---|
ItemSalesPriceCalculator() |
Modifier and Type | Method and Description |
---|---|
ItemPriceSource |
getItemPriceSource(ItemPriceInfo pPriceQuote,
CommerceItem pItem,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
This method is called by the calculator to return the
ItemPriceSource that
should be used to price the given CommerceItem |
PricingTools |
getPricingTools()
pricing tools to help with price calculation
|
java.lang.Double |
getSalePrice(ItemPriceSource pItemPriceSource,
RepositoryItem pPrice,
ItemPriceInfo pPriceQuote,
CommerceItem pItem,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
This method is called by the calculator to provide the sale price to price the given commerce item.
|
java.lang.String |
getSalesPricePropertyName()
the name of the property for the SalesPrice
|
boolean |
populateItemPriceSource(ItemPriceSource pItemPriceSource,
Order pOrder,
CommerceItem pCommerceItem,
CommerceItem pParentCommerceItem,
java.util.Map pExtraParameters)
Sets the sale price property of the given source based on the matching PricingAdjustment
found on the given commerce item.
|
void |
priceItem(RepositoryItem pPrice,
ItemPriceInfo pPriceQuote,
CommerceItem pItem,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Sets the sales price with the given determined price
|
void |
setPricingTools(PricingTools pPricingTools)
pricing tools to help with price calculation
|
void |
setSalesPricePropertyName(java.lang.String pSalesPricePropertyName)
the name of the property for the SalesPrice
|
boolean |
shouldConsumeSource(ItemPriceSource pItemPriceSource)
This method is called to determine the given source should be used by the calculator
to price the item.
|
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 void setPricingTools(PricingTools pPricingTools)
pPricingTools
- new value to setpublic PricingTools getPricingTools()
public void setSalesPricePropertyName(java.lang.String pSalesPricePropertyName)
pSalesPricePropertyName
- new value to setpublic java.lang.String getSalesPricePropertyName()
public void priceItem(RepositoryItem pPrice, ItemPriceInfo pPriceQuote, CommerceItem pItem, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
This method calls getSalePrice
to determine the sale
price that should be used to price the item.
priceItem
in interface ItemSchemePriceCalculator
pPrice
- the price as extracted from the PriceListpPriceQuote
- ItemPriceInfo representing the current price quote for the itempItem
- The item to pricepPricingModel
- A RepositoryItem representing a PricingModelpLocale
- the locale in which this item should be pricedpProfile
- The user's profilepExtraParameters
- A Map of extra parameters to be used in the pricing, may be nullPricingException
- if there was a problem pricing the input pItemgetSalePrice(ItemPriceSource, RepositoryItem, ItemPriceInfo, CommerceItem, RepositoryItem, Locale, RepositoryItem, Map)
public java.lang.Double getSalePrice(ItemPriceSource pItemPriceSource, RepositoryItem pPrice, ItemPriceInfo pPriceQuote, CommerceItem pItem, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
This method first checks for a ItemPriceSource and returns its sale price. Otherwise, it returns the sale price from the given price repository item.
pItemPriceSource
- the ItemPriceSource
that is being use to price the item. The value can be null when
no source is being used.pPrice
- the price object found for the item. This value can be null when a price source is being used.pPriceQuote
- the current price infopItem
- the item being pricedpPricingModel
- pLocale
- pProfile
- pExtraParameters
- the extra parameter mapPricingException
public ItemPriceSource getItemPriceSource(ItemPriceInfo pPriceQuote, CommerceItem pItem, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters)
ItemPriceSource
that
should be used to price the given CommerceItem
getItemPriceSource
in interface ItemPriceSourceHandler
pPriceQuote
- the new ItemPriceInfo for that's being generated in the pricing operationpItem
- the commerce item that's being pricedpPricingModel
- the current pricing modelpLocale
- the localepProfile
- the customer profile referencepExtraParameters
- the extra parameter map passed to the pricing operation.PricingTools.getItemPriceSource(ItemPriceInfo, CommerceItem, RepositoryItem, Locale, RepositoryItem, Map)
public boolean populateItemPriceSource(ItemPriceSource pItemPriceSource, Order pOrder, CommerceItem pCommerceItem, CommerceItem pParentCommerceItem, java.util.Map pExtraParameters)
populateItemPriceSource
in interface ItemPriceSourceHandler
pItemPriceSource
- the source being generated and populated with pricing data.pOrder
- the OrderpCommerceItem
- the item for which the source is being createdpParentCommerceItem
- the item that contained pCommerceItempExtraParameters
- an extra parameter map that was original passed to the call to generate the source objects#findAdjustment(ItemPriceInfo)
public boolean shouldConsumeSource(ItemPriceSource pItemPriceSource)
This implementation always returns true since the parent price list calculator decides
which scheme calculator should price the item based on the priceListScheme
in the ItemPriceSource
shouldConsumeSource
in interface ItemPriceSourceHandler