Interface FavoriteService
public interface FavoriteService
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddFavoriteACLPlugin(FavoriteACLPlugin favoriteACLPlugin) Add a favorite ACL pluginsdefault booleancanCreateFavorite(org.exoplatform.services.security.Identity userIdentity, String entityType, String entityId) Checks whether the user can mark an entity as favoritevoidcreateFavorite(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 usergetFavoriteItemsByCreator(long creatorId, long offset, long limit) Retrieves the favorite items attached to a givenMetadataItemcreatorIdgetFavoriteItemsByCreatorAndType(String objectType, long creatorId, long offset, long limit) Retrieves the favorite items attached to a givenMetadataItemcreatorId andMetadataObjecttypedefault List<MetadataItem>getFavoriteItemsByCreatorAndTypeAndSpaceId(String objectType, long creatorId, long spaceId, long offset, long limit) Retrieves the favorite items attached to a givenMetadataItemcreatorId andMetadataObjecttype andMetadataObjectspaceIdintgetFavoriteItemsSize(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 Details
-
METADATA_TYPE
-
-
Method Details
-
createFavorite
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
Retrieves the favorite items attached to a givenMetadataItemcreatorId- Parameters:
creatorId-MetadataItemcreatorIdoffset- offset of ids to retrievelimit- limit of ids to retrieve- Returns:
Listof linkedMetadataItem
-
getFavoriteItemsByCreatorAndType
List<MetadataItem> getFavoriteItemsByCreatorAndType(String objectType, long creatorId, long offset, long limit) Retrieves the favorite items attached to a givenMetadataItemcreatorId andMetadataObjecttype- Parameters:
objectType-MetadataObjecttypecreatorId-MetadataItemcreatorIdoffset- offset of ids to retrievelimit- limit of ids to retrieve- Returns:
Listof linkedMetadataItem
-
getFavoriteItemsByCreatorAndTypeAndSpaceId
default List<MetadataItem> getFavoriteItemsByCreatorAndTypeAndSpaceId(String objectType, long creatorId, long spaceId, long offset, long limit) Retrieves the favorite items attached to a givenMetadataItemcreatorId andMetadataObjecttype andMetadataObjectspaceId- Parameters:
objectType-MetadataObjecttypecreatorId-MetadataItemcreatorIdspaceId-MetadataItemspaceIdoffset- 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
Check if an object identified by its type/id for a user has favorite metadata or not -
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
-
canCreateFavorite
default boolean canCreateFavorite(org.exoplatform.services.security.Identity userIdentity, String entityType, String entityId) Checks whether the user can mark an entity as favorite- Parameters:
userIdentity- user identityentityType- object type, can be of any type: activity, comment, notes...entityId- object technical unique identifier- Returns:
- true if the user can mark entity as favorite, else false.
-
addFavoriteACLPlugin
Add a favorite ACL plugins
-