| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.commerce.pricing.ItemPriceCalculator
public abstract class ItemPriceCalculator
Superclass for all CommerceItem calculators.  Consolidates 
 functionality that some item price calculators have in common.  ItemPriceCalculator
 extends ApplicationLoggingImpl, so classes that extend this one
 have access to Nucleus logging services.  This class contains a single abstract 
 method: priceItem.  Extending classes implement this method to leverage 
 this class's other CommerceItem pricing methods.
 
Properties:
priceSource which 
         represents an item's price.
  priceSource
         if the CommerceItem doesn't have its [pricePropertyName] property set.
  getPriceSource returns the 
         catalogRef property of the input CommerceItem.  If false,
         getPriceSource returns the productRef property.
  catalogRef property of the input 
       CommerceItem if priceFromCatalogRef is true.  If
        priceFromCatalogRef is false, 
        getPriceSource returns the productRef property.
  
ItemListPriceCalculator, 
ItemSalePriceCalculator| Field Summary | |
|---|---|
| static java.lang.String | CLASS_VERSIONClass 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 | |
|---|---|
| ItemPriceCalculator() | |
| Method Summary | |
|---|---|
|  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 get the ItemPriceSourcethat 
 should be used to price the givenCommerceItem | 
|  java.lang.String | getLoggingIdentifier()the ID that this class uses to identify itself in logs | 
| protected  double | getPrice(java.lang.Object pPriceSource)Return the price that should be used in pricing. | 
|  java.lang.String | getPricePropertyName()Returns the name of the property of the catalogRef property of CommerceItem which contains the price | 
| protected  java.lang.Object | getPriceSource(CommerceItem pItem)Return the object which should be used as the source for pricing. | 
|  java.lang.Object | getPriceSource(ItemPriceInfo pPriceQuote,
               CommerceItem pItem,
               RepositoryItem pPricingModel,
               java.util.Locale pLocale,
               RepositoryItem pProfile,
               java.util.Map pExtraParameters)Returns the object that should be used as a price source for the given commerce item. | 
|  PricingTools | getPricingTools()pricing tools to help with price calculation | 
|  boolean | isPriceFromCatalogRef()Returns property PriceFromCatalogRef. | 
|  boolean | isRequirePriceValue()Returns property RequirePriceValue | 
|  boolean | populateItemPriceSource(ItemPriceSource pItemPriceSource,
                        Order pOrder,
                        CommerceItem pCommerceItem,
                        CommerceItem pParentCommerceItem,
                        java.util.Map pExtraParameters)This is a no-op implementation that returns false. | 
|  void | priceEachItem(java.util.List pPriceQuotes,
              java.util.List pItems,
              RepositoryItem pPricingModel,
              java.util.Locale pLocale,
              RepositoryItem pProfile,
              java.util.Map pExtraParameters)Price each of a List of items in a context | 
| protected abstract  void | priceItem(double pPrice,
          ItemPriceInfo pPriceQuote,
          CommerceItem pItem,
          RepositoryItem pPricingModel,
          java.util.Locale pLocale,
          RepositoryItem pProfile,
          java.util.Map pExtraParameters)Set the price info given the determined price | 
|  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 | priceItems(java.util.List pPriceQuotes,
           java.util.List pItems,
           RepositoryItem pPricingModel,
           java.util.Locale pLocale,
           RepositoryItem pProfile,
           Order pOrder,
           java.util.Map pExtraParameters)Price a List of items together in a context | 
|  void | setLoggingIdentifier(java.lang.String pLoggingIdentifier)the ID that this class uses to identify itself in logs | 
|  void | setPriceFromCatalogRef(boolean pPriceFromCatalogRef)Sets property PriceFromCatalogRef | 
|  void | setPricePropertyName(java.lang.String pPricePropertyName)Returns the name of the property of the catalogRef property of CommerceItem which contains the price | 
|  void | setPricingTools(PricingTools pPricingTools)pricing tools to help with price calculation | 
|  void | setRequirePriceValue(boolean pRequirePriceValue)Sets property RequirePriceValue | 
|  boolean | shouldConsumeSource(ItemPriceSource pItemPriceSource)Determines if the price source should be consumed by the calculator. | 
| 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 | 
|---|
public static final java.lang.String CLASS_VERSION
| Constructor Detail | 
|---|
public ItemPriceCalculator()
| Method Detail | 
|---|
public void setPricingTools(PricingTools pPricingTools)
pPricingTools - new value to setpublic PricingTools getPricingTools()
public void setLoggingIdentifier(java.lang.String pLoggingIdentifier)
pLoggingIdentifier - new value to setpublic java.lang.String getLoggingIdentifier()
public void setPricePropertyName(java.lang.String pPricePropertyName)
pPricePropertyName - the new value to setpublic java.lang.String getPricePropertyName()
public void setRequirePriceValue(boolean pRequirePriceValue)
public boolean isRequirePriceValue()
public void setPriceFromCatalogRef(boolean pPriceFromCatalogRef)
public boolean isPriceFromCatalogRef()
protected java.lang.Object getPriceSource(CommerceItem pItem)
                                   throws PricingException
priceFromCatalogRef property as
 a switch to determine if the catalogRef or productRef should be returned
 from the CommerceItem
PricingException
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
 This implemenation returns the item's matching source from the extra parameters
getItemPriceSource in interface ItemPriceSourceHandlerpPriceQuote - 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 java.lang.Object getPriceSource(ItemPriceInfo pPriceQuote,
                                       CommerceItem pItem,
                                       RepositoryItem pPricingModel,
                                       java.util.Locale pLocale,
                                       RepositoryItem pProfile,
                                       java.util.Map pExtraParameters)
                                throws PricingException
pricePropertyName. 
 
 This implementation first checks for a ItemPriceSource and returns it, if 
 found. Otherwise, it delegates to the getPriceSource(CommerceItem) method
PricingExceptiongetPriceSource(CommerceItem)
protected double getPrice(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
 The list price is determined from price source object returned by getPriceSource
priceItem in interface ItemPricingCalculatorpPriceQuote - 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 null
PricingExceptiongetPriceSource(ItemPriceInfo, CommerceItem, RepositoryItem, Locale, RepositoryItem, Map)
protected abstract void priceItem(double pPrice,
                                  ItemPriceInfo pPriceQuote,
                                  CommerceItem pItem,
                                  RepositoryItem pPricingModel,
                                  java.util.Locale pLocale,
                                  RepositoryItem pProfile,
                                  java.util.Map pExtraParameters)
                           throws PricingException
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 PricingModelpProfile - The user's profilepExtraParameters - A Map of extra parameters to be used in the pricing, may be null
PricingException
public void priceEachItem(java.util.List pPriceQuotes,
                          java.util.List pItems,
                          RepositoryItem pPricingModel,
                          java.util.Locale pLocale,
                          RepositoryItem pProfile,
                          java.util.Map pExtraParameters)
                   throws PricingException
priceEachItem in interface ItemPricingCalculatorpPriceQuotes - List of ItemPriceInfo objects representing the current price quotes for each itempItems - The items to price (individually)pPricingModel - A RepositoryItem representing a PricingModelpProfile - The user's profilepExtraParameters - A Map of extra parameters to be used in the pricing, may be null
PricingException
public void priceItems(java.util.List pPriceQuotes,
                       java.util.List pItems,
                       RepositoryItem pPricingModel,
                       java.util.Locale pLocale,
                       RepositoryItem pProfile,
                       Order pOrder,
                       java.util.Map pExtraParameters)
                throws PricingException
priceItems in interface ItemPricingCalculatorpPriceQuotes - List of ItemPriceInfo objects representing the current price quotes for the itemspItems - The items to pricepPricingModels - A RepositoryItem representing a PricingModelpProfile - The user's profilepOrder - The Order object of which the List of items are a part, may be nullpExtraParameters - A Map of extra parameters to be used in the pricing, may be null
PricingException
public boolean populateItemPriceSource(ItemPriceSource pItemPriceSource,
                                       Order pOrder,
                                       CommerceItem pCommerceItem,
                                       CommerceItem pParentCommerceItem,
                                       java.util.Map pExtraParameters)
populateItemPriceSource in interface ItemPriceSourceHandlerpItemPriceSource - 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 - a Map of extra parameters objects that was passed to the initial call to generate the source objects.
ItemPriceSource properties were updatedpublic boolean shouldConsumeSource(ItemPriceSource pItemPriceSource)
This implementation always returns false. Subclasses override this method to make a determination based on the contents of the source.
shouldConsumeSource in interface ItemPriceSourceHandlerpItemPriceSource - the source that was given to price the item.
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||