opensearch.jsp revision 14a41f02433890d19b2f871156271e3388cd0845
30d2f45dd260208f0fb882dde134a249318524b9Lubos KoscoCDDL HEADER START
30d2f45dd260208f0fb882dde134a249318524b9Lubos KoscoThe contents of this file are subject to the terms of the
30d2f45dd260208f0fb882dde134a249318524b9Lubos KoscoCommon Development and Distribution License (the "License").
30d2f45dd260208f0fb882dde134a249318524b9Lubos KoscoYou may not use this file except in compliance with the License.
30d2f45dd260208f0fb882dde134a249318524b9Lubos KoscoSee LICENSE.txt included in this distribution for the specific
30d2f45dd260208f0fb882dde134a249318524b9Lubos Koscolanguage governing permissions and limitations under the License.
30d2f45dd260208f0fb882dde134a249318524b9Lubos KoscoWhen distributing Covered Code, include this CDDL HEADER in each
30d2f45dd260208f0fb882dde134a249318524b9Lubos Koscofile and include the License file at LICENSE.txt.
30d2f45dd260208f0fb882dde134a249318524b9Lubos KoscoIf applicable, add the following below this CDDL HEADER, with the
30d2f45dd260208f0fb882dde134a249318524b9Lubos Koscofields enclosed by brackets "[]" replaced with your own identifying
30d2f45dd260208f0fb882dde134a249318524b9Lubos Koscoinformation: Portions Copyright [yyyy] [name of copyright owner]
30d2f45dd260208f0fb882dde134a249318524b9Lubos KoscoCDDL HEADER END
30d2f45dd260208f0fb882dde134a249318524b9Lubos KoscoCopyright 2009 Sun Microsystems, Inc. All rights reserved.
30d2f45dd260208f0fb882dde134a249318524b9Lubos KoscoUse is subject to license terms.
14a41f02433890d19b2f871156271e3388cd0845Jens ElknerPortions Copyright 2011 Jens Elkner.
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner--%><%@page session="false" errorPage="error.jsp" import="
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner /* ---------------------- opensearch.jsp start --------------------- */
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner cfg = PageConfig.get(request);
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner StringBuilder url = new StringBuilder(128);
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner url.append("http://").append(request.getServerName());
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner if (port != 80) {
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner url.append(':').append(request.getServerPort());
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner port = url.length(); // mark
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner String img = url.append(cfg.getCssDir()).append("/img/icon.png").toString();
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner url.setLength(port); // rewind
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner /* TODO Bug 11749 ??? */
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner StringBuilder text = new StringBuilder();
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner url.append(request.getContextPath()).append(Prefix.SEARCH_P).append('?');
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner Set<String> projects = cfg.getRequestedProjects();
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner for (String name : projects) {
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner text.append(name).append(',');
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner Util.appendQuery(url, "project", name);
30d2f45dd260208f0fb882dde134a249318524b9Lubos Kosco%><?xml version="1.0" encoding="UTF-8"?>
30d2f45dd260208f0fb882dde134a249318524b9Lubos Kosco<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner <ShortName>OpenGrok <%= text.toString() %></ShortName>
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner <Description>Search in OpenGrok <%= text.toString() %></Description>
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner <InputEncoding>UTF-8</InputEncoding>
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner <Image height="16" width="16" type="image/png"><%= img %></Image>
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner<%-- <Url type="application/x-suggestions+json" template="suggestionURL"/>--%>
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner <Url template="<%= url.toString() %>q={searchTerms}" type="text/html"/>
30d2f45dd260208f0fb882dde134a249318524b9Lubos Kosco</OpenSearchDescription>
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner/* ---------------------- opensearch.jsp end --------------------- */