Class DefaultPageRestrictionFacade
java.lang.Object
de.hybris.platform.cmsfacades.pagesrestrictions.impl.DefaultPageRestrictionFacade
- All Implemented Interfaces:
PageRestrictionFacade
Default implementation of
PageRestrictionFacade. This uses CMSAdminPageService and
CMSAdminRestrictionService to retrieve pages and restrictions respectively.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PageRestrictionDatabuildPageRestrictionData(AbstractPageModel page, AbstractRestrictionModel restriction) Build a new page restriction dto to hold a single pageId - restrictionId pair.protected CMSAdminPageServiceprotected CMSAdminRestrictionServiceGet a list of restrictions for all pages.protected List<PageRestrictionData>protected FacadeValidationServicegetRestrictionsByPage(String pageId) Get a list of restrictions for a given page.protected org.springframework.transaction.PlatformTransactionManagerprotected org.springframework.validation.Validatorprotected ErrorFactoryvoidsetAdminPageService(CMSAdminPageService adminPageService) voidsetAdminRestrictionService(CMSAdminRestrictionService adminRestrictionService) voidsetFacadeValidationService(FacadeValidationService facadeValidationService) voidsetTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) voidsetUpdatePageRestrictionValidator(org.springframework.validation.Validator updatePageRestrictionValidator) voidsetValidatorErrorFactory(ErrorFactory validatorErrorFactory) voidupdateRestrictionRelationsByPage(String pageId, List<PageRestrictionData> pageRestrictionsListData) Updates the list of restrictions associated with the pageId based according to the provided pageRestrictionsListDataprotected voidvalidatePageForUpdate(AbstractPageModel page, List<PageRestrictionData> pageRestrictionsListData) Validate that page defaultPage attribute and list of restrictions to be applied to the page.
-
Constructor Details
-
DefaultPageRestrictionFacade
public DefaultPageRestrictionFacade()
-
-
Method Details
-
getRestrictionsByPage
public List<PageRestrictionData> getRestrictionsByPage(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
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
-
updateRestrictionRelationsByPage
public void updateRestrictionRelationsByPage(String pageId, List<PageRestrictionData> pageRestrictionsListData) throws CMSItemNotFoundException Description 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, 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
-
setFacadeValidationService
-
getAdminPageService
-
setAdminPageService
-
getAdminRestrictionService
-
setAdminRestrictionService
-
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
-
setValidatorErrorFactory
-