public class DefaultCMSAdminContentSlotService extends AbstractCMSAdminService implements CMSAdminContentSlotService
AbstractService.SerializableDTO| Modifier and Type | Field and Description |
|---|---|
protected CMSAdminComponentService |
cmsAdminComponentService
Deprecated.
Implement the CMSAdminComponentService as own property
|
protected CMSContentSlotDao |
cmsContentSlotDao
Deprecated.
Implement the CMSContentSlotDao as own property
|
protected CMSDataFactory |
cmsDataFactory
Deprecated.
Implement the CMSDataFactory as own property
|
static String |
DEFAULT_CONTENTSLOT_FOR_PAGE_UID_PREFIX |
static String |
DEFAULT_CONTENTSLOT_UID_SUFFIX |
ACTIVECATALOGVERSION, ACTIVESITEmodelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultCMSAdminContentSlotService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCMSComponentToContentSlot(AbstractCMSComponentModel component,
ContentSlotModel slot,
Integer index)
Add an existing component item into a specific index position of an existing content slot.
|
protected void |
addComponentToComponentListSaveAsSlot(AbstractCMSComponentModel component,
ContentSlotModel slot,
Integer index,
List<AbstractCMSComponentModel> currentComponentList) |
ContentSlotModel |
createContentSlot(AbstractPageModel page,
String id,
String name,
String position)
Creates the
ContentSlotModel object and ContentSlotForPageModel relation. |
ContentSlotModel |
createContentSlot(AbstractPageModel page,
String id,
String name,
String position,
boolean active)
Creates the
ContentSlotModel object and ContentSlotForPageModel relation. |
ContentSlotModel |
createContentSlot(AbstractPageModel page,
String id,
String name,
String position,
boolean active,
Date activeFrom,
Date activeUntil)
Creates the
ContentSlotModel object and ContentSlotForPageModel relation. |
void |
deleteContentSlot(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,
String position)
deletes a relation between a page and a content slot.
|
protected String |
generateContentSlotForPageUID()
Generate the content slot id using the page uid prefix and the key generator.
|
protected String |
generateContentSlotUid(AbstractPageModel page,
String position)
Generate the Content Slot Uid after the slot position and page Uid
|
Collection<CMSRelationModel> |
getAllRelationsForSlot(ContentSlotModel contentSlot)
Returns all page and template relations with references to this content slot
|
protected CMSAdminComponentService |
getCmsAdminComponentService() |
protected CMSContentSlotDao |
getCmsContentSlotDao() |
protected CMSDataFactory |
getCmsDataFactory() |
ContentSlotModel |
getContentSlot(String contentSlotId)
Deprecated.
use
getContentSlotForId(String) instead. |
ContentSlotModel |
getContentSlot(String contentSlotId,
Collection<CatalogVersionModel> catalogVersions)
Deprecated.
|
ContentSlotModel |
getContentSlotForId(String contentSlotId)
Gets the content slot for specific content slot id.
|
ContentSlotModel |
getContentSlotForIdAndCatalogVersions(String contentSlotId,
Collection<CatalogVersionModel> catalogVersions)
Gets the content slot for slot id and collection of catalog versions.
|
String |
getContentSlotForPageUidPrefix() |
Collection<ContentSlotModel> |
getContentSlotsForCatalogVersion(CatalogVersionModel catalogVersion)
Find all content slots that belong to a given catalog version.
|
Collection<ContentSlotData> |
getContentSlotsForPage(AbstractPageModel page)
returns a collection of all content slots for the given page.
|
String |
getContentSlotUidSuffix() |
KeyGenerator |
getKeyGenerator() |
Collection<CMSRelationModel> |
getOnlyContentSlotRelationsForSlot(ContentSlotModel contentSlot)
Returns only page relations with references to this content slot.
|
Collection<ContentSlotForPageModel> |
getPageRelationsForSlot(ContentSlotModel contentSlot)
Deprecated.
|
Collection<ContentSlotForTemplateModel> |
getTemplateRelationsForSlot(ContentSlotModel contentSlot)
Deprecated.
|
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 |
setCmsAdminComponentService(CMSAdminComponentService cmsAdminComponentService) |
void |
setCmsContentSlotDao(CMSContentSlotDao cmsContentSlotDao) |
void |
setCmsDataFactory(CMSDataFactory cmsDataFactory) |
void |
setContentSlotForPageUidPrefix(String contentSlotForPageUidPrefix) |
void |
setContentSlotUidSuffix(String contentSlotUidSuffix) |
void |
setKeyGenerator(KeyGenerator keyGenerator) |
void |
updatePositionCMSComponentInContentSlot(AbstractCMSComponentModel component,
ContentSlotModel slot,
Integer index)
Update the position of an existing component item into a specific index position of an existing content slot.
|
getActiveCatalogVersion, getActiveSite, getUserService, setUserServicegetModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, setTenantScope, writeReplacepublic static final String DEFAULT_CONTENTSLOT_FOR_PAGE_UID_PREFIX
public static final String DEFAULT_CONTENTSLOT_UID_SUFFIX
@Deprecated protected CMSAdminComponentService cmsAdminComponentService
@Deprecated protected CMSContentSlotDao cmsContentSlotDao
@Deprecated protected CMSDataFactory cmsDataFactory
public ContentSlotModel createContentSlot(AbstractPageModel page, String id, String name, 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, String id, String name, 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, String id, String name, String position, boolean active, Date activeFrom, 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 String generateContentSlotUid(AbstractPageModel page, String position)
page - page model to get the uid fromposition - the position on the slotprotected String generateContentSlotForPageUID()
public void deleteContentSlot(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 CMSAdminContentSlotServicepublic void deleteRelationByPosition(AbstractPageModel page, String position)
deleteRelationByPosition in interface CMSAdminContentSlotServicepublic Collection<CMSRelationModel> getAllRelationsForSlot(ContentSlotModel contentSlot)
getAllRelationsForSlot in interface CMSAdminContentSlotServicecontentSlot - the content slotpublic Collection<CMSRelationModel> getOnlyContentSlotRelationsForSlot(ContentSlotModel contentSlot)
CMSAdminContentSlotService.getAllRelationsForSlot(ContentSlotModel) it does not return template relationsgetOnlyContentSlotRelationsForSlot in interface CMSAdminContentSlotServicecontentSlot - the content slotCMSAdminContentSlotService.getAllRelationsForSlot(ContentSlotModel)@Deprecated public ContentSlotModel getContentSlot(String contentSlotId) throws CMSItemNotFoundException
getContentSlotForId(String) instead.getContentSlot in interface CMSAdminContentSlotServicecontentSlotId - the content slot idCMSItemNotFoundException - the CMS item not found exception@Deprecated public ContentSlotModel getContentSlot(String contentSlotId, Collection<CatalogVersionModel> catalogVersions) throws CMSItemNotFoundException
getContentSlotForIdAndCatalogVersions(String, Collection) instead.getContentSlot in interface CMSAdminContentSlotServicecontentSlotId - the content slot idcatalogVersions - the catalog versionsCMSItemNotFoundException - the CMS item not found exceptionpublic ContentSlotModel getContentSlotForId(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(String contentSlotId, 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 Collection<ContentSlotData> getContentSlotsForPage(AbstractPageModel page)
getContentSlotsForPage in interface CMSAdminContentSlotServicepublic void updatePositionCMSComponentInContentSlot(AbstractCMSComponentModel component, ContentSlotModel slot, 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, 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, Integer index, List<AbstractCMSComponentModel> currentComponentList)
public boolean hasOtherRelations(AbstractPageModel page, ContentSlotModel contentSlot)
hasOtherRelations in interface CMSAdminContentSlotServicetrue if there are other relations between the content slot and other pages; false
otherwisepublic boolean hasRelations(ContentSlotModel contentSlot)
hasRelations in interface CMSAdminContentSlotServicetrue if there are relations to at least one other page; false otherwisepublic Collection<ContentSlotModel> getContentSlotsForCatalogVersion(CatalogVersionModel catalogVersion)
CMSAdminContentSlotServicegetContentSlotsForCatalogVersion in interface CMSAdminContentSlotServicecatalogVersion - - the catalog versionnull@Deprecated public Collection<ContentSlotForPageModel> getPageRelationsForSlot(ContentSlotModel contentSlot)
CMSAdminContentSlotServicegetPageRelationsForSlot in interface CMSAdminContentSlotServicecontentSlot - the content slotContentSlotForPageModel objects or empty list when not found@Deprecated public Collection<ContentSlotForTemplateModel> getTemplateRelationsForSlot(ContentSlotModel contentSlot)
CMSAdminContentSlotServicegetTemplateRelationsForSlot in interface CMSAdminContentSlotServicecontentSlot - the content slotContentSlotForTemplateModel objects or empty list when not foundpublic 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)
public String getContentSlotForPageUidPrefix()
public void setContentSlotForPageUidPrefix(String contentSlotForPageUidPrefix)
public String getContentSlotUidSuffix()
public void setContentSlotUidSuffix(String contentSlotUidSuffix)
Copyright © 2017 SAP SE. All Rights Reserved.