atg.commerce.promotion
Class GiftWithPurchaseSelectionsDroplet

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.GiftWithPurchaseSelectionsDroplet
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 GiftWithPurchaseSelectionsDroplet
extends DynamoServlet

Droplet to retrieve all of the gift with purchase selection on an order or a commerce item. If the commerce item is supplied then the selections only apply to that item. Input parameters:

order
The Order to be inspected. This is a required parameter.
item
The commerce item to be inspected. If specified then the selections apply only to this item.
onlyOutputAvailableSelections
Boolean flag. For order inspections, if true then only selections where quantityAvaiableForSelection is > 0 will be output. Defaults to false.
Output parameters:
selections
A collection of GiftWithPurchaseSelection beans.
errorMsg
If there is an error in the processing, this parameter will hold the error message string.
Open parameters:
output
If there are selections returned, this open parameter will be rendered.
empty
This will be rendered if no selections exist in the current order
error
This will be rendered if errors occur during processing.


Field Summary
static java.lang.String CLASS_VERSION
           
static ParameterName EMPTY
           
static ParameterName ERROR
           
static java.lang.String ERROR_MESSAGE
           
static ParameterName ITEM
           
protected  GWPManager mGwpManager
          Manager component for gift with purchase promotions
static ParameterName ONLY_AVAILABLE
           
static ParameterName ORDER
           
static ParameterName OUTPUT
           
static java.lang.String SELECTIONS
           
 
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
GiftWithPurchaseSelectionsDroplet()
           
 
Method Summary
 GWPManager getGwpManager()
          Getter for the gift with purchase manager property.
protected  CommerceItem getItem(DynamoHttpServletRequest pRequest)
          Gets the commerce item from the request if available
protected  Order getOrder(DynamoHttpServletRequest pRequest)
          Gets the Order from the request if available
protected  java.util.Collection<GiftWithPurchaseSelection> getSelections(Order pOrder, boolean pOnlyOutputAvailableSelections)
          Gets the GiftWithPurchaseSelection beans for an order.
protected  java.util.Collection<GiftWithPurchaseSelection> getSelections(Order pOrder, CommerceItem pItem)
          Gets the GiftWithPurchaseSelection beans for a commerce item
protected  boolean isOnlyOutputAvailableSelections(DynamoHttpServletRequest pRequest)
          Gets the onlyOutputAvailableSelections input parameter if available.
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Outputs the gift selections for a given order or item.
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.
 
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.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

ORDER

public static final ParameterName ORDER

ITEM

public static final ParameterName ITEM

ONLY_AVAILABLE

public static final ParameterName ONLY_AVAILABLE

SELECTIONS

public static final java.lang.String SELECTIONS
See Also:
Constant Field Values

ERROR_MESSAGE

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

OUTPUT

public static final ParameterName OUTPUT

ERROR

public static final ParameterName ERROR

EMPTY

public static final ParameterName EMPTY

mGwpManager

protected GWPManager mGwpManager
Manager component for gift with purchase promotions

Constructor Detail

GiftWithPurchaseSelectionsDroplet

public GiftWithPurchaseSelectionsDroplet()
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 selections for a given order or item.

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

getSelections

protected java.util.Collection<GiftWithPurchaseSelection> getSelections(Order pOrder,
                                                                        boolean pOnlyOutputAvailableSelections)
                                                                 throws CommerceException
Gets the GiftWithPurchaseSelection beans for an order. If pOnlyOutputAvailableSelections is true then only selections where quantityAvaiableForSelection is > 0 will be returned.

Parameters:
pOrder - Order to inspect
pOnlyOutputAvailableSelections - boolean true to only return available selections
Returns:
Collection of GiftWithPurchaseSelection beans
Throws:
CommerceException

getSelections

protected java.util.Collection<GiftWithPurchaseSelection> getSelections(Order pOrder,
                                                                        CommerceItem pItem)
                                                                 throws CommerceException
Gets the GiftWithPurchaseSelection beans for a commerce item

Parameters:
pOrder - Order to inspect
pItem - CommerceItem to inspect
Returns:
Collection of GiftWithPurchaseSelection beans
Throws:
CommerceException

getOrder

protected Order getOrder(DynamoHttpServletRequest pRequest)
Gets the Order from the request if available

Parameters:
pRequest - DynamoHttpServletRequest
Returns:
Order

getItem

protected CommerceItem getItem(DynamoHttpServletRequest pRequest)
Gets the commerce item from the request if available

Parameters:
pRequest - DynamoHttpServletRequest
Returns:
Order

isOnlyOutputAvailableSelections

protected boolean isOnlyOutputAvailableSelections(DynamoHttpServletRequest pRequest)
Gets the onlyOutputAvailableSelections input parameter if available. Defaults to false.

Parameters:
pRequest - DynamoHttpServletRequest
Returns:
boolean