Class DefaultCMSAdminComponentService
java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
de.hybris.platform.cms2.servicelayer.services.admin.impl.AbstractCMSAdminService
de.hybris.platform.cms2.servicelayer.services.admin.impl.DefaultCMSAdminComponentService
- All Implemented Interfaces:
CMSAdminComponentService,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
public class DefaultCMSAdminComponentService
extends AbstractCMSAdminService
implements CMSAdminComponentService
Default implementation of the component service.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO -
Field Summary
FieldsFields inherited from class de.hybris.platform.cms2.servicelayer.services.admin.impl.AbstractCMSAdminService
ACTIVECATALOGVERSION, ACTIVESITE, CLONE_CONTEXT, ORIGINAL_ITEM_CONTEXT, RESTORE_CONTEXT, TYPE_CONTEXTFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManagerFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateCmsComponent(ContentSlotModel contentSlotModel, String componentUid, String componentName, String typeCode) Creates cms component model.findByCatalogVersionAndMask(CatalogVersionModel catalogVersionModel, 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 maskGenerates a new CMS component UIDgetAllCMSComponentsForCatalogVersion(CatalogVersionModel catalogVersionModel) gets all cms components for a given catalog.Gets the allowed cms component containers.Gets the allowed cms components.Gets the cms component container for id.protected CMSComponentContainerRegistryprotected CMSComponentDaoGets the cms component for id.getCMSComponentForIdAndCatalogVersions(String id, Collection<CatalogVersionModel> catalogVersions) Gets the cms component matching the id by searching in the given catalog versions.Get the collection of components that should be provided when a container component is requested.protected Comparator<AbstractCMSComponentModel>protected PersistentKeyGeneratorprotected Collection<ComposedTypeModel>getComposedTypeOfCode(String code) getContainersForContentSlot(ContentSlotModel contentSlot) Gets the collection of containers within a content slot.protected Collection<AbstractCMSComponentModel>Get a collection of components that are displayed based on the given component.getDisplayedComponentsForContentSlot(ContentSlotModel contentSlot) Get the collection of displayed components within a content slot.getEditorProperties(ItemModel component) Get all editor properties for the given content element.getSystemProperties(AbstractCMSComponentModel component) Get all system properties for the given content element.protected TypeServiceprotected BooleanisComponentContainer(AbstractCMSComponentModel component) Checks whether a given component is actually a container.voidremoveCMSComponentFromContentSlot(AbstractCMSComponentModel component, ContentSlotModel contentSlot) Removes the cms component from content slot.voidsetCmsComponentContainerRegistry(CMSComponentContainerRegistry cmsComponentContainerRegistry) voidsetCmsComponentDao(CMSComponentDao cmsComponentDao) voidsetCmsItemCatalogLevelComparator(Comparator<AbstractCMSComponentModel> cmsItemCatalogLevelComparator) voidsetComponentUidGenerator(PersistentKeyGenerator componentUidGenerator) voidsetSystemProperties(List<String> systemProperties) voidsetTypeService(TypeService typeService) Methods inherited from class de.hybris.platform.cms2.servicelayer.services.admin.impl.AbstractCMSAdminService
getActiveCatalogVersion, getActiveSite, getBaseSiteService, getUserService, setBaseSiteService, setUserServiceMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
Field Details
-
CE_SYSTEM_PROPS
- See Also:
-
-
Constructor Details
-
DefaultCMSAdminComponentService
public DefaultCMSAdminComponentService()
-
-
Method Details
-
createCmsComponent
public AbstractCMSComponentModel createCmsComponent(ContentSlotModel contentSlotModel, String componentUid, String componentName, String typeCode) Creates cms component model.- Specified by:
createCmsComponentin interfaceCMSAdminComponentService- 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
Generates a new CMS component UID- Specified by:
generateCmsComponentUidin interfaceCMSAdminComponentService- Returns:
- a newly generated component UID
-
getAllowedCMSComponentContainers
Gets the allowed cms component containers.- Specified by:
getAllowedCMSComponentContainersin interfaceCMSAdminComponentService- Returns:
- the allowed cms component containers
-
getAllowedCMSComponents
Gets the allowed cms components.- Specified by:
getAllowedCMSComponentsin interfaceCMSAdminComponentService- Returns:
- the allowed cms components
-
getCMSComponentContainerForId
public AbstractCMSComponentContainerModel getCMSComponentContainerForId(String id) throws AmbiguousIdentifierException, UnknownIdentifierException Gets the cms component container for id.- Specified by:
getCMSComponentContainerForIdin interfaceCMSAdminComponentService- 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
public AbstractCMSComponentModel getCMSComponentForId(String id) throws AmbiguousIdentifierException, UnknownIdentifierException Gets the cms component for id.- Specified by:
getCMSComponentForIdin interfaceCMSAdminComponentService- 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
public AbstractCMSComponentModel getCMSComponentForIdAndCatalogVersions(String id, Collection<CatalogVersionModel> catalogVersions) throws UnknownIdentifierException Gets the cms component matching the id by searching in the given catalog versions.- Specified by:
getCMSComponentForIdAndCatalogVersionsin interfaceCMSAdminComponentService- Parameters:
id- the id of cms componentcatalogVersions- the collection of catalog versions- Returns:
- found cms component
- Throws:
UnknownIdentifierException- thrown when no object has been found
-
getEditorProperties
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:
getEditorPropertiesin interfaceCMSAdminComponentService- Parameters:
component- the component which editor properties should be retrieved- Returns:
- all editor properties
-
getSystemProperties
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:
getSystemPropertiesin interfaceCMSAdminComponentService- Parameters:
component- the component which system properties should be retrieved- Returns:
- all system properties
-
removeCMSComponentFromContentSlot
public void removeCMSComponentFromContentSlot(AbstractCMSComponentModel component, ContentSlotModel contentSlot) Removes the cms component from content slot.- Specified by:
removeCMSComponentFromContentSlotin interfaceCMSAdminComponentService- Parameters:
component- the component to removecontentSlot- the content slot from which the component will be removed.
-
getAllCMSComponentsForCatalogVersion
public List<AbstractCMSComponentModel> getAllCMSComponentsForCatalogVersion(CatalogVersionModel catalogVersionModel) Description copied from interface:CMSAdminComponentServicegets all cms components for a given catalog.- Specified by:
getAllCMSComponentsForCatalogVersionin interfaceCMSAdminComponentService- Parameters:
catalogVersionModel- the catalog version model- Returns:
- all components for a given catalog version
-
getCMSComponentsForContainer
public Collection<AbstractCMSComponentModel> getCMSComponentsForContainer(AbstractCMSComponentContainerModel container) Description copied from interface:CMSAdminComponentServiceGet 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
- Specified by:
getCMSComponentsForContainerin interfaceCMSAdminComponentService- 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
public Collection<AbstractCMSComponentModel> getDisplayedComponentsForContentSlot(ContentSlotModel contentSlot) Description copied from interface:CMSAdminComponentServiceGet 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.- Specified by:
getDisplayedComponentsForContentSlotin interfaceCMSAdminComponentService- 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
public Collection<AbstractCMSComponentContainerModel> getContainersForContentSlot(ContentSlotModel contentSlot) Description copied from interface:CMSAdminComponentServiceGets the collection of containers within a content slot.- Specified by:
getContainersForContentSlotin interfaceCMSAdminComponentService- Parameters:
contentSlot- - the content slot for which to get all containers- Returns:
- a collection of containers within the given content slot; never
null
-
getDisplayedComponentsForComponent
protected Collection<AbstractCMSComponentModel> getDisplayedComponentsForComponent(AbstractCMSComponentModel component) Get a collection of components that are displayed based on the given component. This will inspect the component to verify if the component is a container and if it is, then we will get all of the components for the given container; otherwise it will simply return a collection with only the component itself.- Parameters:
component- - the component from which to get the displayed components- Returns:
- collections of components displayed for the given component; never
null
-
isComponentContainer
Checks whether a given component is actually a container.- Parameters:
component- - the component to check- Returns:
trueif the component is a container;falseotherwise
-
getCmsComponentDao
-
setCmsComponentDao
-
getSystemProperties
-
setSystemProperties
-
getTypeService
-
setTypeService
-
getComposedTypeOfCode
-
getComponentUidGenerator
-
setComponentUidGenerator
-
getCmsComponentContainerRegistry
-
setCmsComponentContainerRegistry
public void setCmsComponentContainerRegistry(CMSComponentContainerRegistry cmsComponentContainerRegistry) -
findByCatalogVersionAndMask
public SearchResult<AbstractCMSComponentModel> findByCatalogVersionAndMask(CatalogVersionModel catalogVersionModel, String mask, PageableData pageableData) Description copied from interface:CMSAdminComponentServiceFor 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- Specified by:
findByCatalogVersionAndMaskin interfaceCMSAdminComponentService- 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
-
getCmsItemCatalogLevelComparator
-
setCmsItemCatalogLevelComparator
public void setCmsItemCatalogLevelComparator(Comparator<AbstractCMSComponentModel> cmsItemCatalogLevelComparator)
-