xmlcontrasttable.jsp 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <%@ page contentType="text/html; charset=UTF-8" language="java"%>
  2. <%@ page import="java.util.*"%>
  3. <%@ page
  4. import="com.sysmodel.datamodel.xmlmodel.ModelFactory,
  5. com.sysmodel.datamodel.xmlmodel.able.MdpConstant,
  6. com.sysmodel.datamodel.xmlmodel.able.SysModel,
  7. com.persistence.DBdll.SysOperator,
  8. com.sysmodel.datamodel.xmlmodel.able.MdpClass"%>
  9. <%
  10. String sourcecode = request.getParameter("sourcecode");
  11. SysModel sysmodel = ModelFactory.getSysmodel();
  12. if(sourcecode == null) return;
  13. SysOperator SysOperator = new SysOperator();
  14. ArrayList xmltablelist = sysmodel.getMdpClassByDataSource(Integer.parseInt(sourcecode));
  15. ArrayList xmlMdpConstantlist = sysmodel.getMdpConstantByDataSource(Integer.parseInt(sourcecode));
  16. %>
  17. <%!
  18. SysModel sysmodel = ModelFactory.getSysmodel();
  19. public String getClassIds(int number){
  20. StringBuffer sb = new StringBuffer();
  21. //提供的推荐编码个数
  22. int getNum = 5;
  23. int iToNumber = number + 100;
  24. sb.append("{"+number + "~" + iToNumber + "推荐编号 : ");
  25. int iget = 0;
  26. for(int i = number; i < iToNumber; i ++){
  27. if(iget > getNum) break;
  28. if(sysmodel.getMdpClassByClassID(i) == null){
  29. sb.append(" "+ i +" ");
  30. iget ++;
  31. }
  32. }
  33. sb.append("}");
  34. return sb.toString();
  35. }
  36. public boolean isTableExist(String tableName , ArrayList xmltablelist,ArrayList MdpConstantlist){
  37. boolean flag = true;
  38. int iFalg = 0;
  39. for (int i = 0 ; i < xmltablelist.size() ; i++){
  40. MdpClass mdpClass = (MdpClass)xmltablelist.get(i);
  41. if(mdpClass.getName().toUpperCase().equals(tableName.toUpperCase())){
  42. iFalg ++;
  43. }
  44. }
  45. for (int i = 0 ; i < MdpConstantlist.size() ; i++){
  46. MdpConstant mdpConstant = (MdpConstant)MdpConstantlist.get(i);
  47. if(mdpConstant.getCodeName().toUpperCase().equals(tableName.toUpperCase())){
  48. iFalg ++;
  49. }
  50. }
  51. if (iFalg > 0){
  52. flag = false;
  53. }
  54. return flag;
  55. }
  56. %>
  57. <HTML>
  58. <HEAD>
  59. <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  60. <TITLE></TITLE>
  61. <link rel="stylesheet" href="../../../../styles/css.css" type="text/css"></link>
  62. <script type="text/javascript" src="../../../../scripts/dojo/dojo/dojo.js"
  63. djConfig="isDebug: false, parseOnLoad: true"></script>
  64. <script type="text/javascript">
  65. dojo.require("dijit.form.Form");
  66. dojo.require("dijit.form.FilteringSelect");
  67. dojo.require("dijit.form.Button");
  68. dojo.require("dijit.Tooltip");
  69. </script>
  70. <style type="text/css">
  71. @import "../../../../scripts/dojo/dojo/resources/dojo.css";
  72. @import "../../../../scripts/dojo/dijit/themes/tundra/tundra.css";
  73. @import "../../../../scripts/dojo/dijit/themes/tundra/tundra_rtl.css";
  74. @import "../../../../scripts/dojo/dijit/tests/css/dijitTests.css";
  75. </style>
  76. <script type="text/javascript" src="../select.js"></script>
  77. </HEAD>
  78. <body class="tundra">
  79. <form dojoType="dijit.form.Form" name="form1" method="post" action="">
  80. <div id=total>
  81. <div class="whiteborder">
  82. <div class="titback">
  83. <div class="floatleft"><img src="../../../../images/index/arrow1.gif" alt="1" width="20" height="24" /></div>
  84. <div class="dropshadow">数据库中表的管理—(列出配置文件没有管理到的表)</div>
  85. <div class="clear"></div>
  86. </div>
  87. <div class="report">
  88. <table align="center" id="SortTable512_1" width="100%"
  89. cellpadding="1" cellspacing="1" class="ltab2">
  90. <tr>
  91. <td width="65%" valign="top">
  92. <table align="center" width="100%" border="0" cellpadding="1"cellspacing="1" class="ltab2">
  93. <tr class="TableBgColorAsh">
  94. <td width="45%" align="center">
  95. <select name="select" size="15" class="SelectScroll" multiple id="role1" style="width:80%">
  96. <%ArrayList tables = SysOperator.getTableNames(Integer.parseInt(sourcecode));
  97. for (int j = 0 ; j < tables.size() ; j++){
  98. String tableName = (String)tables.get(j);
  99. if (isTableExist(tableName, xmltablelist,xmlMdpConstantlist)){
  100. %>
  101. <option value="<%=tableName%>"> <%=tableName%> </option>
  102. <% }
  103. }
  104. %>
  105. </select> </td>
  106. <td width="10%" align="center"><input name="button" type="button" class="button2"
  107. style="cursor:hand" onClick="move(this.form.role1,this.form.role2);"
  108. value=" &gt;&gt; "/>
  109. <br>
  110. <br>
  111. <input name="button" type="button" class="button2"
  112. style="cursor:hand" onClick="move(this.form.role2,this.form.role1);"
  113. value=" &lt;&lt; "/></td>
  114. <td width="45%" align="center" valign="middle">
  115. <select name="select" size="15" multiple class="SelectScroll" id="role2" style="width:80%">
  116. </select></td>
  117. </tr>
  118. <tr class="TableBgColorBlack">
  119. <td colspan="3" align="center">
  120. <button id="save" dojoType="dijit.form.Button" onClick='checkConfig();' type="button" iconClass="plusIcon">
  121. 开始删除(高危动作,不明确的表请不要随便删除!!!)
  122. </button>
  123. </td>
  124. </tr>
  125. </table>
  126. </td>
  127. <td width="40%" height="100%" valign="top">
  128. <div id="boxIdea" align="left" style="width:98%;height:98%;border:1px solid #999999;"> </div>
  129. </td>
  130. </tr>
  131. </table>
  132. </div>
  133. </div>
  134. </div>
  135. </form>
  136. <script language="JavaScript">
  137. var indexOfCheck = 0;
  138. var role2=document.all.item("role2");
  139. function checkConfig() {
  140. indexOfCheck = 0
  141. var boxIdea=document.all.item("boxIdea");
  142. boxIdea.innerHTML = "";
  143. if(role2.options.length == 0){
  144. alert("请选则进行验证的表对象!");
  145. return;
  146. }
  147. var CodeName = role2.options[0].value;
  148. checkOneObj(CodeName)
  149. }
  150. function checkOneObj(CodeName){
  151. if(CodeName=="") return;
  152. createXMLHttpRequest();
  153. var strA = "";
  154. var moduleObj = dojo.byId('module');
  155. XMLHttpReq.open("POST","deleteExc.jsp?sourcecode=<%=sourcecode%>&CodeName=" + CodeName,false);
  156. XMLHttpReq.setRequestHeader("Content-Length",strA.length);
  157. XMLHttpReq.setRequestHeader("Content-type","application/x-www-form-urlencoded");
  158. XMLHttpReq.send(strA);
  159. var boxIdea=document.all.item("boxIdea");
  160. boxIdea.innerHTML = boxIdea.innerHTML + XMLHttpReq.responseText;
  161. indexOfCheck = indexOfCheck + 1;
  162. if(indexOfCheck < role2.options.length){
  163. checkOneObj(role2.options[indexOfCheck].value);
  164. }else{
  165. return;
  166. }
  167. }
  168. // End -->
  169. </script>
  170. </BODY>
  171. </HTML>