atg.commerce.order.edit
Class RelationshipEditHandler

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.RelationshipEditHandler
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 RelationshipEditHandler
extends ListEditHandler

This handler updates relationships between the clone and original order.

See Also:
ListEditHandler

Field Summary
static java.lang.String CLASS_VERSION
           
protected  CommerceItemEditHandler mCommerceItemEditHandler
           
protected  PaymentGroupEditHandler mPaymentGroupEditHandler
           
protected  ShippingGroupEditHandler mShippingGroupEditHandler
           
 
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
RelationshipEditHandler()
           
 
Method Summary
protected  void addItem(CloneEditState pCloneEditState, AddItem pAddItem)
          Overrides add item to use the commerce item container interfaces to add the new item.
protected  void adjustCommerceItemRelationship(CloneEditState pCloneEditState, CommerceItemRelationship pCommerceItemRelationship)
          Updates a CommerceItemRelationship so that the commerce item side of the relationship points to the original order's commerce item.
protected  void adjustOrderRelationship(CloneEditState pCloneEditState, OrderRelationship pOrderRelationship)
          Updates the relationships for a payment group.
protected  void adjustPaymentGroupRelationship(CloneEditState pCloneEditState, PaymentGroupRelationship pPaymentGroupRelationship)
          Updates a PaymentGroupRelationship so that the payment group side of the relationship points to the original order's payment group.
protected  void adjustRelationship(CloneEditState pCloneEditState, Relationship pRelationship)
          adjusts a relationships properites so they correspond to the original order's objects.
protected  void adjustShippingGroupRelationship(CloneEditState pCloneEditState, ShippingGroupRelationship pShippingGroupRelationship)
          Updates a pShippingGroupRelationship so that the shipping group side of the relationship points to the original order's shipping group.
protected  void deleteItem(CloneEditState pCloneEditState, DeleteItem pDeleteItem)
          Overrides delete item to use the relationship container interfaces to remove the relationship
protected  Relationship findRelationshipsCloneCounterpart(CloneEditState pCloneEditState, Relationship pOriginalRelationship)
          Finds the counterpart relationship to the given original relationship item
 CommerceItemEditHandler getCommerceItemEditHandler()
          Returns the Commerce Item Edit Handler
 PaymentGroupEditHandler getPaymentGroupEditHandler()
          Returns the PaymentGroupEditHandler
 ShippingGroupEditHandler getShippingGroupEditHandler()
          Returns the Shipping Group Edit Handler
protected  void removeRelationshipFromContainers(CloneEditState pCloneEditState, DeleteItem pDeleteItem)
          Removes the deleted relationship from the containers on both sides on the relationship
 void setCommerceItemEditHandler(CommerceItemEditHandler pCommerceItemEditHandler)
           
 void setPaymentGroupEditHandler(PaymentGroupEditHandler pPaymentGroupEditHandler)
           
 void setShippingGroupEditHandler(ShippingGroupEditHandler pShippingGroupEditHandler)
           
 
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, initializeCloneEditState, 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, 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, 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

mCommerceItemEditHandler

protected CommerceItemEditHandler mCommerceItemEditHandler

mShippingGroupEditHandler

protected ShippingGroupEditHandler mShippingGroupEditHandler

mPaymentGroupEditHandler

protected PaymentGroupEditHandler mPaymentGroupEditHandler
Constructor Detail

RelationshipEditHandler

public RelationshipEditHandler()
Method Detail

getCommerceItemEditHandler

public CommerceItemEditHandler getCommerceItemEditHandler()
Returns the Commerce Item Edit Handler


setCommerceItemEditHandler

public void setCommerceItemEditHandler(CommerceItemEditHandler pCommerceItemEditHandler)

getShippingGroupEditHandler

public ShippingGroupEditHandler getShippingGroupEditHandler()
Returns the Shipping Group Edit Handler


setShippingGroupEditHandler

public void setShippingGroupEditHandler(ShippingGroupEditHandler pShippingGroupEditHandler)

getPaymentGroupEditHandler

public PaymentGroupEditHandler getPaymentGroupEditHandler()
Returns the PaymentGroupEditHandler


setPaymentGroupEditHandler

public void setPaymentGroupEditHandler(PaymentGroupEditHandler pPaymentGroupEditHandler)

addItem

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

Overrides:
addItem in class ListEditHandler
Parameters:
pCloneEditState -
pAddItem -
Throws:
CommerceException
See Also:
RelationshipContainer.addRelationship(Relationship, int)

deleteItem

protected void deleteItem(CloneEditState pCloneEditState,
                          DeleteItem pDeleteItem)
                   throws CommerceException
Overrides delete item to use the relationship container interfaces to remove the relationship

Overrides:
deleteItem in class CollectionEditHandler
Parameters:
pCloneEditState -
pDeleteItem - the DeleteItem object
Throws:
CommerceException
See Also:
removeRelationshipFromContainers(CloneEditState, DeleteItem)

removeRelationshipFromContainers

protected void removeRelationshipFromContainers(CloneEditState pCloneEditState,
                                                DeleteItem pDeleteItem)
                                         throws CommerceException
Removes the deleted relationship from the containers on both sides on the relationship

Parameters:
pCloneEditState -
pDeleteItem - the DeleteItem that represents the deleted relationship.
Throws:
CommerceException

adjustRelationship

protected void adjustRelationship(CloneEditState pCloneEditState,
                                  Relationship pRelationship)
                           throws CommerceException
adjusts a relationships properites so they correspond to the original order's objects. This method is used when moving relationships from the clone to the original order so that any references to objects in the clone order are changed to the original order's counterpart objects.

Parameters:
pCloneEditState -
pRelationship -
Throws:
CommerceException
See Also:
adjustCommerceItemRelationship(CloneEditState, CommerceItemRelationship), adjustPaymentGroupRelationship(CloneEditState, PaymentGroupRelationship), adjustShippingGroupRelationship(CloneEditState, ShippingGroupRelationship), adjustOrderRelationship(CloneEditState, OrderRelationship)

adjustCommerceItemRelationship

protected void adjustCommerceItemRelationship(CloneEditState pCloneEditState,
                                              CommerceItemRelationship pCommerceItemRelationship)
                                       throws CommerceException
Updates a CommerceItemRelationship so that the commerce item side of the relationship points to the original order's commerce item.

If the relationship is new, the relationship was moved from the clone order to the original order and the commerce item the relationship points to must be changed to the its original counterpart.

If the relationship is being updated, the relationship was originally on the original order but it may have been moved from one item to another. In this case, we change the commerce item to point to the counterpart relationship's commerce item's counterpart.

Parameters:
pCloneEditState -
pCommerceItemRelationship -
Throws:
CommerceException

findRelationshipsCloneCounterpart

protected Relationship findRelationshipsCloneCounterpart(CloneEditState pCloneEditState,
                                                         Relationship pOriginalRelationship)
Finds the counterpart relationship to the given original relationship item

Parameters:
pCloneEditState -
pOriginalRelationship -
Returns:
counterpart Relationship object

adjustShippingGroupRelationship

protected void adjustShippingGroupRelationship(CloneEditState pCloneEditState,
                                               ShippingGroupRelationship pShippingGroupRelationship)
                                        throws CommerceException
Updates a pShippingGroupRelationship so that the shipping group side of the relationship points to the original order's shipping group.

If the relationship is new, the relationship was moved from the clone order to the original order and the shipping group the relationship points to must be changed to the its original counterpart.

If the relationship is being updated, the relationship was originally on the original order but it may have been moved from one item to another on the clone. In this case, we change the shipping group to point to the counterpart relationship's shippig group's counterpart.

Parameters:
pCloneEditState -
pShippingGroupRelationship -
Throws:
CommerceException

adjustPaymentGroupRelationship

protected void adjustPaymentGroupRelationship(CloneEditState pCloneEditState,
                                              PaymentGroupRelationship pPaymentGroupRelationship)
                                       throws CommerceException
Updates a PaymentGroupRelationship so that the payment group side of the relationship points to the original order's payment group.

If the relationship is new, the relationship was moved from the clone order to the original order and the payment group the relationship points to must be changed to the its original counterpart.

If the relationship is being updated, the relationship was originally on the original order but it may have been moved from one item to another. In this case, we change the payment group to point to the counterpart relationship's payment group's counterpart.

Parameters:
pCloneEditState -
pPaymentGroupRelationship -
Throws:
CommerceException

adjustOrderRelationship

protected void adjustOrderRelationship(CloneEditState pCloneEditState,
                                       OrderRelationship pOrderRelationship)
                                throws CommerceException
Updates the relationships for a payment group. Each relationship is updated so that each side of the relationship points to the original order commerce object.

Parameters:
pCloneEditState -
pOrderRelationship -
Throws:
CommerceException