Changeset 71 in bookmarks for trunk/lib/Bookmarks


Ignore:
Timestamp:
02/13/14 16:10:42 (11 years ago)
Author:
peter
Message:
  • added a Bookmarks::Search class that encapsulates the query, tags, limit, and offset values for a given search
  • Bookmarks::List now has a search attribute that takes a Bookmarks::Search object instead of the individual attributes from the search
  • Bookmarks::get_cotags() takes a Bookmarks::Search object as its search parameter instead of discrete tags and query parameters
  • changed the name of the Bookmarks::get_bookmarks() parameter from tag to tags to align with the rest of the backend APIs
Location:
trunk/lib/Bookmarks
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Bookmarks/Controller.pm

    r70 r71  
    8585    my $list = $self->bookmarks->get_bookmarks({ 
    8686        query  => $query, 
    87         tag    => \@tags, 
     87        tags   => \@tags, 
    8888        limit  => $limit, 
    8989        offset => $offset, 
     
    104104 
    105105    # construct a feed from the most recent 12 bookmarks 
    106     my $list = $self->bookmarks->get_bookmarks({ query => $query, tag => \@tags, limit => 12 }); 
     106    my $list = $self->bookmarks->get_bookmarks({ query => $query, tags => \@tags, limit => 12 }); 
    107107    return $list->as_atom; 
    108108} 
  • trunk/lib/Bookmarks/List.pm

    r70 r71  
    66use HTTP::Date qw{time2iso time2isoz}; 
    77 
    8 has bookmarks => (is => 'ro'); 
    9 has query  => (is => 'ro'); 
    10 has tags   => ( 
     8has bookmarks => ( 
    119    is => 'ro', 
    12     default => sub { [] }, 
     10    isa => 'Bookmarks', 
    1311); 
    14 has limit  => (is => 'ro'); 
    15 has offset => (is => 'ro'); 
     12has search => ( 
     13    is => 'ro', 
     14    isa => 'Bookmarks::Search', 
     15    handles => [qw{query tags limit offset}], 
     16); 
    1617has results => ( is => 'ro' ); 
    1718has title => ( 
     
    182183 
    183184    my @all_tags = $self->bookmarks->get_tags({ selected => @{ $self->tags }[0] }); 
    184     my @cotags = $self->bookmarks->get_cotags({ 
    185         query  => $self->query, 
    186         tag    => $self->tags, 
    187     }); 
     185    my @cotags = $self->bookmarks->get_cotags({ search => $self->search }); 
    188186 
    189187    $template->process( 
Note: See TracChangeset for help on using the changeset viewer.