12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <%@ page contentType="text/html; charset=UTF-8" language="java" %>
- <%@ page language="java"
- import="java.util.*,
- com.sysmodel.collectmodel.xmlmodel.able.FormCollection,
- com.sysmodel.datamodel.xmlmodel.ModelFactory,
- com.sysmodel.datamodel.xmlmodel.impl.MdpClassImpl,
- com.sysmodel.datamodel.xmlmodel.able.SysModel,
- com.sysmodel.datamodel.xmlmodel.able.MdpAttribute,
- com.sysmodel.collectmodel.xmlmodel.impl.ReportFieldImpl,
- com.sysmodel.xformmodel.importcontrol.TreeControl,
- com.sysmodel.xformmodel.impl.ValidateImpl,
- com.sysmodel.collectmodel.xmlmodel.impl.PageBodyImpl,
- com.sysmodel.collectmodel.xmlmanager.xmlobjdll.CollectModeldllImpl"%>
- <%
- String pageid = request.getParameter("pageid") == null ? "" : request.getParameter("pageid");
- String label = request.getParameter("label") == null ? "" : request.getParameter("label");
- String name = request.getParameter("name") == null ? "" : request.getParameter("name");
- String colspan = request.getParameter("colspan") == null ? "" : request.getParameter("colspan");
- String need = request.getParameter("need") == null ? "false" : request.getParameter("need");
- String action = request.getParameter("action") == null ? "" : request.getParameter("action");
- String oName = request.getParameter("oName") == null ? "" : request.getParameter("oName");
- String leafonly = request.getParameter("leafonly") == null ? "false" : request.getParameter("leafonly");
- String size = request.getParameter("size") == null ? "" : request.getParameter("size");
- String parentCode = request.getParameter("parentCode") == null ? "" : request.getParameter("parentCode");
- String order = request.getParameter("order") == null ? "" : request.getParameter("order");
-
- SysModel sysmodel = ModelFactory.getSysmodel();
- MdpClassImpl MdpClass = null;
- FormCollection FormCollection = null;
-
-
- if(session.getAttribute("FormCollect"+pageid) == null ){
- return;
- } else {
- FormCollection = (FormCollection)session.getAttribute("FormCollect"+pageid);
- ReportFieldImpl ReportFieldImpl = new ReportFieldImpl();
- int iclassid = Integer.parseInt(FormCollection.getClassid());
- MdpClass = (MdpClassImpl)sysmodel.getMdpClassByClassID(iclassid);
-
- ReportFieldImpl.setLabel(label) ;
- ReportFieldImpl.setName(name);
- ReportFieldImpl.setControlType("tree");
- if(!colspan.equals("")){
- ReportFieldImpl.setColspan(colspan);
- }
- TreeControl TreeControl = new TreeControl();
- MdpAttribute MdpAttribute = MdpClass.getMdpAttributeByName(name);
- TreeControl.setReferenceTable(MdpAttribute.getReference().getReferenceTable());
- TreeControl.setStoreCode(MdpAttribute.getReference().getStoreName());
- TreeControl.setDisplayName(MdpAttribute.getReference().getDisplayName());
- TreeControl.setSize(size);
- TreeControl.setLeafonly(new Boolean(leafonly).booleanValue());
- TreeControl.setParentCode(parentCode);
- TreeControl.setType(MdpAttribute.getReferenceType()+"");
-
- ReportFieldImpl.setControl(TreeControl);
-
- ValidateImpl ValidateImpl = new ValidateImpl();
- ValidateImpl.setNeed(new Boolean(need).booleanValue());
- ReportFieldImpl.setValidate(ValidateImpl);
-
- CollectModeldllImpl CollectModeldllImpl = new CollectModeldllImpl();
- if(action.equals("add")){
- PageBodyImpl PageBodyImpl = (PageBodyImpl)FormCollection.getPageBody();
- PageBodyImpl.addReportField(ReportFieldImpl);
- }else if(action.equals("edit")){
- CollectModeldllImpl.updateReportField(FormCollection , ReportFieldImpl , oName);
- }
-
- session.setAttribute("FormCollect"+pageid , FormCollection);
-
- %>
- <script type="text/javascript">
- var url = window.opener.location.href;
- url = url.replace("sessionReload=true","sessionReload=false");
- window.opener.location.replace(url);
- window.close();
- </script>
- <%} %>
|