123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <%@ page import="net.sf.json.*"%>
- <%@ page pageEncoding="UTF-8"%>
- <%@ page
- import ="java.util.*"%>
- <%@ page language="java"
- import="com.sysmodel.datamodel.xmlmodel.ModelFactory,
- com.sysmodel.datamodel.xmlmodel.impl.MdpConstantImpl,
- com.sysmodel.datamodel.xmlmodel.able.SysModel"%>
- <% request.setCharacterEncoding("GBK");
- SysModel sysmodel = ModelFactory.getSysmodel();
- List list = null;
-
- String type=request.getParameter("type") == null ? "" : request.getParameter("type");
-
- if(type.equals("")){
- list = sysmodel.getMdpConstants();
- }else{
- list = sysmodel.getMdpConstantByType(type);
- }
- System.out.print("type = " + type);
-
- String begin=request.getParameter("start");
- String size=request.getParameter("limit");
- String callback=request.getParameter("callback");
- int index = Integer.parseInt(begin);
- int pageSize = Integer.parseInt(size);
-
-
- try{
- String json = callback+"({totalProperty:100,root:[";
- for (int i = 0; i < list.size(); i++) {
- MdpConstantImpl MdpConstant = (MdpConstantImpl) list.get(i);
- Map map=new HashMap();
-
- map.put("CodeName","<a href=\"edit.jsp?name="+MdpConstant.getCodeName()+"\">"+MdpConstant.getCodeName()+"</a>");
- map.put("Description",MdpConstant.getDescription());
- map.put("TemplateName",sysmodel.getTemplateByName(MdpConstant.getTemplateName()).getDescription());
- map.put("RootFrom",MdpConstant.getRootFrom());
- map.put("DataSource",sysmodel.getDataSourceByCode(MdpConstant.getDataSource()).getDescription());
- map.put("isKeyCodeAuto",MdpConstant.isKeyCodeAuto());
- map.put("OrderProperty",MdpConstant.getOrderProperty());
- map.put("OrderMethod",MdpConstant.getOrderMethod());
- map.put("ConstantName",sysmodel.getMdpModuleByCode(MdpConstant.getType()).getName());
- map.put("del","<a href=\"editExc.jsp?action=del&name="+MdpConstant.getCodeName() +"\">删除</a>");
-
- JSONObject jsonMap = JSONObject.fromObject(map);
- System.out.println(jsonMap);
- json += jsonMap.toString();
- if (i != (list.size() - 1)) {
- json += ",";
- }
- }
- json += "]});";
- //System.out.println();
- //System.out.println(json);
- //System.out.println();
- response.getWriter().write(json);
- }catch(Exception e){
- System.out.println("json----error!!!");
- }%>
|