atg.commerce.promotion
Class GiftWithPurchaseSelectionChoicesDroplet

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.TimedOperationService
              extended by atg.nucleus.servlet.ServletService
                  extended by atg.nucleus.servlet.HttpServletService
                      extended by atg.servlet.DynamoServlet
                          extended by atg.commerce.promotion.GiftWithPurchaseSelectionChoicesDroplet
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, ParameterServlet, java.util.EventListener, javax.servlet.Servlet

public class GiftWithPurchaseSelectionChoicesDroplet
extends DynamoServlet

Droplet to retrieve all of the products and skus available for selection for a gift with purchase gift. Input parameters:

selection
A GiftWithPurchaseSelection bean for the free gift. If not specified then the giftType and giftDetail parameters must be supplied.
giftType
The gift type of the free gift. If not specified then the selection parameter must be supplied.
giftDetail
The gift detail of the free gift. If not specified then the selection parameter must be supplied.
alwaysReturnSkus
Optional boolean. If true the choices returned will always include the SKUs. Defaults to false.
Output parameters:
choices
A collection of GiftWithPurchaseSelectionChoice beans.
errorMsg
If there is an error in the processing, this parameter will hold the error message string.
Open parameters:
output
If there are selection choices returned, this open parameter will be rendered.
empty
This will be rendered if no selection choices are valid for the free gift
error
This will be rendered if errors occur during processing.


Field Summary
protected static ParameterName ALWAYS_RETURN_SKUS
           
protected static java.lang.String CHOICES
           
static java.lang.String CLASS_VERSION
           
protected static ParameterName EMPTY
           
protected static ParameterName ERROR
           
protected static java.lang.String ERROR_MESSAGE
           
protected static ParameterName GIFT_DETAIL
           
protected static ParameterName GIFT_TYPE
           
protected  GWPManager mGwpManager
          Manager component for gift with purchase promotions
protected static ParameterName OUTPUT
           
protected static ParameterName SELECTION
           
 
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
GiftWithPurchaseSelectionChoicesDroplet()
           
 
Method Summary
protected  java.lang.String getGiftDetail(DynamoHttpServletRequest pRequest, GiftWithPurchaseSelection pSelection)
          Gets the gift detail to use either from the GiftWithPurchaseSelection bean or as a separate request parameter.
protected  java.lang.String getGiftType(DynamoHttpServletRequest pRequest, GiftWithPurchaseSelection pSelection)
          Gets the gift type to use either from the GiftWithPurchaseSelection bean or as a separate request parameter.
 GWPManager getGwpManager()
          Getter for the gift with purchase manager property.
protected  GiftWithPurchaseSelection getSelection(DynamoHttpServletRequest pRequest)
          Gets the GiftWithPurchaseSelection bean from the request if available
protected  java.util.Collection<GiftWithPurchaseSelectionChoice> getSelectionChoices(java.lang.String pGiftType, java.lang.String pGiftDetail, boolean pReturnSkus)
          Gets the GiftWithPurchaseSelectionChoice beans for a gift selection
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Outputs the gift selection choices for a given free gift.
protected  void serviceError(java.lang.String pErrorMsg, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Handles an error by servicing the error parameter.
 void setGwpManager(GWPManager pGwpManager)
          Setter for the gift with purchase manager property.
protected  boolean shouldAlwaysReturnSkus(DynamoHttpServletRequest pRequest)
          Gets the alwaysReturnSkus boolean from the request if available
 
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
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

SELECTION

protected static final ParameterName SELECTION

GIFT_TYPE

protected static final ParameterName GIFT_TYPE

GIFT_DETAIL

protected static final ParameterName GIFT_DETAIL

ALWAYS_RETURN_SKUS

protected static final ParameterName ALWAYS_RETURN_SKUS

CHOICES

protected static final java.lang.String CHOICES
See Also:
Constant Field Values

ERROR_MESSAGE

protected static final java.lang.String ERROR_MESSAGE
See Also:
Constant Field Values

OUTPUT

protected static final ParameterName OUTPUT

ERROR

protected static final ParameterName ERROR

EMPTY

protected static final ParameterName EMPTY

mGwpManager

protected GWPManager mGwpManager
Manager component for gift with purchase promotions

Constructor Detail

GiftWithPurchaseSelectionChoicesDroplet

public GiftWithPurchaseSelectionChoicesDroplet()
Method Detail

setGwpManager

public void setGwpManager(GWPManager pGwpManager)
Setter for the gift with purchase manager property.

Parameters:
pGwpManager - GWPManager

getGwpManager

public GWPManager getGwpManager()
Getter for the gift with purchase manager property.

Returns:
GWPManager

service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
Outputs the gift selection choices for a given free gift.

Overrides:
service in class DynamoServlet
Parameters:
pRequest - the current request
pResponse - the current response
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.

serviceError

protected void serviceError(java.lang.String pErrorMsg,
                            DynamoHttpServletRequest pRequest,
                            DynamoHttpServletResponse pResponse)
                     throws javax.servlet.ServletException,
                            java.io.IOException
Handles an error by servicing the error parameter.

Parameters:
pErrorMsg - String error message
pRequest - DynamoHttpServletRequest
pResponse - DynamoHttpServletResponse
Throws:
javax.servlet.ServletException
java.io.IOException

getSelectionChoices

protected java.util.Collection<GiftWithPurchaseSelectionChoice> getSelectionChoices(java.lang.String pGiftType,
                                                                                    java.lang.String pGiftDetail,
                                                                                    boolean pReturnSkus)
                                                                             throws CommerceException
Gets the GiftWithPurchaseSelectionChoice beans for a gift selection

Parameters:
pGiftType - String gift type
pGiftDetail - String gift detail
pReturnSkus - boolean, true to return the skus for all choices
Returns:
Collection of GiftWithPurchaseSelectionChoice beans
Throws:
MarkerException
CommerceException

getSelection

protected GiftWithPurchaseSelection getSelection(DynamoHttpServletRequest pRequest)
Gets the GiftWithPurchaseSelection bean from the request if available

Parameters:
pRequest - DynamoHttpServletRequest
Returns:
GiftWithPurchaseSelection bean

getGiftType

protected java.lang.String getGiftType(DynamoHttpServletRequest pRequest,
                                       GiftWithPurchaseSelection pSelection)
Gets the gift type to use either from the GiftWithPurchaseSelection bean or as a separate request parameter.

Parameters:
pRequest - DynamoHttpServletRequest
pSelection - GiftWithPurchaseSelection bean
Returns:
String

getGiftDetail

protected java.lang.String getGiftDetail(DynamoHttpServletRequest pRequest,
                                         GiftWithPurchaseSelection pSelection)
Gets the gift detail to use either from the GiftWithPurchaseSelection bean or as a separate request parameter.

Parameters:
pRequest - DynamoHttpServletRequest
pSelection - GiftWithPurchaseSelection bean
Returns:
String

shouldAlwaysReturnSkus

protected boolean shouldAlwaysReturnSkus(DynamoHttpServletRequest pRequest)
Gets the alwaysReturnSkus boolean from the request if available

Parameters:
pRequest - DynamoHttpServletRequest
Returns:
boolean