atg.commerce.order.purchase
Class SaveOrderFormHandler

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.SaveOrderFormHandler
All Implemented Interfaces:
atg.commerce.util.PipelineErrorHandler, DropletFormHandler, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class SaveOrderFormHandler
extends PurchaseProcessFormHandler

The SaveOrderFormHandler is used to save the user's current Order based on a descriptive name that the user specifies. A new empty Order is then made the user's current shopping cart. If a descriptive name for the Order is not specified, then one is created based on the user's Locale and date and time.

See Also:
GenericFormHandler, PurchaseProcessFormHandler

Field Summary
static java.lang.String CLASS_VERSION
           
static java.lang.String MSG_DUPLICATE_ORDER_DESCRIPTION
           
 
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
SaveOrderFormHandler()
          Creates a new SaveOrderFormHandler instance.
 
Method Summary
protected  boolean checkDuplicateDescription(java.lang.String pDescription)
          Checks for duplicate Descriptions among the Saved orders in the OrderHolder.
 java.lang.String getDescription()
          Return the Description property.
 java.lang.String getSaveOrderErrorURL()
          Return the SaveOrderErrorURL property.
 java.lang.String getSaveOrderSuccessURL()
          Return the SaveOrderSuccessURL property.
 boolean handleSaveOrder(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is used to save the user's order based on the provided String description, or absent this description based on the user's Locale representing the date and time.
 void postSaveOrder(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Empty method that can be overriden to provide additional functionality if desired.
 void preSaveOrder(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Empty method that can be overriden to provide additional functionality if desired.
protected  void runProcessSendScenarioEvent(Order pOrder, java.lang.String pType)
          The runProcessSendScenarioEvent method sends a scenario event.
protected  void saveOrder(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method sets the current Order's description and saves it.
 void setDescription(java.lang.String pDescription)
          Set the Description property.
 void setSaveOrderErrorURL(java.lang.String pSaveOrderErrorURL)
          Set the SaveOrderErrorURL property.
 void setSaveOrderSuccessURL(java.lang.String pSaveOrderSuccessURL)
          Set the SaveOrderSuccessURL property.
 
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, 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, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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

MSG_DUPLICATE_ORDER_DESCRIPTION

public static final java.lang.String MSG_DUPLICATE_ORDER_DESCRIPTION
See Also:
Constant Field Values
Constructor Detail

SaveOrderFormHandler

public SaveOrderFormHandler()
Creates a new SaveOrderFormHandler instance.

Method Detail

getDescription

public java.lang.String getDescription()
Return the Description property.

Returns:
a String value

setDescription

public void setDescription(java.lang.String pDescription)
Set the Description property.

Parameters:
pDescription - a String value

setSaveOrderSuccessURL

public void setSaveOrderSuccessURL(java.lang.String pSaveOrderSuccessURL)
Set the SaveOrderSuccessURL property.

Parameters:
pSaveOrderSuccessURL - a String value

getSaveOrderSuccessURL

public java.lang.String getSaveOrderSuccessURL()
Return the SaveOrderSuccessURL property.

Returns:
a String value

setSaveOrderErrorURL

public void setSaveOrderErrorURL(java.lang.String pSaveOrderErrorURL)
Set the SaveOrderErrorURL property.

Parameters:
pSaveOrderErrorURL - a String value

getSaveOrderErrorURL

public java.lang.String getSaveOrderErrorURL()
Return the SaveOrderErrorURL property.

Returns:
a String value

preSaveOrder

public void preSaveOrder(DynamoHttpServletRequest pRequest,
                         DynamoHttpServletResponse pResponse)
                  throws javax.servlet.ServletException,
                         java.io.IOException
Empty method that can be overriden to provide additional functionality if desired. Called before any processing is done by the handleSaveOrder method.

Parameters:
pRequest - the request object
pResponse - the response object
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

postSaveOrder

public void postSaveOrder(DynamoHttpServletRequest pRequest,
                          DynamoHttpServletResponse pResponse)
                   throws javax.servlet.ServletException,
                          java.io.IOException
Empty method that can be overriden to provide additional functionality if desired. Called after all processing is done by the handleSaveOrder method.

Parameters:
pRequest - the request object
pResponse - the response object
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

handleSaveOrder

public boolean handleSaveOrder(DynamoHttpServletRequest pRequest,
                               DynamoHttpServletResponse pResponse)
                        throws javax.servlet.ServletException,
                               java.io.IOException
This method is used to save the user's order based on the provided String description, or absent this description based on the user's Locale representing the date and time.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
true if the request was properly handled
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

saveOrder

protected void saveOrder(DynamoHttpServletRequest pRequest,
                         DynamoHttpServletResponse pResponse)
                  throws javax.servlet.ServletException,
                         java.io.IOException
This method sets the current Order's description and saves it. Subsequently a new empty Order is made the current one.

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

checkDuplicateDescription

protected boolean checkDuplicateDescription(java.lang.String pDescription)
Checks for duplicate Descriptions among the Saved orders in the OrderHolder.

Parameters:
pDescription - a String value
Returns:
true if no duplicates are found

runProcessSendScenarioEvent

protected void runProcessSendScenarioEvent(Order pOrder,
                                           java.lang.String pType)
                                    throws RunProcessException
The runProcessSendScenarioEvent method sends a scenario event.

Parameters:
pOrder - an Order value
pType - a String value
Throws:
RunProcessException - if an error occurs