% /****************************************************************************** * 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" contentType="text/html; charset=UTF-8"%><%@ page import="com.edeal.frontline.navigation.FlRequest" %><%@ page import="com.edeal.frontline.FlContext" %><%@ page import="com.edeal.frontline.DataDictionary" %><%@ page import="javax.swing.tree.DefaultMutableTreeNode" %><%@ page import="com.edeal.frontline.CriteriaBean" %><%@ page import="com.edeal.frontline.FieldNotInitializedException" %><%@ page import="com.edeal.frontline.FieldBean" %><%@ page import="com.edeal.frontline.ObjectsBean" %><%@ page import="java.util.Vector" %><%@ page import="com.edeal.frontline.Utils" %><%@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 paramEdit = flRequest.getRequestParameterOrAttribute("Edit"); String field = flRequest.getRequestParameterOrAttribute("RootFld"); String objID = flRequest.getRequestParameterOrAttribute("ObjID"); DefaultMutableTreeNode tree = (DefaultMutableTreeNode)flRequest.getAttribute("criteria_tree"); boolean isEdit = false; if(paramEdit == null) { paramEdit = "0"; isEdit = false; } else { isEdit = "1".equals(paramEdit); } if (tree != null) { CriteriaBean obj = (CriteriaBean)tree.getUserObject(); boolean isValueNeeded = true; try { String strOpeID = obj.getCriOpe(); isValueNeeded = !"exist".equals(dico.getRefCode("CriOpe", strOpeID)); } catch (FieldNotInitializedException ex) { } %>
<% if(isEdit) { %><% } else { %> <% } %> |
<%
for(int i = 0; i < tree.getChildCount(); i++) {
DefaultMutableTreeNode child = (DefaultMutableTreeNode)tree.getChildAt(i);
request.setAttribute("criteria_tree", child);
%> <%= i == 0 ? "" : (obj.isCriAnd() ? Utils.getMessage(session, "L604B", "et") : Utils.getMessage(session, "L604C", "ou")) %> |
<%
} else {
request.setAttribute("Criteria", obj);
%> <% if(isEdit) { %><% } else { %> <% } %> | ;"><% if(isEdit) { %><% } %> |
<%
if (isValueNeeded) {
%>
<%
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)));
}
} 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) %> <% } %> |
<%
}
}
%>