|
|||||||||
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.nucleus.TimedOperationService atg.nucleus.servlet.ServletService atg.nucleus.servlet.HttpServletService atg.servlet.DynamoServlet atg.commerce.pricing.ItemPricingDroplet atg.commerce.pricing.PriceEachItemDroplet
public class PriceEachItemDroplet
This Dynamo Servlet Bean is used to price a collection of items. The only required parameter is named items. This can be either a collection of RepositoryItems, which represents the item to be priced, or CommerceItems which can be directly priced. If the items supplied are RepositoryItems then a new collection of CommerceItems is created to be priced.
The following parameters are optional:
userPricingModelsPath
property.
profilePath
.
With these parameters the supplied or constructed CommerceItems, the user's current promotions, their profile
and locale are passed to the PricingTools.priceEachItem
method. This then calls into the ItemPricingEngine.
The CommerceItems, which have now been priced, are made available as a parameter in the output
oparam.
By default the name of this collection parameter is element, however as described above this can be changed
through the elementName
input parameter.
For example:
NOTE: the promotions, locale and profile are extracted from the request, since they are not supplied as parameters.
<droplet bean="/atg/commerce/pricing/PriceEachItem"> <param name="items" value="param:product.childSKUs"> <!-- the product param is already defined in this scope so we do not need to set it --> <oparam name="output"> <!-- Now iterate over each of the CommerceItems to display the prices --> <droplet bean="/atg/dynamo/droplet/ForEach"> <param name="array" value="param:element"> <param name="elementName" value="pricedItem"> <oparam name="output"> <valueof param="pricedItem.auxiliaryData.catalogRef.displayName"></valueof> - <!-- Toggle a different display depending if the item is on sale or not --> <droplet bean="Switch"> <param name="value" value="param:pricedItem.priceInfo.onSale"> <oparam name="false"> <valueof param="pricedItem.priceInfo.amount" currency>no price</valueof> </oparam> <oparam name="true"> List price for <valueof param="pricedItem.priceInfo.listPrice" currency>no price</valueof> on sale for <valueof param="pricedItem.priceInfo.salePrice" currency></valueof>! </oparam> </droplet><BR> </oparam> </droplet> </oparam> </droplet>
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
static java.util.ResourceBundle |
sResourceBundle
Resource Bundle |
Fields inherited from class atg.commerce.pricing.ItemPricingDroplet |
---|
mProfilePath, mUserPricingModelsPath |
Fields inherited from class atg.servlet.DynamoServlet |
---|
mAllowCleanupRequest, mParameters |
Fields inherited from class atg.nucleus.servlet.ServletService |
---|
SERVLET_INFO_KEY |
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 | |
---|---|
PriceEachItemDroplet()
Constructs an instanceof PriceEachItemDroplet |
Method Summary | |
---|---|
protected java.util.List |
convertItemsToPrice(CommerceItem[] pItems,
DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Return the array of CommerceItems as a list |
protected java.util.List |
convertItemsToPrice(java.util.List pItems,
DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Convert, as needed, each element of the list into a CommerceItem and then return the new list |
protected java.util.List |
convertItemsToPrice(RepositoryItem[] pItems,
DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Convert each supplied RepositoryItem into a CommerceItem and return the new list |
protected java.util.Map |
getExtraParams(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Intended to be used to extract a map of extra parameters for passing in to ItemPricingEngines for their use in pricing the input item. |
protected java.util.List |
getItemsToPrice(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Return the list of CommerceItems to price (pricing has not occured yet). |
protected java.lang.Object |
performPricing(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Returns the list of CommerceItems which have been priced. |
Methods inherited from class atg.commerce.pricing.ItemPricingDroplet |
---|
createCommerceItem, getCatalogRefId, getDefaultLocale, getOrderTools, getPricingModels, getPricingTools, getProduct, getProductId, getProfile, getProfilePath, getUserLocale, getUserPricingModelsPath, isUseRequestLocale, service, setDefaultLocale, setOrderTools, setPricingTools, setProfilePath, setUseRequestLocale, setUserPricingModelsPath |
Methods inherited from class atg.servlet.DynamoServlet |
---|
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, service, service, setParameter |
Methods inherited from class atg.nucleus.servlet.ServletService |
---|
destroy, getServletConfig, getServletInfo, init, setServletInfo |
Methods inherited from class atg.nucleus.TimedOperationService |
---|
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics |
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 java.lang.String CLASS_VERSION
public static final java.util.ResourceBundle sResourceBundle
Constructor Detail |
---|
public PriceEachItemDroplet()
Method Detail |
---|
protected java.lang.Object performPricing(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
performPricing
in class ItemPricingDroplet
javax.servlet.ServletException
java.io.IOException
protected java.util.List getItemsToPrice(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws CommerceException, javax.servlet.ServletException, java.io.IOException
CommerceException
javax.servlet.ServletException
java.io.IOException
protected java.util.Map getExtraParams(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException
pRequest
- the request object which holds the extra pararameters map in its parameters tablepResponse
- the response object
javax.servlet.ServletException
- if there was a problem getting the request parameter valueprotected java.util.List convertItemsToPrice(java.util.List pItems, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws CommerceException, javax.servlet.ServletException, java.io.IOException
CommerceException
javax.servlet.ServletException
java.io.IOException
protected java.util.List convertItemsToPrice(RepositoryItem[] pItems, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws CommerceException, javax.servlet.ServletException, java.io.IOException
CommerceException
javax.servlet.ServletException
java.io.IOException
protected java.util.List convertItemsToPrice(CommerceItem[] pItems, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws CommerceException, javax.servlet.ServletException, java.io.IOException
CommerceException
javax.servlet.ServletException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |