[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at dev.open-bio.org
Fri Feb 9 00:27:07 UTC 2007


mwilkinson
Thu Feb  8 19:27:07 EST 2007
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory dev.open-bio.org:/tmp/cvs-serv32158/MOBY

Modified Files:
	CommonSubs.pm 
Log Message:
one more function needs to be deprecated since it isnt API compliant (it doesn't use query id's)
moby-live/Perl/MOBY CommonSubs.pm,1.95,1.96
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm	2007/02/09 00:19:01	1.95
+++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm	2007/02/09 00:27:07	1.96
@@ -832,65 +832,6 @@
 }
 
 
-=head1 Client-Side Common Subroutines
-
-These are the subroutines that will be most commonly used Client-Side for
-processing the output of a MOBY service
-
-=head2 processResponse
-
-=cut
-
-sub processResponse {
-	my ( $result ) = @_;
-	return ( [], [] ) unless $result;
-	my $moby;
-	unless ( ref( $result ) =~ /XML\:\:LibXML/ ) {
-		my $parser = XML::LibXML->new();
-		my $doc    = $parser->parse_string( $result );
-		$moby = $doc->getDocumentElement();
-	} else {
-		$moby = $result->getDocumentElement();
-	}
-	my @objects;
-	my @collections;
-	my @Xrefs;
-	my $success = 0;
-	foreach my $which ('mobyData', 'moby:mobyData') {
-		my $responses = $moby->getElementsByTagName( $which );
-		next unless $responses;
-		foreach my $n ( 1 .. ( $responses->size() ) ) {
-			my $resp = $responses->get_node( $n );
-			foreach my $response_component ( $resp->childNodes ) {
-				next unless $response_component->nodeType == ELEMENT_NODE;
-				if ( $response_component->nodeName =~ /^(moby:|)Simple$/ )
-				  {
-					foreach my $Object ( $response_component->childNodes ) {
-						next unless $Object->nodeType == ELEMENT_NODE;
-						$success = 1;
-						push @objects, $Object;
-					}
-				} elsif ( $response_component->nodeName =~ /^(moby:|)Collection$/ )
-				{
-					my @objects;
-					foreach my $simple ( $response_component->childNodes ) {
-						next unless $simple->nodeType == ELEMENT_NODE;
-						next unless ( $simple->nodeName =~ /^(moby:|)Simple$/ );
-						foreach my $Object ( $simple->childNodes ) {
-							next unless $Object->nodeType == ELEMENT_NODE;
-							$success = 1;
-							push @objects, $Object;
-						}
-					}
-					push @collections, \@objects
-					  ;  #I'm not using collections yet, so we just use Simples.
-				}
-			}
-		}
-	}
-	return ( \@collections, \@objects );
-}
-
 
 =head1 ANCILIARY ELEMENTS
 
@@ -1389,6 +1330,63 @@
 
 =head1 DEPRECATED FUNCTIONS
 
+=head2 processResponse
+
+DEPRECATED
+
+=cut
+
+sub processResponse {
+print STDERR "the processResponse subroutine in MOBY::CommonSubs is deprecated.  Please use serviceResponseParser for API compliance\n";
+	my ( $result ) = @_;
+	return ( [], [] ) unless $result;
+	my $moby;
+	unless ( ref( $result ) =~ /XML\:\:LibXML/ ) {
+		my $parser = XML::LibXML->new();
+		my $doc    = $parser->parse_string( $result );
+		$moby = $doc->getDocumentElement();
+	} else {
+		$moby = $result->getDocumentElement();
+	}
+	my @objects;
+	my @collections;
+	my @Xrefs;
+	my $success = 0;
+	foreach my $which ('mobyData', 'moby:mobyData') {
+		my $responses = $moby->getElementsByTagName( $which );
+		next unless $responses;
+		foreach my $n ( 1 .. ( $responses->size() ) ) {
+			my $resp = $responses->get_node( $n );
+			foreach my $response_component ( $resp->childNodes ) {
+				next unless $response_component->nodeType == ELEMENT_NODE;
+				if ( $response_component->nodeName =~ /^(moby:|)Simple$/ )
+				  {
+					foreach my $Object ( $response_component->childNodes ) {
+						next unless $Object->nodeType == ELEMENT_NODE;
+						$success = 1;
+						push @objects, $Object;
+					}
+				} elsif ( $response_component->nodeName =~ /^(moby:|)Collection$/ )
+				{
+					my @objects;
+					foreach my $simple ( $response_component->childNodes ) {
+						next unless $simple->nodeType == ELEMENT_NODE;
+						next unless ( $simple->nodeName =~ /^(moby:|)Simple$/ );
+						foreach my $Object ( $simple->childNodes ) {
+							next unless $Object->nodeType == ELEMENT_NODE;
+							$success = 1;
+							push @objects, $Object;
+						}
+					}
+					push @collections, \@objects
+					  ;  #I'm not using collections yet, so we just use Simples.
+				}
+			}
+		}
+	}
+	return ( \@collections, \@objects );
+}
+
 
 =head2 genericServiceInputParser
 




More information about the MOBY-guts mailing list