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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" %>
  2. <%@ page import="cn.js.fan.security.*"%>
  3. <%@ page import="cn.js.fan.util.*"%>
  4. <%@ page import="cn.js.fan.web.*"%>
  5. <%@ page import="cn.js.fan.module.cms.*"%>
  6. <%@ page import="com.redmoon.oa.pvg.Privilege"%>
  7. <%@ page import="java.util.Calendar" %>
  8. <html><head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  10. <link href="common.css" rel="stylesheet" type="text/css">
  11. <link href="admin/default.css" rel="stylesheet" type="text/css">
  12. <%
  13. String correct_result = "操作成功!";
  14. %>
  15. <script>
  16. function addform_submit() {
  17. addform.content.value = oEdit1.getHTMLBody();
  18. }
  19. function ClearAll(){
  20. oEdit1.RENDER(" ");
  21. }
  22. function SubmitWithFile(){
  23. var htmlcode = oEdit1.getHTMLBody();
  24. if (htmlcode=="")
  25. htmlcode = " ";
  26. addform.webedit.Clear();
  27. addform.webedit.AddField("id", addform.id.value);
  28. addform.webedit.SetHtmlCode(htmlcode);
  29. addform.webedit.UploadArticle();
  30. if (addform.webedit.ReturnMessage == "<%=correct_result%>")
  31. doAfter(true);
  32. else
  33. doAfter(false);
  34. }
  35. function SubmitWithoutFile(){
  36. var htmlcode = oEdit1.getHTMLBody();
  37. if (htmlcode=="")
  38. htmlcode = " ";
  39. addform.webedit.Clear();
  40. addform.webedit.AddField("isuploadfile", "false");
  41. addform.webedit.AddField("id", addform.id.value);
  42. addform.webedit.SetHtmlCode(htmlcode);
  43. addform.webedit.UploadArticle();
  44. if (addform.webedit.ReturnMessage == "<%=correct_result%>")
  45. doAfter(true);
  46. else
  47. doAfter(false);
  48. }
  49. function doAfter(isSucceed) {
  50. if (isSucceed) {
  51. alert("<%=correct_result%>");
  52.      window.location.reload(true); 
  53. }
  54. else {
  55. alert(addform.webedit.ReturnMessage);
  56. }
  57. }
  58. </script>
  59. <jsp:useBean id="strutil" scope="page" class="cn.js.fan.util.StrUtil"/>
  60. <jsp:useBean id="docmanager" scope="page" class="cn.js.fan.module.cms.DocumentMgr"/>
  61. <%
  62. int id = 0;
  63. Document doc = null;
  64. String op = ParamUtil.get(request, "op");
  65. id = ParamUtil.getInt(request, "id");
  66. Privilege privilege = new Privilege();
  67. doc = docmanager.getDocument(request, id, privilege);
  68. LeafPriv lp = new LeafPriv(doc.getDirCode());
  69. if (!lp.canUserModify(privilege.getUser(request))) {
  70. out.print(StrUtil.makeErrMsg(privilege.MSG_INVALID));
  71. return;
  72. }
  73. %>
  74. <title><%=doc.getTitle()%></title>
  75. <style type="text/css">
  76. <!--
  77. td {  font-family: "Arial", "Helvetica", "sans-serif"; font-size: 14px; font-style: normal; line-height: 150%; font-weight: normal}
  78. -->
  79. </style>
  80. <script language=JavaScript src='scripts/language/schi/editor_lang.js'></script>
  81. <%
  82. if (request.getHeader("User-Agent").indexOf("MSIE")!=-1){
  83. out.println("<script language=JavaScript src='scripts/editor.js'></script>");
  84. }
  85. else{
  86. out.println("<script language=JavaScript src='scripts/moz/editor.js'></script>");
  87. }
  88. %>
  89. </head>
  90. <body bgcolor="#FFFFFF" text="#000000">
  91. <TABLE width="98%" BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>
  92.   <TR valign="top" bgcolor="#FFFFFF">
  93.     <TD height="430" colspan="2" style="background-attachment: fixed; background-image: url(images/bg_bottom.jpg); background-repeat: no-repeat">
  94. <form name="addform" action="/doc_abstract_do.jsp" method="post" onSubmit="return addform_submit()">
  95.           <TABLE cellSpacing=0 cellPadding=0 width="100%">
  96.             <TBODY>
  97.               <TR>
  98.                 <TD class=head>
  99. 提取摘要&nbsp;&nbsp;&nbsp;&nbsp;<a href="fwebedit.jsp?op=edit&id=<%=doc.getID()%>&dir_code=<%=StrUtil.UrlEncode(doc.getDirCode())%>">返回</a></TD>
  100.               </TR>
  101.             </TBODY>
  102.           </TABLE>
  103.           <table border="0" cellspacing="1" width="100%" cellpadding="0" align="center">
  104.             <tr align="center" bgcolor="#F2F2F2">
  105.               <td height="20" colspan=3 align=center><b><%=doc.getTitle()%></b>&nbsp;
  106.   <input type="hidden" name=id value="<%=doc.getID()%>">
  107.   </td>
  108.             </tr>
  109.             <tr align="center">
  110.               <td colspan="3" valign="top" bgcolor="#F2F2F2" class="unnamed2">
  111.   <textarea id="content" name="content" style="display:none">
  112.   </textarea>
  113. <pre id="idTemporary" name="idTemporary" style="display:none">
  114. <%=strutil.HTMLEncode(strutil.getNullString(doc.getSummary()))%>
  115. </pre>
  116.  <script>
  117. var oEdit1 = new InnovaEditor("oEdit1");
  118. oEdit1.width="100%";
  119. oEdit1.height="500";
  120. oEdit1.features=["FullScreen","Preview","Print","Search","SpellCheck",
  121. "Cut","Copy","Paste","PasteWord","PasteText","|","Undo","Redo","|",
  122. "ForeColor","BackColor","|","Bookmark","Hyperlink",
  123. "HTMLFullSource","HTMLSource","XHTMLFullSource",
  124. "XHTMLSource","BRK","Numbering","Bullets","|","Indent","Outdent","LTR","RTL","|","Image","Flash","Media","|","InternalLink","CustomObject","|",
  125. "Table","Guidelines","Absolute","|","Characters","Line",
  126. "Form","Clean","ClearAll","BRK",
  127. "StyleAndFormatting","TextFormatting","ListFormatting","BoxFormatting",
  128. "ParagraphFormatting","CssText","Styles","|",
  129. "Paragraph","FontName","FontSize","|",
  130. "Bold","Italic",
  131. "Underline","Strikethrough","|","Superscript","Subscript","|",
  132. "JustifyLeft","JustifyCenter","JustifyRight","JustifyFull"];
  133. oEdit1.RENDER(document.getElementById("idTemporary").innerHTML);
  134. </script>
  135.               </td>
  136.             </tr>
  137.             <tr>
  138.               <td width="13%" align="right" bgcolor="#FFFFFF">提示:</td>
  139.               <td width="87%" colspan="2" bgcolor="#FFFFFF">
  140.   回车可用Shift+Enter   </td>
  141.             </tr>
  142.             <tr>
  143.               <td height="25" colspan=3 align="center" bgcolor="#FFFFFF"><table  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  144.                 <tr>
  145.                   <td bgcolor="#FFFFFF"><%
  146. Calendar cal = Calendar.getInstance();
  147. String year = "" + (cal.get(cal.YEAR));
  148. String month = "" + (cal.get(cal.MONTH) + 1);
  149. String filepath = "upfile/webeditimg/" + year + "/" + month;
  150. %>
  151.                       <object classid="CLSID:DE757F80-F499-48D5-BF39-90BC8BA54D8C" codebase="<%=request.getContextPath()%>/activex/webedit.cab#version=4,0,1,1" width=400 height=153 align="middle" id="webedit">
  152.                         <param name="Encode" value="utf-8">
  153.                         <param name="MaxSize" value="<%=Global.MaxSize%>">
  154.                         <!--上传字节-->
  155.                         <param name="ForeColor" value="(0,255,0)">
  156.                         <param name="BgColor" value="(0,0,0)">
  157.                         <param name="ForeColorBar" value="(255,255,255)">
  158.                         <param name="BgColorBar" value="(0,0,255)">
  159.                         <param name="ForeColorBarPre" value="(0,0,0)">
  160.                         <param name="BgColorBarPre" value="(200,200,200)">
  161.                         <param name="FilePath" value="<%=filepath%>">
  162.                         <!--上传后的文件需放在服务器上的路径-->
  163.                         <param name="Server" value="<%=request.getServerName()%>">
  164.                         <param name="Port" value="<%=request.getServerPort()%>">
  165.                         <param name="VirtualPath" value="<%=Global.virtualPath%>">
  166.                         <param name="PostScript" value="<%=Global.virtualPath%>/doc_abstract_do.jsp">
  167.                     </object></td>
  168.                 </tr>
  169.               </table></td>
  170.             </tr>
  171.             <tr>
  172.               <td height="20" colspan=3 align=center bgcolor="#FFFFFF">
  173. &nbsp;
  174. &nbsp;
  175.       &nbsp;&nbsp;&nbsp;&nbsp;
  176.       <input name="Submit" type="button" class="singleboarder" value=" 提 交 " onClick="return SubmitWithFile()">      &nbsp;&nbsp;&nbsp;
  177.       <input name="Submit" type="button" class="singleboarder" value=" 提 交(不上传文件) " onClick="return SubmitWithoutFile()">      &nbsp;&nbsp;&nbsp;&nbsp;
  178.       <input name="cmdcancel" type="button" class="singleboarder" onClick="ClearAll()" value=" 清 空 ">
  179.       &nbsp;(摘要不支持附件上传)</td>
  180.             </tr>
  181.           </table>
  182.     </form>
  183. <br></TD>
  184.   </TR>
  185. </TABLE>
  186. </body>
  187. </html>