atg.commerce.csr.order
Class ManualAdjustmentsFormHandler

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.csr.order.ManualAdjustmentsFormHandler
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 ManualAdjustmentsFormHandler
extends atg.commerce.order.purchase.PurchaseProcessFormHandler

A form handler for adding and removing manual order adjustments via the OrderTools.createOrderFixedAmountAdjustment() and OrderTools.removeOrderFixedAmountAdjustment() API

See Also:
OrderTools

Nested Class Summary
protected  class ManualAdjustmentsFormHandler.Handler
          Instances of this abstract class are passed to the protected handleRequest() method.
protected static class ManualAdjustmentsFormHandler.Operation
           
 
Field Summary
static java.lang.String ADJUSTMENT
           
static java.lang.String ADJUSTMENT_AMOUNT
           
static java.lang.String ADJUSTMENT_AMOUNT_INVALID_FORMAT
           
static java.lang.String ADJUSTMENT_ID
           
static java.lang.String ADJUSTMENT_TYPE
           
static java.lang.String CLASS_VERSION
           
protected  java.lang.String mAdjustmentAmountAsString
           
static java.lang.String MSG_ERROR_ADDING_MANUAL_ADJUSTMENT
           
static java.lang.String MSG_ERROR_ADJUSTMENT_AMT_INVALID_FORMAT
           
static java.lang.String MSG_ERROR_ADJUSTMENT_AMT_TOO_LARGE
           
static java.lang.String MSG_ERROR_ADJUSTMENT_AMT_TOO_SMALL
           
static java.lang.String MSG_ERROR_DELETING_MANUAL_ADJUSTMENT
           
static java.lang.String MSG_ERROR_NO_ADJUSTMENT_ID_SPECIFIED
           
static java.lang.String MSG_ERROR_NO_ADJUSTMENT_TYPE_SPECIFIED
           
static java.lang.String MSG_ERROR_REPRICING_ORDER
           
protected static java.lang.String RESOURCE_NAME
           
protected static java.util.ResourceBundle sResources
           
 
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
ManualAdjustmentsFormHandler()
           
 
Method Summary
protected  atg.repository.RepositoryItem addAdjustment(ManualAdjustmentsFormHandler.Handler pHandler)
          Add a new manual order adjustment.
protected  java.util.Map createRepriceParameterMap()
          Creates the extra parameter map for pricing the order after form handler modifications.
protected  boolean deleteAdjustment(ManualAdjustmentsFormHandler.Handler pHandler)
          Delete a manual adjustment identified by the adjustmentId property.
 java.lang.String getAddAdjustmentErrorURL()
           
 java.lang.String getAddAdjustmentSuccessURL()
           
 double getAdjustmentAmount()
           
 java.lang.String getAdjustmentAmountAsString()
          Returns the adjustmentAmountAsString.
 java.lang.String getAdjustmentId()
          Get the adjustment ID to be deleted.
 java.lang.String getAdjustmentNote()
           
 java.lang.String getAdjustmentReasonCode()
          The adjustment reason code is used when creating manual adjustments, and is also sent as the reason code value in the CSRAgentMessagingTools.sendRemoveOrderFixedAmountManualAdjustmentEvent() JMS message.
 java.lang.String getAdjustmentType()
          Type in [ "amountOff" | "amountIncrease" ], from atg.commerce.pricing.Constants.java.
 CSRAgentTools getCSRAgentTools()
           
 java.lang.String getDeleteAdjustmentErrorURL()
           
 java.lang.String getDeleteAdjustmentSuccessURL()
           
 double getMaximumAdjustmentAmount()
          The maximum amount for an adjustment
 double getMinimumAdjustmentAmount()
          The minimum amount for an adjustment
 java.lang.String getNewAdjustmentAsString()
           
protected  atg.repository.RepositoryItem getOrderAdjustmentById(atg.commerce.order.Order pOrder, java.lang.String pId)
          Get a manual adjustment by ID
 java.lang.String getPricingOp()
          Get the pricing operation to use for the order reprice that is executed after adding or deleting a manual adjustment.
 atg.commerce.pricing.PricingModelHolder getUserPricingModels()
          Returns the PricingModelHolder that should be used for the current order.
 boolean handleAddAdjustment(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Add manual order adjustment
 boolean handleDeleteAdjustment(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Delete manual order adjustment
protected  boolean handleRequest(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse, ManualAdjustmentsFormHandler.Handler pHandler)
          Boilerplate request handler, all specialization occurs in the Handler implementation.
protected  void postAddAdjustment(ManualAdjustmentsFormHandler.Handler pHandler)
          Post process opportunity for the add adjustment action.
protected  void postDeleteAdjustment(ManualAdjustmentsFormHandler.Handler pHandler)
          Post process opportunity for the delete adjustment action.
protected  void postProcessAddAdjustment(ManualAdjustmentsFormHandler.Handler pHandler)
          Do things that need to be done after a manual order adjustment has been added.
protected  void postProcessDeleteAdjustment(ManualAdjustmentsFormHandler.Handler pHandler)
          Do things that need to be done after a manual order adjustment has been removed.
protected  void preAddAdjustment(ManualAdjustmentsFormHandler.Handler pHandler)
          Pre process opportunity for the add adjustment action.
protected  void preDeleteAdjustment(ManualAdjustmentsFormHandler.Handler pHandler)
          Pre process opportunity for the delete adjustment action.
protected  void sendEvents(ManualAdjustmentsFormHandler.Operation pOp, ManualAdjustmentsFormHandler.Handler pHandler)
          Send events related to the completed operation.
 void setAddAdjustmentErrorURL(java.lang.String pURL)
           
 void setAddAdjustmentSuccessURL(java.lang.String pURL)
           
 void setAdjustmentAmount(double pAdjustmentAmount)
           
 void setAdjustmentAmountAsString(java.lang.String pAdjustmentAmountAsString)
          Sets the adjustmentAmountAsString
 void setAdjustmentId(java.lang.String pAdjustmentId)
          Set the manual adjustment ID.
 void setAdjustmentNote(java.lang.String pAdjustmentNote)
           
 void setAdjustmentReasonCode(java.lang.String pAdjustmentReasonCode)
          The adjustment reason code is used when creating manual adjustments, and is also sent as the reason code value in the CSRAgentMessagingTools.sendRemoveOrderFixedAmountManualAdjustmentEvent() JMS message.
 void setAdjustmentType(java.lang.String pAdjustmentType)
          Type in [ "amountOff" | "amountIncrease" ], from atg.commerce.pricing.Constants.java.
 void setCSRAgentTools(CSRAgentTools pCAT)
           
 void setDeleteAdjustmentErrorURL(java.lang.String pURL)
           
 void setDeleteAdjustmentSuccessURL(java.lang.String pURL)
           
 void setMaximumAdjustmentAmount(double pMax)
          The maximum amount for an adjustment
 void setMinimumAdjustmentAmount(double pMax)
          The minimum amount for an adjustment
 void setPricingOp(java.lang.String pPricingOp)
          Set the pricing operation to use for the order reprice that is executed after adding or deleting a manual adjustment.
protected  void updateOrderAfterAdjustment(ManualAdjustmentsFormHandler.Operation pOp, ManualAdjustmentsFormHandler.Handler pHandler)
          Method called to update order after all changes have been applied.
protected  void validateAddAdjustmentFields()
          Validate fields for the addAdjustment() handler.
protected  void validateDeleteAdjustmentFields()
           
 
Methods inherited from class atg.commerce.order.purchase.PurchaseProcessFormHandler
acquireTransactionLock, acquireTransactionLock, afterSet, beforeSet, checkFormRedirect, commitTransaction, copyConfiguration, 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, 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

RESOURCE_NAME

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

sResources

protected static java.util.ResourceBundle sResources

ADJUSTMENT

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

ADJUSTMENT_ID

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

ADJUSTMENT_TYPE

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

ADJUSTMENT_AMOUNT

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

ADJUSTMENT_AMOUNT_INVALID_FORMAT

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

MSG_ERROR_ADJUSTMENT_AMT_TOO_SMALL

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

MSG_ERROR_ADJUSTMENT_AMT_TOO_LARGE

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

MSG_ERROR_NO_ADJUSTMENT_ID_SPECIFIED

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

MSG_ERROR_NO_ADJUSTMENT_TYPE_SPECIFIED

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

MSG_ERROR_REPRICING_ORDER

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

MSG_ERROR_ADDING_MANUAL_ADJUSTMENT

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

MSG_ERROR_DELETING_MANUAL_ADJUSTMENT

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

MSG_ERROR_ADJUSTMENT_AMT_INVALID_FORMAT

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

mAdjustmentAmountAsString

protected java.lang.String mAdjustmentAmountAsString
Constructor Detail

ManualAdjustmentsFormHandler

public ManualAdjustmentsFormHandler()
Method Detail

getAdjustmentAmountAsString

public java.lang.String getAdjustmentAmountAsString()
Returns the adjustmentAmountAsString.

This property is used enter the adjustment amount as string. The adjustment amount may contain currency symbols and amount values.

Returns:
the adjustmentAmountAsString

setAdjustmentAmountAsString

public void setAdjustmentAmountAsString(java.lang.String pAdjustmentAmountAsString)
Sets the adjustmentAmountAsString

This property is used enter the adjustment amount as string. The adjustment amount may contain currency symbols and amount values.

The adjustment amount is parsed and set in setAdjustmentAmount(double).

Parameters:
pAdjustmentAmountAsString - the adjustmentAmountAsString to set
See Also:
CSRAgentTools.parseAmount(String, String), setAdjustmentAmount(double)

setMaximumAdjustmentAmount

public void setMaximumAdjustmentAmount(double pMax)
The maximum amount for an adjustment


getMaximumAdjustmentAmount

public double getMaximumAdjustmentAmount()
The maximum amount for an adjustment


setMinimumAdjustmentAmount

public void setMinimumAdjustmentAmount(double pMax)
The minimum amount for an adjustment


getMinimumAdjustmentAmount

public double getMinimumAdjustmentAmount()
The minimum amount for an adjustment


getPricingOp

public java.lang.String getPricingOp()
Get the pricing operation to use for the order reprice that is executed after adding or deleting a manual adjustment.

Returns:
the pricing operation code

setPricingOp

public void setPricingOp(java.lang.String pPricingOp)
Set the pricing operation to use for the order reprice that is executed after adding or deleting a manual adjustment. Defaults to PricingConstants.OP_REPRICE_ORDER_TOTAL.

See Also:
PricingConstants

getAdjustmentAmount

public double getAdjustmentAmount()

setAdjustmentAmount

public void setAdjustmentAmount(double pAdjustmentAmount)

getAdjustmentType

public java.lang.String getAdjustmentType()
Type in [ "amountOff" | "amountIncrease" ], from atg.commerce.pricing.Constants.java. Defaults to atg.commerce.pricing.Constants.AMOUNT_OFF.


setAdjustmentType

public void setAdjustmentType(java.lang.String pAdjustmentType)
Type in [ "amountOff" | "amountIncrease" ], from atg.commerce.pricing.Constants.java.


getAdjustmentNote

public java.lang.String getAdjustmentNote()

setAdjustmentNote

public void setAdjustmentNote(java.lang.String pAdjustmentNote)

getAdjustmentReasonCode

public java.lang.String getAdjustmentReasonCode()
The adjustment reason code is used when creating manual adjustments, and is also sent as the reason code value in the CSRAgentMessagingTools.sendRemoveOrderFixedAmountManualAdjustmentEvent() JMS message.

Returns:
the reason code or null

setAdjustmentReasonCode

public void setAdjustmentReasonCode(java.lang.String pAdjustmentReasonCode)
The adjustment reason code is used when creating manual adjustments, and is also sent as the reason code value in the CSRAgentMessagingTools.sendRemoveOrderFixedAmountManualAdjustmentEvent() JMS message.

Parameters:
pAdjustmentReasonCode - the reason code or null

setAdjustmentId

public void setAdjustmentId(java.lang.String pAdjustmentId)
Set the manual adjustment ID. Used in the delete action

Parameters:
pAdjustmentId - the ID

getAdjustmentId

public java.lang.String getAdjustmentId()
Get the adjustment ID to be deleted.

Returns:
the adjustment ID or null

getAddAdjustmentSuccessURL

public java.lang.String getAddAdjustmentSuccessURL()

setAddAdjustmentSuccessURL

public void setAddAdjustmentSuccessURL(java.lang.String pURL)

getAddAdjustmentErrorURL

public java.lang.String getAddAdjustmentErrorURL()

setAddAdjustmentErrorURL

public void setAddAdjustmentErrorURL(java.lang.String pURL)

getDeleteAdjustmentSuccessURL

public java.lang.String getDeleteAdjustmentSuccessURL()

setDeleteAdjustmentSuccessURL

public void setDeleteAdjustmentSuccessURL(java.lang.String pURL)

getDeleteAdjustmentErrorURL

public java.lang.String getDeleteAdjustmentErrorURL()

setDeleteAdjustmentErrorURL

public void setDeleteAdjustmentErrorURL(java.lang.String pURL)

setCSRAgentTools

public void setCSRAgentTools(CSRAgentTools pCAT)

getCSRAgentTools

public CSRAgentTools getCSRAgentTools()

validateAddAdjustmentFields

protected void validateAddAdjustmentFields()
Validate fields for the addAdjustment() handler. This method validates the amount, which must be > 0, and the type, which must be specified (i.e. non-blank.) Adds DropletFormException instances for validation failures.


validateDeleteAdjustmentFields

protected void validateDeleteAdjustmentFields()

getOrderAdjustmentById

protected atg.repository.RepositoryItem getOrderAdjustmentById(atg.commerce.order.Order pOrder,
                                                               java.lang.String pId)
Get a manual adjustment by ID

Parameters:
pOrder - the order from which to get the adjustments
pId - the ID of the adjustment to get
Returns:
the manual adjustment repository item or null if not found

handleRequest

protected boolean handleRequest(atg.servlet.DynamoHttpServletRequest pRequest,
                                atg.servlet.DynamoHttpServletResponse pResponse,
                                ManualAdjustmentsFormHandler.Handler pHandler)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Boilerplate request handler, all specialization occurs in the Handler implementation.

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

preAddAdjustment

protected void preAddAdjustment(ManualAdjustmentsFormHandler.Handler pHandler)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Pre process opportunity for the add adjustment action. This method validates calls validateAddAdjustmentFields()

Parameters:
pHandler - the handler object
Throws:
javax.servlet.ServletException
java.io.IOException

postAddAdjustment

protected void postAddAdjustment(ManualAdjustmentsFormHandler.Handler pHandler)
                          throws javax.servlet.ServletException,
                                 java.io.IOException
Post process opportunity for the add adjustment action. This method does nothing.

Parameters:
pHandler - the handler object
Throws:
javax.servlet.ServletException
java.io.IOException

addAdjustment

protected atg.repository.RepositoryItem addAdjustment(ManualAdjustmentsFormHandler.Handler pHandler)
                                               throws javax.servlet.ServletException,
                                                      java.io.IOException
Add a new manual order adjustment.

Parameters:
pHandler - the handler object
Returns:
the newly added adjustment or null
Throws:
javax.servlet.ServletException
java.io.IOException

postProcessAddAdjustment

protected void postProcessAddAdjustment(ManualAdjustmentsFormHandler.Handler pHandler)
                                 throws javax.servlet.ServletException,
                                        java.io.IOException
Do things that need to be done after a manual order adjustment has been added. This method reprices the order via updateOrderAfterAdjustment(), then sends scenario events with sendEvents().

Parameters:
pHandler - the handler
Throws:
javax.servlet.ServletException
java.io.IOException

preDeleteAdjustment

protected void preDeleteAdjustment(ManualAdjustmentsFormHandler.Handler pHandler)
                            throws javax.servlet.ServletException,
                                   java.io.IOException
Pre process opportunity for the delete adjustment action. This method calls validateDeleteAdjustmentFields().

Parameters:
pHandler - the handler instance
Throws:
javax.servlet.ServletException
java.io.IOException

postDeleteAdjustment

protected void postDeleteAdjustment(ManualAdjustmentsFormHandler.Handler pHandler)
                             throws javax.servlet.ServletException,
                                    java.io.IOException
Post process opportunity for the delete adjustment action. This method does nothing.

Parameters:
pHandler - the handler instance
Throws:
javax.servlet.ServletException
java.io.IOException

deleteAdjustment

protected boolean deleteAdjustment(ManualAdjustmentsFormHandler.Handler pHandler)
                            throws javax.servlet.ServletException,
                                   java.io.IOException
Delete a manual adjustment identified by the adjustmentId property.

Parameters:
pHandler - the handler instance
Throws:
javax.servlet.ServletException
java.io.IOException

postProcessDeleteAdjustment

protected void postProcessDeleteAdjustment(ManualAdjustmentsFormHandler.Handler pHandler)
                                    throws javax.servlet.ServletException,
                                           java.io.IOException
Do things that need to be done after a manual order adjustment has been removed. This method reprices the order via updateOrderAfterAdjustment(), then sends scenario events with sendEvents().

Parameters:
pHandler - the handler
Throws:
javax.servlet.ServletException
java.io.IOException

sendEvents

protected void sendEvents(ManualAdjustmentsFormHandler.Operation pOp,
                          ManualAdjustmentsFormHandler.Handler pHandler)
Send events related to the completed operation. Note that this method requres that the adjustment repository item is available in the Handler's options map associated with the ADJUSTMENT key.

Parameters:
pHandler - the handler in use
pOp - the type of operation just performed

updateOrderAfterAdjustment

protected void updateOrderAfterAdjustment(ManualAdjustmentsFormHandler.Operation pOp,
                                          ManualAdjustmentsFormHandler.Handler pHandler)
                                   throws javax.servlet.ServletException,
                                          java.io.IOException
Method called to update order after all changes have been applied. This method reprices the order with the value of pricingOp, then calls OrderManager.updateOrder().

Parameters:
pOp - type of operation (ADD, DELETE) that has occurred
pHandler - the request handler
Throws:
javax.servlet.ServletException
java.io.IOException

getNewAdjustmentAsString

public java.lang.String getNewAdjustmentAsString()
Returns:
new adjustment values as a String

handleAddAdjustment

public boolean handleAddAdjustment(atg.servlet.DynamoHttpServletRequest pRequest,
                                   atg.servlet.DynamoHttpServletResponse pResponse)
                            throws javax.servlet.ServletException,
                                   java.io.IOException
Add manual order adjustment

Parameters:
pRequest - the Dynamo request
pResponse - the Dynamo response
Throws:
javax.servlet.ServletException
java.io.IOException

handleDeleteAdjustment

public boolean handleDeleteAdjustment(atg.servlet.DynamoHttpServletRequest pRequest,
                                      atg.servlet.DynamoHttpServletResponse pResponse)
                               throws javax.servlet.ServletException,
                                      java.io.IOException
Delete manual order adjustment

Throws:
javax.servlet.ServletException
java.io.IOException

createRepriceParameterMap

protected java.util.Map createRepriceParameterMap()
Creates the extra parameter map for pricing the order after form handler modifications.

Overrides:
createRepriceParameterMap in class atg.commerce.order.purchase.PurchaseProcessFormHandler
Returns:
Map of parameters or null
See Also:
CSRAgentTools.addCurrentOrderPricingParameters(Map)

getUserPricingModels

public atg.commerce.pricing.PricingModelHolder getUserPricingModels()
Returns the PricingModelHolder that should be used for the current order.

Overrides:
getUserPricingModels in class atg.commerce.order.purchase.PurchaseProcessFormHandler
Returns:
a PricingModelHolder value
See Also:
CSREnvironmentTools.getOrderPricingModelHolder(Order)