Class ObjectCollectionServiceImpl
java.lang.Object
de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
de.hybris.platform.cockpit.services.impl.ObjectCollectionServiceImpl
- All Implemented Interfaces:
ObjectCollectionService
public class ObjectCollectionServiceImpl
extends AbstractServiceImpl
implements ObjectCollectionService
Default implementation of the
ObjectCollectionService interface.-
Field Summary
FieldsFields inherited from class de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
modelService, typeService -
Constructor Summary
Constructors -
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) Creates the collection for the given parameters.createSpecialCollection(String qualifier, UserModel user) Creates the special collection with the collection type set to null.createSpecialCollection(String qualifier, UserModel user, HybrisEnumValue collectionType) Creates the special collection for the given parameters.createSpecialCollection(String qualifier, UserModel user, EnumerationValue collectionType) Creates the special collection for the given parameters.protected CockpitCollectionServicegetCollections(UserModel user) Gets the collections.Gets 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.protected EnumerationServiceprotected CockpitObjectAbstractCollectionDaogetReadUsers(ObjectCollection collection) Returns list of all users who are allowed to read given collection.getReadUsersForCollection(ObjectCollection collection) Returns list of all users who are allowed to read given collection.Gets the special collections.getSpecialCollections(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) Returns list of all users who are allowed to modify given collection.getWriteUsersForCollection(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) Checks if given collection belongs to the given user.isInCollection(TypedObject object, ObjectCollection collection) Checks if the given element belongs to the specified collection.Deprecated.voidpublishCollection(ObjectCollection collection) Sets the collection's owner to null, so it can be accessed by any user.refreshCollection(ObjectCollection collection) Removes all not existing items from the collection.voidremoveCollection(ObjectCollection collection) Removes the collection from the system.intremoveFromCollection(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.voidsetCockpitCollectionService(CockpitCollectionService cockpitCollectionService) voidsetEnumerationService(EnumerationService enumerationService) voidvoidsetObjectTypeFilterList(List<String> objectTypeFilterList) Sets the object type filter list.protected CockpitObjectAbstractCollectionunmapCollection(ObjectCollection collection) Deprecated.since 6.3, useunmapToModel(ObjectCollection)insteadprotected CockpitObjectAbstractCollectionModelunmapToModel(ObjectCollection collection) Methods inherited from class de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
getEnum, getEnums, getLocalizedLabel, getLocalizedLabel, getModelService, getTypeService, setCockpitTypeService, setLabelResolver, setModelService
-
Field Details
-
objectCollectionDao
-
-
Constructor Details
-
ObjectCollectionServiceImpl
public ObjectCollectionServiceImpl()
-
-
Method Details
-
addReadUser
Allows given user to read given collection.- Specified by:
addReadUserin interfaceObjectCollectionService- Parameters:
user- to add read accesscollection- to add read access
-
addToCollection
public int addToCollection(ObjectCollection collection, Collection<TypedObject> elements) throws IllegalStateException - Specified by:
addToCollectionin interfaceObjectCollectionService- 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.
- Throws:
IllegalStateException
-
getElements
Returns elements of the given object collection.- Specified by:
getElementsin interfaceObjectCollectionService- 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- Specified by:
removeNullItemReferencesin interfaceObjectCollectionService- 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.- Specified by:
getElementCountin interfaceObjectCollectionService- Parameters:
collection- the collection- Returns:
- the element count
-
addWriteUser
Allows given user to modify given collection.- Specified by:
addWriteUserin interfaceObjectCollectionService- Parameters:
user- to add write accesscollection- to add write access
-
cloneCollection
Clones the given collection and assigns just cloned collection to the given user.- Specified by:
cloneCollectionin interfaceObjectCollectionService- Parameters:
collection- the collection to cloneuser- the user - clonned collection owner- Returns:
- the just cloned collection
-
createCollection
Creates the collection for the given parameters.- Specified by:
createCollectionin interfaceObjectCollectionService- Parameters:
qualifier- the qualifieruser- the user that created collection will belong to- Returns:
- the created object collection
-
createSpecialCollection
Creates the special collection with the collection type set to null.- Specified by:
createSpecialCollectionin interfaceObjectCollectionService- Parameters:
qualifier- the qualifieruser- the user that created collection will belong to- Returns:
- the object collection
-
createSpecialCollection
public ObjectCollection createSpecialCollection(String qualifier, UserModel user, EnumerationValue collectionType) Description copied from interface:ObjectCollectionServiceCreates the special collection for the given parameters.- Specified by:
createSpecialCollectionin interfaceObjectCollectionService- Parameters:
qualifier- the qualifieruser- the user that created collection will belong tocollectionType- the collection type (quickcollection, blacklist, clipboard, etc)- Returns:
- the object collection
-
createSpecialCollection
public ObjectCollection createSpecialCollection(String qualifier, UserModel user, HybrisEnumValue collectionType) Creates the special collection for the given parameters.- Specified by:
createSpecialCollectionin interfaceObjectCollectionService- Parameters:
qualifier- the qualifieruser- the user that created collection will belong tocollectionType- the collection type (quickcollection, blacklist, clipboard, etc)- Returns:
- the object collection
-
getCollections
Description copied from interface:ObjectCollectionServiceGets the collections.- Specified by:
getCollectionsin interfaceObjectCollectionService- Parameters:
user- the user- Returns:
- the collections
-
getReadUsers
Description copied from interface:ObjectCollectionServiceReturns list of all users who are allowed to read given collection.- Specified by:
getReadUsersin interfaceObjectCollectionService- Parameters:
collection- the collection to check read access- Returns:
- user list of the users that are allowed to read from the given collection
-
getSpecialCollections
Description copied from interface:ObjectCollectionServiceGets the special collections.- Specified by:
getSpecialCollectionsin interfaceObjectCollectionService- Parameters:
user- the user- Returns:
- the special collections
-
getSpecialCollections
Gets the special collections of the specified type that belongs to the given user.- Specified by:
getSpecialCollectionsin interfaceObjectCollectionService- Parameters:
user- the usercollectionType- the collection type- Returns:
- the special collections
-
getWriteUsers
Description copied from interface:ObjectCollectionServiceReturns list of all users who are allowed to modify given collection.- Specified by:
getWriteUsersin interfaceObjectCollectionService- Parameters:
collection- the collection to check write access- Returns:
- user list of the users that are allowed to modify the given collection
-
isCollectionOwner
Checks if given collection belongs to the given user.- Specified by:
isCollectionOwnerin interfaceObjectCollectionService- Parameters:
principal- the principalcollection- the collection- Returns:
- true if the user is collection owner
-
hasWriteCollectionRight
Returns information whether the user can modify collection.- Specified by:
hasWriteCollectionRightin interfaceObjectCollectionService- Parameters:
principal- the requested principalcollection- the requested collection- Returns:
- the boolean
-
hasReadCollectionRight
Returns information whether the user can read collection.- Specified by:
hasReadCollectionRightin interfaceObjectCollectionService- Parameters:
principal- the requested principalcollection- the requested collection- Returns:
- the boolean
-
mapCollection
Deprecated.since 6.3, usemapCollection(CockpitObjectAbstractCollectionModel)instead -
publishCollection
Sets the collection's owner to null, so it can be accessed by any user.- Specified by:
publishCollectionin interfaceObjectCollectionService- Parameters:
collection- the collection to publish
-
refreshCollection
Removes all not existing items from the collection.- Specified by:
refreshCollectionin interfaceObjectCollectionService- Parameters:
collection- given collection- Returns:
- refreshed collection
-
isInCollection
Checks if the given element belongs to the specified collection.- Specified by:
isInCollectionin interfaceObjectCollectionService- Parameters:
object- the objectcollection- the collection- Returns:
- true if given element is in the specified collection
-
removeCollection
Removes the collection from the system.- Specified by:
removeCollectionin interfaceObjectCollectionService- Parameters:
collection- the collection to remove
-
removeFromCollection
- Specified by:
removeFromCollectionin interfaceObjectCollectionService- 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.
-
removeReadUser
Disallow given user to read given collection.- Specified by:
removeReadUserin interfaceObjectCollectionService- Parameters:
user- to remove read accesscollection- to remove read access
-
removeWriteUser
Disallow given user to modify given collection.- Specified by:
removeWriteUserin interfaceObjectCollectionService- Parameters:
user- to remove write accesscollection- to remove write access
-
renameCollection
Renames the collection with the specified label.- Specified by:
renameCollectionin interfaceObjectCollectionService- Parameters:
collection- the collection to renamelabel- the new collection label
-
setObjectTypeFilterList
Sets the object type filter list.- Parameters:
objectTypeFilterList- the objectTypeFilterList to set
-
getObjectTypeFilterSet
-
unmapCollection
Deprecated.since 6.3, useunmapToModel(ObjectCollection)instead -
unmapToModel
-
setObjectCollectionDao
-
getObjectCollectionDao
-
getEnumerationService
-
setEnumerationService
-
getCockpitCollectionService
-
setCockpitCollectionService
-
getCollectionsForUser
Gets all collections for given user including the collections that given user has permission to read or write.- Specified by:
getCollectionsForUserin interfaceObjectCollectionService- Parameters:
user- the user- Returns:
- the collections for user
-
getSpecialCollectionsForUser
Gets the special collections for a given user.- Specified by:
getSpecialCollectionsForUserin interfaceObjectCollectionService- Parameters:
user- the user- Returns:
- the special collections for user
-
getReadUsersForCollection
Returns list of all users who are allowed to read given collection.- Specified by:
getReadUsersForCollectionin interfaceObjectCollectionService- Parameters:
collection- the collection to check read access- Returns:
- user list of the users that are allowed to read from the given collection
-
getWriteUsersForCollection
Returns list of all users who are allowed to modify given collection.- Specified by:
getWriteUsersForCollectionin interfaceObjectCollectionService- Parameters:
collection- the collection to check write access- Returns:
- user list of the users that are allowed to modify the given collection
-
mapCollection(CockpitObjectAbstractCollectionModel)instead