[MOBY-guts] biomoby commit

Richard Bruskeiwich rbsk at pub.open-bio.org
Thu Feb 20 21:04:12 UTC 2003


rbsk
Thu Feb 20 16:04:12 EST 2003
Update of /home/repository/moby/moby-live/Perl/scripts
In directory pub.open-bio.org:/tmp/cvs-serv24217

Modified Files:
	RegisterDataType.pl 
Log Message:
starting to create some standard client utilities for MOBY Central configuration

moby-live/Perl/scripts RegisterDataType.pl,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/scripts/RegisterDataType.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/scripts/RegisterDataType.pl	2003/02/19 21:22:08	1.1
+++ /home/repository/moby/moby-live/Perl/scripts/RegisterDataType.pl	2003/02/20 21:04:12	1.2
@@ -1,13 +1,28 @@
-#!/usr/bin/perl -w
-# This script assumes that it is running from the distribution scripts directory
-use lib "../";
-use MOBY::Client::Central;
-my $C = MOBY::Client::Central->new(
-    MOBY_server => "http://mobycentral.cbr.nrc.ca/cgi-bin/MOBY-Central.pl",
-    MOBY_uri  => "http://mobycentral.cbr.nrc.ca/MOBY/Central"
-    );
-
-$r = $C->registerObject(
+#!/usr/bin/perl
+#
+# Sample Data Object Registration script
+#
+# You should edit the MOBY_* arguments to new 
+# (or ignore them all together, if using the default)
+#
+# Note: Remember that your target MOBY Central needs 
+#       to have its database initialized 
+#       prior to running this script
+#
+# Revision:
+# 19/02/2003 - R. Bruskiewich: script extracted from MOBY testcentral.pl 
+#
+use MOBY::Client::Central ;
+my $MOBY = MOBY::Client::Central->new(
+   # Default server: 'http://mobycentral.cbr.nrc.ca/cgi-bin/MOBY-Central.pl'
+   # for a local central, you can use "http://localhost/cgi-bin/MOBY-Central.pl"
+   # MOBY_server => "URL of your chosen MOBY Central server",
+
+   # Default URI: 'http://mobycentral.cbr.nrc.ca/MOBY/Central'
+   # for a local central, you can "http://localhost/MOBY/Central"
+   # MOBY_uri => "URI of your chosen MOBY Central server",
+);
+my $reg = $C->registerObject(
     objectType => "testObject",
     description => "this is a test",
     xsd => "<blah><blah><blah>",
@@ -15,141 +30,9 @@
     authURI => "http://www.illuminae.com",
     clobber => 0,
                        );
-
-print "Reg Object successful?: ",$r->success,"\n";
-print "message: ",$r->error_message,"\n";
-print "id     : ",$r->registration_id,"\n\n";
-
-$r2 = $C->deregisterObject(
-    objectAcc => $r->registration_id,
-                          );
-
-print "De-Reg Object successful?: ",$r2->success,"\n";
-print "message: ",$r2->error_message,"\n";
-print "id     : ",$r2->registration_id,"\n\n";
-
-
-$r = $C->registerServiceType(
-    serviceType => "testService",
-    description => "this is a test",
-    ISA => ["Retrieve"],
-                       );
-
-print "Reg serviceType successful?: ",$r->success,"\n";
-print "message: ",$r->error_message,"\n";
-print "id     : ",$r->registration_id,"\n\n";
-
-
-$r2 = $C->deregisterServiceType(
-    serviceTypeAcc => $r->registration_id
-                       );
-
-print "De-Reg serviceType successful?: ",$r2->success,"\n";
-print "message: ",$r2->error_message,"\n";
-print "id     : ",$r2->registration_id,"\n\n";
-
-
-$r = $C->registerNamespace(
-    namespaceType => "testNamespace",
-    description => "this is a test",
-    authURI => "http://illuminae.com",
-    clobber => 0
-                       );
-
-print "Reg Namespace type successful?: ",$r->success,"\n";
-print "message: ",$r->error_message,"\n";
-print "id     : ",$r->registration_id,"\n\n";
-
-
-
-$r2 = $C->deregisterNamespace(
-    namespaceAcc => $r->registration_id
-                       );
-
-print "De-Reg Namespace successful?: ",$r2->success,"\n";
-print "message: ",$r2->error_message,"\n";
-print "id     : ",$r2->registration_id,"\n\n";
-
-
-$r = $C->registerService(
-    serviceName => "Servicetest2",
-    serviceType => "Retrieve",
-    authURI => "illuminae.com",
-    input => {"Object" => ["Genbank/GI"]},
-    output => ["Object"],
-    URL => "http://www.illuminae.com/cgi-bin/services.cgi",
-    description => "this is a test",
-                       );
-
-print "Register Service successful?: ",$r->success,"\n";
-print "message: ",$r->error_message,"\n";
-print "id     : ",$r->registration_id,"\n\n";
-
-if ($r->success){
-    $r2 = $C->deregisterService(serviceID => "25863527224355317482136671482562144235278182143174");#$r->registration_id);
-    print "De-Reg Service success: ",$r2->success,"\n";
-    print "message: ",$r2->error_message,"\n";
-    print "id     : ",$r2->registration_id,"\n\n";
+if($reg->success) {	
+    print "Registration successful!?\n";
+    print "Service Registration Number: ", $reg->registration_id, "\n";
 } else {
-    print "Skipping test DeregisterService since service registration failed\n\n";
-}
-
-print "\n\nTesting locateServiceByOutput with output 'VirtualSequence' and\nfull_objects + full_services\n";
- at services = $C->locateServiceByOutput(
-    objectType => "VirtualSequence",
-    fullObjects => 1,
-    fullServices => 1,
-                         );
-foreach (@services){
-    print "SERVICE\t",$_->authority, "\t", $_->name,"\n";
-}
-
-print "\n\nTesting locateServiceByOutput with output 'VirtualSequence' and\nfull_services only\n";
- at services = $C->locateServiceByOutput(
-    objectType => "VirtualSequence",
-    fullObjects => 0,
-    fullServices => 1,
-                         );
-foreach (@services){
-    print "SERVICE\t",$_->authority, "\t", $_->name,"\n";
+    print "### Error: ", $reg->error_message, "!\n";
 }
-
-
-print "\n\nTesting locateServiceByInput with input 'Sequence' and\nfull_objects + full_services\n";
- at services = $C->locateServiceByInput(
-    input => {"Sequence" => ["Genbank/GI"]},
-    fullObjects => 1,
-    fullServices => 1,
-                         );
-foreach (@services){
-    print "SERVICE\t",$_->authority, "\t", $_->name,"\n";
-}
-
-print "\n\nTesting locateServiceByInput with input 'Sequence' and\nfull_services only\n";
- at services = $C->locateServiceByInput(
-    input => {"Sequence" => ["Genbank/GI"]},
-    fullObjects => 0,
-    fullServices => 1,
-                         );
-foreach (@services){
-    print "SERVICE\t",$_->authority, "\t", $_->name,"\n";
-}
-
-print "\n\nTesting locateServiceByType with type 'Retrieve' \n+ full_services\n";
- at services = $C->locateServiceByType(
-    serviceType => "Retrieve",
-    fullServices => 1,
-                         );
-foreach (@services){
-    print "SERVICE\t",$_->authority, "\t", $_->name,"\n";
-}
-
-print "\n\nTesting locateServiceByType with type 'Blast' and\nfull_services\n";
- at services = $C->locateServiceByType(
-    serviceType => "Blast",
-    fullServices => 1,
-                         );
-foreach (@services){
-    print "SERVICE\t",$_->authority, "\t", $_->name,"\n";
-}
-



More information about the MOBY-guts mailing list