Exemplo n.º 1
0
  public static List<Group> getFavoriteSitesGroups(long userId, String name, int start, int end)
      throws Exception {

    List<Object[]> favoriteSites =
        FavoriteSiteLocalServiceUtil.getFavoriteSites(userId, name, start, end);

    List<Group> groups = new ArrayList<Group>(favoriteSites.size());

    for (Object[] favoriteSite : favoriteSites) {
      long curUserId = (Long) favoriteSite[0];
      long groupId = (Long) favoriteSite[1];

      try {
        groups.add(GroupServiceUtil.getGroup(groupId));
      } catch (Exception e) {
        FavoriteSiteLocalServiceUtil.deleteFavoriteSite(curUserId, groupId);
      }
    }

    return groups;
  }
Exemplo n.º 2
0
  public static int getFavoriteSitesGroupsCount(long userId, String name) throws Exception {

    return FavoriteSiteLocalServiceUtil.getFavoriteSitesCount(userId, name);
  }