TreeExc.jsp 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <%@ page contentType="text/html; charset=UTF-8" language="java" %>
  2. <%@ page language="java"
  3. import="java.util.*,com.sysmodel.listmodel.xmlmodel.impl.FormListImpl,
  4. com.sysmodel.listmodel.xmlmodel.impl.QueryFieldImpl,
  5. com.sysmodel.xformmodel.importcontrol.TextControl,
  6. com.sysmodel.datamodel.xmlmodel.impl.MdpAttributeImpl,
  7. com.sysmodel.datamodel.xmlmodel.able.SysModel,
  8. com.sysmodel.datamodel.xmlmodel.ModelFactory,
  9. com.sysmodel.datamodel.xmlmodel.able.MdpClass,
  10. com.sysmodel.xformmodel.importcontrol.TreeControl,
  11. com.sysmodel.listmodel.xmlmanager.xmlobjdll.ListModeldllImpl"%>
  12. <%
  13. String listid = request.getParameter("listid") == null ? "" : request.getParameter("listid");
  14. String classid = request.getParameter("classid") == null ? "0" : request.getParameter("classid");
  15. String controltype = "tree";
  16. String dataName = request.getParameter("dataName") == null ? "" : request.getParameter("dataName");
  17. String label = request.getParameter("label") == null ? "" : request.getParameter("label");
  18. String operator = request.getParameter("operator") == null ? "" : request.getParameter("operator");
  19. String size = request.getParameter("size") == null ? "" : request.getParameter("size");
  20. String action = request.getParameter("action") == null ? "" : request.getParameter("action");
  21. String leafonly = request.getParameter("leafonly") == null ? "" : request.getParameter("leafonly");
  22. String oLabel = request.getParameter("oLabel") == null ? "" : request.getParameter("oLabel");
  23. String oDataName = request.getParameter("oDataName") == null ? "" : request.getParameter("oDataName");
  24. FormListImpl FormList = null;
  25. if(session.getAttribute("FormList"+listid) == null){
  26. return;
  27. } else {
  28. FormList = (FormListImpl)session.getAttribute("FormList"+listid);
  29. QueryFieldImpl queryField = new QueryFieldImpl();
  30. queryField.setClassid(Integer.parseInt(classid));
  31. queryField.setDataName(dataName);
  32. queryField.setLabel(label);
  33. queryField.setOperator(operator);
  34. queryField.setControlType(controltype);
  35. TextControl TextControl=new TextControl();
  36. TextControl.setSize(size);
  37. queryField.setControl(TextControl);
  38. SysModel sysmodel = ModelFactory.getSysmodel();
  39. MdpClass MdpClass = sysmodel.getMdpClassByClassID(Integer.parseInt(classid));
  40. MdpAttributeImpl MdpAttribute = (MdpAttributeImpl)MdpClass.getMdpAttributeByName(dataName);
  41. String referenceTable = "";
  42. String type = "";
  43. String storeCode = "";
  44. if ( MdpAttribute.getReference()== null){
  45. return ;
  46. }else {
  47. referenceTable = MdpAttribute.getReference().getReferenceTable();
  48. storeCode = MdpAttribute.getReference().getStoreName();
  49. type = MdpAttribute.getReferenceType() + "";
  50. TreeControl TreeControl = new TreeControl();
  51. TreeControl.setReferenceTable(referenceTable);
  52. TreeControl.setStoreCode(storeCode);
  53. TreeControl.setType(type);
  54. TreeControl.setSize(size);
  55. TreeControl.setLeafonly(new Boolean(leafonly).booleanValue());
  56. queryField.setControl(TreeControl);
  57. ArrayList QueryFields = FormList.getQueryFields();
  58. ListModeldllImpl ListModeldllImpl = new ListModeldllImpl();
  59. if(action.equals("add")){
  60. QueryFields.add(queryField);
  61. }else if (action.equals("edit")){
  62. ListModeldllImpl.updateQueryField(FormList , queryField , oDataName , oLabel);
  63. }
  64. session.setAttribute("FormList"+listid,FormList);
  65. %>
  66. <script type="text/javascript">
  67. var url = window.opener.location.href;
  68. url = url.replace("sessionReload=true","sessionReload=false");
  69. window.opener.location.replace(url);
  70. window.close();
  71. </script>
  72. <%}}%>