public class PriceItemDroplet extends ItemPricingDroplet
The following parameters are optional:
userPricingModelsPath
property.
profilePath
.
With these parameters the supplied or constructed CommerceItem, the user's current promotions, their profile
and locale are passed to the PricingTools.priceItem
method. This then calls into the ItemPricingEngine.
The CommerceItem, which has now been priced, is made available as a parameter in the output
oparam.
By default the name of this CommerceItem 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/PriceItem"> <param name="item" value="param:sku"> <param name="product" value="param:product"> <param name="quantity" value="param:quantity"> <param name="elementName" value="pricedItem"> <oparam name="output"> <valueof param="pricedItem.priceInfo.amount" currency>no price</valueof> </oparam> </droplet>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
protected Qualifier |
mPricingQualifierService |
mProfilePath, mUserPricingModelsPath
mAllowCleanupRequest, mParameters
SERVLET_INFO_KEY
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
PriceItemDroplet()
Constructs an instanceof PriceItemDroplet
|
Modifier and Type | Method and Description |
---|---|
protected CommerceItem |
createCommerceItem(java.lang.String pCatalogRefId,
java.lang.Object pCatalogRef,
java.lang.String pProductId,
java.lang.Object pProductRef,
long pQuantity)
With the given parameters create a new CommerceItem that will be used for pricing.
|
protected java.util.Map |
getExtraParams(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Intended to be used to build a map of extra parameters for passing in to ItemPricingEngines
for their use in pricing the input item.
|
Qualifier |
getPricingQualifierService()
Returns the qualifier service that is used to price promotions
during the pricing operation.
|
protected java.lang.Object |
performPricing(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Returns the CommerceItem which has been priced.
|
void |
setPricingQualifierService(Qualifier pPricingQualifierService) |
getCatalogRefId, getDefaultLocale, getOrderTools, getPricingModels, getPricingTools, getProduct, getProductId, getProfile, getProfilePath, getUserLocale, getUserPricingModelsPath, isUseRequestLocale, service, setDefaultLocale, setOrderTools, setPricingTools, setProfilePath, setUseRequestLocale, setUserPricingModelsPath
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, init, service, service, setParameter
destroy, getServletConfig, getServletInfo, setServletInfo
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static java.lang.String CLASS_VERSION
protected Qualifier mPricingQualifierService
public PriceItemDroplet()
public Qualifier getPricingQualifierService()
public void setPricingQualifierService(Qualifier pPricingQualifierService)
protected CommerceItem createCommerceItem(java.lang.String pCatalogRefId, java.lang.Object pCatalogRef, java.lang.String pProductId, java.lang.Object pProductRef, long pQuantity) throws CommerceException
createCommerceItem
in class ItemPricingDroplet
CommerceException
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.Map getExtraParams(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException
By default, this method will create a parameter map containing the configured qualifier service to be used in the pricing operation. Otherwise, it returns null. Note: override this method if you've created a new implementation of ItemPricingEngine which uses the 'ExtraParameters' param that's passed in to its pricing methods.
pRequest
- the request object which holds the extra pararameters map in its parameters tablepResponse
- the response objectjavax.servlet.ServletException
- if there was a problem getting the request parameter value