dir_top.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:6k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
  2. <%@ page import="java.io.InputStream" %>
  3. <%@ page import="java.util.*" %>
  4. <%@ page import="cn.js.fan.db.*" %>
  5. <%@ page import="com.redmoon.oa.netdisk.*" %>
  6. <%@ page import="com.redmoon.oa.pvg.*" %>
  7. <%@ page import="cn.js.fan.util.*" %>
  8. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  12. <title>目录</title>
  13. <LINK href="../admin/default.css" type=text/css rel=stylesheet>
  14. <script>
  15. function findObj(theObj, theDoc)
  16. {
  17.   var p, i, foundObj;
  18.   
  19.   if(!theDoc) theDoc = document;
  20.   if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  21.   {
  22.     theDoc = parent.frames[theObj.substring(p+1)].document;
  23.     theObj = theObj.substring(0,p);
  24.   }
  25.   if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  26.   for (i=0; !foundObj && i < theDoc.forms.length; i++) 
  27.     foundObj = theDoc.forms[i][theObj];
  28.   for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
  29.     foundObj = findObj(theObj,theDoc.layers[i].document);
  30.   if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  31.   
  32.   return foundObj;
  33. }
  34. function ShowChild(imgobj, name)
  35. {
  36. var tableobj = findObj("childof"+name);
  37. if (tableobj.style.display=="none")
  38. {
  39. tableobj.style.display = "";
  40. if (imgobj.src.indexOf("i_puls-root-1.gif")!=-1)
  41. imgobj.src = "images/i_puls-root.gif";
  42. if (imgobj.src.indexOf("i_plus-1-1.gif")!=-1)
  43. imgobj.src = "images/i_plus2-2.gif";
  44. if (imgobj.src.indexOf("i_plus-1.gif")!=-1)
  45. imgobj.src = "images/i_plus2-1.gif";
  46. }
  47. else
  48. {
  49. tableobj.style.display = "none";
  50. if (imgobj.src.indexOf("i_puls-root.gif")!=-1)
  51. imgobj.src = "images/i_puls-root-1.gif";
  52. if (imgobj.src.indexOf("i_plus2-2.gif")!=-1)
  53. imgobj.src = "images/i_plus-1-1.gif";
  54. if (imgobj.src.indexOf("i_plus2-1.gif")!=-1)
  55. imgobj.src = "images/i_plus-1.gif";
  56. }
  57. }
  58. </script>
  59. </head>
  60. <body>
  61. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  62. <jsp:useBean id="dir" scope="page" class="com.redmoon.oa.netdisk.Directory"/>
  63. <jsp:useBean id="leafPriv" scope="page" class="com.redmoon.oa.netdisk.LeafPriv"/>
  64. <%
  65. String root_code = ParamUtil.get(request, "root_code");
  66. if (root_code.equals("")) {
  67. // root_code = "root";
  68. root_code = privilege.getUser(request);
  69. }
  70. LeafPriv lp = new LeafPriv();
  71. lp.setDirCode(root_code);
  72. if (!lp.canUserModify(privilege.getUser(request))) {
  73. // out.print(StrUtil.makeErrMsg(privilege.MSG_INVALID));
  74. // return;
  75. }
  76. %>
  77. <Script>
  78. var root_code = "<%=root_code%>";
  79. // 使框架的bottom能得到此root_code
  80. function getRootCode() {
  81. return root_code;
  82. }
  83. </Script>
  84. <%
  85. String op = ParamUtil.get(request, "op");
  86. if (op.equals("AddChild")) {
  87. boolean re = false;
  88. try {
  89. re = dir.AddChild(request);
  90. }
  91. catch (ErrMsgException e) {
  92. out.print(StrUtil.Alert(e.getMessage()));
  93. }
  94. if (!re) {
  95. out.print(StrUtil.Alert("添加节点失败,请检查编码是否重复!"));
  96. }
  97. }
  98. if (op.equals("del")) {
  99. String delcode = ParamUtil.get(request, "delcode");
  100. try {
  101. dir.del(delcode);
  102. out.print(StrUtil.Alert("删除成功!"));
  103. }
  104. catch (ErrMsgException e) {
  105. out.print(StrUtil.Alert(e.getMessage()));
  106. }
  107. }
  108. if (op.equals("modify")) {
  109. boolean re = true;
  110. try {
  111. re = dir.update(request);
  112. }
  113. catch (ErrMsgException e) {
  114. out.print(StrUtil.Alert(e.getMessage()));
  115. }
  116. if (re)
  117. out.print(StrUtil.Alert("修改完成"));
  118. }
  119. if (op.equals("move")) {
  120. try {
  121. dir.move(request);
  122. }
  123. catch (ErrMsgException e) {
  124. out.print(StrUtil.Alert(e.getMessage()));
  125. }
  126. }
  127. if (op.equals("removecache")) {
  128. String curcode = ParamUtil.get(request, "code");
  129. LeafChildrenCacheMgr.remove(curcode);
  130. out.print(StrUtil.Alert(curcode + "缓存已被清除!"));
  131. }
  132. Leaf leaf = dir.getLeaf(root_code);
  133. if (leaf==null || !leaf.isLoaded()) {
  134. // 为用户初始化网盘
  135. leaf = new Leaf();
  136. leaf.initRootOfUser(root_code);
  137. leaf = leaf.getLeaf(root_code);
  138. }
  139. String root_name = leaf.getName();
  140. int root_layer = leaf.getLayer();
  141. String root_description = leaf.getDescription();
  142. boolean isHome = false;
  143. %>
  144. <table width='100%' cellpadding='0' cellspacing='0' >
  145.   <tr>
  146.     <td class="head">管理&nbsp;<%=root_name%>&nbsp;&nbsp;<a href="netdisk_frame.jsp" target="_parent">浏览视图</a></td>
  147.   </tr>
  148. </table>
  149. <br>
  150. <TABLE class="frame_gray"  
  151. cellSpacing=0 cellPadding=0 width="95%" align=center>
  152.   <TBODY>
  153.     <TR>
  154.       <TD height=200 valign="top" bgcolor="#FFFBFF">
  155. <table class="tbg1" cellspacing=0 cellpadding=0 width="100%" align=center onMouseOver="this.className='tbg1sel'" onMouseOut="this.className='tbg1'" 
  156. border=0>
  157.           <tbody>
  158.             <tr>
  159.               <td width="66%" height="13" align=left nowrap>              &nbsp;&nbsp;&nbsp;&nbsp;                             </td>
  160.             <td width="34%" align=right nowrap>>>&nbsp;<%=root_name%>&nbsp;&nbsp;<a target="_parent" href="document_list_m.jsp?dir_code=<%=StrUtil.UrlEncode(root_code)%>&dir_name=<%=StrUtil.UrlEncode(root_name)%>"></a><a href="dir_priv_m.jsp?dirCode=<%=StrUtil.UrlEncode(root_code)%>" target="_parent">权限</a>&nbsp;&nbsp;<a target=dirbottomFrame href="dir_bottom.jsp?parent_code=<%=StrUtil.UrlEncode(root_code, "utf-8")%>&parent_name=<%=StrUtil.UrlEncode(root_name, "utf-8")%>&op=AddChild">添子目录</a> <a target="dirbottomFrame" href="dir_bottom.jsp?op=modify&code=<%=StrUtil.UrlEncode(root_code, "utf-8")%>&name=<%=StrUtil.UrlEncode(root_name,"utf-8")%>&description=<%=StrUtil.UrlEncode(root_description,"utf-8")%>">修改</a> <!--<a target=_self href="#" onClick="if (window.confirm('您确定要删除<%=root_name%>吗?')) window.location.href='dir_top.jsp?op=del&delcode=<%=root_code%>'">删除</a>-->
  161.   </td>
  162.             </tr>
  163.           </tbody>
  164.         </table>
  165. <%
  166. DirectoryView tv = new DirectoryView(leaf);
  167. tv.list(out);
  168. %></TD>
  169.     </TR>
  170.   </TBODY>
  171. </TABLE>
  172. </body>
  173. </html>