Exemple #1
0
 private void addUserTagSubjectToList(
     List<TagAssertion> tagAssertions, List<UserTag> userTags, int ignoreTagId) {
   for (Iterator<TagAssertion> it = tagAssertions.iterator(); it.hasNext(); ) {
     TagAssertion ta = it.next();
     UserTag ut = ta.getSubject();
     if (ut != null) {
       if (ut.getId() != ignoreTagId && userTags.contains(ut) == false) {
         userTags.add(ut);
       }
     } else {
       logger.error("addUserTagSubjectToList() finds TagAssertion.getSubject() to return NULL.");
     }
   }
 }
Exemple #2
0
 public Map<String, List<UserTag>> getRDFTypeTagGroups(User user) throws NoSuchUserException {
   GnizrDaoUtil.fillId(userDao, user);
   Map<String, List<UserTag>> map = new HashMap<String, List<UserTag>>();
   List<TagAssertion> result = tagAssertionDao.findTagAssertion(user, null, rdfTypePrpt, null);
   for (TagAssertion t : result) {
     String tagGroupName = t.getObject().getTag().getLabel();
     List<UserTag> memberList = map.get(tagGroupName);
     if (memberList == null) {
       memberList = new ArrayList<UserTag>();
       map.put(tagGroupName, memberList);
     }
     memberList.add(t.getSubject());
   }
   return map;
 }