10d40e9d0SAdam Hornáček<%-- 20d40e9d0SAdam Hornáček$Id$ 30d40e9d0SAdam Hornáček 40d40e9d0SAdam HornáčekCDDL HEADER START 50d40e9d0SAdam Hornáček 60d40e9d0SAdam HornáčekThe contents of this file are subject to the terms of the 70d40e9d0SAdam HornáčekCommon Development and Distribution License (the "License"). 80d40e9d0SAdam HornáčekYou may not use this file except in compliance with the License. 90d40e9d0SAdam Hornáček 100d40e9d0SAdam HornáčekSee LICENSE.txt included in this distribution for the specific 110d40e9d0SAdam Hornáčeklanguage governing permissions and limitations under the License. 120d40e9d0SAdam Hornáček 130d40e9d0SAdam HornáčekWhen distributing Covered Code, include this CDDL HEADER in each 140d40e9d0SAdam Hornáčekfile and include the License file at LICENSE.txt. 150d40e9d0SAdam HornáčekIf applicable, add the following below this CDDL HEADER, with the 160d40e9d0SAdam Hornáčekfields enclosed by brackets "[]" replaced with your own identifying 170d40e9d0SAdam Hornáčekinformation: Portions Copyright [yyyy] [name of copyright owner] 180d40e9d0SAdam Hornáček 190d40e9d0SAdam HornáčekCDDL HEADER END 200d40e9d0SAdam Hornáček 2156f072caSAdam HornáčekCopyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. 220d40e9d0SAdam HornáčekPortions Copyright 2011 Jens Elkner. 23a804b2d7SAdam HornáčekPortions Copyright (c) 2018, Chris Fraire <cfraire@me.com>. 240d40e9d0SAdam Hornáček 250d40e9d0SAdam Hornáček--%><%-- 260d40e9d0SAdam Hornáček 270d40e9d0SAdam HornáčekAfter include you are here: /body/div#page/div#content/ 280d40e9d0SAdam Hornáček 290d40e9d0SAdam Hornáček--%> 30a804b2d7SAdam Hornáček<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> 310d40e9d0SAdam Hornáček<%@page import="org.json.simple.JSONArray"%> 32*686556f2SAdam Hornáček<%@page import="org.opengrok.indexer.configuration.messages.Message"%> 330d40e9d0SAdam Hornáček<%@page import="java.util.SortedSet"%> 34*686556f2SAdam Hornáček<%@page import="org.opengrok.indexer.configuration.RuntimeEnvironment"%> 350d40e9d0SAdam Hornáček<%@ page session="false" errorPage="error.jsp" import=" 360d40e9d0SAdam Hornáčekjava.io.File, 370d40e9d0SAdam Hornáčekjava.io.IOException, 380d40e9d0SAdam Hornáček 39*686556f2SAdam Hornáčekorg.opengrok.indexer.configuration.Project, 40*686556f2SAdam Hornáčekorg.opengrok.indexer.history.HistoryGuru, 41*686556f2SAdam Hornáčekorg.opengrok.indexer.web.EftarFileReader, 42*686556f2SAdam Hornáčekorg.opengrok.indexer.web.PageConfig, 43*686556f2SAdam Hornáčekorg.opengrok.indexer.web.Prefix, 44*686556f2SAdam Hornáčekorg.opengrok.indexer.web.Util"%><% 450d40e9d0SAdam Hornáček/* ---------------------- mast.jsp start --------------------- */ 460d40e9d0SAdam Hornáček{ 470d40e9d0SAdam Hornáček PageConfig cfg = PageConfig.get(request); 480d40e9d0SAdam Hornáček String redir = cfg.canProcess(); 490d40e9d0SAdam Hornáček if (redir == null || redir.length() > 0) { 500d40e9d0SAdam Hornáček if (redir == null) { 510d40e9d0SAdam Hornáček response.sendError(HttpServletResponse.SC_NOT_FOUND); 520d40e9d0SAdam Hornáček } else { 530d40e9d0SAdam Hornáček response.sendRedirect(redir); 540d40e9d0SAdam Hornáček } 550d40e9d0SAdam Hornáček return; 560d40e9d0SAdam Hornáček } 570d40e9d0SAdam Hornáček 580d40e9d0SAdam Hornáček // jel: hmmm - questionable for dynamic content 590d40e9d0SAdam Hornáček long flast = cfg.getLastModified(); 600d40e9d0SAdam Hornáček if (request.getDateHeader("If-Modified-Since") >= flast) { 610d40e9d0SAdam Hornáček response.setStatus(HttpServletResponse.SC_NOT_MODIFIED); 620d40e9d0SAdam Hornáček return; 630d40e9d0SAdam Hornáček } 640d40e9d0SAdam Hornáček response.setDateHeader("Last-Modified", flast); 650d40e9d0SAdam Hornáček 660d40e9d0SAdam Hornáček // Use UTF-8 if no encoding is specified in the request 670d40e9d0SAdam Hornáček if (request.getCharacterEncoding() == null) { 680d40e9d0SAdam Hornáček request.setCharacterEncoding("UTF-8"); 690d40e9d0SAdam Hornáček } 700d40e9d0SAdam Hornáček 710d40e9d0SAdam Hornáček // set the default page title 720d40e9d0SAdam Hornáček String path = cfg.getPath(); 730d40e9d0SAdam Hornáček cfg.setTitle(cfg.getPathTitle()); 740d40e9d0SAdam Hornáček} 750d40e9d0SAdam Hornáček%> 760d40e9d0SAdam Hornáček<%@ 770d40e9d0SAdam Hornáček 780d40e9d0SAdam Hornáčekinclude file="httpheader.jspf" 790d40e9d0SAdam Hornáček 800d40e9d0SAdam Hornáček %><body> 810d40e9d0SAdam Hornáček<script type="text/javascript">/* <![CDATA[ */ 820d40e9d0SAdam Hornáček document.rev = function() { return getParameter("r"); }; 830d40e9d0SAdam Hornáček document.annotate = <%= PageConfig.get(request).annotate() %>; 840d40e9d0SAdam Hornáček document.domReady.push(function() { domReadyMast(); }); 850d40e9d0SAdam Hornáček document.pageReady.push(function() { pageReadyMast(); }); 860d40e9d0SAdam Hornáček/* ]]> */</script> 870d40e9d0SAdam Hornáček<div id="page"> 880d40e9d0SAdam Hornáček <div id="whole_header"> 890d40e9d0SAdam Hornáček<div id="header"><%@ 900d40e9d0SAdam Hornáček 910d40e9d0SAdam Hornáčekinclude file="pageheader.jspf" 920d40e9d0SAdam Hornáček 930d40e9d0SAdam Hornáček%> 940d40e9d0SAdam Hornáček</div> 950d40e9d0SAdam Hornáček<div id="Masthead"> 960d40e9d0SAdam Hornáček <% 970d40e9d0SAdam Hornáček{ 980d40e9d0SAdam Hornáček PageConfig cfg = PageConfig.get(request); 990d40e9d0SAdam Hornáček String path = cfg.getPath(); 1000d40e9d0SAdam Hornáček String context = request.getContextPath(); 1010d40e9d0SAdam Hornáček String rev = cfg.getRequestedRevision(); 1020d40e9d0SAdam Hornáček 1030d40e9d0SAdam Hornáček JSONArray messages = new JSONArray(); 1040d40e9d0SAdam Hornáček if (cfg.getProject() != null) { 1050d40e9d0SAdam Hornáček messages = Util.messagesToJson(cfg.getProject(), 1060d40e9d0SAdam Hornáček RuntimeEnvironment.MESSAGES_MAIN_PAGE_TAG); 1070d40e9d0SAdam Hornáček } 1080d40e9d0SAdam Hornáček %> 1090d40e9d0SAdam Hornáček <% if (!messages.isEmpty()) { %> 1100d40e9d0SAdam Hornáček <span class="important-note"> 1110d40e9d0SAdam Hornáček <% } %> 1120d40e9d0SAdam Hornáček <a href="<%= context + Prefix.XREF_P %>/">xref</a>: <%= Util 1130d40e9d0SAdam Hornáček .breadcrumbPath(context + Prefix.XREF_P, path,'/',"",true,cfg.isDir()) %> 1140d40e9d0SAdam Hornáček <% if (rev.length() != 0) { %> 1150d40e9d0SAdam Hornáček (revision <%= Util.htmlize(rev) %>) 1160d40e9d0SAdam Hornáček <% } %> 1170d40e9d0SAdam Hornáček <span id="dtag"> 1180d40e9d0SAdam Hornáček <% 1190d40e9d0SAdam Hornáček String dtag = cfg.getDefineTagsIndex(); 1200d40e9d0SAdam Hornáček if (dtag.length() > 0) { 1210d40e9d0SAdam Hornáček %> (<%= dtag %>)<% 1220d40e9d0SAdam Hornáček } 1230d40e9d0SAdam Hornáček %></span> 1240d40e9d0SAdam Hornáček <% if (!messages.isEmpty()) { %> 1250d40e9d0SAdam Hornáček </span> 1260d40e9d0SAdam Hornáček <span class="important-note important-note-rounded" 1270d40e9d0SAdam Hornáček data-messages='<%= messages %>'>!</span> 1280d40e9d0SAdam Hornáček <% } 1290d40e9d0SAdam Hornáček} 1300d40e9d0SAdam Hornáček%> 1310d40e9d0SAdam Hornáček</div> 1320d40e9d0SAdam Hornáček<%@ 1330d40e9d0SAdam Hornáček 1340d40e9d0SAdam Hornáčekinclude file="minisearch.jspf" 1350d40e9d0SAdam Hornáček 1360d40e9d0SAdam Hornáček%> 1370d40e9d0SAdam Hornáček<% 1380d40e9d0SAdam Hornáček/* ---------------------- mast.jsp end --------------------- */ 1390d40e9d0SAdam Hornáček%> 140