Package com.isfasiel.util.data

Examples of com.isfasiel.util.data.Data


    param = null;
    return path;
  }
  @RequestMapping(value="/view/{contentId}/{page}")
  public String viewContent(@PathVariable("contentId") long contentId, @PathVariable("page")int page, Model model) throws Exception {
    Data param = getPageParam(page, 20);
    User user = getUser();
    param.add(0, "contentId", contentId);
    param.add(0, "userIdx", user.getId());
    List<Data> result = jobService.select(param);
    //result.get(0).add("comment", result.get(2).toXMl("comment"));
    Data fileResult = toFileData(result);
   
    //result.get(0).add("comment", result.get(2).toXMl("comment"));
    addXML(model, "result", fileResult, "content");
    //addXML(model, "result", result.get(0), "content");
   
View Full Code Here


    param = null;
    return result != null ? true : false;
  }
 
  public Data getTags(List<Object> tagNames) throws Exception {
    return new Data(this.getSqlMapClientTemplate().queryForList("tagDAO.tagSelect", tagNames));
  }
View Full Code Here

  public Data getTags(List<Object> tagNames) throws Exception {
    return new Data(this.getSqlMapClientTemplate().queryForList("tagDAO.tagSelect", tagNames));
  }
 
  public Data getTag(String tagName) throws Exception {
    return new Data(this.getSqlMapClientTemplate().queryForList("tagDAO.select", tagName));
  }
View Full Code Here

  }
 
  public Long insertTag(String tagName) throws Exception {
    tagName = tagName.toUpperCase();
    Long tagId = getSeq("SEQ_TN_TAG");
    Data param = new Data();
    param.add(0, "tagId", tagId);
    param.add(0, "tagName", tagName);
   
    this.getSqlMapClientTemplate().insert("tagDAO.insert", param.getRecord(0));
    param = null;
    return tagId;
  }
View Full Code Here

    param = null;
    return tagId;
  }
 
  public boolean updateTag(long tagId, String tagName, int tagCount, int state) throws Exception {
    Data param = new Data();
    param.add(0, "tagId", tagId);
    param.add(0, "tagName", tagName);
    param.add(0, "tagCount", tagCount);
    param.add(0, "state", state);
   
    int result = this.getSqlMapClientTemplate().update("tagDAO.update", param.getRecord(0));
    param = null;
    return result > 0 ? true : false;
  }
View Full Code Here

    list = null;
    return result > 0 ? true : false;
  }
 
  public boolean delCntTag(long contentId, long[] tagIds) throws Exception {
    Data data = new Data();
    data.add("tagIds", tagIds);
    data.add("contentId", contentId);
    int result = this.getSqlMapClientTemplate().delete("tagDAO.deleteCntTag", data.getRecord(0));
    return result > 0 ? true : false;
  }
View Full Code Here

    return result > 0 ? true : false;
  }
 
 
  public Data getCntTag(long contentId, long tagId) throws Exception{
    Data param = new Data();
    param.add(0, "contentId", contentId);
    param.add(0, "tagId", tagId);
    Data rs = new Data(this.getSqlMapClientTemplate().queryForList("tagDAO.connSelect", param.getRecord(0)));
    param = null;
    return rs;
  }
View Full Code Here

    param = null;
    return rs;
  }
 
  public Data getCntTagByCntId(long contentId) throws Exception{
    Data param = new Data();
    param.add(0, "contentId", contentId);
    Data rs = new Data(this.getSqlMapClientTemplate().queryForList("tagDAO.connSelectByContent", param.getRecord(0)));
    param = null;
    return rs;
  }
View Full Code Here

    param = null;
    return rs;
  }
 
  public Data getCntTagByTagName(long tagId) throws Exception{
    Data param = new Data();
    param.add(0, "tagId", tagId);
    Data rs = new Data(this.getSqlMapClientTemplate().queryForList("tagDAO.connSelectByTag", param.getRecord(0)));
    param = null;
    return rs;
  }
View Full Code Here

   * @param maxFileSize
   * @return
   * @throws Exception
   */
  public Data uploadFiles(HttpServletRequest request, String path, long dirId) throws Exception {
    Data list = new Data();
    int index = 0;
   
    MultipartHttpServletRequest mptRequest = (MultipartHttpServletRequest) request;
    Iterator fileIter = mptRequest.getFileNames();
   
    while (fileIter.hasNext()) {
      MultipartFile mFile = mptRequest.getFile((String) fileIter.next());

      String tmp = mFile.getOriginalFilename();

      if (tmp.lastIndexOf("\\") >= 0) {
        tmp = tmp.substring(tmp.lastIndexOf("\\") + 1);
      }
     
      list.add(index,FILE_NAME, tmp);
      list.add(index,FILE_PHY_NAME, getPhysicalFileName());
      if( tmp.lastIndexOf(".") < 0 ) {
        list.add(index,EXTENTION, "");
      } else {
        String ext = tmp.substring(tmp.lastIndexOf(".") + 1);
        if( ext.length() > 5) {
          ext = ext.substring(0, 5);
        }
        list.add(index,EXTENTION, ext);
      }
     
     
      list.add(index,FILE_SIZE, mFile.getSize());
      list.add(index,DIR_ID, dirId);

      if (tmp.lastIndexOf(".") >= 0) {
        String phyName = list.getString(index, FILE_PHY_NAME) + tmp.substring(tmp.lastIndexOf("."));
       
        list.add(index,FILE_PHY_NAME, phyName);
      }
      String filePath = properties.getProperty("baseDir").replaceAll("\\\\", "/") + SEPERATOR + path + SEPERATOR + list.getString(index, FILE_PHY_NAME);
      filePath = filePath.replaceAll("\\\\", "/");
      if (mFile.getSize() > 0) {
        mFile.transferTo( new File(filePath) );
      }
     
      if(filter(list.getString(index, EXTENTION))) {
        index++;
        list.remove(index);
      } else {
        File removed = new File(filePath);
        removed.delete();
        removed = null;
      }
View Full Code Here

TOP

Related Classes of com.isfasiel.util.data.Data

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.