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

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

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