1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <%@ 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,
- java.util.*"
- %>
- <%
- SysModel sysmodel = ModelFactory.getSysmodel();
- String classid = request.getParameter("classid") == null ? "0" : request.getParameter("classid");
- String gettype = request.getParameter("gettype") == null ? "all" : request.getParameter("gettype");
- MdpClass MdpClass = sysmodel.getMdpClassByClassID(Integer.parseInt(classid));
- ArrayList Attributes = (ArrayList)MdpClass.getAllMdpAttributes();
- StringBuffer sb = new StringBuffer();
- sb.append("<root>");
- for (int i = 0; i < Attributes.size(); i++) {
- MdpAttributeImpl MdpAttributeImpl = (MdpAttributeImpl) Attributes.get(i);
-
- if(gettype.equals("all")){
-
- sb.append("<name>"+MdpAttributeImpl.getName()+"</name>");
- sb.append("<description>"+MdpAttributeImpl.getDescription()+"</description>");
-
- } else if (gettype.equals("constant") && MdpAttributeImpl.getReferenceType() != 0){
-
- sb.append("<name>"+MdpAttributeImpl.getName()+"</name>");
- sb.append("<description>"+MdpAttributeImpl.getDescription()+"</description>");
-
- } else if (gettype.equals("date") && MdpAttributeImpl.getDataType().equals("date")){
-
- sb.append("<name>"+MdpAttributeImpl.getName()+"</name>");
- sb.append("<description>"+MdpAttributeImpl.getDescription()+"</description>");
-
- } else if (gettype.equals("text")
- && MdpAttributeImpl.getReferenceType() == 0
- && !MdpAttributeImpl.getDataType().equals("date")){
-
- sb.append("<name>"+MdpAttributeImpl.getName()+"</name>");
- sb.append("<description>"+MdpAttributeImpl.getDescription()+"</description>");
-
- }
- }
- sb.append("</root>");
- out.print(sb.toString());
- %>
|