Class ComponentCloningStrategy
java.lang.Object
de.hybris.platform.cms2.cloning.strategy.impl.ComponentCloningStrategy
- All Implemented Interfaces:
CMSCloningStrategy<AbstractCMSComponentModel>
public class ComponentCloningStrategy
extends Object
implements CMSCloningStrategy<AbstractCMSComponentModel>
This strategy clones a component only if it's type is cloneable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone(AbstractCMSComponentModel sourceComponentModel, Optional<AbstractCMSComponentModel> template, Optional<Map<String, Object>> context) Clones the CMS item given by the source universal identifier.cloneForItemModel(ItemModel sourceItemModel) Clones the CMS item given by the source universal identifier.protected CatalogVersionServiceprotected CMSItemCloneablePredicateprotected CMSItemDeepCloningServiceprotected CMSModelCloningContextFactoryprotected SessionSearchRestrictionsDisablervoidsetCatalogVersionService(CatalogVersionService catalogVersionService) voidsetCmsItemCloneablePredicate(CMSItemCloneablePredicate cmsItemCloneablePredicate) voidsetCmsItemDeepCloningService(CMSItemDeepCloningService cmsItemDeepCloningService) voidsetCmsModelCloningContextFactory(CMSModelCloningContextFactory cmsModelCloningContextFactory) voidsetCmsSessionSearchRestrictionsDisabler(SessionSearchRestrictionsDisabler cmsSessionSearchRestrictionsDisabler)
-
Constructor Details
-
ComponentCloningStrategy
public ComponentCloningStrategy()
-
-
Method Details
-
clone
public AbstractCMSComponentModel clone(AbstractCMSComponentModel sourceComponentModel, Optional<AbstractCMSComponentModel> template, Optional<Map<String, Object>> context) throws CMSItemNotFoundExceptionDescription copied from interface:CMSCloningStrategyClones the CMS item given by the source universal identifier. If a template is provided, it may be augmented, otherwise a new item may be created.- Specified by:
clonein interfaceCMSCloningStrategy<AbstractCMSComponentModel>- Parameters:
sourceComponentModel- the cms item model to be copiedtemplate- (optional) the template of the cloned item that may be augmentedcontext- (optional) this map contains any context specific data required to clone the item- Returns:
- the cloned CMS item model
- Throws:
CMSItemNotFoundException- when no CMS item with the given source Uid can be found
-
cloneForItemModel
public ItemModel cloneForItemModel(ItemModel sourceItemModel) throws CMSItemNotFoundException, IllegalArgumentException Clones the CMS item given by the source universal identifier. it is useful itemModel which is not AbstractCMSComponentModel. like MediaContainerModel, MediaModel which define at core platform -
getCmsItemDeepCloningService
-
setCmsItemDeepCloningService
-
getCmsSessionSearchRestrictionsDisabler
-
setCmsSessionSearchRestrictionsDisabler
public void setCmsSessionSearchRestrictionsDisabler(SessionSearchRestrictionsDisabler cmsSessionSearchRestrictionsDisabler) -
getCmsModelCloningContextFactory
-
setCmsModelCloningContextFactory
public void setCmsModelCloningContextFactory(CMSModelCloningContextFactory cmsModelCloningContextFactory) -
getCatalogVersionService
-
setCatalogVersionService
-
getCmsItemCloneablePredicate
-
setCmsItemCloneablePredicate
-