Changeset 312
- Timestamp:
- 05/25/06 17:04:25 (6 years ago)
- Location:
- wiki-toolkit/trunk
- Files:
-
- 6 modified
-
lib/Wiki/Toolkit/Feed/Atom.pm (modified) (2 diffs)
-
lib/Wiki/Toolkit/Feed/RSS.pm (modified) (2 diffs)
-
t/296_feed_rss_recentchanges_add_test_data.t (modified) (1 diff)
-
t/297_feed_rss_recentchanges.t (modified) (2 diffs)
-
t/301_feed_atom_add_test_data.t (modified) (1 diff)
-
t/302_feed_atom_recentchanges.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wiki-toolkit/trunk/lib/Wiki/Toolkit/Feed/Atom.pm
r310 r312 154 154 $title =~ s/>/>/g; 155 155 156 # TODO: Store categories in the atom:category element (4.2.2) 156 # Pop the categories into atom:category elements (4.2.2) 157 # We can do this because the spec says: 158 # "This specification assigns no meaning to the content (if any) 159 # of this element." 160 # TODO: Decide if we should include the "all categories listing" url 161 # as the scheme (URI) attribute? 162 my $category_atom; 163 if($node->{metadata}->{category}) { 164 foreach my $cat (@{ $node->{metadata}->{category} }) { 165 $category_atom .= " <category term=\"$cat\" />\n"; 166 } 167 } 168 157 169 # TODO: Find an Atom equivalent of ModWiki, so we can include more info 158 170 … … 165 177 <updated>$item_timestamp</updated> 166 178 <author><name>$author</name></author> 179 $category_atom 167 180 </entry> 168 181 }; -
wiki-toolkit/trunk/lib/Wiki/Toolkit/Feed/RSS.pm
r309 r312 200 200 $title =~ s/</</g; 201 201 $title =~ s/>/>/g; 202 203 # Pop the categories into dublin core subject elements 204 # (http://dublincore.org/usage/terms/history/#subject-004) 205 # TODO: Decide if we should include the "all categories listing" url 206 # as the scheme (URI) attribute? 207 my $category_rss; 208 if($node->{metadata}->{category}) { 209 foreach my $cat (@{ $node->{metadata}->{category} }) { 210 $category_rss .= " <dc:subject>$cat</dc:subject>\n"; 211 } 212 } 202 213 203 214 push @items, qq{ … … 214 225 <modwiki:history>$history_url</modwiki:history> 215 226 <rdfs:seeAlso rdf:resource="$rdf_url" /> 227 $category_rss 216 228 </item> 217 229 }; -
wiki-toolkit/trunk/t/296_feed_rss_recentchanges_add_test_data.t
r308 r312 45 45 { username => "Kake", 46 46 comment => "new node", 47 category => [ 'TestCategory1', 'Meta' ] 47 48 } 48 49 ); -
wiki-toolkit/trunk/t/297_feed_rss_recentchanges.t
r306 r312 5 5 6 6 use Test::More tests => 7 (3 + 1 7* $Wiki::Toolkit::TestConfig::Utilities::num_stores);7 (3 + 18 * $Wiki::Toolkit::TestConfig::Utilities::num_stores); 8 8 9 9 use_ok( "Wiki::Toolkit::Feed::RSS" ); … … 69 69 like( $feed, qr|<description>.*\[nou]</description>|, 70 70 "username included in description" ); 71 72 like( $feed, qr|<dc:subject>TestCategory1</dc:subject>|, 73 "dublin core subject contains category" ); 71 74 72 75 # Check that interwiki things are passed through right. -
wiki-toolkit/trunk/t/301_feed_atom_add_test_data.t
r310 r312 45 45 { username => "Kake", 46 46 comment => "new node", 47 category => [ 'TestCategory1', 'Meta' ] 47 48 } 48 49 ); -
wiki-toolkit/trunk/t/302_feed_atom_recentchanges.t
r255 r312 5 5 6 6 use Test::More tests => 7 (3 + 1 1* $Wiki::Toolkit::TestConfig::Utilities::num_stores);7 (3 + 12 * $Wiki::Toolkit::TestConfig::Utilities::num_stores); 8 8 9 9 use_ok( "Wiki::Toolkit::Feed::Atom" ); … … 62 62 "username included in summary" ); 63 63 64 # Check we also have some categories 65 like( $feed, qr|<category term="TestCategory1" />|, 66 "contains categories" ); 67 64 68 # Test the 'items' parameter. 65 69 $feed = $atom->recent_changes( items => 2 );
