public class DefaultCMSAdminPageService extends AbstractCMSAdminService implements CMSAdminPageService
AbstractService.SerializableDTOACTIVECATALOGVERSION, ACTIVESITE, CLONE_CONTEXTmodelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultCMSAdminPageService() |
| Modifier and Type | Method and Description |
|---|---|
CategoryPageModel |
createCategoryPage(java.lang.String id,
java.lang.String name,
java.lang.String masterTemplateId,
boolean isDefault)
Creates the category page.
|
ContentPageModel |
createContentPage(java.lang.String id,
java.lang.String name,
java.lang.String masterTemplateId,
java.lang.String label)
Creates the content page.
|
AbstractPageModel |
createPage(java.lang.String composedType,
java.lang.String id,
java.lang.String name,
java.lang.String masterTemplateId)
Creates the page.
|
protected AbstractPageModel |
createPageFromType(java.lang.String composedTypeCode) |
ProductPageModel |
createProductPage(java.lang.String id,
java.lang.String name,
java.lang.String masterTemplateId,
boolean isDefault)
Creates the product page.
|
void |
deletePage(java.lang.String id)
Delete a page from the active catalog version
|
java.util.Collection<AbstractPageModel> |
findPagesByType(ComposedTypeModel composedType,
boolean isDefault)
Gets the all default or non-default active pages by page type from the active catalog version.
|
java.util.Collection<AbstractPageModel> |
findPagesByTypeAndPageStatuses(ComposedTypeModel composedType,
boolean isDefault,
java.util.List<CmsPageStatus> pageStatuses)
Gets the all default or non-default pages by page type from the active catalog version.
|
java.util.Collection<PageTemplateModel> |
getAllActivePageTemplates()
returns all page templates which are set to active (only of the active catalogVersion)
|
java.util.Collection<ContentPageModel> |
getAllContentPages(java.util.Collection<CatalogVersionModel> catalogVersions)
Gets the all active content pages.
|
java.util.Collection<ContentPageModel> |
getAllContentPagesForPageStatuses(java.util.Collection<CatalogVersionModel> catalogVersions,
java.util.List<CmsPageStatus> pageStatuses)
Gets the all content pages for a given list of page status.
|
java.util.Collection<AbstractPageModel> |
getAllPages()
Returns all pages which are assigned to the active catalog version
|
java.util.Collection<AbstractPageModel> |
getAllPages(CatalogVersionModel catalogVersion)
Gets the all active pages.
|
java.util.Collection<AbstractPageModel> |
getAllPagesByType(java.lang.String type)
Returns all pages which are assigned to the active catalog version and are of the given type
|
java.util.Collection<AbstractPageModel> |
getAllPagesByType(java.lang.String type,
CatalogVersionModel catalogVersion)
Gets the all pages by type.
|
java.util.Collection<AbstractPageModel> |
getAllPagesForCatalogVersionAndPageStatuses(CatalogVersionModel catalogVersion,
java.util.List<CmsPageStatus> pageStatuses)
Returns all pages which are assigned to the given catalog version and given page statuses
|
java.util.Map<java.lang.String,java.util.Collection<AbstractPageModel>> |
getAllPagesMap()
returns all pages of the active catalogVersion.
|
java.util.Collection<PageTemplateModel> |
getAllPageTemplates(boolean active)
returns all page templates (only of the active catalogVersion)
|
java.util.Collection<PageTemplateModel> |
getAllPageTemplates(java.util.Collection<CatalogVersionModel> catalogVersions)
Gets the all page templates.
|
java.util.Collection<CMSPageTypeModel> |
getAllPageTypes()
Returns a collection of all available page types.
|
java.util.Collection<PageTemplateModel> |
getAllRestrictedPageTemplates(boolean active,
CMSPageTypeModel type)
returns all restricted page templates (only of the active catalogVersion)
|
protected CatalogVersionService |
getCatalogVersionService() |
protected CMSPageDao |
getCmsPageDao() |
protected CMSPageTemplateDao |
getCmsPageTemplateDao() |
java.util.Collection<ContentPageModel> |
getContentPages(java.util.Collection<CatalogVersionModel> catalogVersions,
java.lang.String label)
Gets the content pages.
|
ContentPageModel |
getHomepage(CatalogVersionModel catalogVersion)
Gets the homepage for a given catalog version
|
ContentPageModel |
getHomepage(CMSSiteModel siteModel)
Gets the homepage for a given CMS Site.
|
protected ContentPageModel |
getHomepage(java.util.List<CatalogVersionModel> catalogVersions) |
AbstractPageModel |
getIdenticalPrimaryPageModel(AbstractPageModel pageModel)
Returns identical primary page for provided pageModel.
|
AbstractPageModel |
getPageById(java.lang.String id)
Deprecated.
since 4.4. Please, use
getPageForIdFromActiveCatalogVersion(String) instead. |
AbstractPageModel |
getPageForIdFromActiveCatalogVersion(java.lang.String id)
Returns the active page with the given id from the active catalogVersion.
|
AbstractPageModel |
getPageForIdFromActiveCatalogVersionByPageStatuses(java.lang.String id,
java.util.List<CmsPageStatus> pageStatuses)
Returns the page with the given id and page status list from the active catalogVersion.
|
PageTemplateModel |
getPageTemplateById(java.lang.String id)
Deprecated.
since 4.4. Please, use
getPageTemplateForIdFromActiveCatalogVersion(String) instead. |
PageTemplateModel |
getPageTemplateForIdFromActiveCatalogVersion(java.lang.String id)
Gets the page template with the give id.
|
java.util.Optional<CMSPageTypeModel> |
getPageTypeByCode(java.lang.String typeCode)
Returns the page type with the given type code.
|
protected TypeService |
getTypeService() |
boolean |
pageExists(java.lang.String id)
Checks if a page exists in the active catalog version
|
void |
save(AbstractPageModel page)
Deprecated.
|
void |
setCatalogVersionService(CatalogVersionService catalogVersionService) |
void |
setCmsPageDao(CMSPageDao cmsPageDao) |
void |
setCmsPageTemplateDao(CMSPageTemplateDao cmsPageTemplateDao) |
void |
setTypeService(TypeService typeService) |
void |
updatePage(AbstractPageModel page,
java.lang.String name,
java.lang.String masterTemplateId)
Updates the given page.
|
getActiveCatalogVersion, getActiveSite, getBaseSiteService, getUserService, setBaseSiteService, setUserServicegetModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, setTenantScope, writeReplaceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetActiveCatalogVersionpublic CategoryPageModel createCategoryPage(java.lang.String id, java.lang.String name, java.lang.String masterTemplateId, boolean isDefault) throws CMSItemCreateException
createCategoryPage in interface CMSAdminPageServiceid - the idname - the namemasterTemplateId - the master template idisDefault - the is defaultCMSItemCreateException - the cMS item create exceptionpublic ContentPageModel createContentPage(java.lang.String id, java.lang.String name, java.lang.String masterTemplateId, java.lang.String label) throws CMSItemCreateException
createContentPage in interface CMSAdminPageServiceid - the idname - the namemasterTemplateId - the master template idlabel - the labelCMSItemCreateException - the cMS item create exceptionpublic AbstractPageModel createPage(java.lang.String composedType, java.lang.String id, java.lang.String name, java.lang.String masterTemplateId) throws CMSItemCreateException
createPage in interface CMSAdminPageServicecomposedType - the composed typeid - the idname - the namemasterTemplateId - the master template idCMSItemCreateException - the cMS item create exceptionpublic ProductPageModel createProductPage(java.lang.String id, java.lang.String name, java.lang.String masterTemplateId, boolean isDefault) throws CMSItemCreateException
createProductPage in interface CMSAdminPageServiceid - the idname - the namemasterTemplateId - the master template idisDefault - the is defaultCMSItemCreateException - the cMS item create exceptionpublic void deletePage(java.lang.String id)
throws CMSItemNotFoundException
deletePage in interface CMSAdminPageServiceCMSItemNotFoundException - if no page with the give id is foundpublic java.util.Collection<PageTemplateModel> getAllActivePageTemplates()
getAllActivePageTemplates in interface CMSAdminPageServicepublic java.util.Collection<ContentPageModel> getAllContentPages(java.util.Collection<CatalogVersionModel> catalogVersions)
getAllContentPages in interface CMSAdminPageServicecatalogVersions - the catalog versionspublic java.util.Collection<ContentPageModel> getAllContentPagesForPageStatuses(java.util.Collection<CatalogVersionModel> catalogVersions, java.util.List<CmsPageStatus> pageStatuses)
CMSAdminPageServicegetAllContentPagesForPageStatuses in interface CMSAdminPageServicecatalogVersions - the catalog versionspageStatuses - a list of page statuspublic java.util.Collection<CMSPageTypeModel> getAllPageTypes()
CMSAdminPageServicegetAllPageTypes in interface CMSAdminPageServicepublic java.util.Optional<CMSPageTypeModel> getPageTypeByCode(java.lang.String typeCode)
CMSAdminPageServicegetPageTypeByCode in interface CMSAdminPageServicetypeCode - the type code of the page type to retrievepublic java.util.Collection<AbstractPageModel> getAllPages()
getAllPages in interface CMSAdminPageServicepublic java.util.Collection<AbstractPageModel> getAllPages(CatalogVersionModel catalogVersion)
getAllPages in interface CMSAdminPageServicecatalogVersion - the catalog versionpublic java.util.Collection<AbstractPageModel> getAllPagesForCatalogVersionAndPageStatuses(CatalogVersionModel catalogVersion, java.util.List<CmsPageStatus> pageStatuses)
getAllPagesForCatalogVersionAndPageStatuses in interface CMSAdminPageServicecatalogVersion - the catalog version modelpageStatuses - a list of page statusespublic java.util.Collection<AbstractPageModel> getAllPagesByType(java.lang.String type)
getAllPagesByType in interface CMSAdminPageServicetype - should be a sub-type of AbstractPagepublic java.util.Collection<AbstractPageModel> getAllPagesByType(java.lang.String type, CatalogVersionModel catalogVersion)
getAllPagesByType in interface CMSAdminPageServicetype - the typecatalogVersion - the catalog versionpublic java.util.Map<java.lang.String,java.util.Collection<AbstractPageModel>> getAllPagesMap()
getAllPagesMap in interface CMSAdminPageServicepublic java.util.Collection<PageTemplateModel> getAllPageTemplates(boolean active)
getAllPageTemplates in interface CMSAdminPageServiceactive - if set to true only page templates are returned which are set as activepublic java.util.Collection<PageTemplateModel> getAllPageTemplates(java.util.Collection<CatalogVersionModel> catalogVersions)
getAllPageTemplates in interface CMSAdminPageServicecatalogVersions - the catalog versionspublic java.util.Collection<PageTemplateModel> getAllRestrictedPageTemplates(boolean active, CMSPageTypeModel type)
getAllRestrictedPageTemplates in interface CMSAdminPageServiceactive - if set to true only page templates are returned which are set as activetype - the page type to which the page template will be restrictedpublic java.util.Collection<ContentPageModel> getContentPages(java.util.Collection<CatalogVersionModel> catalogVersions, java.lang.String label)
getContentPages in interface CMSAdminPageServicecatalogVersions - the catalog versionslabel - the label@Deprecated public AbstractPageModel getPageById(java.lang.String id) throws CMSItemNotFoundException
getPageForIdFromActiveCatalogVersion(String) instead.getPageById in interface CMSAdminPageServiceid - the id of the pageCMSItemNotFoundException - if no page with the given id is foundpublic AbstractPageModel getPageForIdFromActiveCatalogVersion(java.lang.String id) throws AmbiguousIdentifierException, UnknownIdentifierException
getPageForIdFromActiveCatalogVersion in interface CMSAdminPageServiceid - the id of the pageAmbiguousIdentifierException - when more then one page is found with the same idUnknownIdentifierException - when no pages is foundpublic AbstractPageModel getPageForIdFromActiveCatalogVersionByPageStatuses(java.lang.String id, java.util.List<CmsPageStatus> pageStatuses) throws AmbiguousIdentifierException, UnknownIdentifierException
getPageForIdFromActiveCatalogVersionByPageStatuses in interface CMSAdminPageServiceid - the id of the pagepageStatuses - a list of page statusesAmbiguousIdentifierException - when more then one page is found with the same idUnknownIdentifierException - when no pages is found@Deprecated public PageTemplateModel getPageTemplateById(java.lang.String id) throws CMSItemNotFoundException
getPageTemplateForIdFromActiveCatalogVersion(String) instead.getPageTemplateById in interface CMSAdminPageServiceCMSItemNotFoundException - if no template with the given id is foundpublic PageTemplateModel getPageTemplateForIdFromActiveCatalogVersion(java.lang.String id) throws AmbiguousIdentifierException, UnknownIdentifierException
getPageTemplateForIdFromActiveCatalogVersion in interface CMSAdminPageServiceid - the idAmbiguousIdentifierException - thrown when more than one object has been found.UnknownIdentifierException - thrown when no object has been foundpublic boolean pageExists(java.lang.String id)
pageExists in interface CMSAdminPageServiceid - page idtrue if the page exists in the active catalog version; false otherwise@Deprecated public void save(AbstractPageModel page)
save in interface CMSAdminPageServicepage - the page model objectprotected CMSPageDao getCmsPageDao()
public void setCmsPageDao(CMSPageDao cmsPageDao)
protected CMSPageTemplateDao getCmsPageTemplateDao()
public void setCmsPageTemplateDao(CMSPageTemplateDao cmsPageTemplateDao)
protected TypeService getTypeService()
public void setTypeService(TypeService typeService)
protected CatalogVersionService getCatalogVersionService()
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
public void updatePage(AbstractPageModel page, java.lang.String name, java.lang.String masterTemplateId) throws CMSItemNotFoundException
updatePage in interface CMSAdminPageServiceCMSItemNotFoundExceptionprotected AbstractPageModel createPageFromType(java.lang.String composedTypeCode) throws CMSItemCreateException
CMSItemCreateExceptionpublic ContentPageModel getHomepage(CMSSiteModel siteModel)
CMSAdminPageServicegetHomepage in interface CMSAdminPageServicepublic ContentPageModel getHomepage(CatalogVersionModel catalogVersion)
CMSAdminPageServicegetHomepage in interface CMSAdminPageServicecatalogVersion - the catalog version containing the homepageprotected ContentPageModel getHomepage(java.util.List<CatalogVersionModel> catalogVersions)
public java.util.Collection<AbstractPageModel> findPagesByType(ComposedTypeModel composedType, boolean isDefault)
CMSAdminPageServicefindPagesByType in interface CMSAdminPageServicecomposedType - the page type modelisDefault - true to find default pages; false otherwisepublic java.util.Collection<AbstractPageModel> findPagesByTypeAndPageStatuses(ComposedTypeModel composedType, boolean isDefault, java.util.List<CmsPageStatus> pageStatuses)
CMSAdminPageServicefindPagesByTypeAndPageStatuses in interface CMSAdminPageServicecomposedType - the page type modelisDefault - true to find default pages; false otherwisepageStatuses - a list of page statusespublic AbstractPageModel getIdenticalPrimaryPageModel(AbstractPageModel pageModel)
CMSAdminPageServicegetIdenticalPrimaryPageModel in interface CMSAdminPageServicepageModel - page modeCopyright © 2018 SAP SE. All Rights Reserved.