[MOBY-guts] biomoby commit

Eddie Kawas kawas at dev.open-bio.org
Mon Aug 25 16:28:57 UTC 2008


kawas
Mon Aug 25 12:28:57 EDT 2008
Update of /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts
In directory dev.open-bio.org:/tmp/cvs-serv7985/Perl/MOSES-MOBY/bin/scripts

Modified Files:
	moses-install.pl moses-generate-services.pl 
Log Message:
added async service support to moses. MOBY.pm has some documentation, but more is to come.
 *for generating services, use -h option to see synopsis
 *installer now checks for async modules if user wishes to
moby-live/Perl/MOSES-MOBY/bin/scripts moses-install.pl,1.4,1.5 moses-generate-services.pl,1.5,1.6
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-install.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-install.pl	2008/04/29 19:59:43	1.4
+++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-install.pl	2008/08/25 16:28:57	1.5
@@ -63,10 +63,19 @@
 			  IO::Scalar
 			  Unicode::String
 			  ) ) {
-	check_module ($module);
+		check_module ($module);
     }
+    # check for async libraries if user wants to ....
+    print STDOUT "Shall we check for the moby-async libraries\n\t(do this only if you plan on creating async moby services)? y/n [n]";
+    my $tmp = <STDIN>;
+    $tmp =~ s/\s//g; 
+    if ($tmp =~ /y/i) {
+    	check_module('MOBY::Client::Central');
+		check_module('WSRF::Lite'); 
+    }
+
     if (MSWIN) {
-	check_module ('Term::ReadLine');
+		check_module ('Term::ReadLine');
 	{
 	    local $^W = 0;
 	    $SimplePrompt::Terminal = Term::ReadLine->new ('Installation');
@@ -241,6 +250,8 @@
     "$pmoses_home/services";
 my $services_table = $MOBYCFG::GENERATORS_IMPL_SERVICES_TABLE ||
     'SERVICES_TABLE';
+my $async_services_table = $MOBYCFG::GENERATORS_IMPL_SERVICES_TABLE ||
+    'ASYNC_SERVICES_TABLE';
 
 my $cgibin_file = "$pmoses_home/MobyServer.cgi";
 if (-e $cgibin_file and ! $opt_F) {
@@ -259,6 +270,27 @@
     chmod 0755, $cgibin_file;   # everybody can execute
 }
 
+# AsyncMobyServer.cgi file
+my $async_services_table = $MOBYCFG::GENERATORS_ASYNC_IMPL_SERVICES_TABLE ||
+    'ASYNC_SERVICES_TABLE';
+
+my $async_cgibin_file = "$pmoses_home/AsyncMobyServer.cgi";
+if (-e $async_cgibin_file and ! $opt_F) {
+    say "\nWeb Server file '$async_cgibin_file' exists.";
+    say "It will not be overwritten unless you start 'install.pl -F'.\n";
+} else {
+    file_from_template
+	($async_cgibin_file,
+	 File::ShareDir::dist_file('MOSES-MOBY','AsyncMobyServer.cgi.template'),
+	 'Web Server file',
+	 { '@PMOSES_HOME@'    => $pmoses_home,
+	   '@GENERATED_DIR@'  => $generated_dir,
+	   '@SERVICES_DIR@'   => $services_dir,
+	   '@ASYNC_SERVICE_TABLE@' => $async_services_table,
+       } );
+    chmod 0755, $async_cgibin_file;   # everybody can execute
+}
+
 # directory for local cache
 my $cachedir = $MOBYCFG::CACHEDIR ||
     prompt_for_directory ( 'Directory for local cache',
@@ -316,6 +348,7 @@
 	   '@GENERATED_DIR@'    		=> $generated_dir,
 	   '@SERVICES_DIR@'     		=> $services_dir,
 	   '@SERVICES_TABLE@'   		=> $services_table,
+	   '@ASYNC_SERVICES_TABLE@'   	=> $async_services_table,
 	   '@LOG4PERL_FILE@'    		=> $log4perl_file,
 	   '@LOGFILE@'          		=> $log_file1,
 	   '@USER_REGISTRIES_FILE_DIR@'	=> $pmoses_home,

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-generate-services.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-generate-services.pl	2008/05/09 20:26:04	1.5
+++ /home/repository/moby/moby-live/Perl/MOSES-MOBY/bin/scripts/moses-generate-services.pl	2008/08/25 16:28:57	1.6
@@ -8,16 +8,16 @@
 
 # some command-line options
 use Getopt::Std;
-use vars qw/ $opt_h $opt_d $opt_R $opt_v $opt_a $opt_s $opt_b $opt_f $opt_u $opt_F $opt_S $opt_t $opt_c /;
-getopts('hdvasbfuFStcR:');
+use vars qw/ $opt_h $opt_A $opt_d $opt_R $opt_v $opt_a $opt_s $opt_b $opt_f $opt_u $opt_F $opt_S $opt_t $opt_c /;
+getopts('hdvasbfuFStcAR:');
 # usage
 if (not($opt_u or $opt_f)) {
 if ($opt_h or (not $opt_a and @ARGV == 0)) {
     print STDOUT <<'END_OF_USAGE';
 Generate Services.
-Usage: [-vds] [-R registry-string] [-b|S|t] authority [service-name] [service-name...]
-       [-vds] [-R registry-string] [-b|S|t] authority
-       [-vd] [-R registry-string] [-b|S|t] -a
+Usage: [-vds] [-R registry-string] [-b|S|t|c|A] authority [service-name] [service-name...]
+       [-vds] [-R registry-string] [-b|S|t|c|A] authority
+       [-vd] [-R registry-string] [-b|S|t|c|A] -a
        [-R registry-string] [-fu]
 
     It also needs to get a location of a local cache (and potentially
@@ -40,9 +40,10 @@
            implementation module has enabled option to read the base
            statically (that is why it is also generated here)
     -i ... generate an implementation of the given service
-    -c ... generate a cgi based implementation of the given service       
+    -c ... generate a cgi based implementation of the given service
+    -A ... generate an asynchronous based implementation of the given service       
     -t ... update dispatch table of services (a table used by the
-	   cgi-bin script and SOAP::Lite to dispatch requests);
+	       cgi-bin script and SOAP::Lite to dispatch requests);
            this table is also updated automatically when options
            -i or -S are given
     If none of -b, -S, -t, -c is given, it generates/show implementation
@@ -119,6 +120,10 @@
 	$generator->generate_cgi;
     } elsif ($opt_t) {
 	$generator->update_table;
+    } elsif ($opt_A) {
+	$generator->generate_impl;
+	$generator->generate_async;
+	$generator->update_async_table;
     } else {
 	$generator->generate_impl;
 	$generator->update_table;
@@ -139,6 +144,11 @@
 		$generator->generate_cgi(service_names => [@ARGV],
 				       authority     => $authority,
 				       outcode       => \$code);
+    }elsif ($opt_A) {
+		$generator->generate_async(service_names => [@ARGV],
+					       authority     => $authority,
+					       outcode       => \$code);
+		#$generator->update_async_table;
     } else {
 	    $generator->generate_impl (service_names => [@ARGV],
 				       authority     => $authority,
@@ -158,7 +168,18 @@
 				       authority     => $authority);
 	    $generator->update_table (service_names => [@ARGV],
 				      authority     => $authority);
-	}  elsif ($opt_c) {
+	} elsif ($opt_A) {
+	    $generator->generate_impl(
+					service_names => [@ARGV],
+					authority     => $authority,
+					force_over    => $opt_F);
+	    $generator->generate_async (service_names => [@ARGV],
+				       authority     => $authority,
+				       force_over    => $opt_F,
+				       static_impl   => 1);
+	    $generator->update_async_table (service_names => [@ARGV],
+				      authority     => $authority);
+	} elsif ($opt_c) {
     	$generator->generate_impl(
 					service_names => [@ARGV],
 					authority     => $authority,




More information about the MOBY-guts mailing list