Package com.gnizr.db.dao

Examples of com.gnizr.db.dao.Link


  }
 
  protected void setUp() throws Exception {
    super.setUp();
    User user1 = new User(1);
    Link link1 = new Link(1);
    Link link2 = new Link(2);
    Link link3 = new Link(3);
   
    Bookmark bm1 = new Bookmark(user1,link1);
    bm1.setTags("tags1 tags2 tags3");
    bm1.setTitle("title foobar1");
   
View Full Code Here


    GnizrDaoUtil.fillId(userDao, user);
    if(url == null){
      throw new NullPointerException("url is null");
   
    Bookmark bmark = new Bookmark();
    bmark.setLink(new Link(url));
    bmark.setUser(user);
    GnizrDaoUtil.fillId(bookmarkDao, userDao, linkDao, bmark);
    return folderDao.pageContainedInFolders(bmark, offset, count);
  }
View Full Code Here

      conn = dataSource.getConnection();
      stmt = conn.prepareStatement("call findLinkUrl(?)");
      stmt.setString(1,url);
      ResultSet rs = stmt.executeQuery();
      while(rs.next()){
        Link aLink = createLinkObject(rs);
        links.add(aLink);
        logger.debug("found: " + aLink);
      }
      if(links.size() == 0){
        logger.debug("found no matching links");
View Full Code Here

    return links;
  }

  public static Link createLinkObject(ResultSet rs) throws SQLException {
    if(rs == null) return null;
    Link aLink = new Link();
    aLink.setId(rs.getInt(LinkSchema.ID));
    aLink.setUrl(rs.getString(LinkSchema.URL));
    aLink.setMimeTypeId(rs.getInt(LinkSchema.MIME_TYPE_ID));
    aLink.setUrlHash(rs.getString(LinkSchema.URL_HASH));
    aLink.setCount(rs.getInt(LinkSchema.COUNT));
    return aLink;
  }
View Full Code Here

    aLink.setCount(rs.getInt(LinkSchema.COUNT));
    return aLink;
  }
  public Link getLink(int id) {
    logger.debug("getLink: id="+id);
    Link aLink = null;
    PreparedStatement stmt = null;
    Connection conn = null;
    try{           
      conn = dataSource.getConnection();
      stmt = conn.prepareStatement("call getLink(?);");
View Full Code Here

      conn = dataSource.getConnection();
      stmt = conn.prepareStatement("call findLinkUrlHash(?)");
      stmt.setString(1,urlHash);
      ResultSet rs = stmt.executeQuery();
      while(rs.next()){
        Link aLink = createLinkObject(rs);
        links.add(aLink);
        logger.debug("found: " + aLink);
      }
      if(links.size() == 0){
        logger.debug("found no matching links");
View Full Code Here

  protected void setUp() throws Exception {   
    super.setUp();
    bmark1 = new Bookmark(101);
    bmark1.setUser(new User("jsmith"));
    bmark1.setTitle("Title of a Bookmark");
    Link ln = new Link("http://example.org/foo1.html");
    ln.setUrlHash("123456789abcdefg");
    bmark1.setLink(ln);
    bmark1.setTags("tag1 tag2 foo.bar machine:tag=233");
    bmark1.setNotes("Some <b>notes</b> of the bookmark <i>not wellformed");
   
    SimpleDateFormat dFormat = new SimpleDateFormat("yyyy-MM-dd");
View Full Code Here

    Bookmark gBookmark = new Bookmark();
    gBookmark.setTitle(title);
    gBookmark.setNotes(cmt);
    gBookmark.setTags(tag);
    gBookmark.setLink(new Link(href));
    gBookmark.setUser(gUser);
    gBookmark.setCreatedOn(createdOn);
    return gBookmark;
  }
View Full Code Here

  public FeedSubscription createSubscription(User user, String feedUrl, String feedTitle) throws NoSuchUserException, NotAuthorizedException, MissingIdException{
    if(feedUrl == null || feedTitle == null){
      throw new NullPointerException("either feedUrl or feedTitle is NULL");
    }
    GnizrDaoUtil.fillId(userDao, user);
    Bookmark feedBmark = new Bookmark(user,new Link(feedUrl));   
    feedBmark.setTitle(feedTitle);
    int bmId = bookmarkManager.addBookmark(feedBmark);
    if(bmId <= 0){
      logger.error("unable create bookmark: " + feedBmark);
    }else{
View Full Code Here

    this.userDao = gnizrDao.getUserDao();
  }
 
  public Link getInfo(String urlHash){
    logger.debug("getInfo: urlHash="+urlHash);
    Link aLink = GnizrDaoUtil.getLinkByUrlHash(linkDao, urlHash);
    if(aLink != null){     
      return aLink;
    }
    return null;
  }
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.