예제 #1
0
 /**
  * Utility helper for implementing getInterestedGroups() that returns a single-member set with the
  * group stored in data1.
  *
  * @param block
  * @return
  */
 protected Set<Group> getData1GroupAsSet(Block block) {
   Group group;
   try {
     group = EJBUtil.lookupGuid(em, Group.class, block.getData1AsGuid());
   } catch (NotFoundException e) {
     throw new RuntimeException(e);
   }
   return Collections.singleton(group);
 }
예제 #2
0
 protected User getData1User(Block block) {
   User user;
   try {
     user = EJBUtil.lookupGuid(em, User.class, block.getData1AsGuid());
   } catch (NotFoundException e) {
     throw new RuntimeException("invalid user in data1 of " + block, e);
   }
   return user;
 }
예제 #3
0
 /**
  * Utility helper for implementing getInterestedUsers() that gets everyone in the group identified
  * by the group id in data1.
  *
  * @param block
  * @return
  */
 protected final Set<User> getUsersWhoCareAboutData1Group(Block block) {
   Group group;
   try {
     group = EJBUtil.lookupGuid(em, Group.class, block.getData1AsGuid());
   } catch (NotFoundException e) {
     throw new RuntimeException("invalid group in data1 of " + block, e);
   }
   Set<User> groupMembers = groupSystem.getUserMembers(SystemViewpoint.getInstance(), group);
   return groupMembers;
 }