opensearch.jsp revision 905
235N/A<%--
235N/ACDDL HEADER START
235N/A
235N/AThe contents of this file are subject to the terms of the
235N/ACommon Development and Distribution License (the "License").
235N/AYou may not use this file except in compliance with the License.
235N/A
235N/ASee LICENSE.txt included in this distribution for the specific
235N/Alanguage governing permissions and limitations under the License.
235N/A
235N/AWhen distributing Covered Code, include this CDDL HEADER in each
235N/Afile and include the License file at LICENSE.txt.
235N/AIf applicable, add the following below this CDDL HEADER, with the
235N/Afields enclosed by brackets "[]" replaced with your own identifying
235N/Ainformation: Portions Copyright [yyyy] [name of copyright owner]
235N/A
235N/ACDDL HEADER END
235N/A
235N/ACopyright 2009 Sun Microsystems, Inc. All rights reserved.
235N/AUse is subject to license terms.
235N/A
235N/Aident "%Z%%M% %I% %E% SMI"
235N/A
235N/A--%><%@ page import = "java.util.List,
235N/Ajavax.servlet.*,
235N/Ajavax.servlet.http.*,java.util.Iterator,
235N/Aorg.opensolaris.opengrok.configuration.RuntimeEnvironment,
235N/Aorg.opensolaris.opengrok.configuration.Project,
235N/Aorg.opensolaris.opengrok.web.*"
235N/A session="false" errorPage="error.jsp" %><%@ include file="projects.jspf" %><%
235N/AString q = request.getParameter("q");
235N/AString defs = request.getParameter("defs");
235N/AString refs = request.getParameter("refs");
235N/AString hist = request.getParameter("hist");
235N/AString path = request.getParameter("path");
235N/ARuntimeEnvironment environment = RuntimeEnvironment.getInstance();
235N/AString Context = request.getContextPath();
235N/AString laf = environment.getWebappLAF();
235N/AStringBuffer url = request.getRequestURL();
235N/Aurl=url.delete(url.lastIndexOf("/"),url.length());
235N/A/* TODO Bug 11749
235N/AString proj="project=";
235N/A */
235N/AString proj="";
235N/AStringBuilder text = new StringBuilder();
235N/Aboolean firstIteration = true;
235N/Aif (project != null) {
235N/Afor (String tproj : project) {
235N/A if (!firstIteration) {
235N/A text.append(',');
235N/A }
235N/A text.append(tproj);
235N/A/* TODO Bug 11749
235N/A proj=proj + Util.URIEncode(tproj)+ ",";
235N/A */
235N/A proj = proj + "project=" + Util.URIEncode(tproj)+ "&amp;";
235N/A firstIteration = false;
}
}
String projtext = text.toString();
%><?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>OpenGrok <%=projtext%></ShortName>
<Description>Search in OpenGrok <%=projtext%></Description>
<InputEncoding>UTF-8</InputEncoding>
<Image height="16" width="16" type="image/png"><%=url%>/<%=laf%>/img/icon.png</Image><%--
<Url type="application/x-suggestions+json" template="suggestionURL"/>
--%><Url template="<%=url%>/s?<%=proj%>q={searchTerms}&amp;start={startPage?}" type="text/html"/>
</OpenSearchDescription>