public class DefaultCockpitCollectionService extends java.lang.Object implements CockpitCollectionService
CockpitCollectionService interface.| Constructor and Description |
|---|
DefaultCockpitCollectionService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addReadUser(PrincipalModel user,
CockpitObjectAbstractCollectionModel collection)
Allows given user to read given collection.
|
int |
addToCollection(CockpitObjectAbstractCollectionModel collModel,
java.util.List<ItemModel> elements)
|
void |
addWriteUser(PrincipalModel user,
CockpitObjectAbstractCollectionModel collection)
Allows given user to modify given collection.
|
CockpitObjectAbstractCollectionModel |
cloneCollection(CockpitObjectAbstractCollectionModel collection,
UserModel user)
Clones the given collection and assigns just cloned collection to the given user.
|
java.util.List<CockpitObjectAbstractCollectionModel> |
getCollectionsForUser(UserModel user)
Gets all collections for given user including the collections that given user has permission to read or write.
|
int |
getElementCount(CockpitObjectAbstractCollectionModel collection)
Gets the element count for the given collection.
|
java.util.List<ItemModel> |
getElements(CockpitObjectAbstractCollectionModel collModel,
int start,
int count)
Returns elements of the given object collection.
|
protected EnumerationService |
getEnumerationService() |
protected ModelService |
getModelService() |
protected CockpitObjectAbstractCollectionDao |
getObjectCollectionDao() |
java.util.List<CockpitObjectSpecialCollectionModel> |
getSpecialCollections(UserModel user,
java.lang.String collectionType)
Gets the special collections of the specified type that belongs to the given user.
|
java.util.List<CockpitObjectSpecialCollectionModel> |
getSpecialCollectionsForUser(UserModel user)
Gets the special collections for a given user.
|
boolean |
hasReadCollectionRight(PrincipalModel principal,
CockpitObjectAbstractCollectionModel collection)
Returns information whether the user can read collection.
|
boolean |
hasWriteCollectionRight(PrincipalModel principal,
CockpitObjectAbstractCollectionModel collection)
Returns information whether the user can modify collection.
|
boolean |
isInCollection(ItemModel object,
CockpitObjectAbstractCollectionModel collection)
Checks if the given element belongs to the specified collection.
|
int |
removeFromCollection(CockpitObjectAbstractCollectionModel collectionModel,
java.util.List<ItemModel> elements)
|
int |
removeNullItemReferences(CockpitObjectAbstractCollectionModel collModel)
Removes references to non-existing items
|
void |
removeReadUser(PrincipalModel user,
CockpitObjectAbstractCollectionModel collection)
Disallow given user to read given collection.
|
void |
removeWriteUser(PrincipalModel user,
CockpitObjectAbstractCollectionModel collection)
Disallow given user to modify given collection.
|
void |
setEnumerationService(EnumerationService enumerationService) |
void |
setModelService(ModelService modelService) |
void |
setObjectCollectionDao(CockpitObjectAbstractCollectionDao objectCollectionDao) |
protected CockpitObjectAbstractCollectionModel |
unmapToModel(ObjectCollection collection) |
public int addToCollection(CockpitObjectAbstractCollectionModel collModel, java.util.List<ItemModel> elements)
addToCollection in interface CockpitCollectionServicecollModel - the collection to which elements are to be addedelements - the elements to addpublic int removeFromCollection(CockpitObjectAbstractCollectionModel collectionModel, java.util.List<ItemModel> elements)
removeFromCollection in interface CockpitCollectionServicecollectionModel - the collection from which elements are to be removedelements - the elements to removepublic java.util.List<ItemModel> getElements(CockpitObjectAbstractCollectionModel collModel, int start, int count)
getElements in interface CockpitCollectionServicecollModel - the object collection to search elements ofstart - starting index of the searchcount - max. count of elements to be foundpublic int removeNullItemReferences(CockpitObjectAbstractCollectionModel collModel)
removeNullItemReferences in interface CockpitCollectionServicecollModel - the object collection to search elements ofpublic int getElementCount(CockpitObjectAbstractCollectionModel collection)
getElementCount in interface CockpitCollectionServicecollection - the collectionpublic CockpitObjectAbstractCollectionModel cloneCollection(CockpitObjectAbstractCollectionModel collection, UserModel user)
cloneCollection in interface CockpitCollectionServicecollection - the collection to cloneuser - the user - clonned collection ownerpublic java.util.List<CockpitObjectAbstractCollectionModel> getCollectionsForUser(UserModel user)
getCollectionsForUser in interface CockpitCollectionServiceuser - the userpublic java.util.List<CockpitObjectSpecialCollectionModel> getSpecialCollectionsForUser(UserModel user)
getSpecialCollectionsForUser in interface CockpitCollectionServiceuser - the userpublic java.util.List<CockpitObjectSpecialCollectionModel> getSpecialCollections(UserModel user, java.lang.String collectionType)
getSpecialCollections in interface CockpitCollectionServiceuser - the usercollectionType - the collection typepublic boolean hasReadCollectionRight(PrincipalModel principal, CockpitObjectAbstractCollectionModel collection)
hasReadCollectionRight in interface CockpitCollectionServiceprincipal - the requested principalcollection - the requested collectionpublic boolean hasWriteCollectionRight(PrincipalModel principal, CockpitObjectAbstractCollectionModel collection)
hasWriteCollectionRight in interface CockpitCollectionServiceprincipal - the requested principalcollection - the requested collectionpublic boolean isInCollection(ItemModel object, CockpitObjectAbstractCollectionModel collection)
isInCollection in interface CockpitCollectionServiceobject - the objectcollection - the collectionpublic void addReadUser(PrincipalModel user, CockpitObjectAbstractCollectionModel collection)
addReadUser in interface CockpitCollectionServiceuser - to add read accesscollection - to add read accesspublic void addWriteUser(PrincipalModel user, CockpitObjectAbstractCollectionModel collection)
addWriteUser in interface CockpitCollectionServiceuser - to add write accesscollection - to add write accesspublic void removeReadUser(PrincipalModel user, CockpitObjectAbstractCollectionModel collection)
removeReadUser in interface CockpitCollectionServiceuser - to remove read accesscollection - to remove read accesspublic void removeWriteUser(PrincipalModel user, CockpitObjectAbstractCollectionModel collection)
removeWriteUser in interface CockpitCollectionServiceuser - to remove write accesscollection - to remove write accessprotected CockpitObjectAbstractCollectionModel unmapToModel(ObjectCollection collection)
protected CockpitObjectAbstractCollectionDao getObjectCollectionDao()
public void setObjectCollectionDao(CockpitObjectAbstractCollectionDao objectCollectionDao)
protected EnumerationService getEnumerationService()
public void setEnumerationService(EnumerationService enumerationService)
protected ModelService getModelService()
public void setModelService(ModelService modelService)
Copyright © 2018 SAP SE. All Rights Reserved.