| 1 | #!/usr/local/bin/perl | ||
| 2 | # This code is used in pl/ (as ISO-msg-t-dumper.pm) to create the message test cases | ||
| 3 | # and in t/ (as 03.messages.t) to test them. | ||
| 4 | # (each script is tweaked a bit... Some day I'll work out a more clever way of doing this) | ||
| 5 | |||
| 6 | #BEGIN{unshift @INC, "./../lib/"} | ||
| 7 | BEGIN{unshift @INC, "./lib/"} | ||
| 8 | |||
| 9 | #use Test::More tests => 20; | ||
| 10 | #use Data::Dumper; | ||
| 11 | |||
| 12 | |||
| 13 | my %msgs = (); | ||
| 14 | my $msg; | ||
| 15 | |||
| 16 | #======================================================================================== | ||
| 17 | |||
| 18 | |||
| 19 | use Biblio::ILL::ISO::Request; | ||
| 20 | |||
| 21 | # | ||
| 22 | # transaction-id | ||
| 23 | # | ||
| 24 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 25 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 26 | |||
| 27 | # | ||
| 28 | # service-date-time | ||
| 29 | # | ||
| 30 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 31 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 32 | ); | ||
| 33 | |||
| 34 | # | ||
| 35 | # requester-id | ||
| 36 | # | ||
| 37 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 38 | $reqid->set_person_name("David A. Christensen"); | ||
| 39 | |||
| 40 | # | ||
| 41 | # responder-id | ||
| 42 | # | ||
| 43 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 44 | |||
| 45 | # | ||
| 46 | # transaction-type | ||
| 47 | # | ||
| 48 | my $tt = new Biblio::ILL::ISO::TransactionType("simple"); | ||
| 49 | |||
| 50 | # | ||
| 51 | # delivery-address | ||
| 52 | # | ||
| 53 | my $da = new Biblio::ILL::ISO::DeliveryAddress( new Biblio::ILL::ISO::SystemAddress("SMTP","DChristens\@gov.mb.ca"), | ||
| 54 | new Biblio::ILL::ISO::PostalAddress("Manitoba Public Library Services", | ||
| 55 | "", | ||
| 56 | "Unit 200", | ||
| 57 | "1525 First Street South", | ||
| 58 | "", | ||
| 59 | "Brandon", | ||
| 60 | "MB", | ||
| 61 | "CANADA", | ||
| 62 | "R7A 7A1" | ||
| 63 | ) | ||
| 64 | ); | ||
| 65 | |||
| 66 | # | ||
| 67 | # delivery-service | ||
| 68 | # | ||
| 69 | my $ds = new Biblio::ILL::ISO::DeliveryService( new Biblio::ILL::ISO::TransportationMode("Canada Post") ); | ||
| 70 | |||
| 71 | # | ||
| 72 | # iLL-service-type | ||
| 73 | # | ||
| 74 | my $ists = new Biblio::ILL::ISO::ILLServiceTypeSequence( new Biblio::ILL::ISO::ILLServiceType("loan"), | ||
| 75 | new Biblio::ILL::ISO::ILLServiceType("copy-non-returnable") | ||
| 76 | ); | ||
| 77 | $ists->add(new Biblio::ILL::ISO::ILLServiceType("locations")); #example of adding to a sequence_of | ||
| 78 | |||
| 79 | # | ||
| 80 | # requester-optional-messages | ||
| 81 | # | ||
| 82 | my $rom = new Biblio::ILL::ISO::RequesterOptionalMessageType(1,1,"desires","requires"); | ||
| 83 | |||
| 84 | # | ||
| 85 | # search-type | ||
| 86 | # | ||
| 87 | my $st = new Biblio::ILL::ISO::SearchType("need-Before-Date","1","20030720"); | ||
| 88 | |||
| 89 | # | ||
| 90 | # supply-medium-into-type | ||
| 91 | # | ||
| 92 | my $smit = new Biblio::ILL::ISO::SupplyMediumInfoType("photocopy","legal-size paper"); | ||
| 93 | my $smits = new Biblio::ILL::ISO::SupplyMediumInfoTypeSequence( $smit ); | ||
| 94 | |||
| 95 | # | ||
| 96 | # place-on-hold | ||
| 97 | # | ||
| 98 | my $poh = new Biblio::ILL::ISO::PlaceOnHoldType("no"); | ||
| 99 | |||
| 100 | # | ||
| 101 | # client-id | ||
| 102 | # | ||
| 103 | my $cid = new Biblio::ILL::ISO::ClientId("David Christensen","Most excellent","007"); | ||
| 104 | |||
| 105 | # | ||
| 106 | # item-id | ||
| 107 | # | ||
| 108 | my $iid = new Biblio::ILL::ISO::ItemId("My Book","David Christensen","CHR001.1"); | ||
| 109 | $iid->set_item_type("monograph"); | ||
| 110 | $iid->set_medium_type("printed"); | ||
| 111 | $iid->set_pagination("456"); | ||
| 112 | $iid->set_publication_date("2003"); | ||
| 113 | |||
| 114 | # | ||
| 115 | # cost-info-type | ||
| 116 | # | ||
| 117 | my $cit = new Biblio::ILL::ISO::CostInfoType("","","","PLS001","\$40.00"); | ||
| 118 | |||
| 119 | # | ||
| 120 | # third-party-info-type | ||
| 121 | # | ||
| 122 | my $stlts = new Biblio::ILL::ISO::SendToListTypeSequence( new Biblio::ILL::ISO::SendToListType( new Biblio::ILL::ISO::SystemId("MBOM") )); | ||
| 123 | $stlts->add(new Biblio::ILL::ISO::SendToListType( new Biblio::ILL::ISO::SystemId("MWPL"), | ||
| 124 | new Biblio::ILL::ISO::AccountNumber("PLS001"), | ||
| 125 | new Biblio::ILL::ISO::SystemAddress("SMTP","pls\@gov.mb.ca") | ||
| 126 | ) | ||
| 127 | ); | ||
| 128 | my $atlt = new Biblio::ILL::ISO::AlreadyTriedListType( new Biblio::ILL::ISO::SystemId("BVAS") ); | ||
| 129 | $obj = new Biblio::ILL::ISO::SystemId(); | ||
| 130 | $obj->set_institution_name("Winnipeg Public Library"); | ||
| 131 | $atlt->add($obj); | ||
| 132 | $obj = new Biblio::ILL::ISO::SystemId(); | ||
| 133 | $obj->set_person_name("Frank Emil Urwald"); | ||
| 134 | $atlt->add($obj); | ||
| 135 | $atlt->add( new Biblio::ILL::ISO::SystemId("MBOM")); | ||
| 136 | my $tpit = new Biblio::ILL::ISO::ThirdPartyInfoType(1,1,1,1,"ordered", | ||
| 137 | new Biblio::ILL::ISO::SystemAddress("SMTP","David_A_Christensen\@hotmail.com"), | ||
| 138 | $stlts, | ||
| 139 | $atlt | ||
| 140 | ); | ||
| 141 | |||
| 142 | |||
| 143 | #------------------------------------------------------------------------------------------- | ||
| 144 | |||
| 145 | $msg = new Biblio::ILL::ISO::Request(); | ||
| 146 | |||
| 147 | # Minimum required: | ||
| 148 | $msg->set_protocol_version_num("version-2"); | ||
| 149 | $msg->set_transaction_id( $tid ); | ||
| 150 | $msg->set_service_date_time( $sdt ); | ||
| 151 | $msg->set_transaction_type( $tt ); | ||
| 152 | $msg->set_ILL_service_type_sequence( $ists ); | ||
| 153 | $msg->set_requester_optional_messages( $rom ); | ||
| 154 | $msg->set_place_on_hold( $poh ); | ||
| 155 | $msg->set_item_id( $iid ); | ||
| 156 | $msg->set_retry_flag("false"); | ||
| 157 | $msg->set_forward_flag("true"); | ||
| 158 | |||
| 159 | # Extra, useful info: | ||
| 160 | $msg->set_requester_id( $reqid ); | ||
| 161 | $msg->set_responder_id( $resid ); | ||
| 162 | $msg->set_delivery_address( $da ); | ||
| 163 | $msg->set_billing_address( $da ); | ||
| 164 | $msg->set_delivery_service( $ds ); | ||
| 165 | $msg->set_search_type( $st ); | ||
| 166 | $msg->set_supply_medium_info_type_sequence( $smits ); | ||
| 167 | $msg->set_client_id( $cid ); | ||
| 168 | |||
| 169 | $msg->set_cost_info_type( $cit ); | ||
| 170 | $msg->set_copyright_compliance("CanCopy"); | ||
| 171 | $msg->set_third_party_info_type( $tpit ); | ||
| 172 | $msg->set_requester_note("This is a requester note"); | ||
| 173 | $msg->set_forward_note("This is a forward note"); | ||
| 174 | |||
| 175 | |||
| 176 | |||
| 177 | #$msg->write("msg_01.request.ber"); | ||
| 178 | $msgs{"01.request"} = $msg; | ||
| 179 | |||
| 180 | |||
| 181 | |||
| 182 | |||
| 183 | |||
| 184 | #======================================================================================== | ||
| 185 | |||
| 186 | |||
| 187 | use Biblio::ILL::ISO::ForwardNotification; | ||
| 188 | |||
| 189 | # | ||
| 190 | # transaction-id | ||
| 191 | # | ||
| 192 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 193 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 194 | |||
| 195 | # | ||
| 196 | # service-date-time | ||
| 197 | # | ||
| 198 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 199 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 200 | ); | ||
| 201 | |||
| 202 | # | ||
| 203 | # requester-id | ||
| 204 | # | ||
| 205 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 206 | $reqid->set_person_name("David A. Christensen"); | ||
| 207 | |||
| 208 | # | ||
| 209 | # responder-id | ||
| 210 | # | ||
| 211 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 212 | |||
| 213 | # | ||
| 214 | # responder-address | ||
| 215 | # | ||
| 216 | my $rad = new Biblio::ILL::ISO::SystemAddress("SMTP","DChristensen\@westman.wave.ca"); | ||
| 217 | |||
| 218 | # | ||
| 219 | # intermediary-id | ||
| 220 | # | ||
| 221 | my $iid = new Biblio::ILL::ISO::SystemId(); | ||
| 222 | $iid->set_institution_name("The Great Library of Alexandria"); | ||
| 223 | |||
| 224 | # | ||
| 225 | # notification-note | ||
| 226 | # | ||
| 227 | my $nn = new Biblio::ILL::ISO::ILLString("This is a notification-note."); | ||
| 228 | |||
| 229 | |||
| 230 | #------------------------------------------------------------------------------------------- | ||
| 231 | |||
| 232 | $msg = new Biblio::ILL::ISO::ForwardNotification(); | ||
| 233 | |||
| 234 | # Minimum required: | ||
| 235 | $msg->set_protocol_version_num("version-2"); | ||
| 236 | $msg->set_transaction_id( $tid ); | ||
| 237 | $msg->set_service_date_time( $sdt ); | ||
| 238 | $msg->set_responder_id( $resid ); | ||
| 239 | |||
| 240 | # Extra, useful info: | ||
| 241 | $msg->set_requester_id( $reqid ); | ||
| 242 | $msg->set_responder_address( $rad ); | ||
| 243 | $msg->set_intermediary_id( $iid ); | ||
| 244 | $msg->set_notification_note( $nn ); | ||
| 245 | |||
| 246 | |||
| 247 | |||
| 248 | #$msg->write("msg_02.forward-notification.ber"); | ||
| 249 | $msgs{"02.forward-notification"} = $msg; | ||
| 250 | |||
| 251 | |||
| 252 | |||
| 253 | |||
| 254 | |||
| 255 | |||
| 256 | #======================================================================================== | ||
| 257 | |||
| 258 | |||
| 259 | use Biblio::ILL::ISO::Shipped; | ||
| 260 | |||
| 261 | # | ||
| 262 | # transaction-id | ||
| 263 | # | ||
| 264 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 265 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 266 | |||
| 267 | # | ||
| 268 | # service-date-time | ||
| 269 | # | ||
| 270 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 271 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 272 | ); | ||
| 273 | # | ||
| 274 | # requester-id | ||
| 275 | # | ||
| 276 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 277 | $reqid->set_person_name("David A. Christensen"); | ||
| 278 | |||
| 279 | # | ||
| 280 | # responder-id | ||
| 281 | # | ||
| 282 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 283 | |||
| 284 | # | ||
| 285 | # responder-address | ||
| 286 | # | ||
| 287 | my $rad = new Biblio::ILL::ISO::SystemAddress("SMTP","DChristensen\@westman.wave.ca"); | ||
| 288 | |||
| 289 | # | ||
| 290 | # intermediary-id | ||
| 291 | # | ||
| 292 | my $iid = new Biblio::ILL::ISO::SystemId(); | ||
| 293 | $iid->set_institution_name("The Great Library of Alexandria"); | ||
| 294 | |||
| 295 | # | ||
| 296 | # supplier-id | ||
| 297 | # | ||
| 298 | my $sid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 299 | |||
| 300 | # | ||
| 301 | # client-id | ||
| 302 | # | ||
| 303 | my $cid = new Biblio::ILL::ISO::ClientId("David Christensen","Most excellent","007"); | ||
| 304 | |||
| 305 | # | ||
| 306 | # transaction-type | ||
| 307 | # | ||
| 308 | my $tt = new Biblio::ILL::ISO::TransactionType("simple"); | ||
| 309 | |||
| 310 | # | ||
| 311 | # shipped-service-type | ||
| 312 | # | ||
| 313 | my $sst = new Biblio::ILL::ISO::ShippedServiceType("loan"); | ||
| 314 | |||
| 315 | # | ||
| 316 | # responder-optional-messages | ||
| 317 | # | ||
| 318 | my $rom = new Biblio::ILL::ISO::ResponderOptionalMessageType(1,1,"desires","requires"); | ||
| 319 | |||
| 320 | # | ||
| 321 | # supply-details | ||
| 322 | # | ||
| 323 | my $upmt = new Biblio::ILL::ISO::UnitsPerMediumType( new Biblio::ILL::ISO::SupplyMediumType("audio-recording"), 3); | ||
| 324 | my $upmts = new Biblio::ILL::ISO::UnitsPerMediumTypeSequence( $upmt ); | ||
| 325 | my $sd = new Biblio::ILL::ISO::SupplyDetails("20030813", | ||
| 326 | "20030920", | ||
| 327 | 123, | ||
| 328 | "45.67", | ||
| 329 | new Biblio::ILL::ISO::ShippedConditions("no-reproduction"), | ||
| 330 | new Biblio::ILL::ISO::ShippedVia( new Biblio::ILL::ISO::TransportationMode("Canada Post") ), | ||
| 331 | new Biblio::ILL::ISO::Amount("50.00"), | ||
| 332 | "50.00", | ||
| 333 | $upmts | ||
| 334 | ); | ||
| 335 | |||
| 336 | # | ||
| 337 | # return-to-address | ||
| 338 | # | ||
| 339 | my $rta = new Biblio::ILL::ISO::PostalAddress("Manitoba Public Library Services", | ||
| 340 | "", | ||
| 341 | "Unit 200", | ||
| 342 | "1525 First Street South", | ||
| 343 | "", | ||
| 344 | "Brandon", | ||
| 345 | "MB", | ||
| 346 | "CANADA", | ||
| 347 | "R7A 7A1" | ||
| 348 | ); | ||
| 349 | |||
| 350 | |||
| 351 | # | ||
| 352 | # responder-note | ||
| 353 | # | ||
| 354 | my $rn = new Biblio::ILL::ISO::ILLString("This is a responder note."); | ||
| 355 | |||
| 356 | |||
| 357 | #------------------------------------------------------------------------------------------- | ||
| 358 | |||
| 359 | $msg = new Biblio::ILL::ISO::Shipped(); | ||
| 360 | |||
| 361 | # Minimum required: | ||
| 362 | $msg->set_protocol_version_num("version-2"); | ||
| 363 | $msg->set_transaction_id( $tid ); | ||
| 364 | $msg->set_service_date_time( $sdt ); | ||
| 365 | $msg->set_transaction_type( $tt ); | ||
| 366 | $msg->set_shipped_service_type( $sst ); | ||
| 367 | $msg->set_supply_details( $sd ); | ||
| 368 | |||
| 369 | # Extra, useful info: | ||
| 370 | $msg->set_requester_id( $reqid ); | ||
| 371 | $msg->set_responder_id( $resid ); | ||
| 372 | $msg->set_responder_address( $rad ); | ||
| 373 | $msg->set_intermediary_id( $iid ); | ||
| 374 | $msg->set_supplier_id( $sid ); | ||
| 375 | $msg->set_client_id( $cid ); | ||
| 376 | $msg->set_return_to_address( $rta ); | ||
| 377 | $msg->set_responder_note( $rn ); | ||
| 378 | |||
| 379 | |||
| 380 | |||
| 381 | #$msg->write("msg_03.shipped.ber"); | ||
| 382 | $msgs{"03.shipped"} = $msg; | ||
| 383 | |||
| 384 | |||
| 385 | |||
| 386 | |||
| 387 | |||
| 388 | |||
| 389 | #======================================================================================== | ||
| 390 | |||
| 391 | |||
| 392 | use Biblio::ILL::ISO::Answer; | ||
| 393 | |||
| 394 | # | ||
| 395 | # transaction-id | ||
| 396 | # | ||
| 397 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 398 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 399 | |||
| 400 | # | ||
| 401 | # service-date-time | ||
| 402 | # | ||
| 403 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 404 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 405 | ); | ||
| 406 | |||
| 407 | # | ||
| 408 | # requester-id | ||
| 409 | # | ||
| 410 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 411 | $reqid->set_person_name("David A. Christensen"); | ||
| 412 | |||
| 413 | # | ||
| 414 | # responder-id | ||
| 415 | # | ||
| 416 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 417 | |||
| 418 | # | ||
| 419 | # transaction-results | ||
| 420 | # | ||
| 421 | my $tr = new Biblio::ILL::ISO::TransactionResults("conditional"); | ||
| 422 | |||
| 423 | # | ||
| 424 | # results-explanation | ||
| 425 | # | ||
| 426 | my $sid = new Biblio::ILL::ISO::SystemId(); | ||
| 427 | $sid->set_person_name("David A. Christensen"); | ||
| 428 | $sid->set_institution_symbol("MWPL"); | ||
| 429 | my $loc = new Biblio::ILL::ISO::LocationInfo($sid, | ||
| 430 | new Biblio::ILL::ISO::SystemAddress("SMTP","DChristensen\@westman.wave.ca"), | ||
| 431 | new Biblio::ILL::ISO::ILLString("This is a location note.") | ||
| 432 | ); | ||
| 433 | my $locseq = new Biblio::ILL::ISO::LocationInfoSequence( $loc ); | ||
| 434 | $sid = new Biblio::ILL::ISO::SystemId(); | ||
| 435 | $sid->set_institution_name("Brandon Public Library"); | ||
| 436 | $loc = new Biblio::ILL::ISO::LocationInfo($sid, new Biblio::ILL::ISO::SystemAddress("SMTP","library\@brandon.mb.ca") ); | ||
| 437 | $locseq->add($loc); | ||
| 438 | my $conres = new Biblio::ILL::ISO::ConditionalResults(new Biblio::ILL::ISO::ConditionalResultsCondition("charges"), | ||
| 439 | new Biblio::ILL::ISO::ISODate("20030727"), | ||
| 440 | $locseq, | ||
| 441 | new Biblio::ILL::ISO::DeliveryService( new Biblio::ILL::ISO::TransportationMode("Canada Post") ) | ||
| 442 | ); | ||
| 443 | my $rexp = new Biblio::ILL::ISO::ResultsExplanation( $conres ); | ||
| 444 | |||
| 445 | # | ||
| 446 | # send-to-list | ||
| 447 | # | ||
| 448 | my $stlt = new Biblio::ILL::ISO::SendToListType( new Biblio::ILL::ISO::SystemId("MBOM") ); | ||
| 449 | my $stlts = new Biblio::ILL::ISO::SendToListTypeSequence( $stlt ); | ||
| 450 | $stlts->add( new Biblio::ILL::ISO::SendToListType( new Biblio::ILL::ISO::SystemId("MWPL"), | ||
| 451 | new Biblio::ILL::ISO::AccountNumber("PLS001"), | ||
| 452 | new Biblio::ILL::ISO::SystemAddress("SMTP","pls\@gov.mb.ca") | ||
| 453 | ) | ||
| 454 | ); | ||
| 455 | |||
| 456 | # | ||
| 457 | # already-tried-list | ||
| 458 | # | ||
| 459 | my $atlt = new Biblio::ILL::ISO::AlreadyTriedListType( new Biblio::ILL::ISO::SystemId("BVAS") ); | ||
| 460 | $obj = new Biblio::ILL::ISO::SystemId(); | ||
| 461 | $obj->set_institution_name("Winnipeg Public Library"); | ||
| 462 | $atlt->add($obj); | ||
| 463 | $obj = new Biblio::ILL::ISO::SystemId(); | ||
| 464 | $obj->set_person_name("Frank Emil Urwald"); | ||
| 465 | $atlt->add($obj); | ||
| 466 | $atlt->add( new Biblio::ILL::ISO::SystemId("MBOM")); | ||
| 467 | |||
| 468 | # | ||
| 469 | # responder-optional-messages | ||
| 470 | # | ||
| 471 | my $rom = new Biblio::ILL::ISO::ResponderOptionalMessageType(1,1,"desires","requires"); | ||
| 472 | |||
| 473 | # | ||
| 474 | # responder-note | ||
| 475 | # | ||
| 476 | my $rn = new Biblio::ILL::ISO::ILLString("This is a responder-note."); | ||
| 477 | |||
| 478 | |||
| 479 | #------------------------------------------------------------------------------------------- | ||
| 480 | |||
| 481 | $msg = new Biblio::ILL::ISO::Answer(); | ||
| 482 | |||
| 483 | # Minimum required: | ||
| 484 | $msg->set_protocol_version_num("version-2"); | ||
| 485 | $msg->set_transaction_id( $tid ); | ||
| 486 | $msg->set_service_date_time( $sdt ); | ||
| 487 | $msg->set_transaction_results( $tr ); | ||
| 488 | $msg->set_results_explanation( $rexp ); | ||
| 489 | |||
| 490 | # Extra, useful info: | ||
| 491 | $msg->set_requester_id( $reqid ); | ||
| 492 | $msg->set_responder_id( $resid ); | ||
| 493 | $msg->set_responder_optional_messages( $rom ); | ||
| 494 | $msg->set_send_to_list( $stlts ); | ||
| 495 | $msg->set_already_tried_list( $atlt ); | ||
| 496 | $msg->set_responder_note( $rn ); | ||
| 497 | |||
| 498 | |||
| 499 | |||
| 500 | #$msg->write("msg_04.answer.ber"); | ||
| 501 | $msgs{"04.answer"} = $msg; | ||
| 502 | |||
| 503 | |||
| 504 | |||
| 505 | |||
| 506 | |||
| 507 | |||
| 508 | #======================================================================================== | ||
| 509 | |||
| 510 | |||
| 511 | use Biblio::ILL::ISO::ConditionalReply; | ||
| 512 | |||
| 513 | # | ||
| 514 | # transaction-id | ||
| 515 | # | ||
| 516 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 517 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 518 | |||
| 519 | # | ||
| 520 | # service-date-time | ||
| 521 | # | ||
| 522 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 523 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 524 | ); | ||
| 525 | |||
| 526 | # | ||
| 527 | # requester-id | ||
| 528 | # | ||
| 529 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 530 | $reqid->set_person_name("David A. Christensen"); | ||
| 531 | |||
| 532 | # | ||
| 533 | # responder-id | ||
| 534 | # | ||
| 535 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 536 | |||
| 537 | # | ||
| 538 | # responder-note | ||
| 539 | # | ||
| 540 | my $rn = new Biblio::ILL::ISO::ILLString("This is a responder-note."); | ||
| 541 | |||
| 542 | |||
| 543 | #------------------------------------------------------------------------------------------- | ||
| 544 | |||
| 545 | $msg = new Biblio::ILL::ISO::ConditionalReply(); | ||
| 546 | |||
| 547 | # Minimum required: | ||
| 548 | $msg->set_protocol_version_num("version-2"); | ||
| 549 | $msg->set_transaction_id( $tid ); | ||
| 550 | $msg->set_service_date_time( $sdt ); | ||
| 551 | $msg->set_answer("true"); | ||
| 552 | |||
| 553 | # Extra, useful info: | ||
| 554 | $msg->set_requester_id( $reqid ); | ||
| 555 | $msg->set_responder_id( $resid ); | ||
| 556 | $msg->set_requester_note( $rn ); | ||
| 557 | |||
| 558 | |||
| 559 | |||
| 560 | #$msg->write("msg_05.conditional-reply.ber"); | ||
| 561 | $msgs{"05.conditional-reply"} = $msg; | ||
| 562 | |||
| 563 | |||
| 564 | |||
| 565 | |||
| 566 | |||
| 567 | |||
| 568 | #======================================================================================== | ||
| 569 | |||
| 570 | |||
| 571 | use Biblio::ILL::ISO::Cancel; | ||
| 572 | |||
| 573 | # | ||
| 574 | # transaction-id | ||
| 575 | # | ||
| 576 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 577 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 578 | |||
| 579 | # | ||
| 580 | # service-date-time | ||
| 581 | # | ||
| 582 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 583 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 584 | ); | ||
| 585 | |||
| 586 | # | ||
| 587 | # requester-id | ||
| 588 | # | ||
| 589 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 590 | $reqid->set_person_name("David A. Christensen"); | ||
| 591 | |||
| 592 | # | ||
| 593 | # responder-id | ||
| 594 | # | ||
| 595 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 596 | |||
| 597 | # | ||
| 598 | # requester-note | ||
| 599 | # | ||
| 600 | my $rn = new Biblio::ILL::ISO::ILLString("This is a requester-note."); | ||
| 601 | |||
| 602 | |||
| 603 | #------------------------------------------------------------------------------------------- | ||
| 604 | |||
| 605 | $msg = new Biblio::ILL::ISO::Cancel(); | ||
| 606 | |||
| 607 | # Minimum required: | ||
| 608 | $msg->set_protocol_version_num("version-2"); | ||
| 609 | $msg->set_transaction_id( $tid ); | ||
| 610 | $msg->set_service_date_time( $sdt ); | ||
| 611 | |||
| 612 | # Extra, useful info: | ||
| 613 | $msg->set_requester_id( $reqid ); | ||
| 614 | $msg->set_responder_id( $resid ); | ||
| 615 | $msg->set_requester_note( $rn ); | ||
| 616 | |||
| 617 | |||
| 618 | |||
| 619 | #$msg->write("msg_06.cancel.ber"); | ||
| 620 | $msgs{"06.cancel"} = $msg; | ||
| 621 | |||
| 622 | |||
| 623 | |||
| 624 | |||
| 625 | |||
| 626 | |||
| 627 | #======================================================================================== | ||
| 628 | |||
| 629 | |||
| 630 | use Biblio::ILL::ISO::CancelReply; | ||
| 631 | |||
| 632 | # | ||
| 633 | # transaction-id | ||
| 634 | # | ||
| 635 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 636 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 637 | |||
| 638 | # | ||
| 639 | # service-date-time | ||
| 640 | # | ||
| 641 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 642 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 643 | ); | ||
| 644 | |||
| 645 | # | ||
| 646 | # requester-id | ||
| 647 | # | ||
| 648 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 649 | $reqid->set_person_name("David A. Christensen"); | ||
| 650 | |||
| 651 | # | ||
| 652 | # responder-id | ||
| 653 | # | ||
| 654 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 655 | |||
| 656 | # | ||
| 657 | # responder-note | ||
| 658 | # | ||
| 659 | my $rn = new Biblio::ILL::ISO::ILLString("This is a responder-note."); | ||
| 660 | |||
| 661 | |||
| 662 | #------------------------------------------------------------------------------------------- | ||
| 663 | |||
| 664 | $msg = new Biblio::ILL::ISO::CancelReply(); | ||
| 665 | |||
| 666 | # Minimum required: | ||
| 667 | $msg->set_protocol_version_num("version-2"); | ||
| 668 | $msg->set_transaction_id( $tid ); | ||
| 669 | $msg->set_service_date_time( $sdt ); | ||
| 670 | $msg->set_answer("true"); | ||
| 671 | |||
| 672 | # Extra, useful info: | ||
| 673 | $msg->set_requester_id( $reqid ); | ||
| 674 | $msg->set_responder_id( $resid ); | ||
| 675 | $msg->set_responder_note( $rn ); | ||
| 676 | |||
| 677 | |||
| 678 | |||
| 679 | #$msg->write("msg_07.cancel-reply.ber"); | ||
| 680 | $msgs{"07.cancel-reply"} = $msg; | ||
| 681 | |||
| 682 | |||
| 683 | |||
| 684 | |||
| 685 | |||
| 686 | |||
| 687 | #======================================================================================== | ||
| 688 | |||
| 689 | |||
| 690 | use Biblio::ILL::ISO::Received; | ||
| 691 | |||
| 692 | # | ||
| 693 | # transaction-id | ||
| 694 | # | ||
| 695 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 696 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 697 | |||
| 698 | # | ||
| 699 | # service-date-time | ||
| 700 | # | ||
| 701 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 702 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 703 | ); | ||
| 704 | |||
| 705 | # | ||
| 706 | # requester-id | ||
| 707 | # | ||
| 708 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 709 | $reqid->set_person_name("David A. Christensen"); | ||
| 710 | |||
| 711 | # | ||
| 712 | # responder-id | ||
| 713 | # | ||
| 714 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 715 | |||
| 716 | # | ||
| 717 | # supplier-id | ||
| 718 | # | ||
| 719 | my $sid = new Biblio::ILL::ISO::SystemId("MBOM"); | ||
| 720 | |||
| 721 | # | ||
| 722 | # date-received | ||
| 723 | # | ||
| 724 | my $dr = new Biblio::ILL::ISO::ISODate("20030813"); | ||
| 725 | |||
| 726 | # | ||
| 727 | # shipped-service-type | ||
| 728 | # | ||
| 729 | my $sst = new Biblio::ILL::ISO::ShippedServiceType("loan"); | ||
| 730 | |||
| 731 | # | ||
| 732 | # requester-note | ||
| 733 | # | ||
| 734 | my $rn = new Biblio::ILL::ISO::ILLString("This is a requester-note."); | ||
| 735 | |||
| 736 | |||
| 737 | #------------------------------------------------------------------------------------------- | ||
| 738 | |||
| 739 | $msg = new Biblio::ILL::ISO::Received(); | ||
| 740 | |||
| 741 | # Minimum required: | ||
| 742 | $msg->set_protocol_version_num("version-2"); | ||
| 743 | $msg->set_transaction_id( $tid ); | ||
| 744 | $msg->set_service_date_time( $sdt ); | ||
| 745 | $msg->set_date_received( $dr ); | ||
| 746 | $msg->set_shipped_service_type( $sst ); | ||
| 747 | |||
| 748 | # Extra, useful info: | ||
| 749 | $msg->set_requester_id( $reqid ); | ||
| 750 | $msg->set_responder_id( $resid ); | ||
| 751 | $msg->set_supplier_id( $sid ); | ||
| 752 | $msg->set_requester_note( $rn ); | ||
| 753 | |||
| 754 | |||
| 755 | |||
| 756 | #$msg->write("msg_08.received.ber"); | ||
| 757 | $msgs{"08.received"} = $msg; | ||
| 758 | |||
| 759 | |||
| 760 | |||
| 761 | |||
| 762 | |||
| 763 | |||
| 764 | #======================================================================================== | ||
| 765 | |||
| 766 | |||
| 767 | use Biblio::ILL::ISO::Recall; | ||
| 768 | |||
| 769 | # | ||
| 770 | # transaction-id | ||
| 771 | # | ||
| 772 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 773 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 774 | |||
| 775 | # | ||
| 776 | # service-date-time | ||
| 777 | # | ||
| 778 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 779 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 780 | ); | ||
| 781 | |||
| 782 | # | ||
| 783 | # requester-id | ||
| 784 | # | ||
| 785 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 786 | $reqid->set_person_name("David A. Christensen"); | ||
| 787 | |||
| 788 | # | ||
| 789 | # responder-id | ||
| 790 | # | ||
| 791 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 792 | |||
| 793 | # | ||
| 794 | # responder-note | ||
| 795 | # | ||
| 796 | my $rn = new Biblio::ILL::ISO::ILLString("This is a responder-note."); | ||
| 797 | |||
| 798 | |||
| 799 | #------------------------------------------------------------------------------------------- | ||
| 800 | |||
| 801 | $msg = new Biblio::ILL::ISO::Recall(); | ||
| 802 | |||
| 803 | # Minimum required: | ||
| 804 | $msg->set_protocol_version_num("version-2"); | ||
| 805 | $msg->set_transaction_id( $tid ); | ||
| 806 | $msg->set_service_date_time( $sdt ); | ||
| 807 | |||
| 808 | # Extra, useful info: | ||
| 809 | $msg->set_requester_id( $reqid ); | ||
| 810 | $msg->set_responder_id( $resid ); | ||
| 811 | $msg->set_responder_note( $rn ); | ||
| 812 | |||
| 813 | |||
| 814 | |||
| 815 | #$msg->write("msg_09.recall.ber"); | ||
| 816 | $msgs{"09.recall"} = $msg; | ||
| 817 | |||
| 818 | |||
| 819 | |||
| 820 | |||
| 821 | |||
| 822 | |||
| 823 | #======================================================================================== | ||
| 824 | |||
| 825 | |||
| 826 | use Biblio::ILL::ISO::Returned; | ||
| 827 | |||
| 828 | # | ||
| 829 | # transaction-id | ||
| 830 | # | ||
| 831 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 832 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 833 | |||
| 834 | # | ||
| 835 | # service-date-time | ||
| 836 | # | ||
| 837 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 838 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 839 | ); | ||
| 840 | |||
| 841 | # | ||
| 842 | # requester-id | ||
| 843 | # | ||
| 844 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 845 | $reqid->set_person_name("David A. Christensen"); | ||
| 846 | |||
| 847 | # | ||
| 848 | # responder-id | ||
| 849 | # | ||
| 850 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 851 | |||
| 852 | # | ||
| 853 | # date-returned | ||
| 854 | # | ||
| 855 | my $dr = new Biblio::ILL::ISO::ISODate("20030814"); | ||
| 856 | |||
| 857 | # | ||
| 858 | # returned-via | ||
| 859 | # | ||
| 860 | my $rv = new Biblio::ILL::ISO::TransportationMode("Canada Post"); | ||
| 861 | |||
| 862 | # | ||
| 863 | # insured-for | ||
| 864 | # | ||
| 865 | my $ins = new Biblio::ILL::ISO::Amount("123.45"); | ||
| 866 | |||
| 867 | # | ||
| 868 | # requester-note | ||
| 869 | # | ||
| 870 | my $rn = new Biblio::ILL::ISO::ILLString("This is a requester-note."); | ||
| 871 | |||
| 872 | |||
| 873 | #------------------------------------------------------------------------------------------- | ||
| 874 | |||
| 875 | $msg = new Biblio::ILL::ISO::Returned(); | ||
| 876 | |||
| 877 | # Minimum required: | ||
| 878 | $msg->set_protocol_version_num("version-2"); | ||
| 879 | $msg->set_transaction_id( $tid ); | ||
| 880 | $msg->set_service_date_time( $sdt ); | ||
| 881 | $msg->set_date_returned( $dr ); | ||
| 882 | |||
| 883 | # Extra, useful info: | ||
| 884 | $msg->set_requester_id( $reqid ); | ||
| 885 | $msg->set_requester_id( $resid ); | ||
| 886 | $msg->set_returned_via( $rv ); | ||
| 887 | $msg->set_insured_for( $ins ); | ||
| 888 | $msg->set_requester_note( $rn ); | ||
| 889 | |||
| 890 | |||
| 891 | #$msg->write("msg_10.returned.ber"); | ||
| 892 | $msgs{"10.returned"} = $msg; | ||
| 893 | |||
| 894 | |||
| 895 | |||
| 896 | |||
| 897 | |||
| 898 | |||
| 899 | #======================================================================================== | ||
| 900 | |||
| 901 | |||
| 902 | use Biblio::ILL::ISO::CheckedIn; | ||
| 903 | |||
| 904 | # | ||
| 905 | # transaction-id | ||
| 906 | # | ||
| 907 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 908 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 909 | |||
| 910 | # | ||
| 911 | # service-date-time | ||
| 912 | # | ||
| 913 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 914 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 915 | ); | ||
| 916 | |||
| 917 | # | ||
| 918 | # requester-id | ||
| 919 | # | ||
| 920 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 921 | $reqid->set_person_name("David A. Christensen"); | ||
| 922 | |||
| 923 | # | ||
| 924 | # responder-id | ||
| 925 | # | ||
| 926 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 927 | |||
| 928 | # | ||
| 929 | # date-checked-in | ||
| 930 | # | ||
| 931 | my $dci = new Biblio::ILL::ISO::ISODate("20030814"); | ||
| 932 | |||
| 933 | # | ||
| 934 | # responder-note | ||
| 935 | # | ||
| 936 | my $rn = new Biblio::ILL::ISO::ILLString("This is a responder-note."); | ||
| 937 | |||
| 938 | |||
| 939 | #------------------------------------------------------------------------------------------- | ||
| 940 | |||
| 941 | $msg = new Biblio::ILL::ISO::CheckedIn(); | ||
| 942 | |||
| 943 | # Minimum required: | ||
| 944 | $msg->set_protocol_version_num("version-2"); | ||
| 945 | $msg->set_transaction_id( $tid ); | ||
| 946 | $msg->set_service_date_time( $sdt ); | ||
| 947 | $msg->set_date_checked_in( $dci ); | ||
| 948 | |||
| 949 | # Extra, useful info: | ||
| 950 | $msg->set_requester_id( $reqid ); | ||
| 951 | $msg->set_responder_id( $resid ); | ||
| 952 | $msg->set_responder_note( $rn ); | ||
| 953 | |||
| 954 | |||
| 955 | |||
| 956 | #$msg->write("msg_11.checked-in.ber"); | ||
| 957 | $msgs{"11.checked-in"} = $msg; | ||
| 958 | |||
| 959 | |||
| 960 | |||
| 961 | |||
| 962 | |||
| 963 | |||
| 964 | #======================================================================================== | ||
| 965 | |||
| 966 | |||
| 967 | use Biblio::ILL::ISO::Overdue; | ||
| 968 | |||
| 969 | # | ||
| 970 | # transaction-id | ||
| 971 | # | ||
| 972 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 973 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 974 | |||
| 975 | # | ||
| 976 | # service-date-time | ||
| 977 | # | ||
| 978 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 979 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 980 | ); | ||
| 981 | |||
| 982 | # | ||
| 983 | # requester-id | ||
| 984 | # | ||
| 985 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 986 | $reqid->set_person_name("David A. Christensen"); | ||
| 987 | |||
| 988 | # | ||
| 989 | # responder-id | ||
| 990 | # | ||
| 991 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 992 | |||
| 993 | # | ||
| 994 | # date-due | ||
| 995 | # | ||
| 996 | my $dd = new Biblio::ILL::ISO::DateDue("20030814","false"); | ||
| 997 | |||
| 998 | # | ||
| 999 | # responder-note | ||
| 1000 | # | ||
| 1001 | my $rn = new Biblio::ILL::ISO::ILLString("This is a responder-note."); | ||
| 1002 | |||
| 1003 | |||
| 1004 | #------------------------------------------------------------------------------------------- | ||
| 1005 | |||
| 1006 | $msg = new Biblio::ILL::ISO::Overdue(); | ||
| 1007 | |||
| 1008 | # Minimum required: | ||
| 1009 | $msg->set_protocol_version_num("version-2"); | ||
| 1010 | $msg->set_transaction_id( $tid ); | ||
| 1011 | $msg->set_service_date_time( $sdt ); | ||
| 1012 | $msg->set_date_due( $dd ); | ||
| 1013 | |||
| 1014 | # Extra, useful info: | ||
| 1015 | $msg->set_requester_id( $reqid ); | ||
| 1016 | $msg->set_responder_id( $resid ); | ||
| 1017 | $msg->set_responder_note( $rn ); | ||
| 1018 | |||
| 1019 | |||
| 1020 | |||
| 1021 | #$msg->write("msg_12.overdue.ber"); | ||
| 1022 | $msgs{"12.overdue"} = $msg; | ||
| 1023 | |||
| 1024 | |||
| 1025 | |||
| 1026 | |||
| 1027 | |||
| 1028 | |||
| 1029 | #======================================================================================== | ||
| 1030 | |||
| 1031 | |||
| 1032 | use Biblio::ILL::ISO::Renew; | ||
| 1033 | |||
| 1034 | # | ||
| 1035 | # transaction-id | ||
| 1036 | # | ||
| 1037 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 1038 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 1039 | |||
| 1040 | # | ||
| 1041 | # service-date-time | ||
| 1042 | # | ||
| 1043 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 1044 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 1045 | ); | ||
| 1046 | |||
| 1047 | # | ||
| 1048 | # requester-id | ||
| 1049 | # | ||
| 1050 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 1051 | $reqid->set_person_name("David A. Christensen"); | ||
| 1052 | |||
| 1053 | # | ||
| 1054 | # responder-id | ||
| 1055 | # | ||
| 1056 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 1057 | |||
| 1058 | # | ||
| 1059 | # desired-due-date | ||
| 1060 | # | ||
| 1061 | my $ddd = new Biblio::ILL::ISO::ISODate("20030814"); | ||
| 1062 | |||
| 1063 | # | ||
| 1064 | # requester-note | ||
| 1065 | # | ||
| 1066 | my $rn = new Biblio::ILL::ISO::ILLString("This is a requester-note."); | ||
| 1067 | |||
| 1068 | |||
| 1069 | #------------------------------------------------------------------------------------------- | ||
| 1070 | |||
| 1071 | $msg = new Biblio::ILL::ISO::Renew(); | ||
| 1072 | |||
| 1073 | # Minimum required: | ||
| 1074 | $msg->set_protocol_version_num("version-2"); | ||
| 1075 | $msg->set_transaction_id( $tid ); | ||
| 1076 | $msg->set_service_date_time( $sdt ); | ||
| 1077 | |||
| 1078 | # Extra, useful info: | ||
| 1079 | $msg->set_requester_id( $reqid ); | ||
| 1080 | $msg->set_requester_id( $resid ); | ||
| 1081 | $msg->set_desired_due_date( $ddd ); | ||
| 1082 | $msg->set_requester_note( $rn ); | ||
| 1083 | |||
| 1084 | |||
| 1085 | |||
| 1086 | #$msg->write("msg_13.renew.ber"); | ||
| 1087 | $msgs{"13.renew"} = $msg; | ||
| 1088 | |||
| 1089 | |||
| 1090 | |||
| 1091 | |||
| 1092 | |||
| 1093 | |||
| 1094 | #======================================================================================== | ||
| 1095 | |||
| 1096 | |||
| 1097 | use Biblio::ILL::ISO::RenewAnswer; | ||
| 1098 | |||
| 1099 | # | ||
| 1100 | # transaction-id | ||
| 1101 | # | ||
| 1102 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 1103 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 1104 | |||
| 1105 | # | ||
| 1106 | # service-date-time | ||
| 1107 | # | ||
| 1108 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 1109 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 1110 | ); | ||
| 1111 | |||
| 1112 | # | ||
| 1113 | # requester-id | ||
| 1114 | # | ||
| 1115 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 1116 | $reqid->set_person_name("David A. Christensen"); | ||
| 1117 | |||
| 1118 | # | ||
| 1119 | # responder-id | ||
| 1120 | # | ||
| 1121 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 1122 | |||
| 1123 | # | ||
| 1124 | # date-due | ||
| 1125 | # | ||
| 1126 | my $dd = new Biblio::ILL::ISO::DateDue("20030814","true"); | ||
| 1127 | |||
| 1128 | # | ||
| 1129 | # responder-note | ||
| 1130 | # | ||
| 1131 | my $rn = new Biblio::ILL::ISO::ILLString("This is a responder-note."); | ||
| 1132 | |||
| 1133 | |||
| 1134 | #------------------------------------------------------------------------------------------- | ||
| 1135 | |||
| 1136 | $msg = new Biblio::ILL::ISO::RenewAnswer(); | ||
| 1137 | |||
| 1138 | # Minimum required: | ||
| 1139 | $msg->set_protocol_version_num("version-2"); | ||
| 1140 | $msg->set_transaction_id( $tid ); | ||
| 1141 | $msg->set_service_date_time( $sdt ); | ||
| 1142 | $msg->set_answer("true"); | ||
| 1143 | |||
| 1144 | # Extra, useful info: | ||
| 1145 | $msg->set_responder_id( $reqid ); | ||
| 1146 | $msg->set_responder_id( $resid ); | ||
| 1147 | $msg->set_date_due( $dd ); | ||
| 1148 | $msg->set_responder_note( $rn ); | ||
| 1149 | |||
| 1150 | |||
| 1151 | |||
| 1152 | #$msg->write("msg_14.renew-answer.ber"); | ||
| 1153 | $msgs{"14.renew-answer"} = $msg; | ||
| 1154 | |||
| 1155 | |||
| 1156 | |||
| 1157 | |||
| 1158 | |||
| 1159 | |||
| 1160 | #======================================================================================== | ||
| 1161 | |||
| 1162 | |||
| 1163 | use Biblio::ILL::ISO::Lost; | ||
| 1164 | |||
| 1165 | # | ||
| 1166 | # transaction-id | ||
| 1167 | # | ||
| 1168 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 1169 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 1170 | |||
| 1171 | # | ||
| 1172 | # service-date-time | ||
| 1173 | # | ||
| 1174 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 1175 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 1176 | ); | ||
| 1177 | |||
| 1178 | # | ||
| 1179 | # requester-id | ||
| 1180 | # | ||
| 1181 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 1182 | $reqid->set_person_name("David A. Christensen"); | ||
| 1183 | |||
| 1184 | # | ||
| 1185 | # responder-id | ||
| 1186 | # | ||
| 1187 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 1188 | |||
| 1189 | |||
| 1190 | #------------------------------------------------------------------------------------------- | ||
| 1191 | |||
| 1192 | $msg = new Biblio::ILL::ISO::Lost(); | ||
| 1193 | |||
| 1194 | # Minimum required: | ||
| 1195 | $msg->set_protocol_version_num("version-2"); | ||
| 1196 | $msg->set_transaction_id( $tid ); | ||
| 1197 | $msg->set_service_date_time( $sdt ); | ||
| 1198 | |||
| 1199 | # Extra, useful info: | ||
| 1200 | $msg->set_requester_id( $reqid ); | ||
| 1201 | $msg->set_responder_id( $resid ); | ||
| 1202 | $msg->set_note("This is a note."); | ||
| 1203 | |||
| 1204 | |||
| 1205 | |||
| 1206 | #$msg->write("msg_15.lost.ber"); | ||
| 1207 | $msgs{"15.lost"} = $msg; | ||
| 1208 | |||
| 1209 | |||
| 1210 | |||
| 1211 | |||
| 1212 | |||
| 1213 | |||
| 1214 | #======================================================================================== | ||
| 1215 | |||
| 1216 | |||
| 1217 | use Biblio::ILL::ISO::Damaged; | ||
| 1218 | |||
| 1219 | # | ||
| 1220 | # transaction-id | ||
| 1221 | # | ||
| 1222 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 1223 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 1224 | |||
| 1225 | # | ||
| 1226 | # service-date-time | ||
| 1227 | # | ||
| 1228 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 1229 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 1230 | ); | ||
| 1231 | |||
| 1232 | # | ||
| 1233 | # requester-id | ||
| 1234 | # | ||
| 1235 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 1236 | $reqid->set_person_name("David A. Christensen"); | ||
| 1237 | |||
| 1238 | # | ||
| 1239 | # responder-id | ||
| 1240 | # | ||
| 1241 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 1242 | |||
| 1243 | # | ||
| 1244 | # damaged-details | ||
| 1245 | # | ||
| 1246 | # Unsupported. (At least, it is until I figure out the whole 'extensions' thing). | ||
| 1247 | |||
| 1248 | |||
| 1249 | |||
| 1250 | #------------------------------------------------------------------------------------------- | ||
| 1251 | |||
| 1252 | $msg = new Biblio::ILL::ISO::Damaged(); | ||
| 1253 | |||
| 1254 | # Minimum required: | ||
| 1255 | $msg->set_protocol_version_num("version-2"); | ||
| 1256 | $msg->set_transaction_id( $tid ); | ||
| 1257 | $msg->set_service_date_time( $sdt ); | ||
| 1258 | |||
| 1259 | # Extra, useful info: | ||
| 1260 | $msg->set_requester_id( $reqid ); | ||
| 1261 | $msg->set_responder_id( $resid ); | ||
| 1262 | $msg->set_note("This is a note."); | ||
| 1263 | |||
| 1264 | |||
| 1265 | |||
| 1266 | #$msg->write("msg_16.damaged.ber"); | ||
| 1267 | $msgs{"16.damaged"} = $msg; | ||
| 1268 | |||
| 1269 | |||
| 1270 | |||
| 1271 | |||
| 1272 | |||
| 1273 | |||
| 1274 | #======================================================================================== | ||
| 1275 | |||
| 1276 | |||
| 1277 | use Biblio::ILL::ISO::Message; | ||
| 1278 | |||
| 1279 | # | ||
| 1280 | # transaction-id | ||
| 1281 | # | ||
| 1282 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 1283 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 1284 | |||
| 1285 | # | ||
| 1286 | # service-date-time | ||
| 1287 | # | ||
| 1288 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 1289 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 1290 | ); | ||
| 1291 | |||
| 1292 | # | ||
| 1293 | # requester-id | ||
| 1294 | # | ||
| 1295 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 1296 | $reqid->set_person_name("David A. Christensen"); | ||
| 1297 | |||
| 1298 | # | ||
| 1299 | # responder-id | ||
| 1300 | # | ||
| 1301 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 1302 | |||
| 1303 | # | ||
| 1304 | # note | ||
| 1305 | # | ||
| 1306 | my $note = new Biblio::ILL::ISO::ILLString("This is a note."); | ||
| 1307 | |||
| 1308 | |||
| 1309 | |||
| 1310 | #------------------------------------------------------------------------------------------- | ||
| 1311 | |||
| 1312 | $msg = new Biblio::ILL::ISO::Message(); | ||
| 1313 | |||
| 1314 | # Minimum required: | ||
| 1315 | $msg->set_protocol_version_num("version-2"); | ||
| 1316 | $msg->set_transaction_id( $tid ); | ||
| 1317 | $msg->set_service_date_time( $sdt ); | ||
| 1318 | $msg->set_note( $note ); | ||
| 1319 | |||
| 1320 | # Extra, useful info: | ||
| 1321 | $msg->set_requester_id( $reqid ); | ||
| 1322 | $msg->set_responder_id( $resid ); | ||
| 1323 | |||
| 1324 | |||
| 1325 | |||
| 1326 | #$msg->write("msg_17.message.ber"); | ||
| 1327 | $msgs{"17.message"} = $msg; | ||
| 1328 | |||
| 1329 | |||
| 1330 | |||
| 1331 | |||
| 1332 | |||
| 1333 | |||
| 1334 | #======================================================================================== | ||
| 1335 | |||
| 1336 | |||
| 1337 | use Biblio::ILL::ISO::StatusQuery; | ||
| 1338 | |||
| 1339 | # | ||
| 1340 | # transaction-id | ||
| 1341 | # | ||
| 1342 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 1343 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 1344 | |||
| 1345 | # | ||
| 1346 | # service-date-time | ||
| 1347 | # | ||
| 1348 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 1349 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 1350 | ); | ||
| 1351 | |||
| 1352 | # | ||
| 1353 | # requester-id | ||
| 1354 | # | ||
| 1355 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 1356 | $reqid->set_person_name("David A. Christensen"); | ||
| 1357 | |||
| 1358 | # | ||
| 1359 | # responder-id | ||
| 1360 | # | ||
| 1361 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 1362 | |||
| 1363 | # | ||
| 1364 | # note | ||
| 1365 | # | ||
| 1366 | my $note = new Biblio::ILL::ISO::ILLString("This is a note."); | ||
| 1367 | |||
| 1368 | |||
| 1369 | |||
| 1370 | #------------------------------------------------------------------------------------------- | ||
| 1371 | |||
| 1372 | $msg = new Biblio::ILL::ISO::StatusQuery(); | ||
| 1373 | |||
| 1374 | # Minimum required: | ||
| 1375 | $msg->set_protocol_version_num("version-2"); | ||
| 1376 | $msg->set_transaction_id( $tid ); | ||
| 1377 | $msg->set_service_date_time( $sdt ); | ||
| 1378 | |||
| 1379 | # Extra, useful info: | ||
| 1380 | $msg->set_requester_id( $reqid ); | ||
| 1381 | $msg->set_responder_id( $resid ); | ||
| 1382 | $msg->set_note( $note ); | ||
| 1383 | |||
| 1384 | |||
| 1385 | |||
| 1386 | #$msg->write("msg_18.status-query.ber"); | ||
| 1387 | $msgs{"18.status-query"} = $msg; | ||
| 1388 | |||
| 1389 | |||
| 1390 | |||
| 1391 | |||
| 1392 | |||
| 1393 | |||
| 1394 | #======================================================================================== | ||
| 1395 | |||
| 1396 | |||
| 1397 | use Biblio::ILL::ISO::StatusOrErrorReport; | ||
| 1398 | |||
| 1399 | # | ||
| 1400 | # transaction-id | ||
| 1401 | # | ||
| 1402 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 1403 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 1404 | |||
| 1405 | # | ||
| 1406 | # service-date-time | ||
| 1407 | # | ||
| 1408 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 1409 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 1410 | ); | ||
| 1411 | |||
| 1412 | # | ||
| 1413 | # requester-id | ||
| 1414 | # | ||
| 1415 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 1416 | $reqid->set_person_name("David A. Christensen"); | ||
| 1417 | |||
| 1418 | # | ||
| 1419 | # responder-id | ||
| 1420 | # | ||
| 1421 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 1422 | |||
| 1423 | # | ||
| 1424 | # status-report | ||
| 1425 | # | ||
| 1426 | my $cs = new Biblio::ILL::ISO::CurrentState("sHIPPED"); | ||
| 1427 | my $hr = new Biblio::ILL::ISO::HistoryReport("20030811", | ||
| 1428 | "fORWARD", | ||
| 1429 | "20030813", | ||
| 1430 | new Biblio::ILL::ISO::SystemId("MBOM"), | ||
| 1431 | "20030815", | ||
| 1432 | "Anne Author", | ||
| 1433 | "A Title", | ||
| 1434 | "", | ||
| 1435 | "", | ||
| 1436 | "loan", | ||
| 1437 | new Biblio::ILL::ISO::TransactionResults("will-supply"), | ||
| 1438 | "This is a history report." | ||
| 1439 | ); | ||
| 1440 | my $sr = new Biblio::ILL::ISO::StatusReport($hr, $cs); | ||
| 1441 | |||
| 1442 | |||
| 1443 | # | ||
| 1444 | # note | ||
| 1445 | # | ||
| 1446 | my $note = new Biblio::ILL::ISO::ILLString("This is a note."); | ||
| 1447 | |||
| 1448 | |||
| 1449 | |||
| 1450 | #------------------------------------------------------------------------------------------- | ||
| 1451 | |||
| 1452 | $msg = new Biblio::ILL::ISO::StatusOrErrorReport(); | ||
| 1453 | |||
| 1454 | # Minimum required: | ||
| 1455 | $msg->set_protocol_version_num("version-2"); | ||
| 1456 | $msg->set_transaction_id( $tid ); | ||
| 1457 | $msg->set_service_date_time( $sdt ); | ||
| 1458 | $msg->set_status_report( $sr ); | ||
| 1459 | |||
| 1460 | # Extra, useful info: | ||
| 1461 | $msg->set_requester_id( $reqid ); | ||
| 1462 | $msg->set_responder_id( $resid ); | ||
| 1463 | $msg->set_note( $note ); | ||
| 1464 | |||
| 1465 | |||
| 1466 | |||
| 1467 | #$msg->write("msg_19.status-or-error-report.ber"); | ||
| 1468 | $msgs{"19.status-or-error-report"} = $msg; | ||
| 1469 | |||
| 1470 | |||
| 1471 | |||
| 1472 | |||
| 1473 | |||
| 1474 | |||
| 1475 | #======================================================================================== | ||
| 1476 | |||
| 1477 | |||
| 1478 | use Biblio::ILL::ISO::Expired; | ||
| 1479 | |||
| 1480 | # | ||
| 1481 | # transaction-id | ||
| 1482 | # | ||
| 1483 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 1484 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 1485 | |||
| 1486 | # | ||
| 1487 | # service-date-time | ||
| 1488 | # | ||
| 1489 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 1490 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 1491 | ); | ||
| 1492 | |||
| 1493 | # | ||
| 1494 | # requester-id | ||
| 1495 | # | ||
| 1496 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 1497 | $reqid->set_person_name("David A. Christensen"); | ||
| 1498 | |||
| 1499 | # | ||
| 1500 | # responder-id | ||
| 1501 | # | ||
| 1502 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 1503 | |||
| 1504 | |||
| 1505 | |||
| 1506 | #------------------------------------------------------------------------------------------- | ||
| 1507 | |||
| 1508 | $msg = new Biblio::ILL::ISO::Expired(); | ||
| 1509 | |||
| 1510 | # Minimum required: | ||
| 1511 | $msg->set_protocol_version_num("version-2"); | ||
| 1512 | $msg->set_transaction_id( $tid ); | ||
| 1513 | $msg->set_service_date_time( $sdt ); | ||
| 1514 | |||
| 1515 | # Extra, useful info: | ||
| 1516 | $msg->set_requester_id( $reqid ); | ||
| 1517 | $msg->set_responder_id( $resid ); | ||
| 1518 | |||
| 1519 | |||
| 1520 | #$msg->write("msg_20.expired.ber"); | ||
| 1521 | $msgs{"20.expired"} = $msg; | ||
| 1522 | |||
| 1523 | |||
| 1524 | #======================================================================================== | ||
| 1525 | #======================================================================================== | ||
| 1526 | #======================================================================================== | ||
| 1527 | |||
| 1528 | my %tester = (); | ||
| 1529 | $tester{"01.request"} = new Biblio::ILL::ISO::Request; | ||
| 1530 | $tester{"02.forward-notification"} = new Biblio::ILL::ISO::ForwardNotification; | ||
| 1531 | $tester{"03.shipped"} = new Biblio::ILL::ISO::Shipped; | ||
| 1532 | $tester{"04.answer"} = new Biblio::ILL::ISO::Answer; | ||
| 1533 | $tester{"05.conditional-reply"} = new Biblio::ILL::ISO::ConditionalReply; | ||
| 1534 | $tester{"06.cancel"} = new Biblio::ILL::ISO::Cancel; | ||
| 1535 | $tester{"07.cancel-reply"} = new Biblio::ILL::ISO::CancelReply; | ||
| 1536 | $tester{"08.received"} = new Biblio::ILL::ISO::Received; | ||
| 1537 | $tester{"09.recall"} = new Biblio::ILL::ISO::Recall; | ||
| 1538 | $tester{"10.returned"} = new Biblio::ILL::ISO::Returned; | ||
| 1539 | $tester{"11.checked-in"} = new Biblio::ILL::ISO::CheckedIn; | ||
| 1540 | $tester{"12.overdue"} = new Biblio::ILL::ISO::Overdue; | ||
| 1541 | $tester{"13.renew"} = new Biblio::ILL::ISO::Renew; | ||
| 1542 | $tester{"14.renew-answer"} = new Biblio::ILL::ISO::RenewAnswer; | ||
| 1543 | $tester{"15.lost"} = new Biblio::ILL::ISO::Lost; | ||
| 1544 | $tester{"16.damaged"} = new Biblio::ILL::ISO::Damaged; | ||
| 1545 | $tester{"17.message"} = new Biblio::ILL::ISO::Message; | ||
| 1546 | $tester{"18.status-query"} = new Biblio::ILL::ISO::StatusQuery; | ||
| 1547 | $tester{"19.status-or-error-report"} = new Biblio::ILL::ISO::StatusOrErrorReport; | ||
| 1548 | $tester{"20.expired"} = new Biblio::ILL::ISO::Expired; | ||
| 1549 | |||
| 1550 | my $generate = "Build me some new test cases!"; | ||
| 1551 | |||
| 1552 | foreach $key (sort keys %tester) { | ||
| 1553 | if (defined $generate) { | ||
| 1554 | $msgs{$key}->write("t/msg_$key.ber"); | ||
| 1555 | } | ||
| 1556 | # $msgs{$key}->write("t/test.ber"); | ||
| 1557 | # | ||
| 1558 | # $/ = undef; | ||
| 1559 | # | ||
| 1560 | # open( IN, "t/test.ber"); | ||
| 1561 | # my $actual = <IN>; | ||
| 1562 | # close( IN ); | ||
| 1563 | # | ||
| 1564 | # open( IN, "t/msg_$key.ber"); | ||
| 1565 | # my $expected = <IN>; | ||
| 1566 | # close( IN ); | ||
| 1567 | # | ||
| 1568 | # is( $actual, $expected, "messages: $key"); | ||
| 1569 | } | ||
| 1570 | |||
| 1571 | |||
| 1572 |