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 use
CockpitCollectionService instead. In this service there should be only method specific for the current
cockpit - like filtering collection elements by type, or dealing with ObjectCollection or TypedObject
elements.-
Method Summary
Modifier and TypeMethodDescriptionvoidaddReadUser(PrincipalModel user, ObjectCollection collection) Allows given user to read given collection.intaddToCollection(ObjectCollection collection, Collection<TypedObject> elements) voidaddWriteUser(PrincipalModel user, ObjectCollection collection) Allows given user to modify given collection.cloneCollection(ObjectCollection collection, UserModel user) Clones the given collection and assigns just cloned collection to the given user.createCollection(String qualifier, UserModel user) Deprecated.createSpecialCollection(String qualifier, UserModel user) Deprecated.since 6.3, useModelServiceto create itemscreateSpecialCollection(String qualifier, UserModel user, HybrisEnumValue collectionType) Deprecated.since 6.3, useModelServiceto create itemscreateSpecialCollection(String qualifier, UserModel user, EnumerationValue collectionType) Deprecated.since 6.3, useModelServiceto create itemsgetCollections(UserModel user) Deprecated.since 6.3, usegetCollectionsForUser(UserModel)insteadGets all collections for given user including the collections that given user has permission to read or write.intgetElementCount(ObjectCollection collection) Gets the number of the elements in the given collection.getElements(ObjectCollection collection, int start, int count) Returns elements of the given object collection.getReadUsers(ObjectCollection collection) Deprecated.since 6.3, usegetReadUsersForCollection(ObjectCollection)insteadgetReadUsersForCollection(ObjectCollection collection) Returns list of all users who are allowed to read given collection.Deprecated.since 6.3, usegetSpecialCollectionsForUser(UserModel)insteadgetSpecialCollections(UserModel user, String collectionType) Gets the special collections of the specified type that belongs to the given user.Gets the special collections for a given user.getWriteUsers(ObjectCollection collection) Deprecated.since 6.3, usegetWriteUsersForCollection(ObjectCollection)insteadgetWriteUsersForCollection(ObjectCollection collection) Returns list of all users who are allowed to modify given collection.hasReadCollectionRight(PrincipalModel principal, ObjectCollection collection) Returns information whether the user can read collection.hasWriteCollectionRight(PrincipalModel principal, ObjectCollection collection) Returns information whether the user can modify collection.isCollectionOwner(PrincipalModel principal, ObjectCollection collection) Deprecated.since 6.3, use local check when requiredisInCollection(TypedObject object, ObjectCollection collection) Checks if the given element belongs to the specified collection.voidpublishCollection(ObjectCollection collection) Sets the collection's owner to null, so it can be accessed by any user.refreshCollection(ObjectCollection collection) Deprecated.since 6.3, use local refreshing if requiredvoidremoveCollection(ObjectCollection collection) Deprecated.since 6.3, useModelServiceto remove itemsintremoveFromCollection(ObjectCollection collection, Collection<TypedObject> elements) intremoveNullItemReferences(ObjectCollection collection) Removes references to non-existing itemsvoidremoveReadUser(PrincipalModel user, ObjectCollection collection) Disallow given user to read given collection.voidremoveWriteUser(PrincipalModel user, ObjectCollection collection) Disallow given user to modify given collection.voidrenameCollection(ObjectCollection collection, String label) Renames the collection with the specified label.
-
Method Details
-
createCollection
Deprecated.since 6.3, useModelServiceto 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.since 6.3, useModelServiceto 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(String qualifier, UserModel user, EnumerationValue collectionType) Deprecated.since 6.3, useModelServiceto 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(String qualifier, UserModel user, HybrisEnumValue collectionType) Deprecated.since 6.3, useModelServiceto 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
Renames the collection with the specified label.- Parameters:
collection- the collection to renamelabel- the new collection label
-
removeCollection
Deprecated.since 6.3, useModelServiceto remove itemsRemoves the collection from the system.- Parameters:
collection- the collection to remove
-
addToCollection
- 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
- 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
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
Removes references to non-existing items- Parameters:
collection- the object collection to search elements of- Returns:
- the number of removed references
-
getElementCount
Gets the number of the elements in the given collection.- Parameters:
collection- the collection- Returns:
- the element count
-
publishCollection
Sets the collection's owner to null, so it can be accessed by any user.- Parameters:
collection- the collection to publish
-
cloneCollection
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.since 6.3, usegetCollectionsForUser(UserModel)insteadGets the collections.- Parameters:
user- the user- Returns:
- the collections
-
getCollectionsForUser
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.since 6.3, usegetSpecialCollectionsForUser(UserModel)insteadGets the special collections.- Parameters:
user- the user- Returns:
- the special collections
-
getSpecialCollectionsForUser
Gets the special collections for a given user.- Parameters:
user- the user- Returns:
- the special collections for user
-
getSpecialCollections
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.since 6.3, use local refreshing if requiredRemoves all not existing items from the collection.- Parameters:
collection- given collection- Returns:
- refreshed collection
-
getReadUsers
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
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.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
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
Returns information whether the user can read collection.- Parameters:
principal- the requested principalcollection- the requested collection- Returns:
- the boolean
-
hasWriteCollectionRight
Returns information whether the user can modify collection.- Parameters:
principal- the requested principalcollection- the requested collection- Returns:
- the boolean
-
isCollectionOwner
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
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
Allows given user to read given collection.- Parameters:
user- to add read accesscollection- to add read access
-
addWriteUser
Allows given user to modify given collection.- Parameters:
user- to add write accesscollection- to add write access
-
removeReadUser
Disallow given user to read given collection.- Parameters:
user- to remove read accesscollection- to remove read access
-
removeWriteUser
Disallow given user to modify given collection.- Parameters:
user- to remove write accesscollection- to remove write access
-
ModelServiceto create items