version 1.2, 2002/05/06 19:51:21
|
version 1.4, 2002/05/29 01:17:55
|
Line 37 package Apache::NSDL::ToTheGateway;
|
Line 37 package Apache::NSDL::ToTheGateway;
|
|
|
# ================================================================ DEPENDENCIES |
# ================================================================ DEPENDENCIES |
use strict; # enforce handling of variables, references and subroutines |
use strict; # enforce handling of variables, references and subroutines |
|
use Apache::Constants qw(:common); |
|
use Apache::GATEWAY::Common; |
|
use Apache::NSDL::FromTheGateway; |
|
|
# ============================================================ MODULE VARIABLES |
# ============================================================ MODULE VARIABLES |
my $VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/); |
my $VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/); |
|
|
# ================================================================= SUBROUTINES |
# ================================================================= 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') { |
|
$output=(<<END); |
|
<?xml version="1.0" encoding="UTF-8"?> |
|
<Identify |
|
xmlns="http://www.openarchives.org/OAI/1.1/OAI_Identify" |
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
xsi:schemaLocation="http://www.openarchives.org/OAI/1.1/OAI_Identify |
|
http://www.openarchives.org/OAI/1.1/OAI_Identify.xsd"> |
|
<responseDate>2001-06-01T19:20:30-04:00</responseDate> |
|
<requestURL>http://nsdl.lon-capa.org/OAI-script?verb=Identify</requestURL> |
|
<repositoryName>The LearningOnline Network with CAPA</repositoryName> |
|
<baseURL>http://nsdl.lon-capa.org/OAI-script</baseURL> |
|
<protocolVersion>1.1</protocolVersion> |
|
<adminEmail>mailto:korte@lite.msu.edu</adminEmail> |
|
<description> |
|
<oai-identifier xmlns="http://www.openarchives.org/OAI/1.1/oai-identifier" |
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
xsi:schemaLocation="http://www.openarchives.org/OAI/1.1/oai-identifier |
|
http://www.openarchives.org/OAI/1.1/oai-identifier.xsd"> |
|
<scheme>oai</scheme> |
|
<repositoryIdentifier>loncapa</repositoryIdentifier> |
|
<delimiter>:</delimiter> |
|
<sampleIdentifier>oai:loncapa:harrison2002-1</sampleIdentifier> |
|
</oai-identifier> |
|
</description> |
|
<description> |
|
<eprints xmlns="http://www.openarchives.org/OAI/1.1/eprints" |
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
xsi:schemaLocation="http://www.openarchives.org/OAI/1.1/eprints |
|
http://www.openarchives.org/OAI/1.1/eprints.xsd"> |
|
<content> |
|
<URL>http://nsdl.lon-capa.org/info/content.htm</URL> |
|
</content> |
|
<metadataPolicy> |
|
<text>Metadata can be used by authorized users</text> |
|
<URL>http://nsdl.lon-capa.org/metadata_use.htm</URL> |
|
</metadataPolicy> |
|
<dataPolicy> |
|
<text>Full content, i.e. preprints may not be harvested by robots</text> |
|
</dataPolicy> |
|
<submissionPolicy> |
|
<URL>http://nsdl.lon-capa.org/info/submission.htm</URL> |
|
</submissionPolicy> |
|
</eprints> |
|
</description> |
|
</Identify> |
|
END |
|
$output=~s/\>/\>/g; |
|
$output=~s/\</\</g; |
|
} |
|
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(<<END); |
|
<html> |
|
<head><title>Test Output</title></head> |
|
<body> |
|
<h1>Apache::NSDL::ToTheGateway</h1> |
|
<h2>Input</h2> |
|
<pre> |
|
$cgi |
|
</pre> |
|
<h2>Output</h2> |
|
<pre> |
|
$output |
|
</pre> |
|
</body> |
|
</html> |
|
END |
|
return(OK); |
|
} |
|
|
# ------------------------------------------- NSDL->answer_list_records_request |
# ------------------------------------------- NSDL->answer_list_records_request |
sub answer_list_records_request { |
sub answer_list_records_request { |
# Not yet implemented |
# Not yet implemented |
Line 51 sub answer_list_records_request {
|
Line 141 sub answer_list_records_request {
|
|
|
# ------------------------------------------------- NSDL->answer_search_request |
# ------------------------------------------------- NSDL->answer_search_request |
sub answer_search_request { |
sub answer_search_request { |
# Not yet implemented |
my ($url)=@_; |
# Need to specifically characterize INPUT arguments and OUTPUT data |
return "will have http querying strategy against NSDL servers\n"; |
} |
} |
|
|
# ---------------------------------------- NSDL->answer_metadata_record_request |
# ---------------------------------------- NSDL->answer_metadata_record_request |
sub answer_metadata_record_request { |
sub answer_metadata_record_request { |
# Not yet implemented |
my ($eref)=@_; |
# Need to specifically characterize INPUT arguments and OUTPUT data |
return Apache::NSDL::FromTheGateway($eref); |
} |
} |
|
|
# ----------------------------------------------- NSDL->answer_resource_request |
# ----------------------------------------------- NSDL->answer_resource_request |
Line 296 and Apache::GATEWAY::* manpages.
|
Line 386 and Apache::GATEWAY::* manpages.
|
linux |
linux |
|
|
=cut |
=cut |
|
|