Пример #1
0
 public List<UserTag> findSKOSNarrower(User user, UserTag userTag)
     throws NoSuchUserException, NoSuchTagException, NoSuchUserTagException, MissingIdException {
   logger.debug("findSKOSNarrower: user="******",userTag=" + userTag);
   if (GnizrDaoUtil.hasMissingId(user)) {
     GnizrDaoUtil.fillId(userDao, user);
   }
   if (GnizrDaoUtil.hasMissingId(userTag)) {
     GnizrDaoUtil.fillId(tagDao, userDao, userTag);
   }
   List<UserTag> result = new ArrayList<UserTag>();
   seekNarrower(user, userTag, result, userTag.getId());
   return result;
 }
Пример #2
0
 public List<UserTag> findUserTagInstance(User user, UserTag classTag)
     throws NoSuchUserException, NoSuchTagException, NoSuchUserTagException, MissingIdException {
   logger.debug("findUserTagInstance: user="******",classTag=" + classTag);
   if (GnizrDaoUtil.hasMissingId(user)) {
     GnizrDaoUtil.fillId(userDao, user);
   }
   if (GnizrDaoUtil.hasMissingId(classTag)) {
     GnizrDaoUtil.fillId(tagDao, userDao, classTag);
   }
   List<UserTag> instanceTag = new ArrayList<UserTag>();
   List<TagAssertion> asrts = tagAssertionDao.findTagAssertion(user, null, rdfTypePrpt, classTag);
   if (asrts != null && !asrts.isEmpty()) {
     addUserTagSubjectToList(asrts, instanceTag, classTag.getId());
   }
   return instanceTag;
 }
Пример #3
0
 public List<UserTag> findRDFType(User user, UserTag userTag)
     throws NoSuchUserException, NoSuchTagException, NoSuchUserTagException, MissingIdException {
   logger.debug("findRDFType: user="******",userTag=" + userTag);
   if (GnizrDaoUtil.hasMissingId(user)) {
     GnizrDaoUtil.fillId(userDao, user);
   }
   if (GnizrDaoUtil.hasMissingId(userTag)) {
     GnizrDaoUtil.fillId(tagDao, userDao, userTag);
   }
   List<TagAssertion> asrts = null;
   List<UserTag> classTags = new ArrayList<UserTag>();
   asrts = tagAssertionDao.findTagAssertion(user, userTag, rdfTypePrpt, null);
   if (asrts != null && !asrts.isEmpty()) {
     addUserTagObjectToList(asrts, classTags, -1);
   }
   return classTags;
 }
Пример #4
0
 public DaoResult<Bookmark> pageLinkHistory(Link link, int offset, int count)
     throws NoSuchLinkException {
   logger.debug("getHistory: link=" + link);
   GnizrDaoUtil.checkNull(link);
   Link aLink = new Link(link);
   GnizrDaoUtil.fillId(linkDao, aLink);
   return bookmarkDao.pageBookmarks(aLink, offset, count);
 }
Пример #5
0
  public List<UserTag> findSKOSRelated(User user, UserTag userTag)
      throws NoSuchUserException, NoSuchTagException, NoSuchUserTagException, MissingIdException {
    logger.debug("findSKOSRelated: user="******",userTag=" + userTag);
    if (GnizrDaoUtil.hasMissingId(user)) {
      GnizrDaoUtil.fillId(userDao, user);
    }
    if (GnizrDaoUtil.hasMissingId(userTag)) {
      GnizrDaoUtil.fillId(tagDao, userDao, userTag);
    }
    List<TagAssertion> asrts = null;
    List<UserTag> relatedTags = new ArrayList<UserTag>();
    asrts = tagAssertionDao.findTagAssertion(user, userTag, skosRelatedPrpt, null);
    if (asrts != null && !asrts.isEmpty()) {
      addUserTagObjectToList(asrts, relatedTags, userTag.getId());
    }
    asrts = tagAssertionDao.findTagAssertion(user, null, skosRelatedPrpt, userTag);
    if (asrts != null && !asrts.isEmpty()) {
      addUserTagSubjectToList(asrts, relatedTags, userTag.getId());
    }

    return relatedTags;
  }
Пример #6
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;
 }
Пример #7
0
 /**
  * @deprecated Since 2.4
  * @param link
  * @return
  */
 public List<Bookmark> getHistory(Link link) {
   logger.debug("getHistory: link=" + link);
   List<Bookmark> result = new ArrayList<Bookmark>();
   GnizrDaoUtil.checkNull(link);
   Link aLink = new Link(link);
   try {
     GnizrDaoUtil.fillId(linkDao, aLink);
     int totalBmCount = bookmarkDao.getBookmarkCount(aLink);
     if (totalBmCount > 0) {
       List<Bookmark> bmarks = bookmarkDao.pageBookmarks(aLink, 0, totalBmCount).getResult();
       for (Iterator<Bookmark> it = bmarks.iterator(); it.hasNext(); ) {
         Bookmark bm = it.next();
         GnizrDaoUtil.fillObject(bookmarkDao, userDao, linkDao, bm);
         result.add(bm);
       }
     }
     return result;
   } catch (Exception e) {
     logger.debug(e);
   }
   return result;
 }