<% /****************************************************************************** * 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 session="true" import="com.edeal.frontline.*,java.util.*, com.edeal.frontline.navigation.FlRequest"%> <%@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(); String paramID = flRequest.getRequestParameterOrAttribute("id"); String paramNode = flRequest.getRequestParameterOrAttribute("Node"); String paramEdit = flRequest.getRequestParameterOrAttribute("Edit"); boolean isEdit = false; if(paramEdit == null) { paramEdit = "0"; isEdit = false; } else { isEdit = "1".equals(paramEdit); } CriteriaBean obj = new CriteriaBean(paramID, session); boolean isValueNeeded = true; try { String strOpeID = obj.getCriOpe(); isValueNeeded = !"exist".equals(dico.getRefCode("CriOpe", strOpeID)); } catch (FieldNotInitializedException ex) { } %> <% Vector children = obj.getChildren(); if(children != null && children.size() > 0) { %> <% } else { request.setAttribute("Criteria", obj); %> <% if(isValueNeeded) { %> <% } } %>
<% if(isEdit) { %><% } else { %> <% } %> <% for(int i = 0; i < children.size(); i++) { String childID = (String)children.elementAt(i); request.setAttribute("Criteria", new CriteriaBean(childID, session)); %> <%= i == 0 ? "" : (obj.isCriAnd() ? Utils.getMessage(session, "L604B", "et") : Utils.getMessage(session, "L604C", "ou")) %>
<% String nodeVal1 = paramNode + "." + i; %> <% } if(isEdit) { %> (+)<% } %>
<% if(isEdit) { %><% } else { %> <% } %> <% if(isEdit) { %><% } %><% if(isEdit) { %><% } %> <%= obj.isCriNot() ? Utils.getMessage(session, "L2006", "Non") + " " : "" %> <% FieldBean fld = dico.getFieldByID(obj.getCriFldID()); Vector vectChx = null; try { vectChx = obj.getCriChx(); } catch (FieldNotInitializedException exChx) { vectChx = new Vector(); } Vector vectDisplay = new Vector(); try { //if field is fob String fobID = fld.getFldFobID(); ObjectsBean fob = dico.getTable("id", fobID); for(int i = 0; i < vectChx.size(); i++) { vectDisplay.addElement(fob.toString(session, (String)vectChx.elementAt(i))); } /* //old way, using the objects' toString() String fobRadical = fob.getObjRadical(); String[][] query = new String[vectChx.size()][1]; for(int i = 0; i < vectChx.size(); i++) { query[i][0] = fobRadical + "ID = '" + (String)vectChx.elementAt(i) + "'"; } Class[] paramType = {Class.forName("javax.servlet.http.HttpSession"), Class.forName("[[Ljava.lang.String;")}; Object[] args = {session, query}; String pkgName = null; try { if (fob.isObjStandard()) { pkgName = "com.edeal.frontline."; } else { try { pkgName = context.getContextParameter("CustomPackage") + "."; } catch (FrontlineException e) { pkgName = "com.edeal.frontline.custom."; } } } catch (FieldNotInitializedException e) { try { pkgName = context.getContextParameter("CustomPackage") + "."; } catch (FrontlineException ex) { pkgName = "com.edeal.frontline.custom."; } } vectDisplay = (Vector)Class.forName(pkgName + fob.getObjSql() + "Bean").getMethod("list", paramType).invoke(null, args); */ } catch (FieldNotInitializedException exFob) { try { String refID = fld.getFldTabID(); String fldSql = fld.getFldSql(); for(int i = 0; i < vectChx.size(); i++) { vectDisplay.addElement(dico.getRefDisp(session, fldSql, (String)vectChx.elementAt(i))); } } catch (FieldNotInitializedException exRef) { String fldType = null; try { fldType = dico.getRefCode("FldFltID", fld.getFldFltID()); } catch (FieldNotInitializedException exTyp) {}; if("BIT".equals(fldType)) { for(int i = 0; i < vectChx.size(); i++) { vectDisplay.addElement("1".equals((String)vectChx.elementAt(i)) ? Utils.getMessage(session, "L2005", "Oui") : Utils.getMessage(session, "L2006", "Non")); } } else { vectDisplay = vectChx; } } } for(int i = 0; i < vectDisplay.size(); i++) { Object chxDisplay = vectDisplay.elementAt(i); %> <%= Utils.formatToWeb(chxDisplay, false) %>
<% } %>