Package com.gnizr.db.dao

Examples of com.gnizr.db.dao.Link


    Tag tag2 = tagDao.findTag("tag2").get(0);
    assertEquals(0,tag2.getCount());
  }
 
  public void testUpdateBookmark4() throws Exception{
    Bookmark bm1 = new Bookmark(new User(2),new Link(204));
    bm1.setTitle("bookmark_1_title");
    bm1.setTags("loc:columbia,md locality:baltimore,maryland");
   
    Bookmark bm2 = new Bookmark(new User(3),new Link(204));
    bm2.setTitle("bookmark_2_title");
    bm2.setTags("loc:columbia,md");
   
    int id1 = manager.addBookmark(bm1);
    int id2 = manager.addBookmark(bm2);
View Full Code Here


    UserTag headlinesUserTag = tagDao.findUserTag(new User(1),headlinesTag).get(0);
    assertEquals(1,headlinesUserTag.getCount());
  }
 
  public void testRenameTag3() throws Exception{
    Bookmark bm = new Bookmark(new User(1),new Link(204));
    bm.setTags("cnn");
    int bmId = manager.addBookmark(bm);
    assertTrue((bmId >0));
   
    boolean okay = manager.renameTag(new User(1),"cnn",new String[]{"cnn_news"});
View Full Code Here

    Tag cnn_newsTag = tagDao.findTag("cnn_news").get(0);
    assertEquals(2,cnn_newsTag.getCount());
  }
 
  public void testRenameTag4() throws Exception{
    Bookmark bm = new Bookmark(new User(1),new Link(204));
    bm.setTags("java.logging");
    bm.setTitle("foio");
    int id = manager.addBookmark(bm);
    assertTrue((id > 0));
   
View Full Code Here

          if(getTitle() == null){
            setTitle(guessLinkTitle(url));
          }
          editBookmark = new Bookmark();         
          editBookmark.setTags(getTags());       
          editBookmark.setLink(new Link(getUrl()));
          String st = GnizrDaoUtil.stripNonPrintableChar(getTitle());
          editBookmark.setTitle(st)
          String sn = GnizrDaoUtil.stripNonPrintableChar(getNotes());
          editBookmark.setNotes(sn);
        }       
View Full Code Here

        }else{
          editBookmark.setTags("");
        }   
       
        editBookmark.setLastUpdated(GnizrDaoUtil.getNow());
        editBookmark.setLink(new Link(getUrl()));
       
        String st = GnizrDaoUtil.stripNonPrintableChar(getTitle());
        editBookmark.setTitle(st)
       
        String sn = GnizrDaoUtil.stripNonPrintableChar(getNotes());
View Full Code Here

  }
 
  private String addBookmark() {
    editBookmark = new Bookmark();
    editBookmark.setUser(loggedInUser);
    editBookmark.setLink(new Link(getUrl()));
    editBookmark.setCreatedOn(GnizrDaoUtil.getNow());
    editBookmark.setLastUpdated(GnizrDaoUtil.getNow());
    editBookmark.setTags(getTags());
   
    String st = GnizrDaoUtil.stripNonPrintableChar(getTitle());
View Full Code Here

      List<Bookmark> bmarks) {
    List<LinkTag> unionCommonTags = new ArrayList<LinkTag>();
    List<Integer> seenTag = new ArrayList<Integer>();
    List<LinkTag> linkTags = null;
    for (Iterator<Bookmark> it = bmarks.iterator(); it.hasNext();) {
      Link aLink = it.next().getLink();
      try {
        LinkTag tmpLinkTag = null;
        // each link in the list is allowed to contribute
        // no more than 5 tags to the common tag cloud
        linkTags = tagCloud.getCommonTagCloud(aLink,5);
View Full Code Here

    return unionCommonTags;
  }

  public String doPageLinkTags() throws Exception{
    if(url != null){
      Link link = linkManager.getInfo(Link.computeUrlHash(url));
      if(link != null){
        List<LinkTag> tags = tagCloud.getCommonTagCloud(link, 6);
        if(tags != null){
          commonTags = tags;
        }
View Full Code Here

  @Override
  protected String go() throws Exception {
    logger.debug("GetLinkHistory.go(): urlHash="+urlHash);
    if(urlHash != null){
      Link link = linkManager.getInfo(urlHash);
      if(link != null){
        bookmarks = linkManager.getHistory(link);             
      }else{
        addActionError("No recorded link history of this URL.");
        return ERROR;
View Full Code Here

    bmark.setLastUpdated(rs.getTimestamp(BookmarkSchema.LAST_UPDATED));   
    User u = new User();
    u.setId(rs.getInt(BookmarkSchema.USER_ID));
    bmark.setUser(u);
   
    Link l = new Link();
    l.setId(rs.getInt(BookmarkSchema.LINK_ID));
    bmark.setLink(l);
   
    return bmark;
  }
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.