Interface CMSContentPageService
-
- All Known Implementing Classes:
DefaultCMSContentPageService
public interface CMSContentPageServiceProvides methods for managing content pages.- Spring Bean ID:
- cmsContentPageService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<java.lang.String>findLabelVariations(java.lang.String label, boolean exactLabelMatch)Find possible variations of the provided label by splitting the sections using the slash as delimiter.java.util.List<AbstractPageModel>findPagesForBestLabelMatch(java.util.Collection<AbstractPageModel> pages, java.util.List<java.lang.String> labels)Finds all pages that matches one of the provided labels.ContentPageModelgetDefaultPageForLabel(java.lang.String label, CatalogVersionModel version)Gets the default page by label and catalog version.ContentPageModelgetHomepage()Gets the homepageContentPageModelgetHomepage(PagePreviewCriteriaData pagePreviewCriteria)Returns homepage forPagePreviewCriteriaData.ContentPageModelgetPageForLabelAndPreview(java.lang.String label, PagePreviewCriteriaData pagePreviewCriteria)Gets the page for label andPagePreviewCriteriaData.ContentPageModelgetPageForLabelAndStatuses(java.lang.String label, java.util.List<CmsPageStatus> pageStatuses)Gets the page for label by page status.ContentPageModelgetPageForLabelOrIdAndMatchType(java.lang.String labelOrId, boolean exactLabelMatch)Gets the page for label or id.ContentPageModelgetPageForLabelOrIdAndMatchType(java.lang.String labelOrId, PagePreviewCriteriaData pagePreviewCriteria, boolean exactLabelMatch)Gets the page matching the provided for label or id filtered by thePagePreviewCriteriaDatainformation.
-
-
-
Method Detail
-
getDefaultPageForLabel
ContentPageModel getDefaultPageForLabel(java.lang.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
ContentPageModel getHomepage(PagePreviewCriteriaData pagePreviewCriteria)
Returns homepage forPagePreviewCriteriaData.- Parameters:
pagePreviewCriteria- thePagePreviewCriteriaDataobject.- Returns:
- the homepage model
-
getPageForLabelAndPreview
ContentPageModel getPageForLabelAndPreview(java.lang.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(java.lang.String label, java.util.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(java.lang.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(java.lang.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
java.util.List<java.lang.String> findLabelVariations(java.lang.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 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
java.util.List<AbstractPageModel> findPagesForBestLabelMatch(java.util.Collection<AbstractPageModel> pages, java.util.List<java.lang.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
-
-