search.jsp revision 14a41f02433890d19b2f871156271e3388cd0845
30daenzerorama<%--
30daenzerorama$Id$
30daenzeroramaCDDL HEADER START
30daenzeroramaThe contents of this file are subject to the terms of the
30daenzeroramaCommon Development and Distribution License (the "License").
30daenzeroramaYou may not use this file except in compliance with the License.
30daenzeroramaSee LICENSE.txt included in this distribution for the specific
32daenzeroramalanguage governing permissions and limitations under the License.
30daenzeroramaWhen distributing Covered Code, include this CDDL HEADER in each
30daenzeroramafile and include the License file at LICENSE.txt.
Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
--%><%@page session="false" errorPage="error.jsp" import="
include file="projects.jspf"
QueryBuilder qb = sh.builder;
url.append("search?");
/* ---------------------- search.jsp start --------------------- */
cfg = PageConfig.get(request);
long starttime = System.currentTimeMillis();
SearchHelper searchHelper = cfg.prepareSearch()
.prepareExec(cfg.getRequestedProjects()).executeQuery().prepareSummary();
if (searchHelper.redirect != null) {
if (searchHelper.errorMsg != null
+ "<a href=\"help.jsp#escaping\">escape special characters</a> "
+ "with <b>\\</b>, or read the <a href=\"help.jsp\">Help</a> "
+ "Error message from parser:<br/>" + searchHelper.errorMsg
.substring(SearchHelper.PARSE_ERROR_MSG.length());
if (searchHelper.errorMsg != null) {
cfg.setTitle("Search Error");
cfg.setTitle("Search");
include file="httpheader.jspf"
include file="pageheader.jspf"
<li><a href="<%= request.getContextPath()
<%-- TODO: jel: IMHO it should be move to menu.jspf as combobox --%>
for (SortOrder o : SortOrder.values()) {
if (searchHelper.order == o) {
%><li><span class="active"><%= o.getDesc() %></span></li><%
%><li><a href="<%= url %><%= o %>"><%= o.getDesc() %></a></li><%
include file="menu.jspf"
if (searchHelper.errorMsg != null) {
} else if (searchHelper.hits == null) {
} else if (searchHelper.hits.length == 0) {
List<Suggestion> hints = searchHelper.getSuggestions();
%><p><font color="#cc0000">Did you mean (for <%= hint.name %>)</font>:<%
for (String word : hint.freetext) {
for (String word : hint.refs) {
for (String word : hint.defs) {
<p> Your search <b><%= searchHelper.query %></b> did not match any files.
int start = searchHelper.start;
int max = searchHelper.maxItems;
int totalHits = searchHelper.totalHits;
buf.append("<span class=\"sel\">").append(label).append("</span>");
buf.append("<a class=\"more\" href=\"s?n=").append(max)
buf.append("<<");
buf.append(">>");
buf.append(label);
buf.append("</a>");
slider = buf.toString();
<p class="pagetitle">Searched <b><%= searchHelper.query
searchHelper.order %></p><%
if (slider.length() > 0) {
Results.prettyPrint(out, searchHelper, start, start + thispage);
<p><b>Completed in <%= System.currentTimeMillis() - starttime
if (slider.length() > 0) {
/* ---------------------- search.jsp end --------------------- */
include file="foot.jspf"