public class DefaultCMSAdminContentSlotService extends AbstractCMSAdminService implements CMSAdminContentSlotService
AbstractService.SerializableDTO| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_CONTENTSLOT_FOR_PAGE_UID_PREFIX |
static java.lang.String |
DEFAULT_CONTENTSLOT_UID_SUFFIX |
ACTIVECATALOGVERSION, ACTIVESITE, CLONE_CONTEXT, RESTORE_CONTEXTmodelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultCMSAdminContentSlotService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCMSComponentToContentSlot(AbstractCMSComponentModel component,
ContentSlotModel slot,
java.lang.Integer index)
Add an existing component item into a specific index position of an existing content slot.
|
protected void |
addComponentToComponentListSaveAsSlot(AbstractCMSComponentModel component,
ContentSlotModel slot,
java.lang.Integer index,
java.util.List<AbstractCMSComponentModel> currentComponentList) |
protected java.util.List<ContentSlotModel> |
appendTemplateSlots(PageTemplateModel pageTemplate,
java.util.Set<java.lang.String> positions,
java.util.List<ContentSlotData> contentSlots,
AbstractPageModel page)
Gets all of the content slots for templates that do not share a position already identified in the content slots
for pages.
|
ContentSlotModel |
createContentSlot(AbstractPageModel page,
java.lang.String id,
java.lang.String name,
java.lang.String position)
Creates the
ContentSlotModel object and ContentSlotForPageModel relation. |
ContentSlotModel |
createContentSlot(AbstractPageModel page,
java.lang.String id,
java.lang.String name,
java.lang.String position,
boolean active)
Creates the
ContentSlotModel object and ContentSlotForPageModel relation. |
ContentSlotModel |
createContentSlot(AbstractPageModel page,
java.lang.String id,
java.lang.String name,
java.lang.String position,
boolean active,
java.util.Date activeFrom,
java.util.Date activeUntil)
Creates the
ContentSlotModel object and ContentSlotForPageModel relation. |
void |
deleteContentSlot(java.lang.String contentSlotId)
delete a content slot and ALL PAGE RELATIONS to it.
|
void |
deleteRelation(AbstractPageModel page,
ContentSlotModel contentSlot)
delete the relation between a content slot and a page
|
void |
deleteRelationByPosition(AbstractPageModel page,
java.lang.String position)
deletes a relation between a page and a content slot.
|
java.util.List<ContentSlotForPageModel> |
findAllContentSlotRelationsByPage(AbstractPageModel page)
Find all content slot relations by page.
|
java.util.List<ContentSlotForTemplateModel> |
findAllContentSlotRelationsByPageTemplate(PageTemplateModel template)
Find all content slot relations by page template.
|
protected java.lang.String |
generateContentSlotForPageUID()
Generate the content slot id using the page uid prefix and the key generator.
|
protected java.lang.String |
generateContentSlotUid(AbstractPageModel page,
java.lang.String position)
Generate the Content Slot Uid after the slot position and page Uid
|
protected CMSAdminSiteService |
getAdminSiteService() |
java.util.Collection<CMSRelationModel> |
getAllRelationsForSlot(ContentSlotModel contentSlot)
Returns all page and template relations with references to this content slot
|
protected CMSAdminComponentService |
getCmsAdminComponentService() |
protected CatalogLevelService |
getCmsCatalogLevelService() |
protected CMSContentSlotDao |
getCmsContentSlotDao() |
protected CMSDataFactory |
getCmsDataFactory() |
protected ConfigurationService |
getConfigurationService() |
ContentSlotModel |
getContentSlotForId(java.lang.String contentSlotId)
Gets the content slot for specific content slot id.
|
ContentSlotModel |
getContentSlotForIdAndCatalogVersions(java.lang.String contentSlotId,
java.util.Collection<CatalogVersionModel> catalogVersions)
Gets the content slot for slot id and collection of catalog versions.
|
java.lang.String |
getContentSlotForPageUidPrefix() |
ContentSlotModel |
getContentSlotOverride(AbstractPageModel page,
ContentSlotModel contentSlot)
Find the content slot in the catalog hierarchy (used with multi-country)
|
java.lang.String |
getContentSlotPosition(AbstractPageModel page,
ContentSlotModel contentSlot)
Find the position of the content slot on the page or its associated page template
|
java.util.List<ContentSlotForPageModel> |
getContentSlotRelationsByPageId(java.lang.String pageId,
CatalogVersionModel catalogVersion)
Find content slot relations for a given pageId and catalog version.
|
java.util.Collection<ContentSlotModel> |
getContentSlotsForCatalogVersion(CatalogVersionModel catalogVersion)
Find all content slots that belong to a given catalog version.
|
java.util.Collection<ContentSlotData> |
getContentSlotsForPage(AbstractPageModel page)
returns a collection of all content slots for the given page.
|
java.util.Collection<ContentSlotData> |
getContentSlotsForPage(AbstractPageModel page,
boolean includeMasterTemplateSlots)
Returns a collection of all content slots for the given page.
|
java.lang.String |
getContentSlotUidSuffix() |
KeyGenerator |
getKeyGenerator() |
java.util.Collection<CMSRelationModel> |
getOnlyContentSlotRelationsForSlot(ContentSlotModel contentSlot)
Returns only page relations with references to this content slot.
|
protected ContentSlotModel |
getOverrideSlot(java.util.List<ContentSlotModel> contentSlots,
ContentSlotModel contentSlot) |
protected PermissionCRUDService |
getPermissionCRUDService() |
java.util.List<ContentSlotModel> |
getSortedMultiCountryContentSlots(java.util.List<ContentSlotModel> contentSlots,
java.util.List<CatalogVersionModel> catalogVersions)
Orders the given content slots according to the catalog level where the slots are defined.
|
boolean |
hasOtherRelations(AbstractPageModel page,
ContentSlotModel contentSlot)
Checks if there are other relations between the given content slot and other pages (except the given one)
|
boolean |
hasRelations(ContentSlotModel contentSlot)
Checks if the given content slot has relations to one or more pages
|
void |
setAdminSiteService(CMSAdminSiteService adminSiteService) |
void |
setCmsAdminComponentService(CMSAdminComponentService cmsAdminComponentService) |
void |
setCmsCatalogLevelService(CatalogLevelService cmsCatalogLevelService) |
void |
setCmsContentSlotDao(CMSContentSlotDao cmsContentSlotDao) |
void |
setCmsDataFactory(CMSDataFactory cmsDataFactory) |
void |
setConfigurationService(ConfigurationService configurationService) |
void |
setContentSlotForPageUidPrefix(java.lang.String contentSlotForPageUidPrefix) |
void |
setContentSlotUidSuffix(java.lang.String contentSlotUidSuffix) |
void |
setKeyGenerator(KeyGenerator keyGenerator) |
void |
setPermissionCRUDService(PermissionCRUDService permissionCRUDService) |
protected void |
throwTypePermissionException(java.lang.String permissionName,
java.lang.String typeCode)
Throws
TypePermissionException. |
void |
updatePositionCMSComponentInContentSlot(AbstractCMSComponentModel component,
ContentSlotModel slot,
java.lang.Integer index)
Update the position of an existing component item into a specific index position of an existing content slot.
|
getActiveCatalogVersion, getActiveSite, getBaseSiteService, getUserService, setBaseSiteService, setUserServicegetModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplacepublic static final java.lang.String DEFAULT_CONTENTSLOT_FOR_PAGE_UID_PREFIX
public static final java.lang.String DEFAULT_CONTENTSLOT_UID_SUFFIX
public ContentSlotModel createContentSlot(AbstractPageModel page, java.lang.String id, java.lang.String name, java.lang.String position)
ContentSlotModel object and ContentSlotForPageModel relation. Method
explicitly saves both objects.createContentSlot in interface CMSAdminContentSlotServicepage - the page which will be set for ContentSlotForPageModel relation.id - the id of content slot.name - the name of content slot.position - the position of page.ContentSlotModel object.public ContentSlotModel createContentSlot(AbstractPageModel page, java.lang.String id, java.lang.String name, java.lang.String position, boolean active)
ContentSlotModel object and ContentSlotForPageModel relation. Method
explicitly saves both objects.createContentSlot in interface CMSAdminContentSlotServicepage - the page which will be set for ContentSlotForPageModel relation.id - the id of content slot.name - the name of content slot.position - the position of page.active - the activity of content slot (true or false)ContentSlotModel object.public ContentSlotModel createContentSlot(AbstractPageModel page, java.lang.String id, java.lang.String name, java.lang.String position, boolean active, java.util.Date activeFrom, java.util.Date activeUntil)
ContentSlotModel object and ContentSlotForPageModel relation. Method
explicitly saves both objects.createContentSlot in interface CMSAdminContentSlotServicepage - the page which will be set for ContentSlotForPageModel relation.id - the id of content slot.name - the name of content slot.position - the position of page.active - the activity of content slot (true or false)activeFrom - start date of activity.activeUntil - end date of activity.ContentSlotModel object.protected java.lang.String generateContentSlotUid(AbstractPageModel page, java.lang.String position)
page - page model to get the uid fromposition - the position on the slotprotected java.lang.String generateContentSlotForPageUID()
public void deleteContentSlot(java.lang.String contentSlotId)
throws CMSItemNotFoundException
deleteContentSlot in interface CMSAdminContentSlotServicecontentSlotId - the identifier of the content slot to be deletedCMSItemNotFoundException - if the content slot could not be foundpublic void deleteRelation(AbstractPageModel page, ContentSlotModel contentSlot)
deleteRelation in interface CMSAdminContentSlotServicepage - the page modelcontentSlot - the content slot modelpublic void deleteRelationByPosition(AbstractPageModel page, java.lang.String position)
deleteRelationByPosition in interface CMSAdminContentSlotServicepage - the page modelposition - the positionpublic java.util.Collection<CMSRelationModel> getAllRelationsForSlot(ContentSlotModel contentSlot)
getAllRelationsForSlot in interface CMSAdminContentSlotServicecontentSlot - the content slotpublic java.util.Collection<CMSRelationModel> getOnlyContentSlotRelationsForSlot(ContentSlotModel contentSlot)
CMSAdminContentSlotService.getAllRelationsForSlot(ContentSlotModel) it does not return template relationsgetOnlyContentSlotRelationsForSlot in interface CMSAdminContentSlotServicecontentSlot - the content slotCMSAdminContentSlotService.getAllRelationsForSlot(ContentSlotModel)public ContentSlotModel getContentSlotForId(java.lang.String contentSlotId) throws UnknownIdentifierException, AmbiguousIdentifierException
getContentSlotForId in interface CMSAdminContentSlotServicecontentSlotId - the content slot idUnknownIdentifierException - thrown when no object has been foundAmbiguousIdentifierException - thrown when more than one object has been found.public ContentSlotModel getContentSlotForIdAndCatalogVersions(java.lang.String contentSlotId, java.util.Collection<CatalogVersionModel> catalogVersions) throws UnknownIdentifierException, AmbiguousIdentifierException
getContentSlotForIdAndCatalogVersions in interface CMSAdminContentSlotServicecontentSlotId - the content slot idcatalogVersions - the collection of catalog versionsUnknownIdentifierException - thrown when no object has been foundAmbiguousIdentifierException - thrown when more than one object has been found.public java.util.Collection<ContentSlotData> getContentSlotsForPage(AbstractPageModel page)
getContentSlotsForPage in interface CMSAdminContentSlotServicepage - the page modelpublic java.util.Collection<ContentSlotData> getContentSlotsForPage(AbstractPageModel page, boolean includeMasterTemplateSlots)
getContentSlotsForPage in interface CMSAdminContentSlotServicepage - the page for which to retrieve the content slotsincludeMasterTemplateSlots - true to include the content slots defined in the master page template, false otherwisepublic java.util.List<ContentSlotForTemplateModel> findAllContentSlotRelationsByPageTemplate(PageTemplateModel template)
findAllContentSlotRelationsByPageTemplate in interface CMSAdminContentSlotServicetemplate - the page templateContentSlotForTemplateModel objects or empty list when not found.public java.util.List<ContentSlotForPageModel> findAllContentSlotRelationsByPage(AbstractPageModel page)
findAllContentSlotRelationsByPage in interface CMSAdminContentSlotServicepage - the pageContentSlotForPageModel objects or empty list when not foundprotected ContentSlotModel getOverrideSlot(java.util.List<ContentSlotModel> contentSlots, ContentSlotModel contentSlot)
protected java.util.List<ContentSlotModel> appendTemplateSlots(PageTemplateModel pageTemplate, java.util.Set<java.lang.String> positions, java.util.List<ContentSlotData> contentSlots, AbstractPageModel page)
pageTemplate - - the page templatepositions - - the positionscontentSlots - - the list of content slot which new slots values will be appended topage - - the page containing the content slotcontentSlots listpublic void updatePositionCMSComponentInContentSlot(AbstractCMSComponentModel component, ContentSlotModel slot, java.lang.Integer index)
CMSAdminContentSlotServiceIf the index provided is larger than the last available position in the slot, then the component will be added to the last position.
updatePositionCMSComponentInContentSlot in interface CMSAdminContentSlotServicecomponent - - the component item; never nullslot - - the content slot; never nullindex - - where to insert the component in the slot; never null, must be a positive numberpublic void addCMSComponentToContentSlot(AbstractCMSComponentModel component, ContentSlotModel slot, java.lang.Integer index)
CMSAdminContentSlotServiceIf the index provided is larger than the last available position in the slot, then the component will be added to the last position.
addCMSComponentToContentSlot in interface CMSAdminContentSlotServicecomponent - - the component item; never nullslot - - the content slot; never nullindex - - where to insert the component in the slot; never null, must be a positive numberprotected void addComponentToComponentListSaveAsSlot(AbstractCMSComponentModel component, ContentSlotModel slot, java.lang.Integer index, java.util.List<AbstractCMSComponentModel> currentComponentList)
public boolean hasOtherRelations(AbstractPageModel page, ContentSlotModel contentSlot)
hasOtherRelations in interface CMSAdminContentSlotServicepage - the page modelcontentSlot - the content slot modeltrue if there are other relations between the content slot and other pages; false
otherwisepublic boolean hasRelations(ContentSlotModel contentSlot)
hasRelations in interface CMSAdminContentSlotServicecontentSlot - the content slot modeltrue if there are relations to at least one other page; false otherwisepublic java.util.Collection<ContentSlotModel> getContentSlotsForCatalogVersion(CatalogVersionModel catalogVersion)
CMSAdminContentSlotServicegetContentSlotsForCatalogVersion in interface CMSAdminContentSlotServicecatalogVersion - - the catalog versionnullpublic java.util.List<ContentSlotModel> getSortedMultiCountryContentSlots(java.util.List<ContentSlotModel> contentSlots, java.util.List<CatalogVersionModel> catalogVersions)
CMSAdminContentSlotServiceCatalogLevelService to determine the ordering.getSortedMultiCountryContentSlots in interface CMSAdminContentSlotServicecontentSlots - - the content slots to be sortedcatalogVersions - - the catalog versionspublic ContentSlotModel getContentSlotOverride(AbstractPageModel page, ContentSlotModel contentSlot)
CMSAdminContentSlotServicegetContentSlotOverride in interface CMSAdminContentSlotServicepage - - the page model used to determine the target catalog versioncontentSlot - - the content slot to be overriddenpublic java.util.List<ContentSlotForPageModel> getContentSlotRelationsByPageId(java.lang.String pageId, CatalogVersionModel catalogVersion)
CMSAdminContentSlotServicegetContentSlotRelationsByPageId in interface CMSAdminContentSlotServicepageId - the page identifiercatalogVersion - the catalog versionsContentSlotForPageModel objects or empty list when not foundpublic java.lang.String getContentSlotPosition(AbstractPageModel page, ContentSlotModel contentSlot)
CMSAdminContentSlotServicegetContentSlotPosition in interface CMSAdminContentSlotServicepage - the page model containing the content slotcontentSlot - the content slot to search fornull if not foundprotected void throwTypePermissionException(java.lang.String permissionName,
java.lang.String typeCode)
TypePermissionException.permissionName - permission nametypeCode - type codepublic void setCmsAdminComponentService(CMSAdminComponentService cmsAdminComponentService)
public void setCmsContentSlotDao(CMSContentSlotDao cmsContentSlotDao)
public void setCmsDataFactory(CMSDataFactory cmsDataFactory)
protected CMSAdminComponentService getCmsAdminComponentService()
protected CMSContentSlotDao getCmsContentSlotDao()
protected CMSDataFactory getCmsDataFactory()
public KeyGenerator getKeyGenerator()
public void setKeyGenerator(KeyGenerator keyGenerator)
protected CMSAdminSiteService getAdminSiteService()
public void setAdminSiteService(CMSAdminSiteService adminSiteService)
protected ConfigurationService getConfigurationService()
public void setConfigurationService(ConfigurationService configurationService)
protected CatalogLevelService getCmsCatalogLevelService()
public void setCmsCatalogLevelService(CatalogLevelService cmsCatalogLevelService)
public java.lang.String getContentSlotForPageUidPrefix()
public void setContentSlotForPageUidPrefix(java.lang.String contentSlotForPageUidPrefix)
public java.lang.String getContentSlotUidSuffix()
public void setContentSlotUidSuffix(java.lang.String contentSlotUidSuffix)
protected PermissionCRUDService getPermissionCRUDService()
public void setPermissionCRUDService(PermissionCRUDService permissionCRUDService)
Copyright © 2018 SAP SE. All Rights Reserved.