mast.jsp revision 59bc918a4fdf38740c21c8f0cb31e21635cd15fc
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews<%--
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic UpdaterCDDL HEADER START
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic UpdaterThe contents of this file are subject to the terms of the
1167fc7904c5f0a472f8df207ac46dd52c7f1ec8Automatic UpdaterCommon Development and Distribution License (the "License").
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic UpdaterYou may not use this file except in compliance with the License.
46da3117812814a29432a8d9a9ccf8acdbfdadceAutomatic Updater
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic UpdaterSee LICENSE.txt included in this distribution for the specific
0519188c8e1ae76978fc4e0f799620cd36eba07aAutomatic Updaterlanguage governing permissions and limitations under the License.
79b273c187a4aa1016a62181983dfdd0521681aeMark Andrews
90ff38a0d8deaf5f9c2aa5916d99b2e572d28738Automatic UpdaterWhen distributing Covered Code, include this CDDL HEADER in each
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonfile and include the License file at LICENSE.txt.
ac4e70ff8955669341f435bc0a734a17c01af124Mark AndrewsIf applicable, add the following below this CDDL HEADER, with the
6c6a121295b30772cbf3dd75a51fb9d883051a0eAutomatic Updaterfields enclosed by brackets "[]" replaced with your own identifying
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtoninformation: Portions Copyright [yyyy] [name of copyright owner]
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater
e171a4137c6ba348957e61b7c4c3541493c0da02Automatic UpdaterCDDL HEADER END
e171a4137c6ba348957e61b7c4c3541493c0da02Automatic Updater
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCopyright 2009 Sun Microsystems, Inc. All rights reserved.
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic UpdaterUse is subject to license terms.
3cc98b8ecedcbc8465f1cf2740b966b315662430Automatic Updater--%><%@ page import = "javax.servlet.*,
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews java.lang.*,
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews javax.servlet.http.*,
e171a4137c6ba348957e61b7c4c3541493c0da02Automatic Updater java.util.*,
831f79c4310a7d38fc3475ccfff531b2b2535641Automatic Updater java.io.*,
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews org.opensolaris.opengrok.index.*,
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater org.opensolaris.opengrok.configuration.*,
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews org.opensolaris.opengrok.web.EftarFileReader,
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater org.opensolaris.opengrok.web.Util,
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson org.opensolaris.opengrok.history.HistoryGuru
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater "
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater %><%@ page session="false" %><%@ page errorPage="error.jsp"%><%
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonString context = request.getContextPath();
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic UpdaterString servlet = request.getServletPath();
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterString reqURI = request.getRequestURI();
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterString path = request.getPathInfo();
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Huntif (path == null) path = "";
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic UpdaterRuntimeEnvironment environment = RuntimeEnvironment.getInstance();
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updaterenvironment.setUrlPrefix(context + "/s?");
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Huntenvironment.register();
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterString rawSource = environment.getSourceRootPath();
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterString resourcePath = rawSource + path;
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterFile resourceFile = new File(resourcePath);
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan HuntresourcePath = resourceFile.getAbsolutePath();
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updaterboolean valid = true;
2d2dc37599979c83495510f8af8d1756753aa2c5Automatic Updaterboolean noHistory = true;
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Huntboolean noAnnotation = true;
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updaterboolean annotate = false;
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterString basename = resourceFile.getName();
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updaterboolean isDir = false;
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterEftarFileReader ef = null;
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterString parent = null;
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic UpdaterString parentBasename = resourceFile.getParentFile().getName();
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic UpdaterIgnoredNames ignoredNames = environment.getIgnoredNames();
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterString uriEncodedName = Util.URIEncodePath(path);
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updaterif(resourcePath.length() < rawSource.length()
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater|| ignoredNames.ignore(path)
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews|| ignoredNames.ignore(parentBasename)
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews|| !resourcePath.startsWith(rawSource)) {
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews valid = false;
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington response.sendError(404);
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater return;
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews} else if (!resourceFile.canRead() && resourcePath.startsWith(rawSource)) {
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater String newPath = rawSource + "/on/" + path; //TODO do we still use "on" ???
8e9f3b69914ee02a80b87c97b1f8093edb3e9ae0Automatic Updater File newFile = new File(newPath);
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews if(newFile.canRead()) {
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic Updater if(newFile.isDirectory() && servlet.startsWith("/xref") && !path.endsWith("/")) {
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews response.sendRedirect(context + servlet + "/on" + path + "/");
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic Updater } else {
80faf1588895fd26490f82f95a7a1b771df1c324Automatic Updater response.sendRedirect(context + servlet + "/on" + path);
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews }
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater }
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews valid = false;
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic Updater response.sendError(404);
693c4232dfdffaff672197d4b9fea944c64cf80aAutomatic Updater return;
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews} else {
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater valid = true;
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson path = resourcePath.substring(rawSource.length());
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater if ("".equals(path)) {
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater path = "/";
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews }
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater if (File.separatorChar == '\\') {
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson path = path.replace('\\','/');
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater }
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater isDir = resourceFile.isDirectory();
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson if (isDir && !servlet.startsWith("/xref") && !servlet.startsWith("/hist")) { //if it is an existing directory perhaps people wanted directory xref
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater if(!reqURI.endsWith("/")) {
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater response.sendRedirect(context + "/xref" + path + "/");
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater } else {
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews response.sendRedirect(context + "/xref" + path);
11af78f7dc35741bdab68dbab11b03daab005b28Automatic Updater }
11af78f7dc35741bdab68dbab11b03daab005b28Automatic Updater } if (isDir && !reqURI.endsWith("/")) {
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews response.sendRedirect(context + servlet + path +"/");
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont } else {
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater
8ccd7da886e93cd490fcb6f4c4e98a6514f35820Automatic Updater long flast = resourceFile.lastModified();
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont String dtag = "";
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater if (request.getDateHeader("If-Modified-Since") >= flast ) {
a308b69ac66fadf66863484f301314d6e6a3f1d2Automatic Updater response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews valid = false;
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews } else {
08e3b6797706a13054bad749dea04e94b514b8e7Automatic Updater
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater response.setDateHeader("Last-Modified", flast);
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews int lastSlash = path.lastIndexOf('/');
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews parent = (lastSlash != -1) ? path.substring(0, lastSlash) : "";
a308b69ac66fadf66863484f301314d6e6a3f1d2Automatic Updater int pLastSlash = parent.lastIndexOf('/');
a308b69ac66fadf66863484f301314d6e6a3f1d2Automatic Updater parentBasename = pLastSlash != -1 ? parent.substring(pLastSlash+1) : parent;
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews noHistory = !HistoryGuru.getInstance().hasHistory(resourceFile);
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews noAnnotation = isDir ||
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater !HistoryGuru.getInstance().hasAnnotation(resourceFile);
82447d835d3ff5c658749b4e9b4f66166407b3eaAutomatic Updater annotate = !noAnnotation &&
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews Boolean.parseBoolean(request.getParameter("a"));
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic Updater try{
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic Updater ef = new EftarFileReader(environment.getDataRootPath() + "/index/dtags.eftar");
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater dtag = ef.get(path);
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater if(servlet.startsWith("/xr")) {
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater } else {
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater if(ef != null) {
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater try {
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater ef.close();
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater } catch (IOException e) {
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater } finally {
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater ef = null;
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson }
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater }
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews }
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson } catch (Exception e) {
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater dtag = "";
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater }
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater String pageTitle="Cross Reference: " + path;
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updater
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updater%><%@ include file="httpheader.jspf" %><%//below style is for the fancy always on top search bar%>
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updater<script type="text/javascript" src="<%=context%>/jquery-1.4.2.min.js"></script>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater<script type="text/javascript">/* <![CDATA[ */
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson $().ready(function() {
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater if (!window.location.hash) {$('#content').focus();}
4104e236f71eb5108fcfda6711878a97f6f4a8e7Automatic Updater} );
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater/* ]]> */</script>
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater<body>
0ce87e5749aabb8eef1e0a37e4bd6e6ffa1d7196Automatic Updater<% if (annotate) { %>
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater<script type="text/javascript" src="<%=context%>/jquery.tooltip-1.3.pack.js"></script>
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater<script type="text/javascript">/* <![CDATA[ */
765c97d56ccddc9d7904c7d9ff2e2d825d9687e4Automatic Updaterfunction toggle_annotations() {
3e5340279d8875d136a4dd815cccad0044aa2644Automatic Updater $("span").each(function() {
8ccd7da886e93cd490fcb6f4c4e98a6514f35820Automatic Updater if (this.className == 'blame') {
da82e232161d67b77df2d67898bdac693f647be1Automatic Updater this.className = 'blame-hidden';
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater } else if (this.className == 'blame-hidden') {
d145b64cacc8d9cda51f9924ec70cd4661c3e2cfAutomatic Updater this.className = 'blame';
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater }
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater }
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater );
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater}
da82e232161d67b77df2d67898bdac693f647be1Automatic Updater$().ready(function() {
9c446b72069d0ab9f710502f4d7048e50875fccbAutomatic Updater $('a[id=r]').tooltip({
e85565067cf73f8cc21ee29b11761659f1d47ee9Automatic Updater left: 5,
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater showURL: false
bc0a53583d92309bebcf93c408e2f3247ebd3d3cAutomatic Updater });
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater} );
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater/* ]]> */</script>
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater<% } %>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<div id="page">
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<div id="whole_header" >
7f79131f9a8e804b93c57f3c679065cce878b726Automatic Updater<form action="<%=context%>/search">
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater <div id="header"><%@ include file="pageheader.jspf" %>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater <div id="pagetitle"><b id="filename">Cross Reference: <%=basename%></b><% if (dtag!=null & dtag!="") { %><br/><%=dtag%><% } %></div>
3f616e6f846be57b1717c6beaba0f74de9d5a7c6Automatic Updater </div>
da82e232161d67b77df2d67898bdac693f647be1Automatic Updater <div id="Masthead"><tt><a href="<%=context%>/xref/">xref</a>: <%=org.opensolaris.opengrok.web.Util.breadcrumbPath(context + "/xref", path)%></tt></div>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater <div id="bar"><a href="<%=context%>" id="home">Home</a> |
19b3dc94bce93fa76bd7e066f9298630dbc9dcb4Automatic Updater <%
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater if (noHistory || servlet.startsWith("/hi")) {
7f94d9a8162c9a96b56e66176702b66e79d8e1a2Automatic Updater %> <span class="c" id="history">History</span><%
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater } else {
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater %><a id="history" href="<%=context%>/history<%=path%>">History</a><%
f7a71eef29bcbf892270460269c79664f600cffdAutomatic Updater }
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater if (noAnnotation) {
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater %> | <span class="c" id="annotate">Annotate</span><%
71bd43eebd9d6e42dbcae62b730f5b6508d5acd8Automatic Updater } else {
82447d835d3ff5c658749b4e9b4f66166407b3eaAutomatic Updater String rev = request.getParameter("r");
7262eb86f2b465822206122921e2f357218f0cfdAutomatic Updater if (rev == null) {
96ea71632887c58a9d00f47eb318bf76b35903c3Mark Andrews rev = "";
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater } else if (rev.length() > 0) {
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater rev = "&r=" + rev;
bbb069be941f649228760edcc241122933c066d2Automatic Updater }
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater
4cda4fd158d6ded5586bacea8c388445d99611eaAutomatic Updater if (Boolean.parseBoolean(request.getParameter("a"))) {
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews %> | <span id="toggle-annotate-by-javascript" style="display: none">
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater <a href="#" onclick="javascript:toggle_annotations(); return false;" title="Show or hide line annotation(commit revisions,authors)." >Annotate</a>
80faf1588895fd26490f82f95a7a1b771df1c324Automatic Updater </span>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews <span id="toggle-annotate">
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater <a href="<%=context%>/xref<%=path%><%
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater if (rev.length() > 0) {
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews %>?<%=rev%><%
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews } %>">Annotate</a></span>
765c97d56ccddc9d7904c7d9ff2e2d825d9687e4Automatic Updater <script type="text/javascript">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews <!--
f7c88d61cc1ad2435b0b7cfaedfc9d5248c0be25Automatic Updater var toggle_js = document.getElementById('toggle-annotate-by-javascript');
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews var toggle_ss = document.getElementById('toggle-annotate');
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater
3f616e6f846be57b1717c6beaba0f74de9d5a7c6Automatic Updater toggle_js.style.display = 'inline';
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater toggle_ss.style.display = 'none';
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater // -->
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater </script> <%
f7a71eef29bcbf892270460269c79664f600cffdAutomatic Updater } else {
3e5340279d8875d136a4dd815cccad0044aa2644Automatic Updater %> | <a href="<%=context%>/xref<%=path%>?a=true<%=rev%>">Annotate</a><%
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington }
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater }
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater if (!isDir) {
cf7e98f59148b559946a7f1ca728471374f1eef3Automatic Updater if ( servlet.startsWith("/xr") ) {
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic Updater %> | <a href="#" onclick="javascript:lntoggle();return false;" title="Show or hide line numbers (might be slower if file has more than 10 000 lines).">Line #</a><%
8ccd7da886e93cd490fcb6f4c4e98a6514f35820Automatic Updater }
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater String rev = request.getParameter("r");
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater if (rev == null || rev.equals("")) {
cf7e98f59148b559946a7f1ca728471374f1eef3Automatic Updater %> | <a id="download" href="<%=context%>/raw<%=path%>">Download</a><%
c3fd32ed29e9e419bb56583f4272a506773b1ea0Automatic Updater } else {
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson %> | <a id="download" href="<%=context%>/raw<%=path%>?r=<%=rev%>">Download</a><%
c3fd32ed29e9e419bb56583f4272a506773b1ea0Automatic Updater }
c3fd32ed29e9e419bb56583f4272a506773b1ea0Automatic Updater }
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater Project proj = Project.getProject(resourceFile);
099b86fb8136a7dff81df85cf395978c16eb254cAutomatic Updater if (proj != null || !environment.hasProjects()) {
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington %> | <input id="search" name="q" class="q"/>
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater <input type="submit" value="Search" class="submit"/>
3857cb6fcabeb79d85de4b3e3e4ab99912b701f8Mark Andrews <%
572cb2c1c931f6bc6a4a019c103ae88239b0eb96Automatic Updater if (proj != null) {
7858b0168b866c0c2878fc4ea31fb5e581c1a6a9Automatic Updater %><input type="hidden" name="project" value="<%=proj.getDescription()%>"/><%
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews }
9174e44c14b1cb91a651fa1dc29470438c246ab9Automatic Updater if(isDir) {
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson if(path.length() > 0) {
e2caa7536302de34de6cc04025abcd53dc3a499aAutomatic Updater %><input type="checkbox" name="path" value="<%=path%>"/> only in <b><%=path%></b><%
56e7dc0c24b04210dcbffb180a9e35644fb820daAutomatic Updater }
7d12a6b412fe47e6d6582923fd6954ab8cd0baebAutomatic Updater } else {
8292deab031e7599cd7622aa7675fbe139ca6095Mark Andrews %><input type="checkbox" name="path" value="<%=parent%>"/> only in <b><%=parentBasename%></b><%
0b57424d28c9a67018107133f9fbc0a7dcf057e2Mark Andrews }
0b57424d28c9a67018107133f9fbc0a7dcf057e2Mark Andrews }
0b57424d28c9a67018107133f9fbc0a7dcf057e2Mark Andrews %>
ca35524ce2b57e6f1b261d23565d1288a355d12fAutomatic Updater</div></form></div>
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews <div id="content"><%
b109432c3a939bff66a463be86c371bd88efe3aaAutomatic Updater} // date check
7d12a6b412fe47e6d6582923fd6954ab8cd0baebAutomatic Updater } // not a directory redirect
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews}
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews%>
3351ccbd5c1961404044f8273d54dad405f53960Mark Andrews