Interface CMSContentPageService

All Known Implementing Classes:
DefaultCMSContentPageService

public interface CMSContentPageService
Provides methods for managing content pages.
Spring Bean ID:
cmsContentPageService
  • Method Details

    • getDefaultPageForLabel

      ContentPageModel getDefaultPageForLabel(String label, CatalogVersionModel version) throws CMSItemNotFoundException
      Gets the default page by label and catalog version.
      Parameters:
      label - the label
      version - the version
      Returns:
      the default page by label
      Throws:
      CMSItemNotFoundException - thrown when item was not found
    • getHomepage

      ContentPageModel getHomepage()
      Gets the homepage
      Returns:
      the homepage model
    • getHomepage

      ContentPageModel getHomepage(PagePreviewCriteriaData pagePreviewCriteria)
      Returns homepage for PagePreviewCriteriaData.
      Parameters:
      pagePreviewCriteria - the PagePreviewCriteriaData object.
      Returns:
      the homepage model
    • getPageForLabelAndPreview

      ContentPageModel getPageForLabelAndPreview(String label, PagePreviewCriteriaData pagePreviewCriteria) throws CMSItemNotFoundException
      Gets the page for label and PagePreviewCriteriaData.
      Parameters:
      label - the label
      pagePreviewCriteria - the PagePreviewCriteriaData object.
      Returns:
      the page for label
      Throws:
      CMSItemNotFoundException - thrown when item is not found
    • getPageForLabelAndStatuses

      ContentPageModel getPageForLabelAndStatuses(String label, List<CmsPageStatus> pageStatuses) throws CMSItemNotFoundException
      Gets the page for label by page status.
      Parameters:
      label - the label
      pageStatuses - the page statuses. i.e. (deleted, active)
      Returns:
      the page for label
      Throws:
      CMSItemNotFoundException - thrown when item was not found
    • getPageForLabelOrIdAndMatchType

      ContentPageModel getPageForLabelOrIdAndMatchType(String labelOrId, boolean exactLabelMatch) throws CMSItemNotFoundException
      Gets the page for label or id. When exactLabelMatch is TRUE, the page is found by matching exactly the provided labelOrId. Otherwise, the page containing a label that closely matches the provided labelOrId is returned instead.
      Parameters:
      labelOrId - the label or id
      exactLabelMatch - determines if the label of the result page should exactly match the provided labelOrId or not.
      Returns:
      the page for label or id
      Throws:
      CMSItemNotFoundException - thrown when page was not found
    • getPageForLabelOrIdAndMatchType

      ContentPageModel getPageForLabelOrIdAndMatchType(String labelOrId, PagePreviewCriteriaData pagePreviewCriteria, boolean exactLabelMatch) throws CMSItemNotFoundException
      Gets the page matching the provided for label or id filtered by the PagePreviewCriteriaData information. When exactLabelMatch is TRUE, the page is found by matching exactly the provided labelOrId. Otherwise, the page containing a label that closely matches the provided labelOrId is returned instead.
      Parameters:
      labelOrId - the label or id
      pagePreviewCriteria - the PagePreviewCriteriaData object.
      exactLabelMatch - determines if the label of the result page should exactly match the provided labelOrId or not.
      Returns:
      the page matching the search criteria
      Throws:
      CMSItemNotFoundException - thrown when no page is found
    • findLabelVariations

      List<String> findLabelVariations(String label, boolean exactLabelMatch)
      Find possible variations of the provided label by splitting the sections using the slash as delimiter. The result list is sorted by the length of the label, starting with the longest label variation first. The result list also includes the provided label.
      Parameters:
      label - the label from which the variations are generated
      exactLabelMatch - determines if the label of the result page should exactly match the provided label or not.
      Returns:
      list of label variations, including the provided label
    • findPagesForBestLabelMatch

      List<AbstractPageModel> findPagesForBestLabelMatch(Collection<AbstractPageModel> pages, List<String> labels)
      Finds all pages that matches one of the provided labels. Best page match is chosen by sorting the pages by their label (longest label first). When multiple pages have the same label size, then the first created page is chosen.
      Parameters:
      pages - the list of pages to filter to find best matches
      labels - the list of labels used for filtering for best page matches
      Returns:
      pages exactly or best match the provided labels