[MOBY-guts] biomoby commit

Eddie Kawas kawas at dev.open-bio.org
Tue Aug 14 23:28:10 UTC 2007


kawas
Tue Aug 14 19:28:09 EDT 2007
Update of /home/repository/moby/moby-live/Perl/scripts
In directory dev.open-bio.org:/tmp/cvs-serv6915

Modified Files:
	authority.pl 
Log Message:

moby-live/Perl/scripts authority.pl,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/scripts/authority.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/scripts/authority.pl	2007/07/17 20:34:36	1.1
+++ /home/repository/moby/moby-live/Perl/scripts/authority.pl	2007/08/14 23:28:09	1.2
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
 #-----------------------------------------------------------------
 # authority.pl
 # Author: Edward Kawas <edward.kawas at gmail.com>,
@@ -13,35 +13,41 @@
 use MOBY::lsid::authority::MobyMetadataResolver;
 
 use LS::ID;
+
 use LS::Service::Fault;
 use LS::Service::Response;
 use LS::Service::Authority;
 use LS::Service::Namespace;
 use LS::Service::DataService;
 use LS::Service::AdvancedDataService;
+
 use LS::HTTP::Service;
+use LS::RDF::SimpleDocument;
 
 #
 # The SOAP service will travel over HTTP to this mod_perl based
 # authority where all of the SOAP messages are decoded and
 # passed up the SOAP stack until they reach this framework
 #
-
+# UNTESTED: The package defaults to HTTP:CGI which works in most
+#           cases.
+#
+#use LS::SOAP::Service transport=> 'HTTP::Apache';
 use LS::SOAP::Service transport => 'HTTP::CGI';
 
 ##############
 
-my $CONF  = MOBY::Config->new;
-
 my $location = 'http://';
 
+# TODO get this from the mobyconfig file
 if ( $ENV{'HTTP_HOST'} ) {
 
-	$location =	'http://' . $ENV{'HTTP_HOST'};
+	$location .= $ENV{'HTTP_HOST'};
 }
 else {
+
 	# Set this to the default hostname for the authority
-	$location = $CONF->{mobycentral}->{lsid_authority} || 'http://localhost:8080';
+	$location .= 'localhost:8080';
 }
 
 # Create the authority service
@@ -81,7 +87,7 @@
 # Add the metadata service with namespaces
 
 # we will handle 4 namespaces ... namespacetype, serviceinstance, servicetype and objectclass.
-#TODO add the other predicates ... like relationships, etc
+#TODO add the other predicates ...
 my $metadata = LS::Service::DataService->new();
 $metadata->addNamespace( MobyNamespaceType->new() );
 $metadata->addNamespace( MobyServiceInstance->new() );
@@ -91,6 +97,7 @@
 my $moby_authority_service = LS::SOAP::Service->new();
 
 $moby_authority_service->metadata_service($metadata);
+$moby_authority_service->data_service($metadata);
 $moby_authority_service->authority_service($authority);
 
 #
@@ -112,22 +119,21 @@
 sub dynamic_ops {
 
 # if the namespace is serviceinstance, get the signatureURL and add it as a location
-	my ( $lsid, $wsdl ) = @_;	
+	my ( $lsid, $wsdl ) = @_;
 	my %valid_namespaces = (
-		$CONF->{mobynamespace}->{lsid_namespace}   => 1,
-		$CONF->{mobycentral}->{lsid_namespace} => 1,
-		$CONF->{mobyobject}->{lsid_namespace}     => 1,
-		$CONF->{mobyservice}->{lsid_namespace}     => 1,
-		$CONF->{mobyrelationship}->{lsid_namespace}     => 1
+		"namespacetype"   => 1,
+		"serviceinstance" => 1,
+		"objectclass"     => 1,
+		"servicetype"     => 1
 	);
 	my $namespace = $lsid->namespace();
 	my $object    = $lsid->object();
-	
-	# check for validity
+
 	return LS::Service::Fault->fault('Unknown LSID')
 	  unless ( $valid_namespaces{$namespace} );
-	
-	
+
+# need to decide whether or not i should check exisitence here as well as in the MobyMetadataResolver.pm ...
+	my $port;
 
 	do {
 		my $length = length($object);
@@ -144,8 +150,8 @@
 			);
 			foreach my $SI (@$services) {
 				#should only be one of them ...
-				my $port = LS::Authority::WSDL::Simple::MetadataPort->newMetadata(
-					portName => 'ServiceProviderHTTPMetadata',
+				$port = LS::Authority::WSDL::Simple::MetadataPort->newMetadata(
+					portName => 'HTTPMetadata',
 					endpoint => $SI->signatureURL,
 					protocol => $LS::Authority::WSDL::Constants::Protocols::HTTP,
 				);




More information about the MOBY-guts mailing list