atg.commerce.order.edit
Class ShippingGroupEditHandler

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

public class ShippingGroupEditHandler
extends ListEditHandler

This handler updates shipping groups between the clone and original order.

See Also:
ListEditHandler

Field Summary
static java.lang.String CLASS_VERSION
           
protected  ShippingGroupManager mShippingGroupManager
           
 
Fields inherited from class atg.commerce.order.edit.CollectionEditHandler
mCollectionPropertyName, mSortPropertyName, mSubPropertyHandlers, 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
ShippingGroupEditHandler()
           
 
Method Summary
protected  void addItem(CloneEditState pCloneEditState, AddItem pAddItem)
          Overrides the base impl to use the shipping group container interfaces to add the new shipping group.
protected  void copyShippingGroupPricingModels(CloneEditState pCloneEditState)
          Copies the pricing models from the original to clone shipping groups.
 Modification createShippingGroupAddedModification(ShippingGroup pShippingGroup, Order pOrder)
          Creates a Modification object that represents a shipping group add.
 Modification createShippingGroupUpdateModification(java.lang.String pShippingGroupId)
          Creates a Modification object that represents a shipping group update.
protected  void deleteItem(CloneEditState pCloneEditState, DeleteItem pDeleteItem)
          Overrides the base impl to use the shipping group container interfaces to remove the shipping group
 java.util.List generateModifications(CloneEditState pCloneEditState)
          Generates the list of Modification objects for shipping groups using the AddItem and UpdateItem objects.
 ShippingGroupManager getShippingGroupManager()
          Return the ShippingGroupManager
 void initializeCloneEditState(CloneEditState pCloneEditState)
          Extends base behavior to copy the pricing models from the original to clone shipping groups.
 void setShippingGroupManager(ShippingGroupManager pShippingGroupManager)
           
protected  void updateItem(CloneEditState pCloneEditState, UpdateItem pUpdateItem)
          Extends updateItem to detect changes in the amountinfo object
 
Methods inherited from class atg.commerce.order.edit.CollectionEditHandler
applyChanges, detectChanges, detectChangesToCollection, detectDeletes, executeSubPropertyHandlerInitialization, executeSubPropertyHandlerUpdates, executeSubPropertyHandlerValidation, findCounterpartObject, getCloneToOriginalMap, getCollection, getCollectionPropertyName, getMatchingCloneKey, getMatchingOriginalKey, getOriginalToCloneMap, getSortedCollection, getSortPropertyName, getSubPropertyHandlers, handleMissingOriginalObject, isSubPropertyHandlers, isThrowExceptionsForCollectionChanges, mapOriginalToClone, mapOriginalToCloneCollection, saveOriginalToCloneObjectMappings, setCollectionPropertyName, setSortPropertyName, setSubPropertyHandlers, setThrowExceptionsForCollectionChanges, sortCollection, validateCloneOrder, validateCollection, validateCollection, validateCollectionSize
 
Methods inherited from class atg.commerce.order.edit.CloneEditHandler
addAddItem, addDeleteItem, addStateData, addUpdateItem, adjustCloneCommerceIdReferences, adjustOriginalCommerceIdReferences, cloneOrder, copyPricingModels, createAddItem, createDeleteItem, createUpdateItem, 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
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

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

mShippingGroupManager

protected ShippingGroupManager mShippingGroupManager
Constructor Detail

ShippingGroupEditHandler

public ShippingGroupEditHandler()
Method Detail

getShippingGroupManager

public ShippingGroupManager getShippingGroupManager()
Return the ShippingGroupManager

Returns:
ShippingGroupManager

setShippingGroupManager

public void setShippingGroupManager(ShippingGroupManager pShippingGroupManager)

addItem

protected void addItem(CloneEditState pCloneEditState,
                       AddItem pAddItem)
                throws CommerceException
Overrides the base impl to use the shipping group container interfaces to add the new shipping group.

Overrides:
addItem in class ListEditHandler
Parameters:
pCloneEditState -
pAddItem -
Throws:
CommerceException
See Also:
ShippingGroupContainer.addShippingGroup(ShippingGroup, int)

deleteItem

protected void deleteItem(CloneEditState pCloneEditState,
                          DeleteItem pDeleteItem)
                   throws CommerceException
Overrides the base impl to use the shipping group container interfaces to remove the shipping group

Overrides:
deleteItem in class CollectionEditHandler
Parameters:
pCloneEditState -
pDeleteItem - the DeleteItem object
Throws:
CommerceException
See Also:
ShippingGroupManager.removeShippingGroupFromOrder(Order, String), ShippingGroupContainer.removeShippingGroup(String)

updateItem

protected void updateItem(CloneEditState pCloneEditState,
                          UpdateItem pUpdateItem)
                   throws CommerceException
Extends updateItem to detect changes in the amountinfo object

Overrides:
updateItem in class CloneEditHandler
Throws:
CommerceException
See Also:
CloneEditManager.detectUpdatesInFinalAmountInfo(Object, Object, String)

generateModifications

public java.util.List generateModifications(CloneEditState pCloneEditState)
Generates the list of Modification objects for shipping groups using the AddItem and UpdateItem objects.

One Modification is created for each newly added payment group and each updated payment group. No Modification is sent for an updated payment group if priceInfo was the only property updated.

Overrides:
generateModifications in class CloneEditHandler
Parameters:
pCloneEditState -
Returns:
List of Modification objects

createShippingGroupAddedModification

public Modification createShippingGroupAddedModification(ShippingGroup pShippingGroup,
                                                         Order pOrder)
Creates a Modification object that represents a shipping group add.

Parameters:
pShippingGroup -
pOrder -
Returns:
Modification object

createShippingGroupUpdateModification

public Modification createShippingGroupUpdateModification(java.lang.String pShippingGroupId)
Creates a Modification object that represents a shipping group update.

Parameters:
pShippingGroupId -
Returns:
Modification object

initializeCloneEditState

public void initializeCloneEditState(CloneEditState pCloneEditState)
                              throws CommerceException
Extends base behavior to copy the pricing models from the original to clone shipping groups.

Overrides:
initializeCloneEditState in class CollectionEditHandler
Throws:
CommerceException
See Also:
copyShippingGroupPricingModels(CloneEditState)

copyShippingGroupPricingModels

protected void copyShippingGroupPricingModels(CloneEditState pCloneEditState)
                                       throws CommerceException
Copies the pricing models from the original to clone shipping groups.

Parameters:
pCloneEditState -
Throws:
CommerceException
See Also:
CloneEditHandler.copyPricingModels(Object, Object, String)