[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Wed Jul 20 15:43:57 UTC 2005


mwilkinson
Wed Jul 20 11:43:57 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv24704/MOBY

Modified Files:
	Central.pm authority.pm service_instance.pm 
Log Message:
The logic for retrieving authority objects was faulty.  It now creates a new db entry if the initial lookup fails

moby-live/Perl/MOBY Central.pm,1.161,1.162 authority.pm,1.3,1.4 service_instance.pm,1.13,1.14
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -r1.161 -r1.162
--- /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2005/07/19 14:33:46	1.161
+++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2005/07/20 15:43:57	1.162
@@ -1184,7 +1184,6 @@
 
 		if ( $ch == 0 ) {
 
-			use MOBY::Config;
 			my $conf = MOBY::Config->new();
 			my $path = $conf->{mobycentral}->{rdfagent};
 			my $rez  = system( $path. " " . $signatureURL );

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/authority.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Perl/MOBY/authority.pm	2005/07/13 21:53:12	1.3
+++ /home/repository/moby/moby-live/Perl/MOBY/authority.pm	2005/07/20 15:43:57	1.4
@@ -91,19 +91,13 @@
 	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
 
 	my $result = $adaptor->query_authority({authority_uri => $self->authority_uri});
-	my $authority_id = @$result[0]->{authority_id};
-	my $common = @$result[0]->{authority_common_name};
-	my $uri = @$result[0]->{authority_uri};
-	my $contact = @$result[0]->{contact_email};
-		
-	unless ($authority_id) {
+	unless (@$result[0]) {
 		my $insertid = $adaptor->insert_authority({authority_common_name => $self->authority_common_name}, 
 		{authority_uri => $self->authority_uri},
 		{contact_email => $self->contact_email});
-		
 		$self->authority_id( $insertid );
 	} else {
-		$self->authority_id($authority_id);
+		$self->authority_id(@$result[0]->{authority_id});
 	}
 	return $self;
 }

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm	2005/07/18 22:46:00	1.13
+++ /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm	2005/07/20 15:43:57	1.14
@@ -358,13 +358,14 @@
 	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
 	
 	my $result = $adaptor->query_authority({authority_uri => $self->authority_uri});
-	my $row = shift(@$result);
-	my $id = $row->{authority_id};
-	my $name = $row->{authority_common_name};
-	my $uri = $row->{authority_uri};
-	my $email = $row->{contact_email};
 	
-	if ( defined $id ) {
+	if ( @$result[0]) {
+		my $row = shift(@$result);
+		my $id = $row->{authority_id};
+		my $name = $row->{authority_common_name};
+		my $uri = $row->{authority_uri};
+		my $email = $row->{contact_email};
+
 		$authority = MOBY::authority->new(
 										   dbh           => $self->dbh,
 										   authority_id  => $id,




More information about the MOBY-guts mailing list