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.AbsoluteNameable, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameContextParentable, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.Configured, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener

public class 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  atg.web.messaging.MessageTools mMessageTools
           
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)
          Deprecated. use UIEnvironmentMonitor#resetOrderSearchResults(EnvironmentChangeDetail, EnvironmentChangeState)
 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.
protected  void applyRepriceOrder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method re-prices the order.
 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 generateCatalogAndPricelistChangeForSiteChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Generates dependent catalog and price list change details for a site change.
protected  void generateCatalogChange(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState, atg.multisite.Site pSite, atg.repository.RepositoryItem pCustomerProfile)
          Generates catalog change.
protected  void generateCatalogChangeForCustomerChange(atg.svc.agent.environment.EnvironmentChangeDetail pCustomerChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method gets the current active site using EnvironmentTools.getCurrentActiveSite(EnvironmentChangeState) and calls generateCatalogChange(EnvironmentChangeState, Site, RepositoryItem)
protected  void generateCatalogChangeForSiteChange(atg.svc.agent.environment.EnvironmentChangeDetail pSiteChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method gets the current active customer profile using EnvironmentTools.getCurrentActiveCustomerProfile(EnvironmentChangeState) and calls generateCatalogChange(EnvironmentChangeState, Site, RepositoryItem)
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 generateDependentDetailsForActiveSiteChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Generates change details that result from a change of active site.
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 generateDependentDetailsForPricelistChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Generate details that are dependent on the given price list change.
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 initial 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 generateInitialChangesForSyncCustomerCatalog(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method creates the initial changes details for the synchronize to customer catalog
protected  void generateInitialChangesForSyncCustomerPriceLists(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method creates the initial changes details for the synchronize to customer price list and sale price list.
protected  java.util.Map generateItemPriceSourceParameters(atg.commerce.order.Order pOrder, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          When applying an order change detail for an order that should use original prices, this method is called to generate the extra parameter map that gets passed to the api that generates the ItemPriceSource objects from the order.
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 generateOrderChangeForSiteChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Generates dependent order change details for a site change.
protected  void generatePriceListChange(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState, atg.multisite.Site pSite, atg.repository.RepositoryItem pCustomerProfile)
          Generates price list change.
protected  void generatePriceListChangeForCustomerChange(atg.svc.agent.environment.EnvironmentChangeDetail pCustomerChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method gets the current active site using EnvironmentTools.getCurrentActiveSite(EnvironmentChangeState) and calls generatePriceListChange(EnvironmentChangeState, Site, RepositoryItem)
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.
protected  void generatePriceListChangeForSiteChange(atg.svc.agent.environment.EnvironmentChangeDetail pSiteChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method gets the current active customer profile using EnvironmentTools.getCurrentActiveCustomerProfile(EnvironmentChangeState) and calls generatePriceListChange(EnvironmentChangeState, Site, RepositoryItem)
protected  void generateSalePriceListChange(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState, atg.multisite.Site pSite, atg.repository.RepositoryItem pCustomerProfile)
          Generates sale price list change.
protected  void generateSalePriceListChangeForCustomerChange(atg.svc.agent.environment.EnvironmentChangeDetail pCustomerChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method gets the current active site using EnvironmentTools.getCurrentActiveSite(EnvironmentChangeState) and calls generateSalePriceListChange(EnvironmentChangeState, Site, RepositoryItem)
protected  void generateSalePriceListChangeForSiteChange(atg.svc.agent.environment.EnvironmentChangeDetail pSiteChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method gets the current active customer profile using EnvironmentTools.getCurrentActiveCustomerProfile(EnvironmentChangeState) and calls generateSalePriceListChange(EnvironmentChangeState, Site, RepositoryItem)
protected  void generateSiteChangeForOrderChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Generate the site change detail 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.
 atg.commerce.gifts.GiftlistManager getGiftlistManager()
          Returns property giftlistManager.
 atg.web.messaging.MessageTools getMessageTools()
          Returns the MessageTools component
protected  atg.repository.RepositoryItem getUsersCatalog(atg.repository.RepositoryItem pProfile)
          Returns a catalog.
protected  atg.repository.RepositoryItem getUsersPriceList(atg.repository.RepositoryItem pProfile)
          Returns a price list.
protected  atg.repository.RepositoryItem getUsersPriceList(atg.repository.RepositoryItem pProfile, atg.multisite.Site pSite)
          Returns a price list.
protected  atg.repository.RepositoryItem getUsersSalePriceList(atg.repository.RepositoryItem pProfile)
          Returns a sale price list.
protected  atg.repository.RepositoryItem getUsersSalePriceList(atg.repository.RepositoryItem pProfile, atg.multisite.Site pSite)
          Returns a 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  void initializePricingModelHolder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method initializes the pricing model 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)
          If the order changed, set the load time in the CSROrderHolder.
protected  void repriceOrder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method re-prices the order.
 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)
          Currently this method method does nothing.
 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
protected  void revertPricingModelHolder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method re-initializes the pricing model holder.
protected  void revertRepriceOrder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method reverts pricing saved in the order.
 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
 void setGiftlistManager(atg.commerce.gifts.GiftlistManager pGiftlistManager)
          Sets property giftlistManager.
 void setMessageTools(atg.web.messaging.MessageTools pMessageTools)
           
protected  boolean shouldInitializePricingModelHolder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Deprecated. use CSREnvironmentTools.shouldInitializePricingModelHolder(EnvironmentChangeState)
protected  boolean shouldRepriceOrder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method decides whether order needs to be the priced or not.
protected  boolean shouldUseOriginalPricesForOrder(atg.commerce.order.Order pOrder)
          This method is called whenever an order is loaded into the current environment to determine if the original item unit prices will be preserved on all pricing operations against the order instead of current day pricing.
protected  void updateCallStateData(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Resets the catalog tree state if the catalog was changed.
protected  void updateContainerServices(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          Deprecated. use UIEnvironmentMonitor#updateContainerServices(EnvironmentChangeState)
protected  void validateCommerceItemSites(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail, atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
          This method validates all commerce item sites in the order.
protected  void validateSiteChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail)
          This method validates the site change.
 
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, 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 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

mMessageTools

protected atg.web.messaging.MessageTools mMessageTools
Constructor Detail

CSREnvironmentMonitor

public CSREnvironmentMonitor()
Method Detail

setGiftlistManager

public void setGiftlistManager(atg.commerce.gifts.GiftlistManager pGiftlistManager)
Sets property giftlistManager.

Parameters:
pGiftlistManager - the giftlistManager class which provides a high level business layer interface to giftlists.

getGiftlistManager

public atg.commerce.gifts.GiftlistManager getGiftlistManager()
Returns property giftlistManager.

Returns:
The value of the property GiftlistManager.

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

getMessageTools

public atg.web.messaging.MessageTools getMessageTools()
Returns the MessageTools component

Returns:
MessageTools

setMessageTools

public void setMessageTools(atg.web.messaging.MessageTools pMessageTools)

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, CSREnvironmentConstants.ENV_CHG_SYNC_TO_CUSTOMER_CATALOG, CSREnvironmentConstants.ENV_CHG_SYNC_TO_CUSTOMER_PRICE_LISTS, generateInitialChangesForChangeCatalogAndPriceList(EnvironmentChangeState), generateInitialChangesForChangeOrder(EnvironmentChangeState), generateInitialChangesForCreateNewOrder(EnvironmentChangeState), generateInitialChangesForInitEnvironment(EnvironmentChangeState), generateInitialChangesForStartCall(EnvironmentChangeState), generateInitialChangesForSyncCustomer(EnvironmentChangeState), generateInitialChangesForSyncCustomerCatalog(EnvironmentChangeState), generateInitialChangesForSyncCustomerPriceLists(EnvironmentChangeState)

generateInitialChangesForInitEnvironment

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

This method initializes order, price lists and Site. If the site detail is not created in the ServiceEnvironmentMonitor.generateInitialChangesForInitEnvironment(EnvironmentChangeState pEnvironmentChangeState)
then this method looks in the CSRAgentTools.getAgentDefaultSiteId() to initialize the agent default site. If the site id is not blank, this method calls CSREnvironmentTools.isSiteValidForEnvironment(String) to verify, whether the site is a valid site. If it is not a valid site, then the site is not loaded.

Parameters:
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
CSREnvironmentTools#isSiteValidForEnvironment(String)}

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
See Also:
generateInitialChangesForSyncCustomerCatalog(EnvironmentChangeState), generateInitialChangesForSyncCustomerPriceLists(EnvironmentChangeState)

generateInitialChangesForSyncCustomerCatalog

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

Parameters:
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
#compareCurrentCatalog(String)}

generateInitialChangesForSyncCustomerPriceLists

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

Parameters:
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
#compareCurrentPriceList(String)}, compareCurrentSalePriceList(String)

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:
validateCommerceItemSites(EnvironmentChangeDetail, EnvironmentChangeState), generateCustomerChangeForOrderChange(EnvironmentChangeDetail, EnvironmentChangeState), generatePricelistChangeForOrderChange(EnvironmentChangeDetail, EnvironmentChangeState), generateSiteChangeForOrderChange(EnvironmentChangeDetail, EnvironmentChangeState)

validateCommerceItemSites

protected void validateCommerceItemSites(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                         atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                  throws atg.svc.agent.environment.EnvironmentException
This method validates all commerce item sites in the order.

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

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.

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
generateCatalogChangeForCustomerChange(EnvironmentChangeDetail, EnvironmentChangeState), generatePriceListChangeForCustomerChange(EnvironmentChangeDetail, EnvironmentChangeState), generateSalePriceListChangeForCustomerChange(EnvironmentChangeDetail, EnvironmentChangeState)

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), generateDependentDetailsForActiveSiteChange(EnvironmentChangeDetail, EnvironmentChangeState)

generateDependentDetailsForPricelistChange

protected void generateDependentDetailsForPricelistChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                                          atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                                   throws atg.svc.agent.environment.EnvironmentChangeDetailConflict,
                                                          atg.svc.agent.environment.EnvironmentException
Generate details that are dependent on the given price list change.

Parameters:
pEnvironmentChangeDetail - the price list detail
pEnvironmentChangeState - the environment change state object
Throws:
atg.svc.agent.environment.EnvironmentChangeDetailConflict
atg.svc.agent.environment.EnvironmentException

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.

Also initializes the pricing model holder and re-prices the order.

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), shouldInitializePricingModelHolder(EnvironmentChangeState), initializePricingModelHolder(EnvironmentChangeState), shouldRepriceOrder(EnvironmentChangeState), applyRepriceOrder(EnvironmentChangeState)

revertChanges

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

Also re-initializes the pricing model holder and calls revertRepriceOrder(EnvironmentChangeState) to revert order pricing.

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

revertActiveCustomerChangeDetail

public void revertActiveCustomerChangeDetail(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                             atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
Currently this method method does nothing.

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. 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

generateItemPriceSourceParameters

protected java.util.Map generateItemPriceSourceParameters(atg.commerce.order.Order pOrder,
                                                          atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
When applying an order change detail for an order that should use original prices, this method is called to generate the extra parameter map that gets passed to the api that generates the ItemPriceSource objects from the order.

By default, this method returns null.

Parameters:
pOrder -
pEnvironmentChangeState -
Returns:
Map of extra parameters used to generate item price source objects from the Order.

shouldUseOriginalPricesForOrder

protected boolean shouldUseOriginalPricesForOrder(atg.commerce.order.Order pOrder)
                                           throws atg.svc.agent.environment.EnvironmentException
This method is called whenever an order is loaded into the current environment to determine if the original item unit prices will be preserved on all pricing operations against the order instead of current day pricing.

Currently returns true for submitted orders

Parameters:
pOrder -
Returns:
true if the original unit prices will be preserved.
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
Deprecated. use UIEnvironmentMonitor#resetOrderSearchResults(EnvironmentChangeDetail, EnvironmentChangeState)

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
See Also:
CSREnvironmentTools.getCurrentCatalogHolder()

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
See Also:
CSREnvironmentTools.getCurrentCatalogHolder()

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. false is returned if they reference the same catalog. true otherwise.

Parameters:
pCatalogId -
Returns:
false 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. false is returned if they reference the same price list.true otherwise.

Parameters:
pPriceListId -
Returns:
false 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. false is returned if they reference the same price list.true otherwise.

Parameters:
pPriceListId -
Returns:
false 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 catalog.

This method gets the current site from EnvironmentTools.getCurrentSite() and calls CSREnvironmentTools.getUsersCatalog(RepositoryItem, Site).

Parameters:
pProfile -
Returns:
price list item
Throws:
atg.commerce.pricing.priceLists.PriceListException
See Also:
CSREnvironmentTools.getUsersCatalog(RepositoryItem, Site)

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.

It also restores any gift handling instructions that may have been on the order berfore the switch.

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 price list.

This method gets the current site from EnvironmentTools.getCurrentSite() and calls getUsersPriceList(RepositoryItem, Site).

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

getUsersPriceList

protected atg.repository.RepositoryItem getUsersPriceList(atg.repository.RepositoryItem pProfile,
                                                          atg.multisite.Site pSite)
                                                   throws atg.commerce.pricing.priceLists.PriceListException
Returns a price list.

The PriceListManager.determinePriceList(RepositoryItem, RepositoryItem, String) is called to get the right price list.

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

getUsersSalePriceList

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

This method gets the current site from EnvironmentTools.getCurrentSite() and calls getUsersSalePriceList(RepositoryItem, Site).

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

getUsersSalePriceList

protected atg.repository.RepositoryItem getUsersSalePriceList(atg.repository.RepositoryItem pProfile,
                                                              atg.multisite.Site pSite)
                                                       throws atg.commerce.pricing.priceLists.PriceListException
Returns a sale price list.

The PriceListManager.determinePriceList(RepositoryItem, RepositoryItem, String) is called to get the right price list.

Parameters:
pProfile -
Returns:
price list item
Throws:
atg.commerce.pricing.priceLists.PriceListException
See Also:
PriceListManager.determinePriceList(RepositoryItem, 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
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
See Also:
updateCallStateData(EnvironmentChangeState)

updateContainerServices

protected void updateContainerServices(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                throws atg.svc.agent.environment.EnvironmentException
Deprecated. use UIEnvironmentMonitor#updateContainerServices(EnvironmentChangeState)

This method updates PaymentGroupMapContainerService and ShippingGroupMapContainerService.

if the user or order is changing CSREnvironmentTools.cleanPaymentGroupContainerService() is called to clean payment group related information.

if the user is changing CSREnvironmentTools.initializeShippingGroupContainerService(Profile, Order) is called to reinitialize the shipping group related information. The existing shipping groups are cleared.

if only the order is changing CSREnvironmentTools.initializeShippingGroupContainerService(Profile, Order) is called to add order's shipping group information and the existing shipping groups are NOT cleared.

Parameters:
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
CSREnvironmentTools#cleanPaymentGroupContainerService()}, CSREnvironmentTools.initializeShippingGroupContainerService(Profile, Order)

generateDependentDetailsForActiveSiteChange

protected void generateDependentDetailsForActiveSiteChange(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 site.

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

validateSiteChange

protected void validateSiteChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail)
                           throws atg.svc.agent.environment.EnvironmentException
This method validates the site change.

This method calls CSREnvironmentTools.isSiteValidForEnvironment(String) to see whether the changing site is valid or not. If the site is not valid, error message is added to the message bar and EnvironmentException is thrown.

Parameters:
pEnvironmentChangeDetail -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
CSREnvironmentTools#isSiteValidForEnvironment(String)}

generateOrderChangeForSiteChange

protected void generateOrderChangeForSiteChange(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 site change.

If the site switch happens out side of the current site group, then new order is created.

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

generateCatalogAndPricelistChangeForSiteChange

protected void generateCatalogAndPricelistChangeForSiteChange(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 site change.

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
generatePriceListChangeForSiteChange(EnvironmentChangeDetail, EnvironmentChangeState), generateSalePriceListChangeForSiteChange(EnvironmentChangeDetail, EnvironmentChangeState), generateCatalogChangeForSiteChange(EnvironmentChangeDetail, EnvironmentChangeState)

generateCatalogChangeForSiteChange

protected void generateCatalogChangeForSiteChange(atg.svc.agent.environment.EnvironmentChangeDetail pSiteChangeDetail,
                                                  atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                           throws atg.svc.agent.environment.EnvironmentException
This method gets the current active customer profile using EnvironmentTools.getCurrentActiveCustomerProfile(EnvironmentChangeState) and calls generateCatalogChange(EnvironmentChangeState, Site, RepositoryItem)

Parameters:
pSiteChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
EnvironmentTools#getCurrentActiveCustomerProfile(EnvironmentChangeState)}, #generateCatalogChange(EnvironmentChangeState, Site, RepositoryItem)}

generatePriceListChangeForSiteChange

protected void generatePriceListChangeForSiteChange(atg.svc.agent.environment.EnvironmentChangeDetail pSiteChangeDetail,
                                                    atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                             throws atg.svc.agent.environment.EnvironmentException
This method gets the current active customer profile using EnvironmentTools.getCurrentActiveCustomerProfile(EnvironmentChangeState) and calls generatePriceListChange(EnvironmentChangeState, Site, RepositoryItem)

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
EnvironmentTools#getCurrentActiveCustomerProfile(EnvironmentChangeState)}, #generatePriceListChange(EnvironmentChangeState, Site, RepositoryItem)}

generateSalePriceListChangeForSiteChange

protected void generateSalePriceListChangeForSiteChange(atg.svc.agent.environment.EnvironmentChangeDetail pSiteChangeDetail,
                                                        atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                                 throws atg.svc.agent.environment.EnvironmentException
This method gets the current active customer profile using EnvironmentTools.getCurrentActiveCustomerProfile(EnvironmentChangeState) and calls generateSalePriceListChange(EnvironmentChangeState, Site, RepositoryItem)

Parameters:
pEnvironmentChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
EnvironmentTools#getCurrentActiveCustomerProfile(EnvironmentChangeState)}, #generateSalePriceListChange(EnvironmentChangeState, Site, RepositoryItem)}

generateCatalogChangeForCustomerChange

protected void generateCatalogChangeForCustomerChange(atg.svc.agent.environment.EnvironmentChangeDetail pCustomerChangeDetail,
                                                      atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                               throws atg.svc.agent.environment.EnvironmentException
This method gets the current active site using EnvironmentTools.getCurrentActiveSite(EnvironmentChangeState) and calls generateCatalogChange(EnvironmentChangeState, Site, RepositoryItem)

Parameters:
pCustomerChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
EnvironmentTools#getCurrentActiveSite(EnvironmentChangeState)}, #generateCatalogChange(EnvironmentChangeState, Site, RepositoryItem)}

generateSalePriceListChangeForCustomerChange

protected void generateSalePriceListChangeForCustomerChange(atg.svc.agent.environment.EnvironmentChangeDetail pCustomerChangeDetail,
                                                            atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                                     throws atg.svc.agent.environment.EnvironmentException
This method gets the current active site using EnvironmentTools.getCurrentActiveSite(EnvironmentChangeState) and calls generateSalePriceListChange(EnvironmentChangeState, Site, RepositoryItem)

Parameters:
pCustomerChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
EnvironmentTools#getCurrentActiveSite(EnvironmentChangeState)}, #generateSalePriceListChange(EnvironmentChangeState, Site, RepositoryItem)}

generatePriceListChangeForCustomerChange

protected void generatePriceListChangeForCustomerChange(atg.svc.agent.environment.EnvironmentChangeDetail pCustomerChangeDetail,
                                                        atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                                 throws atg.svc.agent.environment.EnvironmentException
This method gets the current active site using EnvironmentTools.getCurrentActiveSite(EnvironmentChangeState) and calls generatePriceListChange(EnvironmentChangeState, Site, RepositoryItem)

Parameters:
pCustomerChangeDetail -
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
EnvironmentTools#getCurrentActiveSite(EnvironmentChangeState)}, #generatePriceListChange(EnvironmentChangeState, Site, RepositoryItem)}

generateCatalogChange

protected void generateCatalogChange(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState,
                                     atg.multisite.Site pSite,
                                     atg.repository.RepositoryItem pCustomerProfile)
                              throws atg.svc.agent.environment.EnvironmentException
Generates catalog change.

The catalog change is generated if it meets any of the following conditions.

Parameters:
pEnvironmentChangeState -
pSite -
pCustomerProfile -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
CSREnvironmentTools.getUsersCatalog(RepositoryItem, Site)

generatePriceListChange

protected void generatePriceListChange(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState,
                                       atg.multisite.Site pSite,
                                       atg.repository.RepositoryItem pCustomerProfile)
                                throws atg.svc.agent.environment.EnvironmentException
Generates price list change.

The price list change is generated if it meets any of the following conditions.

Parameters:
pEnvironmentChangeState -
pSite -
pCustomerProfile -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
getUsersPriceList(RepositoryItem, Site)

generateSalePriceListChange

protected void generateSalePriceListChange(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState,
                                           atg.multisite.Site pSite,
                                           atg.repository.RepositoryItem pCustomerProfile)
                                    throws atg.svc.agent.environment.EnvironmentException
Generates sale price list change.

The sale price list change is generated if it meets any of the following conditions.

Parameters:
pEnvironmentChangeDetail -
pSite -
pCustomerProfile -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
getUsersSalePriceList(RepositoryItem, Site)

generateSiteChangeForOrderChange

protected void generateSiteChangeForOrderChange(atg.svc.agent.environment.EnvironmentChangeDetail pEnvironmentChangeDetail,
                                                atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                         throws atg.svc.agent.environment.EnvironmentException
Generate the site change detail based on an order change.

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

initializePricingModelHolder

protected void initializePricingModelHolder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                     throws atg.svc.agent.environment.EnvironmentException
This method initializes the pricing model holder.

The pricing model holder is obtained from CSREnvironmentTools.getCurrentOrderPricingModelHolder().

Parameters:
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
EnvironmentTools.getSiteContext(Site), CSREnvironmentTools.getCurrentOrderPricingModelHolder()

applyRepriceOrder

protected void applyRepriceOrder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                          throws atg.svc.agent.environment.EnvironmentException
This method re-prices the order.

The price list or sale price list or order or site change warrants order pricing. If any of the above environment object changes, the order could be re-priced.

Based on the changes in the pEnvironmentChangeState, this method decides to re-price the order. If the any of the above stated environment object changes, then the order could be re-priced.

If any of the above change warrants order re-price, then this method calls shouldRepriceOrder(EnvironmentChangeState) to find out whether to re-price the order or not. If the order needs to be re-priced, this method returns true and the order is re-priced.

Parameters:
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
repriceOrder(EnvironmentChangeState)

repriceOrder

protected void repriceOrder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                     throws atg.svc.agent.environment.EnvironmentException
This method re-prices the order.

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

revertRepriceOrder

protected void revertRepriceOrder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
This method reverts pricing saved in the order.

Parameters:
pEnvironmentChangeState -
See Also:
repriceOrder(EnvironmentChangeState)

updateCallStateData

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

Remembers 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 current call is active the explicit settings are saved in CallState.getStateDataMap(). The following keys are used to save catalog entry based on multi site support.

If the CSRAgentTools.isMultiSiteEnabled() returns true, the explicit catalog settings are saved in CSREnvironmentConstants.CSR_CURRENT_CALL_EXPLICIT_SITE_ID_TO_CATALOG map.

If the CSRAgentTools.isMultiSiteEnabled() returns false, explicit catalog setting is saved in the CSREnvironmentConstants.CSR_CURRENT_CALL_EXPLICIT_CATALOG.

If the site change result in switching to a non current site group, then the explicit settings are removed from the call state.

Parameters:
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
CSREnvironmentConstants#CSR_CURRENT_CALL_EXPLICIT_CATALOG}, CSREnvironmentConstants.CSR_CURRENT_CALL_EXPLICIT_PRICELIST, CSREnvironmentConstants.CSR_CURRENT_CALL_EXPLICIT_SALEPRICELIST, CSREnvironmentConstants.CSR_CURRENT_CALL_EXPLICIT_SITE_ID_TO_CATALOG

revertPricingModelHolder

protected void revertPricingModelHolder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
This method re-initializes the pricing model holder.

The pricing model holder is obtained from CSREnvironmentTools.getCurrentOrderPricingModelHolder().

Parameters:
pEnvironmentChangeState -
See Also:
EnvironmentTools.getSiteContext(Site), CSREnvironmentTools.getCurrentOrderPricingModelHolder()

shouldRepriceOrder

protected boolean shouldRepriceOrder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                              throws atg.svc.agent.environment.EnvironmentException
This method decides whether order needs to be the priced or not.

The list price list or sale price list or order or site group change warrants order re-pricing. If any of the above environment object changes, this method checks the following additional condition. Otherwise returns returns false.

First this method checks to see if the order contains any commerce items. If there is no commerce item in the order, order can't be priced and returns false.

If order contains commerce items, then this method checks to see if the order is modifiable. If the order is not modifiable, then returns false. Otherwise true.

Parameters:
pEnvironmentChangeState -
Returns:
if the order needs to priced, returns true. Otherwise false.
Throws:
atg.svc.agent.environment.EnvironmentException
See Also:
CSRAgentTools.isOrderModifiable(Order)

shouldInitializePricingModelHolder

protected boolean shouldInitializePricingModelHolder(atg.svc.agent.environment.EnvironmentChangeState pEnvironmentChangeState)
                                              throws atg.svc.agent.environment.EnvironmentException
Deprecated. use CSREnvironmentTools.shouldInitializePricingModelHolder(EnvironmentChangeState)

This method decides whether the pricing model holder needs to be initialized based on the changes being made to the environment.

This method returns true if either the order or user is being changed in the environment.

Parameters:
pEnvironmentChangeState -
Returns:
if the pricing model holder should be initialized, returns true. Otherwise false.
Throws:
atg.svc.agent.environment.EnvironmentException