Interface CMSItemCloningService
- All Known Implementing Classes:
DefaultCMSItemCloningService
public interface CMSItemCloningService
Helper methods for cloning various items
-
Method Summary
Modifier and TypeMethodDescriptioncloneComponent(AbstractCMSComponentModel componentModel) Deep clones the provided component in the same catalog version.voidcloneContentSlotComponents(ContentSlotModel sourceContentSlotModel, ContentSlotModel targetContentSlotModel, CatalogVersionModel targetCatalogVersionModel) Deeps clones all cloneable cms components for a given content slot excluding non cloneable componentsdefault booleanshouldCloneComponents(Map<String, Object> context) Deprecated, for removal: This API element is subject to removal in a future version.since 2105, no longer needed
-
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 componentstargetContentSlotModel- - the target content slot containing the cloned cms componentstargetCatalogVersionModel- - 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 neededDetermine if components should be cloned or not by validating the value associated to the keyCms2Constants.SHOULD_CLONE_COMPONENTS_CONTEXT_KEYin the providedcontextMap.- 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
-