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 Detail

      • createCollection

        @Deprecated
        ObjectCollection createCollection​(java.lang.String qualifier,
                                          UserModel user)
        Deprecated.
        since 6.3, use ModelService to create items
        Creates the collection for the given parameters.
        Parameters:
        qualifier - the qualifier
        user - 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, use ModelService to create items
        Creates the special collection with the collection type set to null.
        Parameters:
        qualifier - the qualifier
        user - 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, use ModelService to create items
        Creates the special collection for the given parameters.
        Parameters:
        qualifier - the qualifier
        user - the user that created collection will belong to
        collectionType - 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, use ModelService to create items
        Creates the special collection for the given parameters.
        Parameters:
        qualifier - the qualifier
        user - the user that created collection will belong to
        collectionType - 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 rename
        label - the new collection label
      • removeCollection

        @Deprecated
        void removeCollection​(ObjectCollection collection)
        Deprecated.
        since 6.3, use ModelService to remove items
        Removes the collection from the system.
        Parameters:
        collection - the collection to remove
      • addToCollection

        int addToCollection​(ObjectCollection collection,
                            java.util.Collection<TypedObject> elements)
        Adds the elements contained in elements to the ObjectCollection collection.
        Parameters:
        collection - the collection to which elements are to be added
        elements - the elements to add
        Returns:
        the number of elements actually added to the collection.
      • removeFromCollection

        int removeFromCollection​(ObjectCollection collection,
                                 java.util.Collection<TypedObject> elements)
        Removes the elements contained in elements from the ObjectCollection collection
        Parameters:
        collection - the collection from which elements are to be removed
        elements - 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 of
        start - starting index of the search
        count - 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 clone
        user - the user - clonned collection owner
        Returns:
        the just cloned collection
      • 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
      • 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 user
        collectionType - the collection type
        Returns:
        the special collections
      • refreshCollection

        @Deprecated
        ObjectCollection refreshCollection​(ObjectCollection collection)
        Deprecated.
        since 6.3, use local refreshing if required
        Removes all not existing items from the collection.
        Parameters:
        collection - given collection
        Returns:
        refreshed collection
      • getReadUsers

        @Deprecated
        java.util.List<PrincipalModel> getReadUsers​(ObjectCollection collection)
        Deprecated.
        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
      • 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.
        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
      • 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 principal
        collection - 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 principal
        collection - the requested collection
        Returns:
        the boolean
      • isCollectionOwner

        @Deprecated
        java.lang.Boolean isCollectionOwner​(PrincipalModel principal,
                                            ObjectCollection collection)
        Deprecated.
        since 6.3, use local check when required
        Checks if given collection belongs to the given user.
        Parameters:
        principal - the principal
        collection - 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 object
        collection - 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 access
        collection - to add read access
      • addWriteUser

        void addWriteUser​(PrincipalModel user,
                          ObjectCollection collection)
        Allows given user to modify given collection.
        Parameters:
        user - to add write access
        collection - to add write access
      • removeReadUser

        void removeReadUser​(PrincipalModel user,
                            ObjectCollection collection)
        Disallow given user to read given collection.
        Parameters:
        user - to remove read access
        collection - to remove read access
      • removeWriteUser

        void removeWriteUser​(PrincipalModel user,
                             ObjectCollection collection)
        Disallow given user to modify given collection.
        Parameters:
        user - to remove write access
        collection - to remove write access