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 java.lang.Object implements OriginalClonedItemProvider<T>
Default implementation forOriginalClonedItemProvider. Stores theItemModelinstances in a stack on the current Session.
-
-
Constructor Summary
Constructors Constructor Description DefaultOriginalClonedItemProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Collection<java.lang.Object>collectAttributeValues(ItemModel itemModel, AttributeDescriptorModel attributeDescriptorModel)This method collects the value(s) of the attribute identified by theAttributeDescriptorModelin the providedItemModel.protected voiddetachAll(ItemModel itemModel)This method detaches parent itemModel from modelService as well as all child models (available through attributes).voidfinalizeItem()Finalizes the latest instance for this transaction.TgetCurrentItem()Provides the current instance for this transaction.protected LocalizedPopulatorgetLocalizedPopulator()protected ModelServicegetModelService()protected SessionServicegetSessionService()protected TypeServicegetTypeService()protected java.util.Deque<ItemModel>getWrappedStack(java.lang.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)
-
-
-
Method Detail
-
initializeItem
public void initializeItem(ItemModel originalItemModel)
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
protected void detachAll(ItemModel itemModel)
This method detaches parent itemModel from modelService as well as all child models (available through attributes).- Parameters:
itemModel-ItemModelthat should be detached.
-
collectAttributeValues
protected java.util.Collection<java.lang.Object> collectAttributeValues(ItemModel itemModel, AttributeDescriptorModel attributeDescriptorModel)
This method collects the value(s) of the attribute identified by theAttributeDescriptorModelin the providedItemModel.
-
getCurrentItem
public T 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
protected java.util.Deque<ItemModel> getWrappedStack(java.lang.Object rawValue)
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
protected SessionService getSessionService()
-
setSessionService
public void setSessionService(SessionService sessionService)
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getTypeService
protected TypeService getTypeService()
-
setTypeService
public void setTypeService(TypeService typeService)
-
getLocalizedPopulator
protected LocalizedPopulator getLocalizedPopulator()
-
setLocalizedPopulator
public void setLocalizedPopulator(LocalizedPopulator localizedPopulator)
-
-