Package com.gnizr.db.dao

Examples of com.gnizr.db.dao.Tag


  private List<String> extractTags(String searchTerm){
    List<String> tags = new ArrayList<String>();
    if(searchTerm != null){
      String[] st = searchTerm.split("\\s+");
      for(String s : st){
        Tag t = tagManager.getTag(s);
        if(t != null){
          tags.add(s);
        }
      }
    }
View Full Code Here


    if(rootList == null){
      rootList = new ArrayList<Integer>();
      cluster.put("root", rootList);
    }
   
    Tag curTag = null;
 
    List<Integer> bmIdSeen = new ArrayList<Integer>();
    List<Integer> curBmList = null;
   
    for(BookmarkTag bt : bookmarkTags){
      if(curTag == null || curTag.getId() != bt.getTag().getId()){
        curTag = bt.getTag();
        curBmList = new ArrayList<Integer>();
        cluster.put(String.valueOf(curTag.getId()),curBmList);
        tags.add(curTag);
      }       
      int bmId = bt.getBookmark().getId();
      curBmList.add(bmId);     
      if(bmIdSeen.contains(bmId) == false){
View Full Code Here

      logger.error("unable to suggest: no user is defined");
      return ERROR;
    }
    try{
      if(user != null && tag != null){
        userTag = tagManager.getUserTag(user, new Tag(tag));
      }
      if(userTag != null){
        List<UserTag> ut = null;
       
        ut = tagPager.findSKOSRelated(user, userTag);
View Full Code Here

    initPagingAction();

    int ppc = getPerPageCount();
    int max = 1;
    try {
      Tag aTag = new Tag(tag);
      max = bookmarkPager.getMaxPageNumber(aTag,ppc);
      setTotalNumOfPages(max);   
      int offset = computeOffset(page);   
      bookmarks = bookmarkPager.pageBookmark(aTag,offset,ppc);
      setPreviousPageNum(getPage(),max);
View Full Code Here

  }
 
  public String doListAllBookmarks() throws Exception{
    bookmarks = new ArrayList<Bookmark>();
    try{
      bookmarks = bookmarkPager.pageAllBookmark(new Tag(tag)).getResult();
    }catch(Exception e){
      logger.debug("error occured when paging bookmarks of tag: "+tag);
    }
    return SUCCESS;
  }
View Full Code Here

        List<Integer> userCluster = getUserCluster(user);
        if(userCluster.contains(bm.getId()) == false){
          userCluster.add(bm.getId());
        }       
       
        Tag tag = bt.getTag();
        List<Integer> tagCluster = getTagCluster(tag);
        if(tagCluster.contains(bm.getId()) == false){
          tagCluster.add(bm.getId());
        }
      }
View Full Code Here

      conn = dataSource.getConnection();
      stmt = conn.prepareStatement("call findTag(?)");
      stmt.setString(1,tag);
      ResultSet rs = stmt.executeQuery();
      while(rs.next()){
        Tag aTag = createTagObject(rs);
        tags.add(aTag);
        logger.debug("found: " + aTag);
      }
      if(tags.size() == 0){
        logger.debug("found no matching tags");
View Full Code Here

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

    return linkTag;
  }

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

    return tag;
  }

  public static Tag createTagObject(ResultSet rs) throws SQLException {
    if(rs == null) return null;
    Tag tag = new Tag();
    tag.setId(rs.getInt(TagSchema.ID));
    tag.setLabel(rs.getString(TagSchema.TAG));
    tag.setCount(rs.getInt(TagSchema.COUNT));
    return tag;
  }
View Full Code Here

TOP

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

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.