[MOBY-guts] biomoby commit

Eddie Kawas kawas at dev.open-bio.org
Mon Mar 31 18:05:18 UTC 2008


kawas
Mon Mar 31 14:05:17 EDT 2008
Update of /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/templates
In directory dev.open-bio.org:/tmp/cvs-serv1239

Modified Files:
	service.tt 
Log Message:
added initial support for namespace checking.
moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/templates service.tt,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/templates/service.tt,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/templates/service.tt	2008/02/21 00:12:55	1.3
+++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/lib/MOSES/MOBY/Generators/templates/service.tt	2008/03/31 18:05:17	1.4
@@ -143,6 +143,7 @@
 use MOSES::MOBY::ServiceException;
 use strict;
 
+my %valid_namespaces = ( [% FOREACH ns IN input_ns %] '[%ns%]'=>1,  [% END %]);
 #-----------------------------------------------------------------
 # process_it
 #    This method is called for every job in the client request.
@@ -169,11 +170,23 @@
 	
     [%- IF is_simple (input) %]
 [% get_members (input_paths.${input.name}, 4) %]
+    # perform namespace checking for inputs to this service
+#   do {
+#       $response->record_error ( { code => INPUT_INCORRECT_NAMESPACE,
+#                                   msg  => 'This service requires inputs under the namespaces: {"' . join(',', keys %valid_namespaces) . '"}' } );
+#       return;
+#   } unless $valid_namespaces{$namespace};
     [%- ELSE %]
     if (defined $[% input.name %]_collection) {
         foreach my $[% input.name %]_element (@{ $[% input.name %]_collection }) {
             my $[% input.name %] = $[% input.name %]_element->data;
 [% get_members (input_paths.${input.name}, 12) %]
+            # perform namespace checking for inputs to this service
+        #   do {
+        #       $response->record_error ( { code => INPUT_INCORRECT_NAMESPACE,
+        #                                   msg  => 'This service requires inputs under the namespaces: { "' . join(',', keys %valid_namespaces) . '"}' } );
+        #       return;
+        #   } unless $valid_namespaces{$namespace};
         }
     }
     [%- END %]




More information about the MOBY-guts mailing list