<%@ page contentType="text/xml; charset=UTF-8" language="java"%> <%@ page import ="com.sysmodel.datamodel.xmlmodel.ModelFactory, com.sysmodel.datamodel.xmlmodel.able.SysModel, com.sysmodel.datamodel.xmlmodel.impl.MdpAttributeImpl, com.sysmodel.datamodel.xmlmodel.able.MdpClass, com.sysmodel.datamodel.xmlmodel.able.MdpAttribute, java.util.*" %> <% SysModel sysmodel = ModelFactory.getSysmodel(); String classid = request.getParameter("classid") == null ? "0" : request.getParameter("classid"); String name = request.getParameter("name") == null ? "" : request.getParameter("name"); String gettype = request.getParameter("gettype") == null ? "all" : request.getParameter("gettype"); MdpClass MdpClass = sysmodel.getMdpClassByClassID(Integer.parseInt(classid)); ArrayList Attributes = (ArrayList)MdpClass.getAllMdpAttributes(); out.print(""); if(name.equals("")){ for (int i = 0; i < Attributes.size(); i++) { MdpAttributeImpl MdpAttributeImpl = (MdpAttributeImpl) Attributes.get(i); if(gettype.equals("all")){ out.print(""+MdpAttributeImpl.getName()+""); out.print(""+MdpAttributeImpl.getDescription()+""); } else if (gettype.equals("constant") && MdpAttributeImpl.getReferenceType() != 0){ out.print(""+MdpAttributeImpl.getName()+""); out.print(""+MdpAttributeImpl.getDescription()+""); } else if (gettype.equals("date") && MdpAttributeImpl.getDataType().equals("date")){ out.print(""+MdpAttributeImpl.getName()+""); out.print(""+MdpAttributeImpl.getDescription()+""); } else if (gettype.equals("text") && MdpAttributeImpl.getReferenceType() == 0 && !MdpAttributeImpl.getDataType().equals("date")){ out.print(""+MdpAttributeImpl.getName()+""); out.print(""+MdpAttributeImpl.getDescription()+""); } } } else { MdpAttribute MdpAttribute = MdpClass.getMdpAttributeByName(name); if(MdpAttribute.getReferenceType() == 1 && MdpAttribute.getReference().getReferenceTable() != null){ MdpClass mdpClass = sysmodel.getMdpClassByClassID(Integer.parseInt(MdpAttribute.getReference().getReferenceTable())); List attributes = mdpClass.getAllMdpAttributes(); for (int i = 0; i < attributes.size(); i++) { MdpAttributeImpl MdpAttributeImpl = (MdpAttributeImpl) attributes.get(i); out.print(""+MdpAttributeImpl.getName()+""); out.print(""+MdpAttributeImpl.getDescription()+""); } } } out.print(""); %>