12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <%@ page contentType="text/html; charset=UTF-8" language="java" %>
- <%@ page language="java"
- import="
- 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.SelectControl,
- 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 dojoInuptType = request.getParameter("dojoInuptType") == null ? "" : request.getParameter("dojoInuptType");
-
- 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("select");
- if(!colspan.equals("")){
- ReportFieldImpl.setColspan(colspan);
- }
- SelectControl SelectControl = new SelectControl();
- MdpAttribute MdpAttribute = MdpClass.getMdpAttributeByName(name);
- SelectControl.setConstantName(MdpAttribute.getReference().getReferenceTable());
- ReportFieldImpl.setControl(SelectControl);
-
- ValidateImpl ValidateImpl = new ValidateImpl();
- ValidateImpl.setNeed(new Boolean(need).booleanValue());
- ValidateImpl.setDojoType(dojoInuptType);
- 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>
- <%} %>
|