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