[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Mon May 3 19:49:18 UTC 2004
mwilkinson
Mon May 3 15:49:18 EDT 2004
Update of /home/repository/moby/moby-live/Perl/MOBY/Client
In directory pub.open-bio.org:/tmp/cvs-serv12366
Modified Files:
Central.pm
Added Files:
SecondaryArticle.html SecondaryArticle.pm
Log Message:
added an object to represent a parameter
moby-live/Perl/MOBY/Client SecondaryArticle.html,NONE,1.1 SecondaryArticle.pm,NONE,1.1 Central.pm,1.74,1.75
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2004/04/14 19:56:59 1.74
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2004/05/03 19:49:18 1.75
@@ -75,14 +75,29 @@
Function : connect to one or more MOBY-Central
registries for searching
Returns : MOBY::Client::Central object
+
+ ENV & PROXY : you can set environment variables to change the defaults.
+ By default, a call to 'new' will initialize MOBY::Client::Central
+ to connect to the MOBY Central registry at:
+ http://mobycentral.cbr.nrc.ca/cgi-bin/MOBY05/mobycentral.pl
+ If you wish to chose another registry by default, or if you need
+ to set up additional connection details (e.g. PROXY) then you may
+ set the following environment variables to whatever you
+ require:
+ MOBY_SERVER (default http://mobycentral.cbr.nrc.ca/cgi-bin/MOBY05/mobycentral.pl)
+ MOBY_URI (default http://mobycentral.cbr.nrc.ca/MOBY/Central)
+ MOBY_PROXY (no default)
+
Args : Registries - optional.
- takes the form
{$NAME1 => {
URL => $URL,
- URI => $URI},
+ URI => $URI,
+ PROXY => $proxy_server},
$NAME2 => {
URL => $URL,
- URI => $URI},
+ URI => $URI,
+ PROXY => $proxy_server},
}
- by default this becomes
{mobycentral => {
@@ -125,6 +140,7 @@
default_MOBY_servername => ['mobycentral', 'read/write'],
default_MOBY_server => ['http://mobycentral.cbr.nrc.ca/cgi-bin/MOBY05/mobycentral.pl', 'read/write'],
default_MOBY_uri => ['http://mobycentral.cbr.nrc.ca/MOBY/Central', 'read/write'],
+ default_MOBY_proxy => [undef, 'read/write'],
default_MOBY_type => ['soap', 'read/write'],
Registries => [undef, 'read/write'],
multiple_registries => [undef, 'read/write'],
@@ -238,6 +254,7 @@
$self->default_MOBY_server($ENV{MOBY_SERVER}) if $ENV{MOBY_SERVER};
$self->default_MOBY_uri($ENV{MOBY_URI}) if $ENV{MOBY_URI};
$self->default_MOBY_type($ENV{MOBY_TYPE}) if $ENV{MOBY_TYPE};
+ $self->default_MOBY_proxy($ENV{MOBY_PROXY}) if $ENV{MOBY_PROXY};
if ($self->Registries){
@@ -248,11 +265,19 @@
my $url = $acc->{URL};
my $uri = $acc->{URI};
my $type = $acc->{TYPE};
+ my $proxy = $acc->{PROXY};
$type ||='soap';
if (lc($type) eq "get"){
push @{$self->Connections}, [$name, $type, $url];
} else {
- push @{$self->Connections}, [$name, $type, SOAP::Lite->proxy($url)->uri($uri)->on_fault(
+ my @soapargs;
+ if ($proxy){
+ @soapargs = ($url,
+ proxy => ['http' => $proxy]);
+ } else {
+ @soapargs = ($url);
+ }
+ push @{$self->Connections}, [$name, $type, SOAP::Lite->proxy(@soapargs)->uri($uri)->on_fault(
sub{
my($soap, $res) = @_;
die ref $res ? $res->faultstring : $soap->transport->status, "\n ERROR ERROR ERROR\n";
@@ -270,7 +295,16 @@
URI => $self->default_MOBY_uri
}}
);
- push @{$self->Connections},[$self->default_MOBY_servername, $self->default_MOBY_type, SOAP::Lite->proxy($self->default_MOBY_server)->uri($self->default_MOBY_uri)->on_fault(
+ my @soapargs;
+ if ($self->default_MOBY_proxy){
+ @soapargs = ($self->default_MOBY_server,
+ proxy => ['http' => $self->default_MOBY_proxy]);
+ } else {
+ @soapargs = ($self->default_MOBY_server);
+ }
+ push @{$self->Connections},[$self->default_MOBY_servername,
+ $self->default_MOBY_type,
+ SOAP::Lite->proxy(@soapargs)->uri($self->default_MOBY_uri)->on_fault(
sub{
my($soap, $res) = @_;
die ref $res ? $res->faultstring : $soap->transport->status, "\n ERROR ERROR ERROR\n";
More information about the MOBY-guts
mailing list