| 1 | package Biblio::ILL::ISO::Renew; | ||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||
| 3 | =head1 NAME | ||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||
| 5 | Biblio::ILL::ISO::Renew - Perl extension for handling ISO 10161 interlibrary loan Renew messages | ||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||
| 7 | =cut | ||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use Biblio::ILL::ISO::ISO; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 10 | 2 | ▶ | use Carp; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||
| 12 | =head1 VERSION | ||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||
| 14 | Version 0.01 | ||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||
| 16 | =cut | ||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||
| 18 | 2 | our $VERSION = '0.01'; | |||||||||||||||||||||||||||||
| 19 | #--------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 20 | # Mods | ||||||||||||||||||||||||||||||
| 21 | # 0.01 - 2003.01.11 - original version | ||||||||||||||||||||||||||||||
| 22 | #--------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||
| 24 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||
| 26 | Biblio::ILL::ISO::Request is a derivation of the abstract | ||||||||||||||||||||||||||||||
| 27 | Biblio::ILL::ISO::ISO object, and handles the ILL-Request message type. | ||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||
| 29 | =head1 EXPORT | ||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||
| 31 | None. | ||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||
| 33 | =head1 ERROR HANDLING | ||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||
| 35 | Each of the set_() methods will croak on missing or invalid parameters. | ||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||
| 37 | =cut | ||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||
| 39 | 2 | ▶ | BEGIN{@ISA = qw ( Biblio::ILL::ISO::ISO ); } | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||
| 41 | =head1 FROM THE ASN DEFINITION | ||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||
| 43 | Renew ::= [APPLICATION 13] SEQUENCE { | ||||||||||||||||||||||||||||||
| 44 | protocol-version-num [0] IMPLICIT INTEGER, -- { | ||||||||||||||||||||||||||||||
| 45 | -- version-1 (1), | ||||||||||||||||||||||||||||||
| 46 | -- version-2 (2) | ||||||||||||||||||||||||||||||
| 47 | -- }, | ||||||||||||||||||||||||||||||
| 48 | transaction-id [1] IMPLICIT Transaction-Id, | ||||||||||||||||||||||||||||||
| 49 | service-date-time [2] IMPLICIT Service-Date-Time, | ||||||||||||||||||||||||||||||
| 50 | requester-id [3] IMPLICIT System-Id OPTIONAL, | ||||||||||||||||||||||||||||||
| 51 | -- mandatory when using store-and-forward communications | ||||||||||||||||||||||||||||||
| 52 | -- optional when using connection-oriented communications | ||||||||||||||||||||||||||||||
| 53 | responder-id [4] IMPLICIT System-Id OPTIONAL, | ||||||||||||||||||||||||||||||
| 54 | -- mandatory when using store-and-forward communications | ||||||||||||||||||||||||||||||
| 55 | -- optional when using connection-oriented communications | ||||||||||||||||||||||||||||||
| 56 | desired-due-date [42] IMPLICIT ISO-Date OPTIONAL, | ||||||||||||||||||||||||||||||
| 57 | requester-note [46] ILL-String OPTIONAL, | ||||||||||||||||||||||||||||||
| 58 | renew-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL | ||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||
| 61 | =cut | ||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||
| 63 | =head1 CONSTRUCTORS | ||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||
| 65 | new() | ||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||
| 67 | Base constructor for the class. It just returns a completely | ||||||||||||||||||||||||||||||
| 68 | empty message object, which you'll need to populate with the | ||||||||||||||||||||||||||||||
| 69 | various set_() methods, or use the read() method to read a | ||||||||||||||||||||||||||||||
| 70 | Renew message from a file (followed by a call to | ||||||||||||||||||||||||||||||
| 71 | from_asn() to turn the read's returned hash into a proper | ||||||||||||||||||||||||||||||
| 72 | Renew message. | ||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||
| 74 | The constructor also initializes the Convert::ASN1 if it | ||||||||||||||||||||||||||||||
| 75 | hasn't been initialized. | ||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||
| 77 | =cut | ||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||
| 79 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 80 | # | ||||||||||||||||||||||||||||||
| 81 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 82 | 2 | ▶ | sub new { | ||||||||||||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.6
Pod
documented
| |||||||||||||||||||||||||||||||
| 83 | 2 | my $class = shift; | |||||||||||||||||||||||||||||
| 84 | 2 | my $self = {}; | |||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||
| 86 | 2 | ▶ | Biblio::ILL::ISO::ISO::_init() if (not $Biblio::ILL::ISO::ISO::_asn_initialized); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 87 | 2 | $self->{"ASN_TYPE"} = "Renew"; | |||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||
| 89 | 2 | ▶ | bless($self, ref($class) || $class); | ||||||||||||||||||||||||||||
|
Condition33%1/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table33%1/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||||||||||||
| 90 | 2 | return ($self); | |||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||
| 94 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 95 | # | ||||||||||||||||||||||||||||||
| 96 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 97 | 0 | ▶ | sub as_pretty_string { | ||||||||||||||||||||||||||||
|
Subroutine
as_pretty_string: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||
| 98 | 0 | my $self = shift; | |||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||
| 100 | 0 | foreach my $key (sort keys %$self) { | |||||||||||||||||||||||||||||
| 101 | 0 | ▶ | if ($key ne "ASN_TYPE") { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 102 | 0 | print "\n[$key]\n"; | |||||||||||||||||||||||||||||
| 103 | 0 | print $self->{$key}->as_pretty_string(); | |||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||||
| 106 | 0 | return; | |||||||||||||||||||||||||||||
| 107 | } | ||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||
| 109 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 110 | # This will return a structure usable by Convert::ASN1 | ||||||||||||||||||||||||||||||
| 111 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 112 | 1 | ▶ | sub as_asn { | ||||||||||||||||||||||||||||
|
Subroutine
as_asn: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 113 | 1 | my $self = shift; | |||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||
| 115 | 1 | my %h = (); | |||||||||||||||||||||||||||||
| 116 | 1 | foreach my $key (sort keys %$self) { | |||||||||||||||||||||||||||||
| 117 | 7 | ▶ | if ($key ne "ASN_TYPE") { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 118 | #print "\n[$key]\n"; | ||||||||||||||||||||||||||||||
| 119 | 6 | $h{$key} = $self->{$key}->as_asn(); | |||||||||||||||||||||||||||||
| 120 | } | ||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||
| 122 | 1 | return \%h; | |||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||
| 125 | =head1 METHODS | ||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||
| 127 | For any example code, assume the following: | ||||||||||||||||||||||||||||||
| 128 | my $msg = new Biblio::ILL::ISO::Renew; | ||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||
| 130 | =cut | ||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||
| 132 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 133 | # | ||||||||||||||||||||||||||||||
| 134 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 135 | =head1 | ||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||
| 137 | =head2 from_asn($href) | ||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||
| 139 | To read a message from a file, use the following: | ||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||
| 141 | my $href = $msg->read("msg_13.renew.ber"); | ||||||||||||||||||||||||||||||
| 142 | $msg = $msg->from_asn($href); | ||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||
| 144 | The from_asn() method turns the hash returned from read() into | ||||||||||||||||||||||||||||||
| 145 | a proper message-type object. | ||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||
| 147 | =cut | ||||||||||||||||||||||||||||||
| 148 | 0 | ▶ | sub from_asn { | ||||||||||||||||||||||||||||
|
Subroutine
from_asn: not called CC=9 SCAR=45.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 149 | 0 | my $self = shift; | |||||||||||||||||||||||||||||
| 150 | 0 | my $href = shift; | |||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||
| 152 | 0 | foreach my $k (keys %$href) { | |||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||
| 154 | 0 | ▶ | if ($k =~ /^protocol-version-num$/) { | ||||||||||||||||||||||||||||
|
Branch: 6 branches
| |||||||||||||||||||||||||||||||
| 155 | 0 | $self->{$k} = new Biblio::ILL::ISO::ProtocolVersionNum(); | |||||||||||||||||||||||||||||
| 156 | 0 | $self->{$k}->from_asn($href->{$k}); | |||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||
| 158 | } elsif ($k =~ /^transaction-id$/) { | ||||||||||||||||||||||||||||||
| 159 | 0 | $self->{$k} = new Biblio::ILL::ISO::TransactionId(); | |||||||||||||||||||||||||||||
| 160 | 0 | $self->{$k}->from_asn($href->{$k}); | |||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||
| 162 | } elsif ($k =~ /^service-date-time$/) { | ||||||||||||||||||||||||||||||
| 163 | 0 | $self->{$k} = new Biblio::ILL::ISO::ServiceDateTime(); | |||||||||||||||||||||||||||||
| 164 | 0 | $self->{$k}->from_asn($href->{$k}); | |||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||
| 166 | ▶ | } elsif (($k =~ /^requester-id$/) | |||||||||||||||||||||||||||||
|
Condition0%0/3
$k =~ /^requester-id$/ or $k =~ /^responder-id$/
MC/DC0%0/2
$k =~ /^requester-id$/ or $k =~ /^responder-id$/
$k =~ /^requester-id$/
$k =~ /^responder-id$/
Truth table0%0/3
A or B
A= $k =~ /^requester-id$/B= $k =~ /^responder-id$/
| |||||||||||||||||||||||||||||||
| 167 | || ($k =~ /^responder-id$/) | ||||||||||||||||||||||||||||||
| 168 | ) { | ||||||||||||||||||||||||||||||
| 169 | 0 | $self->{$k} = new Biblio::ILL::ISO::SystemId(); | |||||||||||||||||||||||||||||
| 170 | 0 | $self->{$k}->from_asn($href->{$k}); | |||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||
| 172 | } elsif ($k =~ /^desired-due-date$/) { | ||||||||||||||||||||||||||||||
| 173 | 0 | $self->{$k} = new Biblio::ILL::ISO::ISODate(); | |||||||||||||||||||||||||||||
| 174 | 0 | $self->{$k}->from_asn($href->{$k}); | |||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||
| 176 | } elsif ($k =~ /^requester-note$/) { | ||||||||||||||||||||||||||||||
| 177 | 0 | $self->{$k} = new Biblio::ILL::ISO::ILLString(); | |||||||||||||||||||||||||||||
| 178 | 0 | $self->{$k}->from_asn($href->{$k}); | |||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||
| 180 | } else { | ||||||||||||||||||||||||||||||
| 181 | 0 | croak "invalid " . ref($self) . " element: [$k]"; | |||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||
| 185 | 0 | return $self; | |||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||
| 188 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 189 | # | ||||||||||||||||||||||||||||||
| 190 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 191 | =head1 | ||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||
| 193 | =head2 set_protocol_version_num($pvn) | ||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||
| 195 | Sets the protocol version number. | ||||||||||||||||||||||||||||||
| 196 | Acceptable parameter values are the strings: | ||||||||||||||||||||||||||||||
| 197 | version-1 | ||||||||||||||||||||||||||||||
| 198 | version-2 | ||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||
| 200 | =cut | ||||||||||||||||||||||||||||||
| 201 | 1 | ▶ | sub set_protocol_version_num { | ||||||||||||||||||||||||||||
|
Subroutine
set_protocol_version_num: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 202 | 1 | my $self = shift; | |||||||||||||||||||||||||||||
| 203 | 1 | my ($parm) = shift; | |||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||
| 205 | 1 | ▶ | croak "missing protocol-version-num" unless $parm; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||||
| 207 | 1 | $self->{"protocol-version-num"} = new Biblio::ILL::ISO::ProtocolVersionNum($parm); | |||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||
| 209 | 1 | return; | |||||||||||||||||||||||||||||
| 210 | } | ||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||
| 212 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 213 | # | ||||||||||||||||||||||||||||||
| 214 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 215 | =head1 | ||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||
| 217 | =head2 set_transaction_id($tid) | ||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||
| 219 | Sets the message's transaction-id. | ||||||||||||||||||||||||||||||
| 220 | Expects a valid Biblio::ILL::ISO::TransactionId. | ||||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||||
| 222 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||||||||||||||||||||||||||||||
| 223 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||||||||||||||||||||||||||||||
| 224 | $msg->set_transaction_id($tid); | ||||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||||
| 226 | This is a mandatory field. | ||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||
| 228 | =cut | ||||||||||||||||||||||||||||||
| 229 | 1 | ▶ | sub set_transaction_id { | ||||||||||||||||||||||||||||
|
Subroutine
set_transaction_id: called CC=3 SCAR=11.2
Pod
documented
| |||||||||||||||||||||||||||||||
| 230 | 1 | my $self = shift; | |||||||||||||||||||||||||||||
| 231 | 1 | my ($parm) = shift; | |||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||
| 233 | 1 | ▶ | croak "missing transaction-id" unless $parm; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 234 | 1 | ▶ | croak "invalid transaction-id" unless (ref($parm) eq "Biblio::ILL::ISO::TransactionId"); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||||
| 236 | 1 | $self->{"transaction-id"} = $parm; | |||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||
| 238 | 1 | return; | |||||||||||||||||||||||||||||
| 239 | } | ||||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||||
| 241 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 242 | # | ||||||||||||||||||||||||||||||
| 243 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 244 | =head1 | ||||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||||
| 246 | =head2 set_service_date_time($sdt) | ||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||
| 248 | Sets the message's service-date-time. | ||||||||||||||||||||||||||||||
| 249 | Expects a valid Biblio::ILL::ISO::ServiceDateTime. | ||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||
| 251 | my $dt_this = new Biblio::ILL::ISO::DateTime("20030623","114400"); | ||||||||||||||||||||||||||||||
| 252 | my $dt_orig = new Biblio::ILL::ISO::DateTime("20030623","114015") | ||||||||||||||||||||||||||||||
| 253 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( $dt_this, $dt_orig); | ||||||||||||||||||||||||||||||
| 254 | $msg->set_service_date_time($sdt); | ||||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||||
| 256 | This is a mandatory field. | ||||||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||||
| 258 | =cut | ||||||||||||||||||||||||||||||
| 259 | 1 | ▶ | sub set_service_date_time { | ||||||||||||||||||||||||||||
|
Subroutine
set_service_date_time: called CC=3 SCAR=11.2
Pod
documented
| |||||||||||||||||||||||||||||||
| 260 | 1 | my $self = shift; | |||||||||||||||||||||||||||||
| 261 | 1 | my ($sdt) = shift; | |||||||||||||||||||||||||||||
| 262 | |||||||||||||||||||||||||||||||
| 263 | 1 | ▶ | croak "missing service-date-time" unless $sdt; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 264 | 1 | ▶ | croak "invalid service-date-time" unless (ref($sdt) eq "Biblio::ILL::ISO::ServiceDateTime"); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||
| 266 | 1 | $self->{"service-date-time"} = $sdt; | |||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||
| 268 | 1 | return; | |||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||
| 270 | |||||||||||||||||||||||||||||||
| 271 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 272 | # | ||||||||||||||||||||||||||||||
| 273 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 274 | =head1 | ||||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||||
| 276 | =head2 set_requester_id($reqid) | ||||||||||||||||||||||||||||||
| 277 | |||||||||||||||||||||||||||||||
| 278 | Sets the message's requester-id. | ||||||||||||||||||||||||||||||
| 279 | Expects a valid Biblio::ILL::ISO::SystemId. | ||||||||||||||||||||||||||||||
| 280 | |||||||||||||||||||||||||||||||
| 281 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||||||||||||||||||||||||||||||
| 282 | $reqid->set_person_name("David A. Christensen"); | ||||||||||||||||||||||||||||||
| 283 | $msg->set_requester_id($reqid); | ||||||||||||||||||||||||||||||
| 284 | |||||||||||||||||||||||||||||||
| 285 | This is an optional field. | ||||||||||||||||||||||||||||||
| 286 | |||||||||||||||||||||||||||||||
| 287 | =cut | ||||||||||||||||||||||||||||||
| 288 | 2 | ▶ | sub set_requester_id { | ||||||||||||||||||||||||||||
|
Subroutine
set_requester_id: called CC=3 SCAR=11.2
Pod
documented
| |||||||||||||||||||||||||||||||
| 289 | 2 | my $self = shift; | |||||||||||||||||||||||||||||
| 290 | 2 | my ($parm) = shift; | |||||||||||||||||||||||||||||
| 291 | |||||||||||||||||||||||||||||||
| 292 | 2 | ▶ | croak "missing requester-id" unless $parm; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 293 | 2 | ▶ | croak "invalid requester-id" unless (ref($parm) eq "Biblio::ILL::ISO::SystemId"); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 294 | |||||||||||||||||||||||||||||||
| 295 | 2 | $self->{"requester-id"} = $parm; | |||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||||
| 297 | 2 | return; | |||||||||||||||||||||||||||||
| 298 | } | ||||||||||||||||||||||||||||||
| 299 | |||||||||||||||||||||||||||||||
| 300 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 301 | # | ||||||||||||||||||||||||||||||
| 302 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 303 | =head1 | ||||||||||||||||||||||||||||||
| 304 | |||||||||||||||||||||||||||||||
| 305 | =head2 set_responder_id($resid) | ||||||||||||||||||||||||||||||
| 306 | |||||||||||||||||||||||||||||||
| 307 | Sets the message's responder-id. | ||||||||||||||||||||||||||||||
| 308 | Expects a valid Biblio::ILL::ISO::SystemId. | ||||||||||||||||||||||||||||||
| 309 | |||||||||||||||||||||||||||||||
| 310 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||||||||||||||||||||||||||||||
| 311 | $msg->set_responder_id($resid); | ||||||||||||||||||||||||||||||
| 312 | |||||||||||||||||||||||||||||||
| 313 | This is an optional field. | ||||||||||||||||||||||||||||||
| 314 | |||||||||||||||||||||||||||||||
| 315 | =cut | ||||||||||||||||||||||||||||||
| 316 | 0 | ▶ | sub set_responder_id { | ||||||||||||||||||||||||||||
|
Subroutine
set_responder_id: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||
| 317 | 0 | my $self = shift; | |||||||||||||||||||||||||||||
| 318 | 0 | my ($parm) = shift; | |||||||||||||||||||||||||||||
| 319 | |||||||||||||||||||||||||||||||
| 320 | 0 | ▶ | croak "missing responder-id" unless $parm; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 321 | 0 | ▶ | croak "invalid responder-id" unless (ref($parm) eq "Biblio::ILL::ISO::SystemId"); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 322 | |||||||||||||||||||||||||||||||
| 323 | 0 | $self->{"responder-id"} = $parm; | |||||||||||||||||||||||||||||
| 324 | |||||||||||||||||||||||||||||||
| 325 | 0 | return; | |||||||||||||||||||||||||||||
| 326 | } | ||||||||||||||||||||||||||||||
| 327 | |||||||||||||||||||||||||||||||
| 328 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 329 | # | ||||||||||||||||||||||||||||||
| 330 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 331 | =head1 | ||||||||||||||||||||||||||||||
| 332 | |||||||||||||||||||||||||||||||
| 333 | =head2 set_desired_due_date($ddd) | ||||||||||||||||||||||||||||||
| 334 | |||||||||||||||||||||||||||||||
| 335 | Sets the message's desired-due-date. | ||||||||||||||||||||||||||||||
| 336 | Expects a valid Biblio::ILL::ISO::ISODate or a properly | ||||||||||||||||||||||||||||||
| 337 | formatted date string (YYYYMMDD). | ||||||||||||||||||||||||||||||
| 338 | |||||||||||||||||||||||||||||||
| 339 | my $ddd = new Biblio::ILL::ISO::ISODate("20030814"); | ||||||||||||||||||||||||||||||
| 340 | $msg->set_desired_due_date($ddd); | ||||||||||||||||||||||||||||||
| 341 | |||||||||||||||||||||||||||||||
| 342 | This is an optional field. | ||||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||||
| 344 | =cut | ||||||||||||||||||||||||||||||
| 345 | 1 | ▶ | sub set_desired_due_date { | ||||||||||||||||||||||||||||
|
Subroutine
set_desired_due_date: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||||||||||||||||||||||
| 346 | 1 | my $self = shift; | |||||||||||||||||||||||||||||
| 347 | 1 | my ($parm) = shift; | |||||||||||||||||||||||||||||
| 348 | |||||||||||||||||||||||||||||||
| 349 | 1 | ▶ | if (ref($parm) eq "Biblio::ILL::ISO::ISODate") { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 350 | 1 | $self->{"desired-due-date"} = $parm; | |||||||||||||||||||||||||||||
| 351 | } else { | ||||||||||||||||||||||||||||||
| 352 | 0 | $self->{"desired-due-date"} = new Biblio::ILL::ISO::ISODate($parm); | |||||||||||||||||||||||||||||
| 353 | } | ||||||||||||||||||||||||||||||
| 354 | |||||||||||||||||||||||||||||||
| 355 | 1 | return; | |||||||||||||||||||||||||||||
| 356 | } | ||||||||||||||||||||||||||||||
| 357 | |||||||||||||||||||||||||||||||
| 358 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 359 | # | ||||||||||||||||||||||||||||||
| 360 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||
| 361 | =head1 | ||||||||||||||||||||||||||||||
| 362 | |||||||||||||||||||||||||||||||
| 363 | =head2 set_requester_note($note) | ||||||||||||||||||||||||||||||
| 364 | |||||||||||||||||||||||||||||||
| 365 | Sets the message's requester-note. | ||||||||||||||||||||||||||||||
| 366 | Expects a valid Biblio::IL::ISO::ILLString or a simple text string. | ||||||||||||||||||||||||||||||
| 367 | |||||||||||||||||||||||||||||||
| 368 | $msg->set_requester_note("This is a requester note"); | ||||||||||||||||||||||||||||||
| 369 | |||||||||||||||||||||||||||||||
| 370 | This is an optional field. | ||||||||||||||||||||||||||||||
| 371 | |||||||||||||||||||||||||||||||
| 372 | =cut | ||||||||||||||||||||||||||||||
| 373 | 1 | ▶ | sub set_requester_note { | ||||||||||||||||||||||||||||
|
Subroutine
set_requester_note: called CC=3 SCAR=11.6
Pod
documented
| |||||||||||||||||||||||||||||||
| 374 | 1 | my $self = shift; | |||||||||||||||||||||||||||||
| 375 | 1 | my ($parm) = shift; | |||||||||||||||||||||||||||||
| 376 | |||||||||||||||||||||||||||||||
| 377 | 1 | ▶ | croak "missing requester-note" unless $parm; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 378 | 1 | ▶ | if (ref($parm) eq "Biblio::ILL::ISO::ILLString") { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 379 | 1 | $self->{"requester-note"} = $parm; | |||||||||||||||||||||||||||||
| 380 | } else { | ||||||||||||||||||||||||||||||
| 381 | 0 | $self->{"requester-note"} = new Biblio::ILL::ISO::ILLString($parm); | |||||||||||||||||||||||||||||
| 382 | } | ||||||||||||||||||||||||||||||
| 383 | |||||||||||||||||||||||||||||||
| 384 | 1 | return; | |||||||||||||||||||||||||||||
| 385 | } | ||||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||||
| 387 | =head1 RELATED MODULES | ||||||||||||||||||||||||||||||
| 388 | |||||||||||||||||||||||||||||||
| 389 | Biblio::ILL::ISO::ISO | ||||||||||||||||||||||||||||||
| 390 | Biblio::ILL::ISO::Request | ||||||||||||||||||||||||||||||
| 391 | Biblio::ILL::ISO::ForwardNotification | ||||||||||||||||||||||||||||||
| 392 | Biblio::ILL::ISO::Shipped | ||||||||||||||||||||||||||||||
| 393 | Biblio::ILL::ISO::Answer | ||||||||||||||||||||||||||||||
| 394 | Biblio::ILL::ISO::ConditionalReply | ||||||||||||||||||||||||||||||
| 395 | Biblio::ILL::ISO::Cancel | ||||||||||||||||||||||||||||||
| 396 | Biblio::ILL::ISO::CancelReply | ||||||||||||||||||||||||||||||
| 397 | Biblio::ILL::ISO::Received | ||||||||||||||||||||||||||||||
| 398 | Biblio::ILL::ISO::Recall | ||||||||||||||||||||||||||||||
| 399 | Biblio::ILL::ISO::Returned | ||||||||||||||||||||||||||||||
| 400 | Biblio::ILL::ISO::CheckedIn | ||||||||||||||||||||||||||||||
| 401 | Biblio::ILL::ISO::Overdue | ||||||||||||||||||||||||||||||
| 402 | Biblio::ILL::ISO::Renew | ||||||||||||||||||||||||||||||
| 403 | Biblio::ILL::ISO::RenewAnswer | ||||||||||||||||||||||||||||||
| 404 | Biblio::ILL::ISO::Lost | ||||||||||||||||||||||||||||||
| 405 | Biblio::ILL::ISO::Damaged | ||||||||||||||||||||||||||||||
| 406 | Biblio::ILL::ISO::Message | ||||||||||||||||||||||||||||||
| 407 | Biblio::ILL::ISO::StatusQuery | ||||||||||||||||||||||||||||||
| 408 | Biblio::ILL::ISO::StatusOrErrorReport | ||||||||||||||||||||||||||||||
| 409 | Biblio::ILL::ISO::Expired | ||||||||||||||||||||||||||||||
| 410 | |||||||||||||||||||||||||||||||
| 411 | =cut | ||||||||||||||||||||||||||||||
| 412 | |||||||||||||||||||||||||||||||
| 413 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||
| 414 | |||||||||||||||||||||||||||||||
| 415 | See the README for system design notes. | ||||||||||||||||||||||||||||||
| 416 | |||||||||||||||||||||||||||||||
| 417 | For more information on Interlibrary Loan standards (ISO 10160/10161), | ||||||||||||||||||||||||||||||
| 418 | a good place to start is: | ||||||||||||||||||||||||||||||
| 419 | |||||||||||||||||||||||||||||||
| 420 | http://www.nlc-bnc.ca/iso/ill/main.htm | ||||||||||||||||||||||||||||||
| 421 | |||||||||||||||||||||||||||||||
| 422 | =cut | ||||||||||||||||||||||||||||||
| 423 | |||||||||||||||||||||||||||||||
| 424 | =head1 AUTHOR | ||||||||||||||||||||||||||||||
| 425 | |||||||||||||||||||||||||||||||
| 426 | David Christensen, <DChristensenSPAMLESS@westman.wave.ca> | ||||||||||||||||||||||||||||||
| 427 | |||||||||||||||||||||||||||||||
| 428 | =cut | ||||||||||||||||||||||||||||||
| 429 | |||||||||||||||||||||||||||||||
| 430 | |||||||||||||||||||||||||||||||
| 431 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||||
| 432 | |||||||||||||||||||||||||||||||
| 433 | Copyright 2003 by David Christensen | ||||||||||||||||||||||||||||||
| 434 | |||||||||||||||||||||||||||||||
| 435 | This library is free software; you can redistribute it and/or modify it | ||||||||||||||||||||||||||||||
| 436 | under the same terms as Perl itself. | ||||||||||||||||||||||||||||||
| 437 | |||||||||||||||||||||||||||||||
| 438 | =cut | ||||||||||||||||||||||||||||||
| 439 | |||||||||||||||||||||||||||||||
| 440 | 2 | 1; | |||||||||||||||||||||||||||||