Class DefaultCMSComponentService
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.service.AbstractService
-
- de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
-
- de.hybris.platform.cms2.servicelayer.services.impl.AbstractCMSService
-
- de.hybris.platform.cms2.servicelayer.services.impl.DefaultCMSComponentService
-
- All Implemented Interfaces:
CMSComponentService
,java.io.Serializable
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.InitializingBean
public class DefaultCMSComponentService extends AbstractCMSService implements CMSComponentService
Default implementation ofCMSComponentService
interface.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
CE_SYSTEM_PROPS
-
Fields inherited from class de.hybris.platform.cms2.servicelayer.services.impl.AbstractCMSService
CURRENTCATALOGVERSION, CURRENTSITE
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManager
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant
-
-
Constructor Summary
Constructors Constructor Description DefaultCMSComponentService()
Constructor used to create new instance ofDefaultCMSComponentService
-
Method Summary
All Methods Instance Methods Concrete 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.protected CatalogVersionService
getCatalogVersionService()
protected CMSComponentDao
getCmsComponentDao()
java.util.Collection<java.lang.String>
getEditorProperties(AbstractCMSComponentModel component)
Get all editor properties for the given content element.protected java.util.Collection<java.lang.String>
getEditorProperties(AbstractCMSComponentModel component, boolean readableOnly)
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.protected java.util.List<java.lang.String>
getSystemProperties()
java.util.Collection<java.lang.String>
getSystemProperties(AbstractCMSComponentModel component)
Get all system properties for the given content element.protected TypeService
getTypeService()
boolean
isComponentContainer(java.lang.String componentTypeCode)
Checks if component is a container.boolean
isComponentRestricted(AbstractCMSComponentModel component)
Checks if passed as parameterAbstractCMSComponentModel
is restricted restricted.boolean
isComponentUsedOutsidePage(AbstractCMSComponentModel component, AbstractPageModel page)
Checks if the component is used outside the page provided as reference.void
setCatalogVersionService(CatalogVersionService catalogVersionService)
void
setCmsComponentDao(CMSComponentDao cmsComponentDao)
void
setSystemProperties(java.util.List<java.lang.String> systemProperties)
void
setTypeService(TypeService typeService)
-
Methods inherited from class de.hybris.platform.cms2.servicelayer.services.impl.AbstractCMSService
getBaseSiteService, getCurrentCatalogVersion, getCurrentSite, getSearchRestrictionService, getUserService, setBaseSiteService, setSearchRestrictionService, setUserService
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManager
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
-
-
-
Field Detail
-
CE_SYSTEM_PROPS
protected static final java.lang.String CE_SYSTEM_PROPS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAbstractCMSComponent
public <T extends AbstractCMSComponentModel> T getAbstractCMSComponent(java.lang.String id) throws CMSItemNotFoundException
Gets the abstract cms component.- Specified by:
getAbstractCMSComponent
in interfaceCMSComponentService
- 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
public <T extends AbstractCMSComponentModel> SearchPageData<T> getAbstractCMSComponents(java.util.Collection<java.lang.String> ids, SearchPageData searchPageData)
Gets the abstract cms component.- Specified by:
getAbstractCMSComponents
in interfaceCMSComponentService
- 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
public <T extends AbstractCMSComponentModel> SearchPageData<T> getAllAbstractCMSComponents(SearchPageData searchPageData)
Description copied from interface:CMSComponentService
Gets all abstract cms components filtered by the specified pagination and sorting information.- Specified by:
getAllAbstractCMSComponents
in interfaceCMSComponentService
- 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
public <T extends AbstractCMSComponentModel> T getAbstractCMSComponent(java.lang.String id, java.util.Collection<CatalogVersionModel> catalogVersions) throws CMSItemNotFoundException
Gets the abstract cms component.- Specified by:
getAbstractCMSComponent
in interfaceCMSComponentService
- 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
public <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.- Specified by:
getAbstractCMSComponent
in interfaceCMSComponentService
- 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
public 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.- Specified by:
getEditorProperties
in interfaceCMSComponentService
- Parameters:
component
- the component which editor properties should be retrieved- Returns:
- all editor properties
-
getReadableEditorProperties
public java.util.Collection<java.lang.String> getReadableEditorProperties(AbstractCMSComponentModel component)
Get all readable editor properties for the given content element. SeeCMSComponentService.getEditorProperties(AbstractCMSComponentModel)
for retrieving all editor properties.- Specified by:
getReadableEditorProperties
in interfaceCMSComponentService
- Parameters:
component
- the component which editor properties should be retrieved- Returns:
- readable editor properties
-
getEditorProperties
protected java.util.Collection<java.lang.String> getEditorProperties(AbstractCMSComponentModel component, boolean readableOnly)
-
getSimpleCMSComponent
public <T extends SimpleCMSComponentModel> T getSimpleCMSComponent(java.lang.String id) throws CMSItemNotFoundException
Gets the simple cms component.- Specified by:
getSimpleCMSComponent
in interfaceCMSComponentService
- 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
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 interfaceCMSComponentService
- Parameters:
component
- the component which system properties should be retrieved- Returns:
- collection of all system properties for component
-
isComponentContainer
public boolean isComponentContainer(java.lang.String componentTypeCode)
Description copied from interface:CMSComponentService
Checks if component is a container.- Specified by:
isComponentContainer
in interfaceCMSComponentService
- Parameters:
componentTypeCode
- the component'sComposedType
code- Returns:
Boolean.TRUE
if is component,Boolean.FALSE
otherwise
-
isComponentRestricted
public boolean isComponentRestricted(AbstractCMSComponentModel component)
Description copied from interface:CMSComponentService
Checks if passed as parameterAbstractCMSComponentModel
is restricted restricted.- Specified by:
isComponentRestricted
in interfaceCMSComponentService
- Parameters:
component
- the component which is checked against any restrictions- Returns:
true
if is restricted,false
otherwise
-
isComponentUsedOutsidePage
public boolean isComponentUsedOutsidePage(AbstractCMSComponentModel component, AbstractPageModel page)
Description copied from interface:CMSComponentService
Checks if the component is used outside the page provided as reference.- Specified by:
isComponentUsedOutsidePage
in interfaceCMSComponentService
- Parameters:
component
- The component to check.page
- The page used as reference.- Returns:
Boolean.TRUE
if the component is used elsewhere.Boolean.FALSE
if it's never used or if it's only used in the reference page.
-
getCmsComponentDao
protected CMSComponentDao getCmsComponentDao()
-
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)
-
getCatalogVersionService
protected CatalogVersionService getCatalogVersionService()
-
setCatalogVersionService
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
-
-