Class DefaultPageRestrictionFacade
- java.lang.Object
-
- de.hybris.platform.cmsfacades.pagesrestrictions.impl.DefaultPageRestrictionFacade
-
- All Implemented Interfaces:
PageRestrictionFacade
public class DefaultPageRestrictionFacade extends java.lang.Object implements PageRestrictionFacade
Default implementation ofPageRestrictionFacade. This usesCMSAdminPageServiceandCMSAdminRestrictionServiceto retrieve pages and restrictions respectively.
-
-
Constructor Summary
Constructors Constructor Description DefaultPageRestrictionFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PageRestrictionDatabuildPageRestrictionData(AbstractPageModel page, AbstractRestrictionModel restriction)Build a new page restriction dto to hold a single pageId - restrictionId pair.protected CMSAdminPageServicegetAdminPageService()protected CMSAdminRestrictionServicegetAdminRestrictionService()java.util.List<PageRestrictionData>getAllPagesRestrictions()Get a list of restrictions for all pages.protected java.util.List<PageRestrictionData>getAllRestrictionsByPage(AbstractPageModel page)protected FacadeValidationServicegetFacadeValidationService()java.util.List<PageRestrictionData>getRestrictionsByPage(java.lang.String pageId)Get a list of restrictions for a given page.protected org.springframework.transaction.PlatformTransactionManagergetTransactionManager()protected org.springframework.validation.ValidatorgetUpdatePageRestrictionValidator()protected ErrorFactorygetValidatorErrorFactory()voidsetAdminPageService(CMSAdminPageService adminPageService)voidsetAdminRestrictionService(CMSAdminRestrictionService adminRestrictionService)voidsetFacadeValidationService(FacadeValidationService facadeValidationService)voidsetTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)voidsetUpdatePageRestrictionValidator(org.springframework.validation.Validator updatePageRestrictionValidator)voidsetValidatorErrorFactory(ErrorFactory validatorErrorFactory)voidupdateRestrictionRelationsByPage(java.lang.String pageId, java.util.List<PageRestrictionData> pageRestrictionsListData)Updates the list of restrictions associated with the pageId based according to the provided pageRestrictionsListDataprotected voidvalidatePageForUpdate(AbstractPageModel page, java.util.List<PageRestrictionData> pageRestrictionsListData)Validate that page defaultPage attribute and list of restrictions to be applied to the page.
-
-
-
Method Detail
-
getRestrictionsByPage
public java.util.List<PageRestrictionData> getRestrictionsByPage(java.lang.String pageId) throws CMSItemNotFoundException
Description copied from interface:PageRestrictionFacadeGet a list of restrictions for a given page.- Specified by:
getRestrictionsByPagein interfacePageRestrictionFacade- Parameters:
pageId- the id of the page to which the restrictions are applied- Returns:
- list of page id - restriction id pairs; never null
- Throws:
CMSItemNotFoundException- when the page cannot be found
-
getAllPagesRestrictions
public java.util.List<PageRestrictionData> getAllPagesRestrictions()
Description copied from interface:PageRestrictionFacadeGet a list of restrictions for all pages.- Specified by:
getAllPagesRestrictionsin interfacePageRestrictionFacade- Returns:
- a list of restrictions for all pages.
-
getAllRestrictionsByPage
protected java.util.List<PageRestrictionData> getAllRestrictionsByPage(AbstractPageModel page)
-
updateRestrictionRelationsByPage
public void updateRestrictionRelationsByPage(java.lang.String pageId, java.util.List<PageRestrictionData> pageRestrictionsListData) throws CMSItemNotFoundExceptionDescription copied from interface:PageRestrictionFacadeUpdates the list of restrictions associated with the pageId based according to the provided pageRestrictionsListData- Specified by:
updateRestrictionRelationsByPagein interfacePageRestrictionFacade- Parameters:
pageId- the id of the page to which the restrictions are appliedpageRestrictionsListData- the list of page-restriction relation- Throws:
CMSItemNotFoundException- when cannot find a page based on the provided pageId
-
validatePageForUpdate
protected void validatePageForUpdate(AbstractPageModel page, java.util.List<PageRestrictionData> pageRestrictionsListData)
Validate that page defaultPage attribute and list of restrictions to be applied to the page.- Parameters:
page- - the page which defaultPage flag should be validatepageRestrictionsListData- - the restrictions to be applied to the page
-
buildPageRestrictionData
protected PageRestrictionData buildPageRestrictionData(AbstractPageModel page, AbstractRestrictionModel restriction)
Build a new page restriction dto to hold a single pageId - restrictionId pair.- Parameters:
page- - the pagerestriction- - the restriction- Returns:
- a page restriction dto
-
getFacadeValidationService
protected FacadeValidationService getFacadeValidationService()
-
setFacadeValidationService
public void setFacadeValidationService(FacadeValidationService facadeValidationService)
-
getAdminPageService
protected CMSAdminPageService getAdminPageService()
-
setAdminPageService
public void setAdminPageService(CMSAdminPageService adminPageService)
-
getAdminRestrictionService
protected CMSAdminRestrictionService getAdminRestrictionService()
-
setAdminRestrictionService
public void setAdminRestrictionService(CMSAdminRestrictionService adminRestrictionService)
-
getUpdatePageRestrictionValidator
protected org.springframework.validation.Validator getUpdatePageRestrictionValidator()
-
setUpdatePageRestrictionValidator
public void setUpdatePageRestrictionValidator(org.springframework.validation.Validator updatePageRestrictionValidator)
-
getTransactionManager
protected org.springframework.transaction.PlatformTransactionManager getTransactionManager()
-
setTransactionManager
public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
-
getValidatorErrorFactory
protected ErrorFactory getValidatorErrorFactory()
-
setValidatorErrorFactory
public void setValidatorErrorFactory(ErrorFactory validatorErrorFactory)
-
-