Interface CMSAdminPageService

  • All Known Implementing Classes:
    DefaultCMSAdminPageService

    public interface CMSAdminPageService
    The Interface CMSAdminPageService responsible for managing pages.
    Spring Bean ID:
    cmsAdminPageService
    • 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 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​(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 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​(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 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​(java.lang.String id,
                                           java.lang.String name,
                                           java.lang.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
      • 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 versions
        pageStatuses - 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 model
        pageStatuses - 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 type
        catalogVersion - 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 active
        type - 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 versions
        label - 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 page
        catalogVersions - 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 page
        pageStatuses - a list of page statuses
        Returns:
        the page for id
        Throws:
        UnknownIdentifierException - when no page is found
      • pageExists

        boolean pageExists​(java.lang.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,
                        java.lang.String name,
                        java.lang.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​(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 model
        isDefault - 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 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​(java.lang.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.