[Bio] / FigKernelPackages / SSserver.pm Repository:
ViewVC logotype

Annotation of /FigKernelPackages/SSserver.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (view) (download) (as text)

1 : disz 1.1
2 :     package SSserver;
3 :    
4 : olson 1.4 #
5 : parrello 1.9 # This is a SAS Component
6 : olson 1.4 #
7 :    
8 : disz 1.1 use LWP::UserAgent;
9 :     use Data::Dumper;
10 :     use YAML;
11 :    
12 :     use strict;
13 :    
14 :     sub new
15 :     {
16 :     my($class, $server_url) = @_;
17 :    
18 : parrello 1.9 $server_url = "http://servers.nmpdr.org/subsystem/server.cgi" unless $server_url;
19 :     # $server_url = "http://bio-macpro-2.mcs.anl.gov/~disz/FIG/subsystem_server_sapling.cgi" unless $server_url;
20 :     # $server_url = "http://bio-big.mcs.anl.gov/server/FIG/subsystem_server_sapling.cgi" unless $server_url;
21 :    
22 : disz 1.1 #$server_url = "http://bio-macpro-1.mcs.anl.gov/ross-proj/FIG/co_occurs_server.cgi" unless $server_url;
23 :    
24 :     my $self = {
25 :     server_url => $server_url,
26 :     ua => LWP::UserAgent->new(),
27 :     };
28 : disz 1.5 $self->{ua}->timeout(30*60);
29 : disz 1.1 return bless $self, $class;
30 :     }
31 :    
32 : parrello 1.9 sub pegs_implementing_roles {
33 :     my ($self, @args) = @_;
34 :     return $self->run_query("pegs_implementing_roles", @args);
35 :     }
36 :    
37 : disz 1.1 sub is_in_subsystem {
38 :     my ($self, @args) = @_;
39 :     return $self->run_query("is_in_subsystem", @args);
40 :     }
41 :     sub is_in_subsystem_with {
42 :     my ($self, @args) = @_;
43 :     return $self->run_query("is_in_subsystem_with", @args);
44 :     }
45 :    
46 :     sub all_subsystems {
47 :     my ($self, @args) = @_;
48 :     return $self->run_query("all_subsystems", @args);
49 :     }
50 :    
51 :     sub subsystem_spreadsheet {
52 :     my ($self, @args) = @_;
53 :     return $self->run_query("subsystem_spreadsheet", @args);
54 :     }
55 :    
56 :    
57 : disz 1.5 sub metabolic_reconstruction {
58 :     my ($self, @args) = @_;
59 :     return $self->run_query("metabolic_reconstruction", @args);
60 :     }
61 :    
62 : disz 1.1 sub run_query
63 :     {
64 :     my($self, $function, @args ) = @_;
65 :    
66 :     my $arg_string = Dump(@args);
67 :     my $form = [function => $function,
68 :     args => "$arg_string"];
69 :    
70 :     my $res = $self->{ua}->post($self->{server_url}, $form);
71 :     if ($res->is_success)
72 :     {
73 : disz 1.2 return Load($res->content);
74 : disz 1.1 }
75 :     else
76 :     {
77 :     die "error on post " . $res->content;
78 :     }
79 :     }
80 :    
81 :    
82 : parrello 1.9 1;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3