atg.projects.store.pricing
Class PriceShippingMethodDroplet
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.projects.store.pricing.PriceShippingMethodDroplet
- All Implemented Interfaces:
- atg.naming.AbsoluteNameable, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameContextParentable, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.Configured, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, atg.servlet.ParameterServlet, java.util.EventListener, javax.servlet.Servlet
public class PriceShippingMethodDroplet
- extends atg.servlet.DynamoServlet
This DynamoServlet Bean is used to determine shipping costs for the shipping
group with specified shipping method. The class's service method calls into
the ShippingPricingEngine priceShippingGroup
method to get the
ShippingPriceInfo for the specified shipping group and the shipping method.
The determined shipping cost is put into the output parameter.
The following parameters are required:
- shippingGroup
-
- The ShippingGroup to price
- shippingMethod
- The Shipping method to price with
The following output parameter is defined when the service method is invoked:
- shippingPrice
- A double value that corresponds to the shipping cost of the specified
shipping group with specified shipping method.
- output
- An oparam that is serviced if the shipping cost is determined.
-
This is an example of using this droplet to provide a price for the shipping
with the specified shipping method.
<dsp:droplet name="/atg/store/pricing/PriceShippingMethod"">
<dsp:param name="shippingGroup" param="shippingGroup"/">
<dsp:param name="shippingMethod" param="shippingMethod"/">
<dsp:oparam name="output"">
<dsp:getvalueof var="shippingPrice" param="shippingPrice" /">
<fmt:formatNumber value="${shippingPrice}" type="currency" /">
</dsp:oparam">
</dsp:droplet">
- Version:
- $Id: //hosting-blueprint/B2CBlueprint/version/10.2.1/EStore/src/atg/projects/store/pricing/PriceShippingMethodDroplet.java#2 $$Change: 788983 $
- Author:
- ATG
Field Summary |
static java.lang.String |
CLASS_VERSION
Class version string |
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 |
Method Summary |
java.util.Locale |
getDefaultLocale()
|
atg.commerce.order.Order |
getOrder()
|
atg.commerce.pricing.PricingTools |
getPricingTools()
|
atg.userprofiling.Profile |
getProfile()
|
protected atg.commerce.order.ShippingGroup |
getShippingGroup(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
Get the shipping group from that we should price with the specified shipping method. |
protected java.util.Locale |
getUserLocale(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
Returns the locale associated with the request. |
atg.commerce.pricing.PricingModelHolder |
getUserPricingModels()
|
void |
service(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
Performs the pricing of specified shipping method. |
void |
setDefaultLocale(java.util.Locale pDefaultLocale)
|
void |
setOrder(atg.commerce.order.Order pOrder)
Set the Order property. |
void |
setPricingTools(atg.commerce.pricing.PricingTools pPricingTools)
|
void |
setProfile(atg.userprofiling.Profile pProfile)
|
void |
setUserPricingModels(atg.commerce.pricing.PricingModelHolder pUserPricingModels)
|
Methods inherited from class atg.servlet.DynamoServlet |
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, init, service, service, setParameter |
Methods inherited from class atg.nucleus.servlet.ServletService |
destroy, getServletConfig, getServletInfo, setServletInfo |
Methods inherited from class atg.nucleus.TimedOperationService |
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics |
Methods inherited from class atg.nucleus.GenericService |
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 |
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 |
CLASS_VERSION
public static final java.lang.String CLASS_VERSION
- Class version string
- See Also:
- Constant Field Values
PriceShippingMethodDroplet
public PriceShippingMethodDroplet()
getPricingTools
public atg.commerce.pricing.PricingTools getPricingTools()
- Returns:
- pricing tools component.
setPricingTools
public void setPricingTools(atg.commerce.pricing.PricingTools pPricingTools)
- Parameters:
pPricingTools
- sets new pricing tools component.
setDefaultLocale
public void setDefaultLocale(java.util.Locale pDefaultLocale)
- Parameters:
pDefaultLocale
- - the default locale for which shipping method should be priced.
getDefaultLocale
public java.util.Locale getDefaultLocale()
- Returns:
- the default locale for which shipping method should be priced.
setOrder
public void setOrder(atg.commerce.order.Order pOrder)
- Set the Order property.
- Parameters:
pOrder
- - an Order
value.
getOrder
public atg.commerce.order.Order getOrder()
- Returns:
- an
Order
value.
setProfile
public void setProfile(atg.userprofiling.Profile pProfile)
- Parameters:
pProfile
- - a Profile
value.
getProfile
public atg.userprofiling.Profile getProfile()
- Returns:
- a
Profile
value.
setUserPricingModels
public void setUserPricingModels(atg.commerce.pricing.PricingModelHolder pUserPricingModels)
- Parameters:
pUserPricingModels
- - a PricingModelHolder
value.
getUserPricingModels
public atg.commerce.pricing.PricingModelHolder getUserPricingModels()
- Returns:
- a
PricingModelHolder
value.
service
public void service(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
throws javax.servlet.ServletException,
java.io.IOException
- Performs the pricing of specified shipping method. Sets the shipping method
the specified shipping group to the one that is passed to the droplet. Then
calls shipping pricing engine to perform pricing of shipping group. And
finally returns back the original shipping method of the shipping group.
The determined price is stored into the output parameter.
- Overrides:
service
in class atg.servlet.DynamoServlet
- Parameters:
pRequest
- - the request to be processed.pResponse
- - the response object for this request.
- Throws:
javax.servlet.ServletException
- an application specific error occurred processing this request.
java.io.IOException
- an error occurred reading data from the request or writing data to the response.
getShippingGroup
protected atg.commerce.order.ShippingGroup getShippingGroup(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
throws javax.servlet.ServletException,
java.io.IOException
- Get the shipping group from that we should price with the specified shipping method.
- Parameters:
pRequest
- - the request to be processed.pResponse
- - the response object for this request.
- Returns:
- the shipping group from that we should price with the specified shipping method.
- Throws:
javax.servlet.ServletException
- an application specific error occurred processing this request
java.io.IOException
- an error occurred reading data from the request or writing data to the response.
getUserLocale
protected java.util.Locale getUserLocale(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
throws javax.servlet.ServletException,
java.io.IOException
- Returns the locale associated with the request. The method first searches
the locale of the request. If the locale cannot be determined, the the
defaultLocale
property is used.
- Parameters:
pRequest
- - the request to be processed.pResponse
- - the response object for this request.
- Returns:
- the locale to be associated with this user.
- Throws:
javax.servlet.ServletException
- an application specific error occurred processing this request.
java.io.IOException
- an error occurred reading data from the request or writing data to the response.