Changeset 315
- Timestamp:
- 05/25/06 17:53:56 (6 years ago)
- Location:
- wiki-toolkit/trunk/lib/Wiki/Toolkit/Feed
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
wiki-toolkit/trunk/lib/Wiki/Toolkit/Feed/Atom.pm
r314 r315 49 49 $self; 50 50 } 51 52 =item B<recent_changes>53 54 Build an Atom Feed of the recent changes to the Wiki::Toolkit instance,55 using any supplied parameters to narrow the results.56 57 If the argument "also_return_timestamp" is supplied, it will return an58 array of the feed, and the feed timestamp. Otherwise it just returns the feed.59 60 =cut61 sub recent_changes62 {63 my ($self, %args) = @_;64 65 my @changes = $self->fetch_recently_changed_nodes(%args);66 my $atom_timestamp = $self->feed_timestamp(67 $self->fetch_newest_for_recently_changed(%args)68 );69 70 my $feed = $self->generate_node_list_feed($atom_timestamp, @changes);71 72 if($args{'also_return_timestamp'}) {73 return ($feed,$feed_timestamp);74 } else {75 return $feed;76 }77 }78 79 80 =item B<node_all_versions>81 82 Build an Atom Feed of all the different versions of a given node.83 84 If the argument "also_return_timestamp" is supplied, it will return an85 array of the feed, and the feed timestamp. Otherwise it just returns the feed.86 87 =cut88 sub node_all_versions89 {90 my ($self, %args) = @_;91 92 my @all_versions = $self->fetch_node_all_versions(%args);93 my $feed_timestamp = $self->feed_timestamp( $all_versions[0] );94 95 my $feed = $self->generate_node_list_feed($feed_timestamp, @all_versions);96 97 if($args{'also_return_timestamp'}) {98 return ($feed,$feed_timestamp);99 } else {100 return $feed;101 }102 }103 104 51 105 52 =item <generate_node_list_feed> -
wiki-toolkit/trunk/lib/Wiki/Toolkit/Feed/Listing.pm
r308 r315 101 101 102 102 103 =item B<recent_changes> 104 105 Build an Atom Feed of the recent changes to the Wiki::Toolkit instance, 106 using any supplied parameters to narrow the results. 107 108 If the argument "also_return_timestamp" is supplied, it will return an 109 array of the feed, and the feed timestamp. Otherwise it just returns the feed. 110 111 =cut 112 sub recent_changes 113 { 114 my ($self, %args) = @_; 115 116 my @changes = $self->fetch_recently_changed_nodes(%args); 117 my $feed_timestamp = $self->feed_timestamp( 118 $self->fetch_newest_for_recently_changed(%args) 119 ); 120 121 my $feed = $self->generate_node_list_feed($feed_timestamp, @changes); 122 123 if($args{'also_return_timestamp'}) { 124 return ($feed,$feed_timestamp); 125 } else { 126 return $feed; 127 } 128 } 129 130 131 =item B<node_all_versions> 132 133 Build an Atom Feed of all the different versions of a given node. 134 135 If the argument "also_return_timestamp" is supplied, it will return an 136 array of the feed, and the feed timestamp. Otherwise it just returns the feed. 137 138 =cut 139 sub node_all_versions 140 { 141 my ($self, %args) = @_; 142 143 my @all_versions = $self->fetch_node_all_versions(%args); 144 my $feed_timestamp = $self->feed_timestamp( $all_versions[0] ); 145 146 my $feed = $self->generate_node_list_feed($feed_timestamp, @all_versions); 147 148 if($args{'also_return_timestamp'}) { 149 return ($feed,$feed_timestamp); 150 } else { 151 return $feed; 152 } 153 } 154 155 156 103 157 # The following are methods that any feed renderer must provide 104 158 105 =item B<recent_changes>106 All implementing feed renderers must implement a method to fetch a list107 of recent changes, and render them108 =cut109 sub recent_changes { die("Not implemented by feed renderer!"); }110 =item B<node_all_versions>111 All implementing feed renderers must implement a method to fetch a list112 of the different versions of a node, and render them113 =cut114 sub node_all_versions { die("Not implemented by feed renderer!"); }115 159 =item B<feed_timestamp> 116 160 All implementing feed renderers must implement a method to produce a 117 161 feed specific timestamp, based on the supplied node 118 162 =cut 119 sub feed_timestamp { die("Not implemented by feed renderer!"); } 163 sub feed_timestamp { die("Not implemented by feed renderer!"); } 164 =item B<generate_node_list_feed> 165 All implementing feed renderers must implement a method to produce a 166 feed from the supplied list of nodes 167 =cut 168 sub generate_node_list_feed { die("Not implemented by feed renderer!"); } 120 169 121 170 1; -
wiki-toolkit/trunk/lib/Wiki/Toolkit/Feed/RSS.pm
r314 r315 49 49 50 50 $self; 51 }52 53 =item B<recent_changes>54 55 Build an RSS Feed of the recent changes to the Wiki::Toolkit instance,56 using any supplied parameters to narrow the results.57 58 If the argument "also_return_timestamp" is supplied, it will return an59 array of the feed, and the feed timestamp. Otherwise it just returns the feed.60 61 =cut62 sub recent_changes63 {64 my ($self, %args) = @_;65 66 my @changes = $self->fetch_recently_changed_nodes(%args);67 my $feed_timestamp = $self->feed_timestamp(68 $self->fetch_newest_for_recently_changed(%args)69 );70 71 my $feed = $self->generate_node_list_feed($feed_timestamp, @changes);72 73 if($args{'also_return_timestamp'}) {74 return ($feed,$feed_timestamp);75 } else {76 return $feed;77 }78 }79 80 81 =item B<node_all_versions>82 83 Build an RSS Feed of all the different versions of a given node.84 85 If the argument "also_return_timestamp" is supplied, it will return an86 array of the feed, and the feed timestamp. Otherwise it just returns the feed.87 88 =cut89 sub node_all_versions90 {91 my ($self, %args) = @_;92 93 my @all_versions = $self->fetch_node_all_versions(%args);94 my $feed_timestamp = $self->feed_timestamp( $all_versions[0] );95 96 my $feed = $self->generate_node_list_feed($feed_timestamp, @all_versions);97 98 if($args{'also_return_timestamp'}) {99 return ($feed,$feed_timestamp);100 } else {101 return $feed;102 }103 51 } 104 52
