getClassids.jsp 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. <%@ page contentType="text/html; charset=UTF-8" language="java"%>
  2. <%@ page
  3. import ="com.sysmodel.datamodel.xmlmodel.ModelFactory,
  4. com.sysmodel.datamodel.xmlmodel.able.SysModel,
  5. com.sysmodel.datamodel.xmlmodel.impl.MdpClassImpl,
  6. java.util.*"
  7. %>
  8. <%
  9. SysModel sysmodel = ModelFactory.getSysmodel();
  10. ArrayList mdpClasses = null;
  11. String type= request.getParameter("type") == null ? "" : request.getParameter("type");
  12. if(type.equals("")){
  13. mdpClasses = sysmodel.getMdpClasses();
  14. } else {
  15. String action= request.getParameter("action") == null ? "" : request.getParameter("action");
  16. if(action.equals("all"))
  17. mdpClasses = sysmodel.getAllChildMdpClassByType(type);
  18. else
  19. mdpClasses = sysmodel.getMdpClassByType(type);
  20. }
  21. out.print("<root>");
  22. for (int i = 0; i < mdpClasses.size(); i++) {
  23. MdpClassImpl mdpClass = (MdpClassImpl) mdpClasses.get(i);
  24. out.print("<classid>"+mdpClass.getClassid()+"</classid>");
  25. out.print("<description>"+mdpClass.getDescription()+"</description>");
  26. }
  27. out.print("</root>");
  28. %>