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