Class DefaultOriginalClonedItemProvider<T extends ItemModel>
java.lang.Object
de.hybris.platform.cmsfacades.cmsitems.impl.DefaultOriginalClonedItemProvider<T>
- All Implemented Interfaces:
CMSItemContextProvider<T>,OriginalClonedItemProvider<T>
public class DefaultOriginalClonedItemProvider<T extends ItemModel>
extends Object
implements OriginalClonedItemProvider<T>
Default implementation for
OriginalClonedItemProvider.
Stores the ItemModel instances in a stack on the current Session.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<Object>collectAttributeValues(ItemModel itemModel, AttributeDescriptorModel attributeDescriptorModel) This method collects the value(s) of the attribute identified by theAttributeDescriptorModelin the providedItemModel.protected voidThis method detaches parent itemModel from modelService as well as all child models (available through attributes).voidFinalizes the latest instance for this transaction.Provides the current instance for this transaction.protected LocalizedPopulatorprotected ModelServiceprotected SessionServiceprotected TypeServicegetWrappedStack(Object rawValue) Values stored in the session service must be wrapped in AtomicReference objects to protect them from being altered during serialization.voidinitializeItem(ItemModel originalItemModel) Initializes and stores a new instance for this transaction.voidsetLocalizedPopulator(LocalizedPopulator localizedPopulator) voidsetModelService(ModelService modelService) voidsetSessionService(SessionService sessionService) voidsetTypeService(TypeService typeService)
-
Constructor Details
-
DefaultOriginalClonedItemProvider
public DefaultOriginalClonedItemProvider()
-
-
Method Details
-
initializeItem
Description copied from interface:CMSItemContextProviderInitializes and stores a new instance for this transaction.- Specified by:
initializeItemin interfaceCMSItemContextProvider<T extends ItemModel>- Specified by:
initializeItemin interfaceOriginalClonedItemProvider<T extends ItemModel>- Parameters:
originalItemModel- the value to store
-
detachAll
This method detaches parent itemModel from modelService as well as all child models (available through attributes).- Parameters:
itemModel-ItemModelthat should be detached.
-
collectAttributeValues
protected Collection<Object> collectAttributeValues(ItemModel itemModel, AttributeDescriptorModel attributeDescriptorModel) This method collects the value(s) of the attribute identified by theAttributeDescriptorModelin the providedItemModel. -
getCurrentItem
Description copied from interface:CMSItemContextProviderProvides the current instance for this transaction.- Specified by:
getCurrentItemin interfaceCMSItemContextProvider<T extends ItemModel>- Specified by:
getCurrentItemin interfaceOriginalClonedItemProvider<T extends ItemModel>- Returns:
- the current item
-
finalizeItem
public void finalizeItem()Description copied from interface:CMSItemContextProviderFinalizes the latest instance for this transaction.- Specified by:
finalizeItemin interfaceCMSItemContextProvider<T extends ItemModel>- Specified by:
finalizeItemin interfaceOriginalClonedItemProvider<T extends ItemModel>
-
getWrappedStack
Values stored in the session service must be wrapped in AtomicReference objects to protect them from being altered during serialization. When values are read from the session service, they must be unwrapped. Thus, this method is used to retrieve the original value (stack) stored in the AtomicReference wrapper.- Parameters:
rawValue- Object retrieved from the session service. The object must be an AtomicReference. Otherwise, an IllegalStateException is thrown.- Returns:
- stack stored within the AtomicReference.
-
getSessionService
-
setSessionService
-
getModelService
-
setModelService
-
getTypeService
-
setTypeService
-
getLocalizedPopulator
-
setLocalizedPopulator
-