treeExc.jsp 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <%@ page contentType="text/html; charset=UTF-8" language="java" %>
  2. <%@ page language="java"
  3. import="java.util.*,
  4. com.sysmodel.collectmodel.xmlmodel.able.FormCollection,
  5. com.sysmodel.datamodel.xmlmodel.ModelFactory,
  6. com.sysmodel.datamodel.xmlmodel.impl.MdpClassImpl,
  7. com.sysmodel.datamodel.xmlmodel.able.SysModel,
  8. com.sysmodel.datamodel.xmlmodel.able.MdpAttribute,
  9. com.sysmodel.collectmodel.xmlmodel.impl.ReportFieldImpl,
  10. com.sysmodel.xformmodel.importcontrol.TreeControl,
  11. com.sysmodel.xformmodel.impl.ValidateImpl,
  12. com.sysmodel.collectmodel.xmlmodel.impl.PageBodyImpl,
  13. com.sysmodel.collectmodel.xmlmanager.xmlobjdll.CollectModeldllImpl"%>
  14. <%
  15. String pageid = request.getParameter("pageid") == null ? "" : request.getParameter("pageid");
  16. String label = request.getParameter("label") == null ? "" : request.getParameter("label");
  17. String name = request.getParameter("name") == null ? "" : request.getParameter("name");
  18. String colspan = request.getParameter("colspan") == null ? "" : request.getParameter("colspan");
  19. String need = request.getParameter("need") == null ? "false" : request.getParameter("need");
  20. String action = request.getParameter("action") == null ? "" : request.getParameter("action");
  21. String oName = request.getParameter("oName") == null ? "" : request.getParameter("oName");
  22. String leafonly = request.getParameter("leafonly") == null ? "false" : request.getParameter("leafonly");
  23. String size = request.getParameter("size") == null ? "" : request.getParameter("size");
  24. String parentCode = request.getParameter("parentCode") == null ? "" : request.getParameter("parentCode");
  25. String order = request.getParameter("order") == null ? "" : request.getParameter("order");
  26. SysModel sysmodel = ModelFactory.getSysmodel();
  27. MdpClassImpl MdpClass = null;
  28. FormCollection FormCollection = null;
  29. if(session.getAttribute("FormCollect"+pageid) == null ){
  30. return;
  31. } else {
  32. FormCollection = (FormCollection)session.getAttribute("FormCollect"+pageid);
  33. ReportFieldImpl ReportFieldImpl = new ReportFieldImpl();
  34. int iclassid = Integer.parseInt(FormCollection.getClassid());
  35. MdpClass = (MdpClassImpl)sysmodel.getMdpClassByClassID(iclassid);
  36. ReportFieldImpl.setLabel(label) ;
  37. ReportFieldImpl.setName(name);
  38. ReportFieldImpl.setControlType("tree");
  39. if(!colspan.equals("")){
  40. ReportFieldImpl.setColspan(colspan);
  41. }
  42. TreeControl TreeControl = new TreeControl();
  43. MdpAttribute MdpAttribute = MdpClass.getMdpAttributeByName(name);
  44. TreeControl.setReferenceTable(MdpAttribute.getReference().getReferenceTable());
  45. TreeControl.setStoreCode(MdpAttribute.getReference().getStoreName());
  46. TreeControl.setDisplayName(MdpAttribute.getReference().getDisplayName());
  47. TreeControl.setSize(size);
  48. TreeControl.setLeafonly(new Boolean(leafonly).booleanValue());
  49. TreeControl.setParentCode(parentCode);
  50. TreeControl.setType(MdpAttribute.getReferenceType()+"");
  51. ReportFieldImpl.setControl(TreeControl);
  52. ValidateImpl ValidateImpl = new ValidateImpl();
  53. ValidateImpl.setNeed(new Boolean(need).booleanValue());
  54. ReportFieldImpl.setValidate(ValidateImpl);
  55. CollectModeldllImpl CollectModeldllImpl = new CollectModeldllImpl();
  56. if(action.equals("add")){
  57. PageBodyImpl PageBodyImpl = (PageBodyImpl)FormCollection.getPageBody();
  58. PageBodyImpl.addReportField(ReportFieldImpl);
  59. }else if(action.equals("edit")){
  60. CollectModeldllImpl.updateReportField(FormCollection , ReportFieldImpl , oName);
  61. }
  62. session.setAttribute("FormCollect"+pageid , FormCollection);
  63. %>
  64. <script type="text/javascript">
  65. var url = window.opener.location.href;
  66. url = url.replace("sessionReload=true","sessionReload=false");
  67. window.opener.location.replace(url);
  68. window.close();
  69. </script>
  70. <%} %>