[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Thu May 8 14:10:29 UTC 2003
mwilkinson
Thu May 8 10:10:29 EDT 2003
Update of /home/repository/moby/moby-live/Perl/MOBY/Client
In directory pub.open-bio.org:/tmp/cvs-serv32719/Perl/MOBY/Client
Modified Files:
Central.pm
Log Message:
temp commit to get some changes over. Client library broken
moby-live/Perl/MOBY/Client Central.pm,1.11,1.12
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2003/05/08 00:10:41 1.11
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2003/05/08 14:10:29 1.12
@@ -512,8 +512,17 @@
[[objType2 => [ns1, ns2...],
objType3 => [ns1, ns2...]], articleName] # Collection (two object Classes)
]
-
-
+ moby: secondary =>[parameter1 => [{
+ datatype => TYPE,
+ default => DEFAULT
+ max => MAX
+ min => MIN
+ enum => [ENUM1, ENUM2...]
+ }, articleName],
+ parameter2 => [{...}, articleName],
+ parameter3 => [{...}, articleName]]
+
+
output:
moby: output =>[
[objType1 => [ns1, ns2...], articleName], # Simple
@@ -524,7 +533,7 @@
URL:
moby: URL => $URL_TO_SERVICE
-
+
=cut
#******************************************* need to have collections and article names! *************************
@@ -550,6 +559,15 @@
# <!-- zero or more Primary (Simple and/or Complex) articles -->
# </Output>
#</registerService>
+
+ #<Parameter articleName="NameOfArticle">
+ # <datatype>INT|FLOAT|STRING</datatype>
+ # <default>...</default> <!-- any/all of these -->
+ # <max>...</max> <!-- ... -->
+ # <min>...</min> <!-- ... -->
+ # <enum>...<enum> <!-- ... -->
+ # <enum>...<enum> <!-- ... -->
+ # </Parameter>
sub registerService {
@@ -561,7 +579,8 @@
my $email = $a{contactEmail}; $email ||="";
my $URL = $a{URL}; $URL ||="";
my $desc = $a{description}; $desc ||="";
- my $Category = $a{Category}; $Category ||="moby";
+ my $Category = lc($a{Category}); $Category ||="moby";
+ return $self->errorRegXML("Only MOBY Service Categories are currently allowed") unless ($Category eq 'moby');
my $message = "
<registerService>
@@ -573,54 +592,75 @@
<authURI>$authURI</authURI>";
if ($Category eq "moby") {
- my @IN = @{$a{input}};
- my @OUT = @{$a{output}};
- $message .= "<inputObjects>\n";
- foreach my $Article(@IN){
- my ($Objects, $articleName) = @{$Article};
- my @Objects;
- if (ref($Objects) =~ /array/i){
- @Objects = @{$Objects};
- $message .="<Collection>\n";
- } else {
- @Objects = $Objects;
- }
- foreach my $Object(@Objects){
- $message .="<Simple>\n";
- my ($type, $Namespaces) = @{$Object);
- $message .="<objectType>$type</objectType>\n";
- foreach my $ns(@{$Namespaces}){
- $message .="<Namespace>$ns</Namespace>\n";
- }
- $message .="</Simple>\n";
- }
- if (ref($Object) =~ /array/i){
- $message .="</Collection>\n";
- }
-
- $message .= "
- <Input>
- <objectType>$otype</objectType>\n";
- foreach (@{$ns}){
- $message .= "
- <Namespace>$_</Namespace>\n"
+ my @IN = @{$a{input}};
+ my @OUT = @{$a{output}};
+ my @SEC = @{$a{secondary}};
+ $message .= "<Input>\n";
+ foreach my $Article(@IN){
+ my ($Objects, $articleName) = @{$Article};
+ my @Objects;
+ if (ref($Objects) =~ /array/i){
+ @Objects = @{$Objects};
+ $message .="<Collection articleName='$articleName'>\n";
+ $articleName="";
+ } else {
+ @Objects = $Objects;
+ }
+ foreach my $Object(@Objects){
+ $message .="<Simple articleName='$articleName'>\n";
+ my ($type, $Namespaces) = @{$Object};
+ $message .="<objectType>$type</objectType>\n";
+ foreach my $ns(@{$Namespaces}){
+ $message .="<Namespace>$ns</Namespace>\n";
}
- $message .= "
- </Input>\n";
+ $message .="</Simple>\n";
}
-
- $message .="
- </inputObjects>
- <outputObjects>";
-
- foreach (@OUT){
- $message .= "
- <objectType>$_</objectType>\n";
+# if (ref($Object) =~ /array/i){
+# $message .="</Collection>\n";
+# }
+ }
+ $message .= "
+ </Input>\n";
+ $message .= "<Output>\n";
+ foreach my $Article(@IN){
+ my ($Objects, $articleName) = @{$Article};
+ my @Objects;
+ if (ref($Objects) =~ /array/i){
+ @Objects = @{$Objects};
+ $message .="<Collection articleName='$articleName'>\n";
+ $articleName="";
+ } else {
+ @Objects = $Objects;
+ }
+ foreach my $Object(@Objects){
+ $message .="<Simple articleName='$articleName'>\n";
+ my ($type, $Namespaces) = @{$Object};
+ $message .="<objectType>$type</objectType>\n";
+ foreach my $ns(@{$Namespaces}){
+ $message .="<Namespace>$ns</Namespace>\n";
+ }
+ $message .="</Simple>\n";
}
- $message .="
- </outputObjects>
- </registerService>";
- } else { return $self->errorRegXML("only moby services are currently supported") if $self->multiple_registries;}
+# if (ref($Object) =~ /array/i){
+# $message .="</Collection>\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;
+ }
+ $message .= "
+ </Output>\n
+ </registerService>";
+ } else { return $self->errorRegXML("cannot register services with a client initialized with multiple registries")}
#elsif ($Category eq "cgi") {
# my $IN = $a{input};
More information about the MOBY-guts
mailing list