atg.projects.store.order.purchase
Class StoreCartProcessHelper

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.order.purchase.PurchaseProcessHelper
              extended by atg.projects.store.order.purchase.StorePurchaseProcessHelper
                  extended by atg.projects.store.order.purchase.StoreCartProcessHelper
All Implemented Interfaces:
atg.naming.AbsoluteNameable, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameContextParentable, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.Configured, 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 StoreCartProcessHelper
extends StorePurchaseProcessHelper

Extends the StorePurchaseProcessHelper to implement cart processing helper methods.

Version:
$Id: //hosting-blueprint/B2CBlueprint/version/10.2.1/EStore/src/atg/projects/store/order/purchase/StoreCartProcessHelper.java#2 $$Change: 788983 $
Author:
ATG

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  atg.userprofiling.ProfileTools mProfileTools
          property: profileTools
static java.lang.String MSG_ERROR_ADDING_TO_GIFTLIST
          Error adding to giftlist message resource key.
static java.lang.String MSG_ERROR_MODIFYING_ORDER
          Error modifying order message resource key.
static java.lang.String MSG_INVALID_ITEMS
          Invalid items message resource key.
static java.lang.String MSG_INVALID_RECIPIENT_EMAIL
          Invalid recipient e-mail address resource key.
static java.lang.String MSG_INVALID_SENDER_EMAIL
          Invalid sender e-mail address.
static java.lang.String MSG_NO_ITEMS_SELECT
          No items selected message resource key.
 
Fields inherited from class atg.projects.store.order.purchase.StorePurchaseProcessHelper
ADDRESS_PROP_NAME, CITY_PROP_NAME, COUNTRY_PROP_NAME, FIRST_NAME_PROP_NAME, LAST_NAME_PROP_NAME, MSG_MISSING_REQUIRED_ADDRESS_PROPERTY, MSG_MULTIPLE_COUPONS_PER_ORDER, MSG_UNCLAIMABLE_COUPON, POSTAL_CODE_PROP_NAME, PRICING_ERROR, PRICING_ERROR_ADDRESS, STATE_PROP_NAME
 
Fields inherited from class atg.commerce.order.purchase.PurchaseProcessHelper
ERROR_FETCHING_PROFILE, MSG_ERROR_ADDING_CREDIT_CARD, MSG_ERROR_ADDING_SHIPPINGGROUP, MSG_ERROR_ADDING_TO_ORDER, MSG_ERROR_CHANGING_ITEM_QUANTITY, MSG_ERROR_CREATING_ORDER, MSG_ERROR_MOVING_ITEM_BETWEEN_SHIPPING_GROUPS, MSG_ERROR_PROCESS_ADD_ITEM_CHAIN, MSG_ERROR_REMOVING_ITEM, MSG_ERROR_REMOVING_ITEM_FROM_SHIPPING_GROUP, MSG_ERROR_REPRICING_ORDER_AFTER_ADD_ITEM, MSG_ERROR_SETTING_ORDER_AMOUNT, MSG_INVALID_PROFILE_ID
 
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
StoreCartProcessHelper()
           
 
Method Summary
 java.lang.String addItemsToGiftlist(java.lang.String pGiftlistId, atg.commerce.order.purchase.AddCommerceItemInfo[] pItems, atg.commerce.gifts.GiftlistManager pGiftlistManager)
           Adds the given item(s) to the selected gift list.
 void addRemoveGiftServices(StoreOrderImpl pStoreOrder, boolean pAddGiftWrap, boolean pAddGiftMessage, java.lang.String pGiftWrapSkuId, java.lang.String pGiftWrapProductId)
          This method can be used by form handlers to add / remove gift message or gift-wrap from the order.
 boolean areItemsInCatalog(atg.commerce.order.Order pOrder)
          Check if all items on the order are in the catalog.
 atg.userprofiling.PropertyManager getProfilePropertyManager()
           
 atg.userprofiling.ProfileTools getProfileTools()
           
 int getSecurityStatus(atg.repository.RepositoryItem pProfile)
          Get the current security status from the provided profile.
 boolean isAllGiftWrap(StoreOrderImpl pOrder)
          Check to see if the order contains only gift wrap items.
 boolean isAuthorizedUser(atg.repository.RepositoryItem pProfile)
          Check the security status of the profile to see if the user is authorized.
 boolean isGiftWrapAddedOrRemoved(StoreOrderImpl pOrder, boolean pGiftWrapSelected)
          Check to see if gift-wrap has been added or removed from the order.
 boolean isLoginUser(atg.repository.RepositoryItem pProfile)
          Check the security status of the profile to see if the user is logged in.
 void rollbackTransaction(javax.transaction.TransactionManager pTransactionManager)
          Rollback the provided transaction.
 void setProfilePropertyManager(atg.userprofiling.PropertyManager pProfilePropertyManager)
           
 void setProfileTools(atg.userprofiling.ProfileTools pProfileTools)
           
 
Methods inherited from class atg.projects.store.order.purchase.StorePurchaseProcessHelper
checkForRequiredAddressProperties, claimCoupon, claimCoupon, getAddressPropertyNameMap, getClaimableManager, getMandatoryStateCountryList, getPlaceUtils, getPricingTools, getRequiredAddressPropertyNames, getStoreConfiguration, getStoreOrderTools, removeCoupon, removeCoupon, repriceOrder, setAddressPropertyNameMap, setClaimableManager, setPlaceUtils, setPricingTools, setRequiredAddressPropertyNames, setStoreConfiguration, setStoreOrderTools, tenderCoupon
 
Methods inherited from class atg.commerce.order.purchase.PurchaseProcessHelper
addCreditCardToOrder, addItemsToOrder, addItemsToOrder, addItemToOrder, addItemToShippingGroup, addShippingAddressToOrder, adjustItemRelationshipsForQuantityChange, adjustNonGiftHandlingInstructionsForQuantityDecrease, adjustNonGiftHandlingInstructionsForQuantityIncrease, applyValueDictionary, changeItemQuantity, copyCreditCardInfo, createCommerceItem, createConfigurableSubitems, createOrder, decreaseRelationshipQuantity, deleteItem, deleteItems, deleteItems, getAddItemToOrderChainId, getAddItemToOrderPricingOp, getCommerceItemManager, getDefaultHardgoodShippingGroupType, getDeleteItemsFromOrderPricingOp, getFirstShippingGroup, getGiftlistManager, getOrderManager, getPipelineManager, getRepriceOrderChainId, getShippingGroupForItem, getShippingGroupManager, getTransactionManager, increaseRelationshipQuantity, isAddItemToDefaultShippingGroup, isTransactionMarkedAsRollBack, moveItemBetweenShippingGroups, postAddItemsToOrder, postDeleteItem, postDeleteItem, processGiftAddition, processPipelineErrors, removeEntireRelationshipQuantity, removeItemQuantityFromShippingGroup, runProcess, runProcess, runProcess, runProcessAddItemToOrder, runProcessRepriceOrder, runProcessSendScenarioEvent, runProcessSendScenarioEvent, runProcessSendScenarioEvent, runRepricingProcess, setAddItemToDefaultShippingGroup, setAddItemToOrderChainId, setAddItemToOrderPricingOp, setCommerceItemManager, setCommerceItemProperties, setDefaultHardgoodShippingGroupType, setDeleteItemsFromOrderPricingOp, setGiftlistManager, setOrderAmountToPaymentGroup, setOrderManager, setPipelineManager, setRepriceOrderChainId, setShippingGroupManager, setTransactionManager
 
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, 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

MSG_ERROR_MODIFYING_ORDER

public static final java.lang.String MSG_ERROR_MODIFYING_ORDER
Error modifying order message resource key.

See Also:
Constant Field Values

MSG_ERROR_ADDING_TO_GIFTLIST

public static final java.lang.String MSG_ERROR_ADDING_TO_GIFTLIST
Error adding to giftlist message resource key.

See Also:
Constant Field Values

MSG_NO_ITEMS_SELECT

public static final java.lang.String MSG_NO_ITEMS_SELECT
No items selected message resource key.

See Also:
Constant Field Values

MSG_INVALID_ITEMS

public static final java.lang.String MSG_INVALID_ITEMS
Invalid items message resource key.

See Also:
Constant Field Values

MSG_INVALID_RECIPIENT_EMAIL

public static final java.lang.String MSG_INVALID_RECIPIENT_EMAIL
Invalid recipient e-mail address resource key.

See Also:
Constant Field Values

MSG_INVALID_SENDER_EMAIL

public static final java.lang.String MSG_INVALID_SENDER_EMAIL
Invalid sender e-mail address.

See Also:
Constant Field Values

mProfileTools

protected atg.userprofiling.ProfileTools mProfileTools
property: profileTools

Constructor Detail

StoreCartProcessHelper

public StoreCartProcessHelper()
Method Detail

getProfileTools

public atg.userprofiling.ProfileTools getProfileTools()
Returns:
the profile tools.

setProfileTools

public void setProfileTools(atg.userprofiling.ProfileTools pProfileTools)
Parameters:
pProfileTools - - the profile tools to set.

setProfilePropertyManager

public void setProfilePropertyManager(atg.userprofiling.PropertyManager pProfilePropertyManager)
Parameters:
pProfilePropertyManager - - the property manager for profiles, used to see if the user is logged in.

getProfilePropertyManager

public atg.userprofiling.PropertyManager getProfilePropertyManager()
Returns:
profile property manager.

addItemsToGiftlist

public java.lang.String addItemsToGiftlist(java.lang.String pGiftlistId,
                                           atg.commerce.order.purchase.AddCommerceItemInfo[] pItems,
                                           atg.commerce.gifts.GiftlistManager pGiftlistManager)
                                    throws javax.servlet.ServletException,
                                           java.io.IOException,
                                           atg.commerce.CommerceException

Adds the given item(s) to the selected gift list.


This method uses the AddCommerceItemInfo items to determine which SKUs and quantities to add to the gift list.

Parameters:
pGiftlistId - - A String value.
pItems - - The items to add to the gift list, a AddCommerceItemInfo[] value.
pGiftlistManager - - The gift list manager, a GiftlistManager value.
Returns:
null if item was selected. Otherwise - no items selected message resource key.
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 - indicates that a severe error occurred while performing a commerce operation.

areItemsInCatalog

public boolean areItemsInCatalog(atg.commerce.order.Order pOrder)
Check if all items on the order are in the catalog.

Parameters:
pOrder - - the Order to process.
pOrderManager - - the order manager object.
Returns:
true - id items are in catalog, otherwise false.

getSecurityStatus

public int getSecurityStatus(atg.repository.RepositoryItem pProfile)
Get the current security status from the provided profile.

Parameters:
pProfile - - the profile to get the security status of.
Returns:
Profile's security status as a int value.

isGiftWrapAddedOrRemoved

public boolean isGiftWrapAddedOrRemoved(StoreOrderImpl pOrder,
                                        boolean pGiftWrapSelected)
Check to see if gift-wrap has been added or removed from the order.

Parameters:
pOrder - - the Order to process.
pGiftWrapSelected - - value for whether or not gift-wrap is selected, a boolean value.
Returns:
true if gift-wrap has been added or removed from the order, a boolean value.

isAllGiftWrap

public boolean isAllGiftWrap(StoreOrderImpl pOrder)
Check to see if the order contains only gift wrap items.

Parameters:
pOrder - - An Order value.
Returns:
true if all items on the order are gift-wrapped, a boolean value.

isAuthorizedUser

public boolean isAuthorizedUser(atg.repository.RepositoryItem pProfile)
Check the security status of the profile to see if the user is authorized.

Parameters:
pProfile - - the profile to be checked.
Returns:
true if the profile is logged in, a boolean value.

isLoginUser

public boolean isLoginUser(atg.repository.RepositoryItem pProfile)
Check the security status of the profile to see if the user is logged in.

Parameters:
pProfile - - the profile to be checked.
Returns:
true if the profile is logged in, a boolean value.

rollbackTransaction

public void rollbackTransaction(javax.transaction.TransactionManager pTransactionManager)
Rollback the provided transaction.

Parameters:
pTransactionManager - - Transaction Manager containing the transaction to roll-back,

addRemoveGiftServices

public void addRemoveGiftServices(StoreOrderImpl pStoreOrder,
                                  boolean pAddGiftWrap,
                                  boolean pAddGiftMessage,
                                  java.lang.String pGiftWrapSkuId,
                                  java.lang.String pGiftWrapProductId)
                           throws atg.commerce.CommerceException
This method can be used by form handlers to add / remove gift message or gift-wrap from the order.

Parameters:
pStoreOrder - - the order.
pAddGiftWrap - - boolean value indicating whether or not to add gift wrap.
pAddGiftMessage - - boolean value indicating whether or not to add gift message.
pGiftWrapSkuId - - String value indicating Sku Id of the gift wrapped.
pGiftWrapProductId - - String value indicating Product Id of the gift wrapped.
Throws:
atg.commerce.CommerceException