Package com.liusoft.dlog4j.beans

Examples of com.liusoft.dlog4j.beans.FckUploadFileBean


   * @param obj_id
   * @return
   * @throws IOException
   */
  public static boolean deleteFileById(int siteid, int obj_id) throws Exception{
    FckUploadFileBean fufb = (FckUploadFileBean)namedUniqueResult("GET_UPLOAD_FILE", obj_id);
    if(fufb!=null && fufb.getSite().getId()==siteid){
      delete(fufb);
      FCK_UploadManager.getUploadHandler().remove(fufb);
      return true;
    }
    return false;
View Full Code Here


   * @param obj_id
   * @return
   * @throws IOException
   */
  public static boolean deleteFileById(int userid, String ssn_id, int obj_id) throws Exception{
    FckUploadFileBean fufb = (FckUploadFileBean)namedUniqueResult("GET_UPLOAD_FILE", obj_id);
    if(fufb!=null && fufb.getUser().getId()==userid && StringUtils.equals(fufb.getSessionId(), ssn_id)){       
      delete(fufb);
      FCK_UploadManager.getUploadHandler().remove(fufb);
      return true;
    }
    return false;
View Full Code Here

   * @throws IOException
   */
  public static int deleteFilesByRef(Session ssn, int site_id, int ref_id, int ref_type) throws Exception{   
    List files = findNamedAll("GET_UPLOAD_FILE_BY_REF", site_id,ref_id, ref_type);
    for(int i=0;i<files.size();i++){
      FckUploadFileBean fufb = (FckUploadFileBean)files.get(i);
      if(StringUtils.isNotEmpty(fufb.getSavePath())){
        FCK_UploadManager.getUploadHandler().remove(fufb);
      }

      int photo_site = DLOG4JUtils.sizeInKbytes(fufb.getFileSize());
      fufb.getSite().getCapacity().incDiaryUsed(-photo_site);
     
      ssn.delete(fufb);
    }
    return files.size();
  }
View Full Code Here

    try{
      beginTransaction();
      List beans = findNamedAll("LIST_ORPHAN_FILES_IN_SESSION",
          new Object[] { new Integer(userid), session_id });
      for(int i=0;i<beans.size();i++){
        FckUploadFileBean fufb = (FckUploadFileBean)beans.get(i);
        FCK_UploadManager.getUploadHandler().remove(fufb);
        ssn.delete(fufb);
        er ++;
      }
      commit();     
View Full Code Here

      text.append("<p>");
      // ���ظ���
      String context_path = req.getContextPath();
      List files = FCKUploadFileDAO.listOrphanFiles(uid, ssn_id);
      for (int i = 0; files != null && i < files.size(); i++) {
        FckUploadFileBean file = (FckUploadFileBean) files.get(i);
        String uri = context_path + file.getUri();
        text.append(MessageFormat.format(img_pattern, new String[]{uri}));
      }
      text.append("</p>");
    }
    return text.toString();
View Full Code Here

    if(loginUser!=null){     
      super.doPost(req, res);
      Integer errno = (Integer)req.getAttribute("errno");
      if(errno!=null && errno.intValue()==0){
        //д���ϴ���Ϣ����
        FckUploadFileBean fbean = new FckUploadFileBean();
        try{       
          Long fileSize = (Long)req.getAttribute("file.size");
          Integer fileType = (Integer)req.getAttribute("file.type");
          String savePath = (String)req.getAttribute("file.path");
          String uriPath = (String)req.getAttribute("file.uri");
          if(fileSize!=null)
            fbean.setFileSize(fileSize.intValue());
          if(fileType!=null)
            fbean.setFileType(fileType.intValue());
          fbean.setSavePath(savePath);
          fbean.setUri(uriPath);
          HttpSession ssn = req.getSession(true);
          //SESSION_IDͬʱ������Cookie�з�ֹ
          RequestUtils.setCookie(req, res, Globals.SESSION_ID_KEY_IN_COOKIE, ssn.getId(),-1);
          fbean.setSessionId(ssn.getId());
          fbean.setUser(new UserBean(loginUser.getId()));
          fbean.setUploadTime(new Date());
          FCKUploadFileDAO.createUploadFileItem(fbean);
        }catch(Exception e){
          log.error("Writting upload file info failed.", e);
        }
      }
View Full Code Here

TOP

Related Classes of com.liusoft.dlog4j.beans.FckUploadFileBean

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.