Interface CMSAdminComponentService
-
- All Known Implementing Classes:
DefaultCMSAdminComponentService
public interface CMSAdminComponentServiceThe Interface CMSAdminComponentService is responsible for managing components and component containers.- Spring Bean ID:
- cmsAdminComponentService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AbstractCMSComponentModelcreateCmsComponent(ContentSlotModel contentSlotModel, java.lang.String componentUid, java.lang.String componentName, java.lang.String typeCode)Creates cms component model.SearchResult<AbstractCMSComponentModel>findByCatalogVersionAndMask(CatalogVersionModel catalogVersionModel, java.lang.String mask, PageableData pageableData)For a given mask used as filter and aPageableDataquery, will return a page object consisting of the content list of the requested page number and the total number of entities for the given maskjava.lang.StringgenerateCmsComponentUid()Generates a new CMS component UIDjava.util.List<AbstractCMSComponentModel>getAllCMSComponentsForCatalogVersion(CatalogVersionModel catalogVersionModel)gets all cms components for a given catalog.java.util.Collection<ComposedTypeModel>getAllowedCMSComponentContainers()Gets the allowed cms component containers.java.util.Collection<ComposedTypeModel>getAllowedCMSComponents()Gets the allowed cms components.AbstractCMSComponentContainerModelgetCMSComponentContainerForId(java.lang.String id)Gets the cms component container for id.AbstractCMSComponentModelgetCMSComponentForId(java.lang.String id)Gets the cms component for id.AbstractCMSComponentModelgetCMSComponentForIdAndCatalogVersions(java.lang.String id, java.util.Collection<CatalogVersionModel> catalogVersions)Gets the cms component matching the id by searching in the given catalog versions.java.util.Collection<AbstractCMSComponentModel>getCMSComponentsForContainer(AbstractCMSComponentContainerModel container)Get the collection of components that should be provided when a container component is requested.java.util.Collection<AbstractCMSComponentContainerModel>getContainersForContentSlot(ContentSlotModel contentSlot)Gets the collection of containers within a content slot.java.util.Collection<AbstractCMSComponentModel>getDisplayedComponentsForContentSlot(ContentSlotModel contentSlot)Get the collection of displayed components within a content slot.java.util.Collection<java.lang.String>getEditorProperties(ItemModel component)Get all editor properties for the given content element.java.util.Collection<java.lang.String>getSystemProperties(AbstractCMSComponentModel component)Get all system properties for the given content element.voidremoveCMSComponentFromContentSlot(AbstractCMSComponentModel component, ContentSlotModel slotModel)Removes the cms component from content slot.
-
-
-
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 slotcomponentUid- the uid for the new cms componentcomponentName- the name for new cms componenttypeCode- 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
-
getCMSComponentContainerForId
AbstractCMSComponentContainerModel getCMSComponentContainerForId(java.lang.String id) throws AmbiguousIdentifierException, UnknownIdentifierException
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
AbstractCMSComponentModel getCMSComponentForId(java.lang.String id) throws AmbiguousIdentifierException, UnknownIdentifierException
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(java.lang.String id, java.util.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 componentcatalogVersions- 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
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 removeslotModel- 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
CMSComponentContainerStrategyto 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 aPageableDataquery, 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 onmask- the string value on which components will be filtered, implementations may choose to filter on the component namepageableData- thePageableDataobject 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
-
-