Edit C:\galaxie\deploy\Tomcat6\webapps\galaxie\common\fulltextsearch\search.jsp
<% /****************************************************************************** * 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="java.util.List" %> <%@ page import="java.util.Map" %> <%@ page import="java.util.Iterator" %> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.FlContext" %> <%@ page import="com.edeal.frontline.Utils" %> <%@ page import="com.edeal.frontline.navigation.WebUtils"%> <%@ page import="com.edeal.frontline.DataDictionary"%> <%@ page import="org.apache.solr.common.SolrDocumentList"%> <%@ page import="org.apache.solr.common.SolrDocument"%> <%@ page import="org.apache.solr.client.solrj.response.QueryResponse"%> <%@ page import="org.apache.solr.client.solrj.response.SpellCheckResponse"%> <%@ page import="org.apache.solr.client.solrj.response.FacetField" %> <%@ 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 sfwID = flRequest.getRequestParameterOrAttribute("SfwID"); String query = flRequest.getParameter("query"); Boolean deepen = "on".equals(flRequest.getParameter("deepen")); QueryResponse rsp = (QueryResponse) flRequest.getAttribute("solr_response"); %> <script type="text/javascript"> function toggle_visibility(id) { if (document.getElementById("txt_" + id).style.display == 'none') { document.getElementById("txt_" + id).style.display = ''; document.getElementById("img_" + id).src="<fl:webapp/>/icons/fleche-titre-down.gif"; } else { document.getElementById("txt_" + id).style.display = 'none'; document.getElementById("img_" + id).src="<fl:webapp/>/icons/fleche-titre.gif"; } } function openStatusWindow(url){ window.open(url, 'Status', 'toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no, width=500, height=300'); } </script> <%--@page import="org.apache.jasper.tagplugins.jstl.core.ForEach"--%> <fl:bigTabs objectTitle="<%= Utils.getMessage(session, \"L7028\", \"Recherche plein texte\") %>" ou="/search.fl"> <form action="<fl:webapp/>/search.fl"> <table class="container" cellpadding="0" width="100%"> <tr> <td colspan="2" class="ftSearchSmall"> <table cellpadding="0" cellspacing="0" style="width: 70%; border: solid; border-width: 1px; border-color : rgb(127,157,185)"> <tr> <td> <input name="query" value="<%= query != null ? Utils.formatToWeb(query, true) : "" %>" style="font-family:Arial,Verdana,sans-serif;font-weight:bold;font-size:12px;height:18px;border:0;outline:none;" id="plainTextSearchQuery" class="queryInput" type="text" size="100" tabindex="1"> </td> <td> <input style="border:none;" id="searcher" type="image" src="<fl:webapp/>/icons/frontoffice/search.png"/> </td> </tr> </table> <% if (sfwID != null) { %> <input type="hidden" name="SfwID" value="<%= sfwID %>"> <% } %> </td> </tr> <tr class="ligne_separation"><td colspan="2"> </td></tr> <tr class="ftSearchSmall"> <td colspan="2"> <fl:getMessage code="L6624" alt="Opérateurs supportés : OR (ou), - (non), * (tous), ? (un seul)"/> <input name="deepen" type="checkbox" <%=deepen ? "checked=\"checked\"" : ""%>/> <fl:getMessage code="L6625" alt="Recherche Approfondie"/> </td> </tr> </table> </form> <table class="container" cellpadding="0" width="100%"> <% // Query formating error if (flRequest.getAttribute("query_failed") != null) { %> <tr class="fieldline"> <td class="ftSearchTitle"><fl:getMessage code="L6626" alt="Impossible d'executer la requête."/></td> </tr> <% //Display results } if (rsp != null) { SolrDocumentList results = rsp.getResults(); List<FacetField> facets = rsp.getLimitingFacets(); Map<String, Map<String, List<String>>> highlight = rsp.getHighlighting(); SpellCheckResponse spell = rsp.getSpellCheckResponse(); boolean fFilteredResult=Boolean.TRUE.equals(rsp.getHeader().get("filtered_result")); %> <tr> <td class="titrePartie" style="text-align: left;"> <fl:getMessage code="L200C" alt="Résultat"/> (<%=results.getNumFound()%>) </td> </tr> <% if (fFilteredResult) {%> <tr> <td class="ligne_separation_couleur" style="text-align: left; color:white; "> <b> <fl:getMessage code="L70AF" alt="Des éléments ont été supprimés du résultat pour cause de droits d'accés"/><br/> <fl:getMessage code="L70B0" alt="Les comptages peuvent être erronés"/> </b> </td> </tr> <% } %> <tr class="ligne_separation_couleur"><td colspan="3"></td></tr> <% //SpellChecker if (spell != null && spell.getCollatedResult() != null) { %> <tr class="ftSearchTitle" style="background-color: #FFCCCC"> <td colspan="3"> <fl:getMessage code="L6627" alt="Essayez plutôt"/> : <% String urlSearch= "/search.fl?query="+WebUtils.urlEncode(context, spell.getCollatedResult()) + (deepen ?"&deepen=on":""); %> <a href="<fl:link url="<%= urlSearch %>" />"> <%= spell.getCollatedResult() %> </a> </td> </tr> <% } %> <% //Display facets if (facets != null && facets.size() > 0) {%> <tr class="titrePartie" style="text-align: left"> <td style="background-color: #EBF4F6" colspan="3"> <p style="margin-bottom: 0px"> <fl:getMessage code="L6628" alt="Facettes"/> : </p> <% for (FacetField f : facets) { %> <div style="margin-left: 10px"> <a href="javascript:toggle_visibility('<%=f.getName()%>')" style="color: #000066"> <img id="img_<%=f.getName()%>" src="<fl:link url="/icons/fleche-titre.gif"/>" style="vertical-align: middle"> <%=dico.getFieldByName(f.getName().replace("facet_", "")).getFldDisplay()%> (<%=f.getValueCount()%>) : </a> <div id="txt_<%=f.getName()%>" style="display: none; margin-left: 10px"> <% for (FacetField.Count c : f.getValues()) { String urlSearch= "/search.fl?query="+ WebUtils.urlEncode(context, query + " AND " + f.getName() + ":\"" + c.getName() + "\"")+"&deepen=on"; %> <a href="<fl:link url="<%= urlSearch %>"/>"> <%=c.toString()%> </a> <% } %> </div> </div> <% } %> </td> </tr> <tr class="ligne_separation"><td colspan="3"> </td></tr> <%} %> <tr> <td class="ftSearchTitle" colspan="3"> <% //Display results table boolean color = true; for (int i = 0; i < results.size(); ) { String last_obj = results.get(i).getFieldValue("meta_cat").toString(); //Display category %> <a href="javascript:toggle_visibility('<%=last_obj%>');" style="color: #000066"> <img id="img_<%=last_obj%>" src="<fl:link url="/icons/fleche-titre-down.gif"/>" style="vertical-align: middle"> <% String fldValue=results.get(i).getFieldValue("meta_cat_title").toString();%> <%= fldValue %> <br/> </a> <div id="txt_<%=last_obj%>" style="border-top-width:1px; border-top-style:solid; border-color:#84a6ae;"> <% while (i < results.size() && (last_obj.equals(results.get(i).getFieldValue("meta_cat")))) { //Display category content %> <table class="data_column" cellpadding="0"> <% String strColor=(color ? "background-color: #EBF4F6" : ""); %> <tr style="<%= strColor %>" > <td> <p class="ftSearchTitle" style="padding-left: 5px;"> <% //Print title w/ link if (results.get(i).getFieldValue("meta_reader") != null) out.print("<a href=" + results.get(i).getFieldValue("meta_reader") + results.get(i).getFieldValue("id") + ">" + results.get(i).getFieldValue("meta_title") + "</a>"); else // Title w/o link out.print(results.get(i).getFieldValue("meta_title")); //Note : meta_title is allocated with EDEAL object's title in IndexSearch.java //basing on object's ID. For non EDEAL objects null is replaced by "[x]" %> </p> <p class="ftSearchSmall" style="padding-left: 20px"> <% //Print text field(s) String str = results.get(i).getFieldValue("all").toString(); //Add highlighting if ((highlight.get(results.get(i).getFieldValue("id")) != null) && highlight.get(results.get(i).getFieldValue("id")).get("all") != null) { for (String hl : highlight.get(results.get(i).getFieldValue("id")).get("all")) { str = str.replace(hl, "<b>" + hl + "</b>"); } } int len=str.length(); str=str.substring(0,(len<250)?len:250); int startSubstr=(str.startsWith("["))?1:0; int lenSubstr=(str.endsWith("]"))?1:0; %> <fl:getMessage code="L6629" alt="Mots clef : "/> <%=str.substring(startSubstr,str.length()-lenSubstr)%> </p> </td> </tr> </table> <% color = !(color); i++; } %> </div> <% } %> </td> </tr> <%}%> <tr class="ligne_separation"><td colspan="3"> </td></tr> </table> </fl:bigTabs>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de