Package org.exoplatform.task.util
Class FavoriteUtil
java.lang.Object
org.exoplatform.task.util.FavoriteUtil
-
Method Summary
Modifier and TypeMethodDescriptiongetFavoriteObjectIds(org.exoplatform.social.metadata.favorite.FavoriteService favoriteService, org.exoplatform.social.core.manager.IdentityManager identityManager, String objectType) Retrieves, in a single call, the ids of all the objects of the given type that the current authenticated user marked as favorite.static booleanisFavorite(org.exoplatform.social.metadata.favorite.FavoriteService favoriteService, org.exoplatform.social.core.manager.IdentityManager identityManager, String objectType, long objectId) Checks whether the current authenticated user has marked the given object as favorite.
-
Method Details
-
isFavorite
public static boolean isFavorite(org.exoplatform.social.metadata.favorite.FavoriteService favoriteService, org.exoplatform.social.core.manager.IdentityManager identityManager, String objectType, long objectId) Checks whether the current authenticated user has marked the given object as favorite.- Parameters:
favoriteService-FavoriteServiceidentityManager-IdentityManagerobjectType- favorite object type (e.g. project/task)objectId- object technical identifier- Returns:
- true if the current user marked the object as favorite
-
getFavoriteObjectIds
public static Set<String> getFavoriteObjectIds(org.exoplatform.social.metadata.favorite.FavoriteService favoriteService, org.exoplatform.social.core.manager.IdentityManager identityManager, String objectType) Retrieves, in a single call, the ids of all the objects of the given type that the current authenticated user marked as favorite. Meant to avoid oneFavoriteService.isFavorite(Favorite)call per row when enriching a list of objects with their favorite status.
-