e795569efcce8dcfbb548e7af3a863433196c48a.svn-base 3.4 KB

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