Class ContentSlotCloningStrategy

    • Constructor Detail

      • ContentSlotCloningStrategy

        public ContentSlotCloningStrategy()
    • Method Detail

      • clone

        public ContentSlotModel clone​(ContentSlotModel sourceContentSlotModel,
                                      java.util.Optional<ContentSlotModel> template,
                                      java.util.Optional<java.util.Map<java.lang.String,​java.lang.Object>> context)
                               throws CMSItemNotFoundException
        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<ContentSlotModel>
        Parameters:
        sourceContentSlotModel - 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
      • customPositionIsAvailable

        protected boolean customPositionIsAvailable​(AbstractPageModel sourcePage,
                                                    java.lang.String targetPosition)
        Validates whether the position of the new created custom slot can be used or it's already taken by another custom slot.
        Parameters:
        sourcePage - the page on which the position is checked
        targetPosition - the target position
        Returns:
        true if the position is available on page, false otherwise
      • createContentSlotForPageRelation

        protected void createContentSlotForPageRelation​(CatalogVersionModel catalogVersionModel,
                                                        java.lang.String position,
                                                        AbstractPageModel pageModel,
                                                        ContentSlotModel contentSlotModel)
        Creates a new ContentSlotForPageModel
        Parameters:
        catalogVersionModel - the catalog version of the ContentSlotForPageModel
        position - the position of the content slot with respect to other slots on the page. Same as the source content slot.
        pageModel - the page where the content slot will be associated to. Same as the source content slot.
        contentSlotModel - the cloned content slot
      • createContentSlotForTemplateRelation

        protected void createContentSlotForTemplateRelation​(CatalogVersionModel catalogVersion,
                                                            java.lang.String position,
                                                            PageTemplateModel pageTemplate,
                                                            ContentSlotModel contentSlotModel)
        Method creates a content slot for template relation.
        Parameters:
        catalogVersion - the catalog version where the relation must be created
        position - the position of the slot
        pageTemplate - the page template to which the association must be created
        contentSlotModel - the content slot that will be associated with a template
      • setCmsSessionSearchRestrictionsDisabler

        public void setCmsSessionSearchRestrictionsDisabler​(SessionSearchRestrictionsDisabler cmsSessionSearchRestrictionsDisabler)
      • setCatalogVersionService

        public void setCatalogVersionService​(CatalogVersionService catalogVersionService)
      • setCmsItemCloningService

        public void setCmsItemCloningService​(CMSItemCloningService cmsItemCloningService)
      • getModelService

        protected ModelService getModelService()
      • setModelService

        public void setModelService​(ModelService modelService)
      • setCmsAdminContentSlotService

        public void setCmsAdminContentSlotService​(CMSAdminContentSlotService cmsAdminContentSlotService)
      • setCmsContentSlotService

        public void setCmsContentSlotService​(CMSContentSlotService cmsContentSlotService)