| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package WebService::Recruit::Dokoiku::Base; | 
| 2 | 3 |  |  | 3 |  | 18 | use strict; | 
|  | 3 |  |  |  |  | 6 |  | 
|  | 3 |  |  |  |  | 105 |  | 
| 3 | 3 |  |  | 3 |  | 14 | use base qw( XML::OverHTTP ); | 
|  | 3 |  |  |  |  | 7 |  | 
|  | 3 |  |  |  |  | 4266 |  | 
| 4 | 3 |  |  | 3 |  | 132969 | use vars qw( $VERSION ); | 
|  | 3 |  |  |  |  | 6 |  | 
|  | 3 |  |  |  |  | 166 |  | 
| 5 |  |  |  |  |  |  | $VERSION = '0.10'; | 
| 6 |  |  |  |  |  |  |  | 
| 7 | 3 |  |  | 3 |  | 7126 | use Class::Accessor::Children::Fast; | 
|  | 3 |  |  |  |  | 1695 |  | 
|  | 3 |  |  |  |  | 34 |  | 
| 8 |  |  |  |  |  |  |  | 
| 9 | 3 |  |  | 3 | 1 | 1906 | sub default_param { { format => 'xml' }; } | 
| 10 | 0 |  |  | 0 | 1 |  | sub notnull_param { [qw( key )]; } | 
| 11 | 0 |  |  | 0 | 1 |  | sub attr_prefix { ''; } | 
| 12 |  |  |  |  |  |  |  | 
| 13 |  |  |  |  |  |  | sub is_error { | 
| 14 | 0 |  |  | 0 | 1 |  | my $self = shift; | 
| 15 | 0 |  |  |  |  |  | my $root = $self->root(); | 
| 16 | 0 |  |  |  |  |  | $root->status();                # 0 means ok | 
| 17 |  |  |  |  |  |  | } | 
| 18 |  |  |  |  |  |  | sub total_entries { | 
| 19 | 0 |  |  | 0 | 1 |  | my $self = shift; | 
| 20 | 0 | 0 |  |  |  |  | my $root = $self->root() or return; | 
| 21 | 0 | 0 |  |  |  |  | $root->{totalcount} || 0; | 
| 22 |  |  |  |  |  |  | } | 
| 23 |  |  |  |  |  |  | sub entries_per_page { | 
| 24 | 0 |  |  | 0 | 1 |  | my $self = shift; | 
| 25 | 0 | 0 |  |  |  |  | my $root = $self->root() or return; | 
| 26 | 0 | 0 |  |  |  |  | $root->{pagesize} || 10; | 
| 27 |  |  |  |  |  |  | } | 
| 28 |  |  |  |  |  |  | sub current_page { | 
| 29 | 0 |  |  | 0 | 1 |  | my $self = shift; | 
| 30 | 0 | 0 |  |  |  |  | my $root = $self->root() or return; | 
| 31 | 0 | 0 |  |  |  |  | $root->{pagenum} || 1; | 
| 32 |  |  |  |  |  |  | } | 
| 33 |  |  |  |  |  |  | sub page_param { | 
| 34 | 0 |  |  | 0 | 1 |  | my $self = shift; | 
| 35 | 0 |  | 0 |  |  |  | my $page = shift || $self->current_page(); | 
| 36 | 0 |  | 0 |  |  |  | my $size = shift || $self->entries_per_page(); | 
| 37 | 0 |  | 0 |  |  |  | my $hash = shift || {}; | 
| 38 | 0 | 0 |  |  |  |  | $hash->{pagenum}  = $page if defined $page; | 
| 39 | 0 | 0 |  |  |  |  | $hash->{pagesize} = $size if defined $size; | 
| 40 | 0 |  |  |  |  |  | $hash; | 
| 41 |  |  |  |  |  |  | } | 
| 42 |  |  |  |  |  |  |  | 
| 43 |  |  |  |  |  |  | =head1 NAME | 
| 44 |  |  |  |  |  |  |  | 
| 45 |  |  |  |  |  |  | WebService::Recruit::Dokoiku::Base - Base class for Dokoiku Web Service Beta | 
| 46 |  |  |  |  |  |  |  | 
| 47 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 48 |  |  |  |  |  |  |  | 
| 49 |  |  |  |  |  |  | This is a base class for the Dokoiku Web Service I. | 
| 50 |  |  |  |  |  |  | L uses this internally. | 
| 51 |  |  |  |  |  |  |  | 
| 52 |  |  |  |  |  |  | =head1 COPYRIGHT AND LICENSE | 
| 53 |  |  |  |  |  |  |  | 
| 54 |  |  |  |  |  |  | Copyright (c) 2007 Yusuke Kawasaki. All rights reserved. | 
| 55 |  |  |  |  |  |  | This program is free software; you can redistribute it and/or | 
| 56 |  |  |  |  |  |  | modify it under the same terms as Perl itself. | 
| 57 |  |  |  |  |  |  |  | 
| 58 |  |  |  |  |  |  | =cut | 
| 59 |  |  |  |  |  |  | 1; |