Class DefaultProductConfigCloneAbstractOrderHook
java.lang.Object
de.hybris.platform.cpq.productconfig.services.hooks.DefaultProductConfigCloneAbstractOrderHook
- All Implemented Interfaces:
de.hybris.platform.order.strategies.ordercloning.CloneAbstractOrderHook
- Direct Known Subclasses:
SwitchableProductConfigIntegrationCloneAbstractOrderHook
public class DefaultProductConfigCloneAbstractOrderHook
extends Object
implements de.hybris.platform.order.strategies.ordercloning.CloneAbstractOrderHook
Default CPQ implementation of the
It will ensure that any CPQ configuration is proper handled whenever a hybris document is cloned. In principal it will ensure that the configuration is deep copied, when both, source and traget documemnt continue to exist. So that both configurations are independent from each other. For example this is the case when an order is tranformed into a cart.
In case the source document is discarded, no deep copy will take place. Instead the existing configuration is used for the target document, to save the overhead of deep copying a configuration. For example this is the case for the cart to order transformation.
CloneAbstractOrderHook.It will ensure that any CPQ configuration is proper handled whenever a hybris document is cloned. In principal it will ensure that the configuration is deep copied, when both, source and traget documemnt continue to exist. So that both configurations are independent from each other. For example this is the case when an order is tranformed into a cart.
In case the source document is discarded, no deep copy will take place. Instead the existing configuration is used for the target document, to save the overhead of deep copying a configuration. For example this is the case for the cart to order transformation.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultProductConfigCloneAbstractOrderHook(ConfigurationService cpqService, ConfigurationServiceLayerHelper serviceLayerHelper, int itemsStart, int itemsIncrement) Constructor that gets the needed beans. -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustEntryNumbers(Map<AbstractOrderEntryModel, Integer> entryNumberMappings) <T extends AbstractOrderModel>
voidafterClone(AbstractOrderModel original, T clone, Class abstractOrderClassResult) <T extends AbstractOrderEntryModel>
voidafterCloneEntries(AbstractOrderModel original, List<T> clonedEntries) voidbeforeClone(AbstractOrderModel original, Class abstractOrderClassResult) voidbeforeCloneEntries(AbstractOrderModel original) protected booleanprotected voidcloneConfig(AbstractOrderModel source, AbstractOrderEntryModel sourceEntry, AbstractOrderEntryModel targetEntry) protected voidcopyConfig(AbstractOrderEntryModel sourceEntry, AbstractOrderEntryModel targetEntry) protected booleanisCartToCart(AbstractOrderModel source, Class<?> targetClass) booleanisCloneConfigNeeded(AbstractOrderModel source, Class<?> targetClass) Checks whether a deep copy of the configuration is neededprotected booleanisOrderToCart(AbstractOrderModel source, Class<?> targetClass) protected booleanisQuoteToCart(AbstractOrderModel source, Class<?> targetClass) protected booleanisQuoteToQuote(AbstractOrderModel source, Class<?> targetClass) protected booleanisSubClass(Class<?> baseClass, Class<?> subClass) protected voidupdateEntryNumbers(Map<AbstractOrderEntryModel, Integer> entryNumberMappings)
-
Constructor Details
-
DefaultProductConfigCloneAbstractOrderHook
public DefaultProductConfigCloneAbstractOrderHook(ConfigurationService cpqService, ConfigurationServiceLayerHelper serviceLayerHelper, int itemsStart, int itemsIncrement) Constructor that gets the needed beans. The default clone strategy is injected via setter injection as we might get circular dependency issues otherwise.- Parameters:
cpqService- Configuration serviceserviceLayerHelper-itemsStart-itemsIncrement-
-
-
Method Details
-
beforeClone
- Specified by:
beforeClonein interfacede.hybris.platform.order.strategies.ordercloning.CloneAbstractOrderHook
-
afterClone
public <T extends AbstractOrderModel> void afterClone(AbstractOrderModel original, T clone, Class abstractOrderClassResult) - Specified by:
afterClonein interfacede.hybris.platform.order.strategies.ordercloning.CloneAbstractOrderHook
-
beforeCloneEntries
- Specified by:
beforeCloneEntriesin interfacede.hybris.platform.order.strategies.ordercloning.CloneAbstractOrderHook
-
afterCloneEntries
public <T extends AbstractOrderEntryModel> void afterCloneEntries(AbstractOrderModel original, List<T> clonedEntries) - Specified by:
afterCloneEntriesin interfacede.hybris.platform.order.strategies.ordercloning.CloneAbstractOrderHook
-
adjustEntryNumbers
- Specified by:
adjustEntryNumbersin interfacede.hybris.platform.order.strategies.ordercloning.CloneAbstractOrderHook
-
updateEntryNumbers
-
checkIfEntryNumbersIncrementedByOne
-
isCloneConfigNeeded
Checks whether a deep copy of the configuration is needed- Parameters:
source- source abstract order documenttargetClass- target abstract order document class- Returns:
- is deep copy of configuration needed
-
isCartToCart
-
isQuoteToCart
-
isOrderToCart
-
isQuoteToQuote
-
isSubClass
-
cloneConfig
protected void cloneConfig(AbstractOrderModel source, AbstractOrderEntryModel sourceEntry, AbstractOrderEntryModel targetEntry) -
copyConfig
-