atg.commerce.pricing
Class ConfigurableItemPriceCalculator

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.pricing.ItemPriceCalculator
              extended by atg.commerce.pricing.ConfigurableItemPriceCalculator
All Implemented Interfaces:
ItemPriceSourceHandler, ItemPricingCalculator, 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, java.util.EventListener

public class ConfigurableItemPriceCalculator
extends ItemPriceCalculator

A calculator which calculates the list price of a configurable item and sets the itemPriceInfo to be that amount. This will set the list price with the prices of the subskus that the configurable item is configured with. If the configurable item is on sale then the sale price will also be modified.

See Also:
ItemPriceInfo

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
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
ConfigurableItemPriceCalculator()
           
 
Method Summary
 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 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
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 with the given price in addition to the sum of the 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 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
 
Methods inherited from class atg.commerce.pricing.ItemPriceCalculator
getItemPriceSource, getLoggingIdentifier, getPrice, getPricePropertyName, getPriceSource, getPriceSource, isPriceFromCatalogRef, isRequirePriceValue, populateItemPriceSource, priceEachItem, priceItems, setLoggingIdentifier, setPriceFromCatalogRef, setPricePropertyName, setRequirePriceValue, shouldConsumeSource
 
Methods inherited from class atg.nucleus.GenericService
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
 
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

Constructor Detail

ConfigurableItemPriceCalculator

public ConfigurableItemPriceCalculator()
Method Detail

setPricingTools

public void setPricingTools(PricingTools pPricingTools)
pricing tools to help with price calculation

Overrides:
setPricingTools in class ItemPriceCalculator
Parameters:
pPricingTools - new value to set

getPricingTools

public PricingTools getPricingTools()
pricing tools to help with price calculation

Overrides:
getPricingTools in class ItemPriceCalculator
Returns:
property PricingTools

getSalePricePropertyName

public java.lang.String getSalePricePropertyName()
Returns property salePricePropertyName

Returns:
returns property salePricePropertyName

setSalePricePropertyName

public void setSalePricePropertyName(java.lang.String pSalePricePropertyName)
Sets property salePricePropertyName

Parameters:
pSalePricePropertyName - the value to set for property salePricePropertyName

setOnSalePropertyName

public void setOnSalePropertyName(java.lang.String pOnSalePropertyName)
Sets property OnSalePropertyName


getOnSalePropertyName

public java.lang.String getOnSalePropertyName()
Returns property OnSalePropertyName


getConfigurationOptionsPricePropertyName

public java.lang.String getConfigurationOptionsPricePropertyName()
Returns property configurationOptionsPricePropertyName

Returns:
returns property configurationOptionsPricePropertyName

setConfigurationOptionsPricePropertyName

public void setConfigurationOptionsPricePropertyName(java.lang.String pConfigurationOptionsPricePropertyName)
Sets property configurationOptionsPricePropertyName

Parameters:
pConfigurationOptionsPricePropertyName - the value to set for property configurationOptionsPricePropertyName

getConfigurablePropertiesPropertyName

public java.lang.String getConfigurablePropertiesPropertyName()
Returns property ConfigurablePropertiesPropertyName

Returns:
returns property ConfigurablePropertiesPropertyName

setConfigurablePropertiesPropertyName

public void setConfigurablePropertiesPropertyName(java.lang.String pConfigurablePropertiesPropertyName)
Sets property ConfigurablePropertiesPropertyName

Parameters:
pConfigurablePropertiesPropertyName - the value to set for property ConfigurablePropertiesPropertyName

getConfigurationOptionsPropertyName

public java.lang.String getConfigurationOptionsPropertyName()
Returns property ConfigurationOptionsPropertyName

Returns:
returns property ConfigurationOptionsPropertyName

setConfigurationOptionsPropertyName

public void setConfigurationOptionsPropertyName(java.lang.String pConfigurationOptionsPropertyName)
Sets property ConfigurationOptionsPropertyName

Parameters:
pConfigurationOptionsPropertyName - the value to set for property ConfigurationOptionsPropertyName

getConfigurationOptionSkuPropertyName

public java.lang.String getConfigurationOptionSkuPropertyName()
Returns property ConfigurationOptionSkuPropertyName

Returns:
returns property ConfigurationOptionSkuPropertyName

setConfigurationOptionSkuPropertyName

public void setConfigurationOptionSkuPropertyName(java.lang.String pConfigurationOptionSkuPropertyName)
Sets property ConfigurationOptionSkuPropertyName

Parameters:
pConfigurationOptionSkuPropertyName - the value to set for property ConfigurationOptionSkuPropertyName

getConfigItemSubSkuMap

public java.util.Map getConfigItemSubSkuMap()
Returns property configItemSubSkuMap

Returns:
returns property configItemSubSkuMap

clearConfigItemSubSkuMap

public void clearConfigItemSubSkuMap()
Clear the configItemSubSkuMap.


getSalePrice

protected double getSalePrice(java.lang.Object pPriceSource)
                       throws PricingException
Throws:
PricingException

priceItem

public void priceItem(ItemPriceInfo pPriceQuote,
                      CommerceItem pItem,
                      RepositoryItem pPricingModel,
                      java.util.Locale pLocale,
                      RepositoryItem pProfile,
                      java.util.Map pExtraParameters)
               throws PricingException
Price a single item in a context

Specified by:
priceItem in interface ItemPricingCalculator
Overrides:
priceItem in class ItemPriceCalculator
Parameters:
pPriceQuote - ItemPriceInfo representing the current price quote for the item
pItem - The item to price
pPricingModel - A RepositoryItem representing a PricingModel
pProfile - The user's profile
pExtraParameters - A Map of extra parameters to be used in the pricing, may be null
Throws:
PricingException
See Also:
ItemPriceCalculator.getPriceSource(ItemPriceInfo, CommerceItem, RepositoryItem, Locale, RepositoryItem, Map)

priceItem

protected void priceItem(double pPrice,
                         ItemPriceInfo pPriceQuote,
                         CommerceItem pItem,
                         RepositoryItem pPricingModel,
                         java.util.Locale pLocale,
                         RepositoryItem pProfile,
                         java.util.Map pExtraParameters)
                  throws PricingException
Sets the list price or sale price with the given price in addition to the sum of the sub sku prices.

Specified by:
priceItem in class ItemPriceCalculator
Parameters:
pPrice - the price as extracted from the item
pPriceQuote - ItemPriceInfo representing the current price quote for the item
pItem - The item to price
pPricingModel - A RepositoryItem representing a PricingModel
pLocale - the locale in which this item should be priced
pProfile - The user's profile
pExtraParameters - A Map of extra parameters to be used in the pricing, may be null
Throws:
PricingException - if there was a problem pricing the input pItem

onSale

protected boolean onSale(java.lang.Object pPriceSource)
                  throws PricingException
Returns true if the commerce item to be priced is on sale

Throws:
PricingException

doStartService

public void doStartService()
                    throws ServiceException
Description copied from class: GenericService
This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values. The Service should override this method to start any processes it requires.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the Service had a problem starting up