atg.commerce.pricing
Class ItemSalePriceCalculator

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.ItemSalePriceCalculator
All Implemented Interfaces:
ItemPricingCalculator, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class ItemSalePriceCalculator
extends ItemPriceCalculator

A calculator which determines the sale price of an item and discounts the itemPriceInfo to that amount, while at the same time maintaining the audit trail of the ItemPriceInfo. There is no rule associate with this calculator. If one of ItemSalePriceCalculator's pricing methods is invoked, all input items are discounted to the sale price.

Properties:

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
ItemSalePriceCalculator()
           
 
Method Summary
 void doStartService()
          This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values.
 java.lang.String getOnSalePropertyName()
          Returns property OnSalePropertyName
 PricingTools getPricingTools()
          pricing tools for help in generating prices
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 sale price with the given determined price
 void priceItem(ItemPriceInfo pPriceQuote, CommerceItem pItem, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters)
          If the item should be priced as a sales item (method onSale return true) then go ahead an price it
 void setOnSalePropertyName(java.lang.String pOnSalePropertyName)
          Sets property OnSalePropertyName
 void setPricingTools(PricingTools pPricingTools)
          pricing tools for help in generating prices
 
Methods inherited from class atg.commerce.pricing.ItemPriceCalculator
getLoggingIdentifier, getPrice, getPricePropertyName, getPriceSource, isPriceFromCatalogRef, isRequirePriceValue, priceEachItem, priceItems, setLoggingIdentifier, setPriceFromCatalogRef, setPricePropertyName, setRequirePriceValue
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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

ItemSalePriceCalculator

public ItemSalePriceCalculator()
Method Detail

setPricingTools

public void setPricingTools(PricingTools pPricingTools)
pricing tools for help in generating prices

Parameters:
pPricingTools - new value to set

getPricingTools

public PricingTools getPricingTools()
pricing tools for help in generating prices

Returns:
property PricingTools

setOnSalePropertyName

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


getOnSalePropertyName

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


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 sale price with the given determined price

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
pProfile - The user's profile
pExtraParameters - A Map of extra parameters to be used in the pricing, may be null
Throws:
PricingException

priceItem

public void priceItem(ItemPriceInfo pPriceQuote,
                      CommerceItem pItem,
                      RepositoryItem pPricingModel,
                      java.util.Locale pLocale,
                      RepositoryItem pProfile,
                      java.util.Map pExtraParameters)
               throws PricingException
If the item should be priced as a sales item (method onSale return true) then go ahead an price it

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

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