task_pending_upload.jsp
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:3k
源码类别:

电子政务应用

开发平台:

Java

  1. <%       
  2.     String root = ConfigParaLoader.getParameter("rootUrl"); 
  3.     if( request.getParameter("type") !=null && Integer.parseInt( request.getParameter("type") ) == 1 ) //上载 
  4.        {              
  5.            String attachURL = ConfigParaLoader.getParameter("workflowAttachmentUrl"); 
  6.            attachURL += SubPathGenerater.getSeperator() + SubPathGenerater.getSubPath( root + SubPathGenerater.getSeperator() + attachURL);
  7.            click = ( SubTaskValueBean )session.getAttribute( "click" );   
  8.         // Initialization 
  9.            mySmartUpload.initialize( pageContext ); 
  10.            mySmartUpload.setTotalMaxFileSize( 100000 ); 
  11.        // Upload        
  12.           mySmartUpload.upload(); 
  13.           mySmartUpload.save( root + SubPathGenerater.getSeperator() + attachURL  ); 
  14.                
  15.        if( mySmartUpload.getRequest().getParameter("subNote") != null )
  16.            click.setSubNote( mySmartUpload.getRequest().getParameter("subNote") );           
  17.        Collection c = click.getSubFiles();
  18.        for (int i=0;i<mySmartUpload.getFiles().getCount();i++) 
  19.        { 
  20.            com.vnex.intranet.upload.File myFile = mySmartUpload.getFiles().getFile(i); 
  21.            if (!myFile.isMissing())   
  22.            { 
  23.                 WorkflowFileValueBean wf = new WorkflowFileValueBean(); 
  24.                 wf.setName( myFile.getFileName() ); 
  25.                 wf.setTitle( attachURL + "/" + myFile.getFileName() ); 
  26.                 wf.setDescription( myFile.getFileName() ); 
  27.                 c.add(wf);             
  28.            }                            
  29.         }     
  30.         SubTaskDao dao = new SubTaskDao();
  31.         SubTaskValueBean sub = dao.getSubTask(subtaskId);
  32.         
  33.         sub.setSubNote(click.getSubNote());
  34.         
  35.         click = sub;
  36.         
  37.         click.setSubFiles(c);    
  38.         
  39.         session.setAttribute("click",click);
  40.   } 
  41.     if( request.getParameter("type") !=null && Integer.parseInt( request.getParameter("type") ) == 2 ) 
  42.       { 
  43.       if( mySmartUpload.getRequest().getParameter("subNote") != null )
  44.           click.setSubNote(request.getParameter("subNote") );
  45.           String files[] = request.getParameterValues("attachments");
  46.                        
  47.           if(files!= null) 
  48.           { 
  49.               for(int i = 0; i<files.length; i++) 
  50.               { 
  51.                   SubPathGenerater.deleteFile( root + SubPathGenerater.getSeperator() + files[i] );  
  52.                   click.removeFile(  files[i] );                 
  53.               }     
  54.               
  55.               SubTaskDao dao = new SubTaskDao();
  56.               SubTaskValueBean sub = dao.getSubTask(subtaskId);
  57.               
  58.               sub.setSubFiles(click.getSubFiles());
  59.               sub.setSubNote(click.getSubNote());              
  60.               
  61.               click = sub;
  62.               session.setAttribute("click",click);
  63.           }     
  64.       }
  65.           
  66.       //proxy.UpdateSubtask(click);
  67. %>