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