c827768ea5d735c2655e4466b65896029e1ce666.svn-base 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <%@ page import="net.sf.json.*"%>
  2. <%@ page pageEncoding="UTF-8"%>
  3. <%@ page contentType="text/html; charset=UTF-8" language="java" %>
  4. <%@ page
  5. import ="java.util.*"%>
  6. <%@ page language="java"
  7. import="com.sysmodel.XFormFactory,
  8. com.sysmodel.listmodel.xmlmodel.impl.FormListImpl,
  9. com.sysmodel.datamodel.xmlmodel.ModelFactory,
  10. com.sysmodel.datamodel.xmlmodel.able.SysModel"%>
  11. <%
  12. String begin=request.getParameter("start");
  13. String size=request.getParameter("limited");
  14. String callback=request.getParameter("callback");
  15. request.setCharacterEncoding("GBK");
  16. List list = XFormFactory.getXFormModel().getFormLists();
  17. String moduleType = request.getParameter("type") == null? "" :request.getParameter("type");
  18. if(moduleType.equals("")){
  19. list = XFormFactory.getXFormModel().getFormLists();
  20. }else{
  21. list = XFormFactory.getXFormModel().getFormListByType(moduleType);
  22. }
  23. try{
  24. int index = Integer.parseInt(begin);
  25. int pageSize = Integer.parseInt(size);
  26. System.out.println(pageSize);
  27. String json = callback+"({totalProperty:100,root:[";
  28. SysModel sysmodel = ModelFactory.getSysmodel();
  29. FormListImpl FormList = new FormListImpl();
  30. for (int i = 0; i < list.size(); i++) {
  31. FormList = (FormListImpl) list.get(i);
  32. String listid = FormList.getListid() == null ? "" : FormList.getListid();
  33. String title = FormList.getDescription() == null ? "" :FormList.getDescription();
  34. String refreshTime = FormList.getRefreshTime() == null ? "" :FormList.getRefreshTime();
  35. String titleWidth = FormList.getListWidth() + "";
  36. String type1 =sysmodel.getMdpModuleByCode(FormList.getType()).getName() == null ? "" :sysmodel.getMdpModuleByCode(FormList.getType()).getName();
  37. String del = "<a href =\"editExc.jsp?listid=" + FormList.getListid() +"&action=del\">删除</a>";
  38. Map map = new HashMap();
  39. map.put("listid",listid);
  40. map.put("title", title);
  41. map.put("refreshTime",refreshTime);
  42. map.put("titleWidth", titleWidth);
  43. map.put("type", type1);
  44. map.put("del", del);
  45. JSONObject jsonMap = JSONObject.fromObject(map);
  46. System.out.println(jsonMap);
  47. json += jsonMap.toString();
  48. if (i != pageSize) {
  49. json += ",";
  50. }
  51. }
  52. json += "]});";
  53. System.out.println();
  54. System.out.println(json);
  55. System.out.println();
  56. response.getWriter().write(json);
  57. }catch(Exception e){
  58. }
  59. %>