atg.commerce.csr.order
Class CSRCancelOrderFormHandler

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.droplet.EmptyFormHandler
              extended by atg.droplet.GenericFormHandler
                  extended by atg.commerce.order.purchase.PurchaseProcessFormHandler
                      extended by atg.commerce.order.purchase.CancelOrderFormHandler
                          extended by atg.commerce.csr.order.CSRCancelOrderFormHandler
All Implemented Interfaces:
atg.commerce.util.PipelineErrorHandler, atg.droplet.DropletFormHandler, 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, java.util.EventListener

public class CSRCancelOrderFormHandler
extends atg.commerce.order.purchase.CancelOrderFormHandler

The CSRCancelOrderFormHandler extends CancelOrderFormHandler to add the sending of the AgentEvent for audit-logging purposes

See Also:
GenericFormHandler, CancelOrderFormHandler

Field Summary
static java.lang.String CANCEL_EXCHG_ONLY
           
static java.lang.String CANCEL_EXCHG_RETURN
           
static java.lang.String CLASS_VERSION
           
protected  CSRAgentTools mCSRAgentTools
           
static java.lang.String MSG_ERROR_WHILE_CREATING_NEW_ORDER
           
static java.lang.String MSG_ERROR_WHILE_ROLLINGBACK_EXCHG_ORDER
           
static java.lang.String MSG_NO_DESIRED_CANCEL_ACTION
           
static java.lang.String MY_RESOURCE_NAME
           
 
Fields inherited from class atg.commerce.order.purchase.CancelOrderFormHandler
MSG_ERROR_CANCELLING_ORDER, MSG_ERROR_LOADING_ORDER, MSG_ERROR_SENDING_MESSAGE, MSG_INVALID_ORDER_ID, MSG_ORDER_NOT_CURRENT, MSG_USER_INFO_NOT_AVAILABLE, MSG_USER_NO_PERMISSION_TO_CANCEL
 
Fields inherited from class atg.commerce.order.purchase.PurchaseProcessFormHandler
LOCK_NAME_ATTRIBUTE_NAME, PARAM_TRANSACTION_CREATED, PARAM_VALUE_TRUE
 
Fields inherited from class atg.droplet.GenericFormHandler
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
 
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
CSRCancelOrderFormHandler()
           
 
Method Summary
 java.lang.String cancelExchangeOrder(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This method is assisting the cancel operation.
 void cancelOrder(atg.commerce.order.Order pOrder, atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This method sends the CancelOrder event
 void createNewOrder()
          This method calls the EnvironmentTools and creates new order.
 CSRAgentMessagingTools getAgentMessagingTools()
          Returns component for sending agent messages
 java.lang.String getCancelExchangeOrderErrorURL()
          Returns the cancelExchangeOrderErrorURL.
 java.lang.String getCancelExchangeOrderSuccessURL()
          Returns the cancelExchangeOrderSuccessURL.
 CSRAgentTools getCSRAgentTools()
           
 java.lang.String getDesiredExchangeOrderCancelOperation()
          This option is used with Returns and Exchanges.
 java.lang.String getNewOrderProgressBarPath()
          Returns the newOrderProgressBarPath.
 java.lang.String getRefundMethodsPageURL()
          Returns the refundMethodsPageURL.
 java.lang.String getReturnItemsProgressBarPath()
          Returns the returnItemsProgressBarPath.
 ReturnManager getReturnManager()
          Returns the returnManager.
 java.lang.String getViewExistingOrderPageURL()
          Returns the viewExistingOrderPageURL.
 boolean handleCancelExchangeOrder(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          The handleCancelExchangeOrder method cancels the exchange order or exchange order and returns.
 void postCancelExchangeOrder(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          postCancelExchangeOrder is used for work that must happen after the Exchange Order is cancelled.
 void postCancelOrder(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Override the base implementation to create a new transient order and place it in the cart.
 void preCancelExchangeOrder(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          preCancelExchangeOrder is used for work that must happen before the exchange Order is cancelled.
 void setAgentMessagingTools(CSRAgentMessagingTools pAgentMessagingTools)
          Sets the component for sending agent messages
 void setCancelExchangeOrderErrorURL(java.lang.String pCancelExchangeOrderErrorURL)
          Sets the cancelExchangeOrderErrorURL.
 void setCancelExchangeOrderSuccessURL(java.lang.String pCancelExchangeOrderSuccessURL)
          Sets the cancelExchangeOrderSuccessURL.
 void setCSRAgentTools(CSRAgentTools pCSRAgentTools)
          Sets the property CSRAgentTools.
 void setDesiredExchangeOrderCancelOperation(java.lang.String pDesiredExchangeOrderCancelOperation)
          This option is used with Returns and Exchanges.
 void setNewOrderProgressBarPath(java.lang.String pNewOrderProgressBarPath)
          Sets the newOrderProgressBarPath.
 void setRefundMethodsPageURL(java.lang.String pRefundMethodsPageURL)
          Sets the refundMethodsPageURL.
 void setReturnItemsProgressBarPath(java.lang.String pReturnItemsProgressBarPath)
          Sets the returnItemsProgressBarPath.
 void setReturnManager(ReturnManager pReturnManager)
          Sets the returnManager.
 void setViewExistingOrderPageURL(java.lang.String pViewExistingOrderPageURL)
          Sets the viewExistingOrderPageURL.
 
Methods inherited from class atg.commerce.order.purchase.CancelOrderFormHandler
canUserCancelOrder, deleteOrder, deleteOrder, getCancelOrderErrorURL, getCancelOrderService, getCancelOrderSuccessURL, getDeleteStates, getIgnoreStates, getMessageSender, getOrderIdToCancel, handleCancelCurrentOrder, handleCancelOrder, isDeleteState, isIgnoreState, preCancelOrder, preserveOrder, setCancelOrderErrorURL, setCancelOrderService, setCancelOrderSuccessURL, setDeleteStates, setIgnoreStates, setMessageSender, setOrderIdToCancel
 
Methods inherited from class atg.commerce.order.purchase.PurchaseProcessFormHandler
acquireTransactionLock, acquireTransactionLock, afterSet, beforeSet, checkFormRedirect, commitTransaction, copyConfiguration, createRepriceParameterMap, defaultLocalLockManager, defaultUserProfile, doStartService, ensureTransaction, formatUserMessage, formatUserMessage, formatUserMessage, formatUserMessage, generatePropertyPath, getClaimableManager, getCommerceIdentifierPaymentInfoContainer, getCommerceItemManager, getCommerceItemShippingInfoContainer, getCommerceProfileTools, getCommercePropertyManager, getConfiguration, getCurrentTransaction, getDefaultLocale, getGiftlistManager, getHandlingInstructionManager, getLocalLockManager, getOrder, getOrderManager, getPaymentGroupManager, getPaymentGroupMapContainer, getPipelineManager, getPriceList, getPriceListId, getPriceListManager, getProfile, getProfileRepository, getPurchaseProcessHelper, getRepeatingRequestMonitor, getRepriceOrderChainId, getResourceBundle, getResourceBundle, getResourceBundleName, getSessionExpirationURL, getShippingGroupManager, getShippingGroupMapContainer, getShoppingCart, getTransactionManager, getUserLocale, getUserLocale, getUserPricingModels, handlePipelineError, isEnsureTransaction, isFormSubmission, isTransactionCreated, isTransactionMarkedAsRollBack, isUseLocksAroundTransactions, isUseRequestLocale, processException, processPipelineErrors, releaseTransactionLock, releaseTransactionLock, runProcess, runProcess, runProcess, runProcessRepriceOrder, runProcessRepriceOrder, runRepricingProcess, setClaimableManager, setCommerceIdentifierPaymentInfoContainer, setCommerceItemManager, setCommerceItemShippingInfoContainer, setCommerceProfileTools, setCommercePropertyManager, setConfiguration, setCurrentTransaction, setDefaultLocale, setEnsureTransaction, setGiftlistManager, setHandlingInstructionManager, setLocalLockManager, setOrder, setOrderManager, setPaymentGroupManager, setPaymentGroupMapContainer, setPipelineManager, setPriceListId, setPriceListManager, setProfile, setProfileRepository, setPurchaseProcessHelper, setRepeatingRequestMonitor, setRepriceOrderChainId, setSessionExpirationURL, setShippingGroupManager, setShippingGroupMapContainer, setShoppingCart, setTransactionCreated, setTransactionManager, setTransactionToRollbackOnly, setUseLocksAroundTransactions, setUseRequestLocale, setUserLocale, setUserPricingModels, transactionLockName, unsetTransactionCreated
 
Methods inherited from class atg.droplet.GenericFormHandler
addFormException, addUncheckedFormException, 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
 
Methods inherited from class atg.droplet.EmptyFormHandler
afterGet, beforeGet
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, 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 final java.lang.String CLASS_VERSION
See Also:
Constant Field Values

MY_RESOURCE_NAME

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

CANCEL_EXCHG_RETURN

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

CANCEL_EXCHG_ONLY

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

MSG_NO_DESIRED_CANCEL_ACTION

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

MSG_ERROR_WHILE_CREATING_NEW_ORDER

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

MSG_ERROR_WHILE_ROLLINGBACK_EXCHG_ORDER

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

mCSRAgentTools

protected CSRAgentTools mCSRAgentTools
Constructor Detail

CSRCancelOrderFormHandler

public CSRCancelOrderFormHandler()
Method Detail

getViewExistingOrderPageURL

public java.lang.String getViewExistingOrderPageURL()
Returns the viewExistingOrderPageURL.

Returns:
viewExistingOrderPageURL

setViewExistingOrderPageURL

public void setViewExistingOrderPageURL(java.lang.String pViewExistingOrderPageURL)
Sets the viewExistingOrderPageURL.

Parameters:
pViewExistingOrderPageURL -

getReturnManager

public ReturnManager getReturnManager()
Returns the returnManager.

Returns:
returnManager

setReturnManager

public void setReturnManager(ReturnManager pReturnManager)
Sets the returnManager.

Parameters:
pReturnManager -

getReturnItemsProgressBarPath

public java.lang.String getReturnItemsProgressBarPath()
Returns the returnItemsProgressBarPath.

Returns:
returnItemsProgressBarPath

setReturnItemsProgressBarPath

public void setReturnItemsProgressBarPath(java.lang.String pReturnItemsProgressBarPath)
Sets the returnItemsProgressBarPath.

Parameters:
pReturnItemsProgressBarPath -

getNewOrderProgressBarPath

public java.lang.String getNewOrderProgressBarPath()
Returns the newOrderProgressBarPath.

Returns:
newOrderProgressBarPath

setNewOrderProgressBarPath

public void setNewOrderProgressBarPath(java.lang.String pNewOrderProgressBarPath)
Sets the newOrderProgressBarPath.

Parameters:
pNewOrderProgressBarPath -

getRefundMethodsPageURL

public java.lang.String getRefundMethodsPageURL()
Returns the refundMethodsPageURL.

Returns:
refundMethodsPageURL

setRefundMethodsPageURL

public void setRefundMethodsPageURL(java.lang.String pRefundMethodsPageURL)
Sets the refundMethodsPageURL.

Parameters:
pRefundMethodsPageURL -

getCancelExchangeOrderErrorURL

public java.lang.String getCancelExchangeOrderErrorURL()
Returns the cancelExchangeOrderErrorURL.

Returns:
cancelExchangeOrderErrorURL

setCancelExchangeOrderErrorURL

public void setCancelExchangeOrderErrorURL(java.lang.String pCancelExchangeOrderErrorURL)
Sets the cancelExchangeOrderErrorURL.

Parameters:
pCancelExchangeOrderErrorURL -

getCancelExchangeOrderSuccessURL

public java.lang.String getCancelExchangeOrderSuccessURL()
Returns the cancelExchangeOrderSuccessURL.

Returns:
cancelExchangeOrderSuccessURL

setCancelExchangeOrderSuccessURL

public void setCancelExchangeOrderSuccessURL(java.lang.String pCancelExchangeOrderSuccessURL)
Sets the cancelExchangeOrderSuccessURL.

Parameters:
pCancelExchangeOrderSuccessURL -

getDesiredExchangeOrderCancelOperation

public java.lang.String getDesiredExchangeOrderCancelOperation()
This option is used with Returns and Exchanges. While processing the Exchange Order, user is provided with couple of options. The two out of box options are as follows: Returns the desiredExchangeOrderCancelOperation.

Returns:
desiredExchangeOrderCancelOperation

setDesiredExchangeOrderCancelOperation

public void setDesiredExchangeOrderCancelOperation(java.lang.String pDesiredExchangeOrderCancelOperation)
This option is used with Returns and Exchanges. While processing the Exchange Order, user is provided with couple of options. The two out of box options are as follows: Sets the desiredExchangeOrderCancelOperation.

Parameters:
pDesiredExchangeOrderCancelOperation -

setAgentMessagingTools

public void setAgentMessagingTools(CSRAgentMessagingTools pAgentMessagingTools)
Sets the component for sending agent messages

Parameters:
pAgentMessagingTools -

getAgentMessagingTools

public CSRAgentMessagingTools getAgentMessagingTools()
Returns component for sending agent messages

Returns:
AgentMessagingTools

setCSRAgentTools

public void setCSRAgentTools(CSRAgentTools pCSRAgentTools)
Sets the property CSRAgentTools.


getCSRAgentTools

public CSRAgentTools getCSRAgentTools()
Returns:
The CSRAgentTools component used to manipulate the profile

cancelOrder

public void cancelOrder(atg.commerce.order.Order pOrder,
                        atg.servlet.DynamoHttpServletRequest pRequest,
                        atg.servlet.DynamoHttpServletResponse pResponse)
                 throws javax.servlet.ServletException,
                        java.io.IOException
This method sends the CancelOrder event

Overrides:
cancelOrder in class atg.commerce.order.purchase.CancelOrderFormHandler
Parameters:
pOrder - the Order to be canceled
pRequest - a DynamoHttpServletRequest value
pResponse - a DynamoHttpServletResponse value
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

postCancelOrder

public void postCancelOrder(atg.servlet.DynamoHttpServletRequest pRequest,
                            atg.servlet.DynamoHttpServletResponse pResponse)
                     throws javax.servlet.ServletException,
                            java.io.IOException
Override the base implementation to create a new transient order and place it in the cart.

Overrides:
postCancelOrder in class atg.commerce.order.purchase.CancelOrderFormHandler
Parameters:
pRequest - a DynamoHttpServletRequest value
pResponse - a DynamoHttpServletResponse value
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

preCancelExchangeOrder

public void preCancelExchangeOrder(atg.servlet.DynamoHttpServletRequest pRequest,
                                   atg.servlet.DynamoHttpServletResponse pResponse)
                            throws javax.servlet.ServletException,
                                   java.io.IOException
preCancelExchangeOrder is used for work that must happen before the exchange Order is cancelled.

Parameters:
pRequest - a DynamoHttpServletRequest value
pResponse - a DynamoHttpServletResponse value
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

postCancelExchangeOrder

public void postCancelExchangeOrder(atg.servlet.DynamoHttpServletRequest pRequest,
                                    atg.servlet.DynamoHttpServletResponse pResponse)
                             throws javax.servlet.ServletException,
                                    java.io.IOException
postCancelExchangeOrder is used for work that must happen after the Exchange Order is cancelled.

Parameters:
pRequest - a DynamoHttpServletRequest value
pResponse - a DynamoHttpServletResponse value
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

handleCancelExchangeOrder

public boolean handleCancelExchangeOrder(atg.servlet.DynamoHttpServletRequest pRequest,
                                         atg.servlet.DynamoHttpServletResponse pResponse)
                                  throws javax.servlet.ServletException,
                                         java.io.IOException
The handleCancelExchangeOrder method cancels the exchange order or exchange order and returns.

Parameters:
pRequest - a DynamoHttpServletRequest value
pResponse - a DynamoHttpServletResponse value
Returns:
a boolean value
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

cancelExchangeOrder

public java.lang.String cancelExchangeOrder(atg.servlet.DynamoHttpServletRequest pRequest,
                                            atg.servlet.DynamoHttpServletResponse pResponse)
                                     throws javax.servlet.ServletException,
                                            java.io.IOException
This method is assisting the cancel operation. In case of the cancelling exchange and return, this method creates a new order. Exchange and ReturnRequest are in the transient state. In case of cancelling exchange only, resetting the return request with original order and clearing the replacement order from the return request. Also changing the process name to Return. If the user is cancelling only the exchange order, this method sets the progress bar to ReturnItems and forwards to refundType page. The refund type page will set the progress bar by itself. If the user is cancelling the Returns and Exchanges, then the newOrder progress bar is set to true.

Parameters:
pRequest -
pResponse -
Returns:
String - Returns the success url. This URL is used to forward to the right page.
Throws:
javax.servlet.ServletException
java.io.IOException

createNewOrder

public void createNewOrder()
This method calls the EnvironmentTools and creates new order. Also selects the new order progress bar.