atg.commerce.gifts
Class GiftlistFormHandler

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.droplet.TransactionalFormHandler
                      extended by atg.commerce.gifts.GiftlistFormHandler
All Implemented Interfaces:
atg.commerce.util.PipelineErrorHandler, DropletFormHandler, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener
Direct Known Subclasses:
PurchaselistFormHandlerSuper

public class GiftlistFormHandler
extends TransactionalFormHandler
implements atg.commerce.util.PipelineErrorHandler

This class provides convenient form handling methods for operating on the current customer's giftlists. It can be used to create new giftlists edit giftlists and add items to the giftlist during the shopping process.

Giftlist management is the core functionality of this form handler. it controls creating, updating and item management to all of the customer's wishlist/giftlist registries. This includes creating, updating, publishing, and deleting gift registries as well as adding items to the lists This functionality is invoked via the various handleXXX methods of the form handler.

All handle methods in this form handler mirror a similiar pattern. Each handleXXX process, some have an associated preXXX and postXXX method. For example, the handleAddItemToGiftlist has an associate preAddItemToGiftlist and postAddItemToGiftlist. These pre/post methods provide an easy way for a user to extend the functionality of this form handler.

See Also:
GenericFormHandler

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  GiftlistDateUtil dateUtil
           
protected static ParameterName LOCALE_PARAM
          Name of the locale parameter
static java.lang.String MSG_ERROR_ADDING_TO_GIFTLIST
           
static java.lang.String MSG_ERROR_DELETING_GIFTLIST
           
static java.lang.String MSG_ERROR_NO_SUCH_GIFTLIST
           
static java.lang.String MSG_ERROR_REMOVING_RROM_GIFTLIST
           
static java.lang.String MSG_ERROR_SAVING_GIFTLIST
           
static java.lang.String MSG_ERROR_UPDATING_GIFTLIST_ITEMS
           
static java.lang.String MSG_INVALID_EVENT_DATE
           
static java.lang.String MSG_INVALID_GIFTLIST_QUANTITY
           
static java.lang.String MSG_NO_GIFTLIST_TO_MODIFY
           
static java.lang.String MSG_NO_ITEM_FOUND
           
static java.lang.String MSG_NO_ITEMS_TO_ADD
           
static java.lang.String MSG_NO_SKU_WITH_ID
           
static java.lang.String MSG_QUANTITY_LESSTHAN_OR_EQUALTO_ZERO
           
protected static java.lang.String MY_RESOURCE_NAME
          Name of the resource
 long QUANTITY_NOT_VALID
           
protected static java.util.ResourceBundle sResourceBundle
          Resource Bundle
 
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
GiftlistFormHandler()
          Constructs an instanceof GiftlistFormHandler
 
Method Summary
protected  void addFormException(java.lang.String pMsgId, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Adds a form exception with the given message id.
protected  void addItemToGiftlist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Adds the given item to the selected giftlist
protected  void createGiftlist()
          Creates a new giftlist.
protected  java.lang.String createNewShippingAddress()
          Creates a shipping address in the address book and return the id.
 java.lang.String formatUserMessage(java.lang.String pKey, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Utility method to format a message with no arguments using the Locale of the user
 java.lang.String formatUserMessage(java.lang.String pKey, java.lang.Object[] pParams, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Utility method to format a message with two arguments using our resource bundle.
 java.lang.String formatUserMessage(java.lang.String pKey, java.lang.Object pParam, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Utility method to format a message with one argument using the Locale of the user
 java.lang.String formatUserMessage(java.lang.String pKey, java.lang.Object pParam1, java.lang.Object pParam2, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Utility method to format a message with two arguments using our resource bundle.
protected  java.lang.String generatePropertyPath(java.lang.String pPropertyName)
          generate property path takes a string and creates full path to property.
 java.lang.String getAddItemToGiftlistErrorURL()
          Returns property AddItemToGiftlistErrorURL
 java.lang.String getAddItemToGiftlistSuccessURL()
          Returns property AddItemToGiftlistSuccessURL
 java.util.Map getAddresses()
          Returns property addresses
 java.lang.String[] getCatalogRefIds()
          Returns property catalogRefIds.
 CatalogTools getCatalogTools()
          Returns property catalogTools.
 java.lang.String getComments()
          Returns property comments.
 java.lang.String getCreateGiftlistErrorURL()
          Returns property CreateGiftlistErrorURL
 java.lang.String getCreateGiftlistSuccessURL()
          Returns property CreateGiftlistSuccessURL
 java.lang.String getDate()
          Returns property date.
 java.lang.String[] getDates()
          Returns property dates
 java.util.Locale getDefaultLocale()
          Returns property DefaultLocale.
 java.lang.String getDeleteGiftlistErrorURL()
          Returns property DeleteGiftlistErrorURL
 java.lang.String getDeleteGiftlistSuccessURL()
          Returns property DeleteGiftlistSuccessURL
 java.lang.String getDescription()
          Returns property description.
 java.util.Date getEventDate()
          Returns eventDate property.
 java.lang.String getEventName()
          Returns the eventName.
 java.lang.String getEventType()
          Returns eventType property.
 java.util.Collection getEventTypes()
          eventType is an enumerated property in the giftlist repository.
 java.lang.String getGeneralFailureURL()
          Returns property generalFailureURL.
 java.lang.String getGeneralSuccessURL()
          Returns property generalSuccessURL.
 java.lang.String getGiftlistId()
          Returns property giftlistId.
 GiftlistManager getGiftlistManager()
          Returns property giftlistManager.
 Repository getGiftlistRepository()
          Returns property GiftlistRepository
 java.lang.String getInstructions()
          Returns property instructions.
 boolean getIsNewAddress()
          Returns property IsNewAddress
 java.lang.Boolean getIsPublic()
          Returns property isPublic
 java.lang.Boolean getIsPublished()
          Returns the IsPublished flag
 java.lang.String[] getItemIds()
          Returns property itemIds.
 java.lang.String getItemRemovedFromOrderEventType()
          Returns the JMS message name for the item removed from order message.
 java.lang.Integer getMonth()
          Returns property month.
 java.lang.String[] getMonths()
          Returns property months
 java.lang.String getMoveItemsFromCartErrorURL()
          Returns property MoveItemsFromCartErrorURL
 java.lang.String getMoveItemsFromCartSuccessURL()
          Returns property MoveItemsFromCartSuccessURL
 Address getNewAddress()
          Returns property newAddress.
 java.lang.String getNewAddressName()
          Returns property NewAddressName.
 Order getOrder()
          Returns property Order, if the shoppingCart property is not null, then return the current order of the shopping cart order holder
 OrderManager getOrderManager()
          Returns property orderManager.
 PipelineManager getPipelineManager()
          Get the pipeline manager used to generate ItemRemovedFromOrder messages
 java.lang.String getProductId()
          Returns property productId.
 RepositoryItem getProfile()
          Returns property Profile
 CommerceProfileTools getProfileTools()
          Returns property profileTools.
 long getQuantity()
          Returns property Quantity
 long getQuantity(java.lang.String pCatalogRefId, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Retrieve the quanity that should be used for the given item
 java.lang.String[] getRemoveGiftitemIds()
          Returns property RemoveGiftitemIds.
 java.lang.String getSaveGiftlistErrorURL()
          Returns property SaveGiftlistErrorURL
 java.lang.String getSaveGiftlistSuccessURL()
          Returns property SaveGiftlistSuccessURL
 java.lang.String getShippingAddressId()
          Returns property shippingAddressId.
 OrderHolder getShoppingCart()
          Returns property ShoppingCart
 java.lang.String getSiteId()
          Returns property siteId.
 java.util.Map getSpecialInstructions()
          Returns property specialInstructions.
 java.lang.String getUpdateGiftlistErrorURL()
          Returns property UpdateGiftlistErrorURL
 java.lang.String getUpdateGiftlistItemsErrorURL()
          Returns property UpdateGiftlistItemsErrorURL
 java.lang.String getUpdateGiftlistItemsSuccessURL()
          Returns property UpdateGiftlistItemsSuccessURL
 java.lang.String getUpdateGiftlistSuccessURL()
          Returns property UpdateGiftlistSuccessURL
 java.util.Locale getUserLocale(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Returns the locale associated with the request.
 java.lang.String getYear()
          Returns property year.
 java.lang.String[] getYears()
          Returns property years
 boolean handleAddItemToGiftlist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          handleAddItemToGiftlist is called when the user hits the submit button on a product page to add an item to the giftlist.
 boolean handleCreateGiftlist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called when the customer selects create to create a new giftlist.
 boolean handleDeleteGiftlist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called when the customer pushes delete giftlist.
 boolean handleMoveItemsFromCart(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          handleMoveItemsFromCart is called when the user hits the submit button on the move items from cart page.
 void handlePipelineError(java.lang.Object pError, java.lang.String pErrorKey)
          Add a pipeline error to the list of form exceptions.
 boolean handleSaveGiftlist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called when the customer selects save giftlist.
 boolean handleUpdateGiftlist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called when the customer selects update giftlist.
 boolean handleUpdateGiftlistItems(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This handle method updates items in the current giftlist either increasing or decreasing quantity desired or if checked, removing the item from the giftlist
 boolean isSendItemRemovedMessages()
          Query whether to send ItemRemovedFromOrder messages when moving items from the shopping cart to a gift list or wish list.
 boolean isUseRequestLocale()
          Returns property UseRequestLocale
protected  void moveItemsFromCart(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          this method moves selected items in itemIds from shopping cart to giftlist.
 void postAddItemToGiftlist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just after an item has been added to a giftlist
 void postCreateGiftlist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just giftlist creation is finished
 void postDeleteGiftlist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just after a giftlist is deleted
 void postMoveItemsFromCart(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just after an item has been moved from shopping cart
 void postSaveGiftlist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just after a giftlist is saved
 void postUpdateGiftlist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just after a giftlist is updated
 void postUpdateGiftlistItems(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just after items in giftlist are updated
 void preAddItemToGiftlist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just before an item is added to a giftlist
 void preCreateGiftlist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just before giftlist creation is started
 void preDeleteGiftlist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just before giftlist is deleted
 void preMoveItemsFromCart(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just before an item is is moved from shopping cart
 void preSaveGiftlist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just before giftlist is saved
 void preUpdateGiftlist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just before giftlist is updated
 void preUpdateGiftlistItems(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just before items in giftlist are updated
 void processException(java.lang.Exception pException, java.lang.String pMsgId, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Add a user error message to the form exceptions, and then display the exception in the logs
protected  boolean processPipelineErrors(PipelineResult pResult)
          Examine the pipeline result looking for any error messages, creates DropletExceptions and adds them as form exceptions
 java.lang.String saveGiftlist(java.lang.String pProfileId)
          Calls the manager class to create a giftlist in the repository and adds it to the current profile.
protected  void sendScenarioEvent(Order pOrder, CommerceItem pItem, long pQuantity, java.lang.String pMsgType)
          Send a message to the Dynamo Scenario Server.
protected  void sendScenarioEvent(Order pOrder, CommerceItem pItem, long pQuantity, java.lang.String pMsgType, java.lang.String pSiteId)
          Send a message to the Dynamo Scenario Server.
 void setAddItemToGiftlistErrorURL(java.lang.String pAddItemToGiftlistErrorURL)
          Sets property AddItemToGiftlistErrorURL
 void setAddItemToGiftlistSuccessURL(java.lang.String pAddItemToGiftlistSuccessURL)
          Sets property AddItemToGiftlistSuccessURL
 void setCatalogRefIds(java.lang.String[] pCatalogRefIds)
          Sets property catalogRefIds.
 void setCatalogTools(CatalogTools pCatalogTools)
          Sets property catalogTools.
 void setComments(java.lang.String pComments)
          Sets property comments.
 void setCreateGiftlistErrorURL(java.lang.String pCreateGiftlistErrorURL)
          Sets property CreateGiftlistErrorURL
 void setCreateGiftlistSuccessURL(java.lang.String pCreateGiftlistSuccessURL)
          Sets property CreateGiftlistSuccessURL
 void setDate(java.lang.String pDate)
          Sets property date.
 void setDefaultLocale(java.util.Locale pDefaultLocale)
          Sets property DefaultLocale
 void setDeleteGiftlistErrorURL(java.lang.String pDeleteGiftlistErrorURL)
          Sets property DeleteGiftlistErrorURL
 void setDeleteGiftlistSuccessURL(java.lang.String pDeleteGiftlistSuccessURL)
          Sets property DeleteGiftlistSuccessURL
 void setDescription(java.lang.String pDescription)
          Sets property description.
 void setEventDate(java.util.Date pEventDate)
          Sets eventDate property.
 void setEventName(java.lang.String pEventName)
          Sets the eventName.
 void setEventType(java.lang.String pEventType)
          Sets eventType property.
 void setGeneralFailureURL(java.lang.String pGeneralFailureURL)
          Sets property generalFailureURL
 void setGeneralSuccessURL(java.lang.String pGeneralSuccessURL)
          Sets property generalSuccessURL.
 void setGiftlistId(java.lang.String pGiftlistId)
          Sets property giftlistId.
 void setGiftlistManager(GiftlistManager pGiftlistManager)
          Sets property giftlistManager.
 void setGiftlistRepository(Repository pGiftlistRepository)
          Sets property GiftlistRepository
 void setInstructions(java.lang.String pInstructions)
          Sets property instructions.
 void setIsNewAddress(boolean pIsNewAddress)
          Sets property isNewAddress
 void setIsPublic(java.lang.Boolean pIsPublic)
          Sets property isPublic
 void setIsPublished(java.lang.Boolean pIsPublished)
          Sets the isPublished flag
 void setItemIds(java.lang.String[] pItemIds)
          Sets property itemIds.
 void setItemRemovedFromOrderEventType(java.lang.String pItemRemovedFromOrderEventType)
          Set the JMS message name for the item removed from order message
 void setMonth(java.lang.Integer pMonth)
          Sets property month.
 void setMoveItemsFromCartErrorURL(java.lang.String pMoveItemsFromCartErrorURL)
          Sets property MoveItemsFromCartErrorURL
 void setMoveItemsFromCartSuccessURL(java.lang.String pMoveItemsFromCartSuccessURL)
          Sets property MoveItemsFromCartSuccessURL
 void setNewAddress(Address pNewAddress)
          Sets property newAddress.
 void setNewAddressName(java.lang.String pNewAddressName)
          Sets property NewAddressName.
 void setOrderManager(OrderManager pOrderManager)
          Sets property orderManager.
 void setPipelineManager(PipelineManager pPipelineManager)
          Set the pipeline manager used to generate ItemRemovedFromOrder messages
 void setProductId(java.lang.String pProductId)
          Sets property productId.
 void setProfile(RepositoryItem pProfile)
          Sets property profile.
 void setProfileTools(CommerceProfileTools pProfileTools)
          Sets property profileTools
 void setQuantity(long pQuantity)
          Sets property Quantity
 void setRemoveGiftitemIds(java.lang.String[] pRemoveGiftitemIds)
          Sets property RemoveGiftitemIds.
 void setSaveGiftlistErrorURL(java.lang.String pSaveGiftlistErrorURL)
          Sets property SaveGiftlistErrorURL
 void setSaveGiftlistSuccessURL(java.lang.String pSaveGiftlistSuccessURL)
          Sets property SaveGiftlistSuccessURL
 void setSendItemRemovedMessages(boolean pSendItemRemovedMessages)
          Specify whether to send ItemRemovedFromOrder messages when moving items from the shopping cart to a gift list or wish list.
 void setShippingAddressId(java.lang.String pShippingAddressId)
          Sets property shippingAddressId.
 void setShoppingCart(OrderHolder pShoppingCart)
          Sets property ShoppingCart
 void setSiteId(java.lang.String pSiteId)
          Sets property siteId.
 void setSpecialInstructions(java.util.Map pSpecialInstructions)
          Sets property specialInstructions.
 void setUpdateGiftlistErrorURL(java.lang.String pUpdateGiftlistErrorURL)
          Sets property UpdateGiftlistErrorURL
 void setUpdateGiftlistItemsErrorURL(java.lang.String pUpdateGiftlistItemsErrorURL)
          Sets property UpdateGiftlistItemsErrorURL
 void setUpdateGiftlistItemsSuccessURL(java.lang.String pUpdateGiftlistItemsSuccessURL)
          Sets property UpdateGiftlistItemsSuccessURL
 void setUpdateGiftlistSuccessURL(java.lang.String pUpdateGiftlistSuccessURL)
          Sets property UpdateGiftlistSuccessURL
 void setUseRequestLocale(boolean pUseRequestLocale)
          Sets property UseRequestLocale
 void setYear(java.lang.String pYear)
          Sets property year.
protected  void updateEventDate()
          Updates the value of the mEventDate property.
protected  void updateGiftlist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Applies the updates to the gift list
protected  void updateGiftlistItems(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method is used to update items in a giftlist by either changing its quantity or removing it altogether.
protected  void updateOrder(CommerceItem pItem, long pQuantity, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          updateOrder will update the quantity of the commerceItem passed in.
protected  boolean validateGiftlistId(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Make sure giftlistId is valid, i.e., such a giftlist exists.
 
Methods inherited from class atg.droplet.TransactionalFormHandler
afterSet, beforeSet, checkFormRedirect, commitTransaction, getTransactionDemarcation, getTransactionStatus, isEnsureTransaction, isRollbackTransaction, isRollbackTransactionOnUnhandledException, isTransactionMarkedAsRollback, setEnsureTransaction, setRollbackTransaction, setRollbackTransactionOnUnhandledException, setTransactionDemarcation
 
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, doStartService, 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 final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

MY_RESOURCE_NAME

protected static final java.lang.String MY_RESOURCE_NAME
Name of the resource

See Also:
Constant Field Values

LOCALE_PARAM

protected static final ParameterName LOCALE_PARAM
Name of the locale parameter


MSG_QUANTITY_LESSTHAN_OR_EQUALTO_ZERO

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

MSG_NO_GIFTLIST_TO_MODIFY

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

MSG_NO_ITEMS_TO_ADD

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

MSG_ERROR_ADDING_TO_GIFTLIST

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

MSG_NO_SKU_WITH_ID

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

MSG_ERROR_REMOVING_RROM_GIFTLIST

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

MSG_NO_ITEM_FOUND

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

MSG_INVALID_EVENT_DATE

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

MSG_ERROR_SAVING_GIFTLIST

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

MSG_ERROR_DELETING_GIFTLIST

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

MSG_ERROR_UPDATING_GIFTLIST_ITEMS

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

MSG_INVALID_GIFTLIST_QUANTITY

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

MSG_ERROR_NO_SUCH_GIFTLIST

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

QUANTITY_NOT_VALID

public long QUANTITY_NOT_VALID

sResourceBundle

protected static java.util.ResourceBundle sResourceBundle
Resource Bundle


dateUtil

protected GiftlistDateUtil dateUtil
Constructor Detail

GiftlistFormHandler

public GiftlistFormHandler()
Constructs an instanceof GiftlistFormHandler

Method Detail

setGiftlistManager

public void setGiftlistManager(GiftlistManager pGiftlistManager)
Sets property giftlistManager.

Parameters:
pGiftlistManager - the giftlistManager class which provides a high level business layer interface to giftlists.

getGiftlistManager

public GiftlistManager getGiftlistManager()
Returns property giftlistManager.

Returns:
The value of the property GiftlistManager.

setOrderManager

public void setOrderManager(OrderManager pOrderManager)
Sets property orderManager.

Parameters:
pOrderManager - the OrderManager class which provides a high level business layer interface to orders.

getOrderManager

public OrderManager getOrderManager()
Returns property orderManager.

Returns:
The value of the property OrderManager.

setCatalogTools

public void setCatalogTools(CatalogTools pCatalogTools)
Sets property catalogTools.

Parameters:
pCatalogTools - the catalogTools which provides low level operations on the catalog.

getCatalogTools

public CatalogTools getCatalogTools()
Returns property catalogTools.

Returns:
The value of the property CatalogTools.

setSendItemRemovedMessages

public void setSendItemRemovedMessages(boolean pSendItemRemovedMessages)
Specify whether to send ItemRemovedFromOrder messages when moving items from the shopping cart to a gift list or wish list. The default value is true; applications that require Dynamo 5.1 behavior, where a message was not sent, can set this property to false instead.


isSendItemRemovedMessages

public boolean isSendItemRemovedMessages()
Query whether to send ItemRemovedFromOrder messages when moving items from the shopping cart to a gift list or wish list.


setPipelineManager

public void setPipelineManager(PipelineManager pPipelineManager)
Set the pipeline manager used to generate ItemRemovedFromOrder messages


getPipelineManager

public PipelineManager getPipelineManager()
Get the pipeline manager used to generate ItemRemovedFromOrder messages


setItemRemovedFromOrderEventType

public void setItemRemovedFromOrderEventType(java.lang.String pItemRemovedFromOrderEventType)
Set the JMS message name for the item removed from order message


getItemRemovedFromOrderEventType

public java.lang.String getItemRemovedFromOrderEventType()
Returns the JMS message name for the item removed from order message.


setProfileTools

public void setProfileTools(CommerceProfileTools pProfileTools)
Sets property profileTools

Parameters:
pProfileTools - the ProfileTools for Commerce which provides low level operations on the current user's profile.

getProfileTools

public CommerceProfileTools getProfileTools()
Returns property profileTools.

Returns:
The value of the property profileTools.

setShoppingCart

public void setShoppingCart(OrderHolder pShoppingCart)
Sets property ShoppingCart

Parameters:
pShoppingCart - the default shopping cart for the current customer.

getShoppingCart

public OrderHolder getShoppingCart()
Returns property ShoppingCart

Returns:
The value of the property ShoppingCart.

getOrder

public Order getOrder()
Returns property Order, if the shoppingCart property is not null, then return the current order of the shopping cart order holder

Returns:
The value of the property Order.

setDefaultLocale

public void setDefaultLocale(java.util.Locale pDefaultLocale)
Sets property DefaultLocale

Parameters:
pDefaultLocale - the default locale for the current customer.

getDefaultLocale

public java.util.Locale getDefaultLocale()
Returns property DefaultLocale. If the property value is null, then JVM's default locale is returned.

Returns:
The value of the property DefaultLocale.

setUseRequestLocale

public void setUseRequestLocale(boolean pUseRequestLocale)
Sets property UseRequestLocale

Parameters:
pUseRequestLocale - boolean to specify whether to use request locale.

isUseRequestLocale

public boolean isUseRequestLocale()
Returns property UseRequestLocale

Returns:
The value of the property UseRequestLocale.

setEventName

public void setEventName(java.lang.String pEventName)
Sets the eventName.

Parameters:
pEventName - The property to store the giftlist event name.

getEventName

public java.lang.String getEventName()
Returns the eventName.

Returns:
The value of the property eventName.

setMonth

public void setMonth(java.lang.Integer pMonth)
Sets property month.

Parameters:
pMonth - The property to store the month value of the event date.

getMonth

public java.lang.Integer getMonth()
Returns property month.

Returns:
The value of the property month.

setDate

public void setDate(java.lang.String pDate)
Sets property date.

Parameters:
pDate - The property to store the day of the month value of the event date.

getDate

public java.lang.String getDate()
Returns property date.

Returns:
The value of the property date.

setYear

public void setYear(java.lang.String pYear)
Sets property year.

Parameters:
pYear - The property to store the year value of the event date.

getYear

public java.lang.String getYear()
Returns property year.

Returns:
The value of the property year.

setEventDate

public void setEventDate(java.util.Date pEventDate)
Sets eventDate property.

Parameters:
pEventDate - The property to store the event date as a Calendar object.

getEventDate

public java.util.Date getEventDate()
                            throws InvalidDateException
Returns eventDate property.

Returns:
The value of the property eventDate.
Throws:
InvalidDateException - if an invalid date was entered for giftlist.

setEventType

public void setEventType(java.lang.String pEventType)
Sets eventType property.

Parameters:
pEventType - The property to store the event type.

getEventType

public java.lang.String getEventType()
Returns eventType property.

Returns:
The value of the property eventType.

setDescription

public void setDescription(java.lang.String pDescription)
Sets property description.

Parameters:
pDescription - The property to store the giftlist description.

getDescription

public java.lang.String getDescription()
Returns property description.

Returns:
The value of the property description.

setComments

public void setComments(java.lang.String pComments)
Sets property comments.

Parameters:
pComments - The property to store the giftlist comments.

getComments

public java.lang.String getComments()
Returns property comments.

Returns:
The value of the property comments.

setInstructions

public void setInstructions(java.lang.String pInstructions)
Sets property instructions.

Parameters:
pInstructions - The property to store the giftlist instructions.

getInstructions

public java.lang.String getInstructions()
Returns property instructions.

Returns:
The value of the property instructions.

setSpecialInstructions

public void setSpecialInstructions(java.util.Map pSpecialInstructions)
Sets property specialInstructions.

Parameters:
pSpecialInstructions - The property to store the giftlist specialInstructions.

getSpecialInstructions

public java.util.Map getSpecialInstructions()
Returns property specialInstructions.

Returns:
The value of the property specialInstructions.

setIsPublic

public void setIsPublic(java.lang.Boolean pIsPublic)
Sets property isPublic

Parameters:
pIsPublic - The property to store the property isPublic which specifies if a giftlist can be visible to persons other than the owner.

getIsPublic

public java.lang.Boolean getIsPublic()
Returns property isPublic

Returns:
The value of the property isPublic.

setIsPublished

public void setIsPublished(java.lang.Boolean pIsPublished)
Sets the isPublished flag

Parameters:
pIsPublished - The property to store the property isPublic which specifies if a giftlist is visible to persons other than the owner.

getIsPublished

public java.lang.Boolean getIsPublished()
Returns the IsPublished flag

Returns:
The value of the property isPublished.

setGiftlistId

public void setGiftlistId(java.lang.String pGiftlistId)
Sets property giftlistId.

Parameters:
pGiftlistId - The property to store the giftlistId property of the current giftlist.

getGiftlistId

public java.lang.String getGiftlistId()
Returns property giftlistId.

Returns:
The value of the property giftlistId.

setProfile

public void setProfile(RepositoryItem pProfile)
Sets property profile.

Parameters:
pProfile - The property to store the profile of the current customer.

getProfile

public RepositoryItem getProfile()
Returns property Profile

Returns:
The value of the property profile.

setGiftlistRepository

public void setGiftlistRepository(Repository pGiftlistRepository)
Sets property GiftlistRepository

Parameters:
pGiftlistRepository - The property to store the value of the giftlist repository.

getGiftlistRepository

public Repository getGiftlistRepository()
Returns property GiftlistRepository

Returns:
The value of the property giftlistRepository.

getAddresses

public java.util.Map getAddresses()
Returns property addresses

Returns:
The value of the property addresses.

getMonths

public java.lang.String[] getMonths()
Returns property months

Returns:
The value of the property months.

getDates

public java.lang.String[] getDates()
Returns property dates

Returns:
The value of the property dates.

getYears

public java.lang.String[] getYears()
Returns property years

Returns:
The value of the property years.

getEventTypes

public java.util.Collection getEventTypes()
eventType is an enumerated property in the giftlist repository. This will return a Collection of eventTypes found in the repository item descriptor. This Collection may be used in a select box in order to choose one to store in the giftlist eventType property.

Returns:
The value of the property eventTypes.

setSiteId

public void setSiteId(java.lang.String pSiteId)
Sets property siteId.

Parameters:
pSiteId - The property to store the site Id for the giftlist.

getSiteId

public java.lang.String getSiteId()
Returns property siteId.

Returns:
The value of the property siteId.

setShippingAddressId

public void setShippingAddressId(java.lang.String pShippingAddressId)
Sets property shippingAddressId.

Parameters:
pShippingAddressId - The property to store the selected shipping Address Id for the giftlist.

getShippingAddressId

public java.lang.String getShippingAddressId()
Returns property shippingAddressId.

Returns:
The value of the property shippingAddressId.

setIsNewAddress

public void setIsNewAddress(boolean pIsNewAddress)
Sets property isNewAddress

Parameters:
pIsNewAddress - The property to store the property IsNewAddress.

getIsNewAddress

public boolean getIsNewAddress()
Returns property IsNewAddress

Returns:
The value of the property isNewAddress.

setNewAddressName

public void setNewAddressName(java.lang.String pNewAddressName)
Sets property NewAddressName.

Parameters:
pNewAddressName - The property to store the nickname for the new shipping address.

getNewAddressName

public java.lang.String getNewAddressName()
Returns property NewAddressName.

Returns:
The value of the property newAddressName.

setNewAddress

public void setNewAddress(Address pNewAddress)
Sets property newAddress.

Parameters:
pNewAddress - The property to store the new address.

getNewAddress

public Address getNewAddress()
Returns property newAddress.

Returns:
The value of the property newAddress.

setCatalogRefIds

public void setCatalogRefIds(java.lang.String[] pCatalogRefIds)
Sets property catalogRefIds.

Parameters:
pCatalogRefIds - The property to store the selected skus to add to the current giftlist.

getCatalogRefIds

public java.lang.String[] getCatalogRefIds()
Returns property catalogRefIds.

Returns:
The value of the property catalogRefIds.

setRemoveGiftitemIds

public void setRemoveGiftitemIds(java.lang.String[] pRemoveGiftitemIds)
Sets property RemoveGiftitemIds.

Parameters:
pRemoveGiftitemIds - The property to store the selected skus to remove from the current giftlist.

getRemoveGiftitemIds

public java.lang.String[] getRemoveGiftitemIds()
Returns property RemoveGiftitemIds.

Returns:
The value of the property RemoveGiftitemIds.

setItemIds

public void setItemIds(java.lang.String[] pItemIds)
Sets property itemIds.

Parameters:
pItemIds - The property to store the selected commerce item ids to move from shopping cart to giftlist.

getItemIds

public java.lang.String[] getItemIds()
Returns property itemIds.

Returns:
The value of the property itemIds.

setProductId

public void setProductId(java.lang.String pProductId)
Sets property productId.

Parameters:
pProductId - The property to store the selected productId to add to the giftlist.

getProductId

public java.lang.String getProductId()
Returns property productId.

Returns:
The value of the property productId.

setQuantity

public void setQuantity(long pQuantity)
Sets property Quantity

Parameters:
pQuantity - The property to store the number of items to add to the giftlist.

getQuantity

public long getQuantity()
Returns property Quantity

Returns:
The value of the property quantity.

setCreateGiftlistSuccessURL

public void setCreateGiftlistSuccessURL(java.lang.String pCreateGiftlistSuccessURL)
Sets property CreateGiftlistSuccessURL

Parameters:
pCreateGiftlistSuccessURL - The property to store the success URL for CreateGiftlist.

getCreateGiftlistSuccessURL

public java.lang.String getCreateGiftlistSuccessURL()
Returns property CreateGiftlistSuccessURL

Returns:
The value of the property createGiftlistSuccessURL.

setCreateGiftlistErrorURL

public void setCreateGiftlistErrorURL(java.lang.String pCreateGiftlistErrorURL)
Sets property CreateGiftlistErrorURL

Parameters:
pCreateGiftlistErrorURL - The property to store the Error URL for CreateGiftlist.

getCreateGiftlistErrorURL

public java.lang.String getCreateGiftlistErrorURL()
Returns property CreateGiftlistErrorURL

Returns:
The value of the property createGiftlistErrorURL.

setSaveGiftlistSuccessURL

public void setSaveGiftlistSuccessURL(java.lang.String pSaveGiftlistSuccessURL)
Sets property SaveGiftlistSuccessURL

Parameters:
pSaveGiftlistSuccessURL - The property to store the success URL for SaveGiftlist.

getSaveGiftlistSuccessURL

public java.lang.String getSaveGiftlistSuccessURL()
Returns property SaveGiftlistSuccessURL

Returns:
The value of the property saveGiftlistSuccessURL.

setSaveGiftlistErrorURL

public void setSaveGiftlistErrorURL(java.lang.String pSaveGiftlistErrorURL)
Sets property SaveGiftlistErrorURL

Parameters:
pSaveGiftlistErrorURL - The property to store the Error URL for SaveGiftlist.

getSaveGiftlistErrorURL

public java.lang.String getSaveGiftlistErrorURL()
Returns property SaveGiftlistErrorURL

Returns:
The value of the property SaveGiftlistErrorURL.

setUpdateGiftlistSuccessURL

public void setUpdateGiftlistSuccessURL(java.lang.String pUpdateGiftlistSuccessURL)
Sets property UpdateGiftlistSuccessURL

Parameters:
pUpdateGiftlistSuccessURL - The property to store the Success URL for UpdateGiftlist.

getUpdateGiftlistSuccessURL

public java.lang.String getUpdateGiftlistSuccessURL()
Returns property UpdateGiftlistSuccessURL

Returns:
The value of the property UpdateGiftlistSuccessURL.

setUpdateGiftlistErrorURL

public void setUpdateGiftlistErrorURL(java.lang.String pUpdateGiftlistErrorURL)
Sets property UpdateGiftlistErrorURL

Parameters:
pUpdateGiftlistErrorURL - The property to store the error URL for UpdateGiftlist.

getUpdateGiftlistErrorURL

public java.lang.String getUpdateGiftlistErrorURL()
Returns property UpdateGiftlistErrorURL

Returns:
The value of the property UpdateGiftlistErrorURL.

setUpdateGiftlistItemsSuccessURL

public void setUpdateGiftlistItemsSuccessURL(java.lang.String pUpdateGiftlistItemsSuccessURL)
Sets property UpdateGiftlistItemsSuccessURL

Parameters:
pUpdateGiftlistItemsSuccessURL - The property to store the Success URL for UpdateGiftlist.

getUpdateGiftlistItemsSuccessURL

public java.lang.String getUpdateGiftlistItemsSuccessURL()
Returns property UpdateGiftlistItemsSuccessURL

Returns:
The value of the property UpdateGiftlistItemsSuccessURL.

setUpdateGiftlistItemsErrorURL

public void setUpdateGiftlistItemsErrorURL(java.lang.String pUpdateGiftlistItemsErrorURL)
Sets property UpdateGiftlistItemsErrorURL

Parameters:
pUpdateGiftlistItemsErrorURL - The property to store the error URL for UpdateGiftlist.

getUpdateGiftlistItemsErrorURL

public java.lang.String getUpdateGiftlistItemsErrorURL()
Returns property UpdateGiftlistItemsErrorURL

Returns:
The value of the property UpdateGiftlistItemsErrorURL.

setDeleteGiftlistSuccessURL

public void setDeleteGiftlistSuccessURL(java.lang.String pDeleteGiftlistSuccessURL)
Sets property DeleteGiftlistSuccessURL

Parameters:
pDeleteGiftlistSuccessURL - The property to store the success URL for DeleteGiftlist.

getDeleteGiftlistSuccessURL

public java.lang.String getDeleteGiftlistSuccessURL()
Returns property DeleteGiftlistSuccessURL

Returns:
The value of the property DeleteGiftlistSuccessURL

setDeleteGiftlistErrorURL

public void setDeleteGiftlistErrorURL(java.lang.String pDeleteGiftlistErrorURL)
Sets property DeleteGiftlistErrorURL

Parameters:
pDeleteGiftlistErrorURL - The property to store the error URL for DeleteGiftlist.

getDeleteGiftlistErrorURL

public java.lang.String getDeleteGiftlistErrorURL()
Returns property DeleteGiftlistErrorURL

Returns:
The value of the property DeleteGiftlistErrorURL

setAddItemToGiftlistSuccessURL

public void setAddItemToGiftlistSuccessURL(java.lang.String pAddItemToGiftlistSuccessURL)
Sets property AddItemToGiftlistSuccessURL

Parameters:
pAddItemToGiftlistSuccessURL - The property to store the success URL for addItemToGiftlist.

getAddItemToGiftlistSuccessURL

public java.lang.String getAddItemToGiftlistSuccessURL()
Returns property AddItemToGiftlistSuccessURL

Returns:
The value of the property AddItemToGiftlistSuccessURL

setAddItemToGiftlistErrorURL

public void setAddItemToGiftlistErrorURL(java.lang.String pAddItemToGiftlistErrorURL)
Sets property AddItemToGiftlistErrorURL

Parameters:
pAddItemToGiftlistErrorURL - The property to store the error URL for addItemToGiftlist.

getAddItemToGiftlistErrorURL

public java.lang.String getAddItemToGiftlistErrorURL()
Returns property AddItemToGiftlistErrorURL

Returns:
The value of the property AddItemToGiftlistErrorURL

setMoveItemsFromCartSuccessURL

public void setMoveItemsFromCartSuccessURL(java.lang.String pMoveItemsFromCartSuccessURL)
Sets property MoveItemsFromCartSuccessURL

Parameters:
pMoveItemsFromCartSuccessURL - The property to store the success URL for MoveItemsFromCart.

getMoveItemsFromCartSuccessURL

public java.lang.String getMoveItemsFromCartSuccessURL()
Returns property MoveItemsFromCartSuccessURL

Returns:
The value of the property MoveItemsFromCartSuccessURL

setMoveItemsFromCartErrorURL

public void setMoveItemsFromCartErrorURL(java.lang.String pMoveItemsFromCartErrorURL)
Sets property MoveItemsFromCartErrorURL

Parameters:
pMoveItemsFromCartErrorURL - The property to store the error URL for MoveItemsFromCart.

getMoveItemsFromCartErrorURL

public java.lang.String getMoveItemsFromCartErrorURL()
Returns property MoveItemsFromCartErrorURL

Returns:
The value of the property MoveItemsFromCartErrorURL

setGeneralSuccessURL

public void setGeneralSuccessURL(java.lang.String pGeneralSuccessURL)
Sets property generalSuccessURL.

Parameters:
pGeneralSuccessURL - The property to store the general success URL.

getGeneralSuccessURL

public java.lang.String getGeneralSuccessURL()
Returns property generalSuccessURL.

Returns:
The value of the property generalSuccessURL.

setGeneralFailureURL

public void setGeneralFailureURL(java.lang.String pGeneralFailureURL)
Sets property generalFailureURL

Parameters:
pGeneralFailureURL - The property to store the general failure URL.

getGeneralFailureURL

public java.lang.String getGeneralFailureURL()
Returns property generalFailureURL.

Returns:
The value of the property generalFailureURL.

handleCreateGiftlist

public boolean handleCreateGiftlist(DynamoHttpServletRequest pRequest,
                                    DynamoHttpServletResponse pResponse)
                             throws javax.servlet.ServletException,
                                    java.io.IOException,
                                    CommerceException
Called when the customer selects create to create a new giftlist.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
true if successful, false otherwise.
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io
CommerceException - if there was an error with Commerce

createGiftlist

protected void createGiftlist()
Creates a new giftlist.


preCreateGiftlist

public void preCreateGiftlist(DynamoHttpServletRequest pRequest,
                              DynamoHttpServletResponse pResponse)
                       throws javax.servlet.ServletException,
                              java.io.IOException
Operation called just before giftlist creation is started

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

postCreateGiftlist

public void postCreateGiftlist(DynamoHttpServletRequest pRequest,
                               DynamoHttpServletResponse pResponse)
                        throws javax.servlet.ServletException,
                               java.io.IOException
Operation called just giftlist creation is finished

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

handleSaveGiftlist

public boolean handleSaveGiftlist(DynamoHttpServletRequest pRequest,
                                  DynamoHttpServletResponse pResponse)
                           throws javax.servlet.ServletException,
                                  java.io.IOException,
                                  CommerceException
Called when the customer selects save giftlist.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
true if successful, false otherwise.
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io
CommerceException - if there was an error with Commerce

saveGiftlist

public java.lang.String saveGiftlist(java.lang.String pProfileId)
                              throws CommerceException,
                                     InvalidDateException
Calls the manager class to create a giftlist in the repository and adds it to the current profile. Returns the newly created gift list id.

Parameters:
pProfileId - the profile Id
Returns:
the Id of the gift list
Throws:
InvalidDateException - thrown when an invalid date has been entered for a gift list
CommerceException - if there was an error with Commerce

preSaveGiftlist

public void preSaveGiftlist(DynamoHttpServletRequest pRequest,
                            DynamoHttpServletResponse pResponse)
                     throws javax.servlet.ServletException,
                            java.io.IOException
Operation called just before giftlist is saved

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

postSaveGiftlist

public void postSaveGiftlist(DynamoHttpServletRequest pRequest,
                             DynamoHttpServletResponse pResponse)
                      throws javax.servlet.ServletException,
                             java.io.IOException
Operation called just after a giftlist is saved

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

handleUpdateGiftlist

public boolean handleUpdateGiftlist(DynamoHttpServletRequest pRequest,
                                    DynamoHttpServletResponse pResponse)
                             throws javax.servlet.ServletException,
                                    java.io.IOException,
                                    CommerceException
Called when the customer selects update giftlist. This will call the manager class to update the properties of the current giftlist in the repository.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
true if successful, false otherwise.
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io
CommerceException - if there was an error with Commerce

preUpdateGiftlist

public void preUpdateGiftlist(DynamoHttpServletRequest pRequest,
                              DynamoHttpServletResponse pResponse)
                       throws javax.servlet.ServletException,
                              java.io.IOException
Operation called just before giftlist is updated

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

updateGiftlist

protected void updateGiftlist(DynamoHttpServletRequest pRequest,
                              DynamoHttpServletResponse pResponse)
                       throws InvalidDateException,
                              CommerceException
Applies the updates to the gift list

Parameters:
pRequest -
pResponse -
Throws:
InvalidDateException
CommerceException

postUpdateGiftlist

public void postUpdateGiftlist(DynamoHttpServletRequest pRequest,
                               DynamoHttpServletResponse pResponse)
                        throws javax.servlet.ServletException,
                               java.io.IOException
Operation called just after a giftlist is updated

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

handleDeleteGiftlist

public boolean handleDeleteGiftlist(DynamoHttpServletRequest pRequest,
                                    DynamoHttpServletResponse pResponse)
                             throws javax.servlet.ServletException,
                                    java.io.IOException,
                                    CommerceException
Called when the customer pushes delete giftlist. This will call the manager class to delete the giftlist from the profile and repository.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
true if successful, false otherwise.
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io
CommerceException - if there was an error with Commerce

preDeleteGiftlist

public void preDeleteGiftlist(DynamoHttpServletRequest pRequest,
                              DynamoHttpServletResponse pResponse)
                       throws javax.servlet.ServletException,
                              java.io.IOException
Operation called just before giftlist is deleted

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

postDeleteGiftlist

public void postDeleteGiftlist(DynamoHttpServletRequest pRequest,
                               DynamoHttpServletResponse pResponse)
                        throws javax.servlet.ServletException,
                               java.io.IOException
Operation called just after a giftlist is deleted

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

handleAddItemToGiftlist

public boolean handleAddItemToGiftlist(DynamoHttpServletRequest pRequest,
                                       DynamoHttpServletResponse pResponse)
                                throws javax.servlet.ServletException,
                                       java.io.IOException,
                                       CommerceException
handleAddItemToGiftlist is called when the user hits the submit button on a product page to add an item to the giftlist. This handler looks up the product in the catalog and returns a sku. It then looks for an existing item in the giftlist with this sku id. if it exists, the quantity desired is incremented by the quantity specified. if it doesn't exist, it creates the item and adds it to the giftlist specified in giftlist id.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
true if successful, false otherwise.
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io
CommerceException - if there was an error with Commerce

preAddItemToGiftlist

public void preAddItemToGiftlist(DynamoHttpServletRequest pRequest,
                                 DynamoHttpServletResponse pResponse)
                          throws javax.servlet.ServletException,
                                 java.io.IOException
Operation called just before an item is added to a giftlist

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

postAddItemToGiftlist

public void postAddItemToGiftlist(DynamoHttpServletRequest pRequest,
                                  DynamoHttpServletResponse pResponse)
                           throws javax.servlet.ServletException,
                                  java.io.IOException
Operation called just after an item has been added to a giftlist

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

addItemToGiftlist

protected void addItemToGiftlist(DynamoHttpServletRequest pRequest,
                                 DynamoHttpServletResponse pResponse)
                          throws javax.servlet.ServletException,
                                 java.io.IOException,
                                 CommerceException
Adds the given item to the selected giftlist

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

handleMoveItemsFromCart

public boolean handleMoveItemsFromCart(DynamoHttpServletRequest pRequest,
                                       DynamoHttpServletResponse pResponse)
                                throws javax.servlet.ServletException,
                                       java.io.IOException,
                                       CommerceException
handleMoveItemsFromCart is called when the user hits the submit button on the move items from cart page. This handler will call moveItemsFromCart.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
true if successful, false otherwise.
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io
CommerceException - if there was an error with Commerce

preMoveItemsFromCart

public void preMoveItemsFromCart(DynamoHttpServletRequest pRequest,
                                 DynamoHttpServletResponse pResponse)
                          throws javax.servlet.ServletException,
                                 java.io.IOException
Operation called just before an item is is moved from shopping cart

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

postMoveItemsFromCart

public void postMoveItemsFromCart(DynamoHttpServletRequest pRequest,
                                  DynamoHttpServletResponse pResponse)
                           throws javax.servlet.ServletException,
                                  java.io.IOException
Operation called just after an item has been moved from shopping cart

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

moveItemsFromCart

protected void moveItemsFromCart(DynamoHttpServletRequest pRequest,
                                 DynamoHttpServletResponse pResponse)
                          throws javax.servlet.ServletException,
                                 java.io.IOException,
                                 CommerceException
this method moves selected items in itemIds from shopping cart to giftlist. if a quantity is specified, it will move the number specified and decrease the order by that amount. By default, it will move the total number in cart to giftlist.

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

preUpdateGiftlistItems

public void preUpdateGiftlistItems(DynamoHttpServletRequest pRequest,
                                   DynamoHttpServletResponse pResponse)
                            throws javax.servlet.ServletException,
                                   java.io.IOException
Operation called just before items in giftlist are updated

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

postUpdateGiftlistItems

public void postUpdateGiftlistItems(DynamoHttpServletRequest pRequest,
                                    DynamoHttpServletResponse pResponse)
                             throws javax.servlet.ServletException,
                                    java.io.IOException
Operation called just after items in giftlist are updated

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

handleUpdateGiftlistItems

public boolean handleUpdateGiftlistItems(DynamoHttpServletRequest pRequest,
                                         DynamoHttpServletResponse pResponse)
                                  throws javax.servlet.ServletException,
                                         java.io.IOException
This handle method updates items in the current giftlist either increasing or decreasing quantity desired or if checked, removing the item from the giftlist

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

updateGiftlistItems

protected void updateGiftlistItems(DynamoHttpServletRequest pRequest,
                                   DynamoHttpServletResponse pResponse)
                            throws javax.servlet.ServletException,
                                   java.io.IOException,
                                   CommerceException
This method is used to update items in a giftlist by either changing its quantity or removing it altogether.

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

getQuantity

public long getQuantity(java.lang.String pCatalogRefId,
                        DynamoHttpServletRequest pRequest,
                        DynamoHttpServletResponse pResponse)
                 throws javax.servlet.ServletException,
                        java.io.IOException
Retrieve the quanity that should be used for the given item

Parameters:
pCatalogRefId - catalog reference id
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
the quantity for the item referenced by CatalogRefId
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

validateGiftlistId

protected boolean validateGiftlistId(DynamoHttpServletRequest pRequest,
                                     DynamoHttpServletResponse pResponse)
                              throws javax.servlet.ServletException,
                                     java.io.IOException
Make sure giftlistId is valid, i.e., such a giftlist exists.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
true if the ID is good, false if the ID is invalid or there is no such giftlist
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet i/o

updateOrder

protected void updateOrder(CommerceItem pItem,
                           long pQuantity,
                           DynamoHttpServletRequest pRequest,
                           DynamoHttpServletResponse pResponse)
                    throws InvalidGiftQuantityException,
                           java.io.IOException,
                           javax.servlet.ServletException
updateOrder will update the quantity of the commerceItem passed in. if quantity moved to giftlist from cart equals or is greater than that in cart, it will remove the item from the cart. otherwise, it will decrease the number by quantity passed in.

Parameters:
pItem - the commerce item to update
pQuantity - the number moved to giftlist
Throws:
InvalidGiftQuantityException - if pQuantity <= 0
java.io.IOException
javax.servlet.ServletException

sendScenarioEvent

protected void sendScenarioEvent(Order pOrder,
                                 CommerceItem pItem,
                                 long pQuantity,
                                 java.lang.String pMsgType)
                          throws RunProcessException
Send a message to the Dynamo Scenario Server.

Parameters:
pOrder - The order being modified
pItem - The CommerceItem involved in the order modification
pQuantity - The quantity of the CommerceItem involved
pMsgType - The JMS message type of the message in question
Throws:
RunProcessException

sendScenarioEvent

protected void sendScenarioEvent(Order pOrder,
                                 CommerceItem pItem,
                                 long pQuantity,
                                 java.lang.String pMsgType,
                                 java.lang.String pSiteId)
                          throws RunProcessException
Send a message to the Dynamo Scenario Server.

Parameters:
pOrder - The order being modified
pItem - The CommerceItem involved in the order modification
pQuantity - The quantity of the CommerceItem involved
pMsgType - The JMS message type of the message in question
pSiteId - The site ID associated with a scenario event
Throws:
RunProcessException

generatePropertyPath

protected java.lang.String generatePropertyPath(java.lang.String pPropertyName)
generate property path takes a string and creates full path to property.

Parameters:
pPropertyName - the property name to get full path
Returns:
the absolute path to the property

createNewShippingAddress

protected java.lang.String createNewShippingAddress()
Creates a shipping address in the address book and return the id.

Returns:
shippingAddressId

processException

public void processException(java.lang.Exception pException,
                             java.lang.String pMsgId,
                             DynamoHttpServletRequest pRequest,
                             DynamoHttpServletResponse pResponse)
                      throws javax.servlet.ServletException,
                             java.io.IOException
Add a user error message to the form exceptions, and then display the exception in the logs

Parameters:
pException - the exception to process
pMsgId - the message id
pRequest - the servlet's request
pResponse - the servlet's response
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

processPipelineErrors

protected boolean processPipelineErrors(PipelineResult pResult)
Examine the pipeline result looking for any error messages, creates DropletExceptions and adds them as form exceptions

Parameters:
pResult - a PipelineResult value
Returns:
true if errors were found

getUserLocale

public java.util.Locale getUserLocale(DynamoHttpServletRequest pRequest,
                                      DynamoHttpServletResponse pResponse)
                               throws javax.servlet.ServletException,
                                      java.io.IOException
Returns the locale associated with the request. The method first searches for a request paramater named locale. This value can be either a java.util.Locale object or a String which represents the locale. Next if the useRequestLocale property is true, then the locale of the request will be returned. Finally, if the locale cannot be determined, the the defaultLocale property is used.

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

formatUserMessage

public java.lang.String formatUserMessage(java.lang.String pKey,
                                          DynamoHttpServletRequest pRequest,
                                          DynamoHttpServletResponse pResponse)
                                   throws javax.servlet.ServletException,
                                          java.io.IOException
Utility method to format a message with no arguments using the Locale of the user

Parameters:
pKey - the identifier for the message to retrieve out of the ResourceBundle
pRequest - the request object which can be used to extract the user's locale
pResponse - the servlet's response
Returns:
the formatted message
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io
See Also:
GiftlistUserMessage

formatUserMessage

public java.lang.String formatUserMessage(java.lang.String pKey,
                                          java.lang.Object pParam,
                                          DynamoHttpServletRequest pRequest,
                                          DynamoHttpServletResponse pResponse)
                                   throws javax.servlet.ServletException,
                                          java.io.IOException
Utility method to format a message with one argument using the Locale of the user

Parameters:
pKey - the identifier for the message to retrieve out of the ResourceBundle
pParam - the first (and only argument) in the message
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
the formatted message
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io
See Also:
GiftlistUserMessage

formatUserMessage

public java.lang.String formatUserMessage(java.lang.String pKey,
                                          java.lang.Object pParam1,
                                          java.lang.Object pParam2,
                                          DynamoHttpServletRequest pRequest,
                                          DynamoHttpServletResponse pResponse)
                                   throws javax.servlet.ServletException,
                                          java.io.IOException
Utility method to format a message with two arguments using our resource bundle.

Parameters:
pKey - the identifier for the message to retrieve out of the ResourceBundle
pParam1 - the first parameter in the message
pParam2 - the second parameter in the message
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
the formatted message
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io
See Also:
GiftlistUserMessage

formatUserMessage

public java.lang.String formatUserMessage(java.lang.String pKey,
                                          java.lang.Object[] pParams,
                                          DynamoHttpServletRequest pRequest,
                                          DynamoHttpServletResponse pResponse)
                                   throws javax.servlet.ServletException,
                                          java.io.IOException
Utility method to format a message with two arguments using our resource bundle.

Parameters:
pKey - the identifier for the message to retrieve out of the ResourceBundle
pParams - a set of parameters to use in the formatting.
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
the formatted message
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io
See Also:
GiftlistUserMessage

handlePipelineError

public void handlePipelineError(java.lang.Object pError,
                                java.lang.String pErrorKey)
Add a pipeline error to the list of form exceptions.

Specified by:
handlePipelineError in interface atg.commerce.util.PipelineErrorHandler
Parameters:
pError - the error reported by the pipeline.
pErrorKey - the key of the error, used for localization.

addFormException

protected void addFormException(java.lang.String pMsgId,
                                DynamoHttpServletRequest pRequest,
                                DynamoHttpServletResponse pResponse)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Adds a form exception with the given message id. It will format the user message and add it as a DropletException to the list of form exceptions.

Parameters:
pMsgId - The message id (i.e. the resource string)
pRequest -
pResponse -
Throws:
javax.servlet.ServletException
java.io.IOException

updateEventDate

protected void updateEventDate()
Updates the value of the mEventDate property. This needs to be updated whenever the setYear, setMonth, setDate or setEventDate are called; This way the correct values are always returned by the equivelent getter methods.