Diff for /nsdl/lib/perl/Apache/NSDL/ToTheGateway.pm between versions 1.3 and 1.5

version 1.3, 2002/05/23 19:54:28 version 1.5, 2002/05/30 17:07:38
Line 38  package Apache::NSDL::ToTheGateway; Line 38  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::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+)/);
Line 47  my $VERSION = sprintf("%d.%02d", q$Revis Line 49  my $VERSION = sprintf("%d.%02d", q$Revis
 # ----------------------------- Handling routine called via Apache and mod_perl  # ----------------------------- Handling routine called via Apache and mod_perl
 sub handler {  sub handler {
     my $r = shift;      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=(<<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>$responseDate</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&#x0040;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
       }
       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/\>/\&gt;/g;
       $output=~s/\</\&lt;/g;
       my $cgi;
       foreach my $key (keys %ENV) {
    if ($key=~/^form\./) {
       $cgi.="$key: $ENV{$key}\n";
    }
       }
     $r->content_type('text/html');      $r->content_type('text/html');
     $r->send_http_header;      $r->send_http_header;
     return(OK) if $r->header_only;      return(OK) if $r->header_only;
Line 54  sub handler { Line 131  sub handler {
 <html>  <html>
 <head><title>Test Output</title></head>  <head><title>Test Output</title></head>
 <body>  <body>
 Apache::NSDL::ToTheGateway  <h1>Apache::NSDL::ToTheGateway</h1>
   <h2>Input</h2>
   <pre>
   $cgi
   </pre>
   <h2>Output</h2>
   <pre>
   $output
   </pre>
 </body>  </body>
 </html>  </html>
 END  END
Line 69  sub answer_list_records_request { Line 154  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 314  and Apache::GATEWAY::* manpages. Line 399  and Apache::GATEWAY::* manpages.
 linux  linux
   
 =cut  =cut
   

Removed from v.1.3  
changed lines
  Added in v.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>