Package com.gnizr.db.dao

Examples of com.gnizr.db.dao.Link


    return null;
  }
 
  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);
      }
View Full Code Here


   */
  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();
View Full Code Here

  }
 
  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);
  }
View Full Code Here

  protected void tearDown() throws Exception {
    super.tearDown();
  }

  public void testCreateLinkTag() throws Exception{
    Link link = new Link(1);
    Tag tag = new Tag("newtag");
    int tid = tagDao.createTag(tag);
    tag = new Tag(tid);
    int id = tagDao.createLinkTag(new LinkTag(link,tag));
    assertTrue((id >0));
View Full Code Here

    assertNull(tagDao.getUserTag(id));
  }
 
 
  public void testFindLinkTag() throws Exception{
    Link link = new Link(1);
    Tag tag = new Tag(1);
    List<LinkTag> linkTags = tagDao.findLinkTag(link, tag);
    assertEquals(1,linkTags.size());
   
    LinkTag linkTag = linkTags.get(0);
View Full Code Here

    assertNotNull(linkTag.getTag().getLabel());
    assertNotNull(linkTag.getLink().getUrlHash());   
  }
 
  public void testFindLinkTagMinFreq() throws Exception{
    Link link = new Link(1);
    List<LinkTag> tags = tagDao.findLinkTag(link,0);
    assertEquals(4,tags.size());
   
    tags = tagDao.findLinkTag(link, 10);
    assertEquals(2,tags.size());
View Full Code Here

 
  public void testCreateEntry1() throws Exception{
    fromSub = new FeedSubscription();
    Bookmark rssBm = new Bookmark();
    rssBm.setUser(new User("hchen1"));
    rssBm.setLink(new Link(rssUrl));
    fromSub.setBookmark(rssBm);
    fromSub.setImportFolders(new ArrayList<String>());
     
    BookmarkEntry bmEntry = factory.createEntry(entry,null, fromSub);
    assertNotNull(bmEntry);
View Full Code Here

   
    assertNotNull(tags.get(0).getLink().getUrl());
  }
 
  public void testPageLinkTagSortByFreq() throws Exception{
    Link link = new Link(1);
    DaoResult<LinkTag> result = tagDao.pageLinkTagSortByFreq(link, 0,100);
    assertEquals(3, result.getSize());
    List<LinkTag> tags = result.getResult();
    assertEquals(105,tags.get(0).getCount());
    assertEquals(100,tags.get(1).getCount())
View Full Code Here

 
  public void testCreateEntry2() throws Exception{
    fromSub = new FeedSubscription();
    Bookmark rssBm = new Bookmark();
    rssBm.setUser(new User("hchen1"));
    rssBm.setLink(new Link(rssUrl));
    rssBm.setTags("tag:mycoolfeed gn:tag=geonames:21024,md tag:    ");
    fromSub.setBookmark(rssBm);
   
    List<String> imFldrs = new ArrayList<String>();
    imFldrs.add("folder1");   
View Full Code Here

   
    BookmarkTag bTag4 = tagDao.getBookmarkTag(40);
    assertEquals(0,bTag4.getCount());
       
    User user1 = new User(1);
    Link link1 = new Link(1);
    Bookmark bmark1 = new Bookmark(1);
       
    boolean[] opOkay = tagDao.addTagCountOne(new Tag[]{tag4}, user1, link1, bmark1);
    assertTrue(opOkay[0]);
   
View Full Code Here

TOP

Related Classes of com.gnizr.db.dao.Link

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.