atg.commerce.order.edit
Class CloneEditManager

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.order.edit.CloneEditManager
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class CloneEditManager
extends GenericService

This class contains the api for applying updates to a persisted order by making a clone of the order and then reconciling the original order with the clone after updates are made.

The advantage of making order updates this way is that all the changes to the clone can be discarded leaving the original order in its original state or all changes can be applied to the original order at once in a single transaction.

The edit process is done in two phases. Both phases are defined as pipelines that consist of several steps. Pipelines are mapped and executed based on the state of the order being edited using the initializeEditChains and reconcileOrderChains, which allows for executing custom pipelines for orders in different states.

The CloneEditHandler components, which are mapped to property cloneEditHandlers are executed in various steps of both phases. Each handler is responsible for handling specific facets of the order during both phases. This is the main integration point for handling customizations to the Order.

In the first phase, the original order is cloned at the repository level. The OrderManager is used to load the clone order, which creates the Commerce Order objects. The clone edit state object is created in this phase and each clone edit is executed.

The second phase reconciles the changes in the clone order with the original order.

See Also:
initializeOrderEdit(Order), reconcileOrder(CloneEditState, Map), CloneEditHandler, CloneEditState

Field Summary
static java.lang.String CLASS_VERSION
           
static java.lang.String CLONEDITMANAGER
          the key used to store the CloneEditManager refernce in the pipeline extra parameters
static java.lang.String CLONEEDITSTATE
          the key used to store the CloneEditState object in the pipeline extra parameters
static java.lang.String CLONEORDER
          the key used to store a refernce to the clone order in the pipeline extra parameters
static java.lang.String CONSUMED_PROMOTIONS
          the key used to store the Map of promotions there were considered used and should be consumed.
protected  CatalogTools mCatalogTools
           
protected  CloneEditHandler[] mCloneEditHandlers
           
protected  java.util.Map mInitializeEditChains
           
protected  InventoryManager mInventoryManager
           
protected  OrderManager mOrderManager
           
protected  PipelineManager mPipelineManager
           
protected  ProfileTools mProfileTools
           
protected  java.util.Map mReconcileOrderChains
           
protected  javax.transaction.TransactionManager mTransactionManager
           
static java.lang.String PROMOTION_COUNTS_BEFORE_UPDATE
          the key used to store the Map of promotion counts on the original order before the updates are applied
static java.lang.String PROMOTION_COUPON_MAP
          the key used to save the Map of promotion to coupon on the original order before the updates are applied
 
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
CloneEditManager()
           
 
Method Summary
 void adjustCloneCommerceIdReferences(CloneEditState pCloneEditState)
          This API calls the adjustCloneCommerceIdReferences on each handler, so each handler can update any references to commerce ids in the clone order to the clone counterpart ids.
 void adjustOriginalCommerceIdReferences(CloneEditState pCloneEditState)
          This API calls the adjustOriginalCommerceIdReferences on each handler, so each handler can update any references to commerce ids in the original order to the original counterpart ids.
 void applyChanges(CloneEditState pCloneEditState)
          Applies all the changes in the clone to the original order.
 java.util.Map buildPropertyValueMap(java.lang.Object pObject)
          Iterates over all the properties of the object and creates a map of their values.
 Order cloneOrder(Order pOrder, java.util.Map pPropExceptions, java.util.Map pExcludedProperties)
          Clones the order at the repository level and then calls the OrderManager to load the order and return it.
 void consumePromotions(CloneEditState pCloneEditState, RepositoryItem pCustomerProfile, java.lang.String pTicketId)
          Compares the promotion use counts on the original order before and after the updates were applied, and consumes each promotion that was newly applied or had its use count increased.
 AddItem createAddItem(CloneEditState pCloneEditState, java.lang.Object pItem, java.lang.Object pOriginalContainter, java.lang.Object pCloneContainer, int pOrdinalPosition, java.lang.String pPropertyName, boolean pAutoRecoveredItem)
          Creates an AddItem object that represents an object that's been added to a container.
 CloneEditState createCloneEditStateObject()
          Retuns a new CloneEditState.
 DeleteItem createDeleteItem(CloneEditState pCloneEditState, java.lang.Object pItem, java.lang.Object pOriginalContainter, java.lang.Object pCloneContainer, java.lang.String pPropertyName, int pOrdinalPosition, boolean pAutoDeletedItem)
          Creates a DeleteItem object that represents an object that's been removed to a particular list.
 java.util.Map createPromotionToCouponMap(Order pOrder)
          Maps each promotion applied to the order to its corresponding coupon specified in the PricingAdjustment
 UpdateItem createUpdateItem(CloneEditState pCloneEditState, java.lang.Object pOriginalItem, java.lang.Object pCloneItem, int pOrdinalPosition, java.lang.String pPropertyName, java.lang.Object pOriginalContainter, java.lang.Object pCloneContainer)
          Creates an UpdateItem object that represents an updated object.
protected  java.util.List detectUpdatesInFinalAmountInfo(java.lang.Object pClonedlPricedObject, java.lang.Object pOriginalPricedObject, java.lang.String pPropertyName)
          Creates a list of PropertyUpdates that reflect changes of amount and amountIsFinal in the price info property
 atg.userprofiling.PropertyUpdate findPropertyUpdate(java.lang.String pPropertyName, java.util.Collection pPropertyUpdates)
          Finds the PropertyUpdate object for the given property name.
 CatalogTools getCatalogTools()
          Returns the CatalogTools that's passed into the reconcileOrder pipeline execution.
 CloneEditHandler[] getCloneEditHandlers()
          Returns the clone edit handlers
 java.util.Map getInitializeEditChains()
          Map of init edit order chain ids.
 java.lang.String getInitializeOrderEditChainId(Order pOrder)
          Returns the init edit order chain id based on the state of the given order.
 InventoryManager getInventoryManager()
          Returns the InventoryManager that's passed into the reconcileOrder pipeline execution.
 OrderManager getOrderManager()
           
 PipelineManager getPipelineManager()
          Returns the pipelineManager
 ProfileTools getProfileTools()
          returns the configured profile tools component.
 PromotionTools getPromotionTools()
          Return the PromotionTools property.
 java.lang.String getReconcileOrderChainId(Order pOrder)
          Returns the reconcile order chain id based on the state of the given order.
 java.util.Map getReconcileOrderChains()
          Map of reconcile chain ids.
 javax.transaction.TransactionManager getTransactionManager()
          Transaction Manager
 void initializeCloneEditState(CloneEditState pCloneEditState, Order pOriginalOrder, Order pCloneOrder)
          Initializes the CloneEditState using the original and clone order
 CloneEditState initializeOrderEdit(Order pOrder)
          Executes the pipeline chain that initializes the order edit process.
 CloneEditState initializeOrderEdit(Order pOrder, java.lang.String pChainId, java.util.Map pExtraParameters)
           
 void initializeReconciliationProcess(CloneEditState pCloneEditState)
          Prepares the CloneEditState for the reconciliation process.
static java.util.Collection parseConfigurationString(java.lang.String pString)
          Parse a String which is delimited by "|" into a collection of strings.
 PipelineResult reconcileOrder(CloneEditState pCloneEditState, java.util.Map pExtraParameters)
           
 PipelineResult reconcileOrder(CloneEditState pCloneEditState, java.lang.String pChainId, java.util.Map pExtraParameters)
          Runs the pipeline to reconcile the original order with the clone order.
protected  java.util.List reconcileProperties(java.lang.Object pClone, java.lang.Object pOrig, java.lang.String[] pProperties)
          Reconciles the properties between the original and clone objects by copying the property values from the clone to the original.
 void restoreCouponReferences(Order pOrder, java.util.Map pPromotionToCoupon)
          Iterates over the orders PriceAdjustment objects and fills in the coupon property based on the promotion referenced in the adjustment.
 void sendFulfillmentNotifications(CloneEditState pCloneEditState)
          Sends the ModifyOrderNotification for changes made to the original order.
 void setCatalogTools(CatalogTools pCatalogTools)
           
 void setCloneEditHandlers(CloneEditHandler[] pCloneEditHandlers)
          Sets the clone edit handlers
 void setInitializeEditChains(java.util.Map pInitializeEditChains)
          Sets the map of order edit chain ids
 void setInventoryManager(InventoryManager pInventoryManager)
           
 void setOrderManager(OrderManager pOrderManager)
           
 void setPipelineManager(PipelineManager pPipelineManager)
          Sets the pipelineManager
 void setProfileTools(ProfileTools pProfileTools)
           
 void setPromotionTools(PromotionTools pPromotionTools)
          Set the PromotionTools property.
 void setReconcileOrderChains(java.util.Map pReconcileOrderChains)
           
 void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
          Sets the Transaction Manager.
 void validateClonedOrder(Order pOriginalOrder, Order pCloneOrder)
          Validates the clone order against the original order.
 
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
See Also:
Constant Field Values

CLONEEDITSTATE

public static final java.lang.String CLONEEDITSTATE
the key used to store the CloneEditState object in the pipeline extra parameters

See Also:
Constant Field Values

CLONEDITMANAGER

public static final java.lang.String CLONEDITMANAGER
the key used to store the CloneEditManager refernce in the pipeline extra parameters

See Also:
Constant Field Values

CLONEORDER

public static final java.lang.String CLONEORDER
the key used to store a refernce to the clone order in the pipeline extra parameters

See Also:
Constant Field Values

PROMOTION_COUNTS_BEFORE_UPDATE

public static final java.lang.String PROMOTION_COUNTS_BEFORE_UPDATE
the key used to store the Map of promotion counts on the original order before the updates are applied

See Also:
Constant Field Values

PROMOTION_COUPON_MAP

public static final java.lang.String PROMOTION_COUPON_MAP
the key used to save the Map of promotion to coupon on the original order before the updates are applied

See Also:
Constant Field Values

CONSUMED_PROMOTIONS

public static final java.lang.String CONSUMED_PROMOTIONS
the key used to store the Map of promotions there were considered used and should be consumed. The map is keyed by the promotion id and the value is the total (new) use count for the promotion

See Also:
Constant Field Values

mProfileTools

protected ProfileTools mProfileTools

mCloneEditHandlers

protected CloneEditHandler[] mCloneEditHandlers

mTransactionManager

protected javax.transaction.TransactionManager mTransactionManager

mInventoryManager

protected InventoryManager mInventoryManager

mCatalogTools

protected CatalogTools mCatalogTools

mInitializeEditChains

protected java.util.Map mInitializeEditChains

mReconcileOrderChains

protected java.util.Map mReconcileOrderChains

mPipelineManager

protected PipelineManager mPipelineManager

mOrderManager

protected OrderManager mOrderManager
Constructor Detail

CloneEditManager

public CloneEditManager()
Method Detail

setPromotionTools

public void setPromotionTools(PromotionTools pPromotionTools)
Set the PromotionTools property.


getPromotionTools

public PromotionTools getPromotionTools()
Return the PromotionTools property.


getProfileTools

public ProfileTools getProfileTools()
returns the configured profile tools component.

Returns:
ProfileTools

setProfileTools

public void setProfileTools(ProfileTools pProfileTools)

setCloneEditHandlers

public void setCloneEditHandlers(CloneEditHandler[] pCloneEditHandlers)
Sets the clone edit handlers

CloneEditHandlers are components that are called are various points in the clone edit process. They can be used to clone and reconcile data between the original and clone orders.

See Also:
CloneEditHandler

getCloneEditHandlers

public CloneEditHandler[] getCloneEditHandlers()
Returns the clone edit handlers


setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Sets the Transaction Manager.


getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()
Transaction Manager


getInventoryManager

public InventoryManager getInventoryManager()
Returns the InventoryManager that's passed into the reconcileOrder pipeline execution.

Returns:
InventoryManager

setInventoryManager

public void setInventoryManager(InventoryManager pInventoryManager)

getCatalogTools

public CatalogTools getCatalogTools()
Returns the CatalogTools that's passed into the reconcileOrder pipeline execution.

Returns:
CatalogTools

setCatalogTools

public void setCatalogTools(CatalogTools pCatalogTools)

getInitializeEditChains

public java.util.Map getInitializeEditChains()
Map of init edit order chain ids.

Chains are expected to be mapped by order state.

Returns:
Map
See Also:
getInitializeOrderEditChainId(Order)

setInitializeEditChains

public void setInitializeEditChains(java.util.Map pInitializeEditChains)
Sets the map of order edit chain ids


getReconcileOrderChains

public java.util.Map getReconcileOrderChains()
Map of reconcile chain ids.

Chains are expected to be mapped by order state.

Returns:
Map
See Also:
getReconcileOrderChainId(Order)

setReconcileOrderChains

public void setReconcileOrderChains(java.util.Map pReconcileOrderChains)

getInitializeOrderEditChainId

public java.lang.String getInitializeOrderEditChainId(Order pOrder)
Returns the init edit order chain id based on the state of the given order.

Returns:
The name of the pipeline chain used to initialize the order edit process
See Also:
getInitializeEditChains()

getReconcileOrderChainId

public java.lang.String getReconcileOrderChainId(Order pOrder)
Returns the reconcile order chain id based on the state of the given order.

Returns:
the name of the pipeline chain use to reconcile the edit updates
See Also:
getReconcileOrderChains()

getPipelineManager

public PipelineManager getPipelineManager()
Returns the pipelineManager


setPipelineManager

public void setPipelineManager(PipelineManager pPipelineManager)
Sets the pipelineManager


getOrderManager

public OrderManager getOrderManager()
Returns:
the OrderManager

setOrderManager

public void setOrderManager(OrderManager pOrderManager)

createCloneEditStateObject

public CloneEditState createCloneEditStateObject()
Retuns a new CloneEditState. Override this method to return your own extended class.

Returns:
a new CloneEditState object

initializeOrderEdit

public CloneEditState initializeOrderEdit(Order pOrder)
                                   throws CommerceException
Executes the pipeline chain that initializes the order edit process.

The CloneEditState is created, initialized and returned. This object is used as input to several of the API for this process.

Executes the configured pipeline for initializing the edit process.

Parameters:
pOrder - the original order
Returns:
the CloneEditState
Throws:
CommerceException
See Also:
getInitializeOrderEditChainId(Order)

initializeOrderEdit

public CloneEditState initializeOrderEdit(Order pOrder,
                                          java.lang.String pChainId,
                                          java.util.Map pExtraParameters)
                                   throws CommerceException
Throws:
CommerceException

cloneOrder

public Order cloneOrder(Order pOrder,
                        java.util.Map pPropExceptions,
                        java.util.Map pExcludedProperties)
                 throws CommerceException
Clones the order at the repository level and then calls the OrderManager to load the order and return it.

The cloneOrder method is executed on all the clone edit handlers.

Parameters:
pOrder - the order to clone
pPropExceptions - Optional. Map of property exceptions passed to the repository cloning process .
pExcludedProperties - Properties to exclude from repository cloning process
Returns:
the clone Order
Throws:
CommerceException
See Also:
RepositoryUtils.cloneItem(RepositoryItem, boolean, Map, Map, MutableRepository, String)

reconcileOrder

public PipelineResult reconcileOrder(CloneEditState pCloneEditState,
                                     java.lang.String pChainId,
                                     java.util.Map pExtraParameters)
                              throws CommerceException
Runs the pipeline to reconcile the original order with the clone order.

This method registers and transaction synchronization that's used to invalidate the original and clone orders when the transaction is rolled back due to errors.

All errors during this process will set the transaction to rollback only.

Before reconciling, as a convenience, the CloneEditState is added as a local thread variable.

Parameters:
pCloneEditState - the clone edit state object
pChainId - optional. the pipeline chain to run.
pExtraParameters - map of parameters passed to the pipeline execution
Returns:
PipelineResult object from reconcile execution
Throws:
CommerceException
See Also:
CloneOrderStateContext

reconcileOrder

public PipelineResult reconcileOrder(CloneEditState pCloneEditState,
                                     java.util.Map pExtraParameters)
                              throws CommerceException
Throws:
CommerceException
See Also:
reconcileOrder(CloneEditState, String, Map)

applyChanges

public void applyChanges(CloneEditState pCloneEditState)
                  throws CommerceException
Applies all the changes in the clone to the original order.

The applyChanges and adjustOriginalCommerceIdReferences method is executed on all the clone edit handlers.

Parameters:
pCloneEditState -
Throws:
CommerceException

adjustCloneCommerceIdReferences

public void adjustCloneCommerceIdReferences(CloneEditState pCloneEditState)
                                     throws CommerceException
This API calls the adjustCloneCommerceIdReferences on each handler, so each handler can update any references to commerce ids in the clone order to the clone counterpart ids. For example, a reference to a shipping group id can be updated to the shipping group's clone counterpart id.

Parameters:
pCloneEditState -
Throws:
CommerceException

adjustOriginalCommerceIdReferences

public void adjustOriginalCommerceIdReferences(CloneEditState pCloneEditState)
                                        throws CommerceException
This API calls the adjustOriginalCommerceIdReferences on each handler, so each handler can update any references to commerce ids in the original order to the original counterpart ids. For example, a reference to a shipping group id can be updated to the shipping group's original counterpart id.

Parameters:
pCloneEditState -
Throws:
CommerceException

reconcileProperties

protected java.util.List reconcileProperties(java.lang.Object pClone,
                                             java.lang.Object pOrig,
                                             java.lang.String[] pProperties)
Reconciles the properties between the original and clone objects by copying the property values from the clone to the original.

Parameters:
pClone -
pOrig -
pProperties - an array of property names that are copied from the clone to the original object.
Returns:
List of PropertyUpdate objects that reflect old and new values for all properties that changed.

validateClonedOrder

public void validateClonedOrder(Order pOriginalOrder,
                                Order pCloneOrder)
                         throws CommerceException
Validates the clone order against the original order.

Calls each CloneEditHandler's validateCloneOrder method.

Parameters:
pOriginalOrder -
pCloneOrder -
Throws:
CommerceException - if sizes don't match

initializeCloneEditState

public void initializeCloneEditState(CloneEditState pCloneEditState,
                                     Order pOriginalOrder,
                                     Order pCloneOrder)
                              throws CommerceException
Initializes the CloneEditState using the original and clone order

Calls each CloneEditHandler's initializeCloneEditState and adjustCloneCommerceIdReferences method.

Parameters:
pCloneEditState - state object to initialize
pOriginalOrder - the original order
pCloneOrder - the clone order
Throws:
CommerceException

initializeReconciliationProcess

public void initializeReconciliationProcess(CloneEditState pCloneEditState)
                                     throws CommerceException
Prepares the CloneEditState for the reconciliation process.

Calls each CloneEditHandler's initializeReconciliationProcess method.

Throws:
CommerceException
See Also:
CloneEditHandler.initializeReconciliationProcess(CloneEditState)

findPropertyUpdate

public atg.userprofiling.PropertyUpdate findPropertyUpdate(java.lang.String pPropertyName,
                                                           java.util.Collection pPropertyUpdates)
Finds the PropertyUpdate object for the given property name.

Parameters:
pPropertyName - the property name to find
pPropertyUpdates - the collection of PropertyUpdates
Returns:
PropertyUpdate
See Also:
PropertyUpdate

sendFulfillmentNotifications

public void sendFulfillmentNotifications(CloneEditState pCloneEditState)
                                  throws javax.jms.JMSException,
                                         CommerceException
Sends the ModifyOrderNotification for changes made to the original order. Calls each CloneEditHandler's sendFulfillmentMessages method.

Parameters:
pCloneEditState -
Throws:
javax.jms.JMSException
CommerceException

detectUpdatesInFinalAmountInfo

protected java.util.List detectUpdatesInFinalAmountInfo(java.lang.Object pClonedlPricedObject,
                                                        java.lang.Object pOriginalPricedObject,
                                                        java.lang.String pPropertyName)
Creates a list of PropertyUpdates that reflect changes of amount and amountIsFinal in the price info property

Parameters:
pClonedlPricedObject - the clone object that contains a price info property
pOriginalPricedObject - the original object that contains a price info property
pPropertyName - the name of the property containing the price info object.
Returns:
List of PropertyUpdates

createAddItem

public AddItem createAddItem(CloneEditState pCloneEditState,
                             java.lang.Object pItem,
                             java.lang.Object pOriginalContainter,
                             java.lang.Object pCloneContainer,
                             int pOrdinalPosition,
                             java.lang.String pPropertyName,
                             boolean pAutoRecoveredItem)
Creates an AddItem object that represents an object that's been added to a container.

Parameters:
pCloneEditState -
pItem -
pOriginalContainter -
pCloneContainer -
pOrdinalPosition -
pAutoRecoveredItem -
Returns:
an AddItem object

createDeleteItem

public DeleteItem createDeleteItem(CloneEditState pCloneEditState,
                                   java.lang.Object pItem,
                                   java.lang.Object pOriginalContainter,
                                   java.lang.Object pCloneContainer,
                                   java.lang.String pPropertyName,
                                   int pOrdinalPosition,
                                   boolean pAutoDeletedItem)
Creates a DeleteItem object that represents an object that's been removed to a particular list.

Parameters:
pCloneEditState -
pItem -
pOriginalContainter -
pOrdinalPosition -
pAutoDeletedItem -
Returns:
DeleteItem object

createUpdateItem

public UpdateItem createUpdateItem(CloneEditState pCloneEditState,
                                   java.lang.Object pOriginalItem,
                                   java.lang.Object pCloneItem,
                                   int pOrdinalPosition,
                                   java.lang.String pPropertyName,
                                   java.lang.Object pOriginalContainter,
                                   java.lang.Object pCloneContainer)
Creates an UpdateItem object that represents an updated object.

Parameters:
pCloneEditState -
pOriginalItem - the original object that was updated
pOrdinalPosition - the position in the container
pOriginalContainter - the original object container
pCloneContainer - the clone object container
Returns:
UpdateItem

buildPropertyValueMap

public java.util.Map buildPropertyValueMap(java.lang.Object pObject)
Iterates over all the properties of the object and creates a map of their values.

Parameters:
pObject -
Returns:
Map of property values

parseConfigurationString

public static java.util.Collection parseConfigurationString(java.lang.String pString)
Parse a String which is delimited by "|" into a collection of strings.


consumePromotions

public void consumePromotions(CloneEditState pCloneEditState,
                              RepositoryItem pCustomerProfile,
                              java.lang.String pTicketId)
                       throws CommerceException
Compares the promotion use counts on the original order before and after the updates were applied, and consumes each promotion that was newly applied or had its use count increased.

This method will store a resulting Map of promotion id to use count for each promotion that was consumed in the given CloneEditState.

Parameters:
pCloneEditState -
Throws:
CommerceException
See Also:
ProcSetOriginalOrderPromotionCounts, atg.commerce.csr.order.edit.processor.ProcConsumeCouponPromotions, CONSUMED_PROMOTIONS

createPromotionToCouponMap

public java.util.Map createPromotionToCouponMap(Order pOrder)
                                         throws CommerceException
Maps each promotion applied to the order to its corresponding coupon specified in the PricingAdjustment

Parameters:
pOrder -
Returns:
Map of promotion id to coupon item.
Throws:
CommerceException

restoreCouponReferences

public void restoreCouponReferences(Order pOrder,
                                    java.util.Map pPromotionToCoupon)
                             throws CommerceException
Iterates over the orders PriceAdjustment objects and fills in the coupon property based on the promotion referenced in the adjustment. The given map contains the necessary promotion to coupon relationships.

Parameters:
pOrder -
pPromotionToCoupon -
Throws:
CommerceException