Interface CMSItemCloningService

All Known Implementing Classes:
DefaultCMSItemCloningService

public interface CMSItemCloningService
Helper methods for cloning various items
  • Method Details

    • cloneContentSlotComponents

      void cloneContentSlotComponents(ContentSlotModel sourceContentSlotModel, ContentSlotModel targetContentSlotModel, CatalogVersionModel targetCatalogVersionModel)
      Deeps clones all cloneable cms components for a given content slot excluding non cloneable components
      Parameters:
      sourceContentSlotModel - - the source content slot containing the cms components
      targetContentSlotModel - - the target content slot containing the cloned cms components
      targetCatalogVersionModel - - the catalog version
    • cloneComponent

      Deep clones the provided component in the same catalog version. The cloned component will have the same information except for the pk, uid and name. The pk will be null because it is a new component. The uid and name will be generated to avoid collisions with the original component.
      Parameters:
      componentModel - - The original component to clone.
      Returns:
      The optional cloned component.
    • shouldCloneComponents

      @Deprecated(since="2105", forRemoval=true) default boolean shouldCloneComponents(Map<String,Object> context)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 2105, no longer needed
      Determine if components should be cloned or not by validating the value associated to the key Cms2Constants.SHOULD_CLONE_COMPONENTS_CONTEXT_KEY in the provided context Map.
      Parameters:
      context - the map containing any data specific to cloning a page
      Returns:
      true if the components of the source page's content slots should be cloned, false if they should be referenced/excluded or the context is null or empty