history.jsp revision 1186
3841a292dc897875faf23e639807abcc90082f3clgentisCDDL HEADER START
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzorThe contents of this file are subject to the terms of the
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzorCommon Development and Distribution License (the "License").
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzorYou may not use this file except in compliance with the License.
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzorSee LICENSE.txt included in this distribution for the specific
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzorlanguage governing permissions and limitations under the License.
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzorWhen distributing Covered Code, include this CDDL HEADER in each
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzorfile and include the License file at LICENSE.txt.
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzorIf applicable, add the following below this CDDL HEADER, with the
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzorfields enclosed by brackets "[]" replaced with your own identifying
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzorinformation: Portions Copyright [yyyy] [name of copyright owner]
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzorCDDL HEADER END
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzorCopyright 2005 Sun Microsystems, Inc. All rights reserved.
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzorUse is subject to license terms.
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzorPortions Copyright 2011 Jens Elkner.
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor--%><%@page import="
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzororg.opensolaris.opengrok.configuration.RuntimeEnvironment"
292d19d4d33644d88dfb182cdcfef173fafa6722lgentisinclude file="mast.jsp"
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor%><%/* ---------------------- history.jsp start --------------------- */
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis PageConfig cfg = PageConfig.get(request);
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor String path = cfg.getPath();
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor String context = request.getContextPath();
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor RuntimeEnvironment env = cfg.getEnv();
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor String uriEncodedName = cfg.getUriEncodedPath();
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis boolean striked = false;
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor String userPage = env.getUserPage();
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis String bugPage = env.getBugPage();
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis String bugRegex = env.getBugPattern();
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor if (bugRegex == null || bugRegex.equals("")) {
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis bugRegex = "\\b([12456789][0-9]{6})\\b";
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor Pattern bugPattern = Pattern.compile(bugRegex);
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor String reviewPage = env.getReviewPage();
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor String reviewRegex = env.getReviewPattern();
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis if(reviewRegex == null || reviewRegex.equals("")) {
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor reviewRegex = "\\b(\\d{4}/\\d{3})\\b";
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor Pattern reviewPattern = Pattern.compile(reviewRegex);
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor Format df = new SimpleDateFormat("dd-MMM-yyyy");
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor History hist=null;
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor hist = HistoryGuru.getInstance().getHistory(f);
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor } catch (Exception e) {
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor // should not happen
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor %><h3>Problem</h3><p class="error"><%= e.getMessage() %></p><%
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis if (hist != null) {
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor%><script type="text/javascript">/* <![CDATA[ */
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzordocument.domReady.push(function() {domReadyHistory();});
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor/* ]]> */</script>
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor<form action="<%= context + Prefix.DIFF_P + uriEncodedName %>">
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor<table class="src" id="revisions">
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor <caption>History log of <a href="<%= context + Prefix.XREF_P
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor + uriEncodedName %>"><%= path %></a></caption>
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor <th>Revision</th><%
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor <th><input type="submit" value=" Compare "/></th><%
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor <th>Date</th>
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor <th>Author</th>
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor <th>Comments <%
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor %><a href="#" onclick="javascript: toggle_filelist(); return false;">
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor <span class="filelist-hidden">
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor (<<< Hide modified files)</span>
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor <span class="filelist">
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor (Show modified files >>>)</span></a><%
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor int count=0;
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis for (HistoryEntry entry : hist.getHistoryEntries()) {
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor String rev = entry.getRevision();
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor if (rev == null || rev.length() == 0) {
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis <td><%= rev %></td><%
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis String rp = uriEncodedName;
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor <td><a name="<%= rev %>" href="<%=
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis context + Prefix.XREF_P + rp + "?r=" + Util.URIEncode(rev) %>"><%=
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor rev %></a></td>
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis <input type="radio"<%
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor if (count == 0 ) {
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor %> disabled="disabled"<%
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor } else if (count == 1) {
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor %> checked="checked"<%
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis %> name="r1" value="<%= rp %>@<%= rev%>"/>
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis <input type="radio"
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor name="r2"<%
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor if (count == 0) {
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor %> checked="checked"<%
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor %> value="<%= rp %>@<%= rev %>"/></td><%
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor striked = true;
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor <td><del><%= rev %></del></td>
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor <td></td><%
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis Date date = entry.getDate();
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor if (date != null) {
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor %><%= df.format(date) %><%
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor String author = entry.getAuthor();
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor if (author == null) {
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis %>(no author)<%
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor } else if (userPage != null && userPage.length() > 0) {
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor %><a href="<%= userPage + Util.htmlize(author)
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor %>"><%= Util.htmlize(author)%></a><%
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis %><%= author %><%
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis if (bugPage != null && bugPage.length() > 0) {
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor cout = bugPattern.matcher(cout).replaceAll("<a href=\""
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis + bugPage + "$1\">$1</a>");
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor if (reviewPage != null && reviewPage.length() > 0) {
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor cout = reviewPattern.matcher(cout).replaceAll("<a href=\""
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis + reviewPage + "$1\">$1</a>");
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor %><%= cout %><%
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor Set<String> files = entry.getFiles();
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor if (files != null) {
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor %><span class="filelist-hidden"><br/><%
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor for (String ifile : files) {
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor String jfile = ifile;
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor if ("/".equals(path)) {
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor } else if (ifile.startsWith(path)
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor if (rev == "") {
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor<a class="h" href="<%= context + Prefix.XREF_P + ifile %>"><%= jfile %></a><br/><%
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor<a class="h" href="<%= context + Prefix.XREF_P + ifile %>?r=<%= rev %>"><%= jfile %></a><br/><%
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor %></span><%
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor if (striked) {
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor%><p><b>Note:</b> No associated file changes are available for
292d19d4d33644d88dfb182cdcfef173fafa6722lgentisrevisions with strike-through numbers (eg. <del>1.45</del>)</p><%
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis<p class="rssbadge"><a href="<%=context + Prefix.RSS_P + uriEncodedName
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor%>" title="RSS XML Feed of latest changes"><span id="rssi"></span></a></p><%
292d19d4d33644d88dfb182cdcfef173fafa6722lgentis/* ---------------------- history.jsp end --------------------- */
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzorinclude file="foot.jspf"