rss.jsp revision 1186
0N/A<%--
1186N/A$Id$
1186N/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
1186N/APortions Copyright 2011 Jens Elkner.
1186N/A
1186N/A--%><%@page import="
1186N/Ajava.io.File,
1186N/Ajava.text.SimpleDateFormat,
1186N/Ajava.util.Set,
1186N/A
1186N/Aorg.opensolaris.opengrok.history.DirectoryHistoryReader,
1186N/Aorg.opensolaris.opengrok.history.History,
1186N/Aorg.opensolaris.opengrok.history.HistoryEntry,
1186N/Aorg.opensolaris.opengrok.history.HistoryGuru,
1186N/Aorg.opensolaris.opengrok.web.Util,
1186N/Aorg.opensolaris.opengrok.web.Prefix,
1186N/Aorg.opensolaris.opengrok.web.PageConfig"
1186N/A%><%@ page session="false" errorPage="error.jsp"%><%@
1186N/A
1186N/Ainclude file="pageconfig.jspf"
0N/A
1186N/A%><%
1186N/A/* ---------------------- rss.jsp start --------------------- */
1186N/A{
1186N/A cfg = PageConfig.get(request);
1186N/A String redir = cfg.canProcess();
1186N/A if (redir == null || redir.length() > 0) {
1186N/A if (redir != null) {
1186N/A response.sendRedirect(redir);
1186N/A } else {
1186N/A response.sendError(HttpServletResponse.SC_NOT_FOUND);
1186N/A }
1186N/A return;
1186N/A }
1186N/A cfg.getEnv().setUrlPrefix(request.getContextPath() + Prefix.SEARCH_R + '?');
1186N/A String path = cfg.getPath();
1186N/A String dtag = cfg.getDefineTagsIndex();
1186N/A response.setContentType("text/xml");
0N/A%><?xml version="1.0"?>
1186N/A<?xml-stylesheet type="text/xsl" href="<%= request.getContextPath()
1186N/A %>/rss.xsl.xml"?>
0N/A<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
0N/A<channel>
1186N/A <title>Changes in <%= path.length() == 0
1186N/A ? "Cross Reference"
1186N/A : Util.htmlize(cfg.getResourceFile().getName()) %></title>
1186N/A <link><%= Util.htmlize(request.getRequestURL()) %></link>
1186N/A <description><%= Util.htmlize(dtag) %></description>
1186N/A <language>en</language>
1186N/A <copyright>Copyright 2005</copyright>
1186N/A <generator>Java</generator><%
1186N/A History hist = null;
1186N/A if(cfg.isDir()) {
1186N/A hist = new DirectoryHistoryReader(cfg.getHistoryDirs()).getHistory();
1186N/A } else {
1186N/A hist = HistoryGuru.getInstance().getHistory(cfg.getResourceFile());
1186N/A }
1186N/A if (hist != null) {
1186N/A int i = 20;
1186N/A for (HistoryEntry entry : hist.getHistoryEntries()) {
1186N/A if (i-- <= 0) {
1186N/A break;
1186N/A }
1186N/A if (entry.isActive()) {
1186N/A %>
1186N/A <item>
1186N/A <title><%= Util.htmlize(entry.getMessage()) %></title>
1186N/A <description><%
1186N/A if (cfg.isDir()) {
1186N/A Set<String> files = entry.getFiles();
1186N/A if (files != null) {
1186N/A for (String ifile : files) {
1186N/A %><%= Util.htmlize(ifile) %><%
1186N/A }
1186N/A }
1186N/A } else {
1186N/A %><%= Util.htmlize(path) %> - <%=
1186N/A Util.htmlize(entry.getRevision()) %><%
1186N/A }
1186N/A %></description>
1186N/A <pubDate><%
1186N/A SimpleDateFormat df =
1186N/A new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z");
1186N/A Util.htmlize(df.format(entry.getDate()));
1186N/A %></pubDate>
1186N/A <dc:creator><%= Util.htmlize(entry.getAuthor()) %></dc:creator>
1186N/A </item>
1186N/A<%
1186N/A }
1186N/A }
1186N/A }
0N/A%>
1186N/A</channel>
1186N/A</rss>
0N/A<%
0N/A}
1186N/A/* ---------------------- rss.jsp end --------------------- */
0N/A%>