Results.java revision 1318
0N/A * The contents of this file are subject to the terms of the 407N/A * Common Development and Distribution License (the "License"). 0N/A * You may not use this file except in compliance with the License. 0N/A * language governing permissions and limitations under the License. 0N/A * When distributing Covered Code, include this CDDL HEADER in each 0N/A * If applicable, add the following below this CDDL HEADER, with the 0N/A * fields enclosed by brackets "[]" replaced with your own identifying 0N/A * information: Portions Copyright [yyyy] [name of copyright owner] 0N/A * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * Portions Copyright 2011 Jens Elkner. 350N/A * @author Chandan slightly rewritten by Lubos Kosco 0N/A // Util class, should not be constructed 0N/A * Create a has map keyed by the directory of the document found. 0N/A * @param searcher searcher to use. 0N/A * @param hits hits produced by the given searcher's search 0N/A * @param startIdx the index of the first hit to check 0N/A * @param stopIdx the index of the last hit to check 0N/A * @return a (directory, hitDocument) hashmap 0N/A * @throws CorruptIndexException 0N/A // Grrrrrrrrrrrrr - TagFilter takes Readers, only!!!! 0N/A // Why? Is it CS sensible? 0N/A * Prints out results in html form. The following search helper fields are * required to be properly initialized: * <li>{@link SearchHelper#dataRoot}</li> * <li>{@link SearchHelper#contextPath}</li> * <li>{@link SearchHelper#searcher}</li> * <li>{@link SearchHelper#hits}</li> * <li>{@link SearchHelper#historyContext} (ignored if {@code null})</li> * <li>{@link SearchHelper#sourceContext} (ignored if {@code null})</li> * <li>{@link SearchHelper#summerizer} (if sourceContext is not {@code null})</li> * <li>{@link SearchHelper#compressed} (if sourceContext is not {@code null})</li> * <li>{@link SearchHelper#sourceRoot} (if sourceContext or historyContext * is not {@code null})</li> * @param out write destination * @param sh search helper which has all required fields set * @param start index of the first hit to print * @param end index of the last hit to print * @throws HistoryException * @throws ClassNotFoundException out.
write(
"<tr class=\"dir\"><td colspan=\"3\"><a href=\"");
out.
write(
"<tr><td class=\"q\"><a href=\"");
out.
write(
"\" title=\"History\">H</a> <a href=\"");
out.
write(
"?a=true\" title=\"Annotate\">A</a> <a href=\"");
out.
write(
"\" title=\"Download\">D</a>");
out.
write(
"<td class=\"f\"><a href=\"");
out.
write(
"</a></td><td><tt class=\"con\">");
// FIXME use Highlighter from lucene contrib here, // instead of summarizer, we'd also get rid of // apache lucene in whole source ...