|
|||||||||
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.priceLists.ItemPriceCalculator
public class ItemPriceCalculator
This class can either price a single commerce item or price a list of commerce items. It will first select the priceList to use based on the profilePriceListPropertyName property, then it will delegate the pricing to different ItemSchemePriceCalculators based on the item's pricing scheme by the pricingSchemePropertyName property.
Properties:
ProfilePriceListPropertyName
is null, then
the value of PriceListManager.automaticallyUseDefaultPriceList determines
if the default price list is used. If false, then the default price list
is never used.
ItemPricingCalculator
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 | |
---|---|
protected RepositoryItem |
getDifferentPriceList(ItemPriceInfo pPriceQuote,
CommerceItem pItem,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Get the price list from the extra parameters. |
java.lang.String |
getLoggingIdentifier()
the ID that this class uses to identify itself in logs |
PriceListManager |
getPriceListManager()
Returns the reference to the PriceListManager which handles the operations of the PriceList |
protected java.lang.String |
getPricingScheme(RepositoryItem pPrice)
Return the pricing scheme in the Price RepositoryItem |
java.util.Properties |
getPricingSchemeNames()
Returns the key/Value pair for the allowed scheme names and its corresponding Calculator |
java.lang.String |
getPricingSchemePropertyName()
the name of the property for the PricingScheme |
java.lang.String |
getProfilePriceListPropertyName()
The name of the property in the profile that stores the price list. |
boolean |
isNoPriceIsError()
If this is true, and the price list is null or there is not price in the price list, then an error is thrown. |
boolean |
isUseDefaultPriceList()
If true and ProfilePriceListPropertyName is null, then
the value of PriceListManager.automaticallyUseDefaultPriceList determines
if the default price list is used. |
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 |
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 |
setNoPriceIsError(boolean pNoPriceIsError)
If this is true, and the price list is null or there is not price in the price list, then an error is thrown. |
void |
setPriceListManager(PriceListManager pPriceListManager)
Sets property PriceListManager which handles the operations of the PriceList |
void |
setPricingSchemeNames(java.util.Properties pPricingSchemeNames)
the key/Value pair for the allowed scheme names and its corresponding Calculator |
void |
setPricingSchemePropertyName(java.lang.String pPricingSchemePropertyName)
the name of the property for the PricingScheme |
void |
setProfilePriceListPropertyName(java.lang.String pProfilePriceListPropertyName)
The name of the property in the profile that stores the price list. |
void |
setUseDefaultPriceList(boolean pUseDefaultPriceList)
If true and the profiles ProfilePriceListPropertyName is null, then the
default price list from the PriceListManager is used. |
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 setPricingSchemePropertyName(java.lang.String pPricingSchemePropertyName)
pPricingSchemePropertyName
- new value to setpublic java.lang.String getPricingSchemePropertyName()
public void setProfilePriceListPropertyName(java.lang.String pProfilePriceListPropertyName)
pProfilePriceListPropertyName
- The new value to setpublic java.lang.String getProfilePriceListPropertyName()
public void setUseDefaultPriceList(boolean pUseDefaultPriceList)
ProfilePriceListPropertyName
is null, then the
default price list from the PriceListManager is used. If false,
and ProfilePriceListPropertyName
is null, then
nothing happens. Defaults to true.
pUseDefaultPriceList
- The new value to setpublic boolean isUseDefaultPriceList()
ProfilePriceListPropertyName
is null, then
the value of PriceListManager.automaticallyUseDefaultPriceList determines
if the default price list is used. If false, then the default price list
is never used. The default is true
public void setNoPriceIsError(boolean pNoPriceIsError)
pNoIsError
- The new value to setpublic boolean isNoPriceIsError()
public void setPriceListManager(PriceListManager pPriceListManager)
pPriceListManager
- the new value to setpublic PriceListManager getPriceListManager()
public void setPricingSchemeNames(java.util.Properties pPricingSchemeNames)
pPricingSchemeNames
- new value to setpublic java.util.Properties getPricingSchemeNames()
protected java.lang.String getPricingScheme(RepositoryItem pPrice) throws PricingException
PricingException
public void priceItem(ItemPriceInfo pPriceQuote, CommerceItem pItem, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
profilePriceListPropertyName
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
You may override the price list in the profile by providing a price
list (or price list id) in this map. Use profilePriceListPropertyName
as the key
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
protected RepositoryItem getDifferentPriceList(ItemPriceInfo pPriceQuote, CommerceItem pItem, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PriceListException
profilePriceListPropertyName
. If it is
present, then the price list mapped to by that key is returned. If the value in the map
is a String, then it is assumed that this is a price list id, and PriceListManager is
used to look up the price.
PriceListException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |