Annotation of nsdl/lib/perl/Apache/NSDL/ToTheGateway.pm, revision 1.3

1.1       harris41    1: # Apache::NSDL::ToTheGateway
                      2: #
                      3: # ToTheGateway.pm
                      4: # API for passing information from NSDL to the Gateway Server
                      5: #
                      6: # For more documentation, read the POD documentation
                      7: # of this module with the perldoc command:
                      8: #
                      9: #         perldoc ./ToTheGateway.pm
                     10: #
                     11: # Brief description
                     12: # =================
                     13: #
                     14: # This module contains functionality for
                     15: # transferring information from NSDL to the Gateway Server.
                     16: #
                     17: # In terms of the overall data flow, the
                     18: # '=====>' below indicates the role of this
                     19: # module.
                     20: #
                     21: # NSDL =========> Gateway --------> LON-CAPA
                     22: # LON-CAPA -----> Gateway --------> NSDL
                     23: #
                     24: # SUBROUTINES:
                     25: # NSDL->answer_list_records_request
                     26: # NSDL->answer_search_request
                     27: # NSDL->answer_metadata_record_request
                     28: # NSDL->answer_resource_request
                     29: 
                     30: # Year 2002
                     31: # Scott Harrison
                     32: # February-May
                     33: #
                     34: ###
                     35: 
                     36: package Apache::NSDL::ToTheGateway;
                     37: 
                     38: # ================================================================ DEPENDENCIES
                     39: use strict; # enforce handling of variables, references and subroutines
1.3     ! harris41   40: use Apache::Constants qw(:common);
1.1       harris41   41: 
                     42: # ============================================================ MODULE VARIABLES
1.3     ! harris41   43: my $VERSION = sprintf("%d.%02d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/);
1.1       harris41   44: 
                     45: # ================================================================= SUBROUTINES
1.3     ! harris41   46: 
        !            47: # ----------------------------- Handling routine called via Apache and mod_perl
        !            48: sub handler {
        !            49:     my $r = shift;
        !            50:     $r->content_type('text/html');
        !            51:     $r->send_http_header;
        !            52:     return(OK) if $r->header_only;
        !            53:     $r->print(<<END);
        !            54: <html>
        !            55: <head><title>Test Output</title></head>
        !            56: <body>
        !            57: Apache::NSDL::ToTheGateway
        !            58: </body>
        !            59: </html>
        !            60: END
        !            61:     return(OK);
        !            62: }
1.1       harris41   63: 
                     64: # ------------------------------------------- NSDL->answer_list_records_request
                     65: sub answer_list_records_request {
                     66: # Not yet implemented
                     67: # Need to specifically characterize INPUT arguments and OUTPUT data
                     68: }
                     69: 
                     70: # ------------------------------------------------- NSDL->answer_search_request
                     71: sub answer_search_request {
                     72: # Not yet implemented
                     73: # Need to specifically characterize INPUT arguments and OUTPUT data
                     74: }
                     75: 
                     76: # ---------------------------------------- NSDL->answer_metadata_record_request
                     77: sub answer_metadata_record_request {
                     78: # Not yet implemented
                     79: # Need to specifically characterize INPUT arguments and OUTPUT data
                     80: }
                     81: 
                     82: # ----------------------------------------------- NSDL->answer_resource_request
                     83: sub answer_resource_request {
                     84: # Not yet implemented
                     85: # Need to specifically characterize INPUT arguments and OUTPUT data
                     86: }
                     87: 
                     88: 1;
                     89: 
                     90: __END__
                     91: 
                     92: =pod
                     93: 
                     94: =head1 NAME
                     95: 
                     96: B<Apache::NSDL::ToTheGateway> - API for passing information from NSDL to the Gateway Server
                     97: 
                     98: =head1 SYNOPSIS
                     99: 
                    100:  use Apache::NSDL::ToTheGateway;
                    101: 
                    102:  my $arrayref=
                    103:     Apache::NSDL::ToTheGateway::answer_list_records_request
                    104:       ($OAI_protocol_request);
                    105: 
                    106: =head1 DESCRIPTION
                    107: 
                    108: This module contains functionality for
                    109: transferring information from NSDL to the Gateway Server.
                    110: 
                    111: In terms of the overall data flow, the
                    112: '=====>' below indicates the role of this
                    113: module.
                    114: 
                    115: B<NSDL =========E<gt> Gateway> --------E<gt> LON-CAPA
                    116: 
                    117: LON-CAPA -----E<gt> Gateway --------E<gt> NSDL
                    118: 
                    119: =head2 EXIT CODES
                    120: 
                    121: The subroutines of this module all output an exit code which
                    122: describes the status of function completion.  The exit code
                    123: may be followed by a more descriptive message such as:
                    124: 
                    125:  FORMATERROR:Sun May  5 20:15:16 GMT 2002:missing 'protocol://' pattern
                    126: 
                    127: =over 4
                    128: 
                    129: =item *
                    130: 
                    131: B<'SUCCESS'>, information was found and is being returned
                    132: 
                    133: =item *
                    134: 
                    135: B<'EMPTY'>, everything functioned properly, but no information was present
                    136: 
                    137: =item *
                    138: 
                    139: B<'BADEMPTY'>, everything appeared to function properly, but no information
                    140: was present (which defies expectation); this is useful for detecting phantom
                    141: cases of connectivity when verifying test cases of vertical software partitions
                    142: 
                    143: =item *
                    144: 
                    145: B<'TIMEOUT'>, the request is taking WAY too long
                    146: 
                    147: =item *
                    148: 
                    149: B<'FORMATERROR'>, the input argument is not formatted correctly in a way that
                    150: can be processed by the NSDL server
                    151: 
                    152: =item *
                    153: 
                    154: B<'CONNECTIONFAILURE'>, the NSDL server cannot be contacted
                    155: 
                    156: =back
                    157: 
                    158: =head2 SUBROUTINES
                    159: 
                    160: Note that the subroutines all output an exit code which
                    161: describes the status of function completion.
                    162: 
                    163: In the case of failed function completion, the other
                    164: output argument(s) will typically only be 'NULL' values.
                    165: 
                    166: =over 4
                    167: 
                    168: =item B<Apache::NSDL::answer_list_records_request>
                    169: 
                    170: =over 4
                    171: 
                    172: =item B<Input> - Scalar string
                    173: 
                    174: Take in an OAI-format request for a specific NSDL server.
                    175: 
                    176: =item B<Output> - Scalar string, Scalar array reference
                    177: 
                    178: An exit code is returned as a scalar string.
                    179: 
                    180: A list of records returned via an array reference.
                    181: 
                    182: =item B<Description>
                    183: 
                    184: This lists the records matching a given request.
                    185: The request comes from the Gateway Server, B<and the information
                    186: passes from NSDL I<to the> GATEWAY>.
                    187: 
1.2       harris41  188: =item B<Status of Implementation>
                    189: 
                    190: n/a
                    191: 
1.1       harris41  192: =back
                    193: 
                    194: =item B<Apache::NSDL::answer_search_request>
                    195: 
                    196: =over 4
                    197: 
                    198: =item B<Input> - Scalar string
                    199: 
                    200: Take in an OAI-format request for a specific NSDL server (a search expression
                    201: is passed).
                    202: 
                    203: =item B<Output> - Scalar string, Scalar array reference
                    204: 
                    205: An exit code is returned as a scalar string.
                    206: 
                    207: A list of relevant records (matching the search request) returned via an
                    208: array reference.
                    209: 
                    210: =item B<Description>
                    211: 
                    212: This lists the records matching a given search request.
                    213: The request comes from the Gateway Server, B<and the information
                    214: passes from NSDL I<to the> GATEWAY>.
                    215: 
1.2       harris41  216: =item B<Status of Implementation>
                    217: 
                    218: n/a
                    219: 
1.1       harris41  220: =back
                    221: 
                    222: =item B<Apache::NSDL::answer_metadata_record_request>
                    223: 
                    224: =over 4
                    225: 
                    226: =item B<Input> - Scalar string
                    227: 
                    228: Take in an OAI-format request for a specific NSDL server resource's
                    229: metadata.
                    230: 
                    231: =item B<Output> - Scalar string, Scalar string reference
                    232: 
                    233: An exit code is returned as a scalar string.
                    234: 
                    235: The metadata entries for the resource; returned via a scalar reference.
                    236: 
                    237: =item B<Description>
                    238: 
                    239: This lists the records matching a given request.
                    240: The request comes from the Gateway Server, B<and the information
                    241: passes from NSDL I<to the> GATEWAY>.
                    242: 
1.2       harris41  243: =item B<Status of Implementation>
                    244: 
                    245: n/a
                    246: 
1.1       harris41  247: =back
                    248: 
                    249: =item B<Apache::NSDL::answer_resource_request>
                    250: 
                    251: =over 4
                    252: 
                    253: =item B<Input> - Scalar string
                    254: 
                    255: Take in an OAI-format request for a specific NSDL server's
                    256: resource content.
                    257: 
                    258: =item B<Output> - Scalar string, Scalar string reference
                    259: 
                    260: An exit code is returned as a scalar string.
                    261: 
                    262: A reference to the resource content (now physically present in computer
                    263: memory).
                    264: 
                    265: =item B<Description>
                    266: 
                    267: This provides the content of the resource matching a given request.
                    268: The request comes from the Gateway Server, B<and the information
                    269: passes from NSDL I<to the> GATEWAY>.
1.2       harris41  270: 
                    271: =item B<Status of Implementation>
                    272: 
                    273: n/a
1.1       harris41  274: 
                    275: =back
                    276: 
                    277: =back
                    278: 
                    279: =head1 README
                    280: 
                    281: B<Apache::NSDL::ToTheGateway>
                    282: is part of the NSDL-LONCAPA Gateway Server system.
                    283: Please see http://nsdl.lon-capa.org/ for more information.
                    284: 
                    285: =head1 AUTHOR
                    286: 
                    287: Scott Harrison, 2002
                    288: 
                    289: =head1 PREREQUISITES
                    290: 
                    291: This module requires the C<strict> module.
                    292: 
                    293: =head1 COREQUISITES
                    294: 
                    295: Apache::NSDL::FromTheGateway
                    296: Apache::GATEWAY::ToNSDL
                    297: Apache::GATEWAY::FromNSDL
                    298: Apache::GATEWAY::ToLONCAPA
                    299: Apache::GATEWAY::FromLONCAPA
                    300: Apache::LONCAPA::FromTheGateway
                    301: Apache::LONCAPA::ToTheGateway
                    302: 
                    303: =head1 SEE ALSO
                    304: 
                    305: http://www.lon-capa.org/
                    306: 
                    307: http://www.smete.org/
                    308: 
                    309: Also visit the other Apache::NSDL::*, Apache::LONCAPA::*,
                    310: and Apache::GATEWAY::* manpages.
                    311: 
                    312: =head1 OSNAMES
                    313: 
                    314: linux
                    315: 
                    316: =cut
                    317: 

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