public class DefaultCMSAdminRestrictionService extends AbstractCMSAdminService implements CMSAdminRestrictionService
AbstractService.SerializableDTO| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
CATALOG_VERSIONS |
ACTIVECATALOGVERSION, ACTIVESITE, CLONE_CONTEXT, RESTORE_CONTEXTmodelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultCMSAdminRestrictionService() |
| 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
|
protected void |
findCategoriesInLocalSession(PreviewDataModel previewContext,
java.util.List<CategoryModel> ret,
java.util.Collection<java.lang.String> categoryListCodes) |
protected void |
findProductsInLocalSession(PreviewDataModel previewContext,
java.util.List<ProductModel> ret,
java.util.Collection<java.lang.String> productListCodes) |
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 id)
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
|
protected CategoryService |
getCategoryService() |
protected CMSAdminPageService |
getCmsAdminPageService() |
protected CMSRestrictionDao |
getCmsRestrictionDao() |
protected CMSRestrictionService |
getCmsRestrictionService() |
protected CommonI18NService |
getCommonI18NService() |
protected ComposedTypeModel |
getComposedTypeModel(java.lang.String composedType) |
protected I18NService |
getI18nService() |
protected java.util.Locale |
getLocalLocale(PreviewDataModel previewContext) |
protected UserModel |
getLocalUser(PreviewDataModel previewContext) |
java.util.List<ProductModel> |
getProducts(CMSProductRestrictionModel productRestriction,
PreviewDataModel previewContext)
Returns products for product restriction
|
protected ProductService |
getProductService() |
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 id,
java.lang.String restrictionType)
Returns all restrictions of the given restriction type which are applied on the given page (via its id)
|
protected TypeService |
getTypeService() |
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
|
protected void |
prepareRestricion(AbstractRestrictionModel res,
java.lang.String id,
java.lang.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) |
getActiveCatalogVersion, getActiveSite, getBaseSiteService, getUserService, setBaseSiteService, setUserServicegetModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplaceprotected static final java.lang.String CATALOG_VERSIONS
public java.util.Collection<RestrictionTypeModel> getAllRestrictionTypes()
CMSAdminRestrictionServicegetAllRestrictionTypes in interface CMSAdminRestrictionServicenullpublic CMSCatalogRestrictionModel createCatalogRestriction(AbstractPageModel page, java.lang.String id, java.lang.String name, java.util.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, java.lang.String id, java.lang.String name, java.util.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, java.lang.String id, java.lang.String name, java.util.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 CMSAdminRestrictionServicepage - the page modelrestriction - the restriction modelpublic void createRelation(java.lang.String pageId,
java.lang.String restrictionId)
throws CMSItemNotFoundException
CMSAdminRestrictionServicecreateRelation in interface CMSAdminRestrictionServicepageId - the page idrestrictionId - the restriciton idCMSItemNotFoundException - if the page and/or restriction is not foundpublic CMSTimeRestrictionModel createTimeRestriction(AbstractPageModel page, java.lang.String id, java.lang.String name, java.util.Date from, java.util.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, java.lang.String id, java.lang.String name, java.util.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, java.lang.String id, java.lang.String name, java.util.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 CMSCampaignRestrictionModel createCampaignRestriction(AbstractPageModel page, java.lang.String id, java.lang.String name, java.util.Collection<CampaignModel> campaigns) throws CMSItemCreateException
CMSAdminRestrictionServicecreateCampaignRestriction in interface CMSAdminRestrictionServicepage - 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 createdpublic void deleteRelation(AbstractRestrictionModel restriction, AbstractPageModel page)
CMSAdminRestrictionServicedeleteRelation in interface CMSAdminRestrictionServicerestriction - the restriciton modelpage - the page modelpublic void deleteRelation(java.lang.String restrictionId,
java.lang.String pageId)
throws CMSItemNotFoundException
CMSAdminRestrictionServicedeleteRelation in interface CMSAdminRestrictionServicerestrictionId - the restriction idpageId - the page idCMSItemNotFoundException - if the restriction and/or page is not foundpublic java.util.Collection<RestrictionTypeModel> getAllowedRestrictionTypesForPage(AbstractPageModel page)
CMSAdminRestrictionServicegetAllowedRestrictionTypesForPage in interface CMSAdminRestrictionServicepage - the page modelpublic java.util.Collection<RestrictionTypeModel> getAllowedRestrictionTypesForPage(java.lang.String id) throws CMSItemNotFoundException
CMSAdminRestrictionServicegetAllowedRestrictionTypesForPage in interface CMSAdminRestrictionServiceid - id of pageCMSItemNotFoundException - if the page is not foundpublic java.util.Collection<AbstractRestrictionModel> getAllRestrictionsByType(java.lang.String restrictionType) throws CMSItemNotFoundException
CMSAdminRestrictionServicegetAllRestrictionsByType in interface CMSAdminRestrictionServicerestrictionType - ComposedType code of restrictionCMSItemNotFoundException - if the composed type is not foundpublic java.util.Collection<AbstractRestrictionModel> getAllRestrictionsByTypeNotLinkedToPage(java.lang.String pageId, java.lang.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 java.util.List<CategoryModel> getCategories(CMSCategoryRestrictionModel categoryRestriction, PreviewDataModel previewContext)
CMSAdminRestrictionServicegetCategories in interface CMSAdminRestrictionServicecategoryRestriction - given restrictionpreviewContext - preview context informationprotected void findCategoriesInLocalSession(PreviewDataModel previewContext, java.util.List<CategoryModel> ret, java.util.Collection<java.lang.String> categoryListCodes)
public java.util.List<ProductModel> getProducts(CMSProductRestrictionModel productRestriction, PreviewDataModel previewContext)
CMSAdminRestrictionServicegetProducts in interface CMSAdminRestrictionServiceproductRestriction - given restrictionpreviewContext - preview context informationprotected void findProductsInLocalSession(PreviewDataModel previewContext, java.util.List<ProductModel> ret, java.util.Collection<java.lang.String> productListCodes)
public AbstractRestrictionModel getRestriction(java.lang.String id) throws CMSItemNotFoundException
CMSAdminRestrictionServicegetRestriction in interface CMSAdminRestrictionServiceid - id of restrictionCMSItemNotFoundException - if no restriction with the given id is foundpublic java.util.List<AbstractRestrictionModel> getRestrictionsByName(java.lang.String name) throws CMSItemNotFoundException
CMSAdminRestrictionServicegetRestrictionsByName in interface CMSAdminRestrictionServicename - name of restrictionCMSItemNotFoundException - if no restriction with the given name is foundpublic java.util.Collection<AbstractRestrictionModel> getRestrictionsForPage(AbstractPageModel page, java.lang.String restrictionType) throws CMSItemNotFoundException
CMSAdminRestrictionServicegetRestrictionsForPage in interface CMSAdminRestrictionServicepage - the page modelrestrictionType - ComposedType code of restrictionCMSItemNotFoundException - if the page or the composed type is not foundpublic java.util.Collection<AbstractRestrictionModel> getRestrictionsForPage(java.lang.String id, java.lang.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 CMSAdminRestrictionServicerestriction - the restriciton modelpage - the page modelpublic boolean hasOtherRelations(java.lang.String restrictionId,
java.lang.String pageId)
throws CMSItemNotFoundException
CMSAdminRestrictionServicehasOtherRelations in interface CMSAdminRestrictionServicerestrictionId - the restriction idpageId - the page idCMSItemNotFoundException - if the restriction and/or page is not foundpublic java.util.Collection<AbstractRestrictionModel> getAllRestrictions()
CMSAdminRestrictionServicegetAllRestrictions in interface CMSAdminRestrictionServicenullpublic java.util.Collection<AbstractRestrictionModel> getRestrictionsForPage(AbstractPageModel page)
CMSAdminRestrictionServicegetRestrictionsForPage in interface CMSAdminRestrictionServicepage - - the page for which we want to retrieve restrictionsprotected CategoryService getCategoryService()
public void setCategoryService(CategoryService categoryService)
protected CMSAdminPageService getCmsAdminPageService()
public void setCmsAdminPageService(CMSAdminPageService cmsAdminPageService)
protected CMSRestrictionDao getCmsRestrictionDao()
public void setCmsRestrictionDao(CMSRestrictionDao cmsRestrictionDao)
protected CMSRestrictionService getCmsRestrictionService()
public void setCmsRestrictionService(CMSRestrictionService cmsRestrictionService)
protected CommonI18NService getCommonI18NService()
public void setCommonI18NService(CommonI18NService commonI18NService)
protected I18NService getI18nService()
public void setI18nService(I18NService i18nService)
protected ProductService getProductService()
public void setProductService(ProductService productService)
protected TypeService getTypeService()
public void setTypeService(TypeService typeService)
protected ComposedTypeModel getComposedTypeModel(java.lang.String composedType) throws CMSItemNotFoundException
CMSItemNotFoundExceptionprotected java.util.Locale getLocalLocale(PreviewDataModel previewContext)
protected UserModel getLocalUser(PreviewDataModel previewContext)
protected void prepareRestricion(AbstractRestrictionModel res, java.lang.String id, java.lang.String name) throws CMSItemCreateException
CMSItemCreateExceptionCopyright © 2018 SAP SE. All Rights Reserved.