Annotation of nsdl/lib/perl/Apache/GATEWAY/ToNSDL.pm, revision 1.4

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

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