public class DefaultCMSAdminRestrictionService extends AbstractCMSAdminService implements CMSAdminRestrictionService
AbstractService.SerializableDTO| Modifier and Type | Field and Description |
|---|---|
protected CategoryService |
categoryService
Deprecated.
Implement the CategoryService as own property
|
protected CMSAdminPageService |
cmsAdminPageService
Deprecated.
Implement the CMSAdminPageService as own property
|
protected CMSRestrictionDao |
cmsRestrictionDao
Deprecated.
Implement the CMSRestrictionDao as own property
|
protected ProductService |
productService
Deprecated.
Implement the ProductService as own property
|
protected TypeService |
typeService
Deprecated.
Implement the TypeService as own property
|
ACTIVECATALOGVERSION, ACTIVESITEmodelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultCMSAdminRestrictionService() |
| Modifier and Type | Method and Description |
|---|---|
CMSCatalogRestrictionModel |
createCatalogRestriction(AbstractPageModel page,
String id,
String name,
Collection<CatalogModel> catalogs)
Creates a new CatalogRestriction and a new relation between the restriction and the given page.
|
CMSCategoryRestrictionModel |
createCategoryRestriction(AbstractPageModel page,
String id,
String name,
Collection<CategoryModel> categories)
Creates a new CategoryRestriction and a new relation between the restriction and the given page
|
CMSProductRestrictionModel |
createProductRestriction(AbstractPageModel page,
String id,
String name,
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(String pageId,
String restrictionId)
creates a new relation between the given page (pageId) and the given restriction (restrictionId)
|
CMSTimeRestrictionModel |
createTimeRestriction(AbstractPageModel page,
String id,
String name,
Date from,
Date until)
Creates a new TimeRestriction and a new relation between the restriction and the given page
|
CMSUserGroupRestrictionModel |
createUserGroupRestriction(AbstractPageModel page,
String id,
String name,
Collection<UserGroupModel> userGroups)
Creates a new UserGroupRestriction and a new relation between the restriction and the given page
|
CMSUserRestrictionModel |
createUserRestriction(AbstractPageModel page,
String id,
String name,
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(String restrictionId,
String pageId)
deletes the relation between the restriction and the page
|
Collection<RestrictionTypeModel> |
getAllowedRestrictionTypesForPage(AbstractPageModel page)
Returns a collection of all restrictions which can be applied on the given page
|
Collection<RestrictionTypeModel> |
getAllowedRestrictionTypesForPage(String id)
Returns a collection of all restrictions which can be applied on the given page (via its id)
|
Collection<AbstractRestrictionModel> |
getAllRestrictions()
Returns all restriction
|
Collection<AbstractRestrictionModel> |
getAllRestrictionsByType(String restrictionType)
Returns all restriction of the given restriction type
|
Collection<AbstractRestrictionModel> |
getAllRestrictionsByTypeNotLinkedToPage(String pageId,
String restrictionType)
Returns all restrictions of the given restriction type which are currently not linked to the given page (via its
id)
|
Collection<RestrictionTypeModel> |
getAllRestrictionTypes()
Returns a collection of all available restriction types.
|
List<CategoryModel> |
getCategories(CMSCategoryRestrictionModel categoryRestriction,
PreviewDataModel previewContext)
Returns products for product restriction
|
protected CMSRestrictionDao |
getCmsRestrictionDao() |
protected ComposedTypeModel |
getComposedTypeModel(String composedType) |
protected Locale |
getLocalLocale(PreviewDataModel previewContext) |
protected UserModel |
getLocalUser(PreviewDataModel previewContext) |
List<ProductModel> |
getProducts(CMSProductRestrictionModel productRestriction,
PreviewDataModel previewContext)
Returns products for product restriction
|
AbstractRestrictionModel |
getRestriction(String id)
Returns a restriction via its id
|
List<AbstractRestrictionModel> |
getRestrictionsByName(String name)
Returns a restriction via its name
|
Collection<AbstractRestrictionModel> |
getRestrictionsForPage(AbstractPageModel page)
Returns all restrictions which are applied on the given page
|
Collection<AbstractRestrictionModel> |
getRestrictionsForPage(AbstractPageModel page,
String restrictionType)
Returns all restrictions of the given restriction type which are applied on the given page
|
Collection<AbstractRestrictionModel> |
getRestrictionsForPage(String id,
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(String restrictionId,
String pageId)
Checks if a given restriction has also other relations than to the given page
|
protected void |
prepareRestricion(AbstractRestrictionModel res,
String id,
String name) |
void |
setCategoryService(CategoryService categoryService) |
void |
setCmsAdminPageService(CMSAdminPageService cmsAdminPageService) |
void |
setCmsRestrictionDao(CMSRestrictionDao cmsRestrictionDao) |
void |
setCmsRestrictionService(CMSRestrictionService cmsRestrictionService) |
void |
setCommonI18NService(CommonI18NService commonI18NService) |
void |
setI18nService(I18NService i18nService) |
void |
setProductService(ProductService productService) |
void |
setTypeService(TypeService typeService) |
void |
setUserService(UserService userService) |
getActiveCatalogVersion, getActiveSite, getUserServicegetModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, setTenantScope, writeReplace@Deprecated protected TypeService typeService
@Deprecated protected ProductService productService
@Deprecated protected CategoryService categoryService
@Deprecated protected CMSAdminPageService cmsAdminPageService
@Deprecated protected CMSRestrictionDao cmsRestrictionDao
public Collection<RestrictionTypeModel> getAllRestrictionTypes()
CMSAdminRestrictionServicegetAllRestrictionTypes in interface CMSAdminRestrictionServicenullpublic CMSCatalogRestrictionModel createCatalogRestriction(AbstractPageModel page, String id, String name, Collection<CatalogModel> catalogs) throws CMSItemCreateException
CMSAdminRestrictionServicecreateCatalogRestriction in interface CMSAdminRestrictionServicepage - 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 createdpublic CMSCategoryRestrictionModel createCategoryRestriction(AbstractPageModel page, String id, String name, Collection<CategoryModel> categories) throws CMSItemCreateException
CMSAdminRestrictionServicecreateCategoryRestriction in interface CMSAdminRestrictionServicepage - 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 createdpublic CMSProductRestrictionModel createProductRestriction(AbstractPageModel page, String id, String name, Collection<ProductModel> products) throws CMSItemCreateException
CMSAdminRestrictionServicecreateProductRestriction in interface CMSAdminRestrictionServicepage - 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 createdpublic void createRelation(AbstractPageModel page, AbstractRestrictionModel restriction)
CMSAdminRestrictionServicecreateRelation in interface CMSAdminRestrictionServicepublic void createRelation(String pageId, String restrictionId) throws CMSItemNotFoundException
CMSAdminRestrictionServicecreateRelation in interface CMSAdminRestrictionServiceCMSItemNotFoundException - if the page and/or restriction is not foundpublic CMSTimeRestrictionModel createTimeRestriction(AbstractPageModel page, String id, String name, Date from, Date until) throws CMSItemCreateException
CMSAdminRestrictionServicecreateTimeRestriction in interface CMSAdminRestrictionServicepage - 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 createdpublic CMSUserGroupRestrictionModel createUserGroupRestriction(AbstractPageModel page, String id, String name, Collection<UserGroupModel> userGroups) throws CMSItemCreateException
CMSAdminRestrictionServicecreateUserGroupRestriction in interface CMSAdminRestrictionServicepage - 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 createdpublic CMSUserRestrictionModel createUserRestriction(AbstractPageModel page, String id, String name, Collection<UserModel> users) throws CMSItemCreateException
CMSAdminRestrictionServicecreateUserRestriction in interface CMSAdminRestrictionServicepage - 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 createdpublic void deleteRelation(AbstractRestrictionModel restriction, AbstractPageModel page)
CMSAdminRestrictionServicedeleteRelation in interface CMSAdminRestrictionServicepublic void deleteRelation(String restrictionId, String pageId) throws CMSItemNotFoundException
CMSAdminRestrictionServicedeleteRelation in interface CMSAdminRestrictionServiceCMSItemNotFoundException - if the restriction and/or page is not foundpublic Collection<RestrictionTypeModel> getAllowedRestrictionTypesForPage(AbstractPageModel page)
CMSAdminRestrictionServicegetAllowedRestrictionTypesForPage in interface CMSAdminRestrictionServicepublic Collection<RestrictionTypeModel> getAllowedRestrictionTypesForPage(String id) throws CMSItemNotFoundException
CMSAdminRestrictionServicegetAllowedRestrictionTypesForPage in interface CMSAdminRestrictionServiceid - id of pageCMSItemNotFoundException - if the page is not foundpublic Collection<AbstractRestrictionModel> getAllRestrictionsByType(String restrictionType) throws CMSItemNotFoundException
CMSAdminRestrictionServicegetAllRestrictionsByType in interface CMSAdminRestrictionServicerestrictionType - ComposedType code of restrictionCMSItemNotFoundException - if the composed type is not foundpublic Collection<AbstractRestrictionModel> getAllRestrictionsByTypeNotLinkedToPage(String pageId, String restrictionType) throws CMSItemNotFoundException
CMSAdminRestrictionServicegetAllRestrictionsByTypeNotLinkedToPage in interface CMSAdminRestrictionServicepageId - id of the pagerestrictionType - composed type code of restrictionCMSItemNotFoundException - if the page or the composed type is not foundpublic List<CategoryModel> getCategories(CMSCategoryRestrictionModel categoryRestriction, PreviewDataModel previewContext)
CMSAdminRestrictionServicegetCategories in interface CMSAdminRestrictionServicecategoryRestriction - given restrictionpreviewContext - preview context informationpublic List<ProductModel> getProducts(CMSProductRestrictionModel productRestriction, PreviewDataModel previewContext)
CMSAdminRestrictionServicegetProducts in interface CMSAdminRestrictionServiceproductRestriction - given restrictionpreviewContext - preview context informationpublic AbstractRestrictionModel getRestriction(String id) throws CMSItemNotFoundException
CMSAdminRestrictionServicegetRestriction in interface CMSAdminRestrictionServiceid - id of restrictionCMSItemNotFoundException - if no restriction with the given id is foundpublic List<AbstractRestrictionModel> getRestrictionsByName(String name) throws CMSItemNotFoundException
CMSAdminRestrictionServicegetRestrictionsByName in interface CMSAdminRestrictionServicename - name of restrictionCMSItemNotFoundException - if no restriction with the given name is foundpublic Collection<AbstractRestrictionModel> getRestrictionsForPage(AbstractPageModel page, String restrictionType) throws CMSItemNotFoundException
CMSAdminRestrictionServicegetRestrictionsForPage in interface CMSAdminRestrictionServicerestrictionType - ComposedType code of restrictionCMSItemNotFoundExceptionpublic Collection<AbstractRestrictionModel> getRestrictionsForPage(String id, String restrictionType) throws CMSItemNotFoundException
CMSAdminRestrictionServicegetRestrictionsForPage in interface CMSAdminRestrictionServiceid - id of pagerestrictionType - ComposedType code of restrictionCMSItemNotFoundException - if the page or the composed type is not foundpublic boolean hasOtherRelations(AbstractRestrictionModel restriction, AbstractPageModel page)
CMSAdminRestrictionServicehasOtherRelations in interface CMSAdminRestrictionServicepublic boolean hasOtherRelations(String restrictionId, String pageId) throws CMSItemNotFoundException
CMSAdminRestrictionServicehasOtherRelations in interface CMSAdminRestrictionServiceCMSItemNotFoundException - if the restriction and/or page is not foundpublic Collection<AbstractRestrictionModel> getAllRestrictions()
CMSAdminRestrictionServicegetAllRestrictions in interface CMSAdminRestrictionServicenullpublic Collection<AbstractRestrictionModel> getRestrictionsForPage(AbstractPageModel page)
CMSAdminRestrictionServicegetRestrictionsForPage in interface CMSAdminRestrictionServicepage - - the page for which we want to retrieve restrictionspublic void setCategoryService(CategoryService categoryService)
public void setCmsAdminPageService(CMSAdminPageService cmsAdminPageService)
public void setCmsRestrictionDao(CMSRestrictionDao cmsRestrictionDao)
protected CMSRestrictionDao getCmsRestrictionDao()
public void setCmsRestrictionService(CMSRestrictionService cmsRestrictionService)
public void setCommonI18NService(CommonI18NService commonI18NService)
public void setI18nService(I18NService i18nService)
public void setProductService(ProductService productService)
public void setTypeService(TypeService typeService)
public void setUserService(UserService userService)
setUserService in class AbstractCMSAdminServiceprotected ComposedTypeModel getComposedTypeModel(String composedType) throws CMSItemNotFoundException
CMSItemNotFoundExceptionprotected Locale getLocalLocale(PreviewDataModel previewContext)
protected UserModel getLocalUser(PreviewDataModel previewContext)
protected void prepareRestricion(AbstractRestrictionModel res, String id, String name) throws CMSItemCreateException
CMSItemCreateExceptionCopyright © 2017 SAP SE. All Rights Reserved.