%@ page contentType="text/html; charset=UTF-8" language="java" %>
<%@ page language="java"
import="java.util.*,com.sysmodel.listmodel.xmlmodel.impl.FormListImpl,
com.sysmodel.listmodel.xmlmodel.impl.QueryFieldImpl,
com.sysmodel.xformmodel.importcontrol.TextControl,
com.sysmodel.datamodel.xmlmodel.impl.MdpAttributeImpl,
com.sysmodel.datamodel.xmlmodel.able.SysModel,
com.sysmodel.datamodel.xmlmodel.ModelFactory,
com.sysmodel.datamodel.xmlmodel.able.MdpClass,
com.sysmodel.xformmodel.importcontrol.TreeControl,
com.sysmodel.listmodel.xmlmanager.xmlobjdll.ListModeldllImpl"%>
<%
String listid = request.getParameter("listid") == null ? "" : request.getParameter("listid");
String classid = request.getParameter("classid") == null ? "0" : request.getParameter("classid");
String controltype = "tree";
String dataName = request.getParameter("dataName") == null ? "" : request.getParameter("dataName");
String label = request.getParameter("label") == null ? "" : request.getParameter("label");
String operator = request.getParameter("operator") == null ? "" : request.getParameter("operator");
String size = request.getParameter("size") == null ? "" : request.getParameter("size");
String action = request.getParameter("action") == null ? "" : request.getParameter("action");
String leafonly = request.getParameter("leafonly") == null ? "" : request.getParameter("leafonly");
String oLabel = request.getParameter("oLabel") == null ? "" : request.getParameter("oLabel");
String oDataName = request.getParameter("oDataName") == null ? "" : request.getParameter("oDataName");
FormListImpl FormList = null;
if(session.getAttribute("FormList"+listid) == null){
return;
} else {
FormList = (FormListImpl)session.getAttribute("FormList"+listid);
QueryFieldImpl queryField = new QueryFieldImpl();
queryField.setClassid(Integer.parseInt(classid));
queryField.setDataName(dataName);
queryField.setLabel(label);
queryField.setOperator(operator);
queryField.setControlType(controltype);
TextControl TextControl=new TextControl();
TextControl.setSize(size);
queryField.setControl(TextControl);
SysModel sysmodel = ModelFactory.getSysmodel();
MdpClass MdpClass = sysmodel.getMdpClassByClassID(Integer.parseInt(classid));
MdpAttributeImpl MdpAttribute = (MdpAttributeImpl)MdpClass.getMdpAttributeByName(dataName);
String referenceTable = "";
String type = "";
String storeCode = "";
if ( MdpAttribute.getReference()== null){
return ;
}else {
referenceTable = MdpAttribute.getReference().getReferenceTable();
storeCode = MdpAttribute.getReference().getStoreName();
type = MdpAttribute.getReferenceType() + "";
TreeControl TreeControl = new TreeControl();
TreeControl.setReferenceTable(referenceTable);
TreeControl.setStoreCode(storeCode);
TreeControl.setType(type);
TreeControl.setSize(size);
TreeControl.setLeafonly(new Boolean(leafonly).booleanValue());
queryField.setControl(TreeControl);
ArrayList QueryFields = FormList.getQueryFields();
ListModeldllImpl ListModeldllImpl = new ListModeldllImpl();
if(action.equals("add")){
QueryFields.add(queryField);
}else if (action.equals("edit")){
ListModeldllImpl.updateQueryField(FormList , queryField , oDataName , oLabel);
}
session.setAttribute("FormList"+listid,FormList);
%>
<%}}%>