public class ObjectCollectionServiceImpl extends AbstractServiceImpl implements ObjectCollectionService
ObjectCollectionService interface.| Modifier and Type | Field and Description |
|---|---|
protected CockpitObjectAbstractCollectionDao |
objectCollectionDao |
modelService, typeService| Constructor and Description |
|---|
ObjectCollectionServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addReadUser(PrincipalModel user,
ObjectCollection collection)
Allows given user to read given collection.
|
int |
addToCollection(ObjectCollection collection,
java.util.Collection<TypedObject> elements)
|
void |
addWriteUser(PrincipalModel user,
ObjectCollection collection)
Allows given user to modify given collection.
|
ObjectCollection |
cloneCollection(ObjectCollection collection,
UserModel user)
Clones the given collection and assigns just cloned collection to the given user.
|
ObjectCollection |
createCollection(java.lang.String qualifier,
UserModel user)
Creates the collection for the given parameters.
|
ObjectCollection |
createSpecialCollection(java.lang.String qualifier,
UserModel user)
Creates the special collection with the collection type set to null.
|
ObjectCollection |
createSpecialCollection(java.lang.String qualifier,
UserModel user,
EnumerationValue collectionType)
Creates the special collection for the given parameters.
|
ObjectCollection |
createSpecialCollection(java.lang.String qualifier,
UserModel user,
HybrisEnumValue collectionType)
Creates the special collection for the given parameters.
|
protected CockpitCollectionService |
getCockpitCollectionService() |
java.util.List<ObjectCollection> |
getCollections(UserModel user)
Gets the collections.
|
java.util.List<ObjectCollection> |
getCollectionsForUser(UserModel user)
Gets all collections for given user including the collections that given user has permission to read or write.
|
int |
getElementCount(ObjectCollection collection)
Gets the number of the elements in the given collection.
|
java.util.List<TypedObject> |
getElements(ObjectCollection collection,
int start,
int count)
Returns elements of the given object collection.
|
protected EnumerationService |
getEnumerationService() |
protected CockpitObjectAbstractCollectionDao |
getObjectCollectionDao() |
protected java.util.Set<java.lang.String> |
getObjectTypeFilterSet() |
java.util.List<PrincipalModel> |
getReadUsers(ObjectCollection collection)
Returns list of all users who are allowed to read given collection.
|
java.util.List<PrincipalModel> |
getReadUsersForCollection(ObjectCollection collection)
Returns list of all users who are allowed to read given collection.
|
java.util.List<ObjectCollection> |
getSpecialCollections(UserModel user)
Gets the special collections.
|
java.util.List<ObjectCollection> |
getSpecialCollections(UserModel user,
java.lang.String collectionType)
Gets the special collections of the specified type that belongs to the given user.
|
java.util.List<ObjectCollection> |
getSpecialCollectionsForUser(UserModel user)
Gets the special collections for a given user.
|
java.util.List<PrincipalModel> |
getWriteUsers(ObjectCollection collection)
Returns list of all users who are allowed to modify given collection.
|
java.util.List<PrincipalModel> |
getWriteUsersForCollection(ObjectCollection collection)
Returns list of all users who are allowed to modify given collection.
|
java.lang.Boolean |
hasReadCollectionRight(PrincipalModel principal,
ObjectCollection collection)
Returns information whether the user can read collection.
|
java.lang.Boolean |
hasWriteCollectionRight(PrincipalModel principal,
ObjectCollection collection)
Returns information whether the user can modify collection.
|
java.lang.Boolean |
isCollectionOwner(PrincipalModel principal,
ObjectCollection collection)
Checks if given collection belongs to the given user.
|
java.lang.Boolean |
isInCollection(TypedObject object,
ObjectCollection collection)
Checks if the given element belongs to the specified collection.
|
ObjectCollection |
mapCollection(CockpitObjectAbstractCollection source)
Deprecated.
since 6.3, use
mapCollection(CockpitObjectAbstractCollectionModel)
instead |
void |
publishCollection(ObjectCollection collection)
Sets the collection's owner to null, so it can be accessed by any user.
|
ObjectCollection |
refreshCollection(ObjectCollection collection)
Removes all not existing items from the collection.
|
void |
removeCollection(ObjectCollection collection)
Removes the collection from the system.
|
int |
removeFromCollection(ObjectCollection collection,
java.util.Collection<TypedObject> elements)
|
int |
removeNullItemReferences(ObjectCollection collection)
Removes references to non-existing items
|
void |
removeReadUser(PrincipalModel user,
ObjectCollection collection)
Disallow given user to read given collection.
|
void |
removeWriteUser(PrincipalModel user,
ObjectCollection collection)
Disallow given user to modify given collection.
|
void |
renameCollection(ObjectCollection collection,
java.lang.String label)
Renames the collection with the specified label.
|
void |
setCockpitCollectionService(CockpitCollectionService cockpitCollectionService) |
void |
setEnumerationService(EnumerationService enumerationService) |
void |
setObjectCollectionDao(CockpitObjectAbstractCollectionDao dao) |
void |
setObjectTypeFilterList(java.util.List<java.lang.String> objectTypeFilterList)
Sets the object type filter list.
|
protected CockpitObjectAbstractCollection |
unmapCollection(ObjectCollection collection)
Deprecated.
since 6.3, use
unmapToModel(ObjectCollection) instead |
protected CockpitObjectAbstractCollectionModel |
unmapToModel(ObjectCollection collection) |
getEnum, getEnums, getLocalizedLabel, getLocalizedLabel, getModelService, getTypeService, setCockpitTypeService, setLabelResolver, setModelServiceprotected CockpitObjectAbstractCollectionDao objectCollectionDao
public void addReadUser(PrincipalModel user, ObjectCollection collection)
addReadUser in interface ObjectCollectionServiceuser - to add read accesscollection - to add read accesspublic int addToCollection(ObjectCollection collection, java.util.Collection<TypedObject> elements) throws java.lang.IllegalStateException
addToCollection in interface ObjectCollectionServicecollection - the collection to which elements are to be addedelements - the elements to addjava.lang.IllegalStateExceptionpublic java.util.List<TypedObject> getElements(ObjectCollection collection, int start, int count)
getElements in interface ObjectCollectionServicecollection - the object collection to search elements ofstart - starting index of the searchcount - max. count of elements to be foundpublic int removeNullItemReferences(ObjectCollection collection)
removeNullItemReferences in interface ObjectCollectionServicecollection - the object collection to search elements ofpublic int getElementCount(ObjectCollection collection)
getElementCount in interface ObjectCollectionServicecollection - the collectionpublic void addWriteUser(PrincipalModel user, ObjectCollection collection)
addWriteUser in interface ObjectCollectionServiceuser - to add write accesscollection - to add write accesspublic ObjectCollection cloneCollection(ObjectCollection collection, UserModel user)
cloneCollection in interface ObjectCollectionServicecollection - the collection to cloneuser - the user - clonned collection ownerpublic ObjectCollection createCollection(java.lang.String qualifier, UserModel user)
createCollection in interface ObjectCollectionServicequalifier - the qualifieruser - the user that created collection will belong topublic ObjectCollection createSpecialCollection(java.lang.String qualifier, UserModel user)
createSpecialCollection in interface ObjectCollectionServicequalifier - the qualifieruser - the user that created collection will belong topublic ObjectCollection createSpecialCollection(java.lang.String qualifier, UserModel user, EnumerationValue collectionType)
ObjectCollectionServicecreateSpecialCollection in interface ObjectCollectionServicequalifier - the qualifieruser - the user that created collection will belong tocollectionType - the collection type (quickcollection, blacklist, clipboard, etc)public ObjectCollection createSpecialCollection(java.lang.String qualifier, UserModel user, HybrisEnumValue collectionType)
createSpecialCollection in interface ObjectCollectionServicequalifier - the qualifieruser - the user that created collection will belong tocollectionType - the collection type (quickcollection, blacklist, clipboard, etc)public java.util.List<ObjectCollection> getCollections(UserModel user)
ObjectCollectionServicegetCollections in interface ObjectCollectionServiceuser - the userpublic java.util.List<PrincipalModel> getReadUsers(ObjectCollection collection)
ObjectCollectionServicegetReadUsers in interface ObjectCollectionServicecollection - the collection to check read accesspublic java.util.List<ObjectCollection> getSpecialCollections(UserModel user)
ObjectCollectionServicegetSpecialCollections in interface ObjectCollectionServiceuser - the userpublic java.util.List<ObjectCollection> getSpecialCollections(UserModel user, java.lang.String collectionType)
getSpecialCollections in interface ObjectCollectionServiceuser - the usercollectionType - the collection typepublic java.util.List<PrincipalModel> getWriteUsers(ObjectCollection collection)
ObjectCollectionServicegetWriteUsers in interface ObjectCollectionServicecollection - the collection to check write accesspublic java.lang.Boolean isCollectionOwner(PrincipalModel principal, ObjectCollection collection)
isCollectionOwner in interface ObjectCollectionServiceprincipal - the principalcollection - the collectionpublic java.lang.Boolean hasWriteCollectionRight(PrincipalModel principal, ObjectCollection collection)
hasWriteCollectionRight in interface ObjectCollectionServiceprincipal - the requested principalcollection - the requested collectionpublic java.lang.Boolean hasReadCollectionRight(PrincipalModel principal, ObjectCollection collection)
hasReadCollectionRight in interface ObjectCollectionServiceprincipal - the requested principalcollection - the requested collection@Deprecated public ObjectCollection mapCollection(CockpitObjectAbstractCollection source)
mapCollection(CockpitObjectAbstractCollectionModel)
insteadpublic void publishCollection(ObjectCollection collection)
publishCollection in interface ObjectCollectionServicecollection - the collection to publishpublic ObjectCollection refreshCollection(ObjectCollection collection)
refreshCollection in interface ObjectCollectionServicecollection - given collectionpublic java.lang.Boolean isInCollection(TypedObject object, ObjectCollection collection)
isInCollection in interface ObjectCollectionServiceobject - the objectcollection - the collectionpublic void removeCollection(ObjectCollection collection)
removeCollection in interface ObjectCollectionServicecollection - the collection to removepublic int removeFromCollection(ObjectCollection collection, java.util.Collection<TypedObject> elements)
removeFromCollection in interface ObjectCollectionServicecollection - the collection from which elements are to be removedelements - the elements to removepublic void removeReadUser(PrincipalModel user, ObjectCollection collection)
removeReadUser in interface ObjectCollectionServiceuser - to remove read accesscollection - to remove read accesspublic void removeWriteUser(PrincipalModel user, ObjectCollection collection)
removeWriteUser in interface ObjectCollectionServiceuser - to remove write accesscollection - to remove write accesspublic void renameCollection(ObjectCollection collection, java.lang.String label)
renameCollection in interface ObjectCollectionServicecollection - the collection to renamelabel - the new collection labelpublic void setObjectTypeFilterList(java.util.List<java.lang.String> objectTypeFilterList)
objectTypeFilterList - the objectTypeFilterList to setprotected java.util.Set<java.lang.String> getObjectTypeFilterSet()
@Deprecated protected CockpitObjectAbstractCollection unmapCollection(ObjectCollection collection)
unmapToModel(ObjectCollection) insteadprotected CockpitObjectAbstractCollectionModel unmapToModel(ObjectCollection collection)
public void setObjectCollectionDao(CockpitObjectAbstractCollectionDao dao)
protected CockpitObjectAbstractCollectionDao getObjectCollectionDao()
protected EnumerationService getEnumerationService()
public void setEnumerationService(EnumerationService enumerationService)
protected CockpitCollectionService getCockpitCollectionService()
public void setCockpitCollectionService(CockpitCollectionService cockpitCollectionService)
public java.util.List<ObjectCollection> getCollectionsForUser(UserModel user)
getCollectionsForUser in interface ObjectCollectionServiceuser - the userpublic java.util.List<ObjectCollection> getSpecialCollectionsForUser(UserModel user)
getSpecialCollectionsForUser in interface ObjectCollectionServiceuser - the userpublic java.util.List<PrincipalModel> getReadUsersForCollection(ObjectCollection collection)
getReadUsersForCollection in interface ObjectCollectionServicecollection - the collection to check read accesspublic java.util.List<PrincipalModel> getWriteUsersForCollection(ObjectCollection collection)
getWriteUsersForCollection in interface ObjectCollectionServicecollection - the collection to check write accessCopyright © 2018 SAP SE. All Rights Reserved.