Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\marketing\populationv2\info_entries.jsp
<% /****************************************************************************** * Copyright (c) 2007-2008 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="java.util.*"%> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@page session="true" import="com.edeal.frontline.*"%> <%@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); int numEntries; try { numEntries = Integer.parseInt(flRequest.getParameter("$$nb")); } catch (Exception e) { numEntries = -1; // Show all the entries } String targetDiv = flRequest.getParameter("targetDiv"); if (targetDiv == null) { targetDiv = "PopulationEntryList"; } Integer noPopAddNbr = (Integer)flRequest.getAttribute("noPopAddNbr"); Vector<Hashtable> results = (Vector<Hashtable>)flRequest.getAttribute("results"); Vector<String> toString = (Vector<String>)flRequest.getAttribute("toString"); Vector<String> colonnes = (Vector<String>)flRequest.getAttribute("colonnes"); Vector<String> objIDFields = (Vector<String>)flRequest.getAttribute("objIDFields"); Vector<String> objNames = (Vector<String>)flRequest.getAttribute("objNames"); String manAddedStr = Utils.getMessage(session, "A3068", "Ajouté manuellement"); String plusUrl = flRequest.computeURL("/icons/ico/plus.gif"); boolean hasAddedEntries = (noPopAddNbr != null && noPopAddNbr > 0); boolean isError = false; if (results == null || toString == null || colonnes == null) { logger.error("No data returned from Population2EntryListAction. Cannot continue"); isError = true; } try { if (toString.size() != colonnes.size()) { logger.error("colonnes/toString data size mismatch. Cannot continue"); isError = true; } } catch (NullPointerException e) { } String ppeRemoved = flRequest.getParameter("PpeRemoved"); String ppeAdded = flRequest.getParameter("PpeAdded"); if (ppeRemoved == null) { ppeRemoved = "0"; } if (ppeAdded == null) { ppeAdded = "0"; } //je dois ecrire les toString int nbObject = (toString == null ? 1 : toString.size()); String widthCol = nbObject == 1 ? "50%" : (100 / nbObject) + "%"; StringBuilder tableBuf = new StringBuilder(); boolean isBlue = true; if (toString.size() > 0 && results.size() > 0 && !isError) { tableBuf.append("<table class=\"container\" cellpadding=\"0\">"); tableBuf.append("<tr style=\"vertical-align: top;\">"); tableBuf.append("<td class=\"headerDataGrid\" style=\"width: 1%;\"> </td>"); if (hasAddedEntries) { tableBuf.append("<td class=\"headerDataGrid\" style=\"width: 1%;\"> </td>"); } Iterator<String> colIter = colonnes.iterator(); while (colIter.hasNext()) { tableBuf.append("<td class=\"headerDataGrid\" style=\"width: auto;\">" + colIter.next() + "</td>"); } tableBuf.append("</tr>"); boolean isRemoved = "1".equals(ppeRemoved); boolean isAdded = "1".equals(ppeAdded); String linkString = isRemoved ? "<a href=\"javascript:doAdd(\\\'" : "<a href=\"javascript:doRemove(\\\'"; String linkImage = isRemoved ? "/icons/ico/cochevalid.gif" : "/icons/ico/close.gif"; String titleMsg = isRemoved ? Utils.getMessage(session, "A000F", "Ajouter") : Utils.getMessage(session, "A0012", "Retirer"); Iterator<Hashtable> resultsIter = results.iterator(); while (resultsIter.hasNext()) { Hashtable row = resultsIter.next(); String ppeID=(String)row.get("PpeID"); /* Make sure the IDs of the popentry will be really IDs within the HTML * page : they must be unique within the HTML page, that's why we have * chosen to suffix them. */ if (isRemoved) { tableBuf.append("<tr id=\"popentryremoved_"+ppeID+"\" class=\""+ (isBlue? "tabSimpleFdBleu" : "tabSimpleFdBlanc" )+"\"><td>"); } else if (isAdded) { tableBuf.append("<tr id=\"popentryadded_"+ppeID+"\" class=\""+ (isBlue? "tabSimpleFdBleu" : "tabSimpleFdBlanc" )+"\"><td>"); } else { tableBuf.append("<tr id=\"popentry_"+ppeID+"\" class=\""+ (isBlue? "tabSimpleFdBleu" : "tabSimpleFdBlanc" )+"\"><td>"); } tableBuf.append(linkString); // tableBuf.append(ppeID); // tableBuf.append("\\\'"); Boolean ppeAddedBool = (Boolean)row.get("PpeAdded"); tableBuf.append(");\"><img src=\""); tableBuf.append(flRequest.computeURL(linkImage)); tableBuf.append("\" alt=\""); tableBuf.append(titleMsg); tableBuf.append("\" title=\""); tableBuf.append(titleMsg); tableBuf.append("\" border=\"0\" height=\"17px\" width=\"17px\"/></a>"); tableBuf.append("</td>"); if (hasAddedEntries) { if (ppeAddedBool != null && ppeAddedBool) { tableBuf.append("<td>"); tableBuf.append("<img src=\""); tableBuf.append(plusUrl); tableBuf.append("\" alt=\""); tableBuf.append(manAddedStr); tableBuf.append("\" title=\""); tableBuf.append(manAddedStr); tableBuf.append("\" border=\"0\" height=\"17px\" width=\"17px\"/></a>"); tableBuf.append("</td>"); } else { tableBuf.append("<td style=\"text-align : right;width : 1%\">"); tableBuf.append(" "); tableBuf.append("</td>"); } } Iterator<String> toStringIter = toString.iterator(); Iterator<String> objIDIter = objIDFields.iterator(); Iterator<String> objNamesIter = objNames.iterator(); while (toStringIter.hasNext()) { String toStringPattern = toStringIter.next(); SyntaxNode synNode = SyntaxNode.parse(toStringPattern); Object synNodeObj = synNode.eval(session, row); String synNodeVal = ""; if (synNodeObj == null) { synNodeVal=""; } else { synNodeVal=synNodeObj.toString(); if ("".equals(synNodeVal)) { try { synNodeVal=(String)row.get(toStringPattern); } catch (Exception e) {} } } String objID = objIDIter.next(); String objName = objNamesIter.next(); tableBuf.append("<td text-align: left;\" width=\""+ widthCol +"\" >"); if (synNodeVal == null || synNodeVal.equals("")) { tableBuf.append(" "); } else { String valToDisp = Utils.formatToJavascript(Utils.formatToWeb(synNodeVal.trim(), false)); tableBuf.append("<a href=\"" + flRequest.computeURL("/read_" + objName + ".fl?id=" + row.get(objID), true, true, true) + "\"><div title=\"" + valToDisp + "\">" + valToDisp + "</div></a>"); } tableBuf.append("</td>"); } isBlue = !isBlue; } tableBuf.append("</tr>"); tableBuf.append("</table>"); if (numEntries != -1 && results.size() >= numEntries) { tableBuf.append("<br>"); tableBuf.append("<center><a href=\"javascript:refreshPopulationEntryShowAll();\">"); tableBuf.append("<div label=\"" + Utils.getMessage(session, "M6115", true, "Voir tous les entrées") + "\">" + Utils.getMessage(session, "M6115", true, "Voir tous les entrées") + "</div>"); tableBuf.append("</a></center>"); } } else { tableBuf.append("<p class=\"dataLabel\">"+ Utils.getMessage(session, "L0001", "Aucune entrée disponible") +"</p>"); } %>var f = document.getElementById('<%= targetDiv %>'); try { f.innerHTML = '<%= tableBuf.toString() %>'; } catch (err) { }
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de