Interface CMSAdminComponentService

  • All Known Implementing Classes:
    DefaultCMSAdminComponentService

    public interface CMSAdminComponentService
    The Interface CMSAdminComponentService is responsible for managing components and component containers.
    Spring Bean ID:
    cmsAdminComponentService
    • Method Detail

      • createCmsComponent

        AbstractCMSComponentModel createCmsComponent​(ContentSlotModel contentSlotModel,
                                                     java.lang.String componentUid,
                                                     java.lang.String componentName,
                                                     java.lang.String typeCode)
        Creates cms component model.
        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
      • generateCmsComponentUid

        java.lang.String generateCmsComponentUid()
        Generates a new CMS component UID
        Returns:
        a newly generated component UID
      • getAllowedCMSComponentContainers

        java.util.Collection<ComposedTypeModel> getAllowedCMSComponentContainers()
        Gets the allowed cms component containers.
        Returns:
        the allowed cms component containers
      • getAllowedCMSComponents

        java.util.Collection<ComposedTypeModel> getAllowedCMSComponents()
        Gets the allowed cms components.
        Returns:
        the allowed cms components
      • getEditorProperties

        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.
        Parameters:
        component - the component which editor properties should be retrieved
        Returns:
        all editor properties
      • getSystemProperties

        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.
        Parameters:
        component - the component which system properties should be retrieved
        Returns:
        all system properties
      • removeCMSComponentFromContentSlot

        void removeCMSComponentFromContentSlot​(AbstractCMSComponentModel component,
                                               ContentSlotModel slotModel)
        Removes the cms component from content slot.
        Parameters:
        component - the component to remove
        slotModel - the content slot from which the component will be removed.
      • getAllCMSComponentsForCatalogVersion

        java.util.List<AbstractCMSComponentModel> getAllCMSComponentsForCatalogVersion​(CatalogVersionModel catalogVersionModel)
        gets all cms components for a given catalog.
        Parameters:
        catalogVersionModel - the catalog version model
        Returns:
        all components for a given catalog version
      • getCMSComponentsForContainer

        java.util.Collection<AbstractCMSComponentModel> getCMSComponentsForContainer​(AbstractCMSComponentContainerModel container)
        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

        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

        java.util.Collection<AbstractCMSComponentModel> getDisplayedComponentsForContentSlot​(ContentSlotModel contentSlot)
        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.

        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
      • getContainersForContentSlot

        java.util.Collection<AbstractCMSComponentContainerModel> getContainersForContentSlot​(ContentSlotModel contentSlot)
        Gets the collection of containers within a content slot.
        Parameters:
        contentSlot - - the content slot for which to get all containers
        Returns:
        a collection of containers within the given content slot; never null
      • findByCatalogVersionAndMask

        SearchResult<AbstractCMSComponentModel> findByCatalogVersionAndMask​(CatalogVersionModel catalogVersionModel,
                                                                            java.lang.String mask,
                                                                            PageableData pageableData)
        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
        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