Class DefaultCMSAdminComponentService

    • Field Detail

      • CE_SYSTEM_PROPS

        protected static final java.lang.String CE_SYSTEM_PROPS
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultCMSAdminComponentService

        public DefaultCMSAdminComponentService()
    • Method Detail

      • createCmsComponent

        public AbstractCMSComponentModel createCmsComponent​(ContentSlotModel contentSlotModel,
                                                            java.lang.String componentUid,
                                                            java.lang.String componentName,
                                                            java.lang.String typeCode)
        Creates cms component model.
        Specified by:
        createCmsComponent in interface CMSAdminComponentService
        Parameters:
        contentSlotModel - the content slot
        componentUid - the uid for the new cms component
        componentName - the name for new cms component
        typeCode - the composed type code for new cms component
        Returns:
        the cms component model
      • getEditorProperties

        public java.util.Collection<java.lang.String> getEditorProperties​(ItemModel component)
        Get all editor properties for the given content element. Editor-Properties are editorial properties, like headline, image and so on. Editor-Properties are used to display information on the frontend.
        Specified by:
        getEditorProperties in interface CMSAdminComponentService
        Parameters:
        component - the component which editor properties should be retrieved
        Returns:
        all editor properties
      • getSystemProperties

        public java.util.Collection<java.lang.String> getSystemProperties​(AbstractCMSComponentModel component)
        Get all system properties for the given content element. System-Properties are non editorial properties, like id, catalogVersion and so on. System-Properties are not used to display any information on the frontend.
        Specified by:
        getSystemProperties in interface CMSAdminComponentService
        Parameters:
        component - the component which system properties should be retrieved
        Returns:
        all system properties
      • getCMSComponentsForContainer

        public java.util.Collection<AbstractCMSComponentModel> getCMSComponentsForContainer​(AbstractCMSComponentContainerModel container)
        Description copied from interface: CMSAdminComponentService
        Get the collection of components that should be provided when a container component is requested.

        This service depends on a CMSComponentContainerStrategy to decide if:

        • the container should return itself as the only container component
        • the container should return its children as the container components
        • the container should return container components based on a custom strategy

        Specified by:
        getCMSComponentsForContainer in interface CMSAdminComponentService
        Parameters:
        container - - the container model from which we want to get the components
        Returns:
        a collection of components that a container represents; never null
      • getDisplayedComponentsForContentSlot

        public java.util.Collection<AbstractCMSComponentModel> getDisplayedComponentsForContentSlot​(ContentSlotModel contentSlot)
        Description copied from interface: CMSAdminComponentService
        Get the collection of displayed components within a content slot. A displayed component is one that will be rendered by the storefront.

        The difference between ContentSlotModel.getCmsComponents() and getting the displayed components in the slot has to do with containers. Some containers are rendered as a single component while some others are rendered as a collection of components or in other ways. So for container components, the #getCMSComponentsForContainer(AbstractCMSComponentContainerModel) method will be used.

        Specified by:
        getDisplayedComponentsForContentSlot in interface CMSAdminComponentService
        Parameters:
        contentSlot - - the content slot for which we want to get all displayed components
        Returns:
        a collection of components that are displayed for a given content slot; never null
      • getDisplayedComponentsForComponent

        protected java.util.Collection<AbstractCMSComponentModel> getDisplayedComponentsForComponent​(AbstractCMSComponentModel component)
        Get a collection of components that are displayed based on the given component. This will inspect the component to verify if the component is a container and if it is, then we will get all of the components for the given container; otherwise it will simply return a collection with only the component itself.
        Parameters:
        component - - the component from which to get the displayed components
        Returns:
        collections of components displayed for the given component; never null
      • isComponentContainer

        protected java.lang.Boolean isComponentContainer​(AbstractCMSComponentModel component)
        Checks whether a given component is actually a container.
        Parameters:
        component - - the component to check
        Returns:
        true if the component is a container; false otherwise
      • setCmsComponentDao

        public void setCmsComponentDao​(CMSComponentDao cmsComponentDao)
      • getSystemProperties

        protected java.util.List<java.lang.String> getSystemProperties()
      • setSystemProperties

        public void setSystemProperties​(java.util.List<java.lang.String> systemProperties)
      • getTypeService

        protected TypeService getTypeService()
      • setTypeService

        public void setTypeService​(TypeService typeService)
      • getComposedTypeOfCode

        protected java.util.Collection<ComposedTypeModel> getComposedTypeOfCode​(java.lang.String code)
      • setComponentUidGenerator

        public void setComponentUidGenerator​(PersistentKeyGenerator componentUidGenerator)
      • setCmsComponentContainerRegistry

        public void setCmsComponentContainerRegistry​(CMSComponentContainerRegistry cmsComponentContainerRegistry)
      • findByCatalogVersionAndMask

        public SearchResult<AbstractCMSComponentModel> findByCatalogVersionAndMask​(CatalogVersionModel catalogVersionModel,
                                                                                   java.lang.String mask,
                                                                                   PageableData pageableData)
        Description copied from interface: CMSAdminComponentService
        For a given mask used as filter and a PageableData query, will return a page object consisting of the content list of the requested page number and the total number of entities for the given mask
        Specified by:
        findByCatalogVersionAndMask in interface CMSAdminComponentService
        Parameters:
        catalogVersionModel - the catalog version to filter on
        mask - the string value on which components will be filtered, implementations may choose to filter on the component name
        pageableData - the PageableData object containing the page request details. PageableData may contain a String value for sort, this will be used by a sorting strategy to select the most appropriate query or resort to a default one.
        Returns:
        a page object
      • getCmsItemCatalogLevelComparator

        protected java.util.Comparator<AbstractCMSComponentModel> getCmsItemCatalogLevelComparator()
      • setCmsItemCatalogLevelComparator

        public void setCmsItemCatalogLevelComparator​(java.util.Comparator<AbstractCMSComponentModel> cmsItemCatalogLevelComparator)