public class ModifyRefundValuesFormHandler
extends atg.droplet.GenericFormHandler
It provides the ability to update the actual refund value for each return item and the ReturnRequest's other, actual shipping and actual tax adjustment values
The process of apply new values includes validation of each value and to abort the process due to validation failures.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
protected CSRAgentTools |
mCSRAgentTools |
protected java.lang.String |
mModifyRefundValuesErrorURL |
protected java.lang.String |
mModifyRefundValuesSuccessURL |
protected java.lang.String |
mOtherAdjustment |
protected java.lang.String |
mPaymentPageURL |
protected java.lang.String |
mRefundPageURL |
protected java.lang.String |
mResetRefundValuesErrorURL |
protected java.lang.String |
mResetRefundValuesSuccessURL |
protected java.util.Map |
mReturnItemRefunds |
protected atg.commerce.csr.returns.ReturnManager |
mReturnManager |
protected atg.commerce.csr.returns.ReturnRequest |
mReturnRequest |
protected java.lang.String |
mShippingAdjustment |
protected javax.transaction.TransactionManager |
mTransactionManager |
protected java.lang.String |
mWashPageURL |
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
Constructor and Description |
---|
ModifyRefundValuesFormHandler() |
Modifier and Type | Method and Description |
---|---|
protected void |
applyOtherAdjustment()
Sets the return request's other adjustment value from the form's other adjustment value.
|
protected void |
applyReturnItemRefunds()
Sets the actual refund amounts of each return item from
the form's map of return item refund values.
|
protected void |
applyShippingAdjustment()
Sets the actual shipping from the form's shipping adjustment value.
|
protected java.lang.String |
formatAmount(double pAmount)
Provides a formatted string representation of
the given double value.
|
CSRAgentTools |
getCSRAgentTools() |
protected java.lang.String |
getItemRefundAmount(int pReturnItemIndex)
returns the item refund amount from the returnItemRefunds
Map for the ReturnItem at the given index in the returnItemList.
|
java.lang.String |
getModifyRefundValuesErrorURL() |
java.lang.String |
getModifyRefundValuesSuccessURL() |
java.lang.String |
getOtherAdjustment()
Returns the other adjustment value that will get set on the
ReturnRequest.
|
java.lang.String |
getPaymentPageURL() |
java.lang.String |
getRefundPageURL() |
java.lang.String |
getResetRefundValuesErrorURL()
Returns property ErrorURL
|
java.lang.String |
getResetRefundValuesSuccessURL()
Returns property ResetRefundValuesSuccessURL
|
java.util.Map |
getReturnItemRefunds()
This method dynamically generates the Map and the values in it
from the ReturnRequest if the Map is null.
|
atg.commerce.csr.returns.ReturnManager |
getReturnManager()
Returns the return manager object
|
atg.commerce.csr.returns.ReturnRequest |
getReturnRequest() |
java.lang.String |
getShippingAdjustment()
Returns the shipping adjustment value that will get set on the
ReturnRequest.
|
javax.transaction.TransactionManager |
getTransactionManager()
Returns the transaction manager
|
protected java.util.Locale |
getUserLocale()
This method gets the current Locale
|
java.lang.String |
getUserLocalizedResource(java.lang.String pKey,
java.lang.Object[] pMsgArgs,
java.util.Locale pLocale)
Returns a formated user message for the given key, arguments and locale
|
java.lang.String |
getWashPageURL() |
boolean |
handleModifyRefundValues(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse) |
boolean |
handleResetRefundValues(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse) |
protected boolean |
modifyRefundValues(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
Validates and applies the form's refund values to the return request
and return items.
|
protected double |
parseAmount(java.lang.String pAmount)
Parses the given amount into a double value.
|
protected boolean |
postModifyRefundValues(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
This method is called after the refund values have been applied.
|
protected boolean |
postResetRefundValues(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
This method is called after the resetting refund values.
|
protected boolean |
preModifyRefundValues(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
This method is called before the refund values have been applied.
|
protected boolean |
preResetRefundValues(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
This method is called before the resetting refund values.
|
protected boolean |
resetRefundValues(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
called to reset the suggested values of the return.
|
void |
setCSRAgentTools(CSRAgentTools pCSRAgentTools)
Sets the property CSRAgentTools.
|
void |
setModifyRefundValuesErrorURL(java.lang.String pModifyRefundValuesErrorURL) |
void |
setModifyRefundValuesSuccessURL(java.lang.String pModifyRefundValuesSuccessURL) |
void |
setOtherAdjustment(java.lang.String pOtherAdjustment) |
void |
setPaymentPageURL(java.lang.String pPaymentPageURL)
Sets the PaymentPageURL.
|
void |
setRefundPageURL(java.lang.String pRefundPageURL)
Sets the refundMethodsPageURL.
|
void |
setResetRefundValuesErrorURL(java.lang.String pResetRefundValuesErrorURL) |
void |
setResetRefundValuesSuccessURL(java.lang.String pResetRefundValuesSuccessURL) |
void |
setReturnItemRefunds(java.util.Map pReturnItemRefunds) |
void |
setReturnManager(atg.commerce.csr.returns.ReturnManager pReturnManager)
sets the return manager object
|
void |
setReturnRequest(atg.commerce.csr.returns.ReturnRequest pReturnRequest) |
void |
setShippingAdjustment(java.lang.String pShippingAdjustment) |
void |
setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Sets the Transaction Manager
|
void |
setWashPageURL(java.lang.String pWashURL)
Sets the WashPageURL.
|
protected boolean |
validateAdjustmentValues()
Validates the refund values in the form's input properties.
|
protected boolean |
validateOtherAdjustment(double pOtherAdjustment)
Validates the other adjustment value
|
protected boolean |
validateReturnItemRefund(atg.commerce.csr.returns.ReturnItem pReturnItem,
double pRefundValue)
Validates the refund item refund values.
|
protected boolean |
validateShippingAdjustment(double pShippingAdjustment)
Validates the shipping refund value
|
addFormException, addUncheckedFormException, afterSet, beforeSet, checkFormRedirect, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleCancel, handleFormException, handleUncheckedFormException, hasUncheckedFormExceptions, isDeferForwardsAndRedirects, isRestorableForm, isUseForwards, isValidSession, redirectOrForward, resetFormExceptions, setCancelURL, setCheckForValidSession, setDeferForwardsAndRedirects, setFormName, setMessagePort, setMessageSource, setMessageType, setRestorableForm, setSendMessages, setUseForwards
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 java.lang.String mOtherAdjustment
protected java.lang.String mShippingAdjustment
protected java.util.Map mReturnItemRefunds
protected java.lang.String mRefundPageURL
protected java.lang.String mPaymentPageURL
protected java.lang.String mWashPageURL
protected atg.commerce.csr.returns.ReturnRequest mReturnRequest
protected java.lang.String mModifyRefundValuesErrorURL
protected java.lang.String mModifyRefundValuesSuccessURL
protected java.lang.String mResetRefundValuesErrorURL
protected java.lang.String mResetRefundValuesSuccessURL
protected javax.transaction.TransactionManager mTransactionManager
protected CSRAgentTools mCSRAgentTools
protected atg.commerce.csr.returns.ReturnManager mReturnManager
public java.lang.String getOtherAdjustment()
The property will initialize itself based on the current otherRefund in the ReturnRequest.
public void setOtherAdjustment(java.lang.String pOtherAdjustment)
public java.lang.String getShippingAdjustment()
Whe null, this property will initialize itself based on the current actualShippingRefund in the ReturnRequest.
public void setShippingAdjustment(java.lang.String pShippingAdjustment)
public java.lang.String getRefundPageURL()
ReturnPaymentState.REFUND
.
For example, the cost of the exchange order is less than the refund.
Note that this URL is only used in the successurl is not valued already.
public void setRefundPageURL(java.lang.String pRefundPageURL)
pRefundMethodsPageURL
- public java.lang.String getPaymentPageURL()
ReturnPaymentState.DUE
.
For example, the cost of the exchange order is more than the refund.
Note that this URL is only used in the successurl is not valued already.
public void setPaymentPageURL(java.lang.String pPaymentPageURL)
pPaymentPageURL
- public java.lang.String getWashPageURL()
ReturnPaymentState.NONE
.
For example, there is no refund because the calculated refund is the same
as the cost of the exchange order.
Note that this URL is only used in the successurl is not valued already.
public void setWashPageURL(java.lang.String pWashURL)
WashPageURL
- public java.util.Map getReturnItemRefunds()
public void setReturnItemRefunds(java.util.Map pReturnItemRefunds)
public atg.commerce.csr.returns.ReturnRequest getReturnRequest()
public void setReturnRequest(atg.commerce.csr.returns.ReturnRequest pReturnRequest)
public void setModifyRefundValuesErrorURL(java.lang.String pModifyRefundValuesErrorURL)
public java.lang.String getModifyRefundValuesErrorURL()
String
valuepublic void setModifyRefundValuesSuccessURL(java.lang.String pModifyRefundValuesSuccessURL)
public java.lang.String getModifyRefundValuesSuccessURL()
String
valuepublic void setResetRefundValuesErrorURL(java.lang.String pResetRefundValuesErrorURL)
public java.lang.String getResetRefundValuesErrorURL()
String
valuepublic void setResetRefundValuesSuccessURL(java.lang.String pResetRefundValuesSuccessURL)
public java.lang.String getResetRefundValuesSuccessURL()
String
valuepublic void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
pTransactionManager
- public javax.transaction.TransactionManager getTransactionManager()
public void setCSRAgentTools(CSRAgentTools pCSRAgentTools)
public CSRAgentTools getCSRAgentTools()
public void setReturnManager(atg.commerce.csr.returns.ReturnManager pReturnManager)
pReturnManager
- the return managerpublic atg.commerce.csr.returns.ReturnManager getReturnManager()
protected boolean validateReturnItemRefund(atg.commerce.csr.returns.ReturnItem pReturnItem, double pRefundValue)
protected boolean validateShippingAdjustment(double pShippingAdjustment)
protected boolean validateOtherAdjustment(double pOtherAdjustment)
protected boolean validateAdjustmentValues()
protected java.lang.String getItemRefundAmount(int pReturnItemIndex)
pReturnItemIndex
- public boolean handleModifyRefundValues(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected boolean preModifyRefundValues(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- pResponse
- javax.servlet.ServletException
java.io.IOException
protected boolean postModifyRefundValues(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- pResponse
- javax.servlet.ServletException
java.io.IOException
protected boolean modifyRefundValues(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- pResponse
- javax.servlet.ServletException
java.io.IOException
protected void applyReturnItemRefunds()
protected void applyShippingAdjustment()
protected void applyOtherAdjustment()
protected double parseAmount(java.lang.String pAmount) throws java.text.ParseException
pAmount
- the amount to parsejava.text.ParseException
CSRAgentTools.parseAmount(String, String)
protected java.lang.String formatAmount(double pAmount)
pAmount
- CSRAgentTools.formatAmount(double, String)
protected java.util.Locale getUserLocale()
public java.lang.String getUserLocalizedResource(java.lang.String pKey, java.lang.Object[] pMsgArgs, java.util.Locale pLocale)
pKey
- pMsgArgs
- pLocale
- public boolean handleResetRefundValues(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected boolean preResetRefundValues(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- pResponse
- javax.servlet.ServletException
java.io.IOException
protected boolean postResetRefundValues(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- pResponse
- javax.servlet.ServletException
java.io.IOException
protected boolean resetRefundValues(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- pResponse
- javax.servlet.ServletException
java.io.IOException