[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Thu Aug 4 09:05:38 UTC 2005


mwilkinson
Thu Aug  4 05:05:38 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv7617/MOBY

Modified Files:
	Central.pm CommonSubs.pm 
Log Message:
cleaning up code, fixed docs.  If tests pass, then commented code will be removed

moby-live/Perl/MOBY Central.pm,1.200,1.201 CommonSubs.pm,1.65,1.66
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v
retrieving revision 1.200
retrieving revision 1.201
diff -u -r1.200 -r1.201
--- /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2005/08/03 12:01:53	1.200
+++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2005/08/04 09:05:38	1.201
@@ -22,7 +22,7 @@
 use MOBY::secondary_input;
 use MOBY::central_db_connection;
 use MOBY::Config;
-use MOBY::Client::Central;
+#use MOBY::Client::Central;
 
 #use MOBY::RDF::ServiceInstanceRDF;
 #use RDF::Core;
@@ -70,7 +70,7 @@
 CLIENT-SIDE
 
  use SOAP::Lite +autodispatch => 
-      proxy => 'http://mobycentral.cbr.nrc.ca/cgi-bin/MOBY05/mobycentral.pl',
+      proxy => 'http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl',
       on_fault => sub {
          my($soap, $res) = @_; 
          die ref $res ? $res->faultstring : $soap->transport->status, "\n";
@@ -1309,24 +1309,24 @@
 
 	foreach my $IN (@IN) {
 		my ( $success, $msg ) = &_registerArticles( $SVC, "input", $IN, undef );
-		return &_error(
-			"Registration Failed During INPUT Article Registration: $msg", "" )
-		  unless ( $success == 1 );
+		unless ( $success == 1 ){
+		    $SVC->DELETE_THYSELF;
+		    return &_error("Registration Failed During INPUT Article Registration: $msg", "" )
+		}
 	}
 	foreach my $OUT (@OUT) {
-		my ( $success, $msg ) =
-		  &_registerArticles( $SVC, "output", $OUT, undef );
-		return &_error(
-			"Registration Failed During OUTPUT Article Registration: $msg", "" )
-		  unless ( $success == 1 );
+		my ( $success, $msg ) = &_registerArticles( $SVC, "output", $OUT, undef );
+		unless ( $success == 1 ){
+		    $SVC->DELETE_THYSELF;
+		    return &_error("Registration Failed During OUTPUT Article Registration: $msg", "" )
+		}
 	}
 	foreach my $SEC (@SECS) {
-		my ( $success, $msg ) =
-		  &_registerArticles( $SVC, "secondary", $SEC, undef );
-		return &_error(
-			"Registration Failed During SECONDARY Article Registration: $msg",
-			"" )
-		  unless ( $success == 1 );
+		my ( $success, $msg ) = &_registerArticles( $SVC, "secondary", $SEC, undef );
+		unless ( $success == 1 ){
+		    $SVC->DELETE_THYSELF;
+		    return &_error("Registration Failed During SECONDARY Article Registration: $msg", "" )
+		}
 	}
 
  # we're going to do a findService here to find the service that we just created
@@ -1342,13 +1342,10 @@
 	);
 	unless ($si) {
 		$SVC->DELETE_THYSELF;
-		return &_error(
-"Registration Failed - newly registered service could not be discovered",
-			""
-		);
+		return &_error("Registration Failed - newly registered service could not be discovered","");
 	}
-	my $services         = MOBY::Client::Central::_parseServices( '', '', $si );
-	my $service_instance = shift @{$services};
+	#my $services         = MOBY::Client::Central::_parseServices( '', '', $si );
+	#my $service_instance = shift @{$services};
 
 	#	my $storage          = new RDF::Core::Storage::Memory;
 	#	my $model            = new RDF::Core::Model( Storage => $storage );
@@ -1425,19 +1422,21 @@
 sub _registerArticles {
 	my ( $SVC, $inout, $node, $collid ) = @_
 	  ; # node is a node of the XML dom representing an article to be registered
-	my $dbh = $SVC->dbh;
 	return ( -1, 'Bad node' ) unless $node->nodeType == ELEMENT_NODE;
 
 	# this is a Simple, Collection, or Parameter object
 	my $simp_coll = $node->nodeName;
 	$debug && &_LOG("TAGNAME in $inout _registerArticle is $simp_coll");
-	my $article = $node->getAttributeNode("articleName");    # may or may not have a name
+	my $article = $node->getAttributeNode("articleName");
+
 	if ($article) { $article = $article->getValue() }
 	$debug && &_LOG("ARTICLENAME in _registerArticle is $article");
+	if (lc($inout) eq "input"){
+	    return (-1, "Input Simples and collections are required to have an articleName as of API version 0.86") if (!$article && !$collid);
+	}
+	
 	my ( $object_type, @namespaces );
 	if ( $simp_coll eq "Collection" ) {
-open OUT, 'C;\out.txt';
-print OUT "Collection found\n";
 		$debug && &_LOG("Collection!\n");
 		my $collection_id;
 		if ( $inout eq 'input' ) {
@@ -1453,29 +1452,21 @@
 			return ( -1, "found article that was neither input nor output" );
 		}
 
-# the following SQl belongs in the service_instance object, but screw it, I'm running out of time!
-#$dbh->do("insert into collection_$inout (service_instance_id, article_name) values (?,?)", undef, ($SVC->service_instance_id, $article));
-#my $collection_id=$dbh->{mysql_insertid};
 		my $Simples = $node->getElementsByTagName('Simple');
 		my $length  = $Simples->size();
-print OUT "Collection has length $length\n";
 		unless ( $length > 0 ) {
 			return ( -1,"Your collection must be a collection of one Simple type"
 			);
 		}
 		unless ( $length == 1 ) {
-print  "\n\n\n\n\nLENGTH OF SIMPLES WAS $length\n\n\n\n\n";
 			return ( -1,"As of API v0.86, Collections must not be of more than one Simple type"
 			);
 		}
 		for ( my $x = 1 ; $x <= $length ; ++$x ) {
-			my ( $success, $message ) =
-			  &_registerArticles( $SVC, $inout, $Simples->get_node($x),
-				$collection_id );
+			my ( $success, $message ) = &_registerArticles( $SVC, $inout, $Simples->get_node($x), $collection_id );
 			unless ( $success == 1 ) { return ( -1, $message ); }
 		}
-	}
-	elsif ( $simp_coll eq "Simple" ) {
+	} elsif ( $simp_coll eq "Simple" ) {
 		my $article = $node->getAttributeNode("articleName");
 		$article = $article->getValue() if $article;
 
@@ -1517,7 +1508,7 @@
 			}
 		}
 		chop($namespace_string);    # remove trailing comma
-		my $dbh = $SVC->dbh;
+
 		my $service_instance_id;
 		unless ($collid)
 		{ # this SIMPLE is either alone, or is part of a COLLECTION ($collid > 0)
@@ -1533,9 +1524,7 @@
 			);
 			unless ($sinput) {
 				$SVC->DELETE_THYSELF;
-				return ( -1,
-"registration failed during registration of input object $typeURI.  Unknown reasons."
-				);
+				return ( -1, "registration failed during registration of input object $typeURI.  Unknown reasons.");
 			}
 		}
 		elsif ( $inout eq 'output' ) {
@@ -1547,8 +1536,7 @@
 			);
 			unless ($soutput) {
 				$SVC->DELETE_THYSELF;
-				return ( -1,
-"registration failed during registration of output object $typeURI.  Unknown reasons."
+				return ( -1,"registration failed during registration of output object $typeURI.  Unknown reasons."
 				);
 			}
 		}
@@ -1573,8 +1561,7 @@
 		map { $valid = 1 if $datatype eq $_ } @{$secondaries};
 		unless ($valid) {
 			$SVC->DELETE_THYSELF;
-			return ( -1,
-"Registration failed.  $datatype must be one of type Integer, String, DateTime, or Float."
+			return ( -1,"Registration failed.  $datatype must be one of type Integer, String, DateTime, or Float."
 			);
 		}
 		
@@ -1903,7 +1890,7 @@
 # we also count the number of criterion
 # we only want the service_id's that appear as many times as the criterion we have
 # since they will have matched every criterion.
-	my $dbh = MOBY::central_db_connection->new()->dbh;
+
 	if ( $findme{authoritative} ) {
 		++$criterion_count;
 		$debug
@@ -1918,7 +1905,7 @@
 		
 		
 		unless ( scalar @{$ids} ) {
-			return &_serviceListResponse( $dbh, undef );
+			return &_serviceListResponse(undef );
 		}
 		$debug
 		  && _LOG( "services " . ( join ',', @{$ids} ) . " incrememted\n" );
@@ -1933,7 +1920,7 @@
 		my ( $exists, $message, $URI ) =
 		  $OS->serviceExists( term => $findme{serviceType} );
 		unless ($exists) {
-			return &_serviceListResponse( $dbh, undef );
+			return &_serviceListResponse(undef );
 		}
 		++$criterion_count;
 		$debug
@@ -1967,7 +1954,7 @@
 		my $ids = _extract_ids($adaptor->query_service_instance(authority_uri => $findme{'authURI'}));
 
 		unless ( scalar @{$ids} ) {
-			return &_serviceListResponse( $dbh, undef );
+			return &_serviceListResponse(undef );
 		}
 		$debug
 		  && _LOG( "services " . ( join ',', @{$ids} ) . " incrememted\n" );
@@ -1985,7 +1972,7 @@
 		my $ids = _extract_ids($adaptor->query_service_instance(servicename => $findme{servicename}));
 
 		unless ( scalar @{$ids} ) {
-			return &_serviceListResponse( $dbh, undef );
+			return &_serviceListResponse( undef );
 		}
 		$debug
 		  && _LOG( "services " . ( join ',', @{$ids} ) . " incrememted\n" );
@@ -2003,7 +1990,7 @@
 		my $ids = _extract_ids($adaptor->query_service_instance(category => lc( $findme{category}) ));
 	
 		unless ( scalar @{$ids} ) {
-			return &_serviceListResponse( $dbh, undef );
+			return &_serviceListResponse( undef );
 		}
 		$debug
 		  && _LOG( "services " . ( join ',', @{$ids} ) . " incrememted\n" );
@@ -2021,7 +2008,7 @@
 		$ids = _extract_ids($ids);  # this is the hash-list that comes back from do_query
 		  
 		unless ( scalar @{$ids} ) {
-			return &_serviceListResponse( $dbh, undef );
+			return &_serviceListResponse( undef );
 		}
 		$debug
 		  && _LOG( "services " . ( join ',', @{$ids} ) . " incrememted\n" );
@@ -2038,8 +2025,7 @@
 		my $obj = ( shift @{ $findme{inputObjects} } );
 		my @si_ids;
 		@si_ids =
-		  &_searchForServicesWithArticle( $dbh, "input", $obj,
-			$findme{'expandObjects'}, '' )
+		  &_searchForServicesWithArticle( "input", $obj,$findme{'expandObjects'}, '' )
 		  if defined $obj;
 		$debug
 		  && _LOG("Initial Search For Services with INPUT Article found @si_ids\n");
@@ -2053,11 +2039,10 @@
 			{             # iterate through the rest of the objects
 				next unless $obj;
 				$debug
-				  && _LOG( "FIRST: ", $dbh, "input", $obj,
+				  && _LOG( "FIRST: ", "input", $obj,
 					$findme{'expandObjects'}, '' );
 				my @new_ids =
-				  &_searchForServicesWithArticle( $dbh, "input", $obj,
-					$findme{'expandObjects'}, '' );    # get their service ids
+				  &_searchForServicesWithArticle("input", $obj,$findme{'expandObjects'}, '' );    # get their service ids
 				$debug
 				  && _LOG("Subsequent Search For Services with INPUT Article found @new_ids\n");
 				my @good_ids;
@@ -2093,8 +2078,7 @@
 			"outputObject added; criterion count is now $criterion_count\n");
 		my $obj = ( shift @{ $findme{outputObjects} } );
 		my @si_ids;
-		@si_ids = &_searchForServicesWithArticle( $dbh, "output", $obj, '' )
-		  if defined $obj;
+		@si_ids = &_searchForServicesWithArticle("output", $obj, '' )if defined $obj;
 		$debug
 		  && _LOG(
 			"Initial Search For Services with OUTPUT Article found @si_ids\n");
@@ -2108,11 +2092,10 @@
 			{             # iterate through the rest of the objects
 				next unless $obj;
 				my @new_ids =
-				  &_searchForServicesWithArticle( $dbh, "output", $obj, '' )
+				  &_searchForServicesWithArticle("output", $obj, '' )
 				  ;       # get their service ids
 				$debug
-				  && _LOG(
-"Subsequent Search For Services with OUTPUT Article found @new_ids\n"
+				  && _LOG("Subsequent Search For Services with OUTPUT Article found @new_ids\n"
 				  );
 				my @good_ids;
 				my %good_ids;
@@ -2151,7 +2134,7 @@
 		  $criterion_count;    # has to have matched every criterion
 		push @final, $id;
 	}
-	return &_serviceListResponse( $dbh, @final );
+	return &_serviceListResponse(@final );
 }
 
 sub _extract_ids {
@@ -2170,22 +2153,22 @@
 
 #Eddie - converted
 sub _searchForServicesWithArticle {
-	my ( $dbh, $inout, $node, $expand, $coll ) = @_;
+	my ($inout, $node, $expand, $coll ) = @_;
 	return ()
 	  unless $node->nodeType ==
 	  ELEMENT_NODE;  # this will erase all current successful service instances!
 	$debug
-	  && _LOG( "searchServWthArticle ", $dbh, $inout, $node, $expand, $coll );
+	  && _LOG( "searchServWthArticle ", $inout, $node, $expand, $coll );
 
 	# this element node may be a Simple or a Collection object
 	my $simp_coll = $node->nodeName;
 	$debug && &_LOG("TAGNAME in _searchForArticle is $simp_coll");
 	my @valid_ids;
 	if ( $simp_coll eq "Collection" ) {
-		@valid_ids = &_searchForCollection( $dbh, $node, $expand, $inout );
+		@valid_ids = &_searchForCollection( $node, $expand, $inout );
 	}
 	elsif ( $simp_coll eq "Simple" ) {
-		@valid_ids = &_searchForSimple( $dbh, $node, $expand, $inout );
+		@valid_ids = &_searchForSimple( $node, $expand, $inout );
 	}
 	return @valid_ids;
 }
@@ -2196,8 +2179,8 @@
 
 	# returns list of service_instance ID's
 	# that match this simple
-	my ( $dbh, $node, $expand, $inout ) = @_;
-	$debug && _LOG( $dbh, $node, $expand, $inout );
+	my ( $node, $expand, $inout ) = @_;
+	$debug && _LOG( $node, $expand, $inout );
 	my ( $objectURI, $namespaceURIs ) =
 	  &_extractObjectTypesAndNamespaces($node);  # (objectType, [ns1, ns2, ns3])
 	unless ($objectURI) { return () }
@@ -2253,7 +2236,7 @@
 	$CONFIG ||= MOBY::Config->new;    # exported by Config.pm
 	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
 
-	my ( $dbh, $node, $expand, $inout ) =
+	my ( $node, $expand, $inout ) =
 	  @_;         # $node in this case is a Collection object
 
 	# luckily, we can return a redundant list of service id's and
@@ -2535,7 +2518,6 @@
 	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
 
 	my ($pkg) = @_;
-	my $dbh   = MOBY::central_db_connection->new()->dbh;
 
 	my $result = $adaptor->get_all_authorities();
 
@@ -2569,7 +2551,7 @@
 	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
 
 	my ($pkg) = shift;
-	my $dbh   = MOBY::central_db_connection->new()->dbh;
+
 	my $result = $adaptor->get_service_names();
 	my $names = "<serviceNames>\n";
 	foreach my  $row (@$result) {
@@ -2610,8 +2592,7 @@
 		if ( $desc =~ /<!\[CDATA\[((?>[^\]]+))\]\]>/ ) {
 			$desc = $1;
 		}
-		$types .=
-"<serviceType name='$serv' lsid='$lsid'>\n<Description><![CDATA[$desc]]></Description>\n</serviceType>\n";
+		$types .="<serviceType name='$serv' lsid='$lsid'>\n<Description><![CDATA[$desc]]></Description>\n</serviceType>\n";
 	}
 	$types .= "</serviceTypes>\n";
 	return $types;
@@ -2653,8 +2634,7 @@
 		if ( $desc =~ /<!\[CDATA\[((?>[^\]]+))\]\]>/ ) {
 			$desc = $1;
 		}
-		$types .=
-"<relationshipType relationship='$name' authority='$auth' lsid='$lsid'>\n<Description><![CDATA[$desc]]></Description>\n</relationshipType>\n";
+		$types .="<relationshipType relationship='$name' authority='$auth' lsid='$lsid'>\n<Description><![CDATA[$desc]]></Description>\n</relationshipType>\n";
 	}
 	$types .= "</relationshipTypes>\n";
 	return $types;
@@ -2688,8 +2668,7 @@
 		if ( $desc =~ /<!\[CDATA\[((?>[^\]]+))\]\]>/ ) {
 			$desc = $1;
 		}
-		$obj .=
-"<Object name='$name' lsid='$lsid'>\n<Description><![CDATA[$desc]]></Description>\n</Object>\n";
+		$obj .="<Object name='$name' lsid='$lsid'>\n<Description><![CDATA[$desc]]></Description>\n</Object>\n";
 	}
 	$obj .= "</objectNames>\n";
 	return $obj;
@@ -2792,8 +2771,7 @@
 		if ( $desc =~ /<!\[CDATA\[((?>[^\]]+))\]\]>/ ) {
 			$desc = $1;
 		}
-		$ns .=
-"<Namespace name='$namespace' lsid='$lsid'>\n<Description><![CDATA[$desc]]></Description>\n</Namespace>\n";
+		$ns .= "<Namespace name='$namespace' lsid='$lsid'>\n<Description><![CDATA[$desc]]></Description>\n</Namespace>\n";
 	}
 	$ns .= "</Namespaces>";
 	return $ns;
@@ -3005,24 +2983,24 @@
 *DUMP = \&DUMP_MySQL;    # alias it for backward compatibility
 *DUMP = \&DUMP_MySQL;    # alias it for backward compatibility
 
-sub _flatten {
-	$CONFIG ||= MOBY::Config->new;    # exported by Config.pm
-	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
-
-	# from a given term, traverse the ontology
-	# and flatten it into a list of parent terms
-	my ( $dbh, $type, $term, $seen ) = @_;
-
-	my $result = $adaptor->get_parent_terms(relationship_type_id => $type,
-						term => $term);
-
-	foreach my $row (@$result) {
-		my $term = $row->{term};
-		next if ${$seen}{$term};
-		&_flatten( $dbh, $type, $term, $seen );
-		${$seen}{$term} = 1;
-	}
-}
+#sub _flatten {
+#	$CONFIG ||= MOBY::Config->new;    # exported by Config.pm
+#	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+#
+#	# from a given term, traverse the ontology
+#	# and flatten it into a list of parent terms
+#	my ( $dbh, $type, $term, $seen ) = @_;
+#
+#	my $result = $adaptor->get_parent_terms(relationship_type_id => $type,
+#						term => $term);
+#
+#	foreach my $row (@$result) {
+#		my $term = $row->{term};
+#		next if ${$seen}{$term};
+#		&_flatten( $dbh, $type, $term, $seen );
+#		${$seen}{$term} = 1;
+#	}
+#}
 
 #Eddie - Converted
 sub _ISAPayload {
@@ -3052,48 +3030,48 @@
 =head2 _getValidServices
 
  Title     :	_getValidServices
- Usage     :	%valid = $MOBY->_getValidServices($dbh, $sth_hash, $query, $max_return)
+ Usage     :	%valid = $MOBY->_getValidServices($sth_hash, $query, $max_return)
  Function  :	execute the query in $query to return a non-redundant list of matching services
  Returns   :	XML 
  Args      :	none
 
 =cut
 
-sub _getValidServices {
-	my ( $dbh, $sth_hash, $query, $max_return ) = @_;
-	my %sth = %{$sth_hash};
-	$debug && &_LOG("QUERY: \n$query\n\n");
-	my $this_query = $dbh->prepare($query);
-	$this_query->execute;
-	my $response;
-	my %seen;
-	$response = "<Services>\n";
-
-	while ( my ( $serviceName, $objectOUT, $AuthURI, $desc, $type, $cat ) =
-		$this_query->fetchrow_array() )
-	{
-		$debug
-		  && &_LOG("$serviceName, $objectOUT, $AuthURI,$desc, $type, $cat\n");
-		next
-		  if $seen{ "$AuthURI" . "||"
-			  . "$serviceName" };    # non-redundant list please
-		$seen{ "$AuthURI" . "||" . "$serviceName" } = 1;
-		$response .=
-		  "<Service authURI='$AuthURI' serviceName='$serviceName'>\n";
-		$response .= "<Category>$cat</Category>\n";
-		$response .= "<serviceType>$type</serviceType>\n";
-		$response .= "<outputObject>$objectOUT</outputObject>\n";
-		if ( $desc =~ /<!\[CDATA\[((?>[^\]]+))\]\]>/ ) {
-			$desc = $1;
-		}
-		$response .= "<Description><![CDATA[$desc]]></Description>\n";
-		$response .= "</Service>\n";
-		if ($max_return) { --$max_return; last unless $max_return }
-	}
-	$response .= "</Services>\n";
-	$debug && &_LOG("\nFINAL RESPONSE IS \n$response\n\n");
-	return $response;
-}
+#sub _getValidServices {
+#	my ($sth_hash, $query, $max_return ) = @_;
+#	my %sth = %{$sth_hash};
+#	$debug && &_LOG("QUERY: \n$query\n\n");
+#	my $this_query = $dbh->prepare($query);
+#	$this_query->execute;
+#	my $response;
+#	my %seen;
+#	$response = "<Services>\n";
+#
+#	while ( my ( $serviceName, $objectOUT, $AuthURI, $desc, $type, $cat ) =
+#		$this_query->fetchrow_array() )
+#	{
+#		$debug
+#		  && &_LOG("$serviceName, $objectOUT, $AuthURI,$desc, $type, $cat\n");
+#		next
+#		  if $seen{ "$AuthURI" . "||"
+#			  . "$serviceName" };    # non-redundant list please
+#		$seen{ "$AuthURI" . "||" . "$serviceName" } = 1;
+#		$response .=
+#		  "<Service authURI='$AuthURI' serviceName='$serviceName'>\n";
+#		$response .= "<Category>$cat</Category>\n";
+#		$response .= "<serviceType>$type</serviceType>\n";
+#		$response .= "<outputObject>$objectOUT</outputObject>\n";
+#		if ( $desc =~ /<!\[CDATA\[((?>[^\]]+))\]\]>/ ) {
+#			$desc = $1;
+#		}
+#		$response .= "<Description><![CDATA[$desc]]></Description>\n";
+#		$response .= "</Service>\n";
+#		if ($max_return) { --$max_return; last unless $max_return }
+#	}
+#	$response .= "</Services>\n";
+#	$debug && &_LOG("\nFINAL RESPONSE IS \n$response\n\n");
+#	return $response;
+#}
 
 =head2 _getServiceWSDL
 
@@ -3149,24 +3127,24 @@
 	return $wsdl;
 }
 
-sub _getCGIService {
-	my ( $dbh, $sth_hash, $id, $serviceName, $AuthURI, $URL, $desc, $category )
-	  = @_;
-	my %sth = %{$sth_hash};
-
-   # "Select OE.term, O.xsd, SP.type
-   # from Object as O, OntologyEntry as OE, ServiceParameter as SP, Service as S
-   # where O.ontologyentry_id = OE.id
-   # AND SP.ontologyentry_id = OE.id
-   # and SP.service_id = ?
-	my $sth = $dbh->prepare( $sth{get_server_parameters} );
-	$sth->execute($id);
-	my ( $Object, $sprintf, $in ) = $sth->fetchrow_array();
-	if ( $sprintf =~ /<!\[CDATA\[((?>[^\]]+))\]\]>/ ) {
-		$sprintf = $1;
-	}
-	return "<GETstring><![CDATA[$sprintf]]></GETstring>";
-}
+#sub _getCGIService {
+#	my ( $dbh, $sth_hash, $id, $serviceName, $AuthURI, $URL, $desc, $category )
+#	  = @_;
+#	my %sth = %{$sth_hash};
+#
+#   # "Select OE.term, O.xsd, SP.type
+#   # from Object as O, OntologyEntry as OE, ServiceParameter as SP, Service as S
+#   # where O.ontologyentry_id = OE.id
+#   # AND SP.ontologyentry_id = OE.id
+#   # and SP.service_id = ?
+#	my $sth = $dbh->prepare( $sth{get_server_parameters} );
+#	$sth->execute($id);
+#	my ( $Object, $sprintf, $in ) = $sth->fetchrow_array();
+#	if ( $sprintf =~ /<!\[CDATA\[((?>[^\]]+))\]\]>/ ) {
+#		$sprintf = $1;
+#	}
+#	return "<GETstring><![CDATA[$sprintf]]></GETstring>";
+#}
 
 
 #Eddie - converted
@@ -3319,7 +3297,7 @@
 	$CONFIG ||= MOBY::Config->new;    # exported by Config.pm
 	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
 
-	my ( $dbh, @ids ) = @_;
+	my (@ids ) = @_;
 	my $output = "";
 	my $OSobj  = MOBY::OntologyServer->new( ontology => 'object' );
 	my $OSns   = MOBY::OntologyServer->new( ontology => 'namespace' );
@@ -3501,6 +3479,9 @@
 
 sub _error {
 	my ( $message, $id ) = @_;
+	$id ||="";
+	$message ||="";
+	
 	my $reg = &Registration(
 		{
 			success => 0,

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm	2005/06/30 11:41:25	1.65
+++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm	2005/08/04 09:05:38	1.66
@@ -1623,7 +1623,6 @@
 =cut
 
 sub whichDeepestParentObject {
-	use MOBY::Client::OntologyServer;
 	my ( $CENTRAL, $queryTerm, $termlist ) = @_;
 	return ( undef, undef )
 	  unless (    $CENTRAL




More information about the MOBY-guts mailing list