Class DefaultPageRenderingService
java.lang.Object
de.hybris.platform.cmsfacades.rendering.impl.DefaultPageRenderingService
- All Implemented Interfaces:
PageRenderingService
Default implementation for
PageRenderingService.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindAllRenderingPageData(String typeCode, SearchPageData searchPageData) Find all pages.protected CMSDataFactoryprotected CMSPageServiceprotected FacadeValidationServiceprotected org.springframework.validation.Validatorprotected AbstractPageDatagetPageData(AbstractPageModel pageModel, RestrictionData restrictionData) protected AbstractPageModelgetPageModel(String pageType, String qualifier) Returns theAbstractPageModel.protected Converter<AbstractPageModel,AbstractPageData> protected StringgetPageQualifier(String pageLabelOrId, String code) Returns the qualifier that is used to extract the page.getPageRenderingData(String pageId) ReturnsAbstractPageDataobject based on pageId.getPageRenderingData(String pageTypeCode, String pageLabelOrId, String code) ReturnsAbstractPageDataobject based on pageLabelOrId or code.protected List<RenderingPageModelSupplier>protected org.springframework.validation.Validatorprotected RestrictionAwareServiceprotected RestrictionDatagetRestrictionData(String pageType, String code) ReturnsRestrictionDatabased on pageTypeCode and code.voidsetCmsDataFactory(CMSDataFactory cmsDataFactory) voidsetCmsPageService(CMSPageService cmsPageService) voidsetFacadeValidationService(FacadeValidationService facadeValidationService) voidsetFindAllPagesRenderingPageValidator(org.springframework.validation.Validator findAllPagesRenderingPageValidator) voidsetPageModelToDataRenderingConverter(Converter<AbstractPageModel, AbstractPageData> pageModelToDataRenderingConverter) voidsetRenderingCacheService(RenderingCacheService<AbstractPageData> renderingCacheService) voidsetRenderingPageModelSuppliers(List<RenderingPageModelSupplier> renderingPageModelSuppliers) voidsetRenderingPageValidator(org.springframework.validation.Validator renderingPageValidator) voidsetRestrictionAwareService(RestrictionAwareService restrictionAwareService) protected voidvalidateParameters(String pageTypeCode, String pageLabelOrId, String code) Validates input parameters.protected voidvalidateParametersForFindAllPages(String pageTypeCode) Validates that the provided type code represents a valid page type.
-
Constructor Details
-
DefaultPageRenderingService
public DefaultPageRenderingService()
-
-
Method Details
-
getPageRenderingData
public AbstractPageData getPageRenderingData(String pageTypeCode, String pageLabelOrId, String code) throws CMSItemNotFoundException Description copied from interface:PageRenderingServiceReturnsAbstractPageDataobject based on pageLabelOrId or code.- Specified by:
getPageRenderingDatain interfacePageRenderingService- Parameters:
pageTypeCode- the page typepageLabelOrId- the page label or id. This field is used only when the page type is ContentPage.code- the code depends on the page type. If the page type is ProductPage then the code should be a product code. If the page type is CategoryPage then the code should be a category code. If the page type is CatalogPage then the code should be a catalog page.- Returns:
- the
AbstractPageDataobject. - Throws:
CMSItemNotFoundException- if the page does not exists.
-
getPageRenderingData
Description copied from interface:PageRenderingServiceReturnsAbstractPageDataobject based on pageId.- Specified by:
getPageRenderingDatain interfacePageRenderingService- Parameters:
pageId- the page id- Returns:
- the
AbstractPageDataobject. - Throws:
CMSItemNotFoundException- if the page does not exists.
-
findAllRenderingPageData
public SearchPageData<AbstractPageData> findAllRenderingPageData(String typeCode, SearchPageData searchPageData) Description copied from interface:PageRenderingServiceFind all pages. The result is paginated. This should be used for rendering purposes.- Specified by:
findAllRenderingPageDatain interfacePageRenderingService- Parameters:
typeCode- the page type codesearchPageData- the pagination and sorting information- Returns:
- a search result containing a list of
AbstractPageData; can be empty, neverNULL
-
getPageData
protected AbstractPageData getPageData(AbstractPageModel pageModel, RestrictionData restrictionData) - Parameters:
pageModel- theAbstractPageModel.restrictionData- theRestrictionData- Returns:
- the
AbstractPageData.
-
getRestrictionData
ReturnsRestrictionDatabased on pageTypeCode and code. Never null.- Parameters:
pageType- the page type.code- the code. If the page type is ProductPage then the code should be a product code. If the page type is CategoryPage then the code should be a category code. If the page type is CatalogPage then the code should be a catalog page.- Returns:
- the
RestrictionData.
-
validateParameters
protected void validateParameters(String pageTypeCode, String pageLabelOrId, String code) throws CMSItemNotFoundException Validates input parameters.- Parameters:
pageTypeCode- the page type code.pageLabelOrId- the page label or id.code- the code (product code, catalog code or category code)- Throws:
CMSItemNotFoundException- when the page label or id is not valid
-
validateParametersForFindAllPages
Validates that the provided type code represents a valid page type.- Parameters:
pageTypeCode- the page type code.
-
getPageQualifier
Returns the qualifier that is used to extract the page.- Parameters:
pageLabelOrId- the page label or idcode- the code.- Returns:
- the qualifier.
-
getPageModel
protected AbstractPageModel getPageModel(String pageType, String qualifier) throws CMSItemNotFoundException Returns theAbstractPageModel.- Parameters:
pageType- the page type.qualifier- the qualifier of the page. SeegetPageQualifier()for more information.- Returns:
- the
AbstractPageModel. - Throws:
CMSItemNotFoundException- if the page does not exist.
-
getRenderingPageModelSuppliers
-
setRenderingPageModelSuppliers
public void setRenderingPageModelSuppliers(List<RenderingPageModelSupplier> renderingPageModelSuppliers) -
getPageModelToDataRenderingConverter
-
setPageModelToDataRenderingConverter
public void setPageModelToDataRenderingConverter(Converter<AbstractPageModel, AbstractPageData> pageModelToDataRenderingConverter) -
getFacadeValidationService
-
setFacadeValidationService
-
getRenderingPageValidator
protected org.springframework.validation.Validator getRenderingPageValidator() -
setRenderingPageValidator
public void setRenderingPageValidator(org.springframework.validation.Validator renderingPageValidator) -
getRestrictionAwareService
-
setRestrictionAwareService
-
getCmsDataFactory
-
setCmsDataFactory
-
getCmsPageService
-
setCmsPageService
-
getRenderingCacheService
-
setRenderingCacheService
-
getFindAllPagesRenderingPageValidator
protected org.springframework.validation.Validator getFindAllPagesRenderingPageValidator() -
setFindAllPagesRenderingPageValidator
public void setFindAllPagesRenderingPageValidator(org.springframework.validation.Validator findAllPagesRenderingPageValidator)
-