[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Wed Jul 20 22:49:05 UTC 2005


mwilkinson
Wed Jul 20 18:49:05 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv26308/MOBY

Modified Files:
	service_instance.pm 
Log Message:
test for the pre-existing service seems to fail.  Try this code instead

moby-live/Perl/MOBY service_instance.pm,1.18,1.19
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm	2005/07/20 21:29:38	1.18
+++ /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm	2005/07/20 22:49:05	1.19
@@ -199,14 +199,11 @@
 	return undef unless $self->authority_uri;
 	return undef unless $self->servicename;
 
-	#$self->_dbh();
-	#return undef unless $self->dbh;
-	#my $dbh = $self->dbh;
 	if ( $self->test ) { return $self->service_instance_exists }
-	$self->authority( $self->_get_authority() )
-	  ; # this might not be necessary - it simply converts auth_uri to auth_id and v.v.?
-	 # it actually is necessary for the moment.  We need to put the logic of determining
-	 # service id into the mysql.pm module!!
+	if ($self->service_instance_exists){return -1}
+
+	$self->authority( $self->_get_authority() );
+
 	if ( $self->service_type ) {
 		my $OE = MOBY::OntologyServer->new( ontology => 'service' );
 		my ( $success, $message, $servicetypeURI ) =
@@ -229,15 +226,7 @@
 								      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
-		&& (    ( 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->{servicename}) { # if service exists, then instantiate it from the database retrieval we just did
+	if ($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'} );




More information about the MOBY-guts mailing list