[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Wed Mar 22 01:12:02 UTC 2006
mwilkinson
Tue Mar 21 20:12:02 EST 2006
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv3826/Perl/MOBY
Modified Files:
Central.pm service_instance.pm
Log Message:
allow registration of services that include a user-defined LSID. This is required for the agent to properly register services based on service-provider-edited RDF, which must by necessily also have an updated LSID in order to reflect that it is edited
moby-live/Perl/MOBY Central.pm,1.248,1.249 service_instance.pm,1.36,1.37
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v
retrieving revision 1.248
retrieving revision 1.249
diff -u -r1.248 -r1.249
--- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2006/03/02 17:27:09 1.248
+++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2006/03/22 01:12:02 1.249
@@ -1074,6 +1074,8 @@
<Category>moby</Category> <!-- one of 'moby', 'cgi', 'wsdl' ; currently only 'moby' and 'wsdl' services are fully supported -->
<serviceName>YourServiceNameHere</serviceName>
<serviceType>TypeOntologyTerm</serviceType>
+ <signatureURL>http://path.to/your/signature/RDF.rdf</sisgnatureURL>
+ <servieLSID>urn:lsid:biomoby.org:serviceinstance:myservice:version</serviceLSID>
<authURI>your.URI.here</authURI>
<URL>http://URL.to.your/Service.script</URL>;
<contactEmail>your_name at contact.address.com</contactEmail>
@@ -1215,7 +1217,7 @@
$serviceName, $serviceType, $AuthURI,
$contactEmail, $URL, $authoritativeService,
$desc, $Category, $INPUTS,
- $OUTPUTS, $SECONDARY, $signatureURL
+ $OUTPUTS, $SECONDARY, $signatureURL, $serviceLSID
)
= &_registerServicePayload($payload);
@@ -1225,7 +1227,7 @@
# THE IMPLICATION IS THAT THEY ARE ASKING YOU TO VISIT THEIR urL now!!!!
if ( defined $signatureURL ) {
my $ch = 0;
- my $i;
+ my $i; # first check if any other parameters were filled-in. If so, then the implication is that they want us to register based on the data they have provided
foreach $i ( $serviceName, $serviceType, $AuthURI, $contactEmail, $URL, $desc)
{
if ( defined $i && $i ne "") {
@@ -1250,6 +1252,7 @@
}
#---------------------------------------------------------------
+
$authoritativeService = (defined($authoritativeService) && $authoritativeService) ? 1 : 0;
my $error;
$error .= "missing serviceName \n" unless defined $serviceName;
@@ -1337,6 +1340,7 @@
authoritative => $authoritativeService,
description => $desc,
signatureURL => $signatureURL,
+ lsid => $serviceLSID
);
return &_error( "Service registration failed for unknown reasons", "" ) if ( !defined $SVC );
@@ -1392,15 +1396,15 @@
my $RDF = _getServiceInstanceRDF(name=>$serviceName, auth=>$AuthURI, url=>$ENV{MOBY_SERVER}, uri=>$ENV{MOBY_URI});
unless ($RDF) {
- return &_success( "Registration successful but LSID resolution error",
- $SVC->service_instance_id, "" );
+ return &_success( "Registration successful but unable to create RDF - please contact your MOBY Central administrator",
+ $SVC->lsid, "" );
}
unless ( $RDF =~ /RDF/ ) {
return &_success(
- "Registration successful but LSID resolution error $RDF",
- $SVC->service_instance_id, "" );
+ "Registration successful but RDF is not correctly formatted:\n\n $RDF",
+ $SVC->lsid, "" );
}
- return &_success( "Registration successful", $SVC->service_instance_id,
+ return &_success( "Registration successful", $SVC->lsid,
$RDF );
}
@@ -1656,6 +1660,7 @@
&_nodeTextContent( $Object, "authoritativeService" );
my $URL = &_nodeTextContent( $Object, "URL" );
my $signatureURL = &_nodeTextContent( $Object, "signatureURL" );
+ my $serviceLSID = &_nodeTextContent( $Object, "serviceLSID" );
my $desc = &_nodeCDATAContent( $Object, "Description" );
my $INPUTS = &_nodeRawContent( $Object, "Input" ); # returns array ref
my $OUTPUTS = &_nodeRawContent( $Object, "Output" ); # returns array ref
@@ -1665,7 +1670,7 @@
$serviceName, $serviceType, $AuthURI,
$contactEmail, $URL, $authoritativeService,
$desc, $Category, $INPUTS,
- $OUTPUTS, $SECONDARIES, $signatureURL
+ $OUTPUTS, $SECONDARIES, $signatureURL, $serviceLSID
);
}
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm 2006/02/24 01:21:26 1.36
+++ /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm 2006/03/22 01:12:02 1.37
@@ -230,14 +230,16 @@
#create LSID for service and register it in the DB
my $_config ||= MOBY::Config->new;
- my $LSID_Auth = $_config->{mobycentral}->{lsid_authority};
- my $LSID_NS = $_config->{mobycentral}->{lsid_namespace};
- $LSID_Auth ||="biomoby.org";
- $LSID_NS ||="serviceinstance";
- my $service_lsid = "urn:lsid:$LSID_Auth:$LSID_NS:"
- . $self->authority_uri . ","
- . $self->servicename.":"."$date"; # LSID with timestamp
- $self->lsid($service_lsid);
+ unless ($self->lsid){ # if we were not passed an lsid by the service creator, we had better make one now
+ my $LSID_Auth = $_config->{mobycentral}->{lsid_authority};
+ my $LSID_NS = $_config->{mobycentral}->{lsid_namespace};
+ $LSID_Auth ||="biomoby.org";
+ $LSID_NS ||="serviceinstance";
+ my $service_lsid = "urn:lsid:$LSID_Auth:$LSID_NS:"
+ . $self->authority_uri . ","
+ . $self->servicename.":"."$date"; # LSID with timestamp
+ $self->lsid($service_lsid);
+ }
my $id = $self->adaptor->insert_service_instance(
category => $self->category,
servicename => $self->servicename,
@@ -248,7 +250,7 @@
authoritative => $self->authoritative,
description => $self->description,
signatureURL => $self->signatureURL,
- lsid => $service_lsid
+ lsid => $self->lsid
);
return undef unless $id;
$self->service_instance_id($id);
More information about the MOBY-guts
mailing list