Interface CMSAdminPageService
- All Known Implementing Classes:
DefaultCMSAdminPageService
public interface CMSAdminPageService
The Interface CMSAdminPageService responsible for managing pages.
- Spring Bean ID:
- cmsAdminPageService
-
Method Summary
Modifier and TypeMethodDescriptioncreateCategoryPage(String id, String name, String masterTemplateId, boolean isDefault) Creates the category page.createContentPage(String id, String name, String masterTemplateId, String label) Creates the content page.createPage(String composedType, String id, String name, String masterTemplateId) Creates the page.createProductPage(String id, String name, String masterTemplateId, boolean isDefault) Creates the product page.voiddeletePage(String id) Delete a page from the active catalog versionfindPagesByType(ComposedTypeModel composedType, boolean isDefault) Gets the all default or non-default active pages by page type from the active catalog version.findPagesByTypeAndPageStatuses(ComposedTypeModel composedType, boolean isDefault, List<CmsPageStatus> pageStatuses) Gets the all default or non-default pages by page type from the active catalog version.Gets the active catalog version.returns all page templates which are set to active (only of the active catalogVersion)getAllContentPages(Collection<CatalogVersionModel> catalogVersions) Gets the all active content pages.getAllContentPagesForPageStatuses(Collection<CatalogVersionModel> catalogVersions, List<CmsPageStatus> pageStatuses) Gets the all content pages for a given list of page status.Returns all pages which are assigned to the active catalog versiongetAllPages(CatalogVersionModel catalogVersion) Gets the all active pages.getAllPagesByType(String type) Returns all pages which are assigned to the active catalog version and are of the given typegetAllPagesByType(String type, CatalogVersionModel catalogVersion) Gets the all pages by type.getAllPagesForCatalogVersionAndPageStatuses(CatalogVersionModel catalogVersion, List<CmsPageStatus> pageStatuses) Returns all pages which are assigned to the given catalog version and given page statusesreturns all pages of the active catalogVersion.getAllPageTemplates(boolean active) returns all page templates (only of the active catalogVersion)getAllPageTemplates(Collection<CatalogVersionModel> catalogVersions) Gets the all page templates.Returns a collection of all available page types.getAllRestrictedPageTemplates(boolean active, CMSPageTypeModel type) returns all restricted page templates (only of the active catalogVersion)getContentPages(Collection<CatalogVersionModel> catalogVersions, String label) Gets the content pages.getHomepage(CatalogVersionModel catalogVersion) Gets the homepage for a given catalog versiongetHomepage(CMSSiteModel siteModel) Gets the homepage for a given CMS Site.getHomepage(List<CatalogVersionModel> catalogVersions) Gets the homepage for the given catalog versions.getIdenticalPrimaryPageModel(AbstractPageModel pageModel) Returns identical primary page for provided pageModel.getPageForId(String id, Collection<CatalogVersionModel> catalogVersions) Returns the active page with the given id and the catalog versions.Returns the active page with the given id from the active catalogVersion.getPageForIdFromActiveCatalogVersionByPageStatuses(String id, List<CmsPageStatus> pageStatuses) Returns the page with the given id and page status list from the active catalogVersion.Gets the page template with the give id.getPageTypeByCode(String typeCode) Returns the page type with the given type code.booleanpageExists(String id) Checks if a page exists in the active catalog versionvoidtrashPage(String pageUid, CatalogVersionModel catalogVersion) Soft deletes a page by updating the pageStatus to DELETED.voidupdatePage(AbstractPageModel page, String name, String masterTemplateId) Updates the given page.
-
Method Details
-
createCategoryPage
CategoryPageModel createCategoryPage(String id, String name, 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(String id, String name, String masterTemplateId, 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(String composedType, String id, String name, 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(String id, String name, 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
Delete 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
Collection<PageTemplateModel> getAllActivePageTemplates()returns all page templates which are set to active (only of the active catalogVersion)- Returns:
- all page templates
-
getAllContentPages
Gets the all active content pages.- Parameters:
catalogVersions- the catalog versions- Returns:
- the all content pages
-
getAllContentPagesForPageStatuses
Collection<ContentPageModel> getAllContentPagesForPageStatuses(Collection<CatalogVersionModel> catalogVersions, 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
Collection<CMSPageTypeModel> getAllPageTypes()Returns a collection of all available page types.- Returns:
- all page types
-
getPageTypeByCode
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
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
Gets the all active pages.- Parameters:
catalogVersion- the catalog version- Returns:
- the all pages
-
getAllPagesForCatalogVersionAndPageStatuses
Collection<AbstractPageModel> getAllPagesForCatalogVersionAndPageStatuses(CatalogVersionModel catalogVersion, 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
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
Gets the all pages by type.- Parameters:
type- the typecatalogVersion- the catalog version- Returns:
- the all pages by type
-
getAllPagesMap
Map<String,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
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
Gets the all page templates.- Parameters:
catalogVersions- the catalog versions- Returns:
- the all page templates
-
getAllRestrictedPageTemplates
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
Collection<ContentPageModel> getContentPages(Collection<CatalogVersionModel> catalogVersions, String label) Gets the content pages.- Parameters:
catalogVersions- the catalog versionslabel- the label- Returns:
- the content pages
-
getPageForIdFromActiveCatalogVersion
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
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(String id, 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(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
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, String name, 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
Gets the homepage for a given CMS Site.- Parameters:
siteModel- the site model- Returns:
- the homepage model
-
getHomepage
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
Gets the homepage for a given catalog version- Parameters:
catalogVersion- the catalog version containing the homepage- Returns:
- the homepage model
-
findPagesByType
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
Collection<AbstractPageModel> findPagesByTypeAndPageStatuses(ComposedTypeModel composedType, boolean isDefault, 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
Returns identical primary page for provided pageModel.- Parameters:
pageModel- page mode- Returns:
- identical primary page
-
trashPage
Soft 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.
-