<% /****************************************************************************** * 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()); String contextPath = (String)session.getAttribute("contextPath"); if(contextPath == null) { contextPath = request.getContextPath(); } FlContext context = Frontline.getContext(contextPath); DataDictionary dico = context.getDataDictionary(); FlRequest flRequest = new FlRequest(request); //this is true if this is an edition (not a creation) and it's the first pass boolean isFirstLoad = Utils.getRequestParameter(context, request, "Fst") != null; //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) CriteriaBean parentCri = (CriteriaBean)request.getAttribute("Criteria"); String parentID = null; try { parentID = parentCri.getID(); } catch (FieldNotInitializedException e) {} //child criteria CriteriaBean cri = (CriteriaBean)flRequest.getAttribute("cri");; String childID = (String)flRequest.getAttribute("childID"); try { // childID = cri.getID(); } catch (Exception e) {} //the root field is the field in which this criteria id is stored (e.g. SetCriSerID) String paramRootFld = Utils.getRequestParameter(context, request, "RootFld"); //the ctr id is the id of the object in which this criteria id is stored (e.g. SetID) String paramCtrID = Utils.getRequestParameter(context, request, "CtrID"); //this is the criteria id to which this criteria belongs (not supported in current use, but left in there) String paramGrpID = Utils.getRequestParameter(context, request, "GrpID"); //this is the script element for which this criteria is created String paramSceID = Utils.getRequestParameter(context, request, "SceID"); //this is the link script element for which this criteria is created String paramLseID = Utils.getRequestParameter(context, request, "LseID"); FieldBean fldBean = dico.getFieldByName(paramRootFld); //This is the SQL name of the object in which the criteria is stored (e.g. ScriptElementTransition) String ctrSql = ((ObjectsBean)dico.getTable("id", fldBean.getFldObjID())).getObjSql(); //if "not" was selected before last refresh String paramCNot = Utils.getRequestParameter(context, request, "CriNot"); if("".equals(paramCNot)) paramCNot = null; //get the operation that was selected before last refresh String paramCOpe = Utils.getRequestParameter(context, request, "CriOpe"); if("".equals(paramCOpe)) paramCOpe = null; //vector of choices for the criteria Vector vectChx = new Vector(); //initialize stuff for first load if(isFirstLoad) { try { paramCNot = cri.isCriNot() ? "1" : null; } catch (FieldNotInitializedException ex) { paramCNot = null; } try { paramCOpe = cri.getCriOpe(); } catch (FieldNotInitializedException ex) { paramCOpe = null; } try { vectChx = cri.getCriChx(); } catch (FieldNotInitializedException ex) { vectChx = new Vector(); } } // prepare data //this is the field this criteria uses FieldBean fld = (FieldBean)request.getAttribute("fld"); //true if an operation is selected in the dropdown list boolean isOpeSelected = ((Boolean) request.getAttribute("isOpeSelected")).booleanValue(); //true if the operation needs a value ("exists" doesn't need one for instance) boolean isValueNeeded = ((Boolean) request.getAttribute("isValueNeeded")).booleanValue(); //true if the operation can work with several choices ("in" for instance) boolean isMultipleValues = ((Boolean) request.getAttribute("isMultipleValues")).booleanValue(); //true if the field is controlled by a list of values ("SerPosition") boolean isControledByLst = ((Boolean) request.getAttribute("isControledByLst")).booleanValue(); //true if the field is free text ("SerText") boolean isText = ((Boolean) request.getAttribute("isText")).booleanValue(); //String sceLabel = (String)sceHashtable.get("SceLabel"); String sceLabel = flRequest.getRequestParameterOrAttribute("SceLabel"); Vector sceList = (Vector)request.getAttribute("sceList"); //array of possible operations for the field String[] ctlOpe = (String[]) request.getAttribute("ctlOpe"); Hashtable sceHashtable = (Hashtable)request.getAttribute("sceHashtable"); //END get all necessary info about the ScriptElement //This is the object the criteria targets ObjectsBean fob = dico.getTable("sql", "ScriptElementResponse"); String id = null; try{ id = parentCri.getID(); }catch(Exception e){ id=""; } String reload=flRequest.getRequestParameterOrAttribute("reload"); String criChx = flRequest.getRequestParameterOrAttribute("CriChx"); %> <fl:getMessage code="L2025" alt="E-DEAL"/> CRM
"> <% if(parentID != null) { %><% } %> <% if(paramGrpID != null) { %> <% } if(paramRootFld != null) { %> <% } if(paramCtrID != null) { %> <% } %> <%-- drop down of all operations --%> <% if(isOpeSelected && !isValueNeeded) { %> <% } else if(isOpeSelected) { %> <%-- choices area : drop down / select area if controled by list, text area if free text --%> <% } %>
>
()
<% if(isControledByLst) { %> <% } else if(isText) { String strResponse=""; if (!"1".equals(reload)){ Vector vectDisplay = new Vector(); try{ vectDisplay = (Vector) cri.getCriChx(); }catch(Exception e){vectDisplay = new Vector();}; for(int k=0; k0) strResponse +=";"; strResponse += (String) vectDisplay.get(k); } }else strResponse = (criChx!=null ? criChx : ""); %>   <% if(isMultipleValues) { %>
<% } } %>
<% if(paramCOpe != null) { %> <% } %>
 <fl:getMessage code=" border="0">  <fl:getMessage code=" border="0">