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

电子政务应用

开发平台:

Java

  1. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  2. <%@ page import="com.vnex.intranet.commoninfo.directory.value.*"%>
  3. <%@ page import="com.vnex.intranet.commoninfo.directory.proxy.*"%>
  4. <%@ page import="com.vnex.intranet.system.loader.ConfigParaLoader"%>
  5. <%@ page import="com.vnex.intranet.util.*"%>
  6. <%@ page import="com.vnex.intranet.upload.*"%>
  7. <%@ page import="java.util.*" %>
  8. <%@ page import="java.sql.*" %>
  9. <%@ page import="java.io.*" %>
  10. <jsp:useBean id="directoryProxy" class="com.vnex.intranet.commoninfo.directory.proxy.DirectoryProxyBean" scope="application" />
  11. <jsp:useBean id="directoryBean" class="com.vnex.intranet.commoninfo.directory.value.DirectoryValueBean" scope="page" />
  12. <jsp:useBean id="myUpload" scope="page" class="com.vnex.intranet.upload.SmartUpload" />
  13. <%
  14.   String root = ConfigParaLoader.getParameter("rootUrl");
  15.   String attachURL = ConfigParaLoader.getParameter("directoryAttachmentUrl");
  16.   String oldUrl = "";
  17.   String directoryName = "";
  18.   String directoryDepartment = "";
  19.   int directoryId = 0;
  20.   int start = 1;
  21.   
  22. // Initialization 
  23.    myUpload.initialize( pageContext ); 
  24.    myUpload.setTotalMaxFileSize( Integer.parseInt(ConfigParaLoader.getParameter("attachmentSize")) );
  25.    
  26. // Upload
  27.    myUpload.upload();
  28.    
  29.   com.vnex.intranet.upload.Request multi = myUpload.getRequest();
  30.   if(multi.getParameter("start")!=null && !multi.getParameter("start").equals(""))
  31.   {
  32.     start = Integer.parseInt(multi.getParameter("start"));
  33.   }  
  34.   if(multi.getParameter("directoryName")!=null && !multi.getParameter("directoryName").equals(""))
  35.   {
  36.     directoryName = (String) multi.getParameter("directoryName");
  37.     directoryBean.setDirectoryName(directoryName);
  38.   }
  39.   if(multi.getParameter("directoryDepartment")!=null && !multi.getParameter("directoryDepartment").equals(""))
  40.   {
  41.     directoryDepartment = (String) multi.getParameter("directoryDepartment");
  42.     directoryBean.setDirectoryDepartment(directoryDepartment);
  43.   }
  44.   if(multi.getParameter("directoryId")!=null && !multi.getParameter("directoryId").equals(""))
  45.   {
  46.     directoryId = Integer.parseInt((String) multi.getParameter("directoryId"));
  47.     directoryBean.setDirectoryId(directoryId);
  48.   }
  49.   com.vnex.intranet.upload.File myFile = myUpload.getFiles().getFile(0); 
  50.   if(myFile.getFileName()!=null && !myFile.getFileName().equals(""))
  51.   {
  52.     if(multi.getParameter("oldUrl")!=null && !multi.getParameter("oldUrl").equals(""))
  53.     {
  54.       oldUrl = (String) multi.getParameter("oldUrl");
  55.       SubPathGenerater.deleteFile( root + oldUrl );
  56.     }
  57.     
  58. // SubPathGenerater
  59.    attachURL += SubPathGenerater.getSubPath( root + SubPathGenerater.getSeperator() + attachURL);
  60.    
  61.    myUpload.save( root + attachURL );
  62.    
  63.     String url = attachURL +SubPathGenerater.getSeperator()+ myFile.getFileName();
  64.     directoryBean.setAttachmentUrl(url);
  65.   }
  66.   else
  67.   {
  68.     if(multi.getParameter("oldUrl")!=null && !multi.getParameter("oldUrl").equals(""))
  69.     {
  70.       oldUrl = (String) multi.getParameter("oldUrl");
  71.       directoryBean.setAttachmentUrl(oldUrl);
  72.     }
  73.   }
  74.   directoryProxy.modifyDirectory(directoryBean);
  75.   response.sendRedirect("/mainctrl/commoninfo/directory/detailDirectory?directoryId="+directoryId+"&start="+start);
  76. %>