Annotation of nsdl/lib/perl/Apache/GATEWAY/ToLONCAPA.pm, revision 1.2
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
40:
41: # ============================================================ MODULE VARIABLES
1.2 ! harris41 42: my $VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/);
1.1 harris41 43:
44: # ================================================================= SUBROUTINES
45:
46: # ------------------------------------------------- GATEWAY->search_NSDLnetwork
47: sub search_NSDLnetwork {
48: # Not yet implemented
49: # Need to specifically characterize INPUT arguments and OUTPUT data
50: }
51:
52: # ------------------------------------------- GATEWAY->view_NSDLnetwork_results
53: sub view_NSDLnetwork_results {
54: # Not yet implemented
55: # Need to specifically characterize INPUT arguments and OUTPUT data
56: }
57:
58: # ----------------------------------- GATEWAY->view_NSDLnetwork_metadata_record
59: sub view_NSDLnetwork_metadata_record {
1.2 ! harris41 60: # Not yet fully implemented
! 61: my ($id)=@_;
! 62: unless (-e '/home/gateway/'.$id) {
! 63: die('Cannot open /home/gateway/'.$id."\n");
! 64: }
! 65: my $tr=new XML::Xalan::Transformer(); # or something
! 66: # set up xsl
! 67: # set up xml
! 68: # process
! 69: undef($tr);
! 70: return ($ref);
1.1 harris41 71: }
72:
73: # ---------------------------------------- GATEWAY->access_NSDLnetwork_resource
74: sub access_NSDLnetwork_resource {
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::ToLONCAPA> - API for passing information from the Gateway Server to LON-CAPA
88:
89: =head1 SYNOPSIS
90:
91: use Apache::GATEWAY::ToLONCAPA;
92:
93: my $accessref=
94: Apache::GATEWAY::ToLONCAPA::access_NSDLnetwork_resource
95: ($resource_identifier);
96:
97: =head1 DESCRIPTION
98:
99: This module contains functionality for
100: transferring information from the Gateway Server to LON-CAPA.
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 B<========E<gt> LON-CAPA>
107:
108: LON-CAPA -----E<gt> 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:
159: =item B<Apache::GATEWAY::ToLONCAPA::view_NSDLnetwork_results>
160:
161: =over 4
162:
163: =item B<Input> - Scalar string
164:
165: Memory location of NSDL results.
166:
167: =item B<Output> - Scalar string, Scalar string reference
168:
169: An exit code is returned as a scalar string.
170:
171: View the NSDL results.
172:
173: =item B<Description>
174:
175: This facilitates the viewing of NSDL record lists.
176: B<This relates to information that has passed
177: from the GATEWAY I<to> LON-CAPA>.
178:
179: =item B<Status of Implementation>
180:
181: n/a
182:
183: =back
184:
185: =item B<Apache::GATEWAY::ToLONCAPA::view_NSDLnetwork_metadata_record>
186:
187: =over 4
188:
189: =item B<Input> - Scalar string
190:
191: Identifier for a specific NSDL metadata record.
192:
193: =item B<Output> - Scalar string, Scalar string reference
194:
195: An exit code is returned as a scalar string.
196:
197: A pointer to the metadata.
198:
199: =item B<Description>
200:
201: This provides the content of the resource matching a given request.
202: B<The information has passed from the GATEWAY I<to> LON-CAPA>.
203:
204: =item B<Status of Implementation>
205:
206: n/a
207:
208: =back
209:
210: =item B<Apache::GATEWAY::ToLONCAPA::access_NSDLnetwork_resource>
211:
212: =over 4
213:
214: =item B<Input> - Scalar string
215:
216: Identifier for NSDL resource.
217:
218: =item B<Output> - Scalar string, Scalar string reference.
219:
220: An exit code is returned as a scalar string.
221:
222: Pointer to information about accessing NSDL resource.
223:
224: =item B<Description>
225:
226: This accepts access to a NSDL resource.
227: B<The information has passed from the GATEWAY I<to> LON-CAPA>.
228:
229: =item B<Status of Implementation>
230:
231: n/a
232:
233: =back
234:
235: =item B<Apache::GATEWAY::ToLONCAPA::search_NSDLnetwork>
236:
237: =over 4
238:
239: =item B<Input> - Scalar string
240:
241: Set of search expressions and corresponding fields to pass onto
242: NSDL.
243:
244: =item B<Output> - Scalar string, Scalar array reference
245:
246: An exit code is returned as a scalar string.
247:
248: A pointer to the location of search results is returned.
249:
250: =item B<Description>
251:
252: This models the functionality by which the NSDL-LONCAPA Gateway Server will
253: receive search results from a NSDL server.
254: This launches the search request and receives a pointer as to
255: where the results will be.
256:
257: =item B<Status of Implementation>
258:
259: n/a
260:
261: =back
262:
263: =back
264:
265: =head1 README
266:
267: B<Apache::GATEWAY::ToLONCAPA>
268: is part of the NSDL-LONCAPA Gateway Server system.
269: Please see http://nsdl.lon-capa.org/ for more information.
270:
271: =head1 AUTHOR
272:
273: Scott Harrison, 2002
274:
275: =head1 PREREQUISITES
276:
277: This module requires the C<strict> module.
278:
279: =head1 COREQUISITES
280:
281: Apache::NSDL::FromTheGateway
282: Apache::NSDL::ToTheGateway
283: Apache::GATEWAY::FromNSDL
284: Apache::GATEWAY::ToNSDL
285: Apache::GATEWAY::FromLONCAPA
286: Apache::LONCAPA::FromTheGateway
287: Apache::LONCAPA::ToTheGateway
288:
289: =head1 SEE ALSO
290:
291: http://www.lon-capa.org/
292:
293: http://www.smete.org/
294:
295: Also visit the other Apache::NSDL::*, Apache::LONCAPA::*,
296: and Apache::GATEWAY::* manpages.
297:
298: =head1 OSNAMES
299:
300: linux
301:
302: =cut
303:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>