Class DefaultPageVariationResolver
- java.lang.Object
-
- de.hybris.platform.cmsfacades.pages.service.impl.DefaultPageVariationResolver
-
- All Implemented Interfaces:
PageVariationResolver<AbstractPageModel>
public class DefaultPageVariationResolver extends java.lang.Object implements PageVariationResolver<AbstractPageModel>
Default implementation of thePageVariationResolver. This is used for retrieving default and variation pages.A page is considered "default":
A page is considered "variation" when the page has at least one restrictions assigned to it.
- when itsdefaultPageflag is set to TRUE or
- when no default page exists for a given page type and exactly one variation page that has no restrictions exists, that variation page will be used as the default page.
-
-
Constructor Summary
Constructors Constructor Description DefaultPageVariationResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreateOptionData(java.lang.String id, java.lang.String label, java.util.List<OptionData> options)java.util.List<AbstractPageModel>findDefaultPages(AbstractPageModel pageModel)Find default page for a given page.java.util.List<OptionData>findDisplayConditions(java.lang.String typeCode)Finds all display conditions available for a given page type.java.util.List<AbstractPageModel>findPagesByType(java.lang.String typeCode, boolean isDefaultPage)Find all default or variation pages for a given page type.java.util.List<AbstractPageModel>findVariationPages(AbstractPageModel pageModel)Find variation pages for a given page.protected CMSAdminPageServicegetAdminPageService()protected CMSAdminRestrictionServicegetAdminRestrictionService()protected TypeServicegetTypeService()booleanisDefaultPage(AbstractPageModel pageModel)Determines if a given page is a default page or a variation page.voidsetAdminPageService(CMSAdminPageService adminPageService)voidsetAdminRestrictionService(CMSAdminRestrictionService adminRestrictionService)voidsetTypeService(TypeService typeService)
-
-
-
Method Detail
-
findPagesByType
public java.util.List<AbstractPageModel> findPagesByType(java.lang.String typeCode, boolean isDefaultPage)
Description copied from interface:PageVariationResolverFind all default or variation pages for a given page type.- Specified by:
findPagesByTypein interfacePageVariationResolver<AbstractPageModel>- Parameters:
typeCode- the page typeisDefaultPage- true to retrieve default pages; false to retrieve variation pages- Returns:
- all default or variation pages
-
findDefaultPages
public java.util.List<AbstractPageModel> findDefaultPages(AbstractPageModel pageModel)
Description copied from interface:PageVariationResolverFind default page for a given page.- Specified by:
findDefaultPagesin interfacePageVariationResolver<AbstractPageModel>- Parameters:
pageModel- the page- Returns:
- default page (the collection should contain at most one item);
empty if the given page is a default page;
never null
-
findVariationPages
public java.util.List<AbstractPageModel> findVariationPages(AbstractPageModel pageModel)
Description copied from interface:PageVariationResolverFind variation pages for a given page.- Specified by:
findVariationPagesin interfacePageVariationResolver<AbstractPageModel>- Parameters:
pageModel- the page- Returns:
- variation pages associated to the given page;
empty if the given page is a variation page;
never null
-
isDefaultPage
public boolean isDefaultPage(AbstractPageModel pageModel)
Description copied from interface:PageVariationResolverDetermines if a given page is a default page or a variation page.- Specified by:
isDefaultPagein interfacePageVariationResolver<AbstractPageModel>- Parameters:
pageModel- the page- Returns:
- true if the given page is a default page; false otherwise
-
findDisplayConditions
public java.util.List<OptionData> findDisplayConditions(java.lang.String typeCode)
Description copied from interface:PageVariationResolverFinds all display conditions available for a given page type. It is used to determine if a fallback and/or variation page can be created.- Specified by:
findDisplayConditionsin interfacePageVariationResolver<AbstractPageModel>- Parameters:
typeCode- the page type- Returns:
- all display conditions
-
createOptionData
protected void createOptionData(java.lang.String id, java.lang.String label, java.util.List<OptionData> options)
-
getAdminPageService
protected CMSAdminPageService getAdminPageService()
-
setAdminPageService
public void setAdminPageService(CMSAdminPageService adminPageService)
-
getAdminRestrictionService
protected CMSAdminRestrictionService getAdminRestrictionService()
-
setAdminRestrictionService
public void setAdminRestrictionService(CMSAdminRestrictionService adminRestrictionService)
-
getTypeService
protected TypeService getTypeService()
-
setTypeService
public void setTypeService(TypeService typeService)
-
-