history.jsp revision 0
0N/A<%--
0N/ACDDL HEADER START
0N/A
0N/AThe contents of this file are subject to the terms of the
0N/ACommon Development and Distribution License (the "License").
0N/AYou may not use this file except in compliance with the License.
0N/A
0N/ASee LICENSE.txt included in this distribution for the specific
0N/Alanguage governing permissions and limitations under the License.
0N/A
0N/AWhen distributing Covered Code, include this CDDL HEADER in each
0N/Afile and include the License file at LICENSE.txt.
0N/AIf applicable, add the following below this CDDL HEADER, with the
0N/Afields enclosed by brackets "[]" replaced with your own identifying
0N/Ainformation: Portions Copyright [yyyy] [name of copyright owner]
0N/A
0N/ACDDL HEADER END
0N/A
0N/ACopyright 2005 Sun Microsystems, Inc. All rights reserved.
0N/AUse is subject to license terms.
0N/A
0N/Aident "@(#)history.jsp 1.1 05/11/11 SMI"
0N/A
0N/A--%><%@ page import = "javax.servlet.*,
0N/Ajava.lang.*,
0N/Ajavax.servlet.http.*,
0N/Ajava.util.*,
0N/Ajava.io.*,
0N/Ajava.text.*,
0N/Aorg.opensolaris.opengrok.analysis.*,
0N/Aorg.opensolaris.opengrok.web.*,
0N/Aorg.opensolaris.opengrok.history.*,
0N/Ajava.util.regex.*
0N/A"
0N/A%><%@include file="mast.jsp"%><%
0N/Aif (path.length() > 0) {
0N/A boolean striked = false;
0N/A String userPage = getInitParameter("USER_PAGE");
0N/A String bugPage = getInitParameter("BUG_PAGE");
0N/A Pattern bugPattern = Pattern.compile("\\b([12456789][0-9]{6})\\b");
0N/A Format df = new SimpleDateFormat("dd-MMM-yyyy");
0N/A HistoryReader hr = null;
0N/A Date tstart = new Date();
0N/A if(isDir) {
0N/A String[] apaths = request.getParameterValues("also");
0N/A String apath = path;
0N/A if (apaths!= null && apaths.length>0) {
0N/A StringBuilder paths = new StringBuilder(path);
0N/A for(int i=0; i< apaths.length; i++) {
0N/A paths.append(' ');
0N/A paths.append(apaths[i]);
0N/A }
0N/A apath = paths.toString();
0N/A }
0N/A hr = new DirectoryHistoryReader(getServletContext().getInitParameter("DATA_ROOT") + "/index", apath, getServletContext().getInitParameter("SRC_ROOT"));
0N/A } else {
0N/A hr = HistoryGuru.getInstance().getHistoryReader(rawSource + parent, basename);
0N/A }
0N/A if (hr != null) {
0N/A
0N/A%><form action="<%=context%>/diff<%=path%>">
0N/A<table cellspacing="0" cellpadding="2" border="0" width="100%" class="src">
0N/A<tr><td colspan="4"><span class="pagetitle">History log of <a href="<%= context +"/xref" + path %>"><%=basename%></a></span></td></tr>
0N/A<tr class="thead"><%
0N/Aif(!isDir) {
0N/A%><td>Revision</td><th><input type="submit" value=" Compare "/></th><%
0N/A}
0N/A%><td>Date</td><td>Author</td><td>Comments</td></tr><%
0N/Aboolean alt = true;
0N/Awhile (hr.next()) {
0N/A String rev = hr.getRevision();
0N/A alt = !alt;
0N/A%><tr valign="top" <%= alt ? "class=\"alt\"" : "" %>><%
0N/Aif(!isDir) {
0N/A if(hr.isActive()) {
0N/A%><td>&nbsp;<a name="<%=rev%>" href="<%= context +"/xref" + path + "?r=" + rev %>"><%=rev%></a>&nbsp;</td><td align="center"><input type="radio" name="r1" value="<%=rev%>"/>
0N/A<input type="radio" name="r2" value="<%=rev%>"/></td><%
0N/A } else {
0N/A striked = true;
0N/A %><td><strike>&nbsp;<%=rev%>&nbsp; </strike></td><td>&nbsp;</td><%
0N/A }
0N/A}
0N/A%><td><%= df.format(hr.getDate()) %>&nbsp;</td>
0N/A<td>
0N/A<%
0N/A
0N/Aif(userPage != null && ! userPage.equals("")) {
0N/A %><a href="<%= userPage + hr.getAuthor() %>"><%= hr.getAuthor() %></a><%
0N/A} else {
0N/A %><%= hr.getAuthor() %><%
0N/A}
0N/A
0N/A%>&nbsp;</td><td><%=
0N/A(bugPage != null && ! bugPage.equals("")) ?
0N/A bugPattern.matcher(Util.Htmlize(hr.getComment())).replaceAll("<a href=\"" + bugPage + "$1\">$1</a>")
0N/A : Util.Htmlize(hr.getComment())
0N/A%><%
0N/AArrayList files = hr.getFiles();
0N/Aif(files != null) {
0N/A Iterator ifiles = files.iterator();
0N/A while(ifiles.hasNext()) {
0N/A String ifile = (String)ifiles.next();
0N/A String jfile = ifile.startsWith(path) ? ifile.substring(path.length()+1) : ifile;
0N/A %><a class="h" href="<%=context%>/xref<%=ifile%>"><%=jfile%></a><br/><%
0N/A }
0N/A}
0N/A%></td></tr><%
0N/A}
0N/A %></table></form><%
0N/A hr.close();
0N/A if(striked) {
0N/A %><p><b>Note:</b> No associated file changes are available for revisions with strike-through numbers (eg. <strike>1.45</strike>)</p><%
0N/A }
0N/A %><p class="rssbadge"><a href="<%=context%>/rss<%=path%>"><img src="<%=context%>/img/rss.png" width="80" height="15" alt="RSS XML Feed" title="RSS XML Feed of latest changes"/></a></p><%
0N/A } else {
0N/A response.sendError(404, "No history");
0N/A }
0N/A}
0N/A%><%@include file="foot.html"%>