| 1 | package Biblio::ILL::ISO::WillSupplyResults; | ||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||
| 3 | =head1 NAME | ||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||
| 5 | Biblio::ILL::ISO::WillSupplyResults | ||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||
| 7 | =cut | ||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||
| 9 | 4 | ▶ | use Biblio::ILL::ISO::ILLASNtype; | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 10 | 4 | ▶ | use Biblio::ILL::ISO::ReasonWillSupply; | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 11 | 4 | ▶ | use Biblio::ILL::ISO::ISODate; | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 12 | 4 | ▶ | use Biblio::ILL::ISO::PostalAddress; | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 13 | 4 | ▶ | use Biblio::ILL::ISO::LocationInfoSequence; | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 14 | 4 | ▶ | use Biblio::ILL::ISO::ElectronicDeliveryService; | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||
| 16 | 4 | ▶ | use Carp; | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||
| 18 | =head1 VERSION | ||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||
| 20 | Version 0.01 | ||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||
| 22 | =cut | ||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||
| 24 | 4 | our $VERSION = '0.01'; | |||||||||||||||||||||||||
| 25 | #--------------------------------------------------------------------------- | ||||||||||||||||||||||||||
| 26 | # Mods | ||||||||||||||||||||||||||
| 27 | # 0.01 - 2003.07.26 - original version | ||||||||||||||||||||||||||
| 28 | #--------------------------------------------------------------------------- | ||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||
| 30 | =head1 DESCRIPTION | ||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||
| 32 | Biblio::ILL::ISO::WillSupplyResults is a derivation of Biblio::ILL::ISO::ILLASNtype. | ||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||
| 34 | =head1 USES | ||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||
| 36 | Biblio::ILL::ISO::ReasonWillSupply | ||||||||||||||||||||||||||
| 37 | Biblio::ILL::ISO::ISODate | ||||||||||||||||||||||||||
| 38 | Biblio::ILL::ISO::PostalAddress | ||||||||||||||||||||||||||
| 39 | Biblio::ILL::ISO::LocationInfoSequence | ||||||||||||||||||||||||||
| 40 | Biblio::ILL::ISO::ElectronicDeliveryService | ||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||
| 42 | =head1 USED IN | ||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||
| 44 | Biblio::ILL::ISO::ResultsExplanation | ||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||
| 46 | =cut | ||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||
| 48 | 4 | ▶ | BEGIN{@ISA = qw ( Biblio::ILL::ISO::ILLASNtype );} # inherit from ILLASNtype | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||
| 50 | =head1 FROM THE ASN DEFINITION | ||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||
| 52 | Will-Supply-Results ::= EXPLICIT SEQUENCE { | ||||||||||||||||||||||||||
| 53 | reason-will-supply [0] ReasonWillSupply, | ||||||||||||||||||||||||||
| 54 | supply-date [1] ISO-Date OPTIONAL, | ||||||||||||||||||||||||||
| 55 | return-to-address [2] Postal-Address OPTIONAL, | ||||||||||||||||||||||||||
| 56 | locations [3] IMPLICIT SEQUENCE OF Location-Info OPTIONAL, | ||||||||||||||||||||||||||
| 57 | electronic-delivery-service [4] Electronic-Delivery-Service OPTIONAL | ||||||||||||||||||||||||||
| 58 | -- if present, this must be one of the services proposed by | ||||||||||||||||||||||||||
| 59 | -- the requester | ||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||
| 62 | =cut | ||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||
| 64 | =head1 METHODS | ||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||
| 66 | =cut | ||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||
| 68 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||
| 69 | # | ||||||||||||||||||||||||||
| 70 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||
| 71 | =head1 | ||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||
| 73 | =head2 new( $reason, [$supplydate [,$returnto [,$locations [,$electronic_delivery_service]]]] ) | ||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||
| 75 | Creates a new WillSupplyResults object. | ||||||||||||||||||||||||||
| 76 | Expects either no paramaters, or | ||||||||||||||||||||||||||
| 77 | a reason (Biblio::ILL::ISO::ReasonWillSupply), | ||||||||||||||||||||||||||
| 78 | (optionally) a supply-date (Biblio::ILL::ISO::ISODate), | ||||||||||||||||||||||||||
| 79 | (optionally) a return-to address (Biblio::ILL::ISO::PostalAddress), | ||||||||||||||||||||||||||
| 80 | (optionally) a locations sequence (Biblio::ILL::ISO::LocationInfoSequence), and | ||||||||||||||||||||||||||
| 81 | (optionally) an electronic delivery address (Biblio::ILL::ISO::ElectronicDeliveryService). | ||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||
| 83 | =cut | ||||||||||||||||||||||||||
| 84 | 1 | ▶ | sub new { | ||||||||||||||||||||||||
|
Subroutine
new: called CC=17 SCAR=33.9
Pod
documented
| |||||||||||||||||||||||||||
| 85 | 1 | my $class = shift; | |||||||||||||||||||||||||
| 86 | 1 | my $self = {}; | |||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||
| 88 | 1 | ▶ | if (@_) { | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 89 | 1 | my ($reason, $supplydate, $returnto, $locations, $electronic_delivery_service) = @_; | |||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||
| 91 | 1 | ▶ | croak "missing will-supply-result reason-will-supply" unless ($reason); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 92 | 1 | ▶ | croak "invalid will-supply-result reason-will-supply" unless (ref($reason) eq "Biblio::ILL::ISO::ReasonWillSupply"); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||
| 94 | 1 | ▶ | if ($supplydate) { | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 95 | 1 | ▶ | croak "invalid supply-date" unless (ref($supplydate) eq "Biblio::ILL::ISO::ISODate"); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||
| 97 | 1 | ▶ | if ($returnto) { | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 98 | 1 | ▶ | croak "invalid return-to-address" unless (ref($returnto) eq "Biblio::ILL::ISO::PostalAddress"); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||
| 100 | 1 | ▶ | if ($locations) { | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 101 | 1 | ▶ | croak "invalid locations" unless (ref($locations) eq "Biblio::ILL::ISO::LocationInfoSequence"); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||
| 103 | 1 | ▶ | if ($electronic_delivery_service) { | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 104 | 0 | ▶ | croak "invalid electronic-delivery-service" unless (ref($electronic_delivery_service) eq "Biblio::ILL::ISO::ElectronicDeliveryService"); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||
| 107 | 1 | $self->{"reason-will-supply"} = $reason; | |||||||||||||||||||||||||
| 108 | 1 | ▶ | $self->{"supply-date"} = $supplydate if ($supplydate); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 109 | 1 | ▶ | $self->{"return-to-address"} = $returnto if ($returnto); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 110 | 1 | ▶ | $self->{"locations"} = $locations if ($locations); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 111 | 1 | ▶ | $self->{"electronic-delivery-address"} = $electronic_delivery_address if ($electronic_delivery_address); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||
| 114 | 1 | ▶ | 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
| |||||||||||||||||||||||||||
| 115 | 1 | return ($self); | |||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||
| 119 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||
| 120 | # | ||||||||||||||||||||||||||
| 121 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||
| 122 | =head1 | ||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||
| 124 | =head2 set( $reason, [$supplydate [,$returnto [,$locations [,$electronic_delivery_service]]]] ) | ||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||
| 126 | Sets the object's reason-will-supply (Biblio::ILL::ISO::ReasonWillSupply), | ||||||||||||||||||||||||||
| 127 | (optionally) supply-date (Biblio::ILL::ISO::ISODate), | ||||||||||||||||||||||||||
| 128 | (optionally) return-to-address (Biblio::ILL::ISO::PostalAddress), | ||||||||||||||||||||||||||
| 129 | (optionally) locations (Biblio::ILL::ISO::LocationInfoSequence), and | ||||||||||||||||||||||||||
| 130 | (optionally) electronic-delivery-address (Biblio::ILL::ISO::ElectronicDeliveryService). | ||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||
| 132 | =cut | ||||||||||||||||||||||||||
| 133 | 0 | ▶ | sub set { | ||||||||||||||||||||||||
|
Subroutine
set: not called CC=15 SCAR=54.8
Pod
documented
| |||||||||||||||||||||||||||
| 134 | 0 | my $self = shift; | |||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||
| 136 | 0 | my ($reason, $supplydate, $returnto, $locations, $electronic_delivery_service) = @_; | |||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||
| 138 | 0 | ▶ | croak "missing will-supply-result reason-will-supply" unless ($reason); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 139 | 0 | ▶ | croak "invalid will-supply-result reason-will-supply" unless (ref($reason) eq "Biblio::ILL::ISO::ReasonWillSupply"); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||
| 141 | 0 | ▶ | if ($supplydate) { | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 142 | 0 | ▶ | croak "invalid supply-date" unless (ref($supplydate) eq "Biblio::ILL::ISO::ISODate"); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||
| 144 | 0 | ▶ | if ($returnto) { | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 145 | 0 | ▶ | croak "invalid return-to-address" unless (ref($returnto) eq "Biblio::ILL::ISO::PostalAddress"); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||
| 147 | 0 | ▶ | if ($locations) { | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 148 | 0 | ▶ | croak "invalid locations" unless (ref($locations) eq "Biblio::ILL::ISO::LocationInfoSequence"); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||
| 150 | 0 | ▶ | if ($electronic_delivery_service) { | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 151 | 0 | ▶ | croak "invalid electronic-delivery-service" unless (ref($electronic_delivery_service) eq "Biblio::ILL::ISO::ElectronicDeliveryService"); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 152 | } | ||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||
| 154 | 0 | $self->{"reason-will-supply"} = $reason; | |||||||||||||||||||||||||
| 155 | 0 | ▶ | $self->{"supply-date"} = $supplydate if ($supplydate); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 156 | 0 | ▶ | $self->{"return-to-address"} = $returnto if ($returnto); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 157 | 0 | ▶ | $self->{"locations"} = $locations if ($locations); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 158 | 0 | ▶ | $self->{"electronic-delivery-address"} = $electronic_delivery_address if ($electronic_delivery_address); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||
| 160 | 0 | return; | |||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||
| 163 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||
| 164 | # | ||||||||||||||||||||||||||
| 165 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||
| 166 | =head1 | ||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||
| 168 | =head2 from_asn($href) | ||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||
| 170 | Given a properly formatted hash, builds the object. | ||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||
| 172 | =cut | ||||||||||||||||||||||||||
| 173 | 0 | ▶ | sub from_asn { | ||||||||||||||||||||||||
|
Subroutine
from_asn: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||
| 174 | 0 | my $self = shift; | |||||||||||||||||||||||||
| 175 | 0 | my $href = shift; | |||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||
| 177 | 0 | foreach my $k (keys %$href) { | |||||||||||||||||||||||||
| 178 | #print ref($self) . "...$k\n"; | ||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||
| 180 | 0 | ▶ | if ($k =~ /^reason-will-supply$/) { | ||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||
| 181 | 0 | $self->{$k} = new Biblio::ILL::ISO::ReasonWillSupply(); | |||||||||||||||||||||||||
| 182 | 0 | $self->{$k}->from_asn($href->{$k}); | |||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||
| 184 | } elsif ($k =~ /^supply-date$/) { | ||||||||||||||||||||||||||
| 185 | 0 | $self->{$k} = new Biblio::ILL::ISO::ISODate(); | |||||||||||||||||||||||||
| 186 | 0 | $self->{$k}->from_asn($href->{$k}); | |||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||
| 188 | } elsif ($k =~ /^return-to-address$/) { | ||||||||||||||||||||||||||
| 189 | 0 | $self->{$k} = new Biblio::ILL::ISO::PostalAddress(); | |||||||||||||||||||||||||
| 190 | 0 | $self->{$k}->from_asn($href->{$k}); | |||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||
| 192 | } elsif ($k =~ /^locations$/) { | ||||||||||||||||||||||||||
| 193 | 0 | $self->{$k} = new Biblio::ILL::ISO::LocationInfoSequence(); | |||||||||||||||||||||||||
| 194 | 0 | $self->{$k}->from_asn($href->{$k}); | |||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||
| 196 | } elsif ($k =~ /^electronic-delivery-address$/) { | ||||||||||||||||||||||||||
| 197 | 0 | $self->{$k} = new Biblio::ILL::ISO::ElectronicDeliveryAddress(); | |||||||||||||||||||||||||
| 198 | 0 | $self->{$k}->from_asn($href->{$k}); | |||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||
| 200 | } else { | ||||||||||||||||||||||||||
| 201 | 0 | croak "invalid " . ref($self) . " element: [$k]"; | |||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||
| 205 | 0 | return $self; | |||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||
| 208 | =head1 SEE ALSO | ||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||
| 210 | See the README for system design notes. | ||||||||||||||||||||||||||
| 211 | See the parent class(es) for other available methods. | ||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||
| 213 | For more information on Interlibrary Loan standards (ISO 10160/10161), | ||||||||||||||||||||||||||
| 214 | a good place to start is: | ||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||
| 216 | http://www.nlc-bnc.ca/iso/ill/main.htm | ||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||
| 218 | =cut | ||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||
| 220 | =head1 AUTHOR | ||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||
| 222 | David Christensen, <DChristensenSPAMLESS@westman.wave.ca> | ||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||
| 224 | =cut | ||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||
| 227 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||
| 229 | Copyright 2003 by David Christensen | ||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||
| 231 | This library is free software; you can redistribute it and/or modify it | ||||||||||||||||||||||||||
| 232 | under the same terms as Perl itself. | ||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||
| 234 | =cut | ||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||
| 236 | 4 | 1; | |||||||||||||||||||||||||