Author: earle Date: 2005-11-29 06:22:42 +0000 (Tue, 29 Nov 2005) New Revision: 718
Modified: trunk/Build.PL trunk/Changes trunk/PREREQUISITES trunk/lib/OpenGuides.pm trunk/lib/OpenGuides/RDF.pm trunk/lib/OpenGuides/Template.pm trunk/t/53_show_index.t trunk/wiki.cgi Log: fixes #28
Modified: trunk/Build.PL =================================================================== --- trunk/Build.PL 2005-11-24 20:12:31 UTC (rev 717) +++ trunk/Build.PL 2005-11-29 06:22:42 UTC (rev 718) @@ -222,7 +222,7 @@ 'CGI::Wiki::Plugin::Categoriser' => 0, 'CGI::Wiki::Plugin::Diff' => '0.07', # earlier buggy 'CGI::Wiki::Plugin::Locator::Grid'=> '0.02', # cope with sqlite 3 - 'CGI::Wiki::Plugin::RSS::ModWiki' => '0.081', # supports DOAP metadata + 'CGI::Wiki::Plugin::RSS::ModWiki' => '0.09', # fixes date formatting bug 'CGI::Wiki::Plugin::RSS::Reader' => '1.3', # earlier versions don't support RSS 2.0 'Class::Accessor' => 0, 'Config::Tiny' => 0, @@ -234,6 +234,7 @@ 'LWP::Simple' => 0, 'Parse::RecDescent' => 0, $search_module => 0, + 'POSIX' => 0, 'Template' => 0, 'Test::MockObject' => '0.07', # earlier doesn't use 'mock' 'Time::Piece' => 0,
Modified: trunk/Changes =================================================================== --- trunk/Changes 2005-11-24 20:12:31 UTC (rev 717) +++ trunk/Changes 2005-11-29 06:22:42 UTC (rev 718) @@ -3,6 +3,7 @@ have customisations to your templates, you may need to make changes to reflect this. Rename OpenGuides::SuperSearch to OpenGuides::Search. + Use corrent content-type (application/rdf+xml) for all RDF output. Fix missing bracket in node.tt. Add custom_node template just below main content in node.tt.
Modified: trunk/PREREQUISITES =================================================================== --- trunk/PREREQUISITES 2005-11-24 20:12:31 UTC (rev 717) +++ trunk/PREREQUISITES 2005-11-29 06:22:42 UTC (rev 718) @@ -10,7 +10,7 @@ CGI::Wiki::Plugin::Categoriser CGI::Wiki::Plugin::Diff (version 0.07 or later) CGI::Wiki::Plugin::Locator::Grid (version 0.02 or later) -CGI::Wiki::Plugin::RSS::ModWiki (version 0.081 or later) +CGI::Wiki::Plugin::RSS::ModWiki (version 0.09 or later) CGI::Wiki::Plugin::RSS::Reader (version 1.3 or later) Class::Accessor Config::Tiny @@ -39,6 +39,7 @@ -- or -- Search::InvertedIndex ) +POSIX Template Test::MockObject (version 0.07 or later) Time::Piece
Modified: trunk/lib/OpenGuides/RDF.pm =================================================================== --- trunk/lib/OpenGuides/RDF.pm 2005-11-24 20:12:31 UTC (rev 717) +++ trunk/lib/OpenGuides/RDF.pm 2005-11-29 06:22:42 UTC (rev 718) @@ -256,11 +256,11 @@ config => $config );
# RDF version of a node. - print "Content-Type: text/plain\n\n"; + print "Content-Type: application/rdf+xml\n\n"; print $rdf_writer->emit_rdfxml( node => "Masala Zone, N1 0NU" );
# Ten most recent changes. - print "Content-Type: text/plain\n"; + print "Content-Type: application/rdf+xml\n"; print "Last-Modified: " . $self->rss_timestamp( items => 10 ) . "\n\n"; print $rdf_writer->make_recentchanges_rss( items => 10 );
@@ -287,7 +287,7 @@ locale => "Islington" } );
- print "Content-Type: text/plain\n\n"; + print "Content-Type: application/rdf+xml\n\n"; print $rdf_writer->emit_rdfxml( node => "Masala Zone, N1 0NU" );
BNote: Some of the fields emitted by the RDF/XML generator are taken @@ -323,7 +323,7 @@ =item B<make_recentchanges_rss>
# Ten most recent changes. - print "Content-Type: text/plain\n"; + print "Content-Type: application/rdf+xml\n"; print "Last-Modified: " . $rdf_writer->rss_timestamp( items => 10 ) . "\n\n"; print $rdf_writer->make_recentchanges_rss( items => 10 );
@@ -335,7 +335,7 @@ filter_on_metadata => { username => "bob" }, );
- print "Content-Type: text/plain\n"; + print "Content-Type: application/rdf+xml\n"; print "Last-Modified: " . $rdf_writer->rss_timestamp( %args ) . "\n\n"; print $rdf_writer->make_recentchanges_rss( %args );
Modified: trunk/lib/OpenGuides/Template.pm =================================================================== --- trunk/lib/OpenGuides/Template.pm 2005-11-24 20:12:31 UTC (rev 717) +++ trunk/lib/OpenGuides/Template.pm 2005-11-29 06:22:42 UTC (rev 718) @@ -166,7 +166,13 @@
my $header = ""; unless ( defined $args{content_type} and $args{content_type} eq "" ) { - $header = CGI::header( -cookie => $args{cookies} ); + my $content_type; + if ($args{content_type}) { + $content_type = $args{content_type}; + } else { + $content_type = "text/html"; + } + $header = CGI::header( -type => $content_type, -cookie => $args{cookies} ); }
# vile hack
Modified: trunk/lib/OpenGuides.pm =================================================================== --- trunk/lib/OpenGuides.pm 2005-11-24 20:12:31 UTC (rev 717) +++ trunk/lib/OpenGuides.pm 2005-11-29 06:22:42 UTC (rev 718) @@ -13,7 +13,7 @@
use vars qw( $VERSION );
-$VERSION = '0.51'; +$VERSION = '0.52';
=head1 NAME
@@ -537,7 +537,7 @@ if ( $args{format} ) { if ( $args{format} eq "rdf" ) { $template = "rdf_index.tt"; - $conf{content_type} = "text/plain"; + $conf{content_type} = "application/rdf+xml"; } elsif ( $args{format} eq "plain" ) { $template = "plain_index.tt"; @@ -665,7 +665,7 @@ config => $self->config, og_version => $VERSION, ); - my $output = "Content-Type: text/plain\n"; + my $output = "Content-Type: application/rdf+xml\n"; $output .= "Last-Modified: " . $rdf_writer->rss_timestamp( %criteria ) . "\n\n"; $output .= $rdf_writer->make_recentchanges_rss( %criteria ); return $output if $return_output; @@ -894,12 +894,9 @@ cookies => $args{cookies}, ); if ( $args{content_type} ) { - $output_conf{content_type} = ""; - my $output = "Content-Type: $args{content_type}\n\n" - . OpenGuides::Template->output( %output_conf ); - } else { - return OpenGuides::Template->output( %output_conf ); + $output_conf{content_type} = $args{content_type}; } + return OpenGuides::Template->output( %output_conf ); }
sub redirect_to_node {
Modified: trunk/t/53_show_index.t =================================================================== --- trunk/t/53_show_index.t 2005-11-24 20:12:31 UTC (rev 717) +++ trunk/t/53_show_index.t 2005-11-29 06:22:42 UTC (rev 718) @@ -50,6 +50,6 @@ return_output => 1, format => "rdf" ); - like( $output, qr|Content-Type: text/plain|, - "RDF output gets content-type of text/plain" ); + like( $output, qr|Content-Type: application/rdf+xml|, + "RDF output gets content-type of application/rdf+xml" ); }
Modified: trunk/wiki.cgi =================================================================== --- trunk/wiki.cgi 2005-11-24 20:12:31 UTC (rev 717) +++ trunk/wiki.cgi 2005-11-29 06:22:42 UTC (rev 718) @@ -276,7 +276,7 @@ my %args = @_; my $rdf_writer = OpenGuides::RDF->new( wiki => $wiki, config => $config ); - print "Content-type: text/plain\n\n"; + print "Content-type: application/rdf+xml\n\n"; print $rdf_writer->emit_rdfxml( node => $args{node} ); exit 0; }
openguides-commits@lists.openguides.org