atg.projects.store.order.purchase
Class GiftMessageFormHandler

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.projects.store.order.purchase.GiftMessageFormHandler
All Implemented Interfaces:
atg.commerce.util.PipelineErrorHandler, atg.droplet.DropletFormHandler, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, 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 GiftMessageFormHandler
extends atg.commerce.order.purchase.PurchaseProcessFormHandler

This class is used to handle form submissions from the Gift Message page.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string.
protected static java.lang.String ERROR_ADDING_GIFT_MESSAGE
          Error adding gift message message key.
protected static java.lang.String GIFT_MESSAGE_TOO_LONG
          Gift message too long message key.
protected  java.lang.String mAddGiftMessageErrorURL
          Add gift message redirect URL.
protected  java.lang.String mAddGiftMessageSuccessURL
          Add gify message success redirect URL.
protected  java.lang.String mExpressCheckout
          Express checkout.
protected  java.lang.String mGiftMessage
          Gift message text.
protected  java.lang.String mGiftMessageFrom
          Gift message recipient.
protected  java.lang.String mGiftMessageTo
          Gift message sender.
protected static java.lang.String MSG_NO_GIFT_MSG
          No gift message message key.
 
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
GiftMessageFormHandler()
           
 
Method Summary
protected  void addGiftMessage(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Adds the gift message to the order.
 java.lang.String getAddGiftMessageErrorURL()
           
 java.lang.String getAddGiftMessageSuccessURL()
           
 java.lang.String getCouponCode()
           
 java.lang.String getExpressCheckout()
           
 java.lang.String getGiftMessage()
           
 java.lang.String getGiftMessageFrom()
           
 java.lang.String getGiftMessageTo()
           
 boolean handleAddGiftMessage(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This method will add the gift message to the order's specialInstructions.
 void setAddGiftMessageErrorURL(java.lang.String pAddGiftMessageErrorURL)
           
 void setAddGiftMessageSuccessURL(java.lang.String pAddGiftMessageSuccessURL)
           
 void setCouponCode(java.lang.String pCouponCode)
           
 void setExpressCheckout(java.lang.String pExpressCheckout)
           
 void setGiftMessage(java.lang.String pGiftMessage)
           
 void setGiftMessageFrom(java.lang.String pGiftMessageFrom)
           
 void setGiftMessageTo(java.lang.String pGiftMessageTo)
           
 
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, 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, reResolveThis, 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
Class version string.


GIFT_MESSAGE_TOO_LONG

protected static final java.lang.String GIFT_MESSAGE_TOO_LONG
Gift message too long message key.

See Also:
Constant Field Values

MSG_NO_GIFT_MSG

protected static final java.lang.String MSG_NO_GIFT_MSG
No gift message message key.

See Also:
Constant Field Values

ERROR_ADDING_GIFT_MESSAGE

protected static final java.lang.String ERROR_ADDING_GIFT_MESSAGE
Error adding gift message message key.

See Also:
Constant Field Values

mAddGiftMessageSuccessURL

protected java.lang.String mAddGiftMessageSuccessURL
Add gify message success redirect URL.


mAddGiftMessageErrorURL

protected java.lang.String mAddGiftMessageErrorURL
Add gift message redirect URL.


mGiftMessageTo

protected java.lang.String mGiftMessageTo
Gift message sender.


mGiftMessageFrom

protected java.lang.String mGiftMessageFrom
Gift message recipient.


mGiftMessage

protected java.lang.String mGiftMessage
Gift message text.


mExpressCheckout

protected java.lang.String mExpressCheckout
Express checkout.

Constructor Detail

GiftMessageFormHandler

public GiftMessageFormHandler()
Method Detail

getCouponCode

public java.lang.String getCouponCode()

setCouponCode

public void setCouponCode(java.lang.String pCouponCode)

handleAddGiftMessage

public boolean handleAddGiftMessage(atg.servlet.DynamoHttpServletRequest pRequest,
                                    atg.servlet.DynamoHttpServletResponse pResponse)
                             throws javax.servlet.ServletException,
                                    java.io.IOException
This method will add the gift message to the order's specialInstructions.

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

addGiftMessage

protected void addGiftMessage(atg.servlet.DynamoHttpServletRequest pRequest,
                              atg.servlet.DynamoHttpServletResponse pResponse)
                       throws java.io.IOException,
                              javax.servlet.ServletException,
                              atg.commerce.CommerceException

Adds the gift message to the order. It gets the gift message from the giftMessageTo giftMessageFrom giftMessage parameters set on the form.

Parameters:
pRequest - - http request
pResponse - - http response
Throws:
atg.commerce.CommerceException - should anything go wrong
java.io.IOException - if IO error occurs
javax.servlet.ServletException - if servlet error occurs
See Also:
StoreOrderManager.addGiftMessage

getAddGiftMessageSuccessURL

public java.lang.String getAddGiftMessageSuccessURL()
Returns:
add gift message success redirect URL.

setAddGiftMessageSuccessURL

public void setAddGiftMessageSuccessURL(java.lang.String pAddGiftMessageSuccessURL)
Parameters:
pAddGiftMessageSuccessURL - - add gift message success resirect URL.

getAddGiftMessageErrorURL

public java.lang.String getAddGiftMessageErrorURL()
Returns:
add gift message error redirect URL.

setAddGiftMessageErrorURL

public void setAddGiftMessageErrorURL(java.lang.String pAddGiftMessageErrorURL)
Parameters:
pAddGiftMessageErrorURL - - add gift message error redirect URL.

setGiftMessageTo

public void setGiftMessageTo(java.lang.String pGiftMessageTo)
Parameters:
pGiftMessageTo - - gift message sender.

getGiftMessageTo

public java.lang.String getGiftMessageTo()
Returns:
mGiftMessageTo - gift message sender.

setGiftMessageFrom

public void setGiftMessageFrom(java.lang.String pGiftMessageFrom)
Parameters:
pGiftMessageFrom - - gift message recipient.

getGiftMessageFrom

public java.lang.String getGiftMessageFrom()
Returns:
gift message recipient.

setGiftMessage

public void setGiftMessage(java.lang.String pGiftMessage)
Parameters:
pGiftMessage - - gift message text.

getGiftMessage

public java.lang.String getGiftMessage()
Returns:
gift message text.

setExpressCheckout

public void setExpressCheckout(java.lang.String pExpressCheckout)
Parameters:
pExpressCheckout - - express checkout.

getExpressCheckout

public java.lang.String getExpressCheckout()
Returns:
express checkout.