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

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

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