[MOBY-guts] biomoby commit

Eddie Kawas kawas at dev.open-bio.org
Thu Jun 19 17:02:26 UTC 2008


kawas
Thu Jun 19 13:02:25 EDT 2008
Update of /home/repository/moby/moby-live/Perl/MOBY-Server/share/cgi
In directory dev.open-bio.org:/tmp/cvs-serv3353/Perl/MOBY-Server/share/cgi

Modified Files:
	RESOURCES 
Log Message:
changes to the service instance regex so that requests in the form of authURI/service_name and authURI,service_name are fullfilled
moby-live/Perl/MOBY-Server/share/cgi RESOURCES,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/share/cgi/RESOURCES,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Perl/MOBY-Server/share/cgi/RESOURCES	2008/03/06 23:18:32	1.2
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/share/cgi/RESOURCES	2008/06/19 17:02:25	1.3
@@ -87,10 +87,43 @@
 		print $form->header('text/xml'), $rdf if $rdf;
 	} if $1;
 } elsif ( $url =~
-m/^RESOURCES\/MOBY\-S\/ServiceInstances(\/[A-Za-z0-9_\-.]*,[A-Za-z0-9_\-]*)?$/
+m/^RESOURCES\/MOBY\-S\/ServiceInstances(\/[A-Za-z0-9_\-.]*,[A-Za-z0-9_\-]*){1}$/
   )
 {
 	my $string = $1 || "";
+	# remove the trailing forward slash
+	$string =~ s/^\///;
+	do {
+		my $x     = MOBY::RDF::Ontologies::Services->new;
+		my $sname = substr ($string, index($string, ',')+1);
+		my $prov  = substr ($string, 0, index($string, ','));
+
+		# get pretty printed RDF/XML for one service
+		$x = $x->findService(
+							  {
+								serviceName => $sname,
+								authURI     => $prov,
+								isAlive     => "yes"
+							  }
+		);
+		print $form->header('text/xml'), $x if $x;
+	} if $string;
+	
+	do {
+		print $form->header('text/html');
+		$form->start_html( -title => 'not MOBY-S', );
+		print h2( "not", "MOBY-S" );
+		print end_html;
+	} unless $string;
+	
+} elsif ( $url =~
+m/^RESOURCES\/MOBY\-S\/ServiceInstances(\/[A-Za-z0-9_\-.]*\/[A-Za-z0-9_\-]*)?$/
+  )
+{
+	my $string = $1 || "";
+	# remove the trailing forward slash
+	$string =~ s/^\///;
+	
 	do {
 		my $x;
 
@@ -122,14 +155,15 @@
 	} unless $string;
 	do {
 		my $x     = MOBY::RDF::Ontologies::Services->new;
-		my $sname = substr( $string, index( $string, ',' ) + 1 );
-		my $prov  = substr( $string, 1, index( $string, ',' ) - 1 );
+		my $sname = substr ($string, index($string, '/')+1);
+		my $prov  = substr ($string, 0, index($string, '/'));
 
 		# get pretty printed RDF/XML for one service
 		$x = $x->findService(
 							  {
 								serviceName => $sname,
 								authURI     => $prov,
+								isAlive     => "yes"
 							  }
 		);
 		print $form->header('text/xml'), $x if $x;




More information about the MOBY-guts mailing list