mast.jsp revision 68903e4ab30e59de41fcf7293ec11b1ac96788b1
363N/ASee LICENSE.txt included in this distribution for the specific
363N/Afile and include the License file at LICENSE.txt.
3817N/A--%><%@ page import = "javax.servlet.*,
2221N/AString context = request.getContextPath();
363N/AString servlet = request.getServletPath();
844N/AString reqURI = request.getRequestURI();
3062N/AString path = request.getPathInfo();
2931N/ARuntimeEnvironment environment = RuntimeEnvironment.getInstance();
363N/Aenvironment.setUrlPrefix(context + "/s?");
3817N/AString rawSource = environment.getSourceRootPath();
365N/AresourcePath = resourceFile.getAbsolutePath();
363N/AString basename = resourceFile.getName();
363N/AString parentBasename = resourceFile.getParentFile().getName();
695N/AIgnoredNames ignoredNames = environment.getIgnoredNames();
363N/AString uriEncodedName = Util.URIEncodePath(path);
4250N/A|| ignoredNames.ignore(path)
814N/A|| ignoredNames.ignore(parentBasename)
363N/A|| !resourcePath.startsWith(rawSource)) {
791N/A response.sendError(404);
3062N/A if(newFile.canRead()) {
3062N/A response.sendRedirect(context + servlet + "/on" + path + "/");
363N/A response.sendRedirect(context + servlet + "/on" + path);
363N/A response.sendError(404);
363N/A if (File.separatorChar == '\\') {
2221N/A path = path.replace('\\','/');
2221N/A isDir = resourceFile.isDirectory();
2221N/A if (isDir && !servlet.startsWith("/xref") && !servlet.startsWith("/hist")) { //if it is an existing directory perhaps people wanted directory xref
2221N/A if(!reqURI.endsWith("/")) {
2221N/A response.sendRedirect(context + "/xref" + path + "/");
363N/A response.sendRedirect(context + "/xref" + path);
2221N/A } if (isDir && !reqURI.endsWith("/")) {
363N/A response.sendRedirect(context + servlet + path +"/");
363N/A long flast = resourceFile.lastModified();
363N/A if (request.getDateHeader("If-Modified-Since") >= flast ) {
363N/A response.setDateHeader("Last-Modified", flast);
363N/A int lastSlash = path.lastIndexOf('/');
363N/A parent = (lastSlash != -1) ? path.substring(0, lastSlash) : "";
363N/A int pLastSlash = parent.lastIndexOf('/');
3477N/A parentBasename = pLastSlash != -1 ? parent.substring(pLastSlash+1) : parent;
3477N/A noHistory = !HistoryGuru.getInstance().hasHistory(resourceFile);
363N/A !HistoryGuru.getInstance().hasAnnotation(resourceFile);
363N/A if(servlet.startsWith("/xr")) {
%><%@ include file="httpheader.jspf" %><%//below style is for the fancy always on top search bar%>
<script type="text/javascript">/* <![CDATA[ */
if (!window.location.hash) {$('#content').focus();}
<script type="text/javascript">/* <![CDATA[ */
if (this.className == 'blame') {
this.className = 'blame-hidden';
} else if (this.className == 'blame-hidden') {
this.className = 'blame';
<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%>/xref/">xref</a>: <%=org.opensolaris.opengrok.web.Util.breadcrumbPath(context + "/xref", path)%></tt></div>
if (noHistory || servlet.startsWith("/hi")) {
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>
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';
if ( servlet.startsWith("/xr") ) {
%> | <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("")) {
Project proj = Project.getProject(resourceFile);
//if (proj != null || !environment.hasProjects())
%><input type="hidden" name="project" value="<%=proj.getDescription()%>"/><%
if(path.length() > 0) {