[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Thu Jul 17 15:50:14 UTC 2003


mwilkinson
Thu Jul 17 11:50:14 EDT 2003
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv15177/MOBY

Modified Files:
	CommonSubs.pm 
Log Message:
added a new service that takes Snapdragon allele names and returns a collection of base64-encoded images of that mutant.  Also changed CommonSubs so that it does not take liberties with whitespace when constructing its XML, as this buggers up base64 encoded data

moby-live/Perl/MOBY CommonSubs.pm,1.10,1.11
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm	2003/07/15 00:06:18	1.10
+++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm	2003/07/17 15:50:14	1.11
@@ -227,15 +227,12 @@
     } elsif($data) {
         return "
         <moby:queryResponse>
-            <Simple>
-                $data
-            </Simple>
+            <Simple>$data</Simple>
         </moby:queryResponse>
         ";
     } else {
 	return "
-        <moby:queryResponse>
-        </moby:queryResponse>
+        <moby:queryResponse/>
 	";
 	}
 }
@@ -259,22 +256,18 @@
 sub collectionResponse {
     my ($data, $articleName) = @_;  # articleName optional
     my $content = "";
-    unless (ref($data) =~ /array/i){  # we're expecting an arrayref as input data
-        return "<moby:queryResponse>
-                </moby:queryResponse>";
+    unless ((ref($data) =~ /array/i) && $data->[0]){  # we're expecting an arrayref as input data,and it must not be empty
+        return "<moby:queryResponse/>";
     }
 
     foreach (@{$data}){
         if($_) {
             $content .= "
-                <Simple>
-                    $_
-                </Simple>
+                <Simple>$_</Simple>
             ";
         } else {
             $content .= "
-                <Simple>
-                </Simple>
+                <Simple/>
             ";
         }
     }




More information about the MOBY-guts mailing list