public class DefaultCMSAdminComponentService extends AbstractCMSAdminService implements CMSAdminComponentService
AbstractService.SerializableDTO| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
CE_SYSTEM_PROPS |
ACTIVECATALOGVERSION, ACTIVESITE, CLONE_CONTEXT, RESTORE_CONTEXTmodelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultCMSAdminComponentService() |
| Modifier and Type | Method and Description |
|---|---|
AbstractCMSComponentModel |
createCmsComponent(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 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 |
java.lang.String |
generateCmsComponentUid()
Generates a new CMS component UID
|
java.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.
|
AbstractCMSComponentContainerModel |
getCMSComponentContainerForId(java.lang.String id)
Gets the cms component container for id.
|
protected CMSComponentContainerRegistry |
getCmsComponentContainerRegistry() |
protected CMSComponentDao |
getCmsComponentDao() |
AbstractCMSComponentModel |
getCMSComponentForId(java.lang.String id)
Gets the cms component for id.
|
AbstractCMSComponentModel |
getCMSComponentForIdAndCatalogVersions(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.
|
protected java.util.Comparator<AbstractCMSComponentModel> |
getCmsItemCatalogLevelComparator() |
protected PersistentKeyGenerator |
getComponentUidGenerator() |
protected java.util.Collection<ComposedTypeModel> |
getComposedTypeOfCode(java.lang.String code) |
java.util.Collection<AbstractCMSComponentContainerModel> |
getContainersForContentSlot(ContentSlotModel contentSlot)
Gets the collection of containers within a content slot.
|
protected java.util.Collection<AbstractCMSComponentModel> |
getDisplayedComponentsForComponent(AbstractCMSComponentModel component)
Get a collection of components that are displayed based on the given component.
|
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.
|
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() |
protected java.lang.Boolean |
isComponentContainer(AbstractCMSComponentModel component)
Checks whether a given component is actually a container.
|
void |
removeCMSComponentFromContentSlot(AbstractCMSComponentModel component,
ContentSlotModel contentSlot)
Removes the cms component from content slot.
|
void |
setCmsComponentContainerRegistry(CMSComponentContainerRegistry cmsComponentContainerRegistry) |
void |
setCmsComponentDao(CMSComponentDao cmsComponentDao) |
void |
setCmsItemCatalogLevelComparator(java.util.Comparator<AbstractCMSComponentModel> cmsItemCatalogLevelComparator) |
void |
setComponentUidGenerator(PersistentKeyGenerator componentUidGenerator) |
void |
setSystemProperties(java.util.List<java.lang.String> systemProperties) |
void |
setTypeService(TypeService typeService) |
getActiveCatalogVersion, getActiveSite, getBaseSiteService, getUserService, setBaseSiteService, setUserServicegetModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplaceprotected static final java.lang.String CE_SYSTEM_PROPS
public AbstractCMSComponentModel createCmsComponent(ContentSlotModel contentSlotModel, java.lang.String componentUid, java.lang.String componentName, java.lang.String typeCode)
createCmsComponent in interface CMSAdminComponentServicecontentSlotModel - the content slotcomponentUid - the uid for the new cms componentcomponentName - the name for new cms componenttypeCode - the composed type code for new cms componentpublic java.lang.String generateCmsComponentUid()
generateCmsComponentUid in interface CMSAdminComponentServicepublic java.util.Collection<ComposedTypeModel> getAllowedCMSComponentContainers()
getAllowedCMSComponentContainers in interface CMSAdminComponentServicepublic java.util.Collection<ComposedTypeModel> getAllowedCMSComponents()
getAllowedCMSComponents in interface CMSAdminComponentServicepublic AbstractCMSComponentContainerModel getCMSComponentContainerForId(java.lang.String id) throws AmbiguousIdentifierException, UnknownIdentifierException
getCMSComponentContainerForId in interface CMSAdminComponentServiceid - the id of cms component container.AmbiguousIdentifierException - thrown when more than one object has been found.UnknownIdentifierException - thrown when no object has been foundpublic AbstractCMSComponentModel getCMSComponentForId(java.lang.String id) throws AmbiguousIdentifierException, UnknownIdentifierException
getCMSComponentForId in interface CMSAdminComponentServiceid - the id of cms componentAmbiguousIdentifierException - thrown when more than one object has been found.UnknownIdentifierException - thrown when no object has been foundpublic AbstractCMSComponentModel getCMSComponentForIdAndCatalogVersions(java.lang.String id, java.util.Collection<CatalogVersionModel> catalogVersions) throws UnknownIdentifierException
getCMSComponentForIdAndCatalogVersions in interface CMSAdminComponentServiceid - the id of cms componentcatalogVersions - the collection of catalog versionsUnknownIdentifierException - thrown when no object has been foundpublic java.util.Collection<java.lang.String> getEditorProperties(ItemModel component)
getEditorProperties in interface CMSAdminComponentServicecomponent - the component which editor properties should be retrievedpublic java.util.Collection<java.lang.String> getSystemProperties(AbstractCMSComponentModel component)
getSystemProperties in interface CMSAdminComponentServicecomponent - the component which system properties should be retrievedpublic void removeCMSComponentFromContentSlot(AbstractCMSComponentModel component, ContentSlotModel contentSlot)
removeCMSComponentFromContentSlot in interface CMSAdminComponentServicecomponent - the component to removecontentSlot - the content slot from which the component will be removed.public java.util.List<AbstractCMSComponentModel> getAllCMSComponentsForCatalogVersion(CatalogVersionModel catalogVersionModel)
CMSAdminComponentServicegetAllCMSComponentsForCatalogVersion in interface CMSAdminComponentServicecatalogVersionModel - the catalog version modelpublic java.util.Collection<AbstractCMSComponentModel> getCMSComponentsForContainer(AbstractCMSComponentContainerModel container)
CMSAdminComponentService
This service depends on a CMSComponentContainerStrategy to decide if:
getCMSComponentsForContainer in interface CMSAdminComponentServicecontainer - - the container model from which we want to get the componentsnullpublic java.util.Collection<AbstractCMSComponentModel> getDisplayedComponentsForContentSlot(ContentSlotModel contentSlot)
CMSAdminComponentService
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.
getDisplayedComponentsForContentSlot in interface CMSAdminComponentServicecontentSlot - - the content slot for which we want to get all displayed componentsnullpublic java.util.Collection<AbstractCMSComponentContainerModel> getContainersForContentSlot(ContentSlotModel contentSlot)
CMSAdminComponentServicegetContainersForContentSlot in interface CMSAdminComponentServicecontentSlot - - the content slot for which to get all containersnullprotected java.util.Collection<AbstractCMSComponentModel> getDisplayedComponentsForComponent(AbstractCMSComponentModel component)
component - - the component from which to get the displayed componentsnullprotected java.lang.Boolean isComponentContainer(AbstractCMSComponentModel component)
component - - the component to checktrue if the component is a container; false otherwiseprotected CMSComponentDao getCmsComponentDao()
public void setCmsComponentDao(CMSComponentDao cmsComponentDao)
protected java.util.List<java.lang.String> getSystemProperties()
public void setSystemProperties(java.util.List<java.lang.String> systemProperties)
protected TypeService getTypeService()
public void setTypeService(TypeService typeService)
protected java.util.Collection<ComposedTypeModel> getComposedTypeOfCode(java.lang.String code)
protected PersistentKeyGenerator getComponentUidGenerator()
public void setComponentUidGenerator(PersistentKeyGenerator componentUidGenerator)
protected CMSComponentContainerRegistry getCmsComponentContainerRegistry()
public void setCmsComponentContainerRegistry(CMSComponentContainerRegistry cmsComponentContainerRegistry)
public SearchResult<AbstractCMSComponentModel> findByCatalogVersionAndMask(CatalogVersionModel catalogVersionModel, java.lang.String mask, PageableData pageableData)
CMSAdminComponentServicePageableData 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 maskfindByCatalogVersionAndMask in interface CMSAdminComponentServicecatalogVersionModel - the catalog version to filter onmask - the string value on which components will be filtered, implementations may choose to filter on the
component namepageableData - 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.protected java.util.Comparator<AbstractCMSComponentModel> getCmsItemCatalogLevelComparator()
public void setCmsItemCatalogLevelComparator(java.util.Comparator<AbstractCMSComponentModel> cmsItemCatalogLevelComparator)
Copyright © 2018 SAP SE. All Rights Reserved.