Interface CMSContentPageService
- All Known Implementing Classes:
DefaultCMSContentPageService
public interface CMSContentPageService
Provides methods for managing content pages.
- Spring Bean ID:
- cmsContentPageService
-
Method Summary
Modifier and TypeMethodDescriptionfindLabelVariations(String label, boolean exactLabelMatch) Find possible variations of the provided label by splitting the sections using the slash as delimiter.findPagesForBestLabelMatch(Collection<AbstractPageModel> pages, List<String> labels) Finds all pages that matches one of the provided labels.getDefaultPageForLabel(String label, CatalogVersionModel version) Gets the default page by label and catalog version.Gets the homepagegetHomepage(PagePreviewCriteriaData pagePreviewCriteria) Returns homepage forPagePreviewCriteriaData.getPageForLabelAndPreview(String label, PagePreviewCriteriaData pagePreviewCriteria) Gets the page for label andPagePreviewCriteriaData.getPageForLabelAndStatuses(String label, List<CmsPageStatus> pageStatuses) Gets the page for label by page status.getPageForLabelOrIdAndMatchType(String labelOrId, boolean exactLabelMatch) Gets the page for label or id.getPageForLabelOrIdAndMatchType(String labelOrId, PagePreviewCriteriaData pagePreviewCriteria, boolean exactLabelMatch) Gets the page matching the provided for label or id filtered by thePagePreviewCriteriaDatainformation.
-
Method Details
-
getDefaultPageForLabel
ContentPageModel getDefaultPageForLabel(String label, CatalogVersionModel version) throws CMSItemNotFoundException Gets the default page by label and catalog version.- Parameters:
label- the labelversion- 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
Returns homepage forPagePreviewCriteriaData.- Parameters:
pagePreviewCriteria- thePagePreviewCriteriaDataobject.- Returns:
- the homepage model
-
getPageForLabelAndPreview
ContentPageModel getPageForLabelAndPreview(String label, PagePreviewCriteriaData pagePreviewCriteria) throws CMSItemNotFoundException Gets the page for label andPagePreviewCriteriaData.- Parameters:
label- the labelpagePreviewCriteria- thePagePreviewCriteriaDataobject.- 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 labelpageStatuses- 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. WhenexactLabelMatchisTRUE, the page is found by matching exactly the providedlabelOrId. Otherwise, the page containing a label that closely matches the providedlabelOrIdis returned instead.- Parameters:
labelOrId- the label or idexactLabelMatch- 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 thePagePreviewCriteriaDatainformation. WhenexactLabelMatchisTRUE, the page is found by matching exactly the providedlabelOrId. Otherwise, the page containing a label that closely matches the providedlabelOrIdis returned instead.- Parameters:
labelOrId- the label or idpagePreviewCriteria- thePagePreviewCriteriaDataobject.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
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 generatedexactLabelMatch- 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 matcheslabels- the list of labels used for filtering for best page matches- Returns:
- pages exactly or best match the provided labels
-