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

Annotation of /FigKernelPackages/Clearinghouse.pm

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : olson 1.4 #
2 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
3 :     # for Interpretations of Genomes. All Rights Reserved.
4 :     #
5 :     # This file is part of the SEED Toolkit.
6 :     #
7 :     # The SEED Toolkit is free software. You can redistribute
8 :     # it and/or modify it under the terms of the SEED Toolkit
9 :     # Public License.
10 :     #
11 :     # You should have received a copy of the SEED Toolkit Public License
12 :     # along with this program; if not write to the University of Chicago
13 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
14 :     # Genomes at veronika@thefig.info or download a copy from
15 :     # http://www.theseed.org/LICENSE.TXT.
16 :     #
17 :    
18 : olson 1.2
19 : olson 1.1 #
20 :     # The clearinghouse is the centralized location where information
21 :     # about live SEED instances is collected.
22 :     #
23 :     # This module defines interface mechanisms for accessing the clearinghouse. The
24 :     # clearinghouse exports its functionality via an XMLRPC interface.
25 :     #
26 :     #
27 :    
28 :     use Frontier::Client;
29 :    
30 :     use LWP::UserAgent;
31 :    
32 :     package Clearinghouse;
33 :    
34 : olson 1.2 use FIGAttributes;
35 :     use base 'FIGAttributes';
36 :    
37 : olson 1.1 sub new
38 :     {
39 :     my($class, $url) = @_;
40 :    
41 :     if (!$url)
42 :     {
43 :     #
44 :     # Default clearinghouse.
45 :     #
46 :    
47 : olson 1.5 $url = "http://www.mcs.anl.gov/~olson/SEED/api.cgi";
48 : olson 1.1 }
49 :    
50 :     $self = {};
51 :    
52 :     $self->{url} = $url;
53 :     $self->{proxy} = Frontier::Client->new('url' => $url);
54 :    
55 :     return bless $self, $class;
56 :     }
57 :    
58 :     sub publish_subsystem
59 :     {
60 :     my($self, $name, $version, $date, $curator, $pedigree, $seed_id, $roles, $genomes) = @_;
61 :    
62 :     return $self->{proxy}->call("publish_subsystem",
63 :     $name, $version, $date, $curator, $pedigree, $seed_id, $roles, $genomes);
64 :     }
65 :    
66 :     sub upload_subsystem_package
67 :     {
68 :     my($self, $url, $package) = @_;
69 :    
70 :     my $ua = LWP::UserAgent->new;
71 :    
72 :     my $req = HTTP::Request->new(POST => $url);
73 :     $req->content_type("application/octet-stream");
74 :     $req->content($package);
75 :    
76 :     my $res = $ua->request($req);
77 :     print $res->as_string;
78 : parrello 1.3 }
79 : olson 1.1
80 : parrello 1.3 sub get_subsystems :Scalar
81 : olson 1.1 {
82 :     my($self) = @_;
83 :    
84 :     return $self->{proxy}->call("get_subsystems");
85 :    
86 :     }
87 :    
88 :     1;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3