| 1 | #!/usr/local/bin/perl | ||
| 2 | |||
| 3 | BEGIN{push @INC, "./../blib/lib/"} | ||
| 4 | |||
| 5 | use Biblio::ILL::ISO::ForwardNotification; | ||
| 6 | |||
| 7 | # | ||
| 8 | # transaction-id | ||
| 9 | # | ||
| 10 | my $tid = new Biblio::ILL::ISO::TransactionId("PLS","001","", | ||
| 11 | new Biblio::ILL::ISO::SystemId("MWPL")); | ||
| 12 | |||
| 13 | # | ||
| 14 | # service-date-time | ||
| 15 | # | ||
| 16 | my $sdt = new Biblio::ILL::ISO::ServiceDateTime( new Biblio::ILL::ISO::DateTime("20030623","114400"), | ||
| 17 | new Biblio::ILL::ISO::DateTime("20030623","114015") | ||
| 18 | ); | ||
| 19 | |||
| 20 | # | ||
| 21 | # requester-id | ||
| 22 | # | ||
| 23 | my $reqid = new Biblio::ILL::ISO::SystemId(); | ||
| 24 | $reqid->set_person_name("David A. Christensen"); | ||
| 25 | |||
| 26 | # | ||
| 27 | # responder-id | ||
| 28 | # | ||
| 29 | my $resid = new Biblio::ILL::ISO::SystemId("MWPL"); | ||
| 30 | |||
| 31 | # | ||
| 32 | # responder-address | ||
| 33 | # | ||
| 34 | my $rad = new Biblio::ILL::ISO::SystemAddress("SMTP","DChristensen\@westman.wave.ca"); | ||
| 35 | |||
| 36 | # | ||
| 37 | # intermediary-id | ||
| 38 | # | ||
| 39 | my $iid = new Biblio::ILL::ISO::SystemId(); | ||
| 40 | $iid->set_institution_name("The Great Library of Alexandria"); | ||
| 41 | |||
| 42 | # | ||
| 43 | # notification-note | ||
| 44 | # | ||
| 45 | my $nn = new Biblio::ILL::ISO::ILLString("This is a notification-note."); | ||
| 46 | |||
| 47 | |||
| 48 | #------------------------------------------------------------------------------------------- | ||
| 49 | |||
| 50 | my $msg = new Biblio::ILL::ISO::ForwardNotification(); | ||
| 51 | |||
| 52 | # Minimum required: | ||
| 53 | $msg->set_protocol_version_num("version-2"); | ||
| 54 | $msg->set_transaction_id( $tid ); | ||
| 55 | $msg->set_service_date_time( $sdt ); | ||
| 56 | |||
| 57 | # Extra, useful info: | ||
| 58 | $msg->set_requester_id( $reqid ); | ||
| 59 | $msg->set_responder_id( $resid ); | ||
| 60 | $msg->set_responder_address( $rad ); | ||
| 61 | $msg->set_intermediary_id( $iid ); | ||
| 62 | $msg->set_notification_note( $nn ); | ||
| 63 | |||
| 64 | # | ||
| 65 | #print "\n-as_pretty_string------------------------------------\n"; | ||
| 66 | #print $msg->as_pretty_string(); | ||
| 67 | #print "\n-----------------------------------------------------\n"; | ||
| 68 | # | ||
| 69 | #print "\n-debug(ans->as_asn())--------------------------------\n"; | ||
| 70 | #my $href = $msg->as_asn(); | ||
| 71 | #print $msg->debug($href); | ||
| 72 | #print "\n-----------------------------------------------------\n"; | ||
| 73 | # | ||
| 74 | #$msg->encode(); | ||
| 75 | # | ||
| 76 | |||
| 77 | #print "\n-write-----------------------------------------------\n"; | ||
| 78 | $msg->write("msg_02.forward-notification.ber"); | ||
| 79 | #print "\n-----------------------------------------------------\n"; | ||
| 80 | |||
| 81 | #print "---end---\n"; | ||
| 82 |