1757230c3b15a898d32dee21112535caf229dcc1.svn-base 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <%@ page contentType="text/html; charset=UTF-8" language="java" %>
  2. <%@ page language="java"
  3. import="
  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.SelectControl,
  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 dojoInuptType = request.getParameter("dojoInuptType") == null ? "" : request.getParameter("dojoInuptType");
  23. SysModel sysmodel = ModelFactory.getSysmodel();
  24. MdpClassImpl MdpClass = null;
  25. FormCollection FormCollection = null;
  26. if(session.getAttribute("FormCollect"+pageid) == null ){
  27. return;
  28. } else {
  29. FormCollection = (FormCollection)session.getAttribute("FormCollect"+pageid);
  30. ReportFieldImpl ReportFieldImpl = new ReportFieldImpl();
  31. int iclassid = Integer.parseInt(FormCollection.getClassid());
  32. MdpClass = (MdpClassImpl)sysmodel.getMdpClassByClassID(iclassid);
  33. ReportFieldImpl.setLabel(label) ;
  34. ReportFieldImpl.setName(name);
  35. ReportFieldImpl.setControlType("select");
  36. if(!colspan.equals("")){
  37. ReportFieldImpl.setColspan(colspan);
  38. }
  39. SelectControl SelectControl = new SelectControl();
  40. MdpAttribute MdpAttribute = MdpClass.getMdpAttributeByName(name);
  41. SelectControl.setConstantName(MdpAttribute.getReference().getReferenceTable());
  42. ReportFieldImpl.setControl(SelectControl);
  43. ValidateImpl ValidateImpl = new ValidateImpl();
  44. ValidateImpl.setNeed(new Boolean(need).booleanValue());
  45. ValidateImpl.setDojoType(dojoInuptType);
  46. ReportFieldImpl.setValidate(ValidateImpl);
  47. CollectModeldllImpl CollectModeldllImpl = new CollectModeldllImpl();
  48. if(action.equals("add")){
  49. PageBodyImpl PageBodyImpl = (PageBodyImpl)FormCollection.getPageBody();
  50. PageBodyImpl.addReportField(ReportFieldImpl);
  51. }else if(action.equals("edit")){
  52. CollectModeldllImpl.updateReportField(FormCollection , ReportFieldImpl , oName);
  53. }
  54. session.setAttribute("FormCollect"+pageid , FormCollection);
  55. %>
  56. <script type="text/javascript">
  57. var url = window.opener.location.href;
  58. url = url.replace("sessionReload=true","sessionReload=false");
  59. window.opener.location.replace(url);
  60. window.close();
  61. </script>
  62. <%} %>