atg.commerce.csr.environment
Class CSREnvironmentMonitor

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.svc.agent.environment.EnvironmentMonitor
              extended by atg.commerce.csr.environment.CSREnvironmentMonitor
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 CSREnvironmentMonitor
extends atg.svc.agent.environment.EnvironmentMonitor

This monitor handles changes to CSR environment objects.

It handles changes to the order, catalog and price list.


Field Summary
static java.lang.String AGENT_ORDER_SEARCH_REQUEST_TRACKER_PATH
          The path to the agentOrderSearchRequestTracker component
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String CLONE_EDIT_STATE_KEY
          the key used to store the clone edit state in the environment change state whenever the order is change while the current order is in clone edit mode.
static java.lang.String CURRENT_CATALOG_HOLDER_PATH
          The path to the environment's current catalog component
static java.lang.String CURRENT_PRICELIST_HOLDER_PATH
          The path to the environment's current price list component
protected  atg.commerce.profile.CommercePropertyManager mCommercePropertyManager
           
protected  CSREnvironmentTools mCSREnvironmentTools
           
protected static java.lang.String MY_RESOURCES
           
static java.lang.String RETURN_REQUEST_KEY
          the key used to store the ReturnRequest in the environment change state whenever the order is change while a return is being processed.
protected  java.util.ResourceBundle sBundle
           
 
Fields inherited from class atg.svc.agent.environment.EnvironmentMonitor
mEnvironmentTools
 
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
CSREnvironmentMonitor()
           
 
Method Summary
 void applyActiveCustomerChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Applies changes related to a current customer change.
 void applyCatalogChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Changes the environment's current catalog based on the change detail.
 void applyChanges(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method applies changes that this monitor is responsible for.
 void applyOrderChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Changes the current order based on the change detail.
 void applyOrderSearchResultsChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Clears order search results when the order-related environment changes so that the agent can begin with a clean new search.
 void applyPriceListChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pPriceListChangeDetail, atg.svc.agent.environment.EnvironmentChangeDetail pSalePriceListChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Changes the environment's current price list and sale price list based on the change details.
 void applyPriceListChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Changes the environment's current price list based on the change detail.
 void changeOrderOwner(atg.commerce.order.Order pOrder, atg.repository.RepositoryItem pNewOwner)
          Changes the order owner of the order.
protected  boolean compareCurrentCatalog(java.lang.String pCatalogId)
          Compares the environment's current catalog to the catalog id provided.
protected  boolean compareCurrentPriceList(java.lang.String pPriceListId)
          Compares the environment current price list to the price list id provided.
protected  boolean compareCurrentSalePriceList(java.lang.String pPriceListId)
          Compares the environment current sale price list to the price list id provided.
 void createWarningsForEnvironmentChange(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Creates the warnings related to CSR environment changes
protected  void generateCatalogAndPricelistChangeForCustomerChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Generates dependent catalog and price list change details for a customer change.
protected  void generateChangeDetailsForChangeKey(java.lang.String pChangeKey, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method is called to generate change details for the given change key.
protected  void generateCustomerChangeForOrderChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Generate the customer change details based on an order change.
protected  void generateDependentChangeDetails(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method is called to generate change details that are dependent on the given EnvironmentChangeDetail
protected  void generateDependentDetailsForActiveCustomerChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Generates change details that result from a change of active profile.
protected  void generateDependentDetailsForOrderChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Generates change details that result from a change of order.
protected  void generateInitialChangesForChangeCatalogAndPriceList(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method creates the initial changes details for change the catalog and price lists.
protected  void generateInitialChangesForChangeOrder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method creates the initial changes details for the change of order
protected  void generateInitialChangesForCreateNewOrder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method creates the initial changes details for the creating a new order
protected  void generateInitialChangesForInitEnvironment(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method creates the initiali changes details for the initialize environment change
protected  void generateInitialChangesForStartCall(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method creates the initial changes details for the start of a new call
protected  void generateInitialChangesForSyncCustomer(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method creates the initial changes details for the synchronize to customer
protected  void generateOrderChangeForCustomerChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Generates dependent order change details for a customer change.
protected  void generatePricelistChangeForOrderChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Generate the price list change details based on an order change.
 atg.commerce.profile.CommercePropertyManager getCommercePropertyManager()
           
 CSREnvironmentTools getCSREnvironmentTools()
           
 atg.repository.RepositoryItem getCurrentCatalog()
          Returns the environment's current catalog.
 atg.commerce.order.Order getCurrentOrder()
          Returns the current order
 atg.repository.RepositoryItem getCurrentPriceList()
          Returns the environment's current price list.
 atg.repository.RepositoryItem getCurrentSalePriceList()
          Returns the environment's current sale price list.
 java.lang.Object getEnvironmentObject(java.lang.String pEnvironmentObjectName)
          returns the environment objects managed by the CSR application.
protected  atg.repository.RepositoryItem getUsersCatalog(atg.repository.RepositoryItem pProfile)
          Returns a profile's assigned catalog.
protected  atg.repository.RepositoryItem getUsersPriceList(atg.repository.RepositoryItem pProfile)
          Returns a profile's price list by calling the PriceListManager.
protected  atg.repository.RepositoryItem getUsersSalePriceList(atg.repository.RepositoryItem pProfile)
          Returns a profile's sale price list.
 void initializeDefaultsForProfile(atg.repository.MutableRepositoryItem pProfile)
          Initializes the default values in the profile.
 void initializeNewOrderInCart()
          Creates a new order and makes it current in the agent's window state order holder
protected  boolean isOwnerChangeable(atg.commerce.order.Order pOrder, atg.repository.RepositoryItem pNewOwnerProfile)
          Determines if an order may have the new owner assigned.
 void postApplyChanges(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Resets the catalog tree state if the catalog was changed.
 void resetOrderForOwnerChange(atg.commerce.order.Order pOrder, atg.repository.RepositoryItem pNewOwner)
          Resets the order for an owner change.
 void revertActiveCustomerChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Reinitializes the customer pricing model holder.
 void revertCatalogChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Loads the old catalog from the detail as the active catalog
 void revertChanges(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Reverts the order, catalog and price list details to the previously loaded values
 void revertOrderChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Reverts the order change.
 void revertPriceListChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pPriceListChangeDetail, atg.svc.agent.environment.EnvironmentChangeDetail pSalePriceListChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Loads the old price lists from the details as the active price lists
 void setCommercePropertyManager(atg.commerce.profile.CommercePropertyManager pCommercePropertyManager)
          Sets the component that defines properties of the profile for Commerce
 void setCSREnvironmentTools(CSREnvironmentTools pCSREnvironmentTools)
          Sets the property CSREnvironmentTools.
 void setCurrentCatalog(atg.repository.RepositoryItem pCatalog)
          sets the current catalog in the environment
 void setCurrentOrder(atg.commerce.order.Order pOrder)
          Sets the order as the the current working order in the Environment
 void setCurrentPriceList(atg.repository.RepositoryItem pPriceList)
          sets the current price list in the environment
 void setCurrentSalePriceList(atg.repository.RepositoryItem pPriceList)
          sets the current sale price list in the environment
 
Methods inherited from class atg.svc.agent.environment.EnvironmentMonitor
generateChangeDetails, getAgentMessagingTools, getEnvironmentTools, preApplyChanges, setAgentMessagingTools, setEnvironmentTools
 
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 java.lang.String CLASS_VERSION
Class version string


MY_RESOURCES

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

sBundle

protected final java.util.ResourceBundle sBundle

CURRENT_PRICELIST_HOLDER_PATH

public static final java.lang.String CURRENT_PRICELIST_HOLDER_PATH
The path to the environment's current price list component

See Also:
Constant Field Values

CURRENT_CATALOG_HOLDER_PATH

public static final java.lang.String CURRENT_CATALOG_HOLDER_PATH
The path to the environment's current catalog component

See Also:
Constant Field Values

AGENT_ORDER_SEARCH_REQUEST_TRACKER_PATH

public static final java.lang.String AGENT_ORDER_SEARCH_REQUEST_TRACKER_PATH
The path to the agentOrderSearchRequestTracker component

See Also:
Constant Field Values

CLONE_EDIT_STATE_KEY

public static final java.lang.String CLONE_EDIT_STATE_KEY
the key used to store the clone edit state in the environment change state whenever the order is change while the current order is in clone edit mode. This clone edit state is used to revert the change in the event that the environment change is reverted.

See Also:
Constant Field Values

RETURN_REQUEST_KEY

public static final java.lang.String RETURN_REQUEST_KEY
the key used to store the ReturnRequest in the environment change state whenever the order is change while a return is being processed. This ReturnRequest is put back in the CSROrderHolder whenever a order change is reverted.

See Also:
Constant Field Values

mCommercePropertyManager

protected atg.commerce.profile.CommercePropertyManager mCommercePropertyManager

mCSREnvironmentTools

protected CSREnvironmentTools mCSREnvironmentTools
Constructor Detail

CSREnvironmentMonitor

public CSREnvironmentMonitor()
Method Detail

setCommercePropertyManager

public void setCommercePropertyManager(atg.commerce.profile.CommercePropertyManager pCommercePropertyManager)
Sets the component that defines properties of the profile for Commerce

Parameters:
pCommercePropertyManager - the component that defines properties of the profile for Commerce

getCommercePropertyManager

public atg.commerce.profile.CommercePropertyManager getCommercePropertyManager()
Returns:
the component that defines properties of the profile for Commerce

setCSREnvironmentTools

public void setCSREnvironmentTools(CSREnvironmentTools pCSREnvironmentTools)
Sets the property CSREnvironmentTools.


getCSREnvironmentTools

public CSREnvironmentTools getCSREnvironmentTools()
Returns:
The CSREnvironmentTools component used to manipulate the profile

initializeDefaultsForProfile

public void initializeDefaultsForProfile(atg.repository.MutableRepositoryItem pProfile)
                                  throws atg.svc.agent.environment.EnvironmentException
Initializes the default values in the profile.

Overrides:
initializeDefaultsForProfile in class atg.svc.agent.environment.EnvironmentMonitor
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
CSREnvironmentTools.initializeDefaultsForProfile(MutableRepositoryItem)

generateChangeDetailsForChangeKey

protected void generateChangeDetailsForChangeKey(java.lang.String pChangeKey,
                                                 atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                          throws atg.svc.agent.environment.EnvironmentChangeDetailConflict,
                                                 atg.svc.agent.environment.EnvironmentException
This method is called to generate change details for the given change key.

This implementation adds details for the following change keys:

Specified by:
generateChangeDetailsForChangeKey in class atg.svc.agent.environment.EnvironmentMonitor
Parameters:
pChangeKey -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentChangeDetailConflict
atg.svc.agent.environment.EnvironmentException
See Also:
ServiceEnvironmentConstants.ENV_CHG_START_NEW_CALL, ServiceEnvironmentConstants.ENV_INITIALIZE, CSREnvironmentConstants.ENV_CHG_ORDER, CSREnvironmentConstants.ENV_CHG_CREATE_NEW_ORDER, CSREnvironmentConstants.ENV_CHG_CATALOG_AND_PRICELIST, generateInitialChangesForChangeCatalogAndPriceList(EnvironmentChangeState), generateInitialChangesForChangeOrder(EnvironmentChangeState), generateInitialChangesForCreateNewOrder(EnvironmentChangeState), generateInitialChangesForInitEnvironment(EnvironmentChangeState), generateInitialChangesForStartCall(EnvironmentChangeState), generateInitialChangesForSyncCustomer(EnvironmentChangeState)

generateInitialChangesForInitEnvironment

protected void generateInitialChangesForInitEnvironment(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                                 throws atg.svc.agent.environment.EnvironmentException
This method creates the initiali changes details for the initialize environment change

Parameters:
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException

generateInitialChangesForStartCall

protected void generateInitialChangesForStartCall(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                           throws atg.svc.agent.environment.EnvironmentException
This method creates the initial changes details for the start of a new call

Parameters:
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException

generateInitialChangesForSyncCustomer

protected void generateInitialChangesForSyncCustomer(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                              throws atg.svc.agent.environment.EnvironmentException
This method creates the initial changes details for the synchronize to customer

Parameters:
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException

generateInitialChangesForChangeOrder

protected void generateInitialChangesForChangeOrder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                             throws atg.svc.agent.environment.EnvironmentException
This method creates the initial changes details for the change of order

Parameters:
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException

generateInitialChangesForCreateNewOrder

protected void generateInitialChangesForCreateNewOrder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                                throws atg.svc.agent.environment.EnvironmentException
This method creates the initial changes details for the creating a new order

Parameters:
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException

generateInitialChangesForChangeCatalogAndPriceList

protected void generateInitialChangesForChangeCatalogAndPriceList(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                                           throws atg.svc.agent.environment.EnvironmentException
This method creates the initial changes details for change the catalog and price lists.

Parameters:
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException

generateDependentDetailsForOrderChange

protected void generateDependentDetailsForOrderChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                                      atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                               throws atg.svc.agent.environment.EnvironmentChangeDetailConflict,
                                                      atg.svc.agent.environment.EnvironmentException
Generates change details that result from a change of order.

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentChangeDetailConflict
atg.svc.agent.environment.EnvironmentException
See Also:
generateCustomerChangeForOrderChange(EnvironmentChangeDetail, EnvironmentChangeState), generatePricelistChangeForOrderChange(EnvironmentChangeDetail, EnvironmentChangeState)

generateCustomerChangeForOrderChange

protected void generateCustomerChangeForOrderChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                                    atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                             throws atg.svc.agent.environment.EnvironmentException
Generate the customer change details based on an order change.

Adds a change detail for a new customer or an existing customer.

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException

generatePricelistChangeForOrderChange

protected void generatePricelistChangeForOrderChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                                     atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                              throws atg.svc.agent.environment.EnvironmentException
Generate the price list change details based on an order change.

Creates a change detail for the price list and sale price list depending on the price lists that can be discerned from the order.

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException

generateDependentDetailsForActiveCustomerChange

protected void generateDependentDetailsForActiveCustomerChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                                               atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                                        throws atg.svc.agent.environment.EnvironmentChangeDetailConflict,
                                                               atg.svc.agent.environment.EnvironmentException
Generates change details that result from a change of active profile.

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentChangeDetailConflict
atg.svc.agent.environment.EnvironmentException
See Also:
generateOrderChangeForCustomerChange(EnvironmentChangeDetail, EnvironmentChangeState), generateCatalogAndPricelistChangeForCustomerChange(EnvironmentChangeDetail, EnvironmentChangeState)

generateOrderChangeForCustomerChange

protected void generateOrderChangeForCustomerChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                                    atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                             throws atg.svc.agent.environment.EnvironmentException
Generates dependent order change details for a customer change.

Adds a new order change if there isn't a order change detail already in the state and the current order owner's cannot be changed.

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException

generateCatalogAndPricelistChangeForCustomerChange

protected void generateCatalogAndPricelistChangeForCustomerChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                                                  atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                                           throws atg.svc.agent.environment.EnvironmentException
Generates dependent catalog and price list change details for a customer change.

Adds change details for the catalog, list price list and sale price list if they haven't been explicitly set by the agent.

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
getUsersPriceList(RepositoryItem), getUsersSalePriceList(RepositoryItem), getUsersCatalog(RepositoryItem)

generateDependentChangeDetails

protected void generateDependentChangeDetails(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                              atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                       throws atg.svc.agent.environment.EnvironmentChangeDetailConflict,
                                              atg.svc.agent.environment.EnvironmentException
This method is called to generate change details that are dependent on the given EnvironmentChangeDetail

Specified by:
generateDependentChangeDetails in class atg.svc.agent.environment.EnvironmentMonitor
Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentChangeDetailConflict
atg.svc.agent.environment.EnvironmentException
See Also:
generateDependentDetailsForOrderChange(EnvironmentChangeDetail, EnvironmentChangeState), generateDependentDetailsForActiveCustomerChange(EnvironmentChangeDetail, EnvironmentChangeState)

createWarningsForEnvironmentChange

public void createWarningsForEnvironmentChange(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                        throws atg.svc.agent.environment.EnvironmentException
Creates the warnings related to CSR environment changes

Overrides:
createWarningsForEnvironmentChange in class atg.svc.agent.environment.EnvironmentMonitor
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
CSREnvironmentTools.createWarningsForPriceListSwitch(EnvironmentChangeState), CSREnvironmentTools.createWarningsForCatalogSwitch(EnvironmentChangeState), CSREnvironmentTools.createWarningsForChangeOrder(EnvironmentChangeState)

applyChanges

public void applyChanges(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                  throws atg.svc.agent.environment.EnvironmentException
This method applies changes that this monitor is responsible for. Specifically, all order, price list and catalog changes are applied here.

Specified by:
applyChanges in class atg.svc.agent.environment.EnvironmentMonitor
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
applyOrderChangeDetail(EnvironmentChangeDetail, EnvironmentChangeState), applyCatalogChangeDetail(EnvironmentChangeDetail, EnvironmentChangeState), applyPriceListChangeDetail(EnvironmentChangeDetail, EnvironmentChangeState)

revertChanges

public void revertChanges(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
Reverts the order, catalog and price list details to the previously loaded values

Overrides:
revertChanges in class atg.svc.agent.environment.EnvironmentMonitor
See Also:
revertOrderChangeDetail(EnvironmentChangeDetail, EnvironmentChangeState), revertPriceListChangeDetail(EnvironmentChangeDetail, EnvironmentChangeDetail, EnvironmentChangeState), revertCatalogChangeDetail(EnvironmentChangeDetail, EnvironmentChangeState)

revertActiveCustomerChangeDetail

public void revertActiveCustomerChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                             atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
Reinitializes the customer pricing model holder.

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -

applyActiveCustomerChangeDetail

public void applyActiveCustomerChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                            atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                     throws atg.svc.agent.environment.EnvironmentException
Applies changes related to a current customer change.

Reinitializes the environment's pricing models.

Changes the current order's owner if there isn't a change order detail in the environment change state.

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException

revertOrderChangeDetail

public void revertOrderChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                    atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
Reverts the order change.

If there's a CloneEditState in the EnvironmentChangeState then it is returned to the CSROrderHolder and the holder's current order is set to the clone edit state's clone order. Otherwise the old order contained in the detail is loaded into the order holder.

If there's a ReturnRequest in the EnvironmentChangeState then it is returned to the CSROrderHolder.

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -

applyOrderChangeDetail

public void applyOrderChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                   atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                            throws atg.svc.agent.environment.EnvironmentException
Changes the current order based on the change detail.

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException

applyOrderSearchResultsChangeDetail

public void applyOrderSearchResultsChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                                atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                         throws atg.svc.agent.environment.EnvironmentException
Clears order search results when the order-related environment changes so that the agent can begin with a clean new search. This will occur for a new call (or a new call after an end call).

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException

applyPriceListChangeDetail

public void applyPriceListChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                       atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                throws atg.svc.agent.environment.EnvironmentException
Changes the environment's current price list based on the change detail.

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:


applyPriceListChangeDetail

public void applyPriceListChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pPriceListChangeDetail,
                                       atg.svc.agent.environment.EnvironmentChangeDetail pSalePriceListChangeDetail,
                                       atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                throws atg.svc.agent.environment.EnvironmentException
Changes the environment's current price list and sale price list based on the change details.

Items in the current order that cannot be priced using the new price lists are removed.

Parameters:
pPriceListChangeDetail -
pSalePriceListChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException

revertPriceListChangeDetail

public void revertPriceListChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pPriceListChangeDetail,
                                        atg.svc.agent.environment.EnvironmentChangeDetail pSalePriceListChangeDetail,
                                        atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
Loads the old price lists from the details as the active price lists

Parameters:
pPriceListChangeDetail -
pSalePriceListChangeDetail -
pEnvironmentChangeState -

revertCatalogChangeDetail

public void revertCatalogChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                      atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
Loads the old catalog from the detail as the active catalog

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -

applyCatalogChangeDetail

public void applyCatalogChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                     atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                              throws atg.svc.agent.environment.EnvironmentException
Changes the environment's current catalog based on the change detail.

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException

isOwnerChangeable

protected boolean isOwnerChangeable(atg.commerce.order.Order pOrder,
                                    atg.repository.RepositoryItem pNewOwnerProfile)
Determines if an order may have the new owner assigned.

True is returned if the order is incomplete.

Parameters:
pOrder - the order
pNewOwnerProfile - repository item representing the potential new owner of the order. This can be null.
Returns:
boolean indicating if the order may have the new owner assigned to it

setCurrentOrder

public void setCurrentOrder(atg.commerce.order.Order pOrder)
                     throws atg.svc.agent.environment.EnvironmentException
Sets the order as the the current working order in the Environment

Parameters:
pOrder -
Throws:
atg.svc.agent.environment.EnvironmentException

getCurrentPriceList

public atg.repository.RepositoryItem getCurrentPriceList()
                                                  throws atg.svc.agent.environment.EnvironmentException
Returns the environment's current price list.

Returns:
the current active price list
Throws:
atg.svc.agent.environment.EnvironmentException

setCurrentPriceList

public void setCurrentPriceList(atg.repository.RepositoryItem pPriceList)
                         throws atg.svc.agent.environment.EnvironmentException
sets the current price list in the environment

Parameters:
pPriceList -
Throws:
atg.svc.agent.environment.EnvironmentException

getCurrentSalePriceList

public atg.repository.RepositoryItem getCurrentSalePriceList()
                                                      throws atg.svc.agent.environment.EnvironmentException
Returns the environment's current sale price list.

Returns:
the current active sale price list
Throws:
atg.svc.agent.environment.EnvironmentException

setCurrentSalePriceList

public void setCurrentSalePriceList(atg.repository.RepositoryItem pPriceList)
                             throws atg.svc.agent.environment.EnvironmentException
sets the current sale price list in the environment

Parameters:
pPriceList -
Throws:
atg.svc.agent.environment.EnvironmentException

getCurrentCatalog

public atg.repository.RepositoryItem getCurrentCatalog()
                                                throws atg.svc.agent.environment.EnvironmentException
Returns the environment's current catalog.

Returns:
catalog repository item
Throws:
atg.svc.agent.environment.EnvironmentException

setCurrentCatalog

public void setCurrentCatalog(atg.repository.RepositoryItem pCatalog)
                       throws atg.svc.agent.environment.EnvironmentException
sets the current catalog in the environment

Parameters:
pCatalog -
Throws:
atg.svc.agent.environment.EnvironmentException

getCurrentOrder

public atg.commerce.order.Order getCurrentOrder()
Returns the current order

Returns:
Order

initializeNewOrderInCart

public void initializeNewOrderInCart()
                              throws atg.svc.agent.environment.EnvironmentException
Creates a new order and makes it current in the agent's window state order holder

Throws:
atg.svc.agent.environment.EnvironmentException

compareCurrentCatalog

protected boolean compareCurrentCatalog(java.lang.String pCatalogId)
Compares the environment's current catalog to the catalog id provided. True is returned if they reference the same catalog.

Parameters:
pCatalogId -
Returns:
true if the catalog is the same as the environment's current catalog.

compareCurrentPriceList

protected boolean compareCurrentPriceList(java.lang.String pPriceListId)
Compares the environment current price list to the price list id provided. True is returned if they reference the same price list

Parameters:
pPriceListId -
Returns:
true if the price list id references the same price list as the environment's current price list.

compareCurrentSalePriceList

protected boolean compareCurrentSalePriceList(java.lang.String pPriceListId)
Compares the environment current sale price list to the price list id provided. True is returned if they reference the same price list

Parameters:
pPriceListId -
Returns:
true if the price list id references the same price list as the environment's current sale price list.

getUsersCatalog

protected atg.repository.RepositoryItem getUsersCatalog(atg.repository.RepositoryItem pProfile)
Returns a profile's assigned catalog.

Parameters:
pProfile -
Returns:
price list item
Throws:
atg.commerce.pricing.priceLists.PriceListException

changeOrderOwner

public void changeOrderOwner(atg.commerce.order.Order pOrder,
                             atg.repository.RepositoryItem pNewOwner)
Changes the order owner of the order.

Parameters:
pOrder - the order to change
pNewOwner - the new owner
See Also:
resetOrderForOwnerChange(Order, RepositoryItem)

resetOrderForOwnerChange

public void resetOrderForOwnerChange(atg.commerce.order.Order pOrder,
                                     atg.repository.RepositoryItem pNewOwner)
                              throws atg.commerce.CommerceException
Resets the order for an owner change. This implementation removes all old shipping groups and payment groups from the order and creates new shipping groups.

Parameters:
pOrder -
pNewOwner -
Throws:
atg.commerce.CommerceException

getUsersPriceList

protected atg.repository.RepositoryItem getUsersPriceList(atg.repository.RepositoryItem pProfile)
                                                   throws atg.commerce.pricing.priceLists.PriceListException
Returns a profile's price list by calling the PriceListManager.

Parameters:
pProfile -
Returns:
price list item
Throws:
atg.commerce.pricing.priceLists.PriceListException
See Also:
PriceListManager.getPriceList(RepositoryItem, String)

getUsersSalePriceList

protected atg.repository.RepositoryItem getUsersSalePriceList(atg.repository.RepositoryItem pProfile)
                                                       throws atg.commerce.pricing.priceLists.PriceListException
Returns a profile's sale price list.

Parameters:
pProfile -
Returns:
price list item
Throws:
atg.commerce.pricing.priceLists.PriceListException
See Also:
PriceListManager.getPriceList(RepositoryItem, String)

getEnvironmentObject

public java.lang.Object getEnvironmentObject(java.lang.String pEnvironmentObjectName)
                                      throws atg.svc.agent.environment.EnvironmentException
returns the environment objects managed by the CSR application. The current order, the current catalog and the current price list.

Specified by:
getEnvironmentObject in class atg.svc.agent.environment.EnvironmentMonitor
Throws:
atg.svc.agent.environment.EnvironmentException

postApplyChanges

public void postApplyChanges(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                      throws atg.svc.agent.environment.EnvironmentException
Resets the catalog tree state if the catalog was changed.

Remebers the agent's explicitly set catalog and price lists in the current call state. If the agent has explicitly set these values in the context of a call, they remain sticky throughout the call and will not automatically change if a new customer is selected.

If the order changed, set the load time in the CSROrderHolder. If a brand new order was created, send the create order event.

Overrides:
postApplyChanges in class atg.svc.agent.environment.EnvironmentMonitor
Parameters:
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException