public interface CMSAdminRestrictionService
| Modifier and Type | Method and Description |
|---|---|
CMSCampaignRestrictionModel |
createCampaignRestriction(AbstractPageModel page,
java.lang.String id,
java.lang.String name,
java.util.Collection<CampaignModel> campaigns)
Creates a new CampaignRestriction and a new relation between the restriction and the given page
|
CMSCatalogRestrictionModel |
createCatalogRestriction(AbstractPageModel page,
java.lang.String id,
java.lang.String name,
java.util.Collection<CatalogModel> catalogs)
Creates a new CatalogRestriction and a new relation between the restriction and the given page.
|
CMSCategoryRestrictionModel |
createCategoryRestriction(AbstractPageModel page,
java.lang.String id,
java.lang.String name,
java.util.Collection<CategoryModel> categories)
Creates a new CategoryRestriction and a new relation between the restriction and the given page
|
CMSProductRestrictionModel |
createProductRestriction(AbstractPageModel page,
java.lang.String id,
java.lang.String name,
java.util.Collection<ProductModel> products)
Creates a new ProductRestriction and a new relation between the restriction and the given page
|
void |
createRelation(AbstractPageModel page,
AbstractRestrictionModel restriction)
creates a new relation between the given page and the given restriction
|
void |
createRelation(java.lang.String pageId,
java.lang.String restrictionId)
creates a new relation between the given page (pageId) and the given restriction (restrictionId)
|
CMSTimeRestrictionModel |
createTimeRestriction(AbstractPageModel page,
java.lang.String id,
java.lang.String name,
java.util.Date from,
java.util.Date until)
Creates a new TimeRestriction and a new relation between the restriction and the given page
|
CMSUserGroupRestrictionModel |
createUserGroupRestriction(AbstractPageModel page,
java.lang.String id,
java.lang.String name,
java.util.Collection<UserGroupModel> userGroups)
Creates a new UserGroupRestriction and a new relation between the restriction and the given page
|
CMSUserRestrictionModel |
createUserRestriction(AbstractPageModel page,
java.lang.String id,
java.lang.String name,
java.util.Collection<UserModel> users)
Creates a new UserRestriction and a new relation between the restriction and the given page
|
void |
deleteRelation(AbstractRestrictionModel restriction,
AbstractPageModel page)
deletes the relation between the restriction and the page
|
void |
deleteRelation(java.lang.String restrictionId,
java.lang.String pageId)
deletes the relation between the restriction and the page
|
java.util.Collection<RestrictionTypeModel> |
getAllowedRestrictionTypesForPage(AbstractPageModel page)
Returns a collection of all restrictions which can be applied on the given page
|
java.util.Collection<RestrictionTypeModel> |
getAllowedRestrictionTypesForPage(java.lang.String pageId)
Returns a collection of all restrictions which can be applied on the given page (via its id)
|
java.util.Collection<AbstractRestrictionModel> |
getAllRestrictions()
Returns all restriction
|
java.util.Collection<AbstractRestrictionModel> |
getAllRestrictionsByType(java.lang.String restrictionType)
Returns all restriction of the given restriction type
|
java.util.Collection<AbstractRestrictionModel> |
getAllRestrictionsByTypeNotLinkedToPage(java.lang.String pageId,
java.lang.String restrictionType)
Returns all restrictions of the given restriction type which are currently not linked to the given page (via its
id)
|
java.util.Collection<RestrictionTypeModel> |
getAllRestrictionTypes()
Returns a collection of all available restriction types.
|
java.util.List<CategoryModel> |
getCategories(CMSCategoryRestrictionModel categoryRestriction,
PreviewDataModel previewContext)
Returns products for product restriction
|
java.util.List<ProductModel> |
getProducts(CMSProductRestrictionModel productRestriction,
PreviewDataModel previewContext)
Returns products for product restriction
|
AbstractRestrictionModel |
getRestriction(java.lang.String id)
Returns a restriction via its id
|
java.util.List<AbstractRestrictionModel> |
getRestrictionsByName(java.lang.String name)
Returns a restriction via its name
|
java.util.Collection<AbstractRestrictionModel> |
getRestrictionsForPage(AbstractPageModel page)
Returns all restrictions which are applied on the given page
|
java.util.Collection<AbstractRestrictionModel> |
getRestrictionsForPage(AbstractPageModel page,
java.lang.String restrictionType)
Returns all restrictions of the given restriction type which are applied on the given page
|
java.util.Collection<AbstractRestrictionModel> |
getRestrictionsForPage(java.lang.String pageId,
java.lang.String restrictionType)
Returns all restrictions of the given restriction type which are applied on the given page (via its id)
|
boolean |
hasOtherRelations(AbstractRestrictionModel restriction,
AbstractPageModel page)
Checks if a given restriction has also other relations than to the given page
|
boolean |
hasOtherRelations(java.lang.String restrictionId,
java.lang.String pageId)
Checks if a given restriction has also other relations than to the given page
|
java.util.Collection<RestrictionTypeModel> getAllRestrictionTypes()
nulljava.util.Collection<RestrictionTypeModel> getAllowedRestrictionTypesForPage(java.lang.String pageId) throws CMSItemNotFoundException
pageId - id of pageCMSItemNotFoundException - if the page is not foundjava.util.Collection<RestrictionTypeModel> getAllowedRestrictionTypesForPage(AbstractPageModel page)
page - the page modeljava.util.Collection<AbstractRestrictionModel> getRestrictionsForPage(java.lang.String pageId, java.lang.String restrictionType) throws CMSItemNotFoundException
pageId - id of pagerestrictionType - ComposedType code of restrictionCMSItemNotFoundException - if the page or the composed type is not foundjava.util.Collection<AbstractRestrictionModel> getRestrictionsForPage(AbstractPageModel page, java.lang.String restrictionType) throws CMSItemNotFoundException
page - the page modelrestrictionType - ComposedType code of restrictionCMSItemNotFoundException - if the page or the composed type is not foundjava.util.Collection<AbstractRestrictionModel> getRestrictionsForPage(AbstractPageModel page)
page - - the page for which we want to retrieve restrictionsjava.util.Collection<AbstractRestrictionModel> getAllRestrictionsByType(java.lang.String restrictionType) throws CMSItemNotFoundException
restrictionType - ComposedType code of restrictionCMSItemNotFoundException - if the composed type is not foundjava.util.Collection<AbstractRestrictionModel> getAllRestrictionsByTypeNotLinkedToPage(java.lang.String pageId, java.lang.String restrictionType) throws CMSItemNotFoundException
pageId - id of the pagerestrictionType - composed type code of restrictionCMSItemNotFoundException - if the page or the composed type is not foundAbstractRestrictionModel getRestriction(java.lang.String id) throws CMSItemNotFoundException
id - id of restrictionCMSItemNotFoundException - if no restriction with the given id is foundjava.util.List<AbstractRestrictionModel> getRestrictionsByName(java.lang.String name) throws CMSItemNotFoundException
name - name of restrictionCMSItemNotFoundException - if no restriction with the given name is foundjava.util.Collection<AbstractRestrictionModel> getAllRestrictions()
nullCMSCategoryRestrictionModel createCategoryRestriction(AbstractPageModel page, java.lang.String id, java.lang.String name, java.util.Collection<CategoryModel> categories) throws CMSItemCreateException
page - page to be linked to the new restrictionid - id of the restrictionname - name of the restrictioncategories - list of categories for this restrictionCMSItemCreateException - if the restriction could not be createdCMSProductRestrictionModel createProductRestriction(AbstractPageModel page, java.lang.String id, java.lang.String name, java.util.Collection<ProductModel> products) throws CMSItemCreateException
page - page to be linked to the new restrictionid - id of the restrictionname - name of the restrictionproducts - list of products for this restrictionCMSItemCreateException - if the restriction could not be createdCMSTimeRestrictionModel createTimeRestriction(AbstractPageModel page, java.lang.String id, java.lang.String name, java.util.Date from, java.util.Date until) throws CMSItemCreateException
page - page to be linked to the new restrictionid - id of the restrictionname - name of the restrictionfrom - restriction is active fromuntil - restriction is active untilCMSItemCreateException - if the restriction could not be createdCMSUserRestrictionModel createUserRestriction(AbstractPageModel page, java.lang.String id, java.lang.String name, java.util.Collection<UserModel> users) throws CMSItemCreateException
page - page to be linked to the new restrictionid - id of the restrictionname - name of the restrictionusers - list of users for this restrictionCMSItemCreateException - if the restriction could not be createdCMSUserGroupRestrictionModel createUserGroupRestriction(AbstractPageModel page, java.lang.String id, java.lang.String name, java.util.Collection<UserGroupModel> userGroups) throws CMSItemCreateException
page - page to be linked to the new restrictionid - id of the restrictionname - name of the restrictionuserGroups - list of user groups for this restrictionCMSItemCreateException - if the restriction could not be createdCMSCatalogRestrictionModel createCatalogRestriction(AbstractPageModel page, java.lang.String id, java.lang.String name, java.util.Collection<CatalogModel> catalogs) throws CMSItemCreateException
page - page to be linked to the new restrictionid - id of the restrictionname - name of the restrictioncatalogs - list of catalogs for this restrictionCMSItemCreateException - if the restriction could not be createdCMSCampaignRestrictionModel createCampaignRestriction(AbstractPageModel page, java.lang.String id, java.lang.String name, java.util.Collection<CampaignModel> campaigns) throws CMSItemCreateException
page - page to be linked to the new restrictionid - id of the restrictionname - name of the restrictioncampaigns - list of campaigns for this restrictionCMSItemCreateException - if the restriction could not be createdvoid createRelation(AbstractPageModel page, AbstractRestrictionModel restriction)
page - the page modelrestriction - the restriction modelvoid createRelation(java.lang.String pageId,
java.lang.String restrictionId)
throws CMSItemNotFoundException
pageId - the page idrestrictionId - the restriciton idCMSItemNotFoundException - if the page and/or restriction is not foundboolean hasOtherRelations(AbstractRestrictionModel restriction, AbstractPageModel page)
restriction - the restriciton modelpage - the page modelboolean hasOtherRelations(java.lang.String restrictionId,
java.lang.String pageId)
throws CMSItemNotFoundException
restrictionId - the restriction idpageId - the page idCMSItemNotFoundException - if the restriction and/or page is not foundvoid deleteRelation(AbstractRestrictionModel restriction, AbstractPageModel page)
restriction - the restriciton modelpage - the page modelvoid deleteRelation(java.lang.String restrictionId,
java.lang.String pageId)
throws CMSItemNotFoundException
restrictionId - the restriction idpageId - the page idCMSItemNotFoundException - if the restriction and/or page is not foundjava.util.List<ProductModel> getProducts(CMSProductRestrictionModel productRestriction, PreviewDataModel previewContext)
productRestriction - given restrictionpreviewContext - preview context informationjava.util.List<CategoryModel> getCategories(CMSCategoryRestrictionModel categoryRestriction, PreviewDataModel previewContext)
categoryRestriction - given restrictionpreviewContext - preview context informationCopyright © 2018 SAP SE. All Rights Reserved.