1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <%@ 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.CheckBoxControl,
- 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 singleLine = request.getParameter("singleLine") == null ? "false" : request.getParameter("singleLine");
- 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("checkbox");
- if(!colspan.equals("")){
- ReportFieldImpl.setColspan(colspan);
- }
- CheckBoxControl CheckBoxControl = new CheckBoxControl();
- MdpAttribute MdpAttribute = MdpClass.getMdpAttributeByName(name);
- CheckBoxControl.setConstantName(MdpAttribute.getReference().getReferenceTable());
- CheckBoxControl.setSingleLine(new Boolean(singleLine).booleanValue());
- ReportFieldImpl.setControl(CheckBoxControl);
-
- 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>
- <%} %>
|