| 1 | package Biblio::ILL::ISO::TransactionId; | ||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||
| 3 | =head1 NAME | ||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||
| 5 | Biblio::ILL::ISO::TransactionId | ||||||||||||||||||||||||||||||||||
| 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::SystemId; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 11 | 4 | ▶ | use Biblio::ILL::ISO::ILLString; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||
| 13 | 4 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||
| 15 | =head1 VERSION | ||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||
| 17 | Version 0.01 | ||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||
| 19 | =cut | ||||||||||||||||||||||||||||||||||
| 20 | 4 | our $VERSION = '0.01'; | |||||||||||||||||||||||||||||||||
| 21 | #--------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||
| 22 | # Mods | ||||||||||||||||||||||||||||||||||
| 23 | # 0.01 - 2003.07.15 - original version | ||||||||||||||||||||||||||||||||||
| 24 | #--------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||
| 26 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||
| 28 | Biblio::ILL::ISO::TransactionId is a derivation of Biblio::ILL::ISO::ILLASNtype. | ||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||
| 30 | =head1 USES | ||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||
| 32 | Biblio::ILL::ISO::SystemId | ||||||||||||||||||||||||||||||||||
| 33 | Biblio::ILL::ISO::ILLString | ||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||
| 35 | =head1 USED IN | ||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||
| 37 | Biblio::ILL::ISO::Answer | ||||||||||||||||||||||||||||||||||
| 38 | Biblio::ILL::ISO::Cancel | ||||||||||||||||||||||||||||||||||
| 39 | Biblio::ILL::ISO::CancelReply | ||||||||||||||||||||||||||||||||||
| 40 | Biblio::ILL::ISO::CheckedIn | ||||||||||||||||||||||||||||||||||
| 41 | Biblio::ILL::ISO::ConditionalReply | ||||||||||||||||||||||||||||||||||
| 42 | Biblio::ILL::ISO::Damaged | ||||||||||||||||||||||||||||||||||
| 43 | Biblio::ILL::ISO::Expired | ||||||||||||||||||||||||||||||||||
| 44 | Biblio::ILL::ISO::ForwardNotification | ||||||||||||||||||||||||||||||||||
| 45 | Biblio::ILL::ISO::Lost | ||||||||||||||||||||||||||||||||||
| 46 | Biblio::ILL::ISO::Message | ||||||||||||||||||||||||||||||||||
| 47 | Biblio::ILL::ISO::Overdue | ||||||||||||||||||||||||||||||||||
| 48 | Biblio::ILL::ISO::Recall | ||||||||||||||||||||||||||||||||||
| 49 | Biblio::ILL::ISO::Received | ||||||||||||||||||||||||||||||||||
| 50 | Biblio::ILL::ISO::RenewAnswer | ||||||||||||||||||||||||||||||||||
| 51 | Biblio::ILL::ISO::Renew | ||||||||||||||||||||||||||||||||||
| 52 | Biblio::ILL::ISO::Request | ||||||||||||||||||||||||||||||||||
| 53 | Biblio::ILL::ISO::Returned | ||||||||||||||||||||||||||||||||||
| 54 | Biblio::ILL::ISO::Shipped | ||||||||||||||||||||||||||||||||||
| 55 | Biblio::ILL::ISO::StatusOrErrorReport | ||||||||||||||||||||||||||||||||||
| 56 | Biblio::ILL::ISO::StatusQuery | ||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||
| 58 | =cut | ||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||
| 60 | 4 | ▶ | BEGIN{@ISA = qw ( Biblio::ILL::ISO::ILLASNtype );} # inherit from ILLASNtype | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||
| 62 | =head1 FROM THE ASN DEFINITION | ||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||
| 64 | Transaction-Id ::= SEQUENCE { | ||||||||||||||||||||||||||||||||||
| 65 | initial-requester-id [0] IMPLICIT System-Id OPTIONAL, | ||||||||||||||||||||||||||||||||||
| 66 | -- mandatory for sub-transactions; not called | ||||||||||||||||||||||||||||||||||
| 67 | -- "requester-id" to distinguish id of initial-requester | ||||||||||||||||||||||||||||||||||
| 68 | --from id of requester of sub-transaction if there is one | ||||||||||||||||||||||||||||||||||
| 69 | transaction-group-qualifier [1] ILL-String, | ||||||||||||||||||||||||||||||||||
| 70 | transaction-qualifier [2] ILL-String, | ||||||||||||||||||||||||||||||||||
| 71 | sub-transaction-qualifier [3] ILL-String OPTIONAL | ||||||||||||||||||||||||||||||||||
| 72 | -- mandatory for sub-transactions | ||||||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||
| 75 | =cut | ||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||
| 77 | =head1 METHODS | ||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||
| 79 | =cut | ||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||
| 81 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||
| 82 | # | ||||||||||||||||||||||||||||||||||
| 83 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||
| 84 | =head1 | ||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||
| 86 | =head2 new( $tgq, $tq [,$stq [,$systemid]] ) | ||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||
| 88 | Creates a new TransactionId object. | ||||||||||||||||||||||||||||||||||
| 89 | Expects a transaction group qualifier (Biblio::ILL::ISO::ILLString), | ||||||||||||||||||||||||||||||||||
| 90 | a transaction qualifier (Biblio::ILL::ISO::ILLString), | ||||||||||||||||||||||||||||||||||
| 91 | (optionally) a sub-transaction qualifier (Biblio::ILL::ISO::ILLString), and | ||||||||||||||||||||||||||||||||||
| 92 | (optionally) an initial-requester id (Biblio::ILL::ISO::SystemId). | ||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||
| 94 | =cut | ||||||||||||||||||||||||||||||||||
| 95 | 21 | ▶ | sub new { | ||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=9 SCAR=24.0
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 96 | 21 | my $class = shift; | |||||||||||||||||||||||||||||||||
| 97 | 21 | my $self = {}; | |||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||
| 99 | 21 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 100 | 21 | my ($tgq, $tq, $stq, $systemid) = @_; | |||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||
| 102 | 21 | ▶ | croak "missing transaction-group-qualifier" unless ($tgq); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 103 | 21 | ▶ | croak "missing transaction-qualifier" unless ($tq); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 104 | 21 | ▶ | if ($systemid) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 105 | 21 | ▶ | croak "invalid initial-requester-id" unless (ref($systemid) eq "Biblio::ILL::ISO::SystemId"); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||
| 108 | 21 | $self->{"transaction-group-qualifier"} = new Biblio::ILL::ISO::ILLString($tgq); | |||||||||||||||||||||||||||||||||
| 109 | 21 | $self->{"transaction-qualifier"} = new Biblio::ILL::ISO::ILLString($tq); | |||||||||||||||||||||||||||||||||
| 110 | 21 | ▶ | $self->{"sub-transaction-qualifier"} = new Biblio::ILL::ISO::ILLString($stq) if ($stq); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 111 | 21 | ▶ | $self->{"initial-requester-id"} = $systemid if ($systemid); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||
| 114 | 21 | ▶ | 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 | 21 | return ($self); | |||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||
| 119 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||
| 120 | # | ||||||||||||||||||||||||||||||||||
| 121 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||
| 122 | =head1 | ||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||
| 124 | =head2 new( $tgq, $tq [,$stq [,$systemid]] ) | ||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||
| 126 | Sets the object's transaction-group-qualifier (Biblio::ILL::ISO::ILLString), | ||||||||||||||||||||||||||||||||||
| 127 | transaction-qualifier (Biblio::ILL::ISO::ILLString), | ||||||||||||||||||||||||||||||||||
| 128 | (optionally) sub-transaction-qualifier (Biblio::ILL::ISO::ILLString), and | ||||||||||||||||||||||||||||||||||
| 129 | (optionally) initial-requester-id (Biblio::ILL::ISO::SystemId). | ||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||
| 131 | =cut | ||||||||||||||||||||||||||||||||||
| 132 | 0 | ▶ | sub set { | ||||||||||||||||||||||||||||||||
|
Subroutine
set: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 133 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 134 | 0 | my ($tgq, $tq, $stq, $systemid) = @_; | |||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||
| 136 | 0 | ▶ | croak "missing transaction-group-qualifier" unless ($tgq); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 137 | 0 | ▶ | croak "missing transaction-qualifier" unless ($tq); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 138 | 0 | ▶ | if ($systemid) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 139 | 0 | ▶ | croak "invalid initial-requester-id" unless (ref($systemid) eq "Biblio::ILL::ISO::SystemId"); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||
| 142 | 0 | $self->{"transaction-group-qualifier"} = new Biblio::ILL::ISO::ILLString($tgq); | |||||||||||||||||||||||||||||||||
| 143 | 0 | $self->{"transaction-qualifier"} = new Biblio::ILL::ISO::ILLString($tq); | |||||||||||||||||||||||||||||||||
| 144 | 0 | ▶ | $self->{"sub-transaction-qualifier"} = new Biblio::ILL::ISO::ILLString($stq) if ($stq); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 145 | 0 | ▶ | $self->{"initial-requester-id"} = $systemid if ($systemid); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||
| 147 | 0 | return; | |||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||
| 150 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||
| 151 | # | ||||||||||||||||||||||||||||||||||
| 152 | #--------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||
| 153 | =head1 | ||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||
| 155 | =head2 from_asn($href) | ||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||
| 157 | Given a properly formatted hash, builds the object. | ||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||
| 159 | =cut | ||||||||||||||||||||||||||||||||||
| 160 | 0 | ▶ | sub from_asn { | ||||||||||||||||||||||||||||||||
|
Subroutine
from_asn: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 161 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 162 | 0 | my $href = shift; | |||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||
| 164 | 0 | foreach my $k (keys %$href) { | |||||||||||||||||||||||||||||||||
| 165 | #print ref($self) . "...$k\n"; | ||||||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||||
| 167 | 0 | ▶ | if ($k =~ /^initial-requester-id$/) { | ||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||
| 168 | 0 | $self->{$k} = new Biblio::ILL::ISO::SystemId(); | |||||||||||||||||||||||||||||||||
| 169 | 0 | $self->{$k}->from_asn($href->{$k}); | |||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||
| 171 | ▶ | } elsif (($k =~ /^transaction-group-qualifier$/) | |||||||||||||||||||||||||||||||||
|
Condition0%0/6
$k =~ /^transaction-group-qualifier$/ or $k =~ /^transaction-qualifier$/ or $k =~ /^sub-transaction-qualifier$/
$k =~ /^transaction-group-qualifier$/ or $k =~ /^transaction-qualifier$/
MC/DC0%0/3
$k =~ /^transaction-group-qualifier$/ or $k =~ /^transaction-qualifier$/ or $k =~ /^sub-transaction-qualifier$/
$k =~ /^transaction-group-qualifier$/
$k =~ /^transaction-qualifier$/
$k =~ /^sub-transaction-qualifier$/
Truth table0%0/4
A or B or C
A= $k =~ /^transaction-group-qualifier$/B= $k =~ /^transaction-qualifier$/C= $k =~ /^sub-transaction-qualifier$/
| |||||||||||||||||||||||||||||||||||
| 172 | || ($k =~ /^transaction-qualifier$/) | ||||||||||||||||||||||||||||||||||
| 173 | || ($k =~ /^sub-transaction-qualifier$/) | ||||||||||||||||||||||||||||||||||
| 174 | ) { | ||||||||||||||||||||||||||||||||||
| 175 | 0 | $self->{$k} = new Biblio::ILL::ISO::ILLString(); | |||||||||||||||||||||||||||||||||
| 176 | 0 | $self->{$k}->from_asn($href->{$k}); | |||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||
| 178 | } else { | ||||||||||||||||||||||||||||||||||
| 179 | 0 | croak "invalid " . ref($self) . " element: [$k]"; | |||||||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||||||
| 183 | 0 | return $self; | |||||||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||
| 186 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||
| 188 | See the README for system design notes. | ||||||||||||||||||||||||||||||||||
| 189 | See the parent class(es) for other available methods. | ||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||
| 191 | For more information on Interlibrary Loan standards (ISO 10160/10161), | ||||||||||||||||||||||||||||||||||
| 192 | a good place to start is: | ||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||
| 194 | http://www.nlc-bnc.ca/iso/ill/main.htm | ||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||
| 196 | =cut | ||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||
| 198 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||
| 200 | David Christensen, <DChristensenSPAMLESS@westman.wave.ca> | ||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||
| 202 | =cut | ||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||
| 205 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||||||||
| 207 | Copyright 2003 by David Christensen | ||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||
| 209 | This library is free software; you can redistribute it and/or modify it | ||||||||||||||||||||||||||||||||||
| 210 | under the same terms as Perl itself. | ||||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||||
| 212 | =cut | ||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||
| 214 | 4 | 1; | |||||||||||||||||||||||||||||||||