[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Wed Jul 20 21:29:38 UTC 2005


mwilkinson
Wed Jul 20 17:29:38 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv26000/MOBY

Modified Files:
	service_instance.pm 
Log Message:
query_service_instance does not return boolean, so the test has to be more explicit

moby-live/Perl/MOBY service_instance.pm,1.17,1.18
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm	2005/07/20 21:23:54	1.17
+++ /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm	2005/07/20 21:29:38	1.18
@@ -229,19 +229,15 @@
 								      servicename => $self->servicename,
 								      authority_uri => $self->authority_uri);
 	my $existing_service = shift(@$existing_services);
-	if (
-		($existing_service->{servicename}) # if it exists, you are not allowed to have passed anything other than service name and authorityURI
+	if (($existing_service->{servicename}) # if it exists, you are not allowed to have passed anything other than service name and authorityURI
 		&& (    ( defined $self->category )
 			 || ( defined $self->service_type )
 			 || ( defined $self->url )
 			 || ( defined $self->contact_email )
 			 || ( defined $self->description ) )
-	  )
-	{
-		return
-		  -1;  # no no no, not alowed to do that!  I will not give you an object
-	} elsif ($existing_service)
-	{ # if service exists, then instantiate it from the database retrieval we just did
+	  ){
+		return -1;  # no no no, not alowed to do that!  I will not give you an object
+	} elsif ($existing_service->{servicename}) { # if service exists, then instantiate it from the database retrieval we just did
 		$self->service_instance_id( $existing_service->{'serviceid'} );
 		$self->category( $existing_service->{'category'} );
 		$self->service_type( $existing_service->{'servicetype'} );
@@ -250,26 +246,22 @@
 		$self->description( $existing_service->{'desc'} );
 		$self->authority( $existing_service->{'authURI'} );
 		$self->signatureURL( $existing_service->{'signatureURL'} );
-	    $self->lsid( $existing_service->{'lsid'} );
+		$self->lsid( $existing_service->{'lsid'} );
 		$self->{__exists__} = 1;    # this service already existed
-	} elsif (
-		!($existing_service)        # if it doesn't exist
-		&& (
-			 defined $self->category
-		)    # and you have given me things I need to create it
+	} elsif (!($existing_service->{servicename})        # if it doesn't exist
+		&& (defined $self->category)    # and you have given me things I need to create it
 		&& ( defined $self->service_type )
 		&& ( defined $self->url )
 		&& ( defined $self->contact_email )
 		&& ( defined $self->description )
-	  )
-	{        # then create it de novo if we have enough information
+	  ) {        # then create it de novo if we have enough information
 		#create LSID for service and register it in the DB
-	my $_config ||= MOBY::Config->new;
-	my $service_lsid = "urn:lsid:"
-	  . $_config->{mobycentral}->{lsid_authority} . ":"
-	  . $_config->{mobycentral}->{lsid_namespace} . ":"
-	  . $self->authority_uri . ","
-	  . $self->servicename;
+		my $_config ||= MOBY::Config->new;
+		my $service_lsid = "urn:lsid:"
+		  . $_config->{mobycentral}->{lsid_authority} . ":"
+		  . $_config->{mobycentral}->{lsid_namespace} . ":"
+		  . $self->authority_uri . ","
+		  . $self->servicename;
  
 		my $id = $self->adaptor->insert_service_instance(
 									{category         => $self->category},




More information about the MOBY-guts mailing list