12345678910111213141516171819202122232425262728293031323334353637 |
- <%@ 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.MdpModuleImpl,
- com.sysmodel.datamodel.xmlmodel.able.SysModel"%>
- <%
- String node = request.getParameter("node") == null ? "" : request.getParameter("node");
- SysModel sysmodel = ModelFactory.getSysmodel();
- ArrayList list1 = new ArrayList();
- if(node.equals("root") || node.equals("")){
- list1 = sysmodel.getMdpModulesByPcode("");
- } else {
- list1 = sysmodel.getMdpModulesByPcode(node);
- }
-
- StringBuffer sb = new StringBuffer();
- sb.append("[");
-
- for (int i = 0; i < list1.size(); i++) {
- MdpModuleImpl MdpModuleImpl=(MdpModuleImpl)list1.get(i);
- String name=MdpModuleImpl.getName()+"";
- String code=MdpModuleImpl.getCode();
- if(sysmodel.getMdpModulesByPcode(code).size()>0){
- sb.append("{id:'" + code + "',text:'"+name+"',leaf:false},");
- } else{
- sb.append("{id:'" + code + "',text:'"+name+"',leaf:true},");
- }
- }
- sb.deleteCharAt(sb.lastIndexOf(","));
- sb.append("]");
- System.out.println("node:"+ node);
- System.out.println("fjaksdlf:"+ sb);
- out.print(sb.toString());
- %>
|