rss.jsp revision 1470
372N/A<%--
372N/A$Id$
372N/A
372N/ACDDL HEADER START
372N/A
372N/AThe contents of this file are subject to the terms of the
372N/ACommon Development and Distribution License (the "License").
372N/AYou may not use this file except in compliance with the License.
372N/A
372N/ASee LICENSE.txt included in this distribution for the specific
372N/Alanguage governing permissions and limitations under the License.
372N/A
372N/AWhen distributing Covered Code, include this CDDL HEADER in each
372N/Afile and include the License file at LICENSE.txt.
372N/AIf applicable, add the following below this CDDL HEADER, with the
372N/Afields enclosed by brackets "[]" replaced with your own identifying
372N/Ainformation: Portions Copyright [yyyy] [name of copyright owner]
372N/A
372N/ACDDL HEADER END
372N/A
372N/ACopyright 2005 Sun Microsystems, Inc. All rights reserved.
372N/AUse is subject to license terms.
372N/A
372N/APortions Copyright 2011 Jens Elkner.
372N/A
372N/A--%><%@page import="
372N/Ajava.text.SimpleDateFormat,
372N/Ajava.util.Set,
372N/A
372N/Aorg.opensolaris.opengrok.history.DirectoryHistoryReader,
372N/Aorg.opensolaris.opengrok.history.History,
372N/Aorg.opensolaris.opengrok.history.HistoryEntry,
493N/Aorg.opensolaris.opengrok.history.HistoryGuru,
372N/Aorg.opensolaris.opengrok.web.Util,
372N/Aorg.opensolaris.opengrok.web.Prefix,
493N/Aorg.opensolaris.opengrok.web.PageConfig"
493N/A%><%@ page session="false" errorPage="error.jsp"%><%@
372N/A
372N/Ainclude file="pageconfig.jspf"
493N/A
372N/A%><%
372N/A/* ---------------------- rss.jsp start --------------------- */
493N/A{
493N/A cfg = PageConfig.get(request);
372N/A String redir = cfg.canProcess();
372N/A if (redir == null || redir.length() > 0) {
460N/A if (redir != null) {
372N/A response.sendRedirect(redir);
372N/A } else {
372N/A response.sendError(HttpServletResponse.SC_NOT_FOUND);
372N/A }
372N/A return;
372N/A }
372N/A cfg.getConfig().setUrlPrefix(request.getContextPath() + Prefix.SEARCH_R + '?');
372N/A String path = cfg.getPath();
493N/A String dtag = cfg.getDefineTagsIndex();
493N/A response.setContentType("text/xml");
493N/A%><?xml version="1.0"?>
493N/A<?xml-stylesheet type="text/xsl" href="<%= request.getContextPath()
493N/A %>/rss.xsl.xml"?>
372N/A<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
372N/A<channel>
372N/A <title>Changes in <%= path.length() == 0
372N/A ? "Cross Reference"
372N/A : Util.htmlize(cfg.getResourceFile().getName()) %></title>
372N/A <link><%= Util.htmlize(request.getRequestURL().toString()) %></link>
372N/A <description><%= Util.htmlize(dtag) %></description>
372N/A <language>en</language>
372N/A <copyright>Copyright 2005</copyright>
372N/A <generator>Java</generator><%
493N/A History hist = null;
372N/A if(cfg.isDir()) {
372N/A hist = new DirectoryHistoryReader(cfg.getHistoryDirs()).getHistory();
372N/A } else {
372N/A hist = HistoryGuru.getInstance().getHistory(cfg.getResourceFile());
372N/A }
372N/A if (hist != null) {
372N/A int i = 20;
372N/A for (HistoryEntry entry : hist.getHistoryEntries()) {
372N/A if (i-- <= 0) {
372N/A break;
372N/A }
372N/A if (entry.isActive()) {
372N/A %>
372N/A <item>
372N/A <title><%= Util.htmlize(entry.getMessage()) %></title>
372N/A <description><%
372N/A if (cfg.isDir()) {
372N/A Set<String> files = entry.getFiles();
372N/A if (files != null) {
372N/A for (String ifile : files) {
372N/A %><%= Util.htmlize(ifile) %><%
372N/A }
493N/A }
372N/A } else {
372N/A %><%= Util.htmlize(path) %> - <%=
372N/A Util.htmlize(entry.getRevision()) %><%
372N/A }
372N/A %></description>
372N/A <pubDate><%
372N/A SimpleDateFormat df =
new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z");
df.format(entry.getDate());
%></pubDate>
<dc:creator><%= Util.htmlize(entry.getAuthor()) %></dc:creator>
</item>
<%
}
}
}
%>
</channel>
</rss>
<%
}
/* ---------------------- rss.jsp end --------------------- */
%>