search.jsp revision 1364
5cca94d19081e525af1906a3ec18d822e3542b4fJenny DonnellyCDDL HEADER START
5cca94d19081e525af1906a3ec18d822e3542b4fJenny DonnellyThe contents of this file are subject to the terms of the
5cca94d19081e525af1906a3ec18d822e3542b4fJenny DonnellyCommon Development and Distribution License (the "License").
5cca94d19081e525af1906a3ec18d822e3542b4fJenny DonnellyYou may not use this file except in compliance with the License.
5cca94d19081e525af1906a3ec18d822e3542b4fJenny DonnellySee LICENSE.txt included in this distribution for the specific
5cca94d19081e525af1906a3ec18d822e3542b4fJenny Donnellylanguage governing permissions and limitations under the License.
5cca94d19081e525af1906a3ec18d822e3542b4fJenny DonnellyWhen distributing Covered Code, include this CDDL HEADER in each
5cca94d19081e525af1906a3ec18d822e3542b4fJenny Donnellyfile and include the License file at LICENSE.txt.
5cca94d19081e525af1906a3ec18d822e3542b4fJenny DonnellyIf applicable, add the following below this CDDL HEADER, with the
5cca94d19081e525af1906a3ec18d822e3542b4fJenny Donnellyfields enclosed by brackets "[]" replaced with your own identifying
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) {
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) {
<a href="help.jsp#escaping">escape special characters</a>
with <b>\</b>, or read the <a href="help.jsp">Help</a>
SearchHelper.PARSE_ERROR_MSG.length())) %><%
} 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.getDesc() %></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"