You may extend core Commerce objects, for example: Order, ShippingGroup, PaymentGroup, Relationship. A site might have extended OrderImpl into MyStoreOrderImpl to add new properties, or added a new type of payment group called MyStoresPaymentMethod. The configuration of the clone editing components may need adjusting or, in some cases, class extensions may be necessary.

It may be necessary to change the cloning process when an application has added new properties to the core Commerce objects. Under normal circumstances all repository items referenced by the cloned item are also cloned into new transient repository items. This is known as the deep clone. An application may want new properties cloned or may want to eliminate certain properties from the cloning process.

The cloning feature allows you to configure the cloning process to exclude certain properties in the deep clone process in the atg/commerce/custsvc/order/edit/processor/CloneOrderForEdit component. The excludedOrderProperties component maps order repository item types to a list of properties that should be excluded from the deep cloning process. The following is the default configuration that disables the repository cloning for properties of two types in the order repository:

excludedOrderProperties=
  itemPriceInfo=priceList,
  pricingAdjustment=pricingModel

An application can also introduce a custom CloneEditHandler to perform special handling on their application specific properties. For example, an application may want to exclude custom property from the deep clone and handle the cloning process another way. The CloneEditHandler callback interface is executed after the repository cloning process is completed and provides an opportunity for applications to execute post cloning logic.

If an application has extended the core Commerce objects, the new types must be identified to the clone editing feature. During the reconciliation phase, cloned object properties are copied to their original order counterpart. You must map which properties should be copied based on the type of object. The following is an example of the configuration for the OrderImpl object type.

Component: atg/commerce/custsvc/order/edit/OrderPropertyHandler
propertiesToCopyOnUpdate=\atg.commerce.order.OrderImpl=description,,state,
,stateDetail,,taxPriceInfo,,priceInfo,,specialInstructions

To add MyStoreOrderImpl:
propertiesToCopyOnUpdate+=\myapp.commerce.order.MyAppOrderImpl=
myCustomProperty

Note: Only the extended properties of the class must be defined for each class extension.

The same type of configuration change is needed for extensions to the CommerceItem, ShippingGroup, PaymentGroup and Relationship objects. See CommerceItemHandler, ShippingGroupHandler, PaymentGroupHandler and RelationshipHandler respectively.

 
loading table of contents...