Class DefaultCMSContentPageService
java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
de.hybris.platform.cms2.servicelayer.services.impl.AbstractCMSService
de.hybris.platform.cms2.servicelayer.services.impl.AbstractCMSPageService
de.hybris.platform.cms2.servicelayer.services.impl.DefaultCMSContentPageService
- All Implemented Interfaces:
CMSContentPageService,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
public class DefaultCMSContentPageService
extends AbstractCMSPageService
implements CMSContentPageService
Default implementation of the
CMSContentPageService- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO -
Field Summary
FieldsFields inherited from class de.hybris.platform.cms2.servicelayer.services.impl.AbstractCMSService
CURRENTCATALOGVERSION, CURRENTSITEFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManagerFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindBestMatchLabelVariations(String label, List<String> labels) Find possible variations of the provided label by splitting the sections using the slash as delimiter.findLabelVariations(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.protected CMSCatalogVersionServiceprotected Comparator<AbstractPageModel>protected CMSSiteServiceprotected Collection<CatalogVersionModel>Finds all content catalog versions.protected Collection<CatalogVersionModel>For multiple content catalog, when content catalogVersions are not relatives, that's mean this request is come from storefront and may have multiple homepage in those content catalogs.getDefaultPageForLabel(String label, CatalogVersionModel version) Gets the default page by label and catalog version.Gets the homepagegetHomepage(PagePreviewCriteriaData pagePreviewCriteria) Returns homepage forPagePreviewCriteriaData.protected ContentPageModelGets the homepage by finding all content pages havingContentPageModel#isHomepage()equals TRUE, in all the catalog versions saved in the session.protected ContentPageModelgetPageForLabel(String label, List<CmsPageStatus> pageStatuses, boolean exactLabelMatch) Gets the page for label by page status and label match type.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.protected Collection<CatalogVersionModel>Finds all catalog versions related to a content catalog that are saved in the session.protected ContentPageModelgetSingleContentPage(List<String> labels) voidsetCmsCatalogVersionService(CMSCatalogVersionService cmsCatalogVersionService) voidsetCmsItemCatalogLevelComparator(Comparator<AbstractPageModel> cmsItemCatalogLevelComparator) voidsetCmsPreviewService(CMSPreviewService cmsPreviewService) voidsetCmsSiteService(CMSSiteService cmsSiteService) Methods inherited from class de.hybris.platform.cms2.servicelayer.services.impl.AbstractCMSPageService
getCatalogVersionService, getCmsPageDao, getCmsRestrictionService, getCmsVersionDao, getCmsVersionService, getCmsVersionSessionContextProvider, getItemByCriteria, getPageForId, getPageForVersionUid, getSessionSearchRestrictionsDisabler, setCatalogVersionService, setCmsPageDao, setCmsRestrictionService, setCmsVersionDao, setCmsVersionService, setCmsVersionSessionContextProvider, setSessionSearchRestrictionsDisablerMethods inherited from class de.hybris.platform.cms2.servicelayer.services.impl.AbstractCMSService
getBaseSiteService, getCurrentCatalogVersion, getCurrentSite, getSearchRestrictionService, getUserService, setBaseSiteService, setSearchRestrictionService, setUserServiceMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
Field Details
-
SLASH
- See Also:
-
-
Constructor Details
-
DefaultCMSContentPageService
public DefaultCMSContentPageService()
-
-
Method Details
-
getDefaultPageForLabel
public ContentPageModel getDefaultPageForLabel(String label, CatalogVersionModel version) throws CMSItemNotFoundException Description copied from interface:CMSContentPageServiceGets the default page by label and catalog version.- Specified by:
getDefaultPageForLabelin interfaceCMSContentPageService- Parameters:
label- the labelversion- the version- Returns:
- the default page by label
- Throws:
CMSItemNotFoundException- thrown when item was not found
-
getHomepage
Description copied from interface:CMSContentPageServiceGets the homepage- Specified by:
getHomepagein interfaceCMSContentPageService- Returns:
- the homepage model
-
getHomepageInternal
Gets the homepage by finding all content pages havingContentPageModel#isHomepage()equals TRUE, in all the catalog versions saved in the session.
In the multi-country scenario, the list of catalog versions contains the catalog versions hierarchy for the active site.CMS restrictions will be evaluated on the homepage to ensure that the proper primary or variation page is returned.
- Returns:
- the homepage model
-
getHomepage
Description copied from interface:CMSContentPageServiceReturns homepage forPagePreviewCriteriaData.- Specified by:
getHomepagein interfaceCMSContentPageService- Parameters:
pagePreviewCriteria- thePagePreviewCriteriaDataobject.- Returns:
- the homepage model
-
getPageForLabelAndPreview
public ContentPageModel getPageForLabelAndPreview(String label, PagePreviewCriteriaData pagePreviewCriteria) throws CMSItemNotFoundException Description copied from interface:CMSContentPageServiceGets the page for label andPagePreviewCriteriaData.- Specified by:
getPageForLabelAndPreviewin interfaceCMSContentPageService- Parameters:
label- the labelpagePreviewCriteria- thePagePreviewCriteriaDataobject.- Returns:
- the page for label
- Throws:
CMSItemNotFoundException- thrown when item is not found
-
getPageForLabelAndStatuses
public ContentPageModel getPageForLabelAndStatuses(String label, List<CmsPageStatus> pageStatuses) throws CMSItemNotFoundException Description copied from interface:CMSContentPageServiceGets the page for label by page status.- Specified by:
getPageForLabelAndStatusesin interfaceCMSContentPageService- Parameters:
label- the labelpageStatuses- the page statuses. i.e. (deleted, active)- Returns:
- the page for label
- Throws:
CMSItemNotFoundException- thrown when item was not found
-
getPageForLabel
protected ContentPageModel getPageForLabel(String label, List<CmsPageStatus> pageStatuses, boolean exactLabelMatch) throws CMSItemNotFoundException Gets the page for label by page status and label match type. WhenexactLabelMatchisTRUE, the page is found by matching exactly the providedlabelOrId. Otherwise, the page containing a label that closely matches the providedlabelOrIdis returned instead.- Parameters:
label- the labelpageStatuses- the page statuses. i.e. (deleted, active)exactLabelMatch- determines if the label of the result page should exactly match the provided labelOrId or not.- Returns:
- the page for label
- Throws:
CMSItemNotFoundException- thrown when item was not found
-
getSingleContentPage
-
getSessionContentCatalogVersions
Finds all catalog versions related to a content catalog that are saved in the session.- Returns:
- a list of catalog versions related to a content catalog
-
getContentCatalogVersions
Finds all content catalog versions. If there is a preview content catalog version, it should return the intersection of preview Hierarchy and session.- Returns:
- a list of catalog versions related to a content catalog
-
getContentCatalogVersionsOfHomepage
For multiple content catalog, when content catalogVersions are not relatives, that's mean this request is come from storefront and may have multiple homepage in those content catalogs. If it set the default content catalog, it should use homepage of the default content catalog as the site homepage.- Returns:
- a list of catalog versions
-
findPagesForBestLabelMatch
public List<AbstractPageModel> findPagesForBestLabelMatch(Collection<AbstractPageModel> pages, List<String> labels) Description copied from interface:CMSContentPageServiceFinds 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.- Specified by:
findPagesForBestLabelMatchin interfaceCMSContentPageService- 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
-
findLabelVariations
Description copied from interface:CMSContentPageServiceFind 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.- Specified by:
findLabelVariationsin interfaceCMSContentPageService- 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
-
findBestMatchLabelVariations
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 generatedlabels- the list of label variations- Returns:
- list of label variations, including the provided label
-
getPageForLabelOrIdAndMatchType
public ContentPageModel getPageForLabelOrIdAndMatchType(String labelOrId, boolean exactLabelMatch) throws CMSItemNotFoundException Description copied from interface:CMSContentPageServiceGets 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.- Specified by:
getPageForLabelOrIdAndMatchTypein interfaceCMSContentPageService- 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
public ContentPageModel getPageForLabelOrIdAndMatchType(String labelOrId, PagePreviewCriteriaData pagePreviewCriteria, boolean exactLabelMatch) throws CMSItemNotFoundException Description copied from interface:CMSContentPageServiceGets 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.- Specified by:
getPageForLabelOrIdAndMatchTypein interfaceCMSContentPageService- 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
-
getCmsItemCatalogLevelComparator
- Overrides:
getCmsItemCatalogLevelComparatorin classAbstractCMSPageService
-
setCmsItemCatalogLevelComparator
public void setCmsItemCatalogLevelComparator(Comparator<AbstractPageModel> cmsItemCatalogLevelComparator) - Overrides:
setCmsItemCatalogLevelComparatorin classAbstractCMSPageService
-
setCmsSiteService
-
getCmsSiteService
-
getCmsCatalogVersionService
-
setCmsCatalogVersionService
-
getCmsPreviewService
-
setCmsPreviewService
-