Interface ObjectCollectionService
-
- All Known Implementing Classes:
ObjectCollectionServiceImpl
public interface ObjectCollectionService
Service that contains method to deal with cockpit collections in web layer. For general use in model layer useCockpitCollectionService
instead. In this service there should be only method specific for the current cockpit - like filtering collection elements by type, or dealing withObjectCollection
orTypedObject
elements.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method 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)
Deprecated.since 6.3, useModelService
to create itemsObjectCollection
createSpecialCollection(java.lang.String qualifier, UserModel user)
Deprecated.since 6.3, useModelService
to create itemsObjectCollection
createSpecialCollection(java.lang.String qualifier, UserModel user, HybrisEnumValue collectionType)
Deprecated.since 6.3, useModelService
to create itemsObjectCollection
createSpecialCollection(java.lang.String qualifier, UserModel user, EnumerationValue collectionType)
Deprecated.since 6.3, useModelService
to create itemsjava.util.List<ObjectCollection>
getCollections(UserModel user)
Deprecated.since 6.3, usegetCollectionsForUser(UserModel)
insteadjava.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.java.util.List<PrincipalModel>
getReadUsers(ObjectCollection collection)
Deprecated.since 6.3, usegetReadUsersForCollection(ObjectCollection)
insteadjava.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)
Deprecated.since 6.3, usegetSpecialCollectionsForUser(UserModel)
insteadjava.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)
Deprecated.since 6.3, usegetWriteUsersForCollection(ObjectCollection)
insteadjava.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)
Deprecated.since 6.3, use local check when requiredjava.lang.Boolean
isInCollection(TypedObject object, ObjectCollection collection)
Checks if the given element belongs to the specified collection.void
publishCollection(ObjectCollection collection)
Sets the collection's owner to null, so it can be accessed by any user.ObjectCollection
refreshCollection(ObjectCollection collection)
Deprecated.since 6.3, use local refreshing if requiredvoid
removeCollection(ObjectCollection collection)
Deprecated.since 6.3, useModelService
to remove itemsint
removeFromCollection(ObjectCollection collection, java.util.Collection<TypedObject> elements)
int
removeNullItemReferences(ObjectCollection collection)
Removes references to non-existing itemsvoid
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.
-
-
-
Method Detail
-
createCollection
@Deprecated ObjectCollection createCollection(java.lang.String qualifier, UserModel user)
Deprecated.since 6.3, useModelService
to create itemsCreates the collection for the given parameters.- Parameters:
qualifier
- the qualifieruser
- the user that created collection will belong to- Returns:
- the created object collection
-
createSpecialCollection
@Deprecated ObjectCollection createSpecialCollection(java.lang.String qualifier, UserModel user)
Deprecated.since 6.3, useModelService
to create itemsCreates the special collection with the collection type set to null.- Parameters:
qualifier
- the qualifieruser
- the user that created collection will belong to- Returns:
- the object collection
-
createSpecialCollection
@Deprecated ObjectCollection createSpecialCollection(java.lang.String qualifier, UserModel user, EnumerationValue collectionType)
Deprecated.since 6.3, useModelService
to create itemsCreates the special collection for the given parameters.- Parameters:
qualifier
- the qualifieruser
- the user that created collection will belong tocollectionType
- the collection type (quickcollection, blacklist, clipboard, etc)- Returns:
- the object collection
-
createSpecialCollection
@Deprecated ObjectCollection createSpecialCollection(java.lang.String qualifier, UserModel user, HybrisEnumValue collectionType)
Deprecated.since 6.3, useModelService
to create itemsCreates the special collection for the given parameters.- Parameters:
qualifier
- the qualifieruser
- the user that created collection will belong tocollectionType
- the collection type (quickcollection, blacklist, clipboard, etc)- Returns:
- the object collection
-
renameCollection
void renameCollection(ObjectCollection collection, java.lang.String label)
Renames the collection with the specified label.- Parameters:
collection
- the collection to renamelabel
- the new collection label
-
removeCollection
@Deprecated void removeCollection(ObjectCollection collection)
Deprecated.since 6.3, useModelService
to remove itemsRemoves the collection from the system.- Parameters:
collection
- the collection to remove
-
addToCollection
int addToCollection(ObjectCollection collection, java.util.Collection<TypedObject> elements)
- Parameters:
collection
- the collection to which elements are to be addedelements
- the elements to add- Returns:
- the number of elements actually added to the collection.
-
removeFromCollection
int removeFromCollection(ObjectCollection collection, java.util.Collection<TypedObject> elements)
- Parameters:
collection
- the collection from which elements are to be removedelements
- the elements to remove- Returns:
- the number of elements actually removed from the collection.
-
getElements
java.util.List<TypedObject> getElements(ObjectCollection collection, int start, int count)
Returns elements of the given object collection.- Parameters:
collection
- the object collection to search elements ofstart
- starting index of the searchcount
- max. count of elements to be found- Returns:
- elements of the given object collection according to given offset and count
-
removeNullItemReferences
int removeNullItemReferences(ObjectCollection collection)
Removes references to non-existing items- Parameters:
collection
- the object collection to search elements of- Returns:
- the number of removed references
-
getElementCount
int getElementCount(ObjectCollection collection)
Gets the number of the elements in the given collection.- Parameters:
collection
- the collection- Returns:
- the element count
-
publishCollection
void publishCollection(ObjectCollection collection)
Sets the collection's owner to null, so it can be accessed by any user.- Parameters:
collection
- the collection to publish
-
cloneCollection
ObjectCollection cloneCollection(ObjectCollection collection, UserModel user)
Clones the given collection and assigns just cloned collection to the given user.- Parameters:
collection
- the collection to cloneuser
- the user - clonned collection owner- Returns:
- the just cloned collection
-
getCollections
@Deprecated java.util.List<ObjectCollection> getCollections(UserModel user)
Deprecated.since 6.3, usegetCollectionsForUser(UserModel)
insteadGets the collections.- Parameters:
user
- the user- Returns:
- the collections
-
getCollectionsForUser
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.- Parameters:
user
- the user- Returns:
- the collections for user
-
getSpecialCollections
@Deprecated java.util.List<ObjectCollection> getSpecialCollections(UserModel user)
Deprecated.since 6.3, usegetSpecialCollectionsForUser(UserModel)
insteadGets the special collections.- Parameters:
user
- the user- Returns:
- the special collections
-
getSpecialCollectionsForUser
java.util.List<ObjectCollection> getSpecialCollectionsForUser(UserModel user)
Gets the special collections for a given user.- Parameters:
user
- the user- Returns:
- the special collections for user
-
getSpecialCollections
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.- Parameters:
user
- the usercollectionType
- the collection type- Returns:
- the special collections
-
refreshCollection
@Deprecated ObjectCollection refreshCollection(ObjectCollection collection)
Deprecated.since 6.3, use local refreshing if requiredRemoves all not existing items from the collection.- Parameters:
collection
- given collection- Returns:
- refreshed collection
-
getReadUsers
@Deprecated java.util.List<PrincipalModel> getReadUsers(ObjectCollection collection)
Deprecated.since 6.3, usegetReadUsersForCollection(ObjectCollection)
insteadReturns list of all users who are allowed to read given collection.- Parameters:
collection
- the collection to check read access- Returns:
- user list of the users that are allowed to read from the given collection
-
getReadUsersForCollection
java.util.List<PrincipalModel> getReadUsersForCollection(ObjectCollection collection)
Returns list of all users who are allowed to read given collection.- Parameters:
collection
- the collection to check read access- Returns:
- user list of the users that are allowed to read from the given collection
-
getWriteUsers
@Deprecated java.util.List<PrincipalModel> getWriteUsers(ObjectCollection collection)
Deprecated.since 6.3, usegetWriteUsersForCollection(ObjectCollection)
insteadReturns list of all users who are allowed to modify given collection.- Parameters:
collection
- the collection to check write access- Returns:
- user list of the users that are allowed to modify the given collection
-
getWriteUsersForCollection
java.util.List<PrincipalModel> getWriteUsersForCollection(ObjectCollection collection)
Returns list of all users who are allowed to modify given collection.- Parameters:
collection
- the collection to check write access- Returns:
- user list of the users that are allowed to modify the given collection
-
hasReadCollectionRight
java.lang.Boolean hasReadCollectionRight(PrincipalModel principal, ObjectCollection collection)
Returns information whether the user can read collection.- Parameters:
principal
- the requested principalcollection
- the requested collection- Returns:
- the boolean
-
hasWriteCollectionRight
java.lang.Boolean hasWriteCollectionRight(PrincipalModel principal, ObjectCollection collection)
Returns information whether the user can modify collection.- Parameters:
principal
- the requested principalcollection
- the requested collection- Returns:
- the boolean
-
isCollectionOwner
@Deprecated java.lang.Boolean isCollectionOwner(PrincipalModel principal, ObjectCollection collection)
Deprecated.since 6.3, use local check when requiredChecks if given collection belongs to the given user.- Parameters:
principal
- the principalcollection
- the collection- Returns:
- true if the user is collection owner
-
isInCollection
java.lang.Boolean isInCollection(TypedObject object, ObjectCollection collection)
Checks if the given element belongs to the specified collection.- Parameters:
object
- the objectcollection
- the collection- Returns:
- true if given element is in the specified collection
-
addReadUser
void addReadUser(PrincipalModel user, ObjectCollection collection)
Allows given user to read given collection.- Parameters:
user
- to add read accesscollection
- to add read access
-
addWriteUser
void addWriteUser(PrincipalModel user, ObjectCollection collection)
Allows given user to modify given collection.- Parameters:
user
- to add write accesscollection
- to add write access
-
removeReadUser
void removeReadUser(PrincipalModel user, ObjectCollection collection)
Disallow given user to read given collection.- Parameters:
user
- to remove read accesscollection
- to remove read access
-
removeWriteUser
void removeWriteUser(PrincipalModel user, ObjectCollection collection)
Disallow given user to modify given collection.- Parameters:
user
- to remove write accesscollection
- to remove write access
-
-