Interface CMSPageService
- All Known Subinterfaces:
VendorCMSPageService
- All Known Implementing Classes:
DefaultCMSPageService,DefaultVendorCMSPageService
public interface CMSPageService
The Interface CMSPageService. Provides methods for managing pages or page templates.
- Spring Bean ID:
- cmsPageService
-
Method Summary
Modifier and TypeMethodDescriptionfindAllPages(String typeCode, SearchPageData searchPageData) Find all pages.Gets the all active page templates.Deprecated, for removal: This API element is subject to removal in a future version.since 1905, no longer neededdefault List<ContentSlotForTemplateModel>getChildSlotForTemplateAtSamePosition(Collection<ContentSlotForTemplateModel> slotForTemplateModels) For multi-country the same position may have multi slotForTemplate, this function will get the child catalogVersion of slotForTemplateModel and remove other parents slotForTemplates.getContentSlotForPage(AbstractPageModel page, String position) Returns a contentslot for the given page and position.getContentSlotForPage(AbstractPageModel page, String position, PagePreviewCriteriaData pagePreviewCriteria) Deprecated, for removal: This API element is subject to removal in a future version.since 2105, no longer needed.getContentSlotModelsForPage(AbstractPageModel page, PagePreviewCriteriaData pagePreviewCriteria) Deprecated, for removal: This API element is subject to removal in a future version.since 2105, no longer needed.Returns collection ofContentSlotDataobjects containing data taken from allContentSlotForPageModelobjects as well fromContentSlotForTemplateModelobjects for passed as parameterAbstractPageModelobject.getContentSlotsForPage(AbstractPageModel page, PagePreviewCriteriaData pagePreviewCriteria) Returns collection ofContentSlotDataobjects containing data taken from allContentSlotForPageModelobjects as well fromContentSlotForTemplateModelobjects for a givenAbstractPageModelandPagePreviewCriteriaData.getContentSlotsForPageTemplate(PageTemplateModel pageTemplate) Gets allContentSlotForTemplateModelobjects related to passed as parameterPageTemplateModel.Returns the default catalog page WITHOUT evaluating any restrictionsReturns the default category page WITHOUT evaluating any restrictionsgetDefaultPageForLabel(String label, CatalogVersionModel version) Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useCMSContentPageService.getDefaultPageForLabel(String, CatalogVersionModel)insteadReturns the default product page WITHOUT evaluating any restrictionsgetFrontendTemplateName(PageTemplateModel template) Gets the frontend template name forPageTemplateModelobject.Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useCMSContentPageService.getHomepage()insteadgetHomepage(PagePreviewCriteriaData pagePreviewCriteria) Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useCMSContentPageService.getHomepage(PagePreviewCriteriaData)insteadgetLabelOrId(ContentPageModel contentPage) Deprecated, for removal: This API element is subject to removal in a future version.since 1905, no longer neededReturns theContentSlotForPageModelobjects for passed as parameterAbstractPageModelobject.getPageForCatalog(CatalogModel catalog) Gets the page by catalog.getPageForCatalogId(String catalogId) Gets the page for catalog id.getPageForCategory(CategoryModel category) Gets the page for category.getPageForCategory(CategoryModel category, PagePreviewCriteriaData pagePreviewCriteria) Gets the page for category andPagePreviewCriteriaData.getPageForCategoryCode(String categoryCode) Gets the page for category code.getPageForCategoryCode(String categoryCode, PagePreviewCriteriaData pagePreviewCriteria) Gets the page for category code andPagePreviewCriteriaData.getPageForId(String id) Gets the page for id.getPageForId(String id, PagePreviewCriteriaData pagePreviewCriteria) Gets the page for id andPagePreviewCriteriaData.Deprecated, for removal: This API element is subject to removal in a future version.since 1905, no longer neededgetPageForLabel(String label) Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useCMSContentPageService.getPageForLabelAndStatuses(String, List)insteadgetPageForLabel(String label, PagePreviewCriteriaData pagePreviewCriteria) Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useCMSContentPageService.getPageForLabelAndPreview(String, PagePreviewCriteriaData)insteadgetPageForLabelAndPageStatuses(String label, List<CmsPageStatus> pageStatuses) Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useCMSContentPageService.getPageForLabelAndStatuses(String, List)insteadgetPageForLabelOrId(String labelOrId) Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useCMSContentPageService.getPageForLabelOrIdAndMatchType(String, boolean)insteadgetPageForLabelOrId(String labelOrId, PagePreviewCriteriaData pagePreviewCriteria) Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useCMSContentPageService.getPageForLabelOrIdAndMatchType(String, PagePreviewCriteriaData, boolean)insteadgetPageForProduct(ProductModel product) Gets the page for product.getPageForProduct(ProductModel product, PagePreviewCriteriaData pagePreviewCriteria) Gets the page for product andPagePreviewCriteriaData.getPageForProductCode(String productCode) Gets the page for product code.getPageForProductCode(String productCode, PagePreviewCriteriaData pagePreviewCriteria) Gets the page for product code andPagePreviewCriteriaData.getPagesForComponent(AbstractCMSComponentModel component) Returns all pages where given component occurs.getPagesForContentSlots(Collection<ContentSlotModel> contentSlots) Returns all pages where given content slots occurs.Gets the pages for page template component.getPagesForPageTemplateContentSlots(Collection<ContentSlotModel> contentSlots) Gets the pages for page template content slots.getSortedMultiCountryContentSlots(List<ContentSlotModel> contentSlots, List<CatalogVersionModel> catalogVersions) Deprecated, for removal: This API element is subject to removal in a future version.since 2105, please usegetSortedMultiCountryContentSlots(List, List, AbstractPageModel)getSortedMultiCountryContentSlots(List<ContentSlotModel> contentSlots, List<CatalogVersionModel> catalogVersions, AbstractPageModel page) Gets the content slots sorted by their catalog hierarchy.
-
Method Details
-
getAllActivePageTemplates
Collection<PageTemplateModel> getAllActivePageTemplates()Gets the all active page templates.- Returns:
- the all active page templates
-
getAllContentPages
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, no longer neededGets the all content pages.- Returns:
- the all content pages
-
getOwnContentSlotsForPage
Returns theContentSlotForPageModelobjects for passed as parameterAbstractPageModelobject.- Parameters:
page- theAbstractPageModelobject.- Returns:
- collection of
ContentSlotForPageModelobjects related toAbstractPageModel.
-
getContentSlotModelsForPage
@Deprecated(since="2105", forRemoval=true) Collection<ContentSlotForPageModel> getContentSlotModelsForPage(AbstractPageModel page, PagePreviewCriteriaData pagePreviewCriteria) Deprecated, for removal: This API element is subject to removal in a future version.since 2105, no longer needed.Returns theContentSlotForPageModelobjects for passed as parameterAbstractPageModelobject andPagePreviewCriteriaData.- Parameters:
page- theAbstractPageModelobject.pagePreviewCriteria- thePagePreviewCriteriaDataobject.- Returns:
- collection of
ContentSlotForPageModelobjects related toAbstractPageModel.
-
getContentSlotForPage
ContentSlotData getContentSlotForPage(AbstractPageModel page, String position) throws CMSItemNotFoundException Returns a contentslot for the given page and position. WARNING: This could be a performance issue when you select all content slots of a page via this method. A better way is to set all contentslots via getContentSlotsForPage(AbstractPageModel page) and set them in the request scope- Parameters:
page- the page modelposition- the position- Returns:
- contentslot for the given page and position.
- Throws:
CMSItemNotFoundException- if no content slot is defined at this position in that page
-
getContentSlotForPage
@Deprecated(since="2105", forRemoval=true) ContentSlotData getContentSlotForPage(AbstractPageModel page, String position, PagePreviewCriteriaData pagePreviewCriteria) throws CMSItemNotFoundException Deprecated, for removal: This API element is subject to removal in a future version.since 2105, no longer needed.Returns a contentslot for the given page, position andPagePreviewCriteriaData. WARNING: This could be a performance issue when you select all content slots of a page via this method. A better way is to set all contentslots via getContentSlotsForPage(AbstractPageModel page) and set them in the request scope- Parameters:
page- the page modelposition- the positionpagePreviewCriteria- thePagePreviewCriteriaDataobject.- Returns:
- contentslot for the given page and position.
- Throws:
CMSItemNotFoundException- if no content slot is defined at this position in that page
-
getContentSlotsForPage
Returns collection ofContentSlotDataobjects containing data taken from allContentSlotForPageModelobjects as well fromContentSlotForTemplateModelobjects for passed as parameterAbstractPageModelobject.- Parameters:
page- theAbstractPageModelobject.- Returns:
- collection of
ContentSlotDataobjects.
-
getContentSlotsForPage
Collection<ContentSlotData> getContentSlotsForPage(AbstractPageModel page, PagePreviewCriteriaData pagePreviewCriteria) Returns collection ofContentSlotDataobjects containing data taken from allContentSlotForPageModelobjects as well fromContentSlotForTemplateModelobjects for a givenAbstractPageModelandPagePreviewCriteriaData.- Parameters:
page- theAbstractPageModelobject.pagePreviewCriteria- thePagePreviewCriteriaDataobject.- Returns:
- collection of
ContentSlotDataobjects.
-
getContentSlotsForPageTemplate
Collection<ContentSlotForTemplateModel> getContentSlotsForPageTemplate(PageTemplateModel pageTemplate) Gets allContentSlotForTemplateModelobjects related to passed as parameterPageTemplateModel.- Parameters:
pageTemplate- thePageTemplateModelobject for which search will be executed.- Returns:
- the list of found
ContentSlotForTemplateModelobjects.
-
getDefaultCatalogPage
Returns the default catalog page WITHOUT evaluating any restrictions- Returns:
- default catalog page
- Throws:
CMSItemNotFoundException- if no default catalog page could be found
-
getDefaultCategoryPage
Returns the default category page WITHOUT evaluating any restrictions- Returns:
- default category page
- Throws:
CMSItemNotFoundException- if no default category page could be found
-
getDefaultPageForLabel
@Deprecated(since="1905", forRemoval=true) ContentPageModel getDefaultPageForLabel(String label, CatalogVersionModel version) throws CMSItemNotFoundException Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useCMSContentPageService.getDefaultPageForLabel(String, CatalogVersionModel)insteadGets 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
-
getDefaultProductPage
Returns the default product page WITHOUT evaluating any restrictions- Returns:
- default product page
- Throws:
CMSItemNotFoundException- if no default product page could be found
-
getFrontendTemplateName
Gets the frontend template name forPageTemplateModelobject.- Parameters:
template- thePageTemplateModelobject.- Returns:
- the frontend template name.
-
getHomepage
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useCMSContentPageService.getHomepage()insteadGets the homepage- Returns:
- the homepage model
-
getHomepage
@Deprecated(since="1905", forRemoval=true) ContentPageModel getHomepage(PagePreviewCriteriaData pagePreviewCriteria) Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useCMSContentPageService.getHomepage(PagePreviewCriteriaData)insteadReturns homepage forPagePreviewCriteriaData.- Parameters:
pagePreviewCriteria- thePagePreviewCriteriaDataobject.- Returns:
- the homepage model
-
getLabelOrId
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, no longer neededGets theContentPageModellabel or id if label is empty.- Parameters:
contentPage- theContentPageModelobject.- Returns:
- the label or id of
ContentPageModel.
-
getPageForCatalog
Gets the page by catalog.- Parameters:
catalog- the catalog- Returns:
- the page by catalog
- Throws:
CMSItemNotFoundException- thrown when item was not found
-
getPageForCatalogId
Gets the page for catalog id.- Parameters:
catalogId- the catalog id- Returns:
- the page for catalog id
- Throws:
CMSItemNotFoundException- thrown when item was not found
-
getPageForCategory
Gets the page for category.- Parameters:
category- the category- Returns:
- the page for category
- Throws:
CMSItemNotFoundException- thrown when item was not found
-
getPageForCategory
CategoryPageModel getPageForCategory(CategoryModel category, PagePreviewCriteriaData pagePreviewCriteria) throws CMSItemNotFoundException Gets the page for category andPagePreviewCriteriaData.- Parameters:
category- the categorypagePreviewCriteria- thePagePreviewCriteriaDataobject.- Returns:
- the page for category
- Throws:
CMSItemNotFoundException- thrown when item is not found
-
getPageForCategoryCode
Gets the page for category code.- Parameters:
categoryCode- the category code- Returns:
- the page for category code
- Throws:
CMSItemNotFoundException- thrown when item was not found
-
getPageForCategoryCode
CategoryPageModel getPageForCategoryCode(String categoryCode, PagePreviewCriteriaData pagePreviewCriteria) throws CMSItemNotFoundException Gets the page for category code andPagePreviewCriteriaData.- Parameters:
categoryCode- the category codepagePreviewCriteria- thePagePreviewCriteriaDataobject.- Returns:
- the page for category code
- Throws:
CMSItemNotFoundException- thrown when item is not found
-
getPageForId
Gets the page for id.- Parameters:
id- the id- Returns:
- the page for id
- Throws:
CMSItemNotFoundException- thrown when item was not found
-
getPageForIdWithRestrictions
@Deprecated(since="1905", forRemoval=true) AbstractPageModel getPageForIdWithRestrictions(String id) throws CMSItemNotFoundException Deprecated, for removal: This API element is subject to removal in a future version.since 1905, no longer neededGets the page for id and evaluates the page restrictions- Parameters:
id- the id- Returns:
- the page for id
- Throws:
CMSItemNotFoundException- thrown when item was not found
-
getPageForId
AbstractPageModel getPageForId(String id, PagePreviewCriteriaData pagePreviewCriteria) throws CMSItemNotFoundException Gets the page for id andPagePreviewCriteriaData.- Parameters:
id- the idpagePreviewCriteria- thePagePreviewCriteriaDataobject.- Returns:
- the page for id
- Throws:
CMSItemNotFoundException- thrown when item is not found
-
getPageForLabel
@Deprecated(since="1905", forRemoval=true) ContentPageModel getPageForLabel(String label) throws CMSItemNotFoundException Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useCMSContentPageService.getPageForLabelAndStatuses(String, List)insteadGets the page for label.- Parameters:
label- the label- Returns:
- the page for label
- Throws:
CMSItemNotFoundException- thrown when item was not found
-
getPageForLabel
@Deprecated(since="1905", forRemoval=true) ContentPageModel getPageForLabel(String label, PagePreviewCriteriaData pagePreviewCriteria) throws CMSItemNotFoundException Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useCMSContentPageService.getPageForLabelAndPreview(String, PagePreviewCriteriaData)insteadGets the page for label andPagePreviewCriteriaData.- Parameters:
label- the labelpagePreviewCriteria- thePagePreviewCriteriaDataobject.- Returns:
- the page for label
- Throws:
CMSItemNotFoundException- thrown when item is not found
-
getPageForLabelAndPageStatuses
@Deprecated(since="1905", forRemoval=true) ContentPageModel getPageForLabelAndPageStatuses(String label, List<CmsPageStatus> pageStatuses) throws CMSItemNotFoundException Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useCMSContentPageService.getPageForLabelAndStatuses(String, List)insteadGets 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
-
getPageForLabelOrId
@Deprecated(since="1905", forRemoval=true) ContentPageModel getPageForLabelOrId(String labelOrId) throws CMSItemNotFoundException Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useCMSContentPageService.getPageForLabelOrIdAndMatchType(String, boolean)insteadGets the page for label or id.- Parameters:
labelOrId- the label or id- Returns:
- the page for label or id
- Throws:
CMSItemNotFoundException- thrown when item was not found
-
getPageForLabelOrId
@Deprecated(since="1905", forRemoval=true) ContentPageModel getPageForLabelOrId(String labelOrId, PagePreviewCriteriaData pagePreviewCriteria) throws CMSItemNotFoundException Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useCMSContentPageService.getPageForLabelOrIdAndMatchType(String, PagePreviewCriteriaData, boolean)insteadGets the page for label or id andPagePreviewCriteriaData.- Parameters:
labelOrId- the label or idpagePreviewCriteria- thePagePreviewCriteriaDataobject.- Returns:
- the page for label or id
- Throws:
CMSItemNotFoundException- thrown when item is not found
-
getPageForProduct
Gets the page for product.- Parameters:
product- the product- Returns:
- the page for product
- Throws:
CMSItemNotFoundException- thrown when item was not found
-
getPageForProduct
ProductPageModel getPageForProduct(ProductModel product, PagePreviewCriteriaData pagePreviewCriteria) throws CMSItemNotFoundException Gets the page for product andPagePreviewCriteriaData.- Parameters:
product- the productpagePreviewCriteria- thePagePreviewCriteriaDataobject.- Returns:
- the page for product
- Throws:
CMSItemNotFoundException- thrown when item is not found
-
getPageForProductCode
Gets the page for product code.- Parameters:
productCode- the product code- Returns:
- the page for product code
- Throws:
CMSItemNotFoundException- thrown when item was not found
-
getPageForProductCode
ProductPageModel getPageForProductCode(String productCode, PagePreviewCriteriaData pagePreviewCriteria) throws CMSItemNotFoundException Gets the page for product code andPagePreviewCriteriaData.- Parameters:
productCode- the product codepagePreviewCriteria- thePagePreviewCriteriaDataobject.- Returns:
- the page for product code
- Throws:
CMSItemNotFoundException- thrown when item is not found
-
getPagesForComponent
Returns all pages where given component occurs.- Parameters:
component- - component model that we are looking pages for- Returns:
- - collection of AbstractPageModel
-
getPagesForContentSlots
Returns all pages where given content slots occurs.- Parameters:
contentSlots- - content slot model that we are looking pages for- Returns:
- - collection of AbstractPageModel
-
getPagesForPageTemplateComponent
Gets the pages for page template component.- Parameters:
component- the component- Returns:
- the pages for page template component
-
getPagesForPageTemplateContentSlots
Collection<AbstractPageModel> getPagesForPageTemplateContentSlots(Collection<ContentSlotModel> contentSlots) Gets the pages for page template content slots.- Parameters:
contentSlots- the content slots- Returns:
- the pages for page template content slots
-
getSortedMultiCountryContentSlots
@Deprecated(since="2105", forRemoval=true) List<ContentSlotModel> getSortedMultiCountryContentSlots(List<ContentSlotModel> contentSlots, List<CatalogVersionModel> catalogVersions) Deprecated, for removal: This API element is subject to removal in a future version.since 2105, please usegetSortedMultiCountryContentSlots(List, List, AbstractPageModel)Gets the content slots sorted by their catalog hierarchy.- Parameters:
contentSlots- - the content slotscatalogVersions- - the catalog versions- Returns:
- a sorted list of content slots
-
getSortedMultiCountryContentSlots
List<ContentSlotModel> getSortedMultiCountryContentSlots(List<ContentSlotModel> contentSlots, List<CatalogVersionModel> catalogVersions, AbstractPageModel page) Gets the content slots sorted by their catalog hierarchy.- Parameters:
contentSlots- - the content slotscatalogVersions- - the catalog versionspage- - original page- Returns:
- a sorted list of
ContentSlotModel, empty list of not found.
-
findAllPages
Find all pages. The result is paginated.- Parameters:
typeCode- the page type codesearchPageData- the pagination and sorting information- Returns:
- a search result containing a list of
AbstractPageModel; can be empty, neverNULL
-
getChildSlotForTemplateAtSamePosition
default List<ContentSlotForTemplateModel> getChildSlotForTemplateAtSamePosition(Collection<ContentSlotForTemplateModel> slotForTemplateModels) For multi-country the same position may have multi slotForTemplate, this function will get the child catalogVersion of slotForTemplateModel and remove other parents slotForTemplates.- Parameters:
slotForTemplateModels- the list of ContentSlotForTemplateModel may have multi slotForTemplate in same position- Returns:
- the
- ContentSlotForTemplateModel
-