[smolder-commits] SF.net SVN: smolder: [577] trunk
Brought to you by:
michael_peters
From: <mic...@us...> - 2007-06-16 16:49:09
|
Revision: 577 http://svn.sourceforge.net/smolder/?rev=577&view=rev Author: michael_peters Date: 2007-06-16 09:49:08 -0700 (Sat, 16 Jun 2007) Log Message: ----------- Removed RSS feeds in favor of using Atom. Modified Paths: -------------- trunk/docs/Changes.pod trunk/lib/Smolder/Control/Admin/Projects.pm trunk/lib/Smolder/Control/Public/Projects.pm trunk/lib/Smolder/Platform.pm trunk/sql/mysql/project.sql trunk/sql/sqlite/project.sql trunk/templates/Admin/Projects/add.tmpl trunk/templates/Admin/Projects/details.tmpl trunk/templates/Admin/Projects/edit.tmpl trunk/upgrades/sql/mysql/V1_1.sql trunk/upgrades/sql/sqlite/V1_1.sql Added Paths: ----------- trunk/src/Carp-Clan-5.9.tar.gz trunk/src/XML-Atom-SimpleFeed-0.8.tar.gz Removed Paths: ------------- trunk/templates/RSS/ Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Name: svk:merge - 6cb60ec2-19fc-4f48-ba02-516b4c84136d:/local/smolder:23500 ef85ff6a-427b-4ddd-bce6-61dc0fed61e7:/local/smolder/trunk:14952 + 6cb60ec2-19fc-4f48-ba02-516b4c84136d:/local/smolder:23500 ef85ff6a-427b-4ddd-bce6-61dc0fed61e7:/local/smolder/trunk:14980 Modified: trunk/docs/Changes.pod =================================================================== --- trunk/docs/Changes.pod 2007-06-16 16:48:44 UTC (rev 576) +++ trunk/docs/Changes.pod 2007-06-16 16:49:08 UTC (rev 577) @@ -6,7 +6,7 @@ =item * Now using straight TAP (bundled in an archive file) instead of the custom XML/YAML thing we were using before. - M. Peters -=item * Added RSS and Atom feeds that can be enabled per project. - M. Peters +=item * Added Atom feeds that can be enabled per project. - M. Peters =item * Updated various component source modules and projects. - M. Peters Modified: trunk/lib/Smolder/Control/Admin/Projects.pm =================================================================== --- trunk/lib/Smolder/Control/Admin/Projects.pm 2007-06-16 16:48:44 UTC (rev 576) +++ trunk/lib/Smolder/Control/Admin/Projects.pm 2007-06-16 16:49:08 UTC (rev 577) @@ -191,7 +191,7 @@ project_name => $project->name, start_date => $project->start_date->strftime('%m/%d/%Y'), public => $project->public, - enable_rss => $project->enable_rss, + enable_feed => $project->enable_feed, ); $output = HTML::FillInForm->new->fill( scalarref => $self->tt_process( \%tt_params ), @@ -247,12 +247,12 @@ my $self = shift; my $id = $self->param('id'); my $form = { - required => [qw(project_name start_date public enable_rss)], + required => [qw(project_name start_date public enable_feed)], constraint_methods => { project_name => [ length_max(255), unique_field_value( 'project', 'name', $id ), ], start_date => to_datetime('%m/%d/%Y'), public => bool(), - enable_rss => bool(), + enable_feed => bool(), }, }; Modified: trunk/lib/Smolder/Control/Public/Projects.pm =================================================================== --- trunk/lib/Smolder/Control/Public/Projects.pm 2007-06-16 16:48:44 UTC (rev 576) +++ trunk/lib/Smolder/Control/Public/Projects.pm 2007-06-16 16:49:08 UTC (rev 577) @@ -5,6 +5,7 @@ use Smolder::DB; use Smolder::DB::Project; use HTML::FillInForm; +use XML::Atom::SimpleFeed; =head1 NAME @@ -33,7 +34,7 @@ add_report process_add_report forbidden - rss + feed ) ] ); @@ -115,23 +116,22 @@ This method is provided by L<Smolder::Control::Developer::Projects>. -=head2 rss +=head2 feed -Will return an RSS 2.0 feed to the browser. The 5 most recent smoke +Will return an XML data feed (Atom) to the browser. The 5 most recent smoke reports for a project are included in this feed. An optional C<type> can also be specified which is can either be C<all> or C<failures>.Only -projects that have been marked as C<enable_rss> will appear in any -RSS feed. +projects that have been marked as C<enable_feed> will appear in any feed. =cut -sub rss { +sub feed { my $self = shift; my @binds; my $sql = qq/ SELECT sr.* FROM smoke_report sr JOIN project p ON (sr.project = p.id) - WHERE p.enable_rss = 1 AND p.id = ? + WHERE p.enable_feed = 1 AND p.id = ? /; my $id = $self->param('id'); my $type = $self->param('type'); @@ -148,15 +148,27 @@ my @reports = Smolder::DB::SmokeReport->sth_to_objects($sth); $self->header_props(-type => 'text/xml'); - - my $output = $self->tt_process( - 'RSS/public_project.tmpl', - { - reports => \@reports, - hostname => HostName(), - no_wrapper => 1, - } + + my $feed = XML::Atom::SimpleFeed->new( + title => 'Smolder - ' . HostName, + link => $self->url_base, + id => $self->url_base, + updated => $reports[0]->added->strftime('%FT%TZ'), ); + foreach my $report (@reports) { + my $link = 'http://' . HostName . '/app/developer_projects/smoke_report/' . $report->id; + $feed->add_entry( + title => '#' + . $report->id . ' - ' + . ( $report->failed ? 'Failed' : 'New' ) + . ' Smoke Report', + author => $report->developer->username, + link => $link, + id => $link, + summary => $report->summary, + ); + } + return $feed->as_string(); } 1; Modified: trunk/lib/Smolder/Platform.pm =================================================================== --- trunk/lib/Smolder/Platform.pm 2007-06-16 16:48:44 UTC (rev 576) +++ trunk/lib/Smolder/Platform.pm 2007-06-16 16:49:08 UTC (rev 577) @@ -778,6 +778,7 @@ "Build support for animated GIFs? [y]" => 'n', "Build XPM support? [y]" => 'n', "Where is libgd installed? [/usr/lib]" => '/usr/lib', + "Add Object::Deadly" => 'n', }; } Modified: trunk/sql/mysql/project.sql =================================================================== --- trunk/sql/mysql/project.sql 2007-06-16 16:48:44 UTC (rev 576) +++ trunk/sql/mysql/project.sql 2007-06-16 16:49:08 UTC (rev 577) @@ -8,7 +8,7 @@ name VARCHAR(255) NOT NULL DEFAULT '', start_date DATETIME NULL, public BOOL NOT NULL DEFAULT 1, - enable_rss BOOL NOT NULL DEFAULT 1, + enable_feed BOOL NOT NULL DEFAULT 1, default_platform VARCHAR(255) NOT NULL DEFAULT '', default_arch VARCHAR(255) NOT NULL DEFAULT '', graph_start ENUM('project', 'year', 'month', 'week', 'day') NOT NULL DEFAULT 'project', Modified: trunk/sql/sqlite/project.sql =================================================================== --- trunk/sql/sqlite/project.sql 2007-06-16 16:48:44 UTC (rev 576) +++ trunk/sql/sqlite/project.sql 2007-06-16 16:49:08 UTC (rev 577) @@ -3,7 +3,7 @@ name TEXT NOT NULL, start_date INTEGER NOT NULL, public INTEGER DEFAULT 1, - enable_rss INTEGER DEFAULT 1, + enable_feed INTEGER DEFAULT 1, default_platform TEXT DEFAULT '', default_arch TEXT DEFAULT '', graph_start TEXT DEFAULT 'project', Added: trunk/src/Carp-Clan-5.9.tar.gz =================================================================== (Binary files differ) Property changes on: trunk/src/Carp-Clan-5.9.tar.gz ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/XML-Atom-SimpleFeed-0.8.tar.gz =================================================================== (Binary files differ) Property changes on: trunk/src/XML-Atom-SimpleFeed-0.8.tar.gz ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/templates/Admin/Projects/add.tmpl =================================================================== --- trunk/templates/Admin/Projects/add.tmpl 2007-06-16 16:48:44 UTC (rev 576) +++ trunk/templates/Admin/Projects/add.tmpl 2007-06-16 16:49:08 UTC (rev 577) @@ -21,10 +21,10 @@ <input type="radio" name="public" value="1" /> Yes <input type="radio" name="public" value="0" /> No </td> - <td><label class="required[%IF c.dfv_msgs.err_enable_rss %] warn[% END %]">Enable RSS Feeds? *</label></td> + <td><label class="required[%IF c.dfv_msgs.err_enable_feed %] warn[% END %]">Enable XML Data Feeds (Atom)? *</label></td> <td> - <input type="radio" name="enable_rss" value="1" /> Yes - <input type="radio" name="enable_rss" value="0" /> No + <input type="radio" name="enable_feed" value="1" /> Yes + <input type="radio" name="enable_feed" value="0" /> No </td> </tr> <tr> Modified: trunk/templates/Admin/Projects/details.tmpl =================================================================== --- trunk/templates/Admin/Projects/details.tmpl 2007-06-16 16:48:44 UTC (rev 576) +++ trunk/templates/Admin/Projects/details.tmpl 2007-06-16 16:49:08 UTC (rev 577) @@ -31,8 +31,8 @@ <td>[% IF project.public %] Yes [% ELSE %] No [% END %]</td> </tr> <tr> - <td><label>Enable RSS Feeds?</label></td> - <td>[% IF project.enable_rss %] Yes [% ELSE %] No [% END %]</td> + <td><label>Enable XML Data Feeds?</label></td> + <td>[% IF project.enable_feed %] Yes [% ELSE %] No [% END %]</td> </tr> <tr class="even"> <td valign="top"><label>Project Admin(s)</label></td> Modified: trunk/templates/Admin/Projects/edit.tmpl =================================================================== --- trunk/templates/Admin/Projects/edit.tmpl 2007-06-16 16:48:44 UTC (rev 576) +++ trunk/templates/Admin/Projects/edit.tmpl 2007-06-16 16:49:08 UTC (rev 577) @@ -21,10 +21,10 @@ <input type="radio" name="public" value="1" /> Yes <input type="radio" name="public" value="0" /> No </td> - <td><label class="required[% IF c.dfv_msgs.err_enable_rss %] warn[% END %]">Enable RSS Feeds? *</label></td> + <td><label class="required[% IF c.dfv_msgs.err_enable_feed %] warn[% END %]">Enable XML Data Feeds (Atom)? *</label></td> <td> - <input type="radio" name="enable_rss" value="1" /> Yes - <input type="radio" name="enable_rss" value="0" /> No + <input type="radio" name="enable_feed" value="1" /> Yes + <input type="radio" name="enable_feed" value="0" /> No </td> </tr> <tr> Modified: trunk/upgrades/sql/mysql/V1_1.sql =================================================================== --- trunk/upgrades/sql/mysql/V1_1.sql 2007-06-16 16:48:44 UTC (rev 576) +++ trunk/upgrades/sql/mysql/V1_1.sql 2007-06-16 16:49:08 UTC (rev 577) @@ -1,4 +1,4 @@ ALTER TABLE smoke_report DROP COLUMN format; ALTER TABLE smoke_report DROP COLUMN html_file; ALTER TABLE smoke_report ADD COLUMN todo_pass INT UNSIGNED NOT NULL DEFAULT 0; -ALTER TABLE project ADD COLUMN enable_rss BOOL NOT NULL DEFAULT 1; +ALTER TABLE project ADD COLUMN enable_feed BOOL NOT NULL DEFAULT 1; Modified: trunk/upgrades/sql/sqlite/V1_1.sql =================================================================== --- trunk/upgrades/sql/sqlite/V1_1.sql 2007-06-16 16:48:44 UTC (rev 576) +++ trunk/upgrades/sql/sqlite/V1_1.sql 2007-06-16 16:49:08 UTC (rev 577) @@ -1,2 +1,2 @@ ALTER TABLE smoke_report ADD COLUMN todo_pass INTEGER DEFAULT 0; -ALTER TABLE project ADD COLUMN enable_rss INTEGER DEFAULT 1; +ALTER TABLE project ADD COLUMN enable_feed INTEGER DEFAULT 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |