<% /****************************************************************************** * 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.*"%> <%@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(); //parent criteria id : the criteria the transition points to is actually the parent criteria //the response criteria itself is a child of that parent (the other child says what the LinkScriptElementid id is) String paramID = Utils.getRequestParameter(context, request, "id"); //not supported in current use String paramNode = Utils.getRequestParameter(context, request, "Node"); //1 if this is for edition String paramEdit = Utils.getRequestParameter(context, request, "Edit"); boolean isEdit = false; if(paramEdit == null) { paramEdit = "0"; isEdit = false; } else { isEdit = "1".equals(paramEdit); } //parent criteria CriteriaBean parentCri = new CriteriaBean(paramID, session); //child response criteria CriteriaBean cri = null; //LinkScriptElement this criteria is for String lseID = null; try { //get all children for the parent Vector children = parentCri.getChildren(); for(int i = 0; i < children.size(); i++) { try { CriteriaBean criBean = new CriteriaBean((String)children.elementAt(i), session); String fldSql = dico.getFieldByID(criBean.getCriFldID()).getFldSql(); //if this is the response criteria, store it in cri if(!"SerLseID".equalsIgnoreCase(fldSql)) { cri = new CriteriaBean((String)children.elementAt(i), session); //if this is the lse criteria, get lseID } else { lseID = (String)new CriteriaBean((String)children.elementAt(i), session).getCriChx().elementAt(0); } } catch (Exception ex) { } } } catch (Exception ex) { } //true if the operation needs choices boolean isValueNeeded = true; try { String strOpeID = cri.getCriOpe(); isValueNeeded = !"exist".equals(dico.getRefCode("CriOpe", strOpeID)); } catch (FieldNotInitializedException ex) { } //BEGIN get all info about the script element String fields[] = {"LseID", "LseScriptElementID", "LseScriptElementID:SceLabel", "LseScriptElementID:SceLstAnswer0", "LseScriptElementID:SceLstAnswer1", "LseScriptElementID:SceLstAnswer2", "LseScriptElementID:SceLstAnswer3", "LseScriptElementID:SceLstAnswer4", "LseScriptElementID:SceLstAnswer5", "LseScriptElementID:SceLstAnswer6", "LseScriptElementID:SceLstAnswer7", "LseScriptElementID:SceLstAnswer8", "LseScriptElementID:SceLstAnswer9", "LseScriptElementID:SceLstAnswer10", "LseScriptElementID:SceLstAnswer11", "LseScriptElementID:SceLstAnswer12", "LseScriptElementID:SceLstAnswer13", "LseScriptElementID:SceLstAnswer14"}; String query[][] = {{"LseID = " + Utils.formatToSQL(context, lseID)}}; Vector lseList = LinkScriptElementBean.listSummary(session, fields, query); if (lseList.size() == 0) { logger.warn("scriptelementresponsecriteria/view.jsp : could not find LinkScriptElement with id " + lseID); } Hashtable lse = (Hashtable)lseList.elementAt(0); String sceLabel = (String)lse.get("LseScriptElementID:SceLabel"); String sceID = (String)lse.get("LseScriptElementID"); //END get all info about the script element %> <% //BEGIN not supported in current use Vector children = cri.getChildren(); if(children != null && children.size() > 0) { %> <% //END not supported in current use } else { request.setAttribute("Criteria", cri); %> <%-- in current use, isEdit is always false --%> <%-- reponse à --%> <% if(isValueNeeded) { %> <% } else { %> <% } } %>
<% 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 ? "" : (cri.isCriAnd() ? Utils.getMessage(session, "L604B", "et") : Utils.getMessage(session, "L604C", "ou")) %>
<% String nodeVal1 = paramNode + "." + i; %> <% } if(isEdit) { %> (+) <% } %>
<% if(isEdit) { %><% } else { %> <% } %>   <%=sceLabel%> <%= cri.isCriNot() ? Utils.getMessage(session, "L2006", "Non") + " " : "" %> <% FieldBean fld = dico.getFieldByID(cri.getCriFldID()); String fldSql = fld.getFldSql(); Vector vectChx = null; try { vectChx = cri.getCriChx(); } catch (FieldNotInitializedException exChx) { vectChx = new Vector(); } Vector vectDisplay = new Vector(); if ("SerPosition".equals(fldSql)) { for (int i=0 ; i < vectChx.size() ; i++) { vectDisplay.addElement(lse.get("LseScriptElementID:SceLstAnswer" + (String)vectChx.elementAt(i))); } } else if ("SerText".equals(fldSql)) { vectDisplay = vectChx; } else { vectDisplay = vectChx; } for(int i = 0; i < vectDisplay.size(); i++) { Object chxDisplay = vectDisplay.elementAt(i); %> <%= Utils.formatToWeb(chxDisplay, false) %>
<% } %>