Class PageCloningStrategy

    • Constructor Detail

      • PageCloningStrategy

        public PageCloningStrategy()
    • Method Detail

      • clone

        public AbstractPageModel clone​(AbstractPageModel sourcePageModel,
                                       java.util.Optional<AbstractPageModel> template,
                                       java.util.Optional<java.util.Map<java.lang.String,​java.lang.Object>> context)
                                throws CMSItemNotFoundException,
                                       java.lang.IllegalArgumentException
        Description copied from interface: CMSCloningStrategy
        Clones 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:
        clone in interface CMSCloningStrategy<AbstractPageModel>
        Parameters:
        sourcePageModel - the cms item model to be copied
        template - (optional) the template of the cloned item that may be augmented
        context - (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
        java.lang.IllegalArgumentException - when the a non-empty optional template or context parameter is expected but not given or the
      • clonePage

        protected java.util.function.Supplier<AbstractPageModel> clonePage​(AbstractPageModel sourcePageModel,
                                                                           AbstractPageModel clonedPageModel,
                                                                           java.util.Map<java.lang.String,​java.lang.Object> context)
        Clones a page by deep copying the content slots and copy the components by reference or by deep copy. And if the cloned page is primary page then it clones a preview image and deletes previously existing primary page.
        Parameters:
        sourcePageModel - - the page model to be copied
        clonedPageModel - - the cloned page object
        context - - the map of cloning values; should contain shouldCloneComponents which determines if the components should be copied by reference (shouldCloneComponents == FALSE) or deep copied ( shouldCloneComponents == TRUE)
        Returns:
        a cloned AbstractPageModel
      • clonePreviewImage

        protected java.util.Optional<MediaModel> clonePreviewImage​(AbstractPageModel sourcePageModel,
                                                                   CatalogVersionModel targetCatalogVersion)
        Clones a preview image model.
        Parameters:
        sourcePageModel - - the page model with a preview image model
        targetCatalogVersion - - the target catalog version for preview image
        Returns:
        - Optional cloned preview image model
      • cloneAndAddContentSlot

        protected ContentSlotModel cloneAndAddContentSlot​(AbstractPageModel pageModel,
                                                          ContentSlotModel contentSlotModel,
                                                          boolean shouldCloneComponents)
        Clones a content slot and adds it to a page.
        Parameters:
        pageModel - the page the cloned content slot will be ad
        contentSlotModel - the content slot to clone
        shouldCloneComponents - true if the components of the content slots should be cloned rather than referenced, false otherwise
        Returns:
        the cloned content slot model
      • setCmsAdminContentSlotService

        public void setCmsAdminContentSlotService​(CMSAdminContentSlotService cmsAdminContentSlotService)
      • getModelService

        protected ModelService getModelService()
      • setModelService

        public void setModelService​(ModelService modelService)
      • getTransactionManager

        protected org.springframework.transaction.PlatformTransactionManager getTransactionManager()
      • setTransactionManager

        public void setTransactionManager​(org.springframework.transaction.PlatformTransactionManager transactionManager)
      • setSearchRestrictionService

        public void setSearchRestrictionService​(SearchRestrictionService searchRestrictionService)
      • setSessionService

        public void setSessionService​(SessionService sessionService)
      • setCmsItemDeepCloningService

        public void setCmsItemDeepCloningService​(CMSItemDeepCloningService cmsItemDeepCloningService)
      • setCmsAdminPageService

        public void setCmsAdminPageService​(CMSAdminPageService cmsAdminPageService)
      • setCmsSessionSearchRestrictionsDisabler

        public void setCmsSessionSearchRestrictionsDisabler​(SessionSearchRestrictionsDisabler cmsSessionSearchRestrictionsDisabler)
      • setCmsModelCloningContextFactory

        public void setCmsModelCloningContextFactory​(CMSModelCloningContextFactory cmsModelCloningContextFactory)
      • setCmsItemCloningService

        public void setCmsItemCloningService​(CMSItemCloningService cmsItemCloningService)