<%@page import="com.edeal.frontline.navigation.EdealBigTabsNavigation.BigTabsParams"%> <% /****************************************************************************** * Copyright (c) 2000-2004 e-Deal * * e-Deal S.A. * 55 rue Brillat Savarin * 75013 Paris * France * * T: +33 (0)1 53 80 80 30 * F: +33 (0)1 73 01 69 77 * http://www.e-deal.com * * La diffusion de ce code source sous quelque forme que ce soit sans * l'autorisation de E-DEAL est interdite. * * Vous êtes autorisés à modifier ce code source uniquement pour votre usage * propre et sous réserve que les mentions de copyright demeurent intactes. * * Ce code est fourni en l'état. Aucune garantie d'aucune sorte, explicite ou * implicite n'est donnée. En aucun cas E-DEAL ne pourra être tenu pour * responsable des dommages pouvant résulter de l'utilisation de ce code * source. * * ******************************************************************************/ %> <%@page language="java" session="true"%> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.*" %> <%@ page import="com.edeal.frontline.custom.*" %> <%@ page import="java.util.*" %> <%@ page import="java.io.*" %> <%@ page import="com.edeal.frontline.dataimport.*" %> <%@ page import="java.io.InputStream" %> <%@ page import="java.io.ByteArrayOutputStream" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <% final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); DataDictionary dico = context.getDataDictionary(); Vector codeError = (Vector) flRequest.getAttribute("codeError"); Vector fldError = (Vector) flRequest.getAttribute("fldError"); Vector fld = (Vector) flRequest.getAttribute("fld"); Vector fldValue = (Vector) flRequest.getAttribute("fldValue"); FrontlineLoadable objBean = (FrontlineLoadable) flRequest.getAttribute("objCurrentBean"); String objSQL = (String) flRequest.getAttribute("objSQL"); if (objBean == null) { try { objBean = (FrontlineLoadable)Class.forName("com.edeal.frontline." + objSQL + "Bean").newInstance(); } catch (ClassNotFoundException ex) { String customPackage = context.getContextParameter("CustomPackage"); if(!customPackage.endsWith(".")) customPackage += "."; objBean = (FrontlineLoadable)Class.forName(customPackage + objSQL + "Bean").newInstance(); } objBean.setContext(context); } String updateType = (String) flRequest.getAttribute("updateType"); BasicBean obj = (BasicBean) objBean; pageContext.setAttribute(objSQL+"Bean",obj); String objRadical = null; String objDisp = null; String objDisplay = null; ObjectsBean objB = null; try { objB = dico.getTable("sql",objSQL); objRadical = objB.getObjRadical(); }catch (FrontlineException e){} try { objDisp = objB.getObjDisplayLabel(); }catch (FieldNotInitializedException e){} try { objDisplay = objB.getObjDisplay(); }catch (FieldNotInitializedException e){} String id = null; try { id = obj.getID(); }catch (FieldNotInitializedException e){} String trlID = (String) flRequest.getAttribute("trlID"); String saveUrl = "/save_object_trash.fl?type=" + objSQL + (id != null ? "&id="+ id : "") + "&trlID=" + trlID; //+ "&successPage=/delete_trash.fl?id="+trlID; String deleteUrl = "/delete_trash.fl?trlID=" + trlID; request.setAttribute(objSQL,obj); String listCode = (String) flRequest.getParameter(BigTabsParams.CodeLC); String cu = ""; if (listCode.equals("TRSHREPLI")) { String sc = (String) flRequest.getParameter(BigTabsParams.SearchCriteria); cu = "process_trash_list_criteria.fl?lc=TRSHREPLI&init" + sc.split("&")[0]; } %> "> <% if (updateType != null && !updateType.equalsIgnoreCase("no")) { %> <% } %> <% for (int i = 0; i < fld.size(); i ++) { String fldName = (String) fld.elementAt(i); if (fldName != null && !fldName.equals(objRadical+"ID")) { FieldBean fldbean = dico.getFieldByName((String) fld.elementAt(i)); boolean isREF = false; try { String refType = fldbean.getFldTabID(); isREF = refType != null; }catch (FieldNotInitializedException e){} String codeLabel = null; try { codeLabel = fldbean.getFldDisplayLabel(); }catch (FieldNotInitializedException e){} String altLabel = null; try { altLabel = fldbean.getFldDisplay(); }catch (FieldNotInitializedException e){} GetInputTag inputTag = new GetInputTag(); inputTag.setName(objSQL + "Bean"); inputTag.setPageContext(pageContext); inputTag.setProperty((String) fld.elementAt(i)); inputTag.setNodiv(true); //si ref je dois donner la possibilité d'une ligne vide if (isREF) { inputTag.setAlt(" "); } String backColor = "#FFFFFF"; if (fldError.contains(fld.elementAt(i))) { //je mets ce champ à null avant de backColor = "#FDCBCC"; //pour les champs ou il y a des erreurs de mets à null boolean isStd = false; try { isStd = fldbean.isFldStd(); }catch (FieldNotInitializedException e){} boolean isMva = false; try { isMva = fldbean.isFldMultival(); }catch (FieldNotInitializedException e){} String strType = BeanOutSource.getJavaType(dico.getRefCode("FldFltID", fldbean.getFldFltID())); Class clType = null; Object cValue = null; // if (isMva) clType="java.lang.Vector"; if(isMva) { clType = Class.forName("java.util.Vector"); cValue = new Vector(); } else if("java.lang.Boolean".equalsIgnoreCase(strType)) { clType = boolean.class; cValue = new Boolean(false); } else if("java.lang.Float".equalsIgnoreCase(strType)) { clType = float.class; cValue = new Float(0); } else if("java.lang.Double".equalsIgnoreCase(strType)) { clType = double.class; cValue = new Double(0); } else if("java.lang.Integer".equalsIgnoreCase(strType)) { clType = int.class; cValue = new Integer(0); } else if("java.lang.Long".equalsIgnoreCase(strType)) { clType = long.class; cValue = new Integer(0); } else if("java.lang.Short".equalsIgnoreCase(strType)) { clType = short.class; cValue = new Integer(0); } else { clType = Class.forName(strType); } try { if(isStd) { Class[] type = {clType}; Object[] params = {cValue}; objBean.getClass().getMethod("set" + (String) fld.elementAt(i),new Class[]{clType}).invoke(objBean, params); } else { objBean.getClass().getMethod("setCustomProperty", new Class[]{Class.forName("java.lang.String"), Class.forName("java.lang.Object")}).invoke(objBean, new Object[]{(String) fld.elementAt(i), null}); } } catch (Exception ex) { logger.error("STACK TRACE",ex); } } %> "> <% } } %>
 
"> " class="input fob"> Sélectionner Vider le champ <%= (id!= null)? objB.toString(session,id) : "" %>  
<% int val = inputTag.doEndTag(); %>  <%= fldValue.elementAt(i) %> <% if (fldError.contains(fld.elementAt(i))) { int j = fldError.indexOf(fld.elementAt(i)); String codeErrVal = ""; if (j > -1) codeErrVal = (String) codeError.elementAt(j); String msgMessage= ""; try { String errID = dico.getRefIdByCode("TrlErrorCodeID",codeErrVal); msgMessage = (String) dico.getRefDisp("TrlErrorCodeID",errID); }catch (FrontlineException e){} %>   <%= codeErrVal + "-" + msgMessage %> <% } %>