Parent Directory
|
Revision Log
Revision 1.17 - (view) (download) (as text)
1 : | disz | 1.1 | package SSserver; |
2 : | |||
3 : | use strict; | ||
4 : | parrello | 1.15 | use base qw(ClientThing); |
5 : | disz | 1.1 | |
6 : | parrello | 1.10 | =head1 Subsystem Server Helper Object |
7 : | |||
8 : | =head2 Description | ||
9 : | |||
10 : | This module is used to call the Subsystem Server, which is a special-purpose | ||
11 : | server for manipulating subsystem data from the Sapling database. Each Subsystem | ||
12 : | Server function corresponds to a method of this object. | ||
13 : | |||
14 : | This package deliberately uses no internal SEED packages or scripts, only common | ||
15 : | PERL modules. | ||
16 : | |||
17 : | The fields in this object are as follows. | ||
18 : | |||
19 : | =over 4 | ||
20 : | |||
21 : | =item server_url | ||
22 : | |||
23 : | The URL used to request data from the subsystem server. | ||
24 : | |||
25 : | =item ua | ||
26 : | |||
27 : | The user agent for communication with the server. | ||
28 : | |||
29 : | =item singleton | ||
30 : | |||
31 : | Indicates whether or not results are to be returned in singleton mode. In | ||
32 : | singleton mode, if the return document is a hash reference with only one | ||
33 : | entry, the entry value is returned rather than the hash. | ||
34 : | |||
35 : | =back | ||
36 : | |||
37 : | =cut | ||
38 : | |||
39 : | =head3 new | ||
40 : | |||
41 : | my $ss = SSserver->new(%options); | ||
42 : | |||
43 : | parrello | 1.11 | Construct a new server object. The |
44 : | following options are supported. | ||
45 : | parrello | 1.10 | |
46 : | =over 4 | ||
47 : | |||
48 : | =item url | ||
49 : | |||
50 : | parrello | 1.11 | URL for the server. This option is required. |
51 : | parrello | 1.10 | |
52 : | parrello | 1.11 | =item singleton (optional) |
53 : | parrello | 1.10 | |
54 : | If TRUE, results from methods will be returned in singleton mode. In singleton | ||
55 : | mode, if a single result comes back, it will come back as a scalar rather than | ||
56 : | as a hash value accessible via an incoming ID. | ||
57 : | |||
58 : | =back | ||
59 : | |||
60 : | =cut | ||
61 : | |||
62 : | sub new { | ||
63 : | # Get the parameters. | ||
64 : | my ($class, %options) = @_; | ||
65 : | parrello | 1.15 | # Compute the URL. |
66 : | parrello | 1.16 | $options{url} = 'http://servers.nmpdr.org/subsystem/server.cgi' if ! $options{url}; |
67 : | parrello | 1.15 | # Construct the subclass. |
68 : | return $class->SUPER::new(SS => %options); | ||
69 : | parrello | 1.11 | } |
70 : | |||
71 : | parrello | 1.10 | 1; |
MCS Webmaster | ViewVC Help |
Powered by ViewVC 1.0.3 |