|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.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_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 | |
---|---|
ItemPriceCalculator()
|
Method Summary | |
---|---|
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. |
boolean |
isPriceFromCatalogRef()
Returns property PriceFromCatalogRef. |
boolean |
isRequirePriceValue()
Returns property RequirePriceValue |
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 |
setRequirePriceValue(boolean pRequirePriceValue)
Sets property RequirePriceValue |
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 |
---|
public static final java.lang.String CLASS_VERSION
Constructor Detail |
---|
public ItemPriceCalculator()
Method Detail |
---|
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
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
priceItem
in interface ItemPricingCalculator
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 null
PricingException
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 ItemPricingCalculator
pPriceQuotes
- 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 ItemPricingCalculator
pPriceQuotes
- 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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |