Interface CMSAdminPageService
-
- All Known Implementing Classes:
DefaultCMSAdminPageService
public interface CMSAdminPageServiceThe Interface CMSAdminPageService responsible for managing pages.- Spring Bean ID:
- cmsAdminPageService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CategoryPageModelcreateCategoryPage(java.lang.String id, java.lang.String name, java.lang.String masterTemplateId, boolean isDefault)Creates the category page.ContentPageModelcreateContentPage(java.lang.String id, java.lang.String name, java.lang.String masterTemplateId, java.lang.String label)Creates the content page.AbstractPageModelcreatePage(java.lang.String composedType, java.lang.String id, java.lang.String name, java.lang.String masterTemplateId)Creates the page.ProductPageModelcreateProductPage(java.lang.String id, java.lang.String name, java.lang.String masterTemplateId, boolean isDefault)Creates the product page.voiddeletePage(java.lang.String id)Delete a page from the active catalog versionjava.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.CatalogVersionModelgetActiveCatalogVersion()Gets 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 versionjava.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 typejava.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 statusesjava.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)java.util.Collection<ContentPageModel>getContentPages(java.util.Collection<CatalogVersionModel> catalogVersions, java.lang.String label)Gets the content pages.ContentPageModelgetHomepage(CatalogVersionModel catalogVersion)Gets the homepage for a given catalog versionContentPageModelgetHomepage(CMSSiteModel siteModel)Gets the homepage for a given CMS Site.ContentPageModelgetHomepage(java.util.List<CatalogVersionModel> catalogVersions)Gets the homepage for the given catalog versions.AbstractPageModelgetIdenticalPrimaryPageModel(AbstractPageModel pageModel)Returns identical primary page for provided pageModel.AbstractPageModelgetPageForId(java.lang.String id, java.util.Collection<CatalogVersionModel> catalogVersions)Returns the active page with the given id and the catalog versions.AbstractPageModelgetPageForIdFromActiveCatalogVersion(java.lang.String id)Returns the active page with the given id from the active catalogVersion.AbstractPageModelgetPageForIdFromActiveCatalogVersionByPageStatuses(java.lang.String id, java.util.List<CmsPageStatus> pageStatuses)Returns the page with the given id and page status list from the active catalogVersion.PageTemplateModelgetPageTemplateForIdFromActiveCatalogVersion(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.booleanpageExists(java.lang.String id)Checks if a page exists in the active catalog versionvoidtrashPage(java.lang.String pageUid, CatalogVersionModel catalogVersion)Soft deletes a page by updating the pageStatus to DELETED.voidupdatePage(AbstractPageModel page, java.lang.String name, java.lang.String masterTemplateId)Updates the given page.
-
-
-
Method Detail
-
createCategoryPage
CategoryPageModel createCategoryPage(java.lang.String id, java.lang.String name, java.lang.String masterTemplateId, boolean isDefault) throws CMSItemCreateException
Creates the category page.- Parameters:
id- the idname- the namemasterTemplateId- the master template idisDefault- the is default- Returns:
- the category page model
- Throws:
CMSItemCreateException- the cMS item create exception
-
createContentPage
ContentPageModel createContentPage(java.lang.String id, java.lang.String name, java.lang.String masterTemplateId, java.lang.String label) throws CMSItemCreateException
Creates the content page.- Parameters:
id- the idname- the namemasterTemplateId- the master template idlabel- the label- Returns:
- the content page model
- Throws:
CMSItemCreateException- the cMS item create exception
-
createPage
AbstractPageModel createPage(java.lang.String composedType, java.lang.String id, java.lang.String name, java.lang.String masterTemplateId) throws CMSItemCreateException
Creates the page.- Parameters:
composedType- the composed typeid- the idname- the namemasterTemplateId- the master template id- Returns:
- the abstract page model
- Throws:
CMSItemCreateException- the cMS item create exception
-
createProductPage
ProductPageModel createProductPage(java.lang.String id, java.lang.String name, java.lang.String masterTemplateId, boolean isDefault) throws CMSItemCreateException
Creates the product page.- Parameters:
id- the idname- the namemasterTemplateId- the master template idisDefault- the is default- Returns:
- the product page model
- Throws:
CMSItemCreateException- the cMS item create exception
-
deletePage
void deletePage(java.lang.String id) throws CMSItemNotFoundExceptionDelete a page from the active catalog version- Parameters:
id- page id- Throws:
CMSItemNotFoundException- if no page with the give id is found
-
getActiveCatalogVersion
CatalogVersionModel getActiveCatalogVersion()
Gets the active catalog version.- Returns:
- the active catalog version
-
getAllActivePageTemplates
java.util.Collection<PageTemplateModel> getAllActivePageTemplates()
returns all page templates which are set to active (only of the active catalogVersion)- Returns:
- all page templates
-
getAllContentPages
java.util.Collection<ContentPageModel> getAllContentPages(java.util.Collection<CatalogVersionModel> catalogVersions)
Gets the all active content pages.- Parameters:
catalogVersions- the catalog versions- Returns:
- the all content pages
-
getAllContentPagesForPageStatuses
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.- Parameters:
catalogVersions- the catalog versionspageStatuses- a list of page status- Returns:
- the all content pages
-
getAllPageTypes
java.util.Collection<CMSPageTypeModel> getAllPageTypes()
Returns a collection of all available page types.- Returns:
- all page types
-
getPageTypeByCode
java.util.Optional<CMSPageTypeModel> getPageTypeByCode(java.lang.String typeCode)
Returns the page type with the given type code.- Parameters:
typeCode- the type code of the page type to retrieve- Returns:
- the page type matching the given type code
-
getAllPages
java.util.Collection<AbstractPageModel> getAllPages()
Returns all pages which are assigned to the active catalog version- Returns:
- all pages which are assigned to the active catalog version
-
getAllPages
java.util.Collection<AbstractPageModel> getAllPages(CatalogVersionModel catalogVersion)
Gets the all active pages.- Parameters:
catalogVersion- the catalog version- Returns:
- the all pages
-
getAllPagesForCatalogVersionAndPageStatuses
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- Parameters:
catalogVersion- the catalog version modelpageStatuses- a list of page statuses- Returns:
- all pages which are assigned to the given catalog version with the given page status
-
getAllPagesByType
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- Parameters:
type- should be a sub-type of AbstractPage- Returns:
- all pages which are assigned to the active catalog version and are of the given type
-
getAllPagesByType
java.util.Collection<AbstractPageModel> getAllPagesByType(java.lang.String type, CatalogVersionModel catalogVersion)
Gets the all pages by type.- Parameters:
type- the typecatalogVersion- the catalog version- Returns:
- the all pages by type
-
getAllPagesMap
java.util.Map<java.lang.String,java.util.Collection<AbstractPageModel>> getAllPagesMap()
returns all pages of the active catalogVersion. The pages are grouped by its type- Returns:
- returns all pages of the active catalogVersion. The pages are grouped by its type
-
getAllPageTemplates
java.util.Collection<PageTemplateModel> getAllPageTemplates(boolean active)
returns all page templates (only of the active catalogVersion)- Parameters:
active- if set to true only page templates are returned which are set as active- Returns:
- all page templates
-
getAllPageTemplates
java.util.Collection<PageTemplateModel> getAllPageTemplates(java.util.Collection<CatalogVersionModel> catalogVersions)
Gets the all page templates.- Parameters:
catalogVersions- the catalog versions- Returns:
- the all page templates
-
getAllRestrictedPageTemplates
java.util.Collection<PageTemplateModel> getAllRestrictedPageTemplates(boolean active, CMSPageTypeModel type)
returns all restricted page templates (only of the active catalogVersion)- Parameters:
active- if set to true only page templates are returned which are set as activetype- the page type to which the page template will be restricted- Returns:
- all restricted page templates
-
getContentPages
java.util.Collection<ContentPageModel> getContentPages(java.util.Collection<CatalogVersionModel> catalogVersions, java.lang.String label)
Gets the content pages.- Parameters:
catalogVersions- the catalog versionslabel- the label- Returns:
- the content pages
-
getPageForIdFromActiveCatalogVersion
AbstractPageModel getPageForIdFromActiveCatalogVersion(java.lang.String id) throws UnknownIdentifierException
Returns the active page with the given id from the active catalogVersion.- Parameters:
id- the id of the page- Returns:
- the page for id
- Throws:
UnknownIdentifierException- when no page is found
-
getPageForId
AbstractPageModel getPageForId(java.lang.String id, java.util.Collection<CatalogVersionModel> catalogVersions)
Returns the active page with the given id and the catalog versions.- Parameters:
id- the id of the pagecatalogVersions- the catalog versions- Returns:
- the page for id
- Throws:
UnknownIdentifierException- when no page is found
-
getPageForIdFromActiveCatalogVersionByPageStatuses
AbstractPageModel getPageForIdFromActiveCatalogVersionByPageStatuses(java.lang.String id, java.util.List<CmsPageStatus> pageStatuses) throws UnknownIdentifierException
Returns the page with the given id and page status list from the active catalogVersion.- Parameters:
id- the id of the pagepageStatuses- a list of page statuses- Returns:
- the page for id
- Throws:
UnknownIdentifierException- when no page is found
-
getPageTemplateForIdFromActiveCatalogVersion
PageTemplateModel getPageTemplateForIdFromActiveCatalogVersion(java.lang.String id) throws AmbiguousIdentifierException, UnknownIdentifierException
Gets the page template with the give id. Searches only of the active catalogVersion.- Parameters:
id- the id- Returns:
- found page template
- Throws:
AmbiguousIdentifierException- thrown when more than one object has been found.UnknownIdentifierException- thrown when no object has been found
-
pageExists
boolean pageExists(java.lang.String id)
Checks if a page exists in the active catalog version- Parameters:
id- page id- Returns:
trueif the page exists in the active catalog version;falseotherwise
-
updatePage
void updatePage(AbstractPageModel page, java.lang.String name, java.lang.String masterTemplateId) throws CMSItemNotFoundException
Updates the given page. Method explicitly saves object.- Parameters:
page- the page modelname- the new page name to be applied to the given page modelmasterTemplateId- the new page template to be applied to the given page model- Throws:
CMSItemNotFoundException- when an item model is not found
-
getHomepage
ContentPageModel getHomepage(CMSSiteModel siteModel)
Gets the homepage for a given CMS Site.- Parameters:
siteModel- the site model- Returns:
- the homepage model
-
getHomepage
ContentPageModel getHomepage(java.util.List<CatalogVersionModel> catalogVersions)
Gets the homepage for the given catalog versions.- Parameters:
catalogVersions- the catalog versions- Returns:
- the homepage model from one of the catalog versions provided; can be NULL if no homepage is found or the given list of catalog version is empty.
-
getHomepage
ContentPageModel getHomepage(CatalogVersionModel catalogVersion)
Gets the homepage for a given catalog version- Parameters:
catalogVersion- the catalog version containing the homepage- Returns:
- the homepage model
-
findPagesByType
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.- Parameters:
composedType- the page type modelisDefault- true to find default pages; false otherwise- Returns:
- the all default or non-default pages for a given page type
-
findPagesByTypeAndPageStatuses
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.- Parameters:
composedType- the page type modelisDefault- true to find default pages; false otherwisepageStatuses- a list of page statuses- Returns:
- the all default or non-default pages for a given page type
-
getIdenticalPrimaryPageModel
AbstractPageModel getIdenticalPrimaryPageModel(AbstractPageModel pageModel)
Returns identical primary page for provided pageModel.- Parameters:
pageModel- page mode- Returns:
- identical primary page
-
trashPage
void trashPage(java.lang.String pageUid, CatalogVersionModel catalogVersion) throws CMSItemNotFoundExceptionSoft deletes a page by updating the pageStatus to DELETED. Does nothing if the page is already deleted.- Parameters:
pageUid- The page to be trashed.catalogVersion- The catalog version of the page.- Throws:
CMSItemNotFoundException- when the page is not found.
-
-