mast.jsp revision 954
0N/ASee LICENSE.txt included in this distribution for the specific
0N/Afile and include the License file at LICENSE.txt.
850N/A--%><%@ page import = "javax.servlet.*,
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();
128N/Aenvironment.setUrlPrefix(context + "/s?");
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()) {
0N/A response.sendRedirect(context + servlet + "/on" + path + "/");
0N/A response.sendRedirect(context + servlet + "/on" + path);
0N/A response.sendError(404);
0N/A if (File.separatorChar == '\\') {
0N/A path = path.replace('\\','/');
0N/A isDir = resourceFile.isDirectory();
0N/A if (isDir && !servlet.startsWith("/xref") && !servlet.startsWith("/hist")) { //if it is an existing directory perhaps people wanted directory xref
0N/A if(!reqURI.endsWith("/")) {
0N/A response.sendRedirect(context + "/xref" + path + "/");
0N/A response.sendRedirect(context + "/xref" + path);
0N/A } if (isDir && !reqURI.endsWith("/")) {
0N/A response.sendRedirect(context + servlet + path +"/");
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);
0N/A if(servlet.startsWith("/xr")) {
144N/A%><%@ include file="httpheader.jspf" %>
878N/A<script type="text/javascript">/* <![CDATA[ */
878N/A var spans = document.getElementsByTagName("span");
878N/A for (var i = 0; i < spans.length; i++) {
878N/A if (span.className == 'blame') {
878N/A span.className = 'blame-hidden';
878N/A } else if (span.className == 'blame-hidden') {
878N/A span.className = 'blame';
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>
954N/A <div id="Masthead"><tt><a href="<%=context%>/xref/">xref</a>: <%=org.opensolaris.opengrok.web.Util.breadcrumbPath(context + "/xref", path)%></tt></div>
581N/A if (noHistory || servlet.startsWith("/hi")) {
581N/A String rev = request.getParameter("r");
581N/A } else if (rev.length() > 0) {
896N/A <a href="#" onclick="javascript:toggle_annotations(); return false;" title="Show or hide line annotation(commit revisions,authors)." >Annotate</a>
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';
878N/A if ( servlet.startsWith("/xr") ) {
896N/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><%
581N/A String rev = request.getParameter("r");
581N/A if (rev == null || rev.equals("")) {
581N/A Project proj = Project.getProject(resourceFile);
581N/A if (proj != null || !environment.hasProjects()) {
867N/A %><input type="hidden" name="project" value="<%=proj.getDescription()%>"/><%
0N/A if(path.length() > 0) {