atg.commerce.csr.order.edit
Class CSRCloneEditManager

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

public class CSRCloneEditManager
extends CloneEditManager

This class contains the CSR extensions to the CloneEditManager


Field Summary
static java.lang.String CLASS_VERSION
           
static java.lang.String CONSUMED_PROMOTIONS_EXTRA_DATA_KEY
          the string key used to store the consumable promotion objects in the CloneEditState
protected  CSRAgentTools mCSRAgentTools
          the agent profile
static java.lang.String TICKETID
          the current ticket id
 
Fields inherited from class atg.commerce.order.edit.CloneEditManager
CLONEDITMANAGER, CLONEEDITSTATE, CLONEORDER, mCatalogTools, mCloneEditHandlers, mInitializeEditChains, mInventoryManager, mOrderManager, mReconcileOrderChains, mTransactionManager
 
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
CSRCloneEditManager()
           
 
Method Summary
 void addConsumablePromotion(CloneEditState pCloneEditState, atg.repository.RepositoryItem pPromotion, int pOrderCountWhenClaimed)
          Adds a pConsumablePromotion to the CloneEditState.
 void consumePromotions(CloneEditState pCloneEditState, atg.repository.RepositoryItem pCustomerProfile, java.lang.String pTicketId)
          Consumes the ConsumablePromotion in the CloneEditState.
 ConsumablePromotion createConsumablePromotion(atg.repository.RepositoryItem pPromotion, int pOrderCountWhenClaimed)
          Creates an instance of a ConsumablePromotion for the given promotion.
 ConsumablePromotion getConsumablePromotion(CloneEditState pCloneEditState, java.lang.String pPromotionId)
          Returns the ConsumablePromotion object from the CloneEditState based on the given promotion id.
protected  java.util.Map getConsumablePromotions(CloneEditState pCloneEditState)
          Returns the consumable promotions map from the order udpate state.
 CSRAgentTools getCSRAgentTools()
           
 java.lang.String getInitializeOrderEditChainId(atg.commerce.order.Order pOrder)
          If the original order is in one of the "submitted" states defined in CSRAgentTools, then the submitted state is returned.
 java.lang.String getReconcileOrderChainId(atg.commerce.order.Order pOrder)
          If the original order is in one of the "submitted" states defined in CSRAgentTools, then the submitted state is returned.
 void sendAgentEvents(CloneEditState pCloneEditState, atg.repository.RepositoryItem pCustomerProfile, java.lang.String pTicketId)
          This method sends agent events for the changes in the order.
 void setCSRAgentTools(CSRAgentTools pCSRAgentTools)
          Sets the property CSRAgentTools.
 
Methods inherited from class atg.commerce.order.edit.CloneEditManager
applyChanges, buildPropertyValueMap, cloneOrder, createAddItem, createCloneEditStateObject, createDeleteItem, createUpdateItem, detectUpdatesInFinalAmountInfo, findPropertyUpdate, getCatalogTools, getCloneEditHandlers, getInitializeEditChains, getInventoryManager, getOrderManager, getPipelineManager, getReconcileOrderChains, getTransactionManager, initializeCloneEditState, initializeOrderEdit, initializeReconciliationProcess, reconcileOrder, reconcileProperties, sendFulfillmentNotifications, setCatalogTools, setCloneEditHandlers, setInitializeEditChains, setInventoryManager, setOrderManager, setReconcileOrderChains, setTransactionManager, validateClonedOrder
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, 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, 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 final java.lang.String CLASS_VERSION
See Also:
Constant Field Values

CONSUMED_PROMOTIONS_EXTRA_DATA_KEY

public static final java.lang.String CONSUMED_PROMOTIONS_EXTRA_DATA_KEY
the string key used to store the consumable promotion objects in the CloneEditState

See Also:
Constant Field Values

TICKETID

public static final java.lang.String TICKETID
the current ticket id

See Also:
Constant Field Values

mCSRAgentTools

protected CSRAgentTools mCSRAgentTools
the agent profile

Constructor Detail

CSRCloneEditManager

public CSRCloneEditManager()
Method Detail

setCSRAgentTools

public void setCSRAgentTools(CSRAgentTools pCSRAgentTools)
Sets the property CSRAgentTools.


getCSRAgentTools

public CSRAgentTools getCSRAgentTools()
Returns:
The value of the property ProfileTools.

sendAgentEvents

public void sendAgentEvents(CloneEditState pCloneEditState,
                            atg.repository.RepositoryItem pCustomerProfile,
                            java.lang.String pTicketId)
This method sends agent events for the changes in the order. The sendAgentEvents method is called on each CloneEditHandler that's an instance of AgentEventHandler.


getConsumablePromotions

protected java.util.Map getConsumablePromotions(CloneEditState pCloneEditState)
Returns the consumable promotions map from the order udpate state.

Parameters:
pCloneEditState -
Returns:
Map of ConsumablePromotions

consumePromotions

public void consumePromotions(CloneEditState pCloneEditState,
                              atg.repository.RepositoryItem pCustomerProfile,
                              java.lang.String pTicketId)
                       throws atg.repository.RepositoryException
Consumes the ConsumablePromotion in the CloneEditState.

Parameters:
pCloneEditState -
Throws:
atg.repository.RepositoryException

getConsumablePromotion

public ConsumablePromotion getConsumablePromotion(CloneEditState pCloneEditState,
                                                  java.lang.String pPromotionId)
Returns the ConsumablePromotion object from the CloneEditState based on the given promotion id.

Parameters:
pCloneEditState -
pPromotionId -
Returns:
ConsumablePromotion

addConsumablePromotion

public void addConsumablePromotion(CloneEditState pCloneEditState,
                                   atg.repository.RepositoryItem pPromotion,
                                   int pOrderCountWhenClaimed)
Adds a pConsumablePromotion to the CloneEditState. These promotions are consumed when the order changes are reconciled and committed.

Parameters:
pCloneEditState -
pPromotion -
pOrderCountWhenClaimed - the number of times the promotion appears in the order when it was claimed. This value can be used later to determine if the promotion should be consumed, if the current count is still the same during reconciliation

createConsumablePromotion

public ConsumablePromotion createConsumablePromotion(atg.repository.RepositoryItem pPromotion,
                                                     int pOrderCountWhenClaimed)
Creates an instance of a ConsumablePromotion for the given promotion.

Returns:

getReconcileOrderChainId

public java.lang.String getReconcileOrderChainId(atg.commerce.order.Order pOrder)
If the original order is in one of the "submitted" states defined in CSRAgentTools, then the submitted state is returned.

Overrides:
getReconcileOrderChainId in class CloneEditManager
Returns:
the name of the pipeline chain use to reconcile the edit updates
See Also:
CloneEditManager.getReconcileOrderChains()

getInitializeOrderEditChainId

public java.lang.String getInitializeOrderEditChainId(atg.commerce.order.Order pOrder)
If the original order is in one of the "submitted" states defined in CSRAgentTools, then the submitted state is returned.

Overrides:
getInitializeOrderEditChainId in class CloneEditManager
Returns:
the name of the pipeline chain use to init the edit updates
See Also:
CloneEditManager.getInitializeEditChains()