[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at dev.open-bio.org
Wed Jan 29 00:59:45 UTC 2003
Tue Jan 28 19:59:45 EST 2003
Update of /home/repository/moby/moby-live/Perl/Client
In directory dev:/tmp/cvs-serv20152/Perl/Client
Modified Files:
MOBY-Client.cgi
Log Message:
amazing! I think I only needed to modify two or three lines to get the client working from the new API :-) Okay, go nuts. Please let me know if you find any errors or feel free to fix them yourself if youre keen
moby-live/Perl/Client MOBY-Client.cgi,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/Client/MOBY-Client.cgi,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /tmp/T0YdaWyN 2003-01-28 19:59:45.270004405 -0500
+++ /tmp/T1ZdaWyN 2003-01-28 19:59:45.280009280 -0500
@@ -76,7 +76,11 @@
start_html(-title => 'A Simple MOBY Client', -bgcolor => "white"),
"<table BGCOLOR='#AAAAFF' width = '100%'><TR><TD><center>",
"<IMG SRC=http://www.biomoby.org/moby1.gif>",
- h1('MOBY Client Initialization'),"</center></TD></TR></table><p>",
+ h1('MOBY Client Initialization'),"<font color='red'><b>SORRY - MANY SERVICES ARE CURRENTLY OFFLINE DUE TO A CHANGE
+IN SERVER LOCATION AT NRC. THIS SHOULD BE RESOLVED SHORTLY</b><br><br>To see examples of functioning services, chose
+the 'Generic Keyword' namespace, and enter '*brassinosteroid*' in the ID field. Flybase has a Gene Ontology
+lookup service that operates on that namespace. Send <b><i>one</b></i> of the resulting GO terms to the TAIR sequence
+retrieval service.</font></center></TD></TR></table><p>",
start_form,
"<h2>What namespace do you have? ";
my %nslabels = (%{$NameSpaces});
@@ -177,7 +181,7 @@
my $obj = $Object->getTagName;
my $ns = $Object->getAttributeNode("namespace")->getValue();
my $id = $Object->getAttributeNode("id")->getValue();
- _LOG("writeCurrentObjects: Object was $obj namespace was $ns\n");
+ $debug && _LOG("writeCurrentObjects: Object was $obj namespace was $ns\n");
$obj = escapeHTML($obj); # escape the name, namespace, and object XML
$ns = escapeHTML($ns);
$id = escapeHTML($id);
@@ -236,16 +240,16 @@
# EXECUTE SELECTED SERVICE
my $SelectedService = param('SelectedService');
my ($URI, $name) = (($SelectedService =~ /(.*?)#(.*)/) && ($1, $2));
- _LOG("Executing\n");
+ $debug && _LOG("Executing\n");
my $Central = MOBY::Client::Central->new();
- my $wsdl = $Central->retrieveService($URI, $name); # get the WSDL for the selected service
- _LOG("WSDL\n\n___________________________________________________$wsdl\n_______________________________________");
+ my $wsdl = $Central->retrieveService(authURI => $URI, serviceName => $name); # get the WSDL for the selected service
+ $debug && _LOG("WSDL\n\n___________________________________________________$wsdl\n_______________________________________");
my $CurrentObjects = join "\n\n", &extractCurrentObjects(); # get the object XML (in human-readable form if possible for logging purposes)
my $MOBY_Request = "<MOBY>\n".$CurrentObjects."</MOBY>";
- _LOG("MOBY_REQUEST\n\n___________________________________________________$MOBY_Request\n_______________________________________");
+ $debug && _LOG("MOBY_REQUEST\n\n___________________________________________________$MOBY_Request\n_______________________________________");
my $Service = MOBY::Client::Service->new(service => $wsdl); # create the service
@@ -266,7 +270,7 @@
$success = 1;
my $Object_text = $Object->toString;
push @objects,$Object_text;
- _LOG("Found response object $Object_text .\n");
+ $debug && _LOG("Found response object $Object_text .\n");
}
unless ($success){$ERROR_FLAG = "MOBY Response Contained No Data"; return};
@@ -327,7 +331,7 @@
sub extractCurrentObjects {
# objects are passed as base64 encoded, need to decode them back to XML
my @objects = param("CurrentObjects");
- &_LOG("CURRENT_OBJECTS__________________\n at objects\n___________________");
+ $debug && &_LOG("CURRENT_OBJECTS__________________\n at objects\n___________________");
return map {decode_base64($_)} @objects;
}
@@ -342,7 +346,7 @@
my $doc = $Parser->parse($_);
my $Object = $doc->getDocumentElement();
my $object_name = $Object->getTagName;
- _LOG("extractObjectTypes: Object was $object_name\n");
+ $debug && _LOG("extractObjectTypes: Object was $object_name\n");
my $CRIB = $Object->getElementsByTagName("CrossReference");
# should be only one CRIB per object, so...
if ($CRIB->item(0)){
@@ -370,7 +374,7 @@
my $doc = $Parser->parse($_);
my $Object = $doc->getDocumentElement();
my $ns = $Object->getAttributeNode("namespace");
- _LOG("extractObjectTypes: Namespace was ".$ns->getValue."\n");
+ $debug && &_LOG("extractObjectTypes: Namespace was ".$ns->getValue."\n");
push @namespaces, $ns->getValue;
}
return @namespaces;
@@ -384,7 +388,7 @@
# menu* of valid services!!
my ($objects, $namespace) = @_;
my @objects = @{$objects}; # has the format @([object_type, \@XREF_XML], [...]...)
- _LOG("getAllServices: \n\tInitial Object List @objects\n");
+ $debug && _LOG("getAllServices: \n\tInitial Object List @objects\n");
my @types;
foreach (@objects){
@@ -397,8 +401,13 @@
my $Central = MOBY::Client::Central->new();
- _LOG("getAllServices: \n\tObjects @types\n\tNamespaces @{$namespace}");
- my @services = $Central->locateServiceByInput(\@types, $namespace);
+ my %searchparams;
+ foreach (@types){
+ $searchparams{$_} = $namespace;
+ }
+ $debug && _LOG("************************************************\n\ngetAllServices: \n\tObjects @types\n\tNamespaces @{$namespace}\n\n*****************************************");
+ my @services = $Central->locateServiceByInput(
+ input => \%searchparams);
my %popup_services;
foreach (@services) {
More information about the MOBY-guts
mailing list