Interface FavoriteService
-
public interface FavoriteService
-
-
Field Summary
Fields Modifier and Type Field Description static MetadataTypeMETADATA_TYPE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcreateFavorite(Favorite favorite)Create a new Favorite for corresponding object identified by its type/id for a uservoiddeleteFavorite(Favorite favorite)Deletes an existing Favorite for corresponding object identified by its type/id for a userList<MetadataItem>getFavoriteItemsByCreator(long creatorId, long offset, long limit)Retrieves the favorite items attached to a givenMetadataItemcreatorIdintgetFavoriteItemsSize(long creatorId)Count the favorite items attached to a givenMetadataItemcreatorIdbooleanisFavorite(Favorite favorite)Check if an object identified by its type/id for a user has favorite metadata or not
-
-
-
Field Detail
-
METADATA_TYPE
static final MetadataType METADATA_TYPE
-
-
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-Favoriteobject that has to define: - objectType object type, can be of any type: activity, comment, notes... - objectId object technical unique identifier - userIdentityIdIdentitytechnical 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 givenMetadataItemcreatorId- Parameters:
creatorId-MetadataItemcreatorIdoffset- offset of ids to retrievelimit- limit of ids to retrieve- Returns:
Listof linkedMetadataItem
-
getFavoriteItemsSize
int getFavoriteItemsSize(long creatorId)
Count the favorite items attached to a givenMetadataItemcreatorId- Parameters:
creatorId-MetadataItemcreatorId- 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-Favoriteobject that has to define: - objectType object type, can be of any type: activity, comment, notes... - objectId object technical unique identifier - userIdentityIdIdentitytechnical 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-Favoriteobject that has to define: - objectType object type, can be of any type: activity, comment, notes... - objectId object technical unique identifier - userIdentityIdIdentitytechnical identifier of the user- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the favorite doesn't exists
-
-