atg.commerce.csr.returns
Class NonReturnItemDetailsDroplet

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.csr.returns.NonReturnItemDetailsDroplet
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 NonReturnItemDetailsDroplet
extends DynamoServlet

This droplet renders information about refund adjustments that were applied to non return items. A non return item is a term used to described any item shipping group relationship that is not reference by a ReturnItem in the ReturnRequest. input params

returnRequest
(required)the return request
oparams
returnDetail
rendered once for each non return item
outputStart
rendered once before any rendering any non return items
outputEnd
rendered once after all non return items have been rendered
outputEmpty
rendered once if there are no non return items or they all have no adjusted values
output params
commerceItem
the commerce item
shippingGroup
the shipping group
quantity adjusted
the quantity of the item to which the adjustments apply
itemCostAdjustments
the collection of ItemCostAdjustments that apply to the non return item
totalAdjustment
the sum of all amount, order discount and manual adjustment adjustments
totalAmountAdjustment
the total adjustment made to the item's amount
totalTaxAdjustment
the total adjustment made to the item's tax
totalShippingAdjustment
the total adjustment made to the item's shipping
totalOrderDiscountAdjustment
the total adjustment made to the item's order discount share
totalManualAdjustmentAdjustment
the total adjustment made to the item's manual adjustment share


Field Summary
static java.lang.String CLASS_VERSION
           
static java.lang.String COMMERCEITEM
          The following are the parameters available in returnDetail oparam
static java.lang.String ITEM_COST_ADJUSTMENTS
           
protected  ReturnTools mReturnTools
           
static ParameterName OUTPUT_EMPTY
          oparam rendered if there are no non return items
static ParameterName OUTPUT_END
          oparam rendered once after rendering all of the non return items
static ParameterName OUTPUT_START
          oparam rendered once before rendering all of the non return items
static java.lang.String QUANTITY_ADJUSTED
           
static ParameterName RETURN_DETAIL
          oparam rendered once for each non return item
static ParameterName RETURN_REQUEST
           
static java.lang.String SHIPPINGGROUP
          The following are the parameters available in returnDetail oparam
static java.lang.String TOTAL_ADJUSTMENT
           
static java.lang.String TOTAL_AMOUNT_ADJUSTMENT
           
static java.lang.String TOTAL_MANUALADJUSTMENT_ADJUSTMENT
           
static java.lang.String TOTAL_ORDERDISCOUNT_ADJUSTMENT
           
static java.lang.String TOTAL_SHIPPING_ADJUSTMENT
           
static java.lang.String TOTAL_TAX_ADJUSTMENT
           
 
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
NonReturnItemDetailsDroplet()
           
 
Method Summary
 java.lang.Object getInputParameter(DynamoHttpServletRequest pReq, ParameterName pInputParamter)
          Gets the input parameter values.
 ReturnTools getReturnTools()
          Returns the returnTools.
protected  double getTotalLineItemAdjustments(java.util.Collection pItemCostAdjustments)
          returns the total adjustments on amount, order discount share and manual adjustment share.
protected  boolean isRenderLineItemAdjustments(java.util.Collection pItemCostAdjustments)
          determines if the collection of adjustments are rendered as a non-return item.
protected  void renderNonReturnItemParams(ReturnRequest pReturnRequest, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Loop over the non return item cost adjustments
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Determine if the current order contains a return request or returnRequestId contains a valid return request.
protected  void setOutputParamsForNonReturnItem(CommerceItem pCommerceItem, ShippingGroup pShippingGroup, java.util.Collection pItemCostAdjustments, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Sets all the output parameters for the given "non-return item"
 void setReturnTools(ReturnTools pReturnTools)
          Sets the returnTools.
 
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

RETURN_REQUEST

public static final ParameterName RETURN_REQUEST

RETURN_DETAIL

public static final ParameterName RETURN_DETAIL
oparam rendered once for each non return item


OUTPUT_START

public static final ParameterName OUTPUT_START
oparam rendered once before rendering all of the non return items


OUTPUT_END

public static final ParameterName OUTPUT_END
oparam rendered once after rendering all of the non return items


OUTPUT_EMPTY

public static final ParameterName OUTPUT_EMPTY
oparam rendered if there are no non return items


COMMERCEITEM

public static final java.lang.String COMMERCEITEM
The following are the parameters available in returnDetail oparam

See Also:
Constant Field Values

SHIPPINGGROUP

public static final java.lang.String SHIPPINGGROUP
The following are the parameters available in returnDetail oparam

See Also:
Constant Field Values

QUANTITY_ADJUSTED

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

ITEM_COST_ADJUSTMENTS

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

TOTAL_ADJUSTMENT

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

TOTAL_AMOUNT_ADJUSTMENT

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

TOTAL_ORDERDISCOUNT_ADJUSTMENT

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

TOTAL_MANUALADJUSTMENT_ADJUSTMENT

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

TOTAL_TAX_ADJUSTMENT

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

TOTAL_SHIPPING_ADJUSTMENT

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

mReturnTools

protected ReturnTools mReturnTools
Constructor Detail

NonReturnItemDetailsDroplet

public NonReturnItemDetailsDroplet()
Method Detail

getReturnTools

public ReturnTools getReturnTools()
Returns the returnTools.

Returns:
returnTools

setReturnTools

public void setReturnTools(ReturnTools pReturnTools)
Sets the returnTools.

Parameters:
pReturnTools -

service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
Determine if the current order contains a return request or returnRequestId contains a valid return request. If there is a return request, this method sets the true output parameter otherwise serves the false parameter.

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

getInputParameter

public java.lang.Object getInputParameter(DynamoHttpServletRequest pReq,
                                          ParameterName pInputParamter)
Gets the input parameter values.

Parameters:
DynamoHttpServletRequest -
String -
Returns:
Input paramter value

renderNonReturnItemParams

protected void renderNonReturnItemParams(ReturnRequest pReturnRequest,
                                         DynamoHttpServletRequest pRequest,
                                         DynamoHttpServletResponse pResponse)
                                  throws java.io.IOException,
                                         javax.servlet.ServletException
Loop over the non return item cost adjustments

Parameters:
pReturnRequest -
pRequest -
pResponse -
Throws:
java.io.IOException
javax.servlet.ServletException

setOutputParamsForNonReturnItem

protected void setOutputParamsForNonReturnItem(CommerceItem pCommerceItem,
                                               ShippingGroup pShippingGroup,
                                               java.util.Collection pItemCostAdjustments,
                                               DynamoHttpServletRequest pRequest,
                                               DynamoHttpServletResponse pResponse)
Sets all the output parameters for the given "non-return item"

Parameters:
pCommerceItem - the commerce item
pShippingGroup - the shipping group to which the item has a relationship
pItemCostAdjustments - the collection of adjustments that reference the given item/shipping group relationship
pRequest -
pResponse -

getTotalLineItemAdjustments

protected double getTotalLineItemAdjustments(java.util.Collection pItemCostAdjustments)
returns the total adjustments on amount, order discount share and manual adjustment share.

If the item doesn't have these types of adjustments then it is not itemized in the non-return item details.

Parameters:
pItemCostAdjustments -
Returns:
total adjustments on amount, order discount share and manual adjustment share.

isRenderLineItemAdjustments

protected boolean isRenderLineItemAdjustments(java.util.Collection pItemCostAdjustments)
determines if the collection of adjustments are rendered as a non-return item.

returns true if the total line item adjustments don't total 0.

Parameters:
pItemCostAdjustments -
Returns: