line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Biblio::ILL::ISO::LocationInfo; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Biblio::ILL::ISO::LocationInfo |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=cut |
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
24
|
use Biblio::ILL::ISO::ILLASNtype; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
107
|
|
10
|
4
|
|
|
4
|
|
23
|
use Biblio::ILL::ISO::SystemId; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
84
|
|
11
|
4
|
|
|
4
|
|
25
|
use Biblio::ILL::ISO::SystemAddress; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
119
|
|
12
|
4
|
|
|
4
|
|
23
|
use Biblio::ILL::ISO::ILLString; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
98
|
|
13
|
|
|
|
|
|
|
|
14
|
4
|
|
|
4
|
|
21
|
use Carp; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
455
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 VERSION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Version 0.01 |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=cut |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
23
|
|
|
|
|
|
|
#--------------------------------------------------------------------------- |
24
|
|
|
|
|
|
|
# Mods |
25
|
|
|
|
|
|
|
# 0.01 - 2003.07.27 - original version |
26
|
|
|
|
|
|
|
#--------------------------------------------------------------------------- |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 DESCRIPTION |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Biblio::ILL::ISO::LocationInfo is a derivation of Biblio::ILL::ISO::ILLASNtype. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 USES |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Biblio::ILL::ISO::SystemId; |
35
|
|
|
|
|
|
|
Biblio::ILL::ISO::SystemAddress; |
36
|
|
|
|
|
|
|
Biblio::ILL::ISO::ILLString; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 USED IN |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Biblio::ILL::ISO::LocationInfoSequence |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
4
|
|
|
4
|
|
2318
|
BEGIN{@ISA = qw ( Biblio::ILL::ISO::ILLASNtype );} # inherit from ILLASNtype |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 FROM THE ASN DEFINITION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Location-Info ::= EXPLICIT SEQUENCE { |
49
|
|
|
|
|
|
|
location-id [0] IMPLICIT System-Id, |
50
|
|
|
|
|
|
|
location-address [1] IMPLICIT System-Address OPTIONAL, |
51
|
|
|
|
|
|
|
location-note [2] ILL-String OPTIONAL |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 METHODS |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
#--------------------------------------------------------------- |
61
|
|
|
|
|
|
|
# |
62
|
|
|
|
|
|
|
#--------------------------------------------------------------- |
63
|
|
|
|
|
|
|
=head1 |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 new( $loc_id [,$loc_addr] [,$note] ) |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Creates a new LocationInfo object. |
68
|
|
|
|
|
|
|
Expects a location-id (Biblio::ILL::ISO::SystemId), |
69
|
|
|
|
|
|
|
(optionally) a location-address (Biblio::ILL::ISO::SystemAddress), and |
70
|
|
|
|
|
|
|
(optionally) a location-note (Biblio::ILL::ISO::ILLString). |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |
73
|
|
|
|
|
|
|
sub new { |
74
|
4
|
|
|
4
|
1
|
7
|
my $class = shift; |
75
|
4
|
|
|
|
|
6
|
my $self = {}; |
76
|
|
|
|
|
|
|
|
77
|
4
|
50
|
|
|
|
10
|
if (@_) { |
78
|
4
|
|
|
|
|
6
|
my ($locid, $locaddr, $locnote) = @_; |
79
|
|
|
|
|
|
|
|
80
|
4
|
50
|
|
|
|
12
|
croak "invalid location-id" unless (ref($locid) eq "Biblio::ILL::ISO::SystemId"); |
81
|
4
|
50
|
|
|
|
7
|
if ($locaddr) { |
82
|
4
|
50
|
|
|
|
19
|
croak "invalid location-address" unless (ref($locaddr) eq "Biblio::ILL::ISO::SystemAddress"); |
83
|
|
|
|
|
|
|
} |
84
|
4
|
100
|
|
|
|
14
|
if ($locnote) { |
85
|
2
|
50
|
|
|
|
7
|
croak "invalid location-note" unless (ref($locnote) eq "Biblio::ILL::ISO::ILLString"); |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
4
|
|
|
|
|
10
|
$self->{"location-id"} = $locid; |
89
|
4
|
50
|
|
|
|
11
|
$self->{"location-address"} = $locaddr if ($locaddr); |
90
|
4
|
100
|
|
|
|
10
|
$self->{"location-note"} = $locnote if ($locnote); |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
4
|
|
33
|
|
|
30
|
bless($self, ref($class) || $class); |
94
|
4
|
|
|
|
|
12
|
return ($self); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
#--------------------------------------------------------------- |
99
|
|
|
|
|
|
|
# |
100
|
|
|
|
|
|
|
#--------------------------------------------------------------- |
101
|
|
|
|
|
|
|
=head1 |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head2 set( $loc_id [,$loc_addr] [,$note] ) |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Sets the object's location-id, location-address, and note. |
106
|
|
|
|
|
|
|
Expects a location-id (Biblio::ILL::ISO::SystemId), |
107
|
|
|
|
|
|
|
(optionally) a location-address (Biblio::ILL::ISO::SystemAddress), and |
108
|
|
|
|
|
|
|
(optionally) a location-note (Biblio::ILL::ISO::ILLString). |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=cut |
111
|
|
|
|
|
|
|
sub set { |
112
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
113
|
|
|
|
|
|
|
|
114
|
0
|
|
|
|
|
|
my ($locid, $locaddr, $locnote) = @_; |
115
|
|
|
|
|
|
|
|
116
|
0
|
0
|
|
|
|
|
croak "invalid location-id" unless (ref($locid) eq "Biblio::ILL::ISO::SystemId"); |
117
|
0
|
0
|
|
|
|
|
if ($locaddr) { |
118
|
0
|
0
|
|
|
|
|
croak "invalid location-address" unless (ref($locaddr) eq "Biblio::ILL::ISO::SystemAddress"); |
119
|
|
|
|
|
|
|
} |
120
|
0
|
0
|
|
|
|
|
if ($locnote) { |
121
|
0
|
0
|
|
|
|
|
croak "invalid location-note" unless (ref($locnote) eq "Biblio::ILL::ISO::ILLString"); |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
0
|
|
|
|
|
|
$self->{"location-id"} = $locid; |
125
|
0
|
0
|
|
|
|
|
$self->{"location-address"} = $locaddr if ($locaddr); |
126
|
0
|
0
|
|
|
|
|
$self->{"location-note"} = $locnote if ($locnote); |
127
|
|
|
|
|
|
|
|
128
|
0
|
|
|
|
|
|
return; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
#--------------------------------------------------------------- |
133
|
|
|
|
|
|
|
# |
134
|
|
|
|
|
|
|
#--------------------------------------------------------------- |
135
|
|
|
|
|
|
|
=head1 |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head2 from_asn($href) |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
Given a properly formatted hash, builds the object. |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=cut |
142
|
|
|
|
|
|
|
sub from_asn { |
143
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
144
|
0
|
|
|
|
|
|
my $href = shift; |
145
|
|
|
|
|
|
|
|
146
|
0
|
|
|
|
|
|
foreach my $k (keys %$href) { |
147
|
|
|
|
|
|
|
#print ref($self) . "...$k\n"; |
148
|
|
|
|
|
|
|
|
149
|
0
|
0
|
|
|
|
|
if ($k =~ /^location-id$/) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
150
|
0
|
|
|
|
|
|
$self->{$k} = new Biblio::ILL::ISO::SystemId(); |
151
|
0
|
|
|
|
|
|
$self->{$k}->from_asn($href->{$k}); |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
} elsif ($k =~ /^location-address$/) { |
154
|
0
|
|
|
|
|
|
$self->{$k} = new Biblio::ILL::ISO::SystemAddress(); |
155
|
0
|
|
|
|
|
|
$self->{$k}->from_asn($href->{$k}); |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
} elsif ($k =~ /^location-note$/) { |
158
|
0
|
|
|
|
|
|
$self->{$k} = new Biblio::ILL::ISO::ILLString(); |
159
|
0
|
|
|
|
|
|
$self->{$k}->from_asn($href->{$k}); |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
} else { |
162
|
0
|
|
|
|
|
|
croak "invalid " . ref($self) . " element: [$k]"; |
163
|
|
|
|
|
|
|
} |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
} |
166
|
0
|
|
|
|
|
|
return $self; |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=head1 SEE ALSO |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
See the README for system design notes. |
172
|
|
|
|
|
|
|
See the parent class(es) for other available methods. |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
For more information on Interlibrary Loan standards (ISO 10160/10161), |
175
|
|
|
|
|
|
|
a good place to start is: |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
http://www.nlc-bnc.ca/iso/ill/main.htm |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=cut |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=head1 AUTHOR |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
David Christensen, |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=cut |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
Copyright 2003 by David Christensen |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it |
193
|
|
|
|
|
|
|
under the same terms as Perl itself. |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=cut |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
1; |