mast.jsp revision 1126
286N/ASee LICENSE.txt included in this distribution for the specific
286N/Afile and include the License file at LICENSE.txt.
286N/A--%><%@page import="org.opensolaris.opengrok.web.Constants"%>
286N/A<%@ page import = "javax.servlet.*,
286N/AString context = request.getContextPath();
286N/AString servlet = request.getServletPath();
286N/AString reqURI = request.getRequestURI();
286N/AString path = request.getPathInfo();
286N/ARuntimeEnvironment environment = RuntimeEnvironment.getInstance();
286N/AString rawSource = environment.getSourceRootPath();
286N/AresourcePath = resourceFile.getAbsolutePath();
286N/AString basename = resourceFile.getName();
286N/AString parentBasename = resourceFile.getParentFile().getName();
286N/AIgnoredNames ignoredNames = environment.getIgnoredNames();
286N/AString uriEncodedName = Util.URIEncodePath(path);
286N/A|| ignoredNames.ignore(path)
286N/A|| ignoredNames.ignore(parentBasename)
286N/A|| !resourcePath.startsWith(rawSource)) {
286N/A response.sendError(404);
286N/A if(newFile.canRead()) {
286N/A response.sendRedirect(context + servlet + "/on" + uriEncodedName + "/");
286N/A response.sendRedirect(context + servlet + "/on" + uriEncodedName);
286N/A response.sendError(404);
286N/A if (File.separatorChar == '\\') {
286N/A path = path.replace('\\','/');
286N/A uriEncodedName = Util.URIEncodePath(path);
286N/A isDir = resourceFile.isDirectory();
286N/A if (isDir && !servlet.startsWith(Constants.xrefP) && !servlet.startsWith(Constants.histP)) { //if it is an existing directory perhaps people wanted directory xref
286N/A if(!reqURI.endsWith("/")) {
286N/A } if (isDir && !reqURI.endsWith("/")) {
286N/A response.sendRedirect(context + servlet + uriEncodedName +"/");
286N/A long flast = resourceFile.lastModified();
286N/A if (request.getDateHeader("If-Modified-Since") >= flast ) {
286N/A response.setDateHeader("Last-Modified", flast);
286N/A int lastSlash = path.lastIndexOf('/');
286N/A parent = (lastSlash != -1) ? path.substring(0, lastSlash) : "";
286N/A int pLastSlash = parent.lastIndexOf('/');
286N/A parentBasename = pLastSlash != -1 ? parent.substring(pLastSlash+1) : parent;
286N/A noHistory = !HistoryGuru.getInstance().hasHistory(resourceFile);
286N/A !HistoryGuru.getInstance().hasAnnotation(resourceFile);
286N/A%><%@ include file="httpheader.jspf" %><%//below style is for the fancy always on top search bar%>
286N/A<script type="text/javascript">/* <![CDATA[ */
286N/A if (!window.location.hash) {$('#content').focus();}
286N/A<script type="text/javascript">/* <![CDATA[ */
286N/A if (this.className == 'blame') {
286N/A this.className = 'blame-hidden';
286N/A } else if (this.className == 'blame-hidden') {
286N/A this.className = 'blame';
<form action="<%=context+Constants.searchP%>">
<div id="header"><%@ include file="pageheader.jspf" %>
<div id="pagetitle"><b id="filename">Cross Reference: <%=basename%></b><% if (dtag!=null & dtag!="") { %><br/><%=dtag%><% } %></div>
<div id="Masthead"><tt><a href="<%=context+Constants.xrefP%>/">xref</a>: <%=org.opensolaris.opengrok.web.Util.breadcrumbPath(context + Constants.xrefP, path)%></tt></div>
%><a id="history" href="<%=context+Constants.histL+uriEncodedName%>">History</a><%
String rev = request.getParameter("r");
} else if (rev.length() > 0) {
<a href="#" onclick="javascript:toggle_annotations(); return false;" title="Show or hide line annotation(commit revisions,authors)." >Annotate</a>
<a href="<%=context+Constants.xrefP+uriEncodedName%><%
if (rev.length() > 0) {
<script type="text/javascript">
var toggle_js = document.getElementById('toggle-annotate-by-javascript');
var toggle_ss = document.getElementById('toggle-annotate');
toggle_js.style.display = 'inline';
toggle_ss.style.display = 'none';
%> | <a href="<%=context+Constants.xrefP+uriEncodedName%>?a=true<%=rev%>">Annotate</a><%
%> | <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> | <a href="#" onclick="javascript:lsttoggle();return false;" title="Show or hide symbol list.">List</a><%
String rev = request.getParameter("r");
if (rev == null || rev.equals("")) {
%> | <a id="download" href="<%=context+Constants.rawP+uriEncodedName%>">Download</a><%
%> | <a id="download" href="<%=context+Constants.rawP+uriEncodedName%>?r=<%=rev%>">Download</a><%
Project proj = Project.getProject(resourceFile);
//if (proj != null || !environment.hasProjects())
%><input type="hidden" name="project" value="<%=proj.getDescription()%>"/><%
if(path.length() > 0) {