line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::Recruit::Jalan::Base; |
2
|
3
|
|
|
3
|
|
19
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
103
|
|
3
|
3
|
|
|
3
|
|
14
|
use base qw( XML::OverHTTP ); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
2693
|
|
4
|
3
|
|
|
3
|
|
106473
|
use vars qw( $VERSION ); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
145
|
|
5
|
|
|
|
|
|
|
$VERSION = '0.10'; |
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
3512
|
use Class::Accessor::Children::Fast; |
|
3
|
|
|
|
|
1682
|
|
|
3
|
|
|
|
|
34
|
|
8
|
|
|
|
|
|
|
|
9
|
0
|
|
|
0
|
1
|
|
sub attr_prefix { ''; } |
10
|
0
|
|
|
0
|
1
|
|
sub text_node_key { '_text'; } |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub is_error { |
13
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
14
|
0
|
|
|
|
|
|
my $tree = $self->tree(); |
15
|
0
|
|
|
|
|
|
my $mess; |
16
|
0
|
0
|
|
|
|
|
if ( ref $tree ) { |
17
|
0
|
0
|
|
|
|
|
my $error = $tree->{Error} or return; |
18
|
0
|
0
|
|
|
|
|
$mess = $error->{Message} or return; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
else { |
21
|
0
|
0
|
|
|
|
|
my $xml = $self->xml() or return; |
22
|
0
|
0
|
|
|
|
|
return unless ( $xml =~ m{\s*$} ); |
23
|
0
|
|
|
|
|
|
$mess = ( $xml =~ m{([^<>]*?)}s )[0]; |
24
|
|
|
|
|
|
|
} |
25
|
0
|
|
|
|
|
|
$mess; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
sub total_entries { |
28
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
29
|
0
|
0
|
|
|
|
|
my $root = $self->root() or return; |
30
|
0
|
0
|
|
|
|
|
$root->{NumberOfResults} || 0; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
sub entries_per_page { |
33
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
34
|
0
|
0
|
|
|
|
|
my $root = $self->root() or return; |
35
|
0
|
0
|
|
|
|
|
$root->{DisplayPerPage} || 0; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
sub current_page { |
38
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
39
|
0
|
0
|
|
|
|
|
my $root = $self->root() or return; |
40
|
0
|
0
|
|
|
|
|
my $epp = $self->entries_per_page() or return; |
41
|
0
|
0
|
|
|
|
|
int(($root->{DisplayFrom}-1) / $epp)+1 || 1; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
sub page_param { |
44
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
45
|
0
|
|
0
|
|
|
|
my $page = shift || $self->current_page(); |
46
|
0
|
|
0
|
|
|
|
my $size = shift || $self->entries_per_page(); |
47
|
0
|
|
0
|
|
|
|
my $hash = shift || {}; |
48
|
0
|
|
|
|
|
|
$hash->{start} = ($page-1) * $size + 1; |
49
|
0
|
|
|
|
|
|
$hash->{count} = $size; |
50
|
0
|
|
|
|
|
|
$hash; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 NAME |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
WebService::Recruit::Jalan::Base - Base class for Jalan Web Service |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 DESCRIPTION |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
This is a base class for the Jalan Web Service. |
60
|
|
|
|
|
|
|
L uses this internally. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Copyright (c) 2007 Yusuke Kawasaki. All rights reserved. |
65
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or |
66
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |
69
|
|
|
|
|
|
|
1; |