Package com.gnizr.db.dao

Examples of com.gnizr.db.dao.LinkTag


    GnizrDaoUtil.fillId(tagDao,userDao,ut);
    GnizrDaoUtil.fillObject(tagDao, userDao, ut);
    assertEquals((1),ut.getCount());
    assertEquals((1),ut.getTag().getCount());
   
    LinkTag lt = new LinkTag("http://www.learntechnology.net/webwork-crud-lm.do","learning");
    GnizrDaoUtil.fillId(tagDao, linkDao,lt);
    GnizrDaoUtil.fillObject(tagDao, linkDao,lt);
    assertEquals((1),lt.getCount());
    assertEquals((1),lt.getTag().getCount());
   
    assertTrue(manager.deleteBookmark(bookmark));

    List<Bookmark> r = bookmarkDao.findBookmark(user, link);
    assertTrue(r.isEmpty());
    GnizrDaoUtil.fillId(tagDao,userDao,ut);
    GnizrDaoUtil.fillObject(tagDao, userDao, ut);
    assertEquals((0),ut.getCount());
    assertEquals((0),ut.getTag().getCount());
     
    GnizrDaoUtil.fillId(tagDao, linkDao,lt);
    GnizrDaoUtil.fillObject(tagDao, linkDao,lt);
    assertEquals((0),lt.getCount());
    assertEquals((0),lt.getTag().getCount());   
  }
View Full Code Here


    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);
        for (Iterator<LinkTag> it2 = linkTags.iterator(); it2.hasNext();) {
          tmpLinkTag = it2.next();
          if (seenTag.contains(tmpLinkTag.getTag().getId()) == false) {
            unionCommonTags.add(tmpLinkTag);
            seenTag.add(tmpLinkTag.getTag().getId());           
          }
        }
      } catch (Exception e) {
        logger.debug(
            "failed to get common tag cloud for link=" + aLink, e);
View Full Code Here

      stmt = conn.prepareStatement("call findLinkTag(?,?)");
      stmt.setInt(1,link.getId());
      stmt.setInt(2,tag.getId());
      ResultSet rs = stmt.executeQuery();
      while(rs.next()){
        LinkTag aTag = createLinkTagObject(rs);
        tags.add(aTag);
        logger.debug("found: " + aTag);
      }
      if(tags.size() == 0){
        logger.debug("found no matching link tags");
View Full Code Here

    return tags;
  }

  public LinkTag getLinkTag(int id) {
    logger.debug("input: id="+id);
    LinkTag tag = null;
    PreparedStatement stmt = null;
    Connection conn = null;
    try{           
      conn = dataSource.getConnection();
      stmt = conn.prepareStatement("call getLinkTag(?);");
View Full Code Here

    return tag;
  }

  public static LinkTag createLinkTagObject(ResultSet rs) throws SQLException {
    if(rs == null) return null;
    LinkTag linkTag = new LinkTag();
    linkTag.setId(rs.getInt(LinkTagIdxSchema.ID));
    linkTag.setCount(rs.getInt(LinkTagIdxSchema.COUNT));
   
    Tag t = createTagObject(rs);
    linkTag.setTag(t);
   
    Link l = LinkDBDao.createLinkObject(rs);
    linkTag.setLink(l);
   
    return linkTag;
  }
View Full Code Here

      stmt = conn.prepareStatement("call findLinkTagMinFreq(?,?)");
      stmt.setInt(1,link.getId());
      stmt.setInt(2,minFreq);
      ResultSet rs = stmt.executeQuery();
      while(rs.next()){
        LinkTag aTag = createLinkTagObject(rs);
        tags.add(aTag);
        logger.debug("found: " + aTag);
      }
      if(tags.size() == 0){
        logger.debug("found no matching link tags");
View Full Code Here

      stmt.setInt(2,offset);
      stmt.setInt(3,count);
      stmt.registerOutParameter(4,Types.INTEGER);
      ResultSet rs = stmt.executeQuery();
      while(rs.next()){
        LinkTag linktag =createLinkTagObject(rs);
        tags.add(linktag);
        logger.debug("found: " + linktag);
      }
      int size = stmt.getInt(4);
      if(size < 0){
View Full Code Here

TOP

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

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.