atg.projects.store.order.purchase
Class StoreCartFormHandler

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.droplet.EmptyFormHandler
              extended by atg.droplet.GenericFormHandler
                  extended by atg.commerce.order.purchase.PurchaseProcessFormHandler
                      extended by atg.commerce.order.purchase.CartModifierFormHandler
                          extended by atg.projects.store.order.purchase.StoreCartFormHandler
All Implemented Interfaces:
atg.commerce.util.PipelineErrorHandler, atg.droplet.DropletFormHandler, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener

public class StoreCartFormHandler
extends atg.commerce.order.purchase.CartModifierFormHandler

Extends the default CartModifierFormHandler for custom functionality. This class holds all the handle methods for the buttons on the cart page. Since all buttons need to perform similar functionality, including updating item quantities, adding gift wrap/gift message and moving to the checkout process, all the methods have been captured in this class. In the case of ExpressCheckout, this class does the preliminary duties of modifying cart contents, and then calls the ExpressCheckoutFormHandler to run the express checkout pipeline.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string.
protected  java.lang.String mAjaxAddItemToOrderErrorUrl
          Add item to order error redirect URL.
protected  java.lang.String mAjaxAddItemToOrderSuccessUrl
          Add item to order success redirect URL.
protected  boolean mInitializeShippingInfoFromProfile
          Should initialize shipping information from profile.
protected  StoreInventoryManager mInventoryManager
          property: Inventory manager.
static java.lang.String MSG_ITEM_LESS_THAN_MIN_QUANTITY
           
static java.lang.String MSG_ITEM_MORE_THAN_MAX_QUANTITY
           
static java.lang.String MSG_LESS_THAN_MIN_QUANTITY
           
static java.lang.String MSG_MORE_THAN_MAX_QUANTITY
           
protected static java.lang.String sPromotionBundleName
          Promotion resource bundle name.
 
Fields inherited from class atg.commerce.order.purchase.CartModifierFormHandler
MSG_AMBIGUOUS_INPUT_FOR_ADD, MSG_ERROR_ADDING_TO_ORDER, MSG_ERROR_MOVE_TO_PURCHASE_INFO, MSG_ERROR_REMOVING_ITEM, MSG_ERROR_UPDATE_ORDER, MSG_INVALID_QUANTITY, MSG_NO_ITEMS_TO_ADD, MSG_NO_ORDER_TO_MODIFY, MSG_QUANTITY_LESSTHAN_OR_EQUALTO_ZERO, MSG_QUANTITY_LESSTHAN_ZERO, MSG_UNSUPPORTED_RELATIONSHIP
 
Fields inherited from class atg.commerce.order.purchase.PurchaseProcessFormHandler
LOCK_NAME_ATTRIBUTE_NAME, PARAM_TRANSACTION_CREATED, PARAM_VALUE_TRUE
 
Fields inherited from class atg.droplet.GenericFormHandler
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
StoreCartFormHandler()
           
 
Method Summary
protected  boolean addItemToList(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Adds an item to a gift/wish list
protected  void addItemToOrder(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Override to set the current transaction for rollback if there are form errors.
protected  void addRemoveGiftServices()
          This is a convenience method for adding gift services.
protected  void determineExpressCheckoutSuccessURL(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Directs to a gift message page if the order contains a gift special instruction and the message hasn't been filled out.
protected  void determineSuccessURL(atg.servlet.DynamoHttpServletRequest pRequest)
          Utility method to create success URL based on if the user and order state.
 java.lang.String getAddItemToGiftlist()
           
 java.lang.String getAddItemToGiftlistErrorURL()
          Returns property AddItemToGiftlistErrorURL.
 java.lang.String getAddItemToGiftlistLoginURL()
           
 java.util.Map<java.lang.String,java.lang.String> getAddItemToGiftlistSuccessURLMap()
          Returns property AddItemToGiftlistSuccessURLMap.
 java.lang.String getAddItemToWishlist()
           
 java.lang.String getAjaxAddItemToOrderErrorUrl()
          Gets the AjaxAddItemToOrderErrorUrl.
 java.lang.String getAjaxAddItemToOrderSuccessUrl()
          Gets the AjaxAddItemToOrderSuccessUrl.
 StoreCartProcessHelper getCartHelper()
           
 CheckoutProgressStates getCheckoutProgressStates()
           
 java.lang.String getConfirmationURL()
           
 java.lang.String getContinueShoppingErrorURL()
           
 java.lang.String getContinueShoppingSuccessURL()
           
 java.lang.String getCouponCode()
           
 java.lang.String getExpressCheckoutErrorURL()
           
 java.lang.String getExpressCheckoutSuccessURL()
           
 java.lang.String getGiftMessageUrl()
           
 boolean getGiftNoteSelected()
           
 java.lang.String getGiftWrapProductId()
           
 boolean getGiftWrapSelected()
           
 java.lang.String getGiftWrapSkuId()
           
 boolean getInitializeShippingInfoFromProfile()
           
 StoreInventoryManager getInventoryManager()
           
 java.lang.String getLoginDuringCheckoutURL()
           
 long getMaxQuantity()
          Returns the maximum quantity permitted per order item
 long getMinQuantity()
          Returns the minimum quantity permitted per order item
 java.lang.String[] getRemoveItemFromOrder()
           
 atg.commerce.order.ShippingGroup getShippingGroup()
          Override of base class behavior to ensure a non-gift hardgood shipping group is returned if a shipping group hasn't already been set.
 java.lang.String getShippingInfoURL()
           
 java.lang.String getSkuType()
          The skuType property is used by form handler when rendering a 'no sku' exception.
 java.lang.String getSkuUnavailableURL()
           
 StoreExpressCheckoutFormHandler getStoreExpressCheckoutFormHandler()
           
 StoreGiftlistFormHandler getStoreGiftlistFormHandler()
           
 java.lang.String getUpdateErrorURL()
           
 java.lang.String getUpdateSuccessURL()
           
 boolean handleAddItemToGiftlist(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Adds items to a gift list based on the AddCommerceItemInfo array.
 boolean handleAddItemToOrder(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Add item to order.
 boolean handleAddItemToWishlist(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Adds items to a wish list based on the AddCommerceItemInfo array.
 boolean handleCheckout(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This method is called when the user wants to starts the CHECKOUT process for an order.
 boolean handleContinueShopping(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Need to do the exact same thing as handleUpdate, but redirect to different URL.
 boolean handleExpressCheckout(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Need to use the same form handler from the page.
 boolean handleRemoveItemFromOrder(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          
 boolean handleUpdate(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This method will update the cart contents.
protected  boolean isQuantityValid(long pQuantity, atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Validates quantity and adds form exceptions if quantity is invalid.
protected  boolean isSkuAvailable(java.lang.String pUnavailableURL, atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Used by the non-javascript picker to determine if a product is available.
 void postMoveToPurchaseInfo(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          The addRemoveGiftServices method should be done after modifying cart contents.
 void postRemoveItemFromOrder(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Called after all processing is done by the removeItemFromOrder method.
 void preAddItemToOrder(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Sets form values from request parameters if they are present on the request and haven't already been set in the form handler.
protected  boolean removeGiftServicesWhenAllGiftWrap()
          Removes gift services if all items in the order are gift wrap items.
 void setAddItemToGiftlist(java.lang.String pAddItemToGiftlist)
          Sets property AddItemToGiftlist.
 void setAddItemToGiftlistErrorURL(java.lang.String pAddItemToGiftlistErrorURL)
          Sets property AddItemToGiftlistErrorURL.
 void setAddItemToGiftlistLoginURL(java.lang.String pAddItemToGiftlistLoginURL)
          Sets property AddItemToGiftlistLoginURL.
 void setAddItemToGiftlistSuccessURLMap(java.util.Map<java.lang.String,java.lang.String> pAddItemToGiftlistSuccessURL)
          Sets property AddItemToGiftlistSuccessURLMap.
 void setAddItemToWishlist(java.lang.String pAddItemToWishlist)
          Sets property AddItemToWishlist.
 void setAjaxAddItemToOrderErrorUrl(java.lang.String pAjaxAddItemToOrderErrorUrl)
           
 void setAjaxAddItemToOrderSuccessUrl(java.lang.String pAjaxAddItemToOrderSuccessUrl)
           
 void setCartHelper(StoreCartProcessHelper pCartHelper)
           
 void setCheckoutProgressStates(CheckoutProgressStates pCheckoutProgressStates)
           
 void setConfirmationURL(java.lang.String pConfirmationURL)
           
 void setContinueShoppingErrorURL(java.lang.String pContinueShoppingErrorURL)
           
 void setContinueShoppingSuccessURL(java.lang.String pContinueShoppingSuccessURL)
           
 void setCouponCode(java.lang.String pCouponCode)
           
 void setExpressCheckoutErrorURL(java.lang.String pExpressCheckoutErrorURL)
           
 void setExpressCheckoutSuccessURL(java.lang.String pExpressCheckoutSuccessURL)
           
 void setGiftMessageUrl(java.lang.String pGiftMessageUrl)
           
 void setGiftNoteSelected(boolean pGiftNoteSelected)
           
 void setGiftWrapProductId(java.lang.String pGiftWrapProductId)
           
 void setGiftWrapSelected(boolean pGiftWrapSelected)
           
 void setGiftWrapSkuId(java.lang.String pGiftWrapSkuId)
          Sets the mGiftWrapSkuId property.
 void setInventoryManager(StoreInventoryManager pInventoryManager)
           
 void setLoginDuringCheckoutURL(java.lang.String pLoginDuringCheckoutURL)
           
 void setMaxQuantity(long pMaxQuantity)
          Set the maximum quantity permitted per order item
 void setMinQuantity(long pMinQuantity)
          Set the minimum quantity permitted per order item
 void setRemoveItemFromOrder(java.lang.String[] pRemoveItemFromOrder)
           
 void setShippingGroup(atg.commerce.order.ShippingGroup pShippingGroup)
          Override of base class behavior to use a locally defined variable for storing the shipping group.
 void setShippingInfoURL(java.lang.String pShippingInfoURL)
           
 void setSkuType(java.lang.String pSkuType)
           
 void setSkuUnavailableURL(java.lang.String pSkuUnavailableURL)
           
 void setStoreExpressCheckoutFormHandler(StoreExpressCheckoutFormHandler pStoreExpressCheckoutFormHandler)
           
 void setStoreGiftlistFormHandler(StoreGiftlistFormHandler pStoreGiftlistFormHandler)
           
 void setUpdateErrorURL(java.lang.String pUpdateErrorURL)
           
 void setUpdateSuccessURL(java.lang.String pUpdateSuccessURL)
           
protected  void validateOrderQuantity(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Validate quantity.
protected  void validateQuantity(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Validate quantity.
protected  void validateSelectedSKUs(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This method checks if all items to be added into the shopping cart contain a reference to a SKU repository item.
 
Methods inherited from class atg.commerce.order.purchase.CartModifierFormHandler
addConfigurableItemToOrder, addConfigurableItemToOrder, addItemToOrder, addItemToShippingGroup, addMultipleItemsToOrder, addMultipleItemsToOrder, applyValueDictionary, createCommerceItem, createConfigurableSubitems, deleteItems, deleteItemsByRelationshipId, doAddItemsToOrder, getAddItemCount, getAddItemInfoClass, getAddItemToOrderChainId, getAddItemToOrderErrorURL, getAddItemToOrderPricingOp, getAddItemToOrderSuccessURL, getAddMultipleItemsToOrderErrorURL, getAddMultipleItemsToOrderSuccessURL, getCatalogKey, getCatalogRefIds, getCommerceIds, getCommerceItemType, getConfigurableItemTypeName, getCreditCard, getDeletedSkus, getDeleteItemsFromOrderPricingOp, getGiftCertificate, getGiftlistId, getGiftlistItemId, getHardgoodShippingGroup, getInvalidQuantityCancelsAdd, getItems, getModifyOrderPricingOp, getMoveToPurchaseInfoByRelIdErrorURL, getMoveToPurchaseInfoByRelIdSuccessURL, getMoveToPurchaseInfoChainId, getMoveToPurchaseInfoErrorURL, getMoveToPurchaseInfoSuccessURL, getPaymentGroup, getProductId, getProductIds, getQuantity, getQuantity, getRemovalCatalogRefIds, getRemovalCommerceIds, getRemovalRelationshipIds, getRemoveAndAddItemToOrderErrorURL, getRemoveAndAddItemToOrderSuccessURL, getRemoveItemFromOrderByRelationshipIdErrorURL, getRemoveItemFromOrderByRelationshipIdSuccessURL, getRemoveItemFromOrderErrorURL, getRemoveItemFromOrderSuccessURL, getRepriceOrderErrorURL, getRepriceOrderSuccessURL, getSetOrderByRelationshipIdErrorURL, getSetOrderByRelationshipIdSuccessURL, getSetOrderChainId, getSetOrderErrorURL, getSetOrderSuccessURL, getShippingGroupCommerceItemRelationships, getSiteId, getValue, handleAddConfigurableItemToOrder, handleAddMultipleItemsToOrder, handleMoveToPurchaseInfo, handleMoveToPurchaseInfoByCommerceId, handleMoveToPurchaseInfoByRelId, handleRemoveAndAddItemToOrder, handleRemoveItemFromOrderByRelationshipId, handleSetOrder, handleSetOrderByCommerceId, handleSetOrderByRelationshipId, isCheckForChangedQuantity, mergeItemInputForAdd, mergeValueDictionaries, modifyCommerceItemsProperties, modifyOrder, modifyOrderByCommerceId, modifyOrderByRelationshipId, modifyOrderPostReprice, postAddItemToOrder, postAddMultipleItemsToOrder, postRemoveAndAddItemToOrder, postRemoveItemFromOrderByRelationshipId, postSetOrder, postSetOrderByCommerceId, postSetOrderByRelationshipId, preAddMultipleItemsToOrder, preMoveToPurchaseInfo, preRemoveAndAddItemToOrder, preRemoveItemFromOrder, preRemoveItemFromOrderByRelationshipId, preSetOrder, preSetOrderByCommerceId, preSetOrderByRelationshipId, processGiftAddition, runProcessAddItemToOrder, runProcessAddItemToOrder, runProcessMoveToPurchaseInfo, runProcessSendScenarioEvent, runProcessSendScenarioEvent, runProcessSendScenarioEvent, runProcessSendScenarioEvent, runProcessSetOrder, setAddItemCount, setAddItemInfoClass, setAddItemToOrderChainId, setAddItemToOrderErrorURL, setAddItemToOrderPricingOp, setAddItemToOrderSuccessURL, setAddMultipleItemsToOrderErrorURL, setAddMultipleItemsToOrderSuccessURL, setCatalogRefIds, setCheckForChangedQuantity, setCommerceIds, setCommerceItemProperties, setCommerceItemType, setConfigurableItemTypeName, setCreditCard, setDeletedSkus, setDeleteItemsFromOrderPricingOp, setGiftCertificate, setGiftlistId, setGiftlistItemId, setHardgoodShippingGroup, setInvalidQuantityCancelsAdd, setModifyOrderPricingOp, setMoveToPurchaseInfoByRelIdErrorURL, setMoveToPurchaseInfoByRelIdSuccessURL, setMoveToPurchaseInfoChainId, setMoveToPurchaseInfoErrorURL, setMoveToPurchaseInfoSuccessURL, setPaymentGroup, setProductId, setProductIds, setQuantity, setRemovalCatalogRefIds, setRemovalCommerceIds, setRemovalRelationshipIds, setRemoveAndAddItemToOrderErrorURL, setRemoveAndAddItemToOrderSuccessURL, setRemoveItemFromOrderByRelationshipIdErrorURL, setRemoveItemFromOrderByRelationshipIdSuccessURL, setRemoveItemFromOrderErrorURL, setRemoveItemFromOrderSuccessURL, setRepriceOrderErrorURL, setRepriceOrderSuccessURL, setSetOrderByRelationshipIdErrorURL, setSetOrderByRelationshipIdSuccessURL, setSetOrderChainId, setSetOrderErrorURL, setSetOrderSuccessURL, setSiteId, updateOrder, validateShippingGroupForAdd
 
Methods inherited from class atg.commerce.order.purchase.PurchaseProcessFormHandler
acquireTransactionLock, acquireTransactionLock, afterSet, beforeSet, checkFormRedirect, commitTransaction, copyConfiguration, createRepriceParameterMap, defaultLocalLockManager, defaultUserProfile, doStartService, ensureTransaction, formatUserMessage, formatUserMessage, formatUserMessage, formatUserMessage, generatePropertyPath, getClaimableManager, getCommerceIdentifierPaymentInfoContainer, getCommerceItemManager, getCommerceItemShippingInfoContainer, getCommerceProfileTools, getCommercePropertyManager, getConfiguration, getCurrentTransaction, getDefaultLocale, getGiftlistManager, getHandlingInstructionManager, getLocalLockManager, getOrder, getOrderManager, getPaymentGroupManager, getPaymentGroupMapContainer, getPipelineManager, getPriceList, getPriceListId, getPriceListManager, getProfile, getProfileRepository, getPurchaseProcessHelper, getRepeatingRequestMonitor, getRepriceOrderChainId, getResourceBundle, getResourceBundle, getResourceBundleName, getSessionExpirationURL, getShippingGroupManager, getShippingGroupMapContainer, getShoppingCart, getTransactionManager, getUserLocale, getUserLocale, getUserPricingModels, handlePipelineError, isEnsureTransaction, isFormSubmission, isTransactionCreated, isTransactionMarkedAsRollBack, isUseLocksAroundTransactions, isUseRequestLocale, processException, processPipelineErrors, releaseTransactionLock, releaseTransactionLock, runProcess, runProcess, runProcess, runProcessRepriceOrder, runProcessRepriceOrder, runRepricingProcess, setClaimableManager, setCommerceIdentifierPaymentInfoContainer, setCommerceItemManager, setCommerceItemShippingInfoContainer, setCommerceProfileTools, setCommercePropertyManager, setConfiguration, setCurrentTransaction, setDefaultLocale, setEnsureTransaction, setGiftlistManager, setHandlingInstructionManager, setLocalLockManager, setOrder, setOrderManager, setPaymentGroupManager, setPaymentGroupMapContainer, setPipelineManager, setPriceListId, setPriceListManager, setProfile, setProfileRepository, setPurchaseProcessHelper, setRepeatingRequestMonitor, setRepriceOrderChainId, setSessionExpirationURL, setShippingGroupManager, setShippingGroupMapContainer, setShoppingCart, setTransactionCreated, setTransactionManager, setTransactionToRollbackOnly, setUseLocksAroundTransactions, setUseRequestLocale, setUserLocale, setUserPricingModels, transactionLockName, unsetTransactionCreated
 
Methods inherited from class atg.droplet.GenericFormHandler
addFormException, addUncheckedFormException, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleCancel, handleFormException, handleUncheckedFormException, hasUncheckedFormExceptions, isDeferForwardsAndRedirects, isRestorableForm, isUseForwards, isValidSession, redirectOrForward, resetFormExceptions, setCancelURL, setCheckForValidSession, setDeferForwardsAndRedirects, setFormName, setMessagePort, setMessageSource, setMessageType, setRestorableForm, setSendMessages, setUseForwards
 
Methods inherited from class atg.droplet.EmptyFormHandler
afterGet, beforeGet
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string.


MSG_LESS_THAN_MIN_QUANTITY

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

MSG_MORE_THAN_MAX_QUANTITY

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

MSG_ITEM_LESS_THAN_MIN_QUANTITY

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

MSG_ITEM_MORE_THAN_MAX_QUANTITY

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

sPromotionBundleName

protected static java.lang.String sPromotionBundleName
Promotion resource bundle name.


mAjaxAddItemToOrderSuccessUrl

protected java.lang.String mAjaxAddItemToOrderSuccessUrl
Add item to order success redirect URL.


mAjaxAddItemToOrderErrorUrl

protected java.lang.String mAjaxAddItemToOrderErrorUrl
Add item to order error redirect URL.


mInitializeShippingInfoFromProfile

protected boolean mInitializeShippingInfoFromProfile
Should initialize shipping information from profile.


mInventoryManager

protected StoreInventoryManager mInventoryManager
property: Inventory manager.

Constructor Detail

StoreCartFormHandler

public StoreCartFormHandler()
Method Detail

getSkuType

public java.lang.String getSkuType()
The skuType property is used by form handler when rendering a 'no sku' exception. Different messages are displayed to the user depending on the skuType property specified.

Returns:
current skuType property value.

setSkuType

public void setSkuType(java.lang.String pSkuType)

getSkuUnavailableURL

public java.lang.String getSkuUnavailableURL()

setSkuUnavailableURL

public void setSkuUnavailableURL(java.lang.String pSkuUnavailableURL)

getInventoryManager

public StoreInventoryManager getInventoryManager()
Returns:
the inventoryManager.

setInventoryManager

public void setInventoryManager(StoreInventoryManager pInventoryManager)
Parameters:
pInventoryManager - - the inventoryManager to set.

getCheckoutProgressStates

public CheckoutProgressStates getCheckoutProgressStates()

setCheckoutProgressStates

public void setCheckoutProgressStates(CheckoutProgressStates pCheckoutProgressStates)

getCartHelper

public StoreCartProcessHelper getCartHelper()
Returns:
the Cart Helper component.

setCartHelper

public void setCartHelper(StoreCartProcessHelper pCartHelper)
Parameters:
pShippingHelper - the cart helper component to set.

setAddItemToGiftlistSuccessURLMap

public void setAddItemToGiftlistSuccessURLMap(java.util.Map<java.lang.String,java.lang.String> pAddItemToGiftlistSuccessURL)
Sets property AddItemToGiftlistSuccessURLMap.

Parameters:
pAddItemToGiftlistSuccessURLMap - The property to store the success URLs map for addItemToGiftlist. The map's keys are gift list IDs.

getAddItemToGiftlistSuccessURLMap

public java.util.Map<java.lang.String,java.lang.String> getAddItemToGiftlistSuccessURLMap()
Returns property AddItemToGiftlistSuccessURLMap.

Returns:
The value of the property AddItemToGiftlistSuccessURLMap

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

setAddItemToGiftlistLoginURL

public void setAddItemToGiftlistLoginURL(java.lang.String pAddItemToGiftlistLoginURL)
Sets property AddItemToGiftlistLoginURL.

Parameters:
pAddItemToGiftlistLoginURL - The property to store the URL for where the user should be redirected if they attempt to add an item to the giftlist without being logged in.

getAddItemToGiftlistLoginURL

public java.lang.String getAddItemToGiftlistLoginURL()
Returns:
add item to gift list login URL.

setAddItemToGiftlist

public void setAddItemToGiftlist(java.lang.String pAddItemToGiftlist)
Sets property AddItemToGiftlist.

Parameters:
pAddItemToGiftlist - The property to store the gift list Id to which item should be added.

getAddItemToGiftlist

public java.lang.String getAddItemToGiftlist()
Returns:
AddItemToGiftlist property.

setAddItemToWishlist

public void setAddItemToWishlist(java.lang.String pAddItemToWishlist)
Sets property AddItemToWishlist.

Parameters:
pAddItemToWishlist - The property to store the gift list Id to which item should be added.

getAddItemToWishlist

public java.lang.String getAddItemToWishlist()
Returns:
AddItemToWishlist property.

getContinueShoppingSuccessURL

public java.lang.String getContinueShoppingSuccessURL()
Returns:
the continue shopping success redirect URL.

setContinueShoppingSuccessURL

public void setContinueShoppingSuccessURL(java.lang.String pContinueShoppingSuccessURL)
Parameters:
pContinueShoppingSuccessURL - - the continue shopping success redirect URL

getContinueShoppingErrorURL

public java.lang.String getContinueShoppingErrorURL()
Returns:
the continue shopping error redirect URL.

setContinueShoppingErrorURL

public void setContinueShoppingErrorURL(java.lang.String pContinueShoppingErrorURL)
Parameters:
pContinueShoppingErrorURL - - the continue shopping error redirect URL.

getRemoveItemFromOrder

public java.lang.String[] getRemoveItemFromOrder()
Returns:
the removal commerce ids.

setRemoveItemFromOrder

public void setRemoveItemFromOrder(java.lang.String[] pRemoveItemFromOrder)
Parameters:
pRemoveItemFromOrder - - the removal commerce ids.

getUpdateSuccessURL

public java.lang.String getUpdateSuccessURL()
Returns:
the update success redirect URL.

setUpdateSuccessURL

public void setUpdateSuccessURL(java.lang.String pUpdateSuccessURL)
Parameters:
pUpdateSuccessURL - - the update success redirect URL.

getUpdateErrorURL

public java.lang.String getUpdateErrorURL()
Returns:
the update error redirect URL.

setUpdateErrorURL

public void setUpdateErrorURL(java.lang.String pUpdateErrorURL)
Parameters:
pUpdateErrorURL - - the update error redirect URL.

getExpressCheckoutSuccessURL

public java.lang.String getExpressCheckoutSuccessURL()
Returns:
the express checkout success redirect URL.

setExpressCheckoutSuccessURL

public void setExpressCheckoutSuccessURL(java.lang.String pExpressCheckoutSuccessURL)
Parameters:
pExpressCheckoutSuccessURL - - the express checkout success redirect URL.

getExpressCheckoutErrorURL

public java.lang.String getExpressCheckoutErrorURL()
Returns:
the express checkout error redirect URL.

setExpressCheckoutErrorURL

public void setExpressCheckoutErrorURL(java.lang.String pExpressCheckoutErrorURL)
Parameters:
pExpressCheckoutErrorURL - - the express checkout error redirect URL.

getStoreExpressCheckoutFormHandler

public StoreExpressCheckoutFormHandler getStoreExpressCheckoutFormHandler()
Returns:
the Store express checkout form handler.

setStoreExpressCheckoutFormHandler

public void setStoreExpressCheckoutFormHandler(StoreExpressCheckoutFormHandler pStoreExpressCheckoutFormHandler)
Parameters:
pStoreExpressCheckoutFormHandler - - the Store express checkout form handler.

getGiftWrapSelected

public boolean getGiftWrapSelected()
Returns:
the gift wrap selected property.

setGiftWrapSelected

public void setGiftWrapSelected(boolean pGiftWrapSelected)
Parameters:
pGiftWrapSelected - - the gift wrap selected property.

getGiftWrapSkuId

public java.lang.String getGiftWrapSkuId()
Returns:
the gift wrap sku id property.

setGiftWrapSkuId

public void setGiftWrapSkuId(java.lang.String pGiftWrapSkuId)
Sets the mGiftWrapSkuId property. This is set by the page after getting the SKU id from the targeter.

Parameters:
pGiftWrapSkuId - - gift wrap sku id property

getGiftWrapProductId

public java.lang.String getGiftWrapProductId()
Returns:
the gift wrap product id property.

setGiftWrapProductId

public void setGiftWrapProductId(java.lang.String pGiftWrapProductId)
Parameters:
pGiftWrapProductId - - the gift wrap product id property.

getGiftNoteSelected

public boolean getGiftNoteSelected()
Returns:
the gift note selected property.

setGiftNoteSelected

public void setGiftNoteSelected(boolean pGiftNoteSelected)
Parameters:
pGiftNoteSelected - - the gift note selected property.

getGiftMessageUrl

public java.lang.String getGiftMessageUrl()
Returns:
the gift message url property.

setGiftMessageUrl

public void setGiftMessageUrl(java.lang.String pGiftMessageUrl)
Parameters:
pGiftMessageUrl - - the gift message url property.

getShippingInfoURL

public java.lang.String getShippingInfoURL()
Returns:
the shipping information URL property.

setShippingInfoURL

public void setShippingInfoURL(java.lang.String pShippingInfoURL)
Parameters:
pShippingInfoURL - - the shipping information URL property.

getLoginDuringCheckoutURL

public java.lang.String getLoginDuringCheckoutURL()
Returns:
the login during checkout URL property.

setLoginDuringCheckoutURL

public void setLoginDuringCheckoutURL(java.lang.String pLoginDuringCheckoutURL)
Parameters:
pLoginDuringCheckoutURL - - the login during checkout URL property.

getCouponCode

public java.lang.String getCouponCode()
Returns:
a coupon code to be claimed

setCouponCode

public void setCouponCode(java.lang.String pCouponCode)

getConfirmationURL

public java.lang.String getConfirmationURL()
Returns:
the confirmation URL property.

setConfirmationURL

public void setConfirmationURL(java.lang.String pConfirmationURL)
Parameters:
pConfirmationURL - - the confirmation URL property.

getAjaxAddItemToOrderSuccessUrl

public java.lang.String getAjaxAddItemToOrderSuccessUrl()
Gets the AjaxAddItemToOrderSuccessUrl.

Returns:
the add item to order success redirect Url.

setAjaxAddItemToOrderSuccessUrl

public void setAjaxAddItemToOrderSuccessUrl(java.lang.String pAjaxAddItemToOrderSuccessUrl)
Parameters:
pAjaxAddItemToOrderSuccessUrl - - the add item to order success redirect Url to set.

getAjaxAddItemToOrderErrorUrl

public java.lang.String getAjaxAddItemToOrderErrorUrl()
Gets the AjaxAddItemToOrderErrorUrl.

Returns:
the add item to order error redirect Url

setAjaxAddItemToOrderErrorUrl

public void setAjaxAddItemToOrderErrorUrl(java.lang.String pAjaxAddItemToOrderErrorUrl)
Parameters:
pAjaxAddItemToOrderErrorUrl - - the add item to order error Url to set.

getInitializeShippingInfoFromProfile

public boolean getInitializeShippingInfoFromProfile()
Returns:
true if shipping info should be initialized from profile property.

setMinQuantity

public void setMinQuantity(long pMinQuantity)
Set the minimum quantity permitted per order item

Parameters:
pMinQuantity - minimum quantity permitted per order item

getMinQuantity

public long getMinQuantity()
Returns the minimum quantity permitted per order item

Returns:
minimum quantity permitted per order item

setMaxQuantity

public void setMaxQuantity(long pMaxQuantity)
Set the maximum quantity permitted per order item

Parameters:
pMaxQuantity - maximum quantity permitted per order item

getMaxQuantity

public long getMaxQuantity()
Returns the maximum quantity permitted per order item

Returns:
maximum quantity permitted per order item

getStoreGiftlistFormHandler

public StoreGiftlistFormHandler getStoreGiftlistFormHandler()
Returns:
the Gift list form handler.

setStoreGiftlistFormHandler

public void setStoreGiftlistFormHandler(StoreGiftlistFormHandler pStoreGiftlistFormHandler)
Parameters:
pStoreGiftlistFormHandler - - the Gift list form handler.

handleCheckout

public boolean handleCheckout(atg.servlet.DynamoHttpServletRequest pRequest,
                              atg.servlet.DynamoHttpServletResponse pResponse)
                       throws javax.servlet.ServletException,
                              java.io.IOException
This method is called when the user wants to starts the CHECKOUT process for an order. It will first validates quantity. If quantity is valid it checks if order contains only items with zero quantity and update order (remove all commerce items) if so. After this has happened it will claim coupons and invokes super.handleMoveToPurchaseInfoByCommerceId method.

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

postMoveToPurchaseInfo

public void postMoveToPurchaseInfo(atg.servlet.DynamoHttpServletRequest pRequest,
                                   atg.servlet.DynamoHttpServletResponse pResponse)
                            throws javax.servlet.ServletException,
                                   java.io.IOException
The addRemoveGiftServices method should be done after modifying cart contents. The modifyOrder method will remove the gw item from the cart.

Overrides:
postMoveToPurchaseInfo in class atg.commerce.order.purchase.CartModifierFormHandler
Parameters:
pRequest - the request object
pResponse - the response object
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

handleUpdate

public boolean handleUpdate(atg.servlet.DynamoHttpServletRequest pRequest,
                            atg.servlet.DynamoHttpServletResponse pResponse)
                     throws javax.servlet.ServletException,
                            java.io.IOException
This method will update the cart contents.

Parameters:
pRequest - - http request
pResponse - - http response
Returns:
true if success, false - otherwise
Throws:
javax.servlet.ServletException - if servlet error occurs
java.io.IOException - if IO error occurs

handleContinueShopping

public boolean handleContinueShopping(atg.servlet.DynamoHttpServletRequest pRequest,
                                      atg.servlet.DynamoHttpServletResponse pResponse)
                               throws javax.servlet.ServletException,
                                      java.io.IOException
Need to do the exact same thing as handleUpdate, but redirect to different URL. Let page specify success URL based on Profile.categoryLastBrowsed. Set updateSuccessURL here, and re-use handleUpdate code.

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

handleRemoveItemFromOrder

public boolean handleRemoveItemFromOrder(atg.servlet.DynamoHttpServletRequest pRequest,
                                         atg.servlet.DynamoHttpServletResponse pResponse)
                                  throws java.io.IOException,
                                         javax.servlet.ServletException

Overrides:
handleRemoveItemFromOrder in class atg.commerce.order.purchase.CartModifierFormHandler
Parameters:
pRequest - the request object
pResponse - the resonse object
Returns:
true if the request was handled properly
Throws:
java.io.IOException - if an error occurs
javax.servlet.ServletException - if an error occurs

handleExpressCheckout

public boolean handleExpressCheckout(atg.servlet.DynamoHttpServletRequest pRequest,
                                     atg.servlet.DynamoHttpServletResponse pResponse)
                              throws javax.servlet.ServletException,
                                     java.io.IOException
Need to use the same form handler from the page. Modify cart contents, and then call the ExpressCheckoutFormHandler to use express checkout.

Parameters:
pRequest - the request
pResponse - the response
Returns:
boolean success or failure
Throws:
javax.servlet.ServletException - If servlet exception occurs
java.io.IOException - If IO exception occurs

removeGiftServicesWhenAllGiftWrap

protected boolean removeGiftServicesWhenAllGiftWrap()
Removes gift services if all items in the order are gift wrap items.

Returns:
true if all items are gift wrap items and gift wrap services were removed

addRemoveGiftServices

protected void addRemoveGiftServices()
This is a convenience method for adding gift services. This needs to be done when the update, checkout, delete or continue shopping buttons are pushed.


determineSuccessURL

protected void determineSuccessURL(atg.servlet.DynamoHttpServletRequest pRequest)
Utility method to create success URL based on if the user and order state. Not possible to set this in the page b/c we don't know if the user selects gift message or not when clicking "checkout" button. Set success URL based on current state of order and login status. if ((order doesn't have samples AND user has not chosen to skip samples) OR (order has gift message)) redirect to samples page. if (order has samples OR user explicitly chose no samples) if (user is logged in) redirect to shipping else redirect to login

Parameters:
pRequest - - http request

determineExpressCheckoutSuccessURL

protected void determineExpressCheckoutSuccessURL(atg.servlet.DynamoHttpServletRequest pRequest,
                                                  atg.servlet.DynamoHttpServletResponse pResponse)
Directs to a gift message page if the order contains a gift special instruction and the message hasn't been filled out.

Parameters:
pRequest - - http request
pResponse - - http response

preAddItemToOrder

public void preAddItemToOrder(atg.servlet.DynamoHttpServletRequest pRequest,
                              atg.servlet.DynamoHttpServletResponse pResponse)
                       throws javax.servlet.ServletException,
                              java.io.IOException
Sets form values from request parameters if they are present on the request and haven't already been set in the form handler. This allows add operations to be triggered by a link instead of a form submission.

Overrides:
preAddItemToOrder in class atg.commerce.order.purchase.CartModifierFormHandler
Parameters:
pRequest - the request object
pResponse - the response object
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

addItemToOrder

protected void addItemToOrder(atg.servlet.DynamoHttpServletRequest pRequest,
                              atg.servlet.DynamoHttpServletResponse pResponse)
                       throws javax.servlet.ServletException,
                              java.io.IOException
Override to set the current transaction for rollback if there are form errors.

Overrides:
addItemToOrder in class atg.commerce.order.purchase.CartModifierFormHandler
Parameters:
pRequest - - http request
pResponse - - http response
Throws:
javax.servlet.ServletException - if servlet error occurs
java.io.IOException - if IO error occurs

handleAddItemToWishlist

public boolean handleAddItemToWishlist(atg.servlet.DynamoHttpServletRequest pRequest,
                                       atg.servlet.DynamoHttpServletResponse pResponse)
                                throws javax.servlet.ServletException,
                                       java.io.IOException,
                                       atg.commerce.CommerceException
Adds items to a wish list based on the AddCommerceItemInfo array. Each item in the array is added to the profiles wish 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
atg.commerce.CommerceException - if there was an error with Commerce

handleAddItemToGiftlist

public boolean handleAddItemToGiftlist(atg.servlet.DynamoHttpServletRequest pRequest,
                                       atg.servlet.DynamoHttpServletResponse pResponse)
                                throws javax.servlet.ServletException,
                                       java.io.IOException,
                                       atg.commerce.CommerceException
Adds items to a gift list based on the AddCommerceItemInfo array. Each item in the array is added to the selected gift 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
atg.commerce.CommerceException - if there was an error with Commerce

addItemToList

protected boolean addItemToList(atg.servlet.DynamoHttpServletRequest pRequest,
                                atg.servlet.DynamoHttpServletResponse pResponse)
                         throws javax.servlet.ServletException,
                                java.io.IOException,
                                atg.commerce.CommerceException
Adds an item to a gift/wish 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
atg.commerce.CommerceException - if there was an error with Commerce

postRemoveItemFromOrder

public void postRemoveItemFromOrder(atg.servlet.DynamoHttpServletRequest pRequest,
                                    atg.servlet.DynamoHttpServletResponse pResponse)
                             throws javax.servlet.ServletException,
                                    java.io.IOException
Called after all processing is done by the removeItemFromOrder method.

Overrides:
postRemoveItemFromOrder in class atg.commerce.order.purchase.CartModifierFormHandler
Parameters:
pRequest - the request object
pResponse - the response object
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

setShippingGroup

public void setShippingGroup(atg.commerce.order.ShippingGroup pShippingGroup)
Override of base class behavior to use a locally defined variable for storing the shipping group.

Overrides:
setShippingGroup in class atg.commerce.order.purchase.CartModifierFormHandler
Parameters:
pShippingGroup - - shipping group

getShippingGroup

public atg.commerce.order.ShippingGroup getShippingGroup()
Override of base class behavior to ensure a non-gift hardgood shipping group is returned if a shipping group hasn't already been set.

Overrides:
getShippingGroup in class atg.commerce.order.purchase.CartModifierFormHandler
Returns:
shipping group

handleAddItemToOrder

public boolean handleAddItemToOrder(atg.servlet.DynamoHttpServletRequest pRequest,
                                    atg.servlet.DynamoHttpServletResponse pResponse)
                             throws javax.servlet.ServletException,
                                    java.io.IOException
Add item to order.

Overrides:
handleAddItemToOrder in class atg.commerce.order.purchase.CartModifierFormHandler
Parameters:
pRequest - - http request
pResponse - - http response
Returns:
true if succcess, false - otherwise
Throws:
javax.servlet.ServletException - if servlet error occurs
java.io.IOException - if IO error occurs

isSkuAvailable

protected boolean isSkuAvailable(java.lang.String pUnavailableURL,
                                 atg.servlet.DynamoHttpServletRequest pRequest,
                                 atg.servlet.DynamoHttpServletResponse pResponse)
Used by the non-javascript picker to determine if a product is available. If we are unable to determine if its in stock assume it is.

Parameters:
pUnavailableURL - The url to redirect to in the event a product is not available
Returns:
A boolean indicating whether or not a product is available

validateSelectedSKUs

protected void validateSelectedSKUs(atg.servlet.DynamoHttpServletRequest pRequest,
                                    atg.servlet.DynamoHttpServletResponse pResponse)
                             throws javax.servlet.ServletException,
                                    java.io.IOException
This method checks if all items to be added into the shopping cart contain a reference to a SKU repository item. If no items specified, this method walks through catalogRefIds references, and if no reference found, creates a 'no sku' form exception. If there are some items specified, this method walks through them and checks all references to SKU repotisoty item. If one or more items has no reference to SKU, this method creates a 'no sku' form exception.

Parameters:
pRequest - - current HTTP request.
pResponse - - current HTTP response.
Throws:
javax.servlet.ServletException - - if something goes wrong.
java.io.IOException - - if unable to modify HTTP request or response.

validateOrderQuantity

protected void validateOrderQuantity(atg.servlet.DynamoHttpServletRequest pRequest,
                                     atg.servlet.DynamoHttpServletResponse pResponse)
                              throws javax.servlet.ServletException,
                                     java.io.IOException
Validate quantity.

Parameters:
pRequest - - http request
pResponse - - http response
Throws:
javax.servlet.ServletException - if servlet error occurs
java.io.IOException - if IO error occurs

validateQuantity

protected void validateQuantity(atg.servlet.DynamoHttpServletRequest pRequest,
                                atg.servlet.DynamoHttpServletResponse pResponse)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Validate quantity.

Parameters:
pRequest - - http request
pResponse - - http response
Throws:
javax.servlet.ServletException - if servlet error occurs
java.io.IOException - if IO error occurs

isQuantityValid

protected boolean isQuantityValid(long pQuantity,
                                  atg.servlet.DynamoHttpServletRequest pRequest,
                                  atg.servlet.DynamoHttpServletResponse pResponse)
                           throws javax.servlet.ServletException,
                                  java.io.IOException
Validates quantity and adds form exceptions if quantity is invalid.

Parameters:
pQuantity - quantity to validate
pRequest - - http request
pResponse - - http response
Returns:
true is valid, false otherwise
Throws:
javax.servlet.ServletException - if servlet error occurs
java.io.IOException - if IO error occurs