designExc.jsp 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <%@ page contentType="text/html; charset=UTF-8" language="java" %>
  2. <%@ page language="java"
  3. import="com.sysmodel.XFormFactory,
  4. com.sysmodel.listmodel.xmlmodel.impl.FormListImpl,
  5. com.sysmodel.listmodel.xmlmodel.impl.*,
  6. com.sysmodel.listmodel.xmlmanager.xmlobjdll.ListModeldllable,
  7. com.sysmodel.listmodel.xmlmanager.xmlobjdll.ListModeldllImpl,
  8. java.util.ArrayList"%>
  9. <%
  10. String listid = request.getParameter("listid") == null ? "" : request.getParameter("listid");
  11. String deltype = request.getParameter("deltype") == null ? "" : request.getParameter("deltype");
  12. FormListImpl FormList = null;
  13. if(session.getAttribute("FormList"+listid) == null){
  14. return;
  15. } else {
  16. FormList = (FormListImpl)session.getAttribute("FormList"+listid);
  17. }
  18. if(!deltype.equals("")){
  19. if(deltype.equals("pagesize")){
  20. QueryListImpl QueryListImpl = (QueryListImpl)FormList.getQueryList();
  21. QueryListImpl.setPageSize(0);
  22. }
  23. else if(deltype.equals("pageorder")){
  24. QueryListImpl QueryListImpl = (QueryListImpl)FormList.getQueryList();
  25. QueryListImpl.setHaveOrder(false);
  26. }
  27. else if(deltype.equals("queryfield")){
  28. ArrayList list =FormList.getQueryFields();
  29. String classid = request.getParameter("classid") == null ? "0" : request.getParameter("classid");
  30. String fieldname = request.getParameter("fieldname") == null ? "" : request.getParameter("fieldname");
  31. String operator = request.getParameter("operator") == null ? "" : request.getParameter("operator");
  32. int iclassid = Integer.parseInt(classid);
  33. for (int i = 0 ; i < list.size() ; i++) {
  34. QueryFieldImpl QueryField = (QueryFieldImpl)list.get(i);
  35. if(QueryField.getClassid() == iclassid
  36. && QueryField.getDataName().equals(fieldname)
  37. && QueryField.getOperator().equals(operator)){
  38. list.remove(i);
  39. }
  40. }
  41. }
  42. else if(deltype.equals("pagetier")){
  43. QueryListImpl QueryListImpl = (QueryListImpl)FormList.getQueryList();
  44. ArrayList list = QueryListImpl.getlistFields();
  45. String classid = request.getParameter("classid") == null ? "0" : request.getParameter("classid");
  46. String fieldname = request.getParameter("fieldname") == null ? "" : request.getParameter("fieldname");
  47. String fieldlabel = request.getParameter("fieldlabel") == null ? "" : request.getParameter("fieldlabel");
  48. int iclassid = Integer.parseInt(classid);
  49. for (int i = 0 ; i < list.size() ; i++) {
  50. ListFieldImpl ListField = (ListFieldImpl)list.get(i);
  51. if(ListField.getClassid() == iclassid
  52. && ListField.getDataName().equals(fieldname)
  53. && ListField.getLabel().equals(fieldlabel)){
  54. list.remove(i);
  55. }
  56. }
  57. }
  58. }
  59. String doaction = request.getParameter("doaction") == null ? "" : request.getParameter("doaction");
  60. if(doaction.equals("reload")){
  61. FormListImpl FormListold =(FormListImpl)XFormFactory.getXFormModel().getFormList(listid);
  62. FormList = (FormListImpl)FormListold.clone();
  63. }
  64. if(doaction.equals("save")){
  65. ListModeldllable ListModeldll = new ListModeldllImpl();
  66. ListModeldll.updateFormList(FormList);
  67. }
  68. session.setAttribute("FormList"+listid,FormList);
  69. response.sendRedirect("design.jsp?listid="+listid+"&sessionReload=false");
  70. %>