atg.commerce.order.edit
Class HandlingInstructionEditHandler

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.order.edit.CloneEditHandler
              extended by atg.commerce.order.edit.CollectionEditHandler
                  extended by atg.commerce.order.edit.ListEditHandler
                      extended by atg.commerce.order.edit.HandlingInstructionEditHandler
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 HandlingInstructionEditHandler
extends ListEditHandler

This handler updates handling instructions between the clone and original order.

The ShippingGroupEditHandler must execute before this handler to first reconcile the shipping groups to which the handling instructions are attached.

See Also:
ListEditHandler

Field Summary
static java.lang.String CLASS_VERSION
           
protected  CommerceItemEditHandler mCommerceItemEditHandler
           
protected  atg.commerce.gifts.GiftlistManager mGiftlistManager
           
protected  atg.commerce.order.HandlingInstructionManager mHandlingInstructionManager
           
protected  ShippingGroupEditHandler mShippingGroupEditHandler
           
 
Fields inherited from class atg.commerce.order.edit.CollectionEditHandler
mCollectionPropertyName, mSortPropertyName, mThrowExceptionsForCollectionChanges, STATE_CLONETOORIGINAL_MAP, STATE_ORIGINALTOCLONE_MAP
 
Fields inherited from class atg.commerce.order.edit.CloneEditHandler
mFulfillmentMessageSender, mKeyPropertyName, mOrderFulfillmentTools, mPropertiesToCopyOnUpdate, STATE_ADD_ITEMS, STATE_DELETE_ITEMS, STATE_UPDATE_ITEMS
 
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
HandlingInstructionEditHandler()
           
 
Method Summary
protected  void addItem(CloneEditState pCloneEditState, AddItem pAddItem)
          Overrides add item to use the handling group container interfaces to add the new item.
protected  void adjustHandlingInstructionReferences(CloneEditState pCloneEditState, atg.commerce.order.HandlingInstruction pHandlingInstruction)
          Changes the commerceItemId and shippingGroupId of the handling instruction to the original order counter parts.
protected  void deleteItem(CloneEditState pCloneEditState, DeleteItem pDeleteItem)
          Overrides delete item to use the handling instruction container interfaces to remove the item
protected  void detectChangesToCollection(CloneEditState pCloneEditState, java.lang.Object pOriginalCollectionContainer, java.lang.Object pCloneCollectionContainer)
          Extends the base behavior by first getting the shipping group lists from the containers and calling super with the shipping group lists.
 CommerceItemEditHandler getCommerceItemEditHandler()
           
 atg.commerce.gifts.GiftlistManager getGiftlistManager()
          All Giftlist manipulations are done with this.
 atg.commerce.order.HandlingInstructionManager getHandlingInstructionManager()
          The HandlingInstruction manager
 ShippingGroupEditHandler getShippingGroupEditHandler()
           
protected  void mapOriginalToClone(CloneEditState pCloneEditState, atg.commerce.order.Order pOriginalOrder, atg.commerce.order.Order pCloneOrder)
          Overrides base behavior to process all the CommerceItemContainers starting with the order.
 void reconcileGiftlistRepository(CloneEditState pCloneEditState)
          Reconciles the gift list purchase quantitys for updated and added giftlist handling instructions
 void setCommerceItemEditHandler(CommerceItemEditHandler pCommerceItemEditHandler)
           
 void setGiftlistManager(atg.commerce.gifts.GiftlistManager pGiftlistManager)
           
 void setHandlingInstructionManager(atg.commerce.order.HandlingInstructionManager pHandlingInstructionManager)
          Specifies the HandlingInstructionManager.
 void setShippingGroupEditHandler(ShippingGroupEditHandler pShippingGroupEditHandler)
           
protected  void validateCollection(atg.commerce.order.Order pOriginalOrder, atg.commerce.order.Order pCloneOrder)
          Validates the handling instruction collections for each shipping group in the order.
 
Methods inherited from class atg.commerce.order.edit.CollectionEditHandler
applyChanges, detectChanges, detectDeletes, findCounterpartObject, getCloneToOriginalMap, getCollection, getCollectionPropertyName, getMatchingCloneKey, getMatchingOriginalKey, getOriginalToCloneMap, getSortPropertyName, initializeCloneEditState, isThrowExceptionsForCollectionChanges, mapOriginalToCloneCollection, saveOriginalToCloneObjectMappings, setCollectionPropertyName, setSortPropertyName, setThrowExceptionsForCollectionChanges, sortCollection, validateCloneOrder, validateCollectionSize
 
Methods inherited from class atg.commerce.order.edit.CloneEditHandler
addAddItem, addDeleteItem, addStateData, addUpdateItem, cloneOrder, copyPricingModels, createAddItem, createDeleteItem, createUpdateItem, generateModifications, getAddItems, getCloneEditManager, getDeleteItems, getFulfillmentMessageSender, getKeyForObject, getKeyPropertyName, getObjectType, getOrderFulfillmentTools, getPropertiesToCopy, getPropertiesToCopyOnUpdate, getStateData, getStateMap, getUpdateItems, initializeReconciliationProcess, isAddedItem, parseConfigString, processAddItems, processDeleteItems, processUpdateItems, reconcileObjectProperties, sendFulfillmentNotifications, sendMessage, setCloneEditManager, setFulfillmentMessageSender, setKeyPropertyName, setOrderFulfillmentTools, setPropertiesToCopyOnUpdate, updateItem
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
See Also:
Constant Field Values

mGiftlistManager

protected atg.commerce.gifts.GiftlistManager mGiftlistManager

mCommerceItemEditHandler

protected CommerceItemEditHandler mCommerceItemEditHandler

mShippingGroupEditHandler

protected ShippingGroupEditHandler mShippingGroupEditHandler

mHandlingInstructionManager

protected atg.commerce.order.HandlingInstructionManager mHandlingInstructionManager
Constructor Detail

HandlingInstructionEditHandler

public HandlingInstructionEditHandler()
Method Detail

setGiftlistManager

public void setGiftlistManager(atg.commerce.gifts.GiftlistManager pGiftlistManager)

getGiftlistManager

public atg.commerce.gifts.GiftlistManager getGiftlistManager()
All Giftlist manipulations are done with this.


getCommerceItemEditHandler

public CommerceItemEditHandler getCommerceItemEditHandler()

setCommerceItemEditHandler

public void setCommerceItemEditHandler(CommerceItemEditHandler pCommerceItemEditHandler)

getShippingGroupEditHandler

public ShippingGroupEditHandler getShippingGroupEditHandler()

setShippingGroupEditHandler

public void setShippingGroupEditHandler(ShippingGroupEditHandler pShippingGroupEditHandler)

setHandlingInstructionManager

public void setHandlingInstructionManager(atg.commerce.order.HandlingInstructionManager pHandlingInstructionManager)
Specifies the HandlingInstructionManager.

Parameters:
pHandlingInstructionManager - a HandlingInstructionManager value

getHandlingInstructionManager

public atg.commerce.order.HandlingInstructionManager getHandlingInstructionManager()
The HandlingInstruction manager

Returns:
a HandlingInstructionManager value

mapOriginalToClone

protected void mapOriginalToClone(CloneEditState pCloneEditState,
                                  atg.commerce.order.Order pOriginalOrder,
                                  atg.commerce.order.Order pCloneOrder)
                           throws atg.commerce.CommerceException
Overrides base behavior to process all the CommerceItemContainers starting with the order.

Overrides:
mapOriginalToClone in class CollectionEditHandler
Throws:
atg.commerce.CommerceException
See Also:
CollectionEditHandler.mapOriginalToCloneCollection(CloneEditState, Collection, Collection)

detectChangesToCollection

protected void detectChangesToCollection(CloneEditState pCloneEditState,
                                         java.lang.Object pOriginalCollectionContainer,
                                         java.lang.Object pCloneCollectionContainer)
                                  throws atg.commerce.CommerceException
Extends the base behavior by first getting the shipping group lists from the containers and calling super with the shipping group lists.

Overrides:
detectChangesToCollection in class CollectionEditHandler
Parameters:
pCloneEditState - the CloneEditState that was created at the beginning of the clone process.
Throws:
atg.commerce.CommerceException

addItem

protected void addItem(CloneEditState pCloneEditState,
                       AddItem pAddItem)
                throws atg.commerce.CommerceException
Overrides add item to use the handling group container interfaces to add the new item.

Overrides:
addItem in class ListEditHandler
Parameters:
pCloneEditState -
pAddItem -
Throws:
atg.commerce.CommerceException

deleteItem

protected void deleteItem(CloneEditState pCloneEditState,
                          DeleteItem pDeleteItem)
                   throws atg.commerce.CommerceException
Overrides delete item to use the handling instruction container interfaces to remove the item

Overrides:
deleteItem in class CollectionEditHandler
Parameters:
pCloneEditState -
pDeleteItem - the DeleteItem object
Throws:
atg.commerce.CommerceException

adjustHandlingInstructionReferences

protected void adjustHandlingInstructionReferences(CloneEditState pCloneEditState,
                                                   atg.commerce.order.HandlingInstruction pHandlingInstruction)
Changes the commerceItemId and shippingGroupId of the handling instruction to the original order counter parts.

Parameters:
pCloneEditState -
pHandlingInstruction -

reconcileGiftlistRepository

public void reconcileGiftlistRepository(CloneEditState pCloneEditState)
                                 throws atg.commerce.CommerceException
Reconciles the gift list purchase quantitys for updated and added giftlist handling instructions

Parameters:
pCloneEditState -
Throws:
atg.commerce.CommerceException

validateCollection

protected void validateCollection(atg.commerce.order.Order pOriginalOrder,
                                  atg.commerce.order.Order pCloneOrder)
                           throws atg.commerce.CommerceException
Validates the handling instruction collections for each shipping group in the order.

Overrides:
validateCollection in class CollectionEditHandler
Throws:
atg.commerce.CommerceException
See Also:
CollectionEditHandler.validateCollectionSize(Object, Object)