public class ConfigurableItemPriceCalculator extends ItemPriceCalculator
ItemPriceInfo
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 |
---|
ConfigurableItemPriceCalculator() |
Modifier and Type | Method and Description |
---|---|
void |
clearConfigItemSubSkuMap()
Clear the configItemSubSkuMap.
|
void |
doStartService()
This is called after a Service has been created, placed into the
naming hierarchy, and initialized with its configured property
values.
|
java.util.Map |
getConfigItemSubSkuMap()
Returns property configItemSubSkuMap
|
java.lang.String |
getConfigurablePropertiesPropertyName()
Returns property ConfigurablePropertiesPropertyName
|
java.lang.String |
getConfigurationOptionItemType()
Returns the item type for configurationOption catalog items
|
java.lang.String |
getConfigurationOptionSkuPropertyName()
Returns property ConfigurationOptionSkuPropertyName
|
java.lang.String |
getConfigurationOptionsPricePropertyName()
Returns property configurationOptionsPricePropertyName
|
java.lang.String |
getConfigurationOptionsPropertyName()
Returns property ConfigurationOptionsPropertyName
|
java.lang.String |
getOnSalePropertyName()
Returns property OnSalePropertyName
|
PricingTools |
getPricingTools()
pricing tools to help with price calculation
|
protected double |
getSalePrice(java.lang.Object pPriceSource) |
java.lang.String |
getSalePricePropertyName()
Returns property salePricePropertyName
|
long |
getSubSkuQuantity(CommerceItem pSubItem)
Get the quantity for the given subsku.
|
double |
getSubSkuQuantityDerivedAsFloatingPoint(CommerceItem pSubItem)
Get the quantity for the given subsku.
|
double |
getSubSkuQuantityWithFraction(CommerceItem pSubItem)
Get the quantity (with fraction) for the given subsku.
|
protected boolean |
onSale(java.lang.Object pPriceSource)
Returns true if the commerce item to be priced is on sale
|
protected void |
priceItem(double pPrice,
ItemPriceInfo pPriceQuote,
CommerceItem pItem,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Sets the list price or sale price of the head of a configurable item tree
with the given price in addition to the sum of the sub sku prices.
|
protected void |
priceItem(double pPrice,
ItemPriceInfo pPriceQuote,
ConfigurableCommerceItem pItem,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters,
boolean pOnSale)
Sets the list price or sale price of any configurable item within a tree
with the given price in addition to the sum of its sub sku prices.
|
void |
priceItem(ItemPriceInfo pPriceQuote,
CommerceItem pItem,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price a single item in a context
|
void |
setConfigurablePropertiesPropertyName(java.lang.String pConfigurablePropertiesPropertyName)
Sets property ConfigurablePropertiesPropertyName
|
void |
setConfigurationOptionItemType(java.lang.String pConfigurationOptionItemType)
Sets the item type for configurationOption catalog items
|
void |
setConfigurationOptionSkuPropertyName(java.lang.String pConfigurationOptionSkuPropertyName)
Sets property ConfigurationOptionSkuPropertyName
|
void |
setConfigurationOptionsPricePropertyName(java.lang.String pConfigurationOptionsPricePropertyName)
Sets property configurationOptionsPricePropertyName
|
void |
setConfigurationOptionsPropertyName(java.lang.String pConfigurationOptionsPropertyName)
Sets property ConfigurationOptionsPropertyName
|
void |
setOnSalePropertyName(java.lang.String pOnSalePropertyName)
Sets property OnSalePropertyName
|
void |
setPricingTools(PricingTools pPricingTools)
pricing tools to help with price calculation
|
void |
setSalePricePropertyName(java.lang.String pSalePricePropertyName)
Sets property salePricePropertyName
|
getItemPriceSource, getLoggingIdentifier, getPrice, getPricePropertyName, getPriceSource, getPriceSource, isPriceFromCatalogRef, isRequirePriceValue, populateItemPriceSource, priceEachItem, priceItems, setLoggingIdentifier, setPriceFromCatalogRef, setPricePropertyName, setRequirePriceValue, shouldConsumeSource
addLogListener, createAdminServlet, 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)
setPricingTools
in class ItemPriceCalculator
pPricingTools
- new value to setpublic PricingTools getPricingTools()
getPricingTools
in class ItemPriceCalculator
public java.lang.String getSalePricePropertyName()
public void setSalePricePropertyName(java.lang.String pSalePricePropertyName)
pSalePricePropertyName
- the value to set for property salePricePropertyNamepublic void setOnSalePropertyName(java.lang.String pOnSalePropertyName)
public java.lang.String getOnSalePropertyName()
public java.lang.String getConfigurationOptionsPricePropertyName()
public void setConfigurationOptionsPricePropertyName(java.lang.String pConfigurationOptionsPricePropertyName)
pConfigurationOptionsPricePropertyName
- the value to set for property configurationOptionsPricePropertyNamepublic java.lang.String getConfigurablePropertiesPropertyName()
public void setConfigurablePropertiesPropertyName(java.lang.String pConfigurablePropertiesPropertyName)
pConfigurablePropertiesPropertyName
- the value to set for property ConfigurablePropertiesPropertyNamepublic java.lang.String getConfigurationOptionsPropertyName()
public void setConfigurationOptionsPropertyName(java.lang.String pConfigurationOptionsPropertyName)
pConfigurationOptionsPropertyName
- the value to set for property ConfigurationOptionsPropertyNamepublic java.lang.String getConfigurationOptionSkuPropertyName()
public void setConfigurationOptionSkuPropertyName(java.lang.String pConfigurationOptionSkuPropertyName)
pConfigurationOptionSkuPropertyName
- the value to set for property ConfigurationOptionSkuPropertyNamepublic java.lang.String getConfigurationOptionItemType()
public void setConfigurationOptionItemType(java.lang.String pConfigurationOptionItemType)
pConfigurationOptionItemType
- the value to set for property ConfigurationOptionItemTypepublic java.util.Map getConfigItemSubSkuMap()
public void clearConfigItemSubSkuMap()
protected double getSalePrice(java.lang.Object pPriceSource) throws PricingException
PricingException
public void priceItem(ItemPriceInfo pPriceQuote, CommerceItem pItem, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
priceItem
in interface ItemPricingCalculator
priceItem
in class ItemPriceCalculator
pPriceQuote
- ItemPriceInfo representing the current price quote for the itempItem
- The item to pricepPricingModel
- A RepositoryItem representing a PricingModelpProfile
- The user's profilepExtraParameters
- A Map of extra parameters to be used in the pricing, may be nullPricingException
ItemPriceCalculator.getPriceSource(ItemPriceInfo, CommerceItem, RepositoryItem, Locale, RepositoryItem, Map)
protected void priceItem(double pPrice, ItemPriceInfo pPriceQuote, CommerceItem pItem, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
Each subitem contributes a PricingAdjustment to the parent item's ItemPriceInfo and to all of its DetailedItemPriceInfos. The subitem also gets its own ItemPriceInfo, a DetailedItemPriceInfo, and a single PricingAdjustment on each. All of the PricingAdjustments contain the same information.
priceItem
in class ItemPriceCalculator
pPrice
- the price as extracted from the itempPriceQuote
- 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 pItemprotected void priceItem(double pPrice, ItemPriceInfo pPriceQuote, ConfigurableCommerceItem pItem, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters, boolean pOnSale) throws PricingException
Each subitem contributes a PricingAdjustment to the parent item's ItemPriceInfo and to all of its DetailedItemPriceInfos. The subitem also gets its own ItemPriceInfo, a DetailedItemPriceInfo, and a single PricingAdjustment on each. All of the PricingAdjustments contain the same information.
pPrice
- the item's list or sale price, as appropriate for the item's price source
(a sku or configurationOption)pPriceQuote
- ItemPriceInfo representing the current price quote for the item. If
the item is on sale, pPriceQuote.listPrice
must already
be filled in with the item's base price (without sub skus).pItem
- The parent 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 nullpOnSale
- true
if pPrice
is a sale pricePricingException
- if there was a problem pricing the input pItemprotected boolean onSale(java.lang.Object pPriceSource) throws PricingException
PricingException
public long getSubSkuQuantity(CommerceItem pSubItem)
pSubItem
- The CommerceItem object for the sub skupublic double getSubSkuQuantityWithFraction(CommerceItem pSubItem)
pSubItem
- The CommerceItem object for the sub skupublic double getSubSkuQuantityDerivedAsFloatingPoint(CommerceItem pSubItem)
If the subsku's quantity is fractional, then that value will be returned, otherwise a double representation of the subsku's quantity value.
pSubItem
- The CommerceItem object for the sub skupublic void doStartService() throws ServiceException
GenericService
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting up