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