atg.commerce.order.purchase
Class PurchaseProcessFormHandler

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
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:
CancelOrderFormHandler, CartModifierFormHandler, CommitOrderFormHandler, CostCenterFormHandler, CreateCreditCardFormHandler, ExpressCheckoutFormHandler, PaymentGroupFormHandler, SaveOrderFormHandler, ShippingGroupFormHandler, UpdateShippingGroupFormHandler

public abstract class PurchaseProcessFormHandler
extends GenericFormHandler
implements atg.commerce.util.PipelineErrorHandler

This abstract class defines the very general FormHandling functionality that the purchase process formhandlers require, including Transaction management, PipelineChain execution, central configuration, and error processing.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected static java.lang.String LOCK_NAME_ATTRIBUTE_NAME
           
protected static java.lang.String PARAM_TRANSACTION_CREATED
           
protected static java.lang.String 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
PurchaseProcessFormHandler()
           
 
Method Summary
protected  void acquireTransactionLock()
          Deprecated. please use acquireTransactionLock(DynamoHttpServletRequest pRequest) instead
protected  void acquireTransactionLock(DynamoHttpServletRequest pRequest)
          Attempt to acquire a local lock before creating a transaction that may modify the order, but only if useLocksAroundTransactions is set to true.
 boolean afterSet(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called after any setX methods on this form are set when a form that modifies properties of this form handler is submitted.
 boolean beforeSet(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called before any setX methods on this form are set when a form that modifies properties of this form handler is submitted.
 boolean checkFormRedirect(java.lang.String pSuccessURL, java.lang.String pFailureURL, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          If the request coming in is for a new session (which would indicate that the session has expired or been failed over) AND is a form submission then we optionally redirect to a session expiration url.
protected  void commitTransaction(javax.transaction.Transaction pTransaction)
          Commits the supplied transaction
protected  void copyConfiguration()
          Copy property settings from the optional PurchaseProcessConfiguration component.
protected  java.util.Map createRepriceParameterMap()
          Creates the extra parameter map that is used when the order is repriced after form handler modifications to the order.
protected  ClientLockManager defaultLocalLockManager(boolean pSetLocalLockManager)
          Deprecated. Use the TransactionLockFactory instead
protected  RepositoryItem defaultUserProfile(boolean pSetProfile)
          Get the default user profile to use if profile has not been set.
 void doStartService()
          Perform one-time startup operations, including copying property settings from the optional PurchaseProcessConfiguration component.
protected  javax.transaction.Transaction ensureTransaction()
          This method ensures that a transaction exists before returning.
 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.
 java.lang.String generatePropertyPath(java.lang.String pPropertyName)
          Returns a Nucleus property path which can be used in a DropletFormException
 ClaimableManager getClaimableManager()
          Returns the ClaimableManager is used in determining the user's GiftCertificates.
 CommerceIdentifierPaymentInfoContainer getCommerceIdentifierPaymentInfoContainer()
          Return the CommerceIdentifierPaymentInfoContainer property.
 CommerceItemManager getCommerceItemManager()
          Return the CommerceItemManager property.
 CommerceItemShippingInfoContainer getCommerceItemShippingInfoContainer()
          Return the CommerceItemShippingInfoContainer property.
 CommerceProfileTools getCommerceProfileTools()
          Return the CommerceProfileTools property.
 CommercePropertyManager getCommercePropertyManager()
          Return the CommercePropertyManager property.
 PurchaseProcessConfiguration getConfiguration()
          Returns property Configuration
 javax.transaction.Transaction getCurrentTransaction()
          Returns property currentTransaction
 java.util.Locale getDefaultLocale()
          Returns property DefaultLocale.
 GiftlistManager getGiftlistManager()
          The giftlist manager
 HandlingInstructionManager getHandlingInstructionManager()
          The HandlingInstruction manager
 ClientLockManager getLocalLockManager()
          Deprecated. Use the TransactionLockFactory instead
 Order getOrder()
          Return the Order property.
 SimpleOrderManager getOrderManager()
          Return the OrderManager property.
 PaymentGroupManager getPaymentGroupManager()
          Return the PaymentGroupManager property.
 PaymentGroupMapContainer getPaymentGroupMapContainer()
          Return the PaymentGroupMapContainer property.
 PipelineManager getPipelineManager()
          Returns property PipelineManager
protected  RepositoryItem getPriceList()
          Returns the price list identified by the priceListId
 java.lang.String getPriceListId()
          Returns property PriceListId
 PriceListManager getPriceListManager()
          Returns the Price List Manager
 RepositoryItem getProfile()
          Return the Profile property.
 Repository getProfileRepository()
          Return the ProfileRepository property.
 PurchaseProcessHelper getPurchaseProcessHelper()
          Returns property purchaseProcessHelper
 RepeatingRequestMonitor getRepeatingRequestMonitor()
          Return the RepeatingRequestMonitor property.
 java.lang.String getRepriceOrderChainId()
          Return the RepriceOrderChainId property.
protected  java.util.ResourceBundle getResourceBundle()
          Returns the error message ResourceBundle
protected  java.util.ResourceBundle getResourceBundle(java.util.Locale pLocale)
          This method returns ResourceBundle object for specified locale.
protected  java.lang.String getResourceBundleName()
          Returns the name of the error message ResourceBundle
 java.lang.String getSessionExpirationURL()
          Return the SessionExpirationURL property.
 ShippingGroupManager getShippingGroupManager()
          Return the ShippingGroupManager property.
 ShippingGroupMapContainer getShippingGroupMapContainer()
          Return the ShippingGroupMapContainer property.
 OrderHolder getShoppingCart()
          Returns property ShoppingCart
 javax.transaction.TransactionManager getTransactionManager()
          Returns property TransactionManager
 java.util.Locale getUserLocale()
          Return the UserLocale property.
 java.util.Locale getUserLocale(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Returns the locale associated with the request.
 PricingModelHolder getUserPricingModels()
          Returns property UserPricingModels
 void handlePipelineError(java.lang.Object pError, java.lang.String pErrorKey)
          Add a pipeline error to the list of form exceptions.
 boolean isEnsureTransaction()
          Returns property EnsureTransaction
 boolean isFormSubmission(DynamoHttpServletRequest pRequest)
          If it is a form submission then return true.
protected  boolean isTransactionCreated(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
           
protected  boolean isTransactionMarkedAsRollBack()
          Returns true if the transaction associated with the current thread is marked for rollback.
 boolean isUseLocksAroundTransactions()
          Deprecated. Use the TransactionLockFactory instead
 boolean isUseRequestLocale()
          Returns property UseRequestLocale
 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 DropletFormExceptions and adds them as form exceptions
protected  void releaseTransactionLock()
          Deprecated. please use releaseTransactionLock(DynamoHttpServletRequest pRequest) instead
protected  void releaseTransactionLock(DynamoHttpServletRequest pRequest)
          Attempt to release the local lock that was acquired before creating a transaction that may have modified the order, but only if useLocksAroundTransactions is set to true.
protected  PipelineResult runProcess(java.lang.String pChainId, java.util.Map pParameters)
          Executes a Pipeline Chain.
protected  PipelineResult runProcess(java.lang.String pChainId, Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters)
          Executes a Pipeline Chain and places the supplies method parameters into a HashMap which is supplied to the chain to execute.
protected  PipelineResult runProcess(java.lang.String pChainId, Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pParameters, java.util.Map pExtraParameters)
          Executes a Pipeline Chain and places the supplies method parameters into a HashMap which is supplied to the chain to execute.
protected  void runProcessRepriceOrder(Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters)
          Run the pipeline which should be executed when the order needs to be repriced.
protected  void runProcessRepriceOrder(java.lang.String pPricingOperation, Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters)
          Run the pipeline which should be executed when the order needs to be repriced
protected  PipelineResult runRepricingProcess(java.lang.String pChainId, java.lang.String pPricingOperation, Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters)
          Executes a Pipeline Chain and places the supplies method parameters into a HashMap which is supplied to the chain to execute.
 void setClaimableManager(ClaimableManager pClaimableManager)
          Specifies the ClaimableManager to use in determining the user's GiftCertificates.
 void setCommerceIdentifierPaymentInfoContainer(CommerceIdentifierPaymentInfoContainer pCommerceIdentifierPaymentInfoContainer)
          Set the CommerceIdentifierPaymentInfoContainer property.
 void setCommerceItemManager(CommerceItemManager pCommerceItemManager)
          Set the CommerceItemManager property.
 void setCommerceItemShippingInfoContainer(CommerceItemShippingInfoContainer pCommerceItemShippingInfoContainer)
          Set the CommerceItemShippingInfoContainer property.
 void setCommerceProfileTools(CommerceProfileTools pCommerceProfileTools)
          Set the CommerceProfileTools property.
 void setCommercePropertyManager(CommercePropertyManager pCommercePropertyManager)
          Set the CommercePropertyManager property.
 void setConfiguration(PurchaseProcessConfiguration pConfiguration)
          Sets property Configuration
 void setCurrentTransaction(javax.transaction.Transaction pCurrentTransaction)
          Sets property CurrentTransaction
 void setDefaultLocale(java.util.Locale pDefaultLocale)
          Sets property DefaultLocale
 void setEnsureTransaction(boolean pEnsureTransaction)
          Sets property EnsureTransaction
 void setGiftlistManager(GiftlistManager pGiftlistManager)
          Specifies the GiftlistManager.
 void setHandlingInstructionManager(HandlingInstructionManager pHandlingInstructionManager)
          Specifies the HandlingInstructionManager.
 void setLocalLockManager(ClientLockManager pLocalLockManager)
          Deprecated. Use the TransactionLockFactory instead
 void setOrder(Order pOrder)
          Set the Order property.
 void setOrderManager(SimpleOrderManager pOrderManager)
          Set the OrderManager property.
 void setPaymentGroupManager(PaymentGroupManager pPaymentGroupManager)
          Set the PaymentGroupManager property.
 void setPaymentGroupMapContainer(PaymentGroupMapContainer pPaymentGroupMapContainer)
          Set the PaymentGroupMapContainer property.
 void setPipelineManager(PipelineManager pPipelineManager)
          Sets property PipelineManager
 void setPriceListId(java.lang.String pPriceListId)
          Sets property PriceListId
 void setPriceListManager(PriceListManager pPriceListManager)
          Sets the Price List Manager
 void setProfile(RepositoryItem pProfile)
          Set the Profile property.
 void setProfileRepository(Repository pProfileRepository)
          Set the ProfileRepository property.
 void setPurchaseProcessHelper(PurchaseProcessHelper pPurchaseProcessHelper)
          Sets property purchaseProcessHelper
 void setRepeatingRequestMonitor(RepeatingRequestMonitor pRepeatingRequestMonitor)
          Set the RepeatingRequestMonitor property.
 void setRepriceOrderChainId(java.lang.String pRepriceOrderChainId)
          Set the RepriceOrderChainId property.
 void setSessionExpirationURL(java.lang.String pSessionExpirationURL)
          Set the SessionExpirationURL property.
 void setShippingGroupManager(ShippingGroupManager pShippingGroupManager)
          Set the ShippingGroupManager property.
 void setShippingGroupMapContainer(ShippingGroupMapContainer pShippingGroupMapContainer)
          Set the ShippingGroupMapContainer property.
 void setShoppingCart(OrderHolder pShoppingCart)
          Sets property ShoppingCart
protected  void setTransactionCreated(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
           
 void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
          Sets property TransactionManager
protected  void setTransactionToRollbackOnly()
          Sets the transaction to rollback
 void setUseLocksAroundTransactions(boolean pUseLocksAroundTransactions)
          Deprecated. Use the TransactionLockFactory instead
 void setUseRequestLocale(boolean pUseRequestLocale)
          Sets property UseRequestLocale
 void setUserLocale(java.util.Locale pUserLocale)
          Set the UserLocale property.
 void setUserPricingModels(PricingModelHolder pUserPricingModels)
          Sets property UserPricingModels
protected  java.lang.String transactionLockName()
          Deprecated. Use the TransactionLockFactory instead
protected  void unsetTransactionCreated(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
           
 
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


PARAM_TRANSACTION_CREATED

protected static final java.lang.String PARAM_TRANSACTION_CREATED
See Also:
Constant Field Values

PARAM_VALUE_TRUE

protected static final java.lang.String PARAM_VALUE_TRUE
See Also:
Constant Field Values

LOCK_NAME_ATTRIBUTE_NAME

protected static final java.lang.String LOCK_NAME_ATTRIBUTE_NAME
See Also:
Constant Field Values
Constructor Detail

PurchaseProcessFormHandler

public PurchaseProcessFormHandler()
Method Detail

setPriceListId

public void setPriceListId(java.lang.String pPriceListId)
Sets property PriceListId

This price list will be used when repricing after add and delete of items.

Parameters:
pPriceListId - a String value

getPriceListId

public java.lang.String getPriceListId()
Returns property PriceListId

Returns:
a String value

getPriceList

protected RepositoryItem getPriceList()
Returns the price list identified by the priceListId

Returns:
price list repository item

setConfiguration

public void setConfiguration(PurchaseProcessConfiguration pConfiguration)
Sets property Configuration


getConfiguration

public PurchaseProcessConfiguration getConfiguration()
Returns property Configuration


setCommercePropertyManager

public void setCommercePropertyManager(CommercePropertyManager pCommercePropertyManager)
Set the CommercePropertyManager property.

Parameters:
pCommercePropertyManager - the Commerce profile property manager

getCommercePropertyManager

public CommercePropertyManager getCommercePropertyManager()
Return the CommercePropertyManager property.


setPriceListManager

public void setPriceListManager(PriceListManager pPriceListManager)
Sets the Price List Manager

Parameters:
pPriceListManager - the Price List Manager

getPriceListManager

public PriceListManager getPriceListManager()
Returns the Price List Manager


setDefaultLocale

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

Parameters:
pDefaultLocale - a Locale value

getDefaultLocale

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

Returns:
a Locale value

setUserLocale

public void setUserLocale(java.util.Locale pUserLocale)
Set the UserLocale property.

Parameters:
pUserLocale - a Locale value

getUserLocale

public java.util.Locale getUserLocale()
Return the UserLocale property.

Returns:
a Locale value

setUseRequestLocale

public void setUseRequestLocale(boolean pUseRequestLocale)
Sets property UseRequestLocale

Parameters:
pUseRequestLocale - a boolean value

isUseRequestLocale

public boolean isUseRequestLocale()
Returns property UseRequestLocale

Returns:
a boolean value

setRepriceOrderChainId

public void setRepriceOrderChainId(java.lang.String pRepriceOrderChainId)
Set the RepriceOrderChainId property.

Parameters:
pRepriceOrderChainId - a String value

getRepriceOrderChainId

public java.lang.String getRepriceOrderChainId()
Return the RepriceOrderChainId property.

Returns:
a String value

setUseLocksAroundTransactions

public void setUseLocksAroundTransactions(boolean pUseLocksAroundTransactions)
Deprecated. Use the TransactionLockFactory instead

Specify whether to use a local lock manager to obtain a lock before starting transactions in beforeSet and to release the lock after committing transacations in afterSet.

If this property is set to true, locking will be used to prevent one user from trying to modify orders in multiple concurrent threads. This has a small performance impact as we obtain and release the lock, but minimizes the possibility of concurrent update exceptions if two threads try to modify the same order for the same user. The default value for useLocksAroundTransactions is true.


isUseLocksAroundTransactions

public boolean isUseLocksAroundTransactions()
Deprecated. Use the TransactionLockFactory instead

Inquire whether to use a local lock manager to obtain a lock before starting transactions in beforeSet, and to release the lock after committing transactions in afterSet.


setLocalLockManager

public void setLocalLockManager(ClientLockManager pLocalLockManager)
Deprecated. Use the TransactionLockFactory instead

Specify the lock manager to use if useLocksAroundTransactions is true.

See Also:
setUseLocksAroundTransactions(boolean)

getLocalLockManager

public ClientLockManager getLocalLockManager()
Deprecated. Use the TransactionLockFactory instead

Return the lock manager to use if useLocksAroundTransactions is true.

See Also:
setUseLocksAroundTransactions(boolean)

defaultLocalLockManager

protected ClientLockManager defaultLocalLockManager(boolean pSetLocalLockManager)
Deprecated. Use the TransactionLockFactory instead

Get the default local lock manager to use if localLockManager has not been set. If pSetLocalLockManager is true, then also set localLockManager to the value returned so future calls to getLocalLockManager will succeed.


setProfile

public void setProfile(RepositoryItem pProfile)
Set the Profile property.

Parameters:
pProfile - a RepositoryItem value

getProfile

public RepositoryItem getProfile()
Return the Profile property.

Returns:
a RepositoryItem value

defaultUserProfile

protected RepositoryItem defaultUserProfile(boolean pSetProfile)
Get the default user profile to use if profile has not been set. If pSetProfile is true, then also set profile to the value returned so future calls to getProfile will succeed.


setProfileRepository

public void setProfileRepository(Repository pProfileRepository)
Set the ProfileRepository property.

Parameters:
pProfileRepository - a Repository value

getProfileRepository

public Repository getProfileRepository()
Return the ProfileRepository property.

Returns:
a Repository value

setCommerceProfileTools

public void setCommerceProfileTools(CommerceProfileTools pCommerceProfileTools)
Set the CommerceProfileTools property.

Parameters:
pCommerceProfileTools - a CommerceProfileTools value

getCommerceProfileTools

public CommerceProfileTools getCommerceProfileTools()
Return the CommerceProfileTools property.

Returns:
a CommerceProfileTools value

setOrder

public void setOrder(Order pOrder)
Set the Order property.

Parameters:
pOrder - an Order value

getOrder

public Order getOrder()
Return the Order property.

Returns:
an Order value

setShoppingCart

public void setShoppingCart(OrderHolder pShoppingCart)
Sets property ShoppingCart

Parameters:
pShoppingCart - an OrderHolder value

getShoppingCart

public OrderHolder getShoppingCart()
Returns property ShoppingCart

Returns:
an OrderHolder value

setCommerceItemManager

public void setCommerceItemManager(CommerceItemManager pCommerceItemManager)
Set the CommerceItemManager property.

Parameters:
pCommerceItemManager - a CommerceItemManager value

getCommerceItemManager

public CommerceItemManager getCommerceItemManager()
Return the CommerceItemManager property.

Returns:
a CommerceItemManager value

setOrderManager

public void setOrderManager(SimpleOrderManager pOrderManager)
Set the OrderManager property.

Parameters:
pOrderManager - a SimpleOrderManager value

getOrderManager

public SimpleOrderManager getOrderManager()
Return the OrderManager property.

Returns:
a SimpleOrderManager value

setCommerceIdentifierPaymentInfoContainer

public void setCommerceIdentifierPaymentInfoContainer(CommerceIdentifierPaymentInfoContainer pCommerceIdentifierPaymentInfoContainer)
Set the CommerceIdentifierPaymentInfoContainer property.

Parameters:
pCommerceIdentifierPaymentInfoContainer - a CommerceIdentifierPaymentInfoContainer value

getCommerceIdentifierPaymentInfoContainer

public CommerceIdentifierPaymentInfoContainer getCommerceIdentifierPaymentInfoContainer()
Return the CommerceIdentifierPaymentInfoContainer property.

Returns:
a CommerceIdentifierPaymentInfoContainer value

setPaymentGroupManager

public void setPaymentGroupManager(PaymentGroupManager pPaymentGroupManager)
Set the PaymentGroupManager property.

Parameters:
pPaymentGroupManager - a PaymentGroupManager value

getPaymentGroupManager

public PaymentGroupManager getPaymentGroupManager()
Return the PaymentGroupManager property.

Returns:
a PaymentGroupManager value

setPaymentGroupMapContainer

public void setPaymentGroupMapContainer(PaymentGroupMapContainer pPaymentGroupMapContainer)
Set the PaymentGroupMapContainer property.

Parameters:
pPaymentGroupMapContainer - a PaymentGroupMapContainer value

getPaymentGroupMapContainer

public PaymentGroupMapContainer getPaymentGroupMapContainer()
Return the PaymentGroupMapContainer property.

Returns:
a PaymentGroupMapContainer value

setPipelineManager

public void setPipelineManager(PipelineManager pPipelineManager)
Sets property PipelineManager

Parameters:
pPipelineManager - a PipelineManager value

getPipelineManager

public PipelineManager getPipelineManager()
Returns property PipelineManager

Returns:
a PipelineManager value

getCurrentTransaction

public javax.transaction.Transaction getCurrentTransaction()
Returns property currentTransaction

Returns:
returns property currentTransaction

setCurrentTransaction

public void setCurrentTransaction(javax.transaction.Transaction pCurrentTransaction)
Sets property CurrentTransaction

Parameters:
pCurrentTransaction - a Transaction value

setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Sets property TransactionManager

Parameters:
pTransactionManager - a TransactionManager value

getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()
Returns property TransactionManager

Returns:
a TransactionManager value

setEnsureTransaction

public void setEnsureTransaction(boolean pEnsureTransaction)
Sets property EnsureTransaction

Parameters:
pEnsureTransaction - a boolean value

isEnsureTransaction

public boolean isEnsureTransaction()
Returns property EnsureTransaction

Returns:
a boolean value

setClaimableManager

public void setClaimableManager(ClaimableManager pClaimableManager)
Specifies the ClaimableManager to use in determining the user's GiftCertificates.

Parameters:
pClaimableManager - a ClaimableManager value

getClaimableManager

public ClaimableManager getClaimableManager()
Returns the ClaimableManager is used in determining the user's GiftCertificates.

Returns:
a ClaimableManager value

setGiftlistManager

public void setGiftlistManager(GiftlistManager pGiftlistManager)
Specifies the GiftlistManager.

Parameters:
pGiftlistManager - a GiftlistManager value

getGiftlistManager

public GiftlistManager getGiftlistManager()
The giftlist manager

Returns:
a GiftlistManager value

setHandlingInstructionManager

public void setHandlingInstructionManager(HandlingInstructionManager pHandlingInstructionManager)
Specifies the HandlingInstructionManager.

Parameters:
pHandlingInstructionManager - a HandlingInstructionManager value

getHandlingInstructionManager

public HandlingInstructionManager getHandlingInstructionManager()
The HandlingInstruction manager

Returns:
a HandlingInstructionManager value

setShippingGroupManager

public void setShippingGroupManager(ShippingGroupManager pShippingGroupManager)
Set the ShippingGroupManager property.

Parameters:
pShippingGroupManager - a ShippingGroupManager value

getShippingGroupManager

public ShippingGroupManager getShippingGroupManager()
Return the ShippingGroupManager property.

Returns:
a ShippingGroupManager value

setCommerceItemShippingInfoContainer

public void setCommerceItemShippingInfoContainer(CommerceItemShippingInfoContainer pCommerceItemShippingInfoContainer)
Set the CommerceItemShippingInfoContainer property.

Parameters:
pCommerceItemShippingInfoContainer - a CommerceItemShippingInfoContainer value

getCommerceItemShippingInfoContainer

public CommerceItemShippingInfoContainer getCommerceItemShippingInfoContainer()
Return the CommerceItemShippingInfoContainer property.

Returns:
a CommerceItemShippingInfoContainer value

setShippingGroupMapContainer

public void setShippingGroupMapContainer(ShippingGroupMapContainer pShippingGroupMapContainer)
Set the ShippingGroupMapContainer property.

Parameters:
pShippingGroupMapContainer - a ShippingGroupMapContainer value

getShippingGroupMapContainer

public ShippingGroupMapContainer getShippingGroupMapContainer()
Return the ShippingGroupMapContainer property.

Returns:
a ShippingGroupMapContainer value

setRepeatingRequestMonitor

public void setRepeatingRequestMonitor(RepeatingRequestMonitor pRepeatingRequestMonitor)
Set the RepeatingRequestMonitor property.

Parameters:
pRepeatingRequestMonitor - a RepeatingRequestMonitor value

getRepeatingRequestMonitor

public RepeatingRequestMonitor getRepeatingRequestMonitor()
Return the RepeatingRequestMonitor property.

Returns:
a RepeatingRequestMonitor value

setSessionExpirationURL

public void setSessionExpirationURL(java.lang.String pSessionExpirationURL)
Set the SessionExpirationURL property.

Parameters:
pSessionExpirationURL - a String value

getSessionExpirationURL

public java.lang.String getSessionExpirationURL()
Return the SessionExpirationURL property.

Returns:
a String value

setUserPricingModels

public void setUserPricingModels(PricingModelHolder pUserPricingModels)
Sets property UserPricingModels

Parameters:
pUserPricingModels - a PricingModelHolder value

getUserPricingModels

public PricingModelHolder getUserPricingModels()
Returns property UserPricingModels

Returns:
a PricingModelHolder value

setPurchaseProcessHelper

public void setPurchaseProcessHelper(PurchaseProcessHelper pPurchaseProcessHelper)
Sets property purchaseProcessHelper

Parameters:
pPurchaseProcessHelper - a PurchaseProcessHelper value

getPurchaseProcessHelper

public PurchaseProcessHelper getPurchaseProcessHelper()
Returns property purchaseProcessHelper

Returns:
a PurchaseProcessHelper value

getResourceBundle

protected java.util.ResourceBundle getResourceBundle()
Returns the error message ResourceBundle


getResourceBundle

protected java.util.ResourceBundle getResourceBundle(java.util.Locale pLocale)
This method returns ResourceBundle object for specified locale.

Parameters:
pLocale - The locale used to retrieve the resource bundle. If null then the default resource bundle is returned.
Returns:
the resource bundle.

getResourceBundleName

protected java.lang.String getResourceBundleName()
Returns the name of the error message ResourceBundle


checkFormRedirect

public boolean checkFormRedirect(java.lang.String pSuccessURL,
                                 java.lang.String pFailureURL,
                                 DynamoHttpServletRequest pRequest,
                                 DynamoHttpServletResponse pResponse)
                          throws javax.servlet.ServletException,
                                 java.io.IOException
If the request coming in is for a new session (which would indicate that the session has expired or been failed over) AND is a form submission then we optionally redirect to a session expiration url. If the transaction is marked as rollback, then redirect to the FailureURL, otherwise allow the super-class behavior to perform.

Overrides:
checkFormRedirect in class GenericFormHandler
Parameters:
pSuccessURL - a String value
pFailureURL - a String value
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
If redirect (for whatever reason) to a new page occurred, return false. If NO redirect occurred, return true.
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

isFormSubmission

public boolean isFormSubmission(DynamoHttpServletRequest pRequest)
If it is a form submission then return true.

Parameters:
pRequest - a DynamoHttpServletRequest value
Returns:
a boolean value

generatePropertyPath

public java.lang.String generatePropertyPath(java.lang.String pPropertyName)
Returns a Nucleus property path which can be used in a DropletFormException

Parameters:
pPropertyName - a String value
Returns:
a String value

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 - an Exception value
pMsgId - a String value
pRequest - a DynamoHttpServletRequest value
pResponse - a DynamoHttpServletResponse value
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

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 - a DynamoHttpServletRequest value
pResponse - a DynamoHttpServletResponse value
Returns:
a Locale value
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

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 - a DynamoHttpServletResponse value
Returns:
the formatted message
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs
See Also:
PurchaseUserMessage

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 - a DynamoHttpServletRequest value
pResponse - a DynamoHttpServletResponse value
Returns:
the formatted message
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs
See Also:
PurchaseUserMessage

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 - a DynamoHttpServletRequest value
pResponse - a DynamoHttpServletResponse value
Returns:
the formatted message
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs
See Also:
PurchaseUserMessage

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 - a DynamoHttpServletRequest value
pResponse - a DynamoHttpServletResponse value
Returns:
the formatted message
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs
See Also:
PurchaseUserMessage

runProcess

protected PipelineResult runProcess(java.lang.String pChainId,
                                    Order pOrder,
                                    PricingModelHolder pPricingModels,
                                    java.util.Locale pLocale,
                                    RepositoryItem pProfile,
                                    java.util.Map pExtraParameters)
                             throws RunProcessException
Executes a Pipeline Chain and places the supplies method parameters into a HashMap which is supplied to the chain to execute.

Parameters:
pChainId - the pipeline chain to execute
pOrder - the order to reprice
pPricingModels - the set of all pricing models for the user (item, order, shipping, tax)
pLocale - the locale that the order should be priced within
pProfile - the user who owns the order
pExtraParameters - A Map of extra parameters to be used in the pricing
Returns:
a PipelineResult value
Throws:
RunProcessException - if an error occurs

runProcess

protected PipelineResult runProcess(java.lang.String pChainId,
                                    Order pOrder,
                                    PricingModelHolder pPricingModels,
                                    java.util.Locale pLocale,
                                    RepositoryItem pProfile,
                                    java.util.Map pParameters,
                                    java.util.Map pExtraParameters)
                             throws RunProcessException
Executes a Pipeline Chain and places the supplies method parameters into a HashMap which is supplied to the chain to execute.

Parameters:
pChainId - the pipeline chain to execute
pOrder - the order to reprice
pPricingModels - the set of all pricing models for the user (item, order, shipping, tax)
pLocale - the locale that the order should be priced within
pProfile - the user who owns the order
pParameters - A Map of parameters to be used when calling the PipelineChain
pExtraParameters - A Map of extra parameters to be used in the pricing
Returns:
a PipelineResult value
Throws:
RunProcessException - if an error occurs

runProcess

protected PipelineResult runProcess(java.lang.String pChainId,
                                    java.util.Map pParameters)
                             throws RunProcessException
Executes a Pipeline Chain.

Parameters:
pChainId - the pipeline chain to execute
pParameters - A Map of parameters to be passed to the chain during execution
Returns:
a PipelineResult value
Throws:
RunProcessException - if an error occurs

processPipelineErrors

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

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

runProcessRepriceOrder

protected void runProcessRepriceOrder(Order pOrder,
                                      PricingModelHolder pPricingModels,
                                      java.util.Locale pLocale,
                                      RepositoryItem pProfile,
                                      java.util.Map pExtraParameters)
                               throws RunProcessException
Run the pipeline which should be executed when the order needs to be repriced. This method call defaults to the the pricing operation ORDER_TOTAL.

Parameters:
pOrder - the order to reprice
pPricingModels - the set of all pricing models for the user (item, order, shipping, tax)
pLocale - the locale that the order should be priced within
pProfile - the user who owns the order
pExtraParameters - A Map of extra parameters to be used in the pricing
Throws:
RunProcessException - if an error occurs
See Also:
PricingConstants.OP_REPRICE_ORDER_TOTAL

runProcessRepriceOrder

protected void runProcessRepriceOrder(java.lang.String pPricingOperation,
                                      Order pOrder,
                                      PricingModelHolder pPricingModels,
                                      java.util.Locale pLocale,
                                      RepositoryItem pProfile,
                                      java.util.Map pExtraParameters)
                               throws RunProcessException
Run the pipeline which should be executed when the order needs to be repriced

Parameters:
pPricingOperation - the pricing operation (e.g. order total, subtotal, shipping, etc) that should be performed.
pOrder - the order to reprice
pPricingModels - the set of all pricing models for the user (item, order, shipping, tax)
pLocale - the locale that the order should be priced within
pProfile - the user who owns the order
pExtraParameters - A Map of extra parameters to be used in the pricing
Throws:
RunProcessException - if an error occurs

runRepricingProcess

protected PipelineResult runRepricingProcess(java.lang.String pChainId,
                                             java.lang.String pPricingOperation,
                                             Order pOrder,
                                             PricingModelHolder pPricingModels,
                                             java.util.Locale pLocale,
                                             RepositoryItem pProfile,
                                             java.util.Map pExtraParameters)
                                      throws RunProcessException
Executes a Pipeline Chain and places the supplies method parameters into a HashMap which is supplied to the chain to execute.

Parameters:
pChainId - the pipeline chain to execute
pPricingOperation - a String value
pOrder - the order to reprice
pPricingModels - the set of all pricing models for the user (item, order, shipping, tax)
pLocale - the locale that the order should be priced within
pProfile - the user who owns the order
pExtraParameters - A Map of extra parameters to be used in the pricing
Returns:
a PipelineResult value
Throws:
RunProcessException - if an error occurs

ensureTransaction

protected javax.transaction.Transaction ensureTransaction()
This method ensures that a transaction exists before returning. If there is no transaction, a new one is started and returned. In this case, you must call commitTransaction when the transaction completes.

Returns:
a Transaction value

commitTransaction

protected void commitTransaction(javax.transaction.Transaction pTransaction)
Commits the supplied transaction

Parameters:
pTransaction - a Transaction value

setTransactionToRollbackOnly

protected void setTransactionToRollbackOnly()
                                     throws javax.transaction.SystemException
Sets the transaction to rollback

Throws:
javax.transaction.SystemException - if an error occurs

isTransactionMarkedAsRollBack

protected boolean isTransactionMarkedAsRollBack()
Returns true if the transaction associated with the current thread is marked for rollback. This is useful if you do not want to perform some action (e.g. updating the order) if some other subservice already needs the transaction rolledback.

Returns:
a boolean value

acquireTransactionLock

protected void acquireTransactionLock()
                               throws DeadlockException
Deprecated. please use acquireTransactionLock(DynamoHttpServletRequest pRequest) instead

Attempt to acquire a local lock before creating a transaction that may modify the order, but only if useLocksAroundTransactions is set to true.

Throws:
DeadlockException

acquireTransactionLock

protected void acquireTransactionLock(DynamoHttpServletRequest pRequest)
                               throws DeadlockException
Attempt to acquire a local lock before creating a transaction that may modify the order, but only if useLocksAroundTransactions is set to true.

Throws:
DeadlockException

releaseTransactionLock

protected void releaseTransactionLock()
                               throws LockManagerException
Deprecated. please use releaseTransactionLock(DynamoHttpServletRequest pRequest) instead

Attempt to release the local lock that was acquired before creating a transaction that may have modified the order, but only if useLocksAroundTransactions is set to true.

Throws:
LockManagerException

releaseTransactionLock

protected void releaseTransactionLock(DynamoHttpServletRequest pRequest)
                               throws LockManagerException
Attempt to release the local lock that was acquired before creating a transaction that may have modified the order, but only if useLocksAroundTransactions is set to true.

Throws:
LockManagerException

transactionLockName

protected java.lang.String transactionLockName()
Deprecated. Use the TransactionLockFactory instead

Generate the lock name to use when acquiring and releasing locks in acquireTransactionLock and releaseTransactionLock. By default this returns the repository id of the current user profile, generating an error message and returning null if no profile is available. Subclasses may override this behavior to choose a different locking strategy.

Returns:
The lock name to use when acquiring and releasing locks, or null if no lock name is available. In this case locking will be disabled for the current form submission.

beforeSet

public boolean beforeSet(DynamoHttpServletRequest pRequest,
                         DynamoHttpServletResponse pResponse)
                  throws DropletFormException
Called before any setX methods on this form are set when a form that modifies properties of this form handler is submitted. Creates a transaction if necessary at the beginning of the form submission process, optionally obtaining a local lock to prevent multiple forms from creating transactions that may modify the same order.

Specified by:
beforeSet in interface DropletFormHandler
Overrides:
beforeSet in class GenericFormHandler
Parameters:
pRequest - a DynamoHttpServletRequest value
pResponse - a DynamoHttpServletResponse value
Returns:
a boolean value
Throws:
DropletFormException - if an error occurs
See Also:
afterSet(atg.servlet.DynamoHttpServletRequest, atg.servlet.DynamoHttpServletResponse), ensureTransaction(), setUseLocksAroundTransactions(boolean)

afterSet

public boolean afterSet(DynamoHttpServletRequest pRequest,
                        DynamoHttpServletResponse pResponse)
                 throws DropletFormException
Called after any setX methods on this form are set when a form that modifies properties of this form handler is submitted. Commits or rolls back any transaction created in beforeSet, and releases any lock that was acquired at the time.

Specified by:
afterSet in interface DropletFormHandler
Overrides:
afterSet in class GenericFormHandler
Parameters:
pRequest - a DynamoHttpServletRequest value
pResponse - a DynamoHttpServletResponse value
Returns:
a boolean value
Throws:
DropletFormException - if an error occurs
See Also:
beforeSet(atg.servlet.DynamoHttpServletRequest, atg.servlet.DynamoHttpServletResponse), ensureTransaction(), setUseLocksAroundTransactions(boolean)

setTransactionCreated

protected void setTransactionCreated(DynamoHttpServletRequest pRequest,
                                     DynamoHttpServletResponse pResponse)

isTransactionCreated

protected boolean isTransactionCreated(DynamoHttpServletRequest pRequest,
                                       DynamoHttpServletResponse pResponse)

unsetTransactionCreated

protected void unsetTransactionCreated(DynamoHttpServletRequest pRequest,
                                       DynamoHttpServletResponse pResponse)

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.

createRepriceParameterMap

protected java.util.Map createRepriceParameterMap()
Creates the extra parameter map that is used when the order is repriced after form handler modifications to the order.

Returns:
Map of parameters or null

copyConfiguration

protected void copyConfiguration()
Copy property settings from the optional PurchaseProcessConfiguration component. Property values that were configured locally are preserved. Configures the following properties (if not already set):


doStartService

public void doStartService()
                    throws ServiceException
Perform one-time startup operations, including copying property settings from the optional PurchaseProcessConfiguration component.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the Service had a problem starting up