opensearch.jsp revision 8e4e27126852837892d11016ca62f6b8f51997b8
b31d69afd0b141cad8082cc344f651651108c210Garrett D'AmoreCDDL HEADER START
b31d69afd0b141cad8082cc344f651651108c210Garrett D'AmoreThe contents of this file are subject to the terms of the
b31d69afd0b141cad8082cc344f651651108c210Garrett D'AmoreCommon Development and Distribution License (the "License").
b31d69afd0b141cad8082cc344f651651108c210Garrett D'AmoreYou may not use this file except in compliance with the License.
b31d69afd0b141cad8082cc344f651651108c210Garrett D'AmoreSee LICENSE.txt included in this distribution for the specific
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amorelanguage governing permissions and limitations under the License.
b31d69afd0b141cad8082cc344f651651108c210Garrett D'AmoreWhen distributing Covered Code, include this CDDL HEADER in each
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amorefile and include the License file at LICENSE.txt.
b31d69afd0b141cad8082cc344f651651108c210Garrett D'AmoreIf applicable, add the following below this CDDL HEADER, with the
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amorefields enclosed by brackets "[]" replaced with your own identifying
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amoreinformation: Portions Copyright [yyyy] [name of copyright owner]
b31d69afd0b141cad8082cc344f651651108c210Garrett D'AmoreCDDL HEADER END
b31d69afd0b141cad8082cc344f651651108c210Garrett D'AmoreCopyright 2009 Sun Microsystems, Inc. All rights reserved.
68c47f65208790c466e5e484f2293d3baed71c6aGarrett D'AmoreUse is subject to license terms.
b31d69afd0b141cad8082cc344f651651108c210Garrett D'AmorePortions Copyright 2011 Jens Elkner.
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore--%><%@page session="false" errorPage="error.jsp" import="
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore /* ---------------------- opensearch.jsp start --------------------- */
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore StringBuilder url = new StringBuilder(128);
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore String protocol="http://";
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore if (request.getProtocol().toUpperCase().startsWith("HTTPS")) protocol="https://";
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore url.append("http://").append(request.getServerName());
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore if (port != 80) {
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore url.append(':').append(request.getServerPort());
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore port = url.length(); // mark
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore String img = url.append(cfg.getCssDir()).append("/img/icon.png").toString();
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore url.setLength(port); // rewind
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore /* TODO Bug 11749 ??? */
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore StringBuilder text = new StringBuilder();
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore url.append(request.getContextPath()).append(Prefix.SEARCH_P).append('?');
7014882c6a3672fd0e5d60200af8643ae53c5928Richard Lowe Set<String> projects = cfg.getRequestedProjects();
7014882c6a3672fd0e5d60200af8643ae53c5928Richard Lowe for (String name : projects) {
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore text.append(name).append(',');
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore Util.appendQuery(url, "project", name);
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore%><?xml version="1.0" encoding="UTF-8"?>
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore <ShortName>OpenGrok <%= text.toString() %></ShortName>
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore <Description>Search in OpenGrok <%= text.toString() %></Description>
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore <InputEncoding>UTF-8</InputEncoding>
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore <Image height="16" width="16" type="image/png"><%= img %></Image>
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore<%-- <Url type="application/x-suggestions+json" template="suggestionURL"/>--%>
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore <Url template="<%= url.toString() %>&q={searchTerms}" type="text/html"/>
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore</OpenSearchDescription>
b31d69afd0b141cad8082cc344f651651108c210Garrett D'Amore/* ---------------------- opensearch.jsp end --------------------- */