--- nsdl/lib/perl/Apache/LONCAPA/ToTheGateway.pm 2002/05/07 14:04:07 1.2 +++ nsdl/lib/perl/Apache/LONCAPA/ToTheGateway.pm 2002/05/29 01:09:37 1.3 @@ -36,12 +36,52 @@ package Apache::LONCAPA::ToTheGateway; # ================================================================ DEPENDENCIES use strict; # enforce handling of variables, references and subroutines +use Apache::Constants qw(:common); +use Apache::LONCAPA::FromTheGateway; # ============================================================ MODULE VARIABLES -my $VERSION = sprintf("%d.%02d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/); +my $VERSION = sprintf("%d.%02d", q$Revision: 1.3 $ =~ /(\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 'search') { +# NSDL->answer_metadata_record_request + $output= + Apache::LONCAPA::FromTheGateway::search_or_browse_against_NSDLgateway(\%ENV); + } + my $cgi; + foreach my $key (keys %ENV) { + if ($key=~/^form\./) { + $cgi.="$key: $ENV{$key}\n"; + } + } + $r->content_type('text/html'); + $r->send_http_header; + return(OK) if $r->header_only; + $r->print(< +Test Output + +

Apache::LONCAPA::ToTheGateway

+

Input

+
+$cgi
+
+

Output

+
+$output
+
+ + +END + return(OK); +} + # ---------------------------------------------- LONCAPA->answer_search_request sub answer_search_request { # Not yet implemented @@ -50,8 +90,8 @@ sub answer_search_request { # ------------------------------------- LONCAPA->answer_metadata_record_request sub answer_metadata_record_request { -# Not yet implemented -# Need to specifically characterize INPUT arguments and OUTPUT data + my ($url)=@_; + return "will have multiplexed this and returned from LON-CAPA network\n"; } # -------------------------------------------- LONCAPA->answer_resource_request