<% /****************************************************************************** * Copyright (c) 2000-2005 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"%> <%@ page import="com.edeal.frontline.navigation.*" %> <%@ page import="com.edeal.frontline.*" %> <%@ page import="java.util.*" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl"%> <%@ page import="java.text.DecimalFormat" %> <% 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(); DecimalFormat df = FlLocale.getInstance(session).getDecimalFormat("#,##0.##"); Vector list = (Vector) request.getAttribute("ListSeg"); Vector listDive = (Vector) request.getAttribute("ListDive"); if (listDive == null) listDive = new Vector(); if (list == null) list = new Vector(); String pDive = Utils.getRequestParameter(context, request, "dive"); // search criteria String sc = flRequest.getRequestParameterOrAttribute("sc"); // object uri String ou = flRequest.getRequestParameterOrAttribute("ou"); // id Map searchCriteria = new Hashtable(); if (sc != null) { searchCriteria = WebUtils.parseQueryString(sc); } request.setAttribute("selectedTab", "1"); Vector dive = null; if (pDive != null) { dive = Utils.explodeList(pDive, ";"); } Vector divingAxes = new Vector(); boolean calcFirst = "1".equals(Utils.getRequestParameter(context, request, "calcFirst")); Vector axesCount = new Vector(); %> " ou="<%=\"/list_axis.fl\"%>" criteriaTitle="<%= Utils.getMessage(session, \"L64D7\", \"Recherche segmentation\") %>" listTitle="<%= Utils.getMessage(session, \"L64D8\", false, true, \"Liste des segmentations\") %>" lu="/list_axis.fl" cu="/list_axis_criteria.fl">
">
<%-- IF THERE ARE DIVING SEGMENTS --%> <% if (dive != null && dive.size() > 0) { %> <%-- SHOW TOOLBAR FOR NEW SEGMENT (ONLY IF SEVERAL AXIS SELECTED) AND NEW POP--%>
  <% if (false && dive.size() > 1) { %> + | <% } %> + |
<%-- HEADERS--%> <%-- tr class="ligne_separation_couleur"> <%-- FOR EVERY DIVING AXIS, LOOK FOR THE DISPLAY INFO IN THE LISTSUMMARY RESULT --%> <% String upDive = ""; //STRING TO CONSTRUCT TO GO BACK UP Vector mySegments1 = new Vector(); //FOR EACH SEGMENT, CALCULATE VOLUME AND PRP, AND DISPLAY INFO for (int i=0 ; dive != null && i < dive.size() ; i++) { upDive += (i!=0 ? ";" : "") + dive.elementAt(i); for (int j=0 ; j <% int spacerNB = 0; for (int k=0 ; k < i ; k++) { %> <% spacerNB = k; } %> <% break; //IF WE HAVE FOUND THE SEGMENT WE WANT, GO TO NEXT } //END OF IF RIGHT SEGMENT } //END OF FOR (J) } //END OF FOR (I) %> <%-- JUMP A LINE --%> <%----%> <%----%>
   <%= Utils.formatToWeb(axeCode, false)%> - <%= Utils.formatToWeb(axeName, false)%>
<% if (currSeg.get("SegAttID") != null) { %> " border="0" alt=""> <% } else { String color = null; try { color = (String)dico.getRefDisp(session, "Col", "Te2", (String)currSeg.get("SegColor")); } catch (Exception e) {} %> "> <%= Utils.formatToWeb(segCode, false) %> <% } %> <%= Utils.formatToWeb(segLabel, false) %> <%= Utils.formatToWeb(volume1, false) %> <%= new Double(Double.MIN_VALUE).equals(prp1) ? " " : df.format(prp1) %>

<% } //END OF IF THERE ARE DIVING SEGMENT if (list != null && list.size() > 0) { %> <%-- FOR EACH SEGMENT --%> <% boolean firstOne = true; boolean allInDive = true; String prevAxeID = ""; int compteur = 0; for (int j=0; j <%-- REMAINING SEGMENT HEADER (IF AT LEAST ONE) --%> <% if (dive != null && dive.size() > 0) { %> <% } else { %> <% } %> <% firstOne = false; } //IF FIRST SEGMENT IN AXIS, SHOW AXIS INFO if (!prevAxeID.equals(axeID)) { %> <% prevAxeID = axeID; } Number volume = null; Number prp = null; //IF THERE ARE DIVING AXIS OR IF FORCE CALC IS CHECKED, CALCULATE if (dive != null || calcFirst) { Vector mySegments = null; if (dive == null) { mySegments = new Vector(); } else { mySegments = new Vector(dive); } mySegments.addElement(segID); Vector countSegments = SegmentBean.countSegment(context, mySegments); if (countSegments != null) { if (countSegments.elementAt(0)!=null) { volume = (Number)countSegments.elementAt(0); } if (countSegments.elementAt(1) != null) { prp = (Number)countSegments.elementAt(1); } } //OTHERWISE, TAKE PRE-CALCULATED VALUES } else { if (currSeg.get("SegCount") != null) { volume = (Number)currSeg.get("SegCount"); } if (currSeg.get("SegPRP") != null) { prp = (Number)currSeg.get("SegPRP"); } } %> "> <% } //END OF IF IT ISN'T A DIVING SEGMENT } //END OF FOR EACH SEGMENT %> <% if (!allInDive) { %>
 <%= Utils.formatToWeb(axeCode, false)%> - <%= Utils.formatToWeb(axeName, false)%>
<% if (currSeg.get("SegAttID") != null) { %> ')"> " border="0" alt=""> <% } else { String color = null; try { color = (String)dico.getRefDisp(session, "Col", "Te2", (String)currSeg.get("SegColor")); } catch (Exception e) {} %> "> <%= Utils.formatToWeb(segCode, false) %> <% } %> ')"><%= Utils.formatToWeb(segLabel, false)%> <%= Utils.formatToWeb(volume, false) %> <%= (prp == null || new Double(Double.MIN_VALUE).equals(prp)) ? " " : df.format(prp) %>
<%}//Il faut ne pas le mettre si il n'existe pas de segment restants%> <% }else { %>
<% } %>