[MOBY-guts] biomoby commit

Eddie Kawas kawas at dev.open-bio.org
Tue Aug 28 22:43:16 UTC 2007


kawas
Tue Aug 28 18:43:16 EDT 2007
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory dev.open-bio.org:/tmp/cvs-serv22031

Modified Files:
	Central.pm 
Log Message:
rdf now generated by perl scripts rather than java ...
moby-live/Perl/MOBY Central.pm,1.285,1.286
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v
retrieving revision 1.285
retrieving revision 1.286
diff -u -r1.285 -r1.286
--- /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2007/07/18 10:47:24	1.285
+++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2007/08/28 22:43:16	1.286
@@ -22,6 +22,7 @@
 use MOBY::secondary_input;
 use MOBY::central_db_connection;
 use MOBY::Config;
+use MOBY::RDF::Ontologies::Services;
 use URI;
 use LWP;
 use MOBY::CommonSubs;
@@ -1437,7 +1438,7 @@
 	}
 
 
-	my $RDF = _getServiceInstanceRDF(name=>$serviceName, auth=>$AuthURI, url=>$ENV{MOBY_SERVER}, uri=>$ENV{MOBY_URI});
+	my $RDF = _getServiceInstanceRDF(name=>$serviceName, auth=>$AuthURI);
 	unless ($RDF) {
 		return &_success( "Registration successful but unable to create RDF - please contact your MOBY Central administrator",
 			$SVC->lsid, "" );
@@ -1454,23 +1455,22 @@
 
 sub _getServiceInstanceRDF {
 	my ( %args ) = @_;
-	my $browser = LWP::UserAgent->new(%user_agent_args);
-	my $conf = MOBY::Config->new();
-	return "" unless $conf->{mobycentral}->{rdf_generator};
-	my $url = URI->new( $conf->{mobycentral}->{rdf_generator} );
-    # makes an object representing the URL
-    $url->query_form(  # And here the form data pairs:
-    			'name'      => $args{name},
-    			'auth' 		=> $args{auth},
-    			'url' 		=> $args{url},
-    			'uri' 		=> $args{uri}
-  			);
- 	my $response = $browser->get($url);
- 	if ($response) {
-		my $rdfXML = $response->content;
-		# removed cdata element because i want to ensure that we can pass the error in the message.
-		# fixes the embedded CDATA bug found by IRRI
-		return "$rdfXML" unless ( $rdfXML =~ /title>Service Instance Not Found</ );
+	my $x = MOBY::RDF::Ontologies::Services->new;
+	my $xml = "";
+	eval {
+		$xml = $x->findService(
+			{
+				serviceName => $args{name},
+				authURI => $args{auth}
+			}
+	 );
+	};
+	if ($@) {
+		return "";
+	}
+ 	print STDERR "$xml\n";
+ 	if ($x) {
+		return "$xml" unless ( $xml =~ /title>Service Instance Not Found</ );
  	}
  	return "";
 }




More information about the MOBY-guts mailing list