Class DefaultCMSItemCloningService
java.lang.Object
de.hybris.platform.cms2.cloning.service.impl.DefaultCMSItemCloningService
- All Implemented Interfaces:
CMSItemCloningService
Default implementation of
CMSItemCloningService to deep copy item models.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncloneComponent(AbstractCMSComponentModel componentModel) Deep clones the provided component in the same catalog version.protected Optional<AbstractCMSComponentModel>cloneComponentInCatalogVersion(AbstractCMSComponentModel componentModel, CatalogVersionModel targetCatalogVersionModel) Deep clones the provided component in the provided catalog version.voidcloneContentSlotComponents(ContentSlotModel sourceContentSlotModel, ContentSlotModel targetContentSlotModel, CatalogVersionModel targetCatalogVersionModel) Deeps clones all cloneable cms components for a given content slot excluding non cloneable componentsprotected CMSItemCloneablePredicateprotected CMSItemDeepCloningServiceprotected CMSModelCloningContextFactoryprotected CMSPageServicevoidsetCmsItemCloneablePredicate(CMSItemCloneablePredicate cmsItemCloneablePredicate) voidsetCmsItemDeepCloningService(CMSItemDeepCloningService cmsItemDeepCloningService) voidsetCmsModelCloningContextFactory(CMSModelCloningContextFactory cmsModelCloningContextFactory) voidsetCmsPageService(CMSPageService cmsPageService) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.cms2.cloning.service.CMSItemCloningService
shouldCloneComponents
-
Constructor Details
-
DefaultCMSItemCloningService
public DefaultCMSItemCloningService()
-
-
Method Details
-
cloneContentSlotComponents
public void cloneContentSlotComponents(ContentSlotModel sourceContentSlotModel, ContentSlotModel targetContentSlotModel, CatalogVersionModel targetCatalogVersionModel) Description copied from interface:CMSItemCloningServiceDeeps clones all cloneable cms components for a given content slot excluding non cloneable components- Specified by:
cloneContentSlotComponentsin interfaceCMSItemCloningService- Parameters:
sourceContentSlotModel- - the source content slot containing the cms componentstargetContentSlotModel- - the target content slot containing the cloned cms componentstargetCatalogVersionModel- - the catalog version
-
cloneComponent
Description copied from interface:CMSItemCloningServiceDeep 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.- Specified by:
cloneComponentin interfaceCMSItemCloningService- Parameters:
componentModel- - The original component to clone.- Returns:
- The optional cloned component.
-
cloneComponentInCatalogVersion
protected Optional<AbstractCMSComponentModel> cloneComponentInCatalogVersion(AbstractCMSComponentModel componentModel, CatalogVersionModel targetCatalogVersionModel) Deep clones the provided component in the provided 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.targetCatalogVersionModel- - The catalog version where to clone the provided component.- Returns:
- The optional cloned component.
-
getCmsModelCloningContextFactory
-
setCmsModelCloningContextFactory
public void setCmsModelCloningContextFactory(CMSModelCloningContextFactory cmsModelCloningContextFactory) -
getCmsItemCloneablePredicate
-
setCmsItemCloneablePredicate
-
getCmsItemDeepCloningService
-
setCmsItemDeepCloningService
-
getCmsPageService
-
setCmsPageService
-