[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Thu Jul 28 22:10:11 UTC 2005
mwilkinson
Thu Jul 28 18:10:11 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY/Client
In directory pub.open-bio.org:/tmp/cvs-serv6384/MOBY/Client
Modified Files:
Central.pm
Log Message:
starting to update Cient libraries to make LSID avialble
moby-live/Perl/MOBY/Client Central.pm,1.101,1.102
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -r1.101 -r1.102
--- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/07/22 23:05:04 1.101
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/07/28 22:10:11 1.102
@@ -497,9 +497,10 @@
my ($return) =
$self->_call( 'default', 'retrieveObjectDefinition', $message );
return \%def unless $return;
- my ( $term, $desc, $relationships, $email, $authURI ) =
+ my ( $term, $lsid, $desc, $relationships, $email, $authURI ) =
&_ObjectDefinitionPayload($return);
$def{objectType} = $term;
+ $def{objectLSID} = $lsid;
$def{description} = $desc;
$def{contactEmail} = $email;
$def{authURI} = $authURI;
@@ -516,6 +517,7 @@
my $obj = $Object->nodeName;
return undef unless ( $obj eq 'retrieveObjectDefinition' );
my $term = &_nodeTextContent( $Object, "objectType" );
+ my $lsid = &_nodeAttributeValue( $Object, "objectType", "lsid");
my $desc = &_nodeCDATAContent( $Object, "Description" );
if ( $desc =~ /<!\[CDATA\[((?>[^\]]+))\]\]>/ ) {
$desc = $1;
@@ -1970,6 +1972,32 @@
return $content;
}
+sub _nodeAttributeContent {
+
+ # will get text of **all** child $node from the given $DOM
+ # regardless of their depth!!
+ my ( $DOM, $node, $attr ) = @_;
+ my $x = $DOM->getElementsByTagName($node);
+ unless ( $x->get_node(1) ) { return }
+ my $n = $x->get_node(1);
+ my @att = $n->attributes($attr);
+ my $atval;
+ if (scalar(@att)){
+ $atval = $attr->getValue;
+ }
+ my @child = $x->get_node(1)->childNodes;
+ my $content;
+ foreach (@child) {
+
+ #print getNodeTypeName($_), "\t", $_->toString,"\n";
+ next
+ unless ( ( $_->nodeType == TEXT_NODE )
+ || ( $_->nodeType == CDATA_SECTION_NODE ) );
+ $content = $_->textContent;
+ }
+ return $content;
+}
+
sub _nodeRawContent {
# will get XML of **all** child $node from the given $DOM
More information about the MOBY-guts
mailing list