Interface CMSComponentService
-
- All Known Implementing Classes:
DefaultCMSComponentService
public interface CMSComponentServiceThe Interface CMSComponentService provides methods for managing cms components.- Spring Bean ID:
- cmsComponentService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends AbstractCMSComponentModel>
TgetAbstractCMSComponent(java.lang.String id)Gets the abstract cms component.<T extends AbstractCMSComponentModel>
TgetAbstractCMSComponent(java.lang.String id, java.lang.String contentSlotId, java.util.Collection<CatalogVersionModel> catalogVersions)Gets the abstract cms component.<T extends AbstractCMSComponentModel>
TgetAbstractCMSComponent(java.lang.String id, java.util.Collection<CatalogVersionModel> catalogVersions)Gets the abstract cms component.<T extends AbstractCMSComponentModel>
SearchPageData<T>getAbstractCMSComponents(java.util.Collection<java.lang.String> ids, SearchPageData searchPageData)Gets the abstract cms component.<T extends AbstractCMSComponentModel>
SearchPageData<T>getAllAbstractCMSComponents(SearchPageData searchPageData)Gets all abstract cms components filtered by the specified pagination and sorting information.java.util.Collection<java.lang.String>getEditorProperties(AbstractCMSComponentModel component)Get all editor properties for the given content element.java.util.Collection<java.lang.String>getReadableEditorProperties(AbstractCMSComponentModel component)Get all readable editor properties for the given content element.<T extends SimpleCMSComponentModel>
TgetSimpleCMSComponent(java.lang.String id)Gets the simple cms component.java.util.Collection<java.lang.String>getSystemProperties(AbstractCMSComponentModel component)Get all system properties for the given content element.booleanisComponentContainer(java.lang.String componentTypeCode)Checks if component is a container.booleanisComponentRestricted(AbstractCMSComponentModel component)Checks if passed as parameterAbstractCMSComponentModelis restricted restricted.booleanisComponentUsedOutsidePage(AbstractCMSComponentModel component, AbstractPageModel page)Checks if the component is used outside the page provided as reference.
-
-
-
Method Detail
-
getAbstractCMSComponent
<T extends AbstractCMSComponentModel> T getAbstractCMSComponent(java.lang.String id) throws CMSItemNotFoundException
Gets the abstract cms component.- Type Parameters:
T- the generic type- Parameters:
id- the id of cms component to get- Returns:
- the abstract cms component
- Throws:
CMSItemNotFoundException- thrown when item was not found
-
getAbstractCMSComponents
<T extends AbstractCMSComponentModel> SearchPageData<T> getAbstractCMSComponents(java.util.Collection<java.lang.String> ids, SearchPageData searchPageData)
Gets the abstract cms component.- Type Parameters:
T- the AbstractCMSComponentModel subclass type- Parameters:
ids- the id collection of cms components to getsearchPageData- the searchPageData contains requested pagination and sorting information- Returns:
- the list of abstract cms component in SearchPageData; otherwise return an empty collection result when no component is found
-
getAllAbstractCMSComponents
<T extends AbstractCMSComponentModel> SearchPageData<T> getAllAbstractCMSComponents(SearchPageData searchPageData)
Gets all abstract cms components filtered by the specified pagination and sorting information.- Type Parameters:
T- the AbstractCMSComponentModel subclass type- Parameters:
searchPageData- the searchPageData contains requested pagination and sorting information- Returns:
- the list of abstract cms component in SearchPageData; otherwise return an empty collection result when no component is found
-
getAbstractCMSComponent
<T extends AbstractCMSComponentModel> T getAbstractCMSComponent(java.lang.String id, java.util.Collection<CatalogVersionModel> catalogVersions) throws CMSItemNotFoundException
Gets the abstract cms component.- Type Parameters:
T- the generic type- Parameters:
id- the id of cms component to getcatalogVersions- the catalog versions- Returns:
- the abstract cms component
- Throws:
CMSItemNotFoundException- thrown when item was not found
-
getAbstractCMSComponent
<T extends AbstractCMSComponentModel> T getAbstractCMSComponent(java.lang.String id, java.lang.String contentSlotId, java.util.Collection<CatalogVersionModel> catalogVersions) throws CMSItemNotFoundException
Gets the abstract cms component.- Type Parameters:
T- the generic type- Parameters:
id- the id of cms component to getcontentSlotId- the content slot idcatalogVersions- the catalog versions- Returns:
- the abstract cms component
- Throws:
CMSItemNotFoundException- thrown when item was not found
-
getEditorProperties
java.util.Collection<java.lang.String> getEditorProperties(AbstractCMSComponentModel 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
-
getReadableEditorProperties
java.util.Collection<java.lang.String> getReadableEditorProperties(AbstractCMSComponentModel component)
Get all readable editor properties for the given content element. SeegetEditorProperties(AbstractCMSComponentModel)for retrieving all editor properties.- Parameters:
component- the component which editor properties should be retrieved- Returns:
- readable editor properties
-
getSimpleCMSComponent
<T extends SimpleCMSComponentModel> T getSimpleCMSComponent(java.lang.String id) throws CMSItemNotFoundException
Gets the simple cms component.- Type Parameters:
T- the generic type- Parameters:
id- the id of component to get- Returns:
- the simple cms component
- Throws:
CMSItemNotFoundException- thrown when item was not found
-
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:
- collection of all system properties for component
-
isComponentRestricted
boolean isComponentRestricted(AbstractCMSComponentModel component)
Checks if passed as parameterAbstractCMSComponentModelis restricted restricted.- Parameters:
component- the component which is checked against any restrictions- Returns:
trueif is restricted,falseotherwise
-
isComponentContainer
boolean isComponentContainer(java.lang.String componentTypeCode)
Checks if component is a container.- Parameters:
componentTypeCode- the component'sComposedTypecode- Returns:
Boolean.TRUEif is component,Boolean.FALSEotherwise
-
isComponentUsedOutsidePage
boolean isComponentUsedOutsidePage(AbstractCMSComponentModel component, AbstractPageModel page)
Checks if the component is used outside the page provided as reference.- Parameters:
component- The component to check.page- The page used as reference.- Returns:
Boolean.TRUEif the component is used elsewhere.Boolean.FALSEif it's never used or if it's only used in the reference page.
-
-