Interface FavoriteService


  • public interface FavoriteService
    • Method Detail

      • createFavorite

        void createFavorite​(Favorite favorite)
                     throws ObjectAlreadyExistsException
        Create a new Favorite for corresponding object identified by its type/id for a user
        Parameters:
        favorite - Favorite object that has to define: - objectType object type, can be of any type: activity, comment, notes... - objectId object technical unique identifier - userIdentityId Identity technical identifier of the user
        Throws:
        ObjectAlreadyExistsException - when the favorite already exists
      • getFavoriteItemsByCreator

        List<MetadataItem> getFavoriteItemsByCreator​(long creatorId,
                                                     long offset,
                                                     long limit)
        Retrieves the favorite items attached to a given MetadataItem creatorId
        Parameters:
        creatorId - MetadataItem creatorId
        offset - offset of ids to retrieve
        limit - limit of ids to retrieve
        Returns:
        List of linked MetadataItem
      • getFavoriteItemsSize

        int getFavoriteItemsSize​(long creatorId)
        Count the favorite items attached to a given MetadataItem creatorId
        Parameters:
        creatorId - MetadataItem creatorId
        Returns:
        integer
      • isFavorite

        boolean isFavorite​(Favorite favorite)
        Check if an object identified by its type/id for a user has favorite metadata or not
        Parameters:
        favorite - Favorite object that has to define: - objectType object type, can be of any type: activity, comment, notes... - objectId object technical unique identifier - userIdentityId Identity technical identifier of the user
        Throws:
        org.exoplatform.commons.exception.ObjectNotFoundException - when the favorite doesn't exists
      • deleteFavorite

        void deleteFavorite​(Favorite favorite)
                     throws org.exoplatform.commons.exception.ObjectNotFoundException
        Deletes an existing Favorite for corresponding object identified by its type/id for a user
        Parameters:
        favorite - Favorite object that has to define: - objectType object type, can be of any type: activity, comment, notes... - objectId object technical unique identifier - userIdentityId Identity technical identifier of the user
        Throws:
        org.exoplatform.commons.exception.ObjectNotFoundException - when the favorite doesn't exists