Interface CMSAdminPageService

All Known Implementing Classes:
DefaultCMSAdminPageService

public interface CMSAdminPageService
The Interface CMSAdminPageService responsible for managing pages.
Spring Bean ID:
cmsAdminPageService
  • Method Details

    • createCategoryPage

      CategoryPageModel createCategoryPage(String id, String name, String masterTemplateId, boolean isDefault) throws CMSItemCreateException
      Creates the category page.
      Parameters:
      id - the id
      name - the name
      masterTemplateId - the master template id
      isDefault - 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 id
      name - the name
      masterTemplateId - the master template id
      label - 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 type
      id - the id
      name - the name
      masterTemplateId - 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 id
      name - the name
      masterTemplateId - the master template id
      isDefault - the is default
      Returns:
      the product page model
      Throws:
      CMSItemCreateException - the cMS item create exception
    • deletePage

      void deletePage(String id) throws CMSItemNotFoundException
      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

      Collection<ContentPageModel> getAllContentPages(Collection<CatalogVersionModel> catalogVersions)
      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 versions
      pageStatuses - 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

      Optional<CMSPageTypeModel> getPageTypeByCode(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

      Returns all pages which are assigned to the active catalog version
      Returns:
      all pages which are assigned to the active catalog version
    • getAllPages

      Collection<AbstractPageModel> getAllPages(CatalogVersionModel catalogVersion)
      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 model
      pageStatuses - a list of page statuses
      Returns:
      all pages which are assigned to the given catalog version with the given page status
    • getAllPagesByType

      Collection<AbstractPageModel> getAllPagesByType(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

      Collection<AbstractPageModel> getAllPagesByType(String type, CatalogVersionModel catalogVersion)
      Gets the all pages by type.
      Parameters:
      type - the type
      catalogVersion - the catalog version
      Returns:
      the all pages by type
    • 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

      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

      Collection<PageTemplateModel> getAllPageTemplates(Collection<CatalogVersionModel> catalogVersions)
      Gets the all page templates.
      Parameters:
      catalogVersions - the catalog versions
      Returns:
      the all page templates
    • getAllRestrictedPageTemplates

      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 active
      type - 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 versions
      label - the label
      Returns:
      the content pages
    • getPageForIdFromActiveCatalogVersion

      AbstractPageModel getPageForIdFromActiveCatalogVersion(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(String id, Collection<CatalogVersionModel> catalogVersions)
      Returns the active page with the given id and the catalog versions.
      Parameters:
      id - the id of the page
      catalogVersions - 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 page
      pageStatuses - 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

      boolean pageExists(String id)
      Checks if a page exists in the active catalog version
      Parameters:
      id - page id
      Returns:
      true if the page exists in the active catalog version; false otherwise
    • updatePage

      void updatePage(AbstractPageModel page, String name, String masterTemplateId) throws CMSItemNotFoundException
      Updates the given page. Method explicitly saves object.
      Parameters:
      page - the page model
      name - the new page name to be applied to the given page model
      masterTemplateId - 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(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

      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 model
      isDefault - 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 model
      isDefault - true to find default pages; false otherwise
      pageStatuses - 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(String pageUid, CatalogVersionModel catalogVersion) throws CMSItemNotFoundException
      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.