Class DefaultCMSItemDeepCloningService
- java.lang.Object
-
- de.hybris.platform.cms2.cloning.service.impl.DefaultCMSItemDeepCloningService
-
- All Implemented Interfaces:
CMSItemDeepCloningService
public class DefaultCMSItemDeepCloningService extends java.lang.Object implements CMSItemDeepCloningService
Default implementation ofCMSItemDeepCloningServiceto deep copy item models.
-
-
Constructor Summary
Constructors Constructor Description DefaultCMSItemDeepCloningService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ItemModeldeepCloneComponent(ItemModel srcComponent, ModelCloningContext cloningContext)Creates a clone of the given component and deep copies all the component's attributes.java.lang.StringgenerateCloneComponentName(java.lang.String originalComponentName)Creates a new name to be used on a cloned component to avoid clashing with the original one.java.lang.StringgenerateCloneItemUid()Creates a uid consisting of the prefixclone_and a generated number.protected PersistentKeyGeneratorgetCloneUidGenerator()protected CMSItemModelCloneCreatorgetCmsItemModelCloneCreator()voidsetCloneUidGenerator(PersistentKeyGenerator cloneUidGenerator)voidsetCmsItemModelCloneCreator(CMSItemModelCloneCreator cmsItemModelCloneCreator)
-
-
-
Method Detail
-
deepCloneComponent
public ItemModel deepCloneComponent(ItemModel srcComponent, ModelCloningContext cloningContext)
Description copied from interface:CMSItemDeepCloningServiceCreates a clone of the given component and deep copies all the component's attributes.- Specified by:
deepCloneComponentin interfaceCMSItemDeepCloningService- Parameters:
srcComponent- - the cms component to be clonedcloningContext- - the cloning context- Returns:
- a newly cloned component
-
generateCloneItemUid
public java.lang.String generateCloneItemUid()
Description copied from interface:CMSItemDeepCloningServiceCreates a uid consisting of the prefixclone_and a generated number.- Specified by:
generateCloneItemUidin interfaceCMSItemDeepCloningService- Returns:
- a new uid to be assigned to a cloned item; never null
-
generateCloneComponentName
public java.lang.String generateCloneComponentName(java.lang.String originalComponentName)
Description copied from interface:CMSItemDeepCloningServiceCreates a new name to be used on a cloned component to avoid clashing with the original one. This method takes the original name, removes everything after the last space, and adds a generated number at the end. Examples:- Input: component1 Output: component1 123
- Input: component1 123 Output: component1 456
- Input: this is a component Output: this is a 789
- Specified by:
generateCloneComponentNamein interfaceCMSItemDeepCloningService- Parameters:
originalComponentName- - the original name to use as a base for the clone name.- Returns:
- the name to use for the cloned component
-
getCmsItemModelCloneCreator
protected CMSItemModelCloneCreator getCmsItemModelCloneCreator()
-
setCmsItemModelCloneCreator
public void setCmsItemModelCloneCreator(CMSItemModelCloneCreator cmsItemModelCloneCreator)
-
getCloneUidGenerator
protected PersistentKeyGenerator getCloneUidGenerator()
-
setCloneUidGenerator
public void setCloneUidGenerator(PersistentKeyGenerator cloneUidGenerator)
-
-