예제 #1
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);
 }
예제 #2
0
 public Bookmark getFirstMatchedBookmark(String url) {
   logger.debug("getFirstMatchedBookmark: url" + url);
   Link aLink = GnizrDaoUtil.getLink(linkDao, url);
   if (aLink != null) {
     DaoResult<Bookmark> result = bookmarkDao.pageBookmarks(aLink, 0, 1);
     if (result.getSize() > 0) {
       return result.getResult().get(0);
     }
   }
   return null;
 }
예제 #3
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;
 }