From 0d641a3abf09179ceff91738ada31baa27fcbeec Mon Sep 17 00:00:00 2001 From: "myk%mozilla.org" Date: Tue, 15 Mar 2005 17:16:25 +0000 Subject: [PATCH] Fix for bug 82878: Generate RSS 1.0 version of bug lists. Patch by Jason Remillard. r=myk a=myk --- webtools/bugzilla/Bugzilla/Constants.pm | 5 +- webtools/bugzilla/docs/xml/using.xml | 28 +++++- .../en/default/global/header.html.tmpl | 8 ++ .../template/en/default/list/list.html.tmpl | 3 + .../template/en/default/list/list.ics.tmpl | 8 +- .../template/en/default/list/list.rss.tmpl | 95 +++++++++++++++++++ 6 files changed, 140 insertions(+), 7 deletions(-) create mode 100644 webtools/bugzilla/template/en/default/list/list.rss.tmpl diff --git a/webtools/bugzilla/Bugzilla/Constants.pm b/webtools/bugzilla/Bugzilla/Constants.pm index d59ae0f84f20..45897a332963 100644 --- a/webtools/bugzilla/Bugzilla/Constants.pm +++ b/webtools/bugzilla/Bugzilla/Constants.pm @@ -126,10 +126,11 @@ use constant LOGOUT_KEEP_CURRENT => 2; use constant contenttypes => { - "html" => "text/html" , + "html"=> "text/html" , "rdf" => "application/rdf+xml" , + "rss" => "application/rss+xml" , "xml" => "application/xml" , - "js" => "application/x-javascript" , + "js" => "application/x-javascript" , "csv" => "text/plain" , "png" => "image/png" , "ics" => "text/calendar" , diff --git a/webtools/bugzilla/docs/xml/using.xml b/webtools/bugzilla/docs/xml/using.xml index 43adc3bfc799..de5d9d26d662 100644 --- a/webtools/bugzilla/docs/xml/using.xml +++ b/webtools/bugzilla/docs/xml/using.xml @@ -461,7 +461,22 @@ get the buglist as comma-separated values, for import into e.g. a spreadsheet. - + + + RSS + + get the buglist as a RSS 1.0 feed. It is used by setting up your + buglist query and then copying this links url into your RSS reader. If + you are using firefox, you can also save the buglist as a live + bookmark. If you would like to limit the number of RSS items, add + a limit=n url parameter. + + + iCalendar + + Get the buglist as an iCalendar file. Each bug is represented as a + to-do item in the imported calendar. + Change Columns: @@ -494,6 +509,17 @@ + + + If you would like to access the bug list from another program + it is often useful to have the list returned in something other + than HTML. By adding the ctype=type parameter into the bug list URL + you can specify several alternate formats. The supported formats + are: Comma Separated Values (ctype=csv), iCalendar (ctype=ics), + RDF Site Summary (RSS) 1.0 (ctype=rss), ECMAScript, also known + as JavaScript (ctype=js), and finally Resource Description Framework + RDF/XML (ctype=rdf). +
diff --git a/webtools/bugzilla/template/en/default/global/header.html.tmpl b/webtools/bugzilla/template/en/default/global/header.html.tmpl index 3c7c6f170340..90c3659fe828 100644 --- a/webtools/bugzilla/template/en/default/global/header.html.tmpl +++ b/webtools/bugzilla/template/en/default/global/header.html.tmpl @@ -35,6 +35,7 @@ # style: string. CSS style. # style_urls: list. List of URLs to CSS style sheets. # message: string. A message to display to the user. May contain HTML. + # rsslink: rss link url, May contain HTML #%] [% IF message %] @@ -99,6 +100,13 @@ [% END %] [% END %] + [%# this puts the live bookmark up on firefox for the RSS feed %] + [% IF rsslink %] + + [% END %] + [%# Migration note: contents of the old Param 'bodyhtml' go in the body tag, diff --git a/webtools/bugzilla/template/en/default/list/list.html.tmpl b/webtools/bugzilla/template/en/default/list/list.html.tmpl index e0a5a2b9367e..ce42ed03a6d3 100644 --- a/webtools/bugzilla/template/en/default/list/list.html.tmpl +++ b/webtools/bugzilla/template/en/default/list/list.html.tmpl @@ -48,6 +48,7 @@ [% PROCESS global/header.html.tmpl title = title style = style + rsslink = "buglist.cgi?$urlquerypart&ctype=rss" %]
@@ -150,6 +151,8 @@ CSV | RSS | + iCalendar | Change Columns | diff --git a/webtools/bugzilla/template/en/default/list/list.ics.tmpl b/webtools/bugzilla/template/en/default/list/list.ics.tmpl index 27dc1b401ed9..6246cf7551de 100644 --- a/webtools/bugzilla/template/en/default/list/list.ics.tmpl +++ b/webtools/bugzilla/template/en/default/list/list.ics.tmpl @@ -18,7 +18,7 @@ # # Contributor(s): William Jon McCann #%] -[% PROCESS global/variables.none.tmpl %] +[% PROCESS global/variables.none.tmpl %][% USE date %] BEGIN:VCALENDAR CALSCALE:GREGORIAN [%+ PROCESS ics_prodid +%] @@ -32,7 +32,7 @@ BEGIN:VTODO [%+ PROCESS ics_status bug_status = bug.bug_status +%] [%+ PROCESS ics_dtstamp +%] [% IF bug.changeddate %] -[%+ bug.changeddate FILTER ics('LAST-MODIFIED') +%] +[%+ date.format(bug.changedtime,"%Y%m%dT%H%M%SZ") FILTER ics('LAST-MODIFIED') +%] [% END %] [% IF bug.percentage_complete %] [%+ bug.percentage_complete FILTER format('%d') FILTER ics('PERCENT-COMPLETE') +%] @@ -66,11 +66,11 @@ END:VCALENDAR [% END %] [% BLOCK ics_dtstart %] - [% bug.opendate FILTER ics('DTSTART') %] + [% date.format(bug.opentime,"%Y%m%dT%H%M%SZ") FILTER ics('DTSTART') %] [% END %] [% BLOCK ics_dtstamp %] - [% currenttime FILTER ics('DTSTAMP') %] + [% date.format(date.now,"%Y%m%dT%H%M%SZ") FILTER ics('DTSTAMP') %] [% END %] [% BLOCK ics_status %] diff --git a/webtools/bugzilla/template/en/default/list/list.rss.tmpl b/webtools/bugzilla/template/en/default/list/list.rss.tmpl new file mode 100644 index 000000000000..53352f22585b --- /dev/null +++ b/webtools/bugzilla/template/en/default/list/list.rss.tmpl @@ -0,0 +1,95 @@ +[%# 1.0@bugzilla.org %] +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # The Initial Developer of the Original Code is Netscape Communications + # Corporation. Portions created by Netscape are + # Copyright (C) 1998 Netscape Communications Corporation. All + # Rights Reserved. + # + # Contributor(s): Walter Hoehn + # John Belmonte + # Jason Remillard + # + # This is a template for generating an RSS 1.0 representation of a buglist. + #%] + +[% PROCESS global/variables.none.tmpl %] +[% USE date %] + +[% DEFAULT title = "$terms.Bugzilla $terms.Bugs" %] + + + + + + [% title FILTER xml %] + [% "$terms.Bugzilla $terms.bug list" FILTER xml %] + + [% Param('urlbase') %]buglist.cgi? + [%- urlquerypart.replace('ctype=rss[&]?','') FILTER xml -%] + + + hourly + 2 + + + + [% FOREACH bug = bugs %] + + [% END %] + + + + + + [% FOREACH bug = bugs %] + + [% bug.short_desc FILTER xml %] + [% Param('urlbase') FILTER xml %]show_bug.cgi?id=[% bug.bug_id FILTER xml %] + [% bug.reporter_realname FILTER xml %] + [% date.format( format=>"%Y-%m-%dT%H:%MZ",time=>bug.opentime) FILTER xml %] + + [%# Filter out the entire block, so that we don't need to escape the html code out %] + [% FILTER xml %] + + + + + + + + + + + + + + + + + + + + + + +
FieldValue
[% columns.opendate.title FILTER none %][% bug.opendate FILTER none %]
[% columns.assigned_to_realname.title FILTER none %][% bug.assigned_to_realname FILTER none %]
[% columns.priority.title FILTER none %][% bug.priority FILTER none %]
[% columns.bug_severity.title FILTER none %] [% bug.bug_severity FILTER none %]
[% columns.bug_status.title FILTER none %][% bug.bug_status FILTER none %]
[% columns.changeddate.title FILTER none %][% bug.changeddate FILTER none -%]
+ [% END %] +
+
+ [% END %] +