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 Details

    • DefaultOriginalClonedItemProvider

      public DefaultOriginalClonedItemProvider()
  • Method Details

    • initializeItem

      public void initializeItem(ItemModel originalItemModel)
      Description copied from interface: CMSItemContextProvider
      Initializes and stores a new instance for this transaction.
      Specified by:
      initializeItem in interface CMSItemContextProvider<T extends ItemModel>
      Specified by:
      initializeItem in interface OriginalClonedItemProvider<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 - ItemModel that should be detached.
    • collectAttributeValues

      protected Collection<Object> collectAttributeValues(ItemModel itemModel, AttributeDescriptorModel attributeDescriptorModel)
      This method collects the value(s) of the attribute identified by the AttributeDescriptorModel in the provided ItemModel.
      Parameters:
      itemModel - the ItemModel that contains the values to collect.
      attributeDescriptorModel - the descriptor that identifies the attribute whose values to collect.
      Returns:
      The collection containing the value(s) of the attribute found in the provided ItemModel.
    • getCurrentItem

      public T getCurrentItem()
      Description copied from interface: CMSItemContextProvider
      Provides the current instance for this transaction.
      Specified by:
      getCurrentItem in interface CMSItemContextProvider<T extends ItemModel>
      Specified by:
      getCurrentItem in interface OriginalClonedItemProvider<T extends ItemModel>
      Returns:
      the current item
    • finalizeItem

      public void finalizeItem()
      Description copied from interface: CMSItemContextProvider
      Finalizes the latest instance for this transaction.
      Specified by:
      finalizeItem in interface CMSItemContextProvider<T extends ItemModel>
      Specified by:
      finalizeItem in interface OriginalClonedItemProvider<T extends ItemModel>
    • getWrappedStack

      protected Deque<ItemModel> getWrappedStack(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)