Class FavoriteUtil

java.lang.Object
org.exoplatform.task.util.FavoriteUtil

public final class FavoriteUtil extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 - FavoriteService
      identityManager - IdentityManager
      objectType - 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 one FavoriteService.isFavorite(Favorite) call per row when enriching a list of objects with their favorite status.
      Parameters:
      favoriteService - FavoriteService
      identityManager - IdentityManager
      objectType - favorite object type (e.g. project/task)
      Returns:
      Set of favorite object ids (as String) for the current user