[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Fri Aug 15 17:36:17 UTC 2003
mwilkinson
Fri Aug 15 13:36:17 EDT 2003
Update of /home/repository/moby/moby-live/Perl/scripts
In directory pub.open-bio.org:/tmp/cvs-serv2618
Modified Files:
MOBY-Client05.cgi
Log Message:
removed some cruft from the client to speed it up a bit. It was making unnecessary calls to MOBY Central
moby-live/Perl/scripts MOBY-Client05.cgi,1.16,1.17
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/scripts/MOBY-Client05.cgi,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- /home/repository/moby/moby-live/Perl/scripts/MOBY-Client05.cgi 2003/07/17 19:51:43 1.16
+++ /home/repository/moby/moby-live/Perl/scripts/MOBY-Client05.cgi 2003/08/15 17:36:17 1.17
@@ -9,7 +9,7 @@
use Data::Dumper;
use CGI qw/:standard/;
-my $debug = 1; # change to '1' to get debugging messages in /tmp
+my $debug = 0; # change to '1' to get debugging messages in /tmp
my $ERROR_FLAG = 0;
if ($debug) {
# refreshes the debugging log
@@ -46,22 +46,7 @@
_LOG("SOAP CONNECTIONS FOUND: ",($Central->default_MOBY_server),"\n");
- my (@ValidObjects, @ValidServices, @ValidNamespaces);
- # get & cache all valid objects from MOBY Central
- my $ObjectNames = $Central->retrieveObjectNames;
-
- while (my ($k, $v) = each %{$ObjectNames}) {
- # consists of name and description
- push @ValidObjects, $k."~~~".$v;
- }
-
- my $ServiceTypes = $Central->retrieveServiceTypes;
- while (my ($k, $v) = each %{$ServiceTypes}) {
- # get & cache all valid services from MOBY Central
- push @ValidServices, $k."~~~".$v; # name and description
- }
-
- # get and cache all cvalid namespaces
+ my (@ValidNamespaces);
my $NameSpaces = $Central->retrieveNamespaces;
while (my ($k, $v) = each %{$NameSpaces}) {
push @ValidNamespaces, $k."~~~".$v; # name and description
@@ -69,15 +54,13 @@
# _LOG("INITIALIZING");
@ValidNamespaces = sort @ValidNamespaces;
- param('ValidObjects', @ValidObjects);
- param('ValidServices', @ValidServices);
param('ValidNamespaces', @ValidNamespaces);
# _LOG("GOT MOBY CENTRAL DATA @ValidObjects ::: @ValidServices ::: @ValidNamespaces\n");
}
sub SendOpeningPage {
# send out initialization screen... a bit "flat" at the moment, but we can make it pretty later
- my ($ObjectNames, $ServiceTypes, $NameSpaces) = &extractInitializedParams(); # these are the MOBY-Central reported objects, services and namespaces
+ my ($NameSpaces) = &extractInitializedParams(); # these are the MOBY-Central reported objects, services and namespaces
print header,
start_html(-title => 'A Simple MOBY Client', -bgcolor => "white"),
@@ -124,14 +107,9 @@
sub setInitializedParams {
# shortcut to write persistence fields into the CGI form.
- hidden(-name => 'ValidObjects'),"\n",
- hidden(-name => 'ValidServices'),"\n",
- hidden(-name => 'ValidNamespaces'),"\n",
hidden(-name => 'continue', value => 1),"\n",
}
sub InitializeParams {
- hidden(-name => 'ValidObjects'),"\n",
- hidden(-name => 'ValidServices'),"\n",
hidden(-name => 'ValidNamespaces'),"\n",
hidden(-name => 'start', -value => 1), # set the "start" flag for the next time the script is called
}
@@ -139,26 +117,13 @@
sub extractInitializedParams {
# get's the persistence data out of the CGI form input.
# returns hash of {name}="definition" for each of Object, Service and Namespace
- my @ValidObjects = param('ValidObjects'); # get hidden fields
- my @ValidServices = param('ValidServices');
my @ValidNamespaces = param('ValidNamespaces');
- my (%ObjectNames, %ServiceTypes, %NameSpaces);
- foreach (@ValidObjects) {
- my ($key, $value) = split "~~~", $_; # the persistent data is in the form name~~~definition. Use Regexp to split them
- $ObjectNames{$key} = $value;
- }
- foreach (@ValidServices) {
- my ($key, $value) = split "~~~", $_; # the persistent data is in the form name~~~definition. Use Regexp to split them
- $ServiceTypes{$key} = $value;
- }
+ my (%NameSpaces);
foreach (@ValidNamespaces) {
my ($key, $value) = split "~~~", $_; # the persistent data is in the form name~~~definition. Use Regexp to split them
$NameSpaces{$key} = $value;
}
-
-# _LOG("InitializedParams are \nOBJECTS: ",keys(%ObjectNames),"\nSERVICES: ",keys(%ServiceTypes),"\nNAMESPACES: ",keys(%NameSpaces),"\n");
-
- return (\%ObjectNames, \%ServiceTypes, \%NameSpaces);
+ return (\%NameSpaces);
}
@@ -364,7 +329,7 @@
# called after the service has been executed
# gets the new current object types, as well as the cached object/service/namespace data
# presents the new possibilities to the client.
- my ($ObjectNames, $ServiceTypes, $NameSpaces) = &extractInitializedParams(); # these are the MOBY-Central reported objects, services and namespaces
+ my ($NameSpaces) = &extractInitializedParams(); # these are the MOBY-Central reported objects, services and namespaces
my @Objects = extractCurrentObjects(); # simply base64 decodes the CurrentObjects CGI parameter
my @CurrentObjectTypes = extractObjectTypes(@Objects);
my @CurrentNamespaces = extractNamespaceTypes(@Objects);
More information about the MOBY-guts
mailing list