<%-- $Id$ CDDL HEADER START The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. See LICENSE.txt included in this distribution for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at LICENSE.txt. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] CDDL HEADER END Copyright (c) 2009, 2021, Oracle and/or its affiliates. All rights reserved. Portions Copyright 2011 Jens Elkner. Portions Copyright (c) 2018, 2020, Chris Fraire . --%><%@page session="false" errorPage="error.jsp" import=" java.util.Set, org.opengrok.indexer.web.Prefix, org.opengrok.indexer.web.QueryParameters, org.opengrok.indexer.web.Util" %> <% { PageConfig cfg = PageConfig.get(request); cfg.checkSourceRootExistence(); } %><%@ include file="projects.jspf" %><% /* ---------------------- opensearch.jsp start --------------------- */ { PageConfig cfg = PageConfig.get(request); // Optimize for URLs up to 128 characters. StringBuilder url = new StringBuilder(128); String scheme = request.getScheme(); int port = request.getServerPort(); url.append(scheme).append("://"); String serverName = cfg.getServerName(); url.append(serverName); // Append port if needed. if ((port != 80 && scheme.equals("http")) || (port != 443 && scheme.equals("https"))) { url.append(':').append(port); } String imgUrl = url + cfg.getCssDir() + "/img/icon.png"; /* TODO Bug 11749 ??? */ StringBuilder text = new StringBuilder(); url.append(request.getContextPath()).append(Prefix.SEARCH_P).append('?'); Set projects = cfg.getRequestedProjects(); for (String name : projects) { text.append(name).append(','); Util.appendQuery(url, QueryParameters.PROJECT_SEARCH_PARAM, name); } if (text.length() != 0) { text.setLength(text.length()-1); } %> OpenGrok <%= text.toString() %> Search in OpenGrok <%= text.toString() %> UTF-8 <%= imgUrl %> <%-- --%> <% } /* ---------------------- opensearch.jsp end --------------------- */ %>