atg.projects.b2bstore.purchaselists
Class PurchaselistFormHandler

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
                          extended by atg.projects.b2bstore.purchaselists.PurchaselistFormHandlerSuper
                              extended by atg.projects.b2bstore.purchaselists.PurchaselistFormHandler
All Implemented Interfaces:
atg.commerce.util.PipelineErrorHandler, DropletFormHandler, atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class PurchaselistFormHandler
extends PurchaselistFormHandlerSuper

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

See Also:
GenericFormHandler, GiftlistFormHandler

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String ERR_DUPLICATE_LIST_NAME
           
static java.lang.String ERR_NULL_LIST_NAME
           
static java.lang.String ERR_UNABLE_TO_CREATE_LIST
           
static java.lang.String EVENTNAME_PROPERTY
           
static java.lang.String LIST_ID
           
protected static java.lang.String sBundleName
           
 
Fields inherited from class atg.commerce.gifts.GiftlistFormHandler
dateUtil, LOCALE_PARAM, mEnableSecurity, MSG_ERROR_ADDING_TO_GIFTLIST, MSG_ERROR_DELETING_GIFTLIST, MSG_ERROR_NO_SUCH_GIFTLIST, MSG_ERROR_REMOVING_RROM_GIFTLIST, MSG_ERROR_SAVING_GIFTLIST, MSG_ERROR_UPDATING_GIFTLIST_ITEMS, MSG_INVALID_EVENT_DATE, MSG_INVALID_GIFTLIST_QUANTITY, MSG_NO_GIFTLIST_TO_MODIFY, MSG_NO_ITEM_FOUND, MSG_NO_ITEMS_TO_ADD, MSG_NO_SKU_WITH_ID, MSG_QUANTITY_LESSTHAN_OR_EQUALTO_ZERO, MY_RESOURCE_NAME, QUANTITY_NOT_VALID, sResourceBundle
 
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
PurchaselistFormHandler()
           
 
Method Summary
protected  void addFormException(java.lang.String pErrorKey, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Adds a form exception to the formhandler.
protected  boolean checkForListName(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method checks for validity of purchase list name.
protected  java.util.Locale getLocale(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Returns either the Locale from the Request object (if it isn't NULL), or the Locale from the JVM.
 java.lang.String getStringResource(java.lang.String pResourceName, java.util.Locale pLocale)
          This method acts as a utility method to obtain a given resource for a particular key.
 java.lang.String getUserLocale()
          Return the userLocale property.
 boolean handleAddItemToPurchaselist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          handleAddItemToPurchaseList is called when the user hits the submit button on a product page to add an item to the purchase list.
 boolean handleCreatePurchaselist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called when the customer selects create to create a new purchase list.
 boolean handleDeletePurchaselist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called when the customer pushes delete giftlist.
 boolean handleSavePurchaselist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called when the customer selects save purchaselist.
 boolean handleUpdatePurchaselist(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called when the customer selects update purchaselist.
 void populateGiftListFields()
          Since the purchase list feature relies on the atg.commerce.gifts package in its implementation, this method is used to populate the individual fields of a giftlist that are needed for manipulating giftlists, but which do not have any direct relevance to the purchase list paradigm.
 void setAddItemToPurchaselistErrorURL(java.lang.String pAddItemToPurchaselistErrorURL)
          Sets property addItemToPurchaselistErrorURL
 void setAddItemToPurchaselistSuccessURL(java.lang.String pAddItemToPurchaselistSuccessURL)
          Sets property addItemToPurchaselistSuccessURL
 void setCreatePurchaselistErrorURL(java.lang.String pCreatePurchaselistErrorURL)
          Sets property createPurchaselistErrorURL
 void setCreatePurchaselistSuccessURL(java.lang.String pCreatePurchaselistSuccessURL)
          Sets property createPurchaselistSuccessURL
 void setDeletePurchaselistErrorURL(java.lang.String pDeletePurchaselistErrorURL)
          Sets property deletePurchaselistErrorURL
 void setDeletePurchaselistSuccessURL(java.lang.String pDeletePurchaselistSuccessURL)
          Sets property deletePurchaselistSuccessURL
 void setListName(java.lang.String pListName)
          Sets property listName
 void setPurchaseListId(java.lang.String pPurchaseListId)
          Sets property purchaseListId
 void setSavePurchaselistErrorURL(java.lang.String pSavePurchaselistErrorURL)
          Sets property savePurchaselistErrorURL
 void setSavePurchaselistSuccessURL(java.lang.String pSavePurchaselistSuccessURL)
          Sets property savePurchaselistSuccessURL
 void setUpdatePurchaselistErrorURL(java.lang.String pUpdatePurchaselistErrorURL)
          Sets property setUpdatePurchaselistErrorURL
 void setUpdatePurchaselistItemsErrorURL(java.lang.String pUpdatePurchaselistItemsErrorURL)
          Sets property updatePurchaselistItemsErrorURL
 void setUpdatePurchaselistItemsSuccessURL(java.lang.String pUpdatePurchaselistItemsSuccessURL)
          Sets property updatePurchaselistItemsSuccessURL
 void setUpdatePurchaselistSuccessURL(java.lang.String pUpdatePurchaselistSuccessURL)
          Sets property updatePurchaselistSuccessURL
 void setUserLocale(java.lang.String pUserLocale)
          Set the userLocale property.
 
Methods inherited from class atg.projects.b2bstore.purchaselists.PurchaselistFormHandlerSuper
copyPropertiesTo, equals, getAddItemToPurchaselistErrorURL, getAddItemToPurchaselistSuccessURL, getCreatePurchaselistErrorURL, getCreatePurchaselistSuccessURL, getDeletePurchaselistErrorURL, getDeletePurchaselistSuccessURL, getListName, getPurchaseListId, getSavePurchaselistErrorURL, getSavePurchaselistSuccessURL, getUpdatePurchaselistErrorURL, getUpdatePurchaselistItemsErrorURL, getUpdatePurchaselistItemsSuccessURL, getUpdatePurchaselistSuccessURL, hashCode, toString
 
Methods inherited from class atg.commerce.gifts.GiftlistFormHandler
addItemToGiftlist, checkGiftlistAccess, createGiftlist, createNewShippingAddress, formatUserMessage, formatUserMessage, formatUserMessage, formatUserMessage, generatePropertyPath, getAddItemToGiftlistErrorURL, getAddItemToGiftlistSuccessURL, getAddresses, getCatalogRefIds, getCatalogTools, getComments, getCreateGiftlistErrorURL, getCreateGiftlistSuccessURL, getDate, getDates, getDefaultLocale, getDeleteGiftlistErrorURL, getDeleteGiftlistSuccessURL, getDescription, getEventDate, getEventName, getEventType, getEventTypes, getGeneralFailureURL, getGeneralSuccessURL, getGiftlistId, getGiftlistManager, getGiftlistRepository, getInstructions, getIsNewAddress, getIsPublic, getIsPublished, getItemIds, getItemRemovedFromOrderEventType, getMonth, getMonths, getMoveItemsFromCartErrorURL, getMoveItemsFromCartSuccessURL, getNewAddress, getNewAddressName, getOrder, getOrderManager, getPipelineManager, getProductId, getProfile, getProfileTools, getQuantity, getQuantity, getRemoveGiftitemIds, getSaveGiftlistErrorURL, getSaveGiftlistSuccessURL, getShippingAddressId, getShoppingCart, getSiteId, getSpecialInstructions, getUpdateGiftlistErrorURL, getUpdateGiftlistItemsErrorURL, getUpdateGiftlistItemsSuccessURL, getUpdateGiftlistSuccessURL, getUserLocale, getYear, getYears, handleAddItemToGiftlist, handleCreateGiftlist, handleDeleteGiftlist, handleMoveItemsFromCart, handlePipelineError, handleSaveGiftlist, handleUpdateGiftlist, handleUpdateGiftlistItems, isEnableSecurity, isSendItemRemovedMessages, isUseRequestLocale, moveItemsFromCart, postAddItemToGiftlist, postCreateGiftlist, postDeleteGiftlist, postMoveItemsFromCart, postSaveGiftlist, postUpdateGiftlist, postUpdateGiftlistItems, preAddItemToGiftlist, preCreateGiftlist, preDeleteGiftlist, preMoveItemsFromCart, preSaveGiftlist, preUpdateGiftlist, preUpdateGiftlistItems, processException, processPipelineErrors, saveGiftlist, sendScenarioEvent, sendScenarioEvent, setAddItemToGiftlistErrorURL, setAddItemToGiftlistSuccessURL, setCatalogRefIds, setCatalogTools, setComments, setCreateGiftlistErrorURL, setCreateGiftlistSuccessURL, setDate, setDefaultLocale, setDeleteGiftlistErrorURL, setDeleteGiftlistSuccessURL, setDescription, setEnableSecurity, setEventDate, setEventName, setEventType, setGeneralFailureURL, setGeneralSuccessURL, setGiftlistId, setGiftlistManager, setGiftlistRepository, setInstructions, setIsNewAddress, setIsPublic, setIsPublished, setItemIds, setItemRemovedFromOrderEventType, setMonth, setMoveItemsFromCartErrorURL, setMoveItemsFromCartSuccessURL, setNewAddress, setNewAddressName, setOrderManager, setPipelineManager, setProductId, setProfile, setProfileTools, setQuantity, setRemoveGiftitemIds, setSaveGiftlistErrorURL, setSaveGiftlistSuccessURL, setSendItemRemovedMessages, setShippingAddressId, setShoppingCart, setSiteId, setSpecialInstructions, setUpdateGiftlistErrorURL, setUpdateGiftlistItemsErrorURL, setUpdateGiftlistItemsSuccessURL, setUpdateGiftlistSuccessURL, setUseRequestLocale, setYear, updateEventDate, updateGiftlist, updateGiftlistItems, updateOrder, validateGiftlistId
 
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, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


LIST_ID

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

EVENTNAME_PROPERTY

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

sBundleName

protected static java.lang.String sBundleName

ERR_NULL_LIST_NAME

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

ERR_DUPLICATE_LIST_NAME

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

ERR_UNABLE_TO_CREATE_LIST

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

PurchaselistFormHandler

public PurchaselistFormHandler()
Method Detail

setPurchaseListId

public void setPurchaseListId(java.lang.String pPurchaseListId)
Sets property purchaseListId

Overrides:
setPurchaseListId in class PurchaselistFormHandlerSuper
Parameters:
pPurchaseListId - The property to store the purchase list ID

setCreatePurchaselistSuccessURL

public void setCreatePurchaselistSuccessURL(java.lang.String pCreatePurchaselistSuccessURL)
Sets property createPurchaselistSuccessURL

Overrides:
setCreatePurchaselistSuccessURL in class PurchaselistFormHandlerSuper
Parameters:
pCreatePurchaselistSuccessURL - The property to store the createPurchaselistSuccessURL

setCreatePurchaselistErrorURL

public void setCreatePurchaselistErrorURL(java.lang.String pCreatePurchaselistErrorURL)
Sets property createPurchaselistErrorURL

Overrides:
setCreatePurchaselistErrorURL in class PurchaselistFormHandlerSuper
Parameters:
pCreatePurchaselistErrorURL - The property to store the createPurchaselistErrorURL

setSavePurchaselistSuccessURL

public void setSavePurchaselistSuccessURL(java.lang.String pSavePurchaselistSuccessURL)
Sets property savePurchaselistSuccessURL

Overrides:
setSavePurchaselistSuccessURL in class PurchaselistFormHandlerSuper
Parameters:
pSavePurchaselistSuccessURL - The property to store the savePurchaselistSuccessURL

setSavePurchaselistErrorURL

public void setSavePurchaselistErrorURL(java.lang.String pSavePurchaselistErrorURL)
Sets property savePurchaselistErrorURL

Overrides:
setSavePurchaselistErrorURL in class PurchaselistFormHandlerSuper
Parameters:
pSavePurchaselistErrorURL - The property to store the savePurchaselistErrorURL

setUpdatePurchaselistSuccessURL

public void setUpdatePurchaselistSuccessURL(java.lang.String pUpdatePurchaselistSuccessURL)
Sets property updatePurchaselistSuccessURL

Overrides:
setUpdatePurchaselistSuccessURL in class PurchaselistFormHandlerSuper
Parameters:
pUpdatePurchaselistSuccessURL - The property to store the updatePurchaselistSuccessURL

setUpdatePurchaselistErrorURL

public void setUpdatePurchaselistErrorURL(java.lang.String pUpdatePurchaselistErrorURL)
Sets property setUpdatePurchaselistErrorURL

Overrides:
setUpdatePurchaselistErrorURL in class PurchaselistFormHandlerSuper
Parameters:
pUpdatePurchaselistErrorURL - The property to store the setUpdatePurchaselistErrorURL

setUpdatePurchaselistItemsSuccessURL

public void setUpdatePurchaselistItemsSuccessURL(java.lang.String pUpdatePurchaselistItemsSuccessURL)
Sets property updatePurchaselistItemsSuccessURL

Overrides:
setUpdatePurchaselistItemsSuccessURL in class PurchaselistFormHandlerSuper
Parameters:
pUpdatePurchaselistItemsSuccessURL - The property to store the updatePurchaselistItemsSuccessURL

setUpdatePurchaselistItemsErrorURL

public void setUpdatePurchaselistItemsErrorURL(java.lang.String pUpdatePurchaselistItemsErrorURL)
Sets property updatePurchaselistItemsErrorURL

Overrides:
setUpdatePurchaselistItemsErrorURL in class PurchaselistFormHandlerSuper
Parameters:
pUpdatePurchaselistItemsErrorURL - The property to store the updatePurchaselistItemsErrorURL

setDeletePurchaselistSuccessURL

public void setDeletePurchaselistSuccessURL(java.lang.String pDeletePurchaselistSuccessURL)
Sets property deletePurchaselistSuccessURL

Overrides:
setDeletePurchaselistSuccessURL in class PurchaselistFormHandlerSuper
Parameters:
pDeletePurchaselistSuccessURL - The property to store the deletePurchaselistSuccessURL

setDeletePurchaselistErrorURL

public void setDeletePurchaselistErrorURL(java.lang.String pDeletePurchaselistErrorURL)
Sets property deletePurchaselistErrorURL

Overrides:
setDeletePurchaselistErrorURL in class PurchaselistFormHandlerSuper
Parameters:
pDeletePurchaselistErrorURL - The property to store the deletePurchaselistErrorURL

setAddItemToPurchaselistSuccessURL

public void setAddItemToPurchaselistSuccessURL(java.lang.String pAddItemToPurchaselistSuccessURL)
Sets property addItemToPurchaselistSuccessURL

Overrides:
setAddItemToPurchaselistSuccessURL in class PurchaselistFormHandlerSuper
Parameters:
pAddItemToPurchaselistSuccessURL - The property to store the addItemToPurchaselistSuccessURL

setAddItemToPurchaselistErrorURL

public void setAddItemToPurchaselistErrorURL(java.lang.String pAddItemToPurchaselistErrorURL)
Sets property addItemToPurchaselistErrorURL

Overrides:
setAddItemToPurchaselistErrorURL in class PurchaselistFormHandlerSuper
Parameters:
pAddItemToPurchaselistErrorURL - The property to store the addItemToPurchaselistErrorURL

setListName

public void setListName(java.lang.String pListName)
Sets property listName

Overrides:
setListName in class PurchaselistFormHandlerSuper
Parameters:
pListName - The property to store the listName

getUserLocale

public java.lang.String getUserLocale()
Return the userLocale property.

Returns:
users locale.

setUserLocale

public void setUserLocale(java.lang.String pUserLocale)
Set the userLocale property.

Parameters:
pUserLocale -

handleAddItemToPurchaselist

public boolean handleAddItemToPurchaselist(DynamoHttpServletRequest pRequest,
                                           DynamoHttpServletResponse pResponse)
                                    throws javax.servlet.ServletException,
                                           java.io.IOException,
                                           CommerceException
handleAddItemToPurchaseList is called when the user hits the submit button on a product page to add an item to the purchase list. It relies on the atg.commerce.gifts.GiftlistFormHandler.handleAddItemToGiftlist() method to execute this action. For the B2B demo, this is a skeleton method intended to preserve a consistent purchase list (rather than gift list) nomenclature.

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
See Also:
GiftListFormHandler#handleAddItemToGiftlist

handleCreatePurchaselist

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

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

handleSavePurchaselist

public boolean handleSavePurchaselist(DynamoHttpServletRequest pRequest,
                                      DynamoHttpServletResponse pResponse)
                               throws javax.servlet.ServletException,
                                      java.io.IOException,
                                      CommerceException
Called when the customer selects save purchaselist. Since for the b2b demo, purchase lists are implemented using the DCS5.0 giftlists feature, this will call the manager class to create a giftlist in the repository and add it to the current profile.

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
See Also:
GiftlistFormHandler#handleSaveGiftList

handleDeletePurchaselist

public boolean handleDeletePurchaselist(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

handleUpdatePurchaselist

public boolean handleUpdatePurchaselist(DynamoHttpServletRequest pRequest,
                                        DynamoHttpServletResponse pResponse)
                                 throws javax.servlet.ServletException,
                                        java.io.IOException,
                                        CommerceException
Called when the customer selects update purchaselist.

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

populateGiftListFields

public void populateGiftListFields()
Since the purchase list feature relies on the atg.commerce.gifts package in its implementation, this method is used to populate the individual fields of a giftlist that are needed for manipulating giftlists, but which do not have any direct relevance to the purchase list paradigm.


checkForListName

protected boolean checkForListName(DynamoHttpServletRequest pRequest,
                                   DynamoHttpServletResponse pResponse)
This method checks for validity of purchase list name. Its first checks for null and later checks against the current purchase lists of user for duplicate name. if duplicate exists it populates error message on screen.

Returns:
true if listname is not null and no purchase list exists with the listname.

getLocale

protected java.util.Locale getLocale(DynamoHttpServletRequest pRequest,
                                     DynamoHttpServletResponse pResponse)
Returns either the Locale from the Request object (if it isn't NULL), or the Locale from the JVM.

Parameters:
pRequest - the servlet's request
Returns:
Either the Locale from the Request object, or the Locale from the JVM.

addFormException

protected void addFormException(java.lang.String pErrorKey,
                                DynamoHttpServletRequest pRequest,
                                DynamoHttpServletResponse pResponse)
Adds a form exception to the formhandler. The exception that is generated is created using the pErrorKey to obtain a resource using the getStringResource method.

Overrides:
addFormException in class GiftlistFormHandler
Parameters:
pErrorKey - the resource key
pRequest - a DynamoHttpServletRequest value
pResponse - a DynamoHttpServletResponse value

getStringResource

public java.lang.String getStringResource(java.lang.String pResourceName,
                                          java.util.Locale pLocale)
This method acts as a utility method to obtain a given resource for a particular key. This is used to lookup error messages for the users locale.

Parameters:
pResourceName - the resource key used to obtain the resource
pLocale - the users locale for which the resource bundle will be obtained.
Returns:
The String resource