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