--- nsdl/lib/perl/Apache/NSDL/ToTheGateway.pm 2002/05/23 19:54:28 1.3 +++ nsdl/lib/perl/Apache/NSDL/ToTheGateway.pm 2002/05/30 17:07:38 1.5 @@ -38,15 +38,92 @@ package Apache::NSDL::ToTheGateway; # ================================================================ DEPENDENCIES use strict; # enforce handling of variables, references and subroutines use Apache::Constants qw(:common); +use Apache::GATEWAY::Common; +use Apache::NSDL::FromTheGateway; # ============================================================ MODULE VARIABLES -my $VERSION = sprintf("%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/); +my $VERSION = sprintf("%d.%02d", q$Revision: 1.5 $ =~ /(\d+)\.(\d+)/); # ================================================================= SUBROUTINES # ----------------------------- Handling routine called via Apache and mod_perl sub handler { my $r = shift; + Apache::GATEWAY::Common::readCGI($r); + my $output; + if ($ENV{'form.verb'} eq 'GetRecord') { + $output= + Apache::NSDL::FromTheGateway::view_LONCAPAgateway_metadata_record(\%ENV); + } + elsif ($ENV{'form.verb'} eq 'Identify') { + my $responseDate=Apache::GATEWAY::Common::responseDate(); + $output=(< + + $responseDate + http://nsdl.lon-capa.org/OAI-script?verb=Identify + The LearningOnline Network with CAPA + http://nsdl.lon-capa.org/OAI-script + 1.1 + mailto:korte@lite.msu.edu + + + oai + loncapa + : + oai:loncapa:harrison2002-1 + + + + + + http://nsdl.lon-capa.org/info/content.htm + + + Metadata can be used by authorized users + http://nsdl.lon-capa.org/metadata_use.htm + + + Full content, i.e. preprints may not be harvested by robots + + + http://nsdl.lon-capa.org/info/submission.htm + + + + +END + } + elsif ($ENV{'form.verb'} eq 'ListIdentifiers') { + $output='not yet implemented'; + } + elsif ($ENV{'form.verb'} eq 'ListMetadataFormats') { + $output='not yet implemented'; + } + elsif ($ENV{'form.verb'} eq 'ListRecords') { + $output='not yet implemented'; + } + elsif ($ENV{'form.verb'} eq 'ListSets') { + $output='not yet implemented'; + } + $output=~s/\>/\>/g; + $output=~s/\content_type('text/html'); $r->send_http_header; return(OK) if $r->header_only; @@ -54,7 +131,15 @@ sub handler { Test Output -Apache::NSDL::ToTheGateway +

Apache::NSDL::ToTheGateway

+

Input

+
+$cgi
+
+

Output

+
+$output
+
END @@ -69,14 +154,14 @@ sub answer_list_records_request { # ------------------------------------------------- NSDL->answer_search_request sub answer_search_request { -# Not yet implemented -# Need to specifically characterize INPUT arguments and OUTPUT data + my ($url)=@_; + return "will have http querying strategy against NSDL servers\n"; } # ---------------------------------------- NSDL->answer_metadata_record_request sub answer_metadata_record_request { -# Not yet implemented -# Need to specifically characterize INPUT arguments and OUTPUT data + my ($eref)=@_; + return Apache::NSDL::FromTheGateway($eref); } # ----------------------------------------------- NSDL->answer_resource_request @@ -314,4 +399,3 @@ and Apache::GATEWAY::* manpages. linux =cut -