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 Details

    • createCmsComponent

      AbstractCMSComponentModel createCmsComponent(ContentSlotModel contentSlotModel, String componentUid, String componentName, 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

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

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

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

      Gets the cms component container for id.
      Parameters:
      id - the id of cms component container.
      Returns:
      found cms component container.
      Throws:
      AmbiguousIdentifierException - thrown when more than one object has been found.
      UnknownIdentifierException - thrown when no object has been found
    • getCMSComponentForId

      Gets the cms component for id.
      Parameters:
      id - the id of cms component
      Returns:
      found cms component
      Throws:
      AmbiguousIdentifierException - thrown when more than one object has been found.
      UnknownIdentifierException - thrown when no object has been found
    • getCMSComponentForIdAndCatalogVersions

      AbstractCMSComponentModel getCMSComponentForIdAndCatalogVersions(String id, Collection<CatalogVersionModel> catalogVersions) throws AmbiguousIdentifierException, UnknownIdentifierException
      Gets the cms component matching the id by searching in the given catalog versions.
      Parameters:
      id - the id of cms component
      catalogVersions - the collection of catalog versions
      Returns:
      found cms component
      Throws:
      AmbiguousIdentifierException - thrown when more than one object has been found.
      UnknownIdentifierException - thrown when no object has been found
    • getEditorProperties

      Collection<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

      Collection<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

      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

      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

      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

      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, 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