[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Thu May 8 15:47:09 UTC 2003


mwilkinson
Thu May  8 11:47:08 EDT 2003
Update of /home/repository/moby/moby-live/Perl/MOBY/Client
In directory pub.open-bio.org:/tmp/cvs-serv1361/Perl/MOBY/Client

Modified Files:
	Central.pm 
Log Message:
service block should be absent if no services are found, rather than beign full of empty elements
moby-live/Perl/MOBY/Client Central.pm,1.13,1.14
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm	2003/05/08 14:24:09	1.13
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm	2003/05/08 15:47:08	1.14
@@ -512,15 +512,15 @@
                      [[objType2 => [ns1, ns2...],
 					   objType3 => [ns1, ns2...]], articleName] # Collection (two object Classes)
                      ]
-      moby: secondary =>[parameter1 => [{
+      moby: secondary =>[articleName => {
 		                    datatype => TYPE,
 							default => DEFAULT
 							max => MAX
 							min => MIN
 							enum => [ENUM1, ENUM2...]
-							}, articleName],
-                         parameter2 => [{...}, articleName],
-                         parameter3 => [{...}, articleName]]
+							},
+                         articleName2 => {...},
+                         articleName3 => {...}]
    
 
    output:
@@ -622,9 +622,9 @@
 		$message .= "
 			   </Input>\n";
 		$message .= "<Output>\n";
-		foreach my $Article(@IN){
+		foreach my $Article(@OUT){
 			my ($Objects, $articleName) = @{$Article};
-			my @Objects;				
+			my @Objects;
 			if (ref($Objects) =~ /array/i){
 				@Objects = @{$Objects};
 				$message .="<Collection articleName='$articleName'>\n";
@@ -645,21 +645,28 @@
 				$message .="</Collection>\n";
 			}
 		}
+		$message .= "</Output>\n";
+			$message .="<secondaryArticles>\n";
 		foreach my $Sec(@SEC){
-#			[parameter1 => [{
-#		                    datatype => TYPE,
-#							default => DEFAULT
-#							max => MAX
-#							min => MIN
-#							enum => [ENUM1, ENUM2...]
-#							}, articleName],
-#           parameter2 => [{...}, articleName],
-#           parameter3 => [{...}, articleName]]
-			#my ($param, $data) = @a;
+			my ($param, $data) = @{$Sec};
+			my %data = %{$data};
+			my $default = $data{default};
+			my $max = $data{max};
+			my $min = $data{min};
+			my $datatype = $data{datatype};
+			return $self->errorRegXML("a secondaryArticle must contain at least a datatype value");
+			my @enums = @{$data{enum}};
+			$message .="<Parameter articleName='$param'>\n";
+			$message .="<default>$default</default>\n";
+			$message .="<datatype>$datatype</datatype>\n";
+			$message .="<max></max>\n";
+			$message .="<min></min>\n";
+			foreach (@enums){
+				$message .="<enum>$_</enum>\n";
+			}			
 		}
-		$message .= "
-			   </Output>\n
-			</registerService>";
+		$message .= "</secondaryArticles>\n";
+		$message .= "</registerService>";
 	} else {	return $self->errorRegXML("cannot register services with a client initialized with multiple registries")}
 
 	#elsif ($Category eq "cgi") {
@@ -680,6 +687,7 @@
 	#	error_messsage => "missing parameters or other failure leading to incorrectly formatted XML",
 	#	registration_id => "0")};
 
+	return $message;
 	$debug && &_LOG(" message\n\n$message\n\n");
 	my $return = $self->SOAP_connection->call(registerService => ($message))->paramsall;
 




More information about the MOBY-guts mailing list