Examples of LinkTag


Examples of com.gnizr.db.dao.LinkTag

      tagObj.add(tag);

      int id = 0;
      id = tagDao.createUserTag(new UserTag(user, tag));
      logger.debug("userTag id = " + id);
      id = tagDao.createLinkTag(new LinkTag(link, tag));
      logger.debug("linkTag id = " + id);
      id = tagDao.getBookmarkTagId(bmark, tag);
      if (id <= 0) {
        id = tagDao.createBookmarkTag(new BookmarkTag(0, bmark, tag, 0,
            pos));
View Full Code Here

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

Examples of com.gnizr.db.dao.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);
        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

Examples of com.gnizr.db.dao.LinkTag

      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

Examples of com.gnizr.db.dao.LinkTag

    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

Examples of com.gnizr.db.dao.LinkTag

    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

Examples of com.gnizr.db.dao.LinkTag

      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

Examples of com.gnizr.db.dao.LinkTag

      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

Examples of org.htmlparser.tags.LinkTag

        public void visitTag(Tag tag) {
            // Process any tag/node in your HTML
            String name = tag.getTagName();
            // Set the Link's target to _blank if the href is external
            if ("a".equalsIgnoreCase(name)) {
              LinkTag lnk = (LinkTag) tag;
              String sUrl = lnk.extractLink();
                if(sUrl.startsWith("http://") || sUrl.startsWith("https://")) {
                    lnk.setLink(sRedirectorUrl+Gadgets.URLEncode(Base64Encoder.encode(sUrl)));
                }
            }
        }
    };
View Full Code Here

Examples of org.htmlparser.tags.LinkTag

      htmlPage.setBaseUrl(rawDocument.getUrl());

      // Iterate over all links found
      Iterator linksIter = links.iterator();
      while (linksIter.hasNext()) {
        LinkTag currTag = ((LinkTag) linksIter.next());
        String link = CrawlerToolkit.removeAnchor(currTag.extractLink());

        // find urls which do not end with an '/' but are a directory
        link = CrawlerToolkit.completeDirectory(link);

        //link = CrawlerToolkit.toAbsoluteUrl(link, rawDocument.getUrl());
        String linkText = (currTag.getLinkText() == null) ? "" : currTag.getLinkText();

        // store all http(s)-links the link
        if (currTag.isHTTPLikeLink()) {
          rawDocument.addLink(link, linkText);
        }
      }

    } catch (ParserException ex) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.