[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Wed Aug 3 12:00:32 UTC 2005
mwilkinson
Wed Aug 3 08:00:32 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY/Client
In directory pub.open-bio.org:/tmp/cvs-serv4027/MOBY/Client
Modified Files:
Central.pm
Log Message:
added a client-side subroutine to deal with the retreiveResourceURLs MOBY Central method
moby-live/Perl/MOBY/Client Central.pm,1.111,1.112
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -r1.111 -r1.112
--- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/08/03 11:30:30 1.111
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/08/03 12:00:32 1.112
@@ -1301,6 +1301,44 @@
return $content;
}
+
+=head2 retrieveResourceURLs
+
+ Title : retrieveResourceURLs()
+ Usage : $names = $MOBY->retrieveResourceURLs()
+ Function : get a hash of the URL's for each of the MOBY ontologies
+ Returns : hashref to the following hash
+ $names{Ontology} = [URL1, URL2,...]
+ Args : none
+
+=cut
+
+sub retrieveResourceURLs {
+ my ($self, %args) = shift;
+ my $reg = $args{registry};
+ $reg = $reg ? $reg : $self->default_MOBY_servername;
+ return undef unless ( $self->Connection($reg) );
+
+# CODE GOES HERE....
+
+
+
+ my ($return) = $self->_call( $reg, 'retrieveResourceURLs', "" );
+ my $parser = XML::LibXML->new();
+ my $doc = $parser->parse_string($return);
+ my $root = $doc->getDocumentElement;
+ my $urls_list = $root->childNodes;
+ my %urls;
+ for ( my $x = 1 ; $x <= $urls_list->size() ; $x++ ) {
+ next unless $urls_list->get_node($x)->nodeType == ELEMENT_NODE;
+ my $ontology = $urls_list->get_node($x)->getAttributeNode('name')->getValue;
+ my $url = $urls_list->get_node($x)->getAttributeNode('url')->getValue;
+ push @{ $urls{$ontology} }, $url
+ }
+ return \%urls;
+}
+
+
=head2 retrieveServiceNames
Title : retrieveServiceNames(%args)
More information about the MOBY-guts
mailing list