line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::ILS::RecordedBooks::PartnerPatron; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
945
|
use Modern::Perl; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=encoding utf-8 |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
WebService::ILS::RecordedBooks::PartnerPatron - RecordedBooks patner API |
10
|
|
|
|
|
|
|
for an individual patron |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use WebService::ILS::RecordedBooks::PartnerPatron; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 DESCRIPTION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
L - services |
19
|
|
|
|
|
|
|
that use trusted partner credentials to operat on behalf of a specified patron |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
See L |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
1
|
|
128
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
52
|
|
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
1
|
|
5
|
use parent qw(WebService::ILS::RecordedBooks::PartnerBase); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head2 new (%params_hash or $params_hashref) |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head3 Additional constructor params: |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=over 12 |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=item C => RecordedBooks user id (barcode), or email |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=back |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
C is either RecordedBooks id (barcode) or email |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
|
45
|
1
|
|
|
|
|
4
|
use Class::Tiny qw( |
46
|
|
|
|
|
|
|
user_id |
47
|
1
|
|
|
1
|
|
59
|
); |
|
1
|
|
|
|
|
2
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__PACKAGE__->_set_param_spec({ |
50
|
|
|
|
|
|
|
user_id => { required => 1 }, |
51
|
|
|
|
|
|
|
}); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub BUILD { |
54
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
55
|
0
|
|
|
|
|
|
my $params = shift; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
local $@; |
58
|
0
|
0
|
|
|
|
|
my $patron_id = eval { $self->SUPER::patron_id($self->user_id) } |
|
0
|
0
|
|
|
|
|
|
59
|
|
|
|
|
|
|
or croak "Invalid user_id ".$self->user_id.($@ ? "\n$@" : ""); |
60
|
0
|
|
|
|
|
|
$self->user_id($patron_id); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub circulation_action_base_url { |
64
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
return $self->library_action_base_url."/patrons/".$self->user_id; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub patron_id { |
70
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
71
|
0
|
|
|
|
|
|
return $self->user_id; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub patron { |
75
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
76
|
0
|
|
|
|
|
|
return {id => $self->user_id}; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 NATIVE METHODS |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 native_patron () |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
This method cannot be called |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=cut |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
1; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
__END__ |