--- nsdl/lib/perl/Apache/LONCAPA/ToTheGateway.pm 2002/05/07 14:01:30 1.1 +++ nsdl/lib/perl/Apache/LONCAPA/ToTheGateway.pm 2002/05/29 01:09:37 1.3 @@ -36,13 +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.1 $ =~ /(\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 @@ -51,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 @@ -88,9 +127,9 @@ In terms of the overall data flow, the '=====>' below indicates the role of this module. -NSDL ---------E B LON-CAPA> +NSDL ---------E Gateway --------E LON-CAPA -LON-CAPA -----E Gateway --------E NSDL +B Gateway> --------E NSDL =head2 EXIT CODES