Show
Ignore:
Timestamp:
05/25/06 17:53:56 (6 years ago)
Author:
nick
Message:

Refactoring - shift fetch methods into Listing.pm, to avoid yet more duplication

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • wiki-toolkit/trunk/lib/Wiki/Toolkit/Feed/Atom.pm

    r314 r315  
    4949  $self; 
    5050} 
    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 an 
    58 array of the feed, and the feed timestamp. Otherwise it just returns the feed. 
    59  
    60 =cut 
    61 sub recent_changes 
    62 { 
    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 an 
    85 array of the feed, and the feed timestamp. Otherwise it just returns the feed. 
    86  
    87 =cut 
    88 sub node_all_versions 
    89 { 
    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  
    10451 
    10552=item <generate_node_list_feed>