
WWW::Mixi::OO::ListPage - WWW::Mixi::OO's List Pages base class

package WWW::Mixi::OO::Foo; use base qw(WWW::Mixi::OO::ListPage); # some implementations...

list pages base class.

see super class (WWW::Mixi::OO::Page).
this module handle following params:
page number, maybe 1 origin.
see super class (WWW::Mixi::OO::Page).
this module handle following params:
page number, maybe 1 origin.
# subclass
sub parse_navi_next {
my ($this, %options) = @_;
# parse...
$this->content =~ /.../;
# return
return { a => b, c => d };
}
# call
my $next = $pkg->parse_navi_next;
page "next" navi parser. please return hashref. page didn't have next page navigation, no need to implement this.
# subclass
sub parse_navi_prev {
my ($this, %options) = @_;
# parse...
$this->content =~ /.../;
# return
return { a => b, c => d };
}
# call
my $prev = $pkg->parse_navi_prev;
page "prev" navi parser. please return hashref. page didn't have previous page navigation, no need to implement this.
# call
$pkg->fetch(
limit => $limit,
other_options...
);
fetch all items from some pages. need ->get and ->parse_navi_next()->{link}.
# call $pkg->gen_sort_proc($spec, [$pkg]);
generate sort closure(anonsub).
spec is "$field" or "!$field"(reverse order).
# call $pkg->sort($spec, @items...);
handy sort function. (but maybe need unnecessarily array copy...)
# subclass
sub sort_type {
my ($this, $field) = @_;
if (grep { $_ eq $field } qw(more nums...)) {
return 'num';
} else {
return $this->SUPER::sort_type($field);
}
}
sort type probe function.
# call $pkg->get_navi_next([opt => val], ...);
handy method. call ->set_content and ->parse_navi_next.
# call $pkg->get_navi_prev([opt => val], ...);
handy method. call ->set_content and ->parse_navi_prev.


Topia <topia@clovery.jp>

Copyright (C) 2005 by Topia.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.