From senger at pub.open-bio.org Thu Sep 1 01:51:18 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Sep 1 02:34:07 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509010551.j815pIJa003222@pub.open-bio.org> senger Thu Sep 1 01:51:18 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv3203 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.25,1.26 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/01 01:30:07 1.25 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/01 05:51:18 1.26 @@ -612,10 +612,21 @@ - - - - + + + + + + + + + From senger at pub.open-bio.org Thu Sep 1 01:51:18 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Sep 1 02:34:23 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509010551.j815pIw8003237@pub.open-bio.org> senger Thu Sep 1 01:51:18 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv3203/src/Clients Added Files: TestArgs.java Log Message: moby-live/Java/src/Clients TestArgs.java,NONE,1.1 From senger at pub.open-bio.org Thu Sep 1 04:01:16 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Sep 1 04:44:14 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509010801.j8181GTC004629@pub.open-bio.org> senger Thu Sep 1 04:01:16 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv4610 Modified Files: build.xml Log Message: windows scripts improved moby-live/Java build.xml,1.26,1.27 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/01 05:51:18 1.26 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/01 08:01:16 1.27 @@ -618,7 +618,7 @@ --> - + From senger at pub.open-bio.org Thu Sep 1 04:01:16 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Sep 1 04:44:15 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509010801.j8181Gau004648@pub.open-bio.org> senger Thu Sep 1 04:01:16 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv4610/docs Modified Files: ChangeLog Log Message: windows scripts improved moby-live/Java/docs ChangeLog,1.38,1.39 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/08/31 11:39:06 1.38 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/01 08:01:16 1.39 @@ -1,3 +1,8 @@ +2005-09-01 Martin Senger + + * Fixed the Windows run...bat scripts in order to accept spaces in + the file names (many double quotes added) + 2005-08-31 Martin Senger * Fixed build.xml (javadoc target) to run under Windows (newlines From senger at pub.open-bio.org Thu Sep 1 04:01:16 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Sep 1 04:44:28 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509010801.j8181GXN004701@pub.open-bio.org> senger Thu Sep 1 04:01:16 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv4610/src/config Modified Files: run-any-client.bat run-cache-client.bat run-cmdline-client.bat run-digest-client.bat run-generator.bat run-graphs-client.bat run-moby-parser.bat run-service.bat run-testing-central.bat Log Message: windows scripts improved moby-live/Java/src/config run-any-client.bat,1.2,1.3 run-cache-client.bat,1.1,1.2 run-cmdline-client.bat,1.1,1.2 run-digest-client.bat,1.1,1.2 run-generator.bat,1.1,1.2 run-graphs-client.bat,1.1,1.2 run-moby-parser.bat,1.1,1.2 run-service.bat,1.1,1.2 run-testing-central.bat,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-any-client.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/08/26 06:27:03 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/09/01 08:01:16 1.3 @@ -1,12 +1,12 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% -set CP=%PROJECT_HOME%\build\others\datatypes;%CP% -set CP=%PROJECT_HOME%\build\others\skeletons;%CP% -set CP=%PROJECT_HOME%\build\others\samples;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" +set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" +set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" +set "CP=%PROJECT_HOME%\build\others\samples;%CP%" -java -classpath %CP% %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat 2004/11/14 16:12:50 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat 2005/09/01 08:01:16 1.2 @@ -1,9 +1,9 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" -java -classpath %CP% CacheRegistryClient %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" CacheRegistryClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2004/09/23 00:18:01 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2005/09/01 08:01:16 1.2 @@ -1,9 +1,9 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" -java -classpath %CP% MobyCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" MobyCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat 2004/11/14 16:43:49 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat 2005/09/01 08:01:16 1.2 @@ -1,9 +1,9 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" -java -classpath %CP% MobyDigestClient %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" MobyDigestClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-generator.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-generator.bat 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-generator.bat 2005/09/01 08:01:16 1.2 @@ -1,11 +1,11 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% -set CP=%PROJECT_HOME%\build\others\datatypes;%CP% -set CP=%PROJECT_HOME%\build\others\skeletons;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" +set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" +set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" -java -classpath %CP% MosesGenerators %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" MosesGenerators %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat 2004/09/23 00:18:01 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat 2005/09/01 08:01:16 1.2 @@ -1,9 +1,9 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" -java -classpath %CP% MobyGraphs %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" MobyGraphs %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat 2005/09/01 08:01:16 1.2 @@ -1,10 +1,10 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% -set CP=%PROJECT_HOME%\build\others\datatypes;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" +set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" -java -classpath %CP% TestingMobyParser %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" TestingMobyParser %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-service.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-service.bat 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-service.bat 2005/09/01 08:01:16 1.2 @@ -1,12 +1,12 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% -set CP=%PROJECT_HOME%\build\others\datatypes;%CP% -set CP=%PROJECT_HOME%\build\others\skeletons;%CP% -set CP=%PROJECT_HOME%\build\others\samples;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" +set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" +set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" +set "CP=%PROJECT_HOME%\build\others\samples;%CP%" -java -classpath %CP% org.biomoby.client.BaseCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" org.biomoby.client.BaseCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat 2004/09/23 00:18:01 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat 2005/09/01 08:01:16 1.2 @@ -1,9 +1,9 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" -java -classpath %CP% TestingCentral %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" TestingCentral %1 %2 %3 %4 %5 %6 %7 %8 %9 From fgibbons at pub.open-bio.org Thu Sep 1 09:50:46 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Thu Sep 1 10:33:29 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509011350.j81DokKV005950@pub.open-bio.org> fgibbons Thu Sep 1 09:50:46 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv5921/t Modified Files: Client-Central.t Client-Service.t Log Message: - Make distinctions in API moby-live/Perl/t Client-Central.t,1.40,1.41 Client-Service.t,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Central.t,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- /home/repository/moby/moby-live/Perl/t/Client-Central.t 2005/08/31 22:31:55 1.40 +++ /home/repository/moby/moby-live/Perl/t/Client-Central.t 2005/09/01 13:50:46 1.41 @@ -11,7 +11,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; #use SOAP::Lite +trace; -use Test::More 'no_plan'; #tests => 127; # perldoc Test::More for details +use Test::More 'no_plan'; #skip_all => "Turn off for development"; # See perldoc Test::More for details use strict; use Data::Dumper; #Is the client-code even installed? @@ -55,7 +55,31 @@ isa_ok( $C, 'MOBY::Client::Central',"Connected to test MOBY Central") or die("Cannot Connect to MOBY Central... cannot continue?"); +############ ENFORCE REGISTRY API ############### +# First, mandatory methods for all registries. +my @mandatory = qw/findService retrieveService +retrieveResourceURLs retrieveServiceProviders retrieveServiceNames +retrieveServiceTypes retrieveObjectNames retrieveObjectDefinition +retrieveNamespaces retrieveObjectSchema Relationships/; + +my @mandatory_if_write_access = qw/registerObjectClass deregisterObjectClass +registerServiceType deregisterServiceType +registerNamespace deregisterNamespace +registerService deregisterService/; + +my @optional_recommended = qw/DUMP registerServiceWSDL/; + +can_ok($C, @mandatory ) + or diag("Registry failed to supply mandatory methods"); + +# How do we check whether the registry has 'write' access - most will, so take as default. +can_ok($C, @mandatory_if_write_access) + or diag("Registry has 'write' access and failed to supply mandatory methods"); +# Optional, but probably recommended methods +can_ok($C, @optional_recommended) + or diag("Registry does not supply certain optional methods;\n" + . "you should consider adding them"); ################## MOBY Registration Tests ################# ################## OBJECT REGISTRATION ############# =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Service.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/08/30 19:14:29 1.1 +++ /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/01 13:50:46 1.2 @@ -40,8 +40,8 @@ Even if we do that, we should clearly specify which is the preferred name. OPINION -can_ok("MOBY::Client::Service", qw/new execute ServiceName/) - or diag($opinion); +my @API = qw/new execute ServiceName/; +can_ok("MOBY::Client::Service", @API) or diag($opinion); is(MOBY::Client::Service->new(), undef) or diag("Created a new service without supplying any WSDL - it ain't right, I tell you!"); # Can't do nothing without WSDL From fgibbons at pub.open-bio.org Thu Sep 1 10:00:00 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Thu Sep 1 10:42:43 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509011400.j81E00jc006035@pub.open-bio.org> fgibbons Thu Sep 1 10:00:00 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv6010/MOBY Modified Files: CommonSubs.pm Log Message: - Test for namespace agreement in a way that avoids warning messages. Also remove redundant 'name:' lines, which merely duplicate the =head2 lines above them. moby-live/Perl/MOBY CommonSubs.pm,1.67,1.68 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.67 retrieving revision 1.68 diff -u -r1.67 -r1.68 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/08/30 15:31:52 1.67 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/09/01 14:00:00 1.68 @@ -248,7 +248,6 @@ =head2 genericServiceInputParser - name : genericServiceInputParser function : For the MOST SIMPLE SERVICES that take single Simple or Collection inputs and no Secondaries/Parameters this routine takes the MOBY message and breaks the objects out of it in a useful way @@ -329,7 +328,7 @@ =head2 serviceInputParser - name : DO NOT USE!! + DO NOT USE!! function : to take a MOBY message and break the objects out of it. This is identical to the genericServiceInputParser method above, except that it returns the data as Objects rather than XML::LibXML nodes. This is an improvement! @@ -372,7 +371,6 @@ =head2 complexServiceInputParser - name : complexServiceInputParser function : For more complex services that have multiple articles for each input and/or accept parameters, this routine will take a MOBY message and extract the Simple/Collection/Parameter objects out of it in a @@ -534,7 +532,6 @@ =head2 getSimpleArticleIDs - name : getSimpleArticleIDs function : to get the IDs of simple articles that are in the given namespace usage : my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles); my @ids = getSimpleArticleIDs(\@SimpleArticles); @@ -566,15 +563,17 @@ return undef unless scalar @{$input_nodes}; my @input_nodes = @{$input_nodes}; my $OS = MOBY::Client::OntologyServer->new; - my ( $s, $m ); + my ( $s, $m, $namespace_lsid ); if ( $desired_namespace ) { - ( $s, $m, $desired_namespace ) = + ( $s, $m, $namespace_lsid ) = $OS->namespaceExists( term => $desired_namespace ); # returns (success, message, lsid) unless ( $s ) { # bail if not successful - print STDERR - "MOBY::CommonSubs WARNING ** the namespace '$desired_namespace' does not exist in the MOBY ontology, and is not a valid LSID\n"; + # Printing to STDERR is not very helpful - we should probably return something that can be dealt iwth programatically.... + print STDERR "MOBY::CommonSubs WARNING ** the namespace '$desired_namespace' " + . "does not exist in the MOBY ontology, and does not have a valid LSID\n"; return undef; } + $desired_namespace = $namespace_lsid; # Replace namespace with fully-qualified LSID } my @ids; foreach my $in ( @input_nodes ) { @@ -593,13 +592,15 @@ } $ns = $ns->getValue; # if we have a namespace, then get its value ( $s, $m, $ns ) = $OS->namespaceExists( term => $ns ); - unless ( $ns eq $desired_namespace ) + # A bad namespace will return 'undef' which makes for a bad comparison (Perl warning). + # Better to check directly for success ($s), THEN check that namespace is the one we wanted. + unless ( $s && $ns eq $desired_namespace ) { # we are registering as working in a particular namespace, so check this push @ids, undef; # and push undef onto the stack if it isn't next; } } - + # Now do the same thing for ID's my $id = $_->getAttributeNode( 'id' ) || $_->getAttributeNode( 'moby:id' ); unless ( $id ) { @@ -619,7 +620,6 @@ =head2 getSimpleArticleNamespaceURI - name : getSimpleArticleNamespaceURI function : to get the namespace of a simple article usage : my $ns = getSimpleArticleNamespaceURI($SimpleArticle); args : $Simple - (required) a single XML::LibXML node representing a Simple Article @@ -655,7 +655,6 @@ =head2 simpleResponse - name : simpleResponse function : wraps a simple article in the appropriate (mobyData) structure usage : $resp .= &simpleResponse($object, 'MyArticleName', $queryID); args : (in order) @@ -700,7 +699,6 @@ =head2 collectionResponse - name : collectionResponse function : wraps a set of articles in the appropriate mobyData structure usage : return responseHeader . &collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter; args : (in order) @@ -753,7 +751,6 @@ =head2 complexResponse - name : complexResponse function : wraps articles in the appropriate (mobyData) structure usage : $resp .= &complexResponse(\@data, $qID); args : (in order) @@ -809,7 +806,6 @@ =head2 responseHeader - name : responseHeader function : print the XML string of a MOBY response header +/- serviceNotes usage : responseHeader('illuminae.com') responseHeader( @@ -846,7 +842,6 @@ =head2 responseFooter - name : responseFooter function : print the XML string of a MOBY response footer usage : return responseHeader('illuminae.com') . $DATA . responseFooter; notes : returns everything required after the response articles themselves @@ -880,7 +875,6 @@ =head2 getInputs - name : getInputs function : get the mobyData block(s) as XML::LibXML nodes usage : @queryInputs = getInputArticles($XML) args : the raw XML of a query, or an XML::LibXML document @@ -908,7 +902,6 @@ =head2 getInputID - name : getInputID function : get the value of the queryID element usage : @queryInputs = getInputID($XML) args : the raw XML or XML::LibXML of a queryInput or mobyData block (e.g. from getInputs) @@ -931,7 +924,7 @@ =head2 getArticlesAsObjects - name : DO NOT USE!! + DO NOT USE!! function : get the Simple/Collection articles for a single mobyData or queryResponse node, rethrning them as SimpleArticle, SecondaryArticle, or ServiceInstance objects @@ -970,7 +963,6 @@ =head2 getCollectedSimples - name : getCollectedSimples function : get the Simple articles collected in a moby:Collection block usage : @Simples = getCollectedSimples($XML) args : raw XML or XML::LibXML of a moby:Collection block @@ -995,7 +987,6 @@ =head2 getInputArticles - name : getInputArticles function : get the Simple/Collection articles for each input query, in order usage : @queries = getInputArticles($XML) args : the raw XML of a moby:MOBY query @@ -1050,7 +1041,6 @@ =head2 isSimpleArticle - name : isSimpleArticle function : tests XML (text) or an XML DOM node to see if it represents a Simple article usage : if (isSimpleArticle($node)){do something to it} input : an XML::LibXML node, an XML::LibXML::Document or straight XML @@ -1071,7 +1061,6 @@ =head2 isCollectionArticle - name : isCollectionArticle function : tests XML (text) or an XML DOM node to see if it represents a Collection article usage : if (isCollectionArticle($node)){do something to it} input : an XML::LibXML node, an XML::LibXML::Document or straight XML @@ -1090,7 +1079,6 @@ =head2 isSecondaryArticle - name : isSecondaryArticle function : tests XML (text) or an XML DOM node to see if it represents a Secondary article usage : if (isSecondaryArticle($node)){do something to it} input : an XML::LibXML node, an XML::LibXML::Document or straight XML @@ -1111,7 +1099,6 @@ =head2 extractRawContent - name : extractRawContent function : pass me an article (Simple, or Collection) and I'll give you the content AS A STRING - i.e. the raw XML of the contained MOBY Object(s) usage : extractRawContent($simple) @@ -1133,7 +1120,6 @@ =head2 getNodeContentWithArticle - name : getNodeContentWithArticle function : a very flexible way to get the stringified content of a node that has the correct element and article name or get the value of a Parameter element. @@ -1296,7 +1282,6 @@ =head2 validateNamespaces - name : validateNamespaces function : checks the namespace ontology for the namespace lsid usage : @LSIDs = validateNamespaces(@namespaces) args : ordered list of either human-readable or lsid presumptive namespaces @@ -1321,7 +1306,6 @@ =head2 validateThisNamespace - name : validateThisNamespace function : checks a given namespace against a list of valid namespaces usage : $valid = validateThisNamespace($ns, @validNS); args : ordered list of the namespace of interest and the list of valid NS's @@ -1339,7 +1323,6 @@ =head2 getResponseArticles (a.k.a. extractResponseArticles) - name : getResponseArticles function : get the DOM nodes corresponding to individual Simple or Collection outputs from a MOBY Response usage : ($collections, $simples) = getResponseArticles($node) @@ -1411,7 +1394,6 @@ =head2 getServiceNotes - name : getServiceNotes function : to get the content of the Service Notes block of the MOBY message usage : getServiceNotes($message) args : $message is either the XML::LibXML of the MOBY message, or plain XML @@ -1443,7 +1425,6 @@ =head2 getCrossReferences - name : getCrossReferences function : to get the cross-references for a Simple article usage : @xrefs = getCrossReferences($XML) args : $XML is either a SIMPLE article (...) @@ -1501,7 +1482,6 @@ =head2 whichDeepestParentObject - name : whichDeepestParentObject function : select the parent node from nodeList that is closest to the querynode usage : ($term, $lsid) = whichDeepestParentObject($CENTRAL, $queryTerm, \@termList) From fgibbons at pub.open-bio.org Thu Sep 1 12:09:40 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Thu Sep 1 12:52:21 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509011609.j81G9e0G006651@pub.open-bio.org> fgibbons Thu Sep 1 12:09:40 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv6626/t Modified Files: Client-OntologyServer.t Log Message: - Test that 'Exists' functions return success/failure when they should. The relationship function seems to fail, perhaps the test is wrong. moby-live/Perl/t Client-OntologyServer.t,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/08/31 14:17:11 1.1 +++ /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/01 16:09:39 1.2 @@ -14,8 +14,6 @@ #use SOAP::Lite +trace; use Test::More 'no_plan'; # perldoc Test::More for details use strict; -use English; -use Data::Dumper; use MOBY::Client::OntologyServer; #Is the client-code even installed? BEGIN { use_ok('MOBY::Client::OntologyServer') }; @@ -33,8 +31,68 @@ my @API = (@autoload, qw/new getUserAgent objectExists serviceExists namespaceExists relationshipExists/); -my $si = MOBY::Client::OntologyServer->new(); -foreach (@autoload) {eval{$si->$_};} # Call all AUTOLOAD methods, to create them. +my $os = MOBY::Client::OntologyServer->new(); +foreach (@autoload) {eval{$os->$_};} # Call all AUTOLOAD methods, to create them. can_ok("MOBY::Client::OntologyServer", @API) or diag("OntologyServer doesn't implement full API"); +################ CHECK THAT VALID STUFF RETURNS CORRECTLY ########## +# +# It would really be better not to have literal lists of valid namespaces here, +# Can we pull the entire list of valid namespaces in programmatically from somewhere, +# and check them all here? Ditto for Objects, Service-types +# +my ($success, $msg, $existingURI); +my @check_ns = qw/SGD NCBI_gi/; +foreach (@check_ns) { + ($success, $msg, $existingURI) = $os->namespaceExists( term => $_); + is($success, 1) + or diag("Namespace '$_' reported erroneously as non-existent."); +} + +my @check_obj = qw/ Object String Integer Float/; +foreach (@check_obj) { + ($success, $msg, $existingURI) = $os->objectExists(term => $_); + is($success, 1) + or diag("Object '$_' reported erroneously as non-existent."); +} + +my @check_servicetype = qw/Retrieval/; +foreach (@check_servicetype) { + ($success, $msg, $existingURI) = $os->serviceExists(term => $_); + is($success, 1) + or diag("Service type '$_' reported erroneously as non-existent."); +} + +my @check_rel = qw/ISA HASA HAS/; +foreach (@check_rel) { + ($success, $msg, $existingURI) = $os->relationshipExists(term => $_); + is($success, 1) + or diag("Relationship '$_' reported erroneously as non-existent."); +} + + +######### CHECK THAT *IN*VALID STUFF FAILS CORRECTLY ############### +# +# Literal invalid names are OK here, since there's no obvious way to generate them +# and guarantee that they'll be invalid. +# +my $invalid_ns = "InvalidNS"; +($success, $msg, $existingURI) = $os->namespaceExists( term => $invalid_ns); +is($success, 0) + or diag("Namespace '$invalid_ns' reported erroneously as existent."); + +my $invalid_obj = "InvalidObject"; +($success, $msg, $existingURI) = $os->objectExists(term => $invalid_obj); +is($success, 0) + or diag("Object '$invalid_obj' reported erroneously as existent."); + +my $invalid_st = "InvalidServiceType"; +($success, $msg, $existingURI) = $os->serviceExists(term => $invalid_st); +is($success, 0) + or diag("Service type '$invalid_st' reported erroneously as existent."); + +my $invalid_rel = "HA"; +($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel); +is($success, 0) + or diag("Relationship '$invalid_rel' reported erroneously as existent."); From mwilkinson at pub.open-bio.org Thu Sep 1 16:04:40 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu Sep 1 16:47:30 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509012004.j81K4eVc007213@pub.open-bio.org> mwilkinson Thu Sep 1 16:04:40 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv7194/MOBY/Client Modified Files: Service.pm Log Message: fixed docs for Client Service, added a version attribute to the MOBY tag. moby-live/Perl/MOBY/Client Service.pm,1.20,1.21 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/06/30 11:47:19 1.20 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/09/01 20:04:40 1.21 @@ -66,8 +66,9 @@ ( service => [ undef, 'read/write' ], uri => [ undef, 'read/write' ], - ServiceName => [ undef, 'read/write' ], + serviceName => [ undef, 'read/write' ], _soapService => [ undef, 'read/write' ], + smessageVersion => ['0.87', 'read' ], ); #_____________________________________________________________ @@ -123,7 +124,7 @@ return undef unless $wsdl; my $soap = SOAP::Lite->service( "data:,$wsdl" ); if ( $self->uri ) { $soap->uri( $self->uri ) } - $self->ServiceName( &getServiceName( $soap ) ); + $self->serviceName( &_getServiceName( $soap ) ); $self->_soapService( $soap ); return $self; } @@ -219,8 +220,9 @@ # this was added on January 19th, 2005 and may not work! ################### ################### + my $version = $self->smessageVersion(); $data = " - + $data @@ -246,11 +248,21 @@ return $@ ? "" : $response; # the service execution failed then pass back "" } -=head2 ServiceName +=head2 serviceName - Title : ServiceName - Usage : $name = $Service->name() - Function : retrieve the name of your service + Title : serviceName + Usage : $name = $Service->serviceName() + Function : get the name of the service + Returns : string + Args : none + +=cut + +=head2 _getServiceName + + Title : getServiceName + Usage : $name = $Service->getServiceName() + Function : Internal method to retrieve the name of the service from the SOAP object Returns : string Args : none From mwilkinson at pub.open-bio.org Thu Sep 1 16:14:17 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu Sep 1 16:56:57 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509012014.j81KEHXm007298@pub.open-bio.org> mwilkinson Thu Sep 1 16:14:17 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv7279/MOBY/Client Modified Files: Service.pm Log Message: fixed docs for Client Service, added a version attribute to the MOBY tag. moby-live/Perl/MOBY/Client Service.pm,1.21,1.22 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/09/01 20:04:40 1.21 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/09/01 20:14:17 1.22 @@ -241,7 +241,7 @@ # $data # #]]>"; - my $METHOD = $self->ServiceName; + my $METHOD = $self->serviceName; &_LOG( %args, $METHOD ); my $response; eval { ( $response ) = $self->_soapService->$METHOD( $data ) }; @@ -260,8 +260,8 @@ =head2 _getServiceName - Title : getServiceName - Usage : $name = $Service->getServiceName() + Title : _getServiceName + Usage : $name = $Service->_getServiceName() Function : Internal method to retrieve the name of the service from the SOAP object Returns : string Args : none From mwilkinson at pub.open-bio.org Thu Sep 1 16:16:04 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu Sep 1 16:58:42 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509012016.j81KG4aH007386@pub.open-bio.org> mwilkinson Thu Sep 1 16:16:04 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv7367/MOBY/Client Modified Files: Service.pm Log Message: fixed docs for Client Service, added a version attribute to the MOBY tag. moby-live/Perl/MOBY/Client Service.pm,1.22,1.23 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/09/01 20:14:17 1.22 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/09/01 20:16:04 1.23 @@ -268,7 +268,7 @@ =cut -sub getServiceName { +sub _getServiceName { my ( $service ) = @_; no strict; my ( $method ) = @{ join '::', ref $service, 'EXPORT_OK' }; From mwilkinson at pub.open-bio.org Thu Sep 1 16:20:13 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu Sep 1 17:02:56 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509012020.j81KKDs7007458@pub.open-bio.org> mwilkinson Thu Sep 1 16:20:13 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv7439/t Modified Files: Client-Service.t Log Message: updating test for ClientService moby-live/Perl/t Client-Service.t,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Service.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/01 13:50:46 1.2 +++ /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/01 20:20:13 1.3 @@ -33,14 +33,9 @@ my $opinion = <new(), undef) From senger at pub.open-bio.org Fri Sep 2 03:31:50 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri Sep 2 04:17:04 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020731.j827VoHB009022@pub.open-bio.org> senger Fri Sep 2 03:31:50 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv9004/dashboard Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard added to the repository moby-live/Java/src/main/org/biomoby/service/dashboard - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Sep 2 03:37:42 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri Sep 2 04:20:26 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020737.j827bgxr009068@pub.open-bio.org> senger Fri Sep 2 03:37:42 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files In directory pub.open-bio.org:/tmp/cvs-serv9050/doc-files Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files added to the repository moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Sep 2 03:38:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri Sep 2 04:21:51 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020738.j827calY009132@pub.open-bio.org> senger Fri Sep 2 03:38:35 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv9113 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.27,1.28 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/01 08:01:16 1.27 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/02 07:38:35 1.28 @@ -80,6 +80,9 @@ + + + From senger at pub.open-bio.org Fri Sep 2 03:38:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri Sep 2 04:21:59 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020738.j827caMg009151@pub.open-bio.org> senger Fri Sep 2 03:38:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv9113/src/config Modified Files: run-any-client Log Message: moby-live/Java/src/config run-any-client,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-any-client,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-any-client 2005/08/26 06:27:03 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-any-client 2005/09/02 07:38:36 1.3 @@ -15,5 +15,6 @@ CLASSPATH=${PROJECT_HOME}/build/others/skeletons:$CLASSPATH CLASSPATH=${PROJECT_HOME}/build/others/samples:$CLASSPATH CLASSPATH=`echo ${PROJECT_HOME}/lib/*.jar | tr ' ' ':'`:$CLASSPATH +###CLASSPATH=`echo ${PROJECT_HOME}/lib/ant_home/lib/*.jar | tr ' ' ':'`:$CLASSPATH exec java -cp $CLASSPATH "$@" From senger at pub.open-bio.org Fri Sep 2 03:38:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri Sep 2 04:22:26 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020738.j827calM009185@pub.open-bio.org> senger Fri Sep 2 03:38:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files In directory pub.open-bio.org:/tmp/cvs-serv9113/src/main/org/biomoby/service/dashboard/doc-files Added Files: code-generators-panel.jpg dashboard.jpg deployment-panel.jpg registration-panel.jpg registry-panel.jpg testing-panel.jpg Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files code-generators-panel.jpg,NONE,1.1 dashboard.jpg,NONE,1.1 deployment-panel.jpg,NONE,1.1 registration-panel.jpg,NONE,1.1 registry-panel.jpg,NONE,1.1 testing-panel.jpg,NONE,1.1 From senger at pub.open-bio.org Fri Sep 2 03:38:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri Sep 2 04:26:13 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020738.j827caip009167@pub.open-bio.org> senger Fri Sep 2 03:38:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv9113/src/main/org/biomoby/service/dashboard Added Files: AbstractPanel.java DashboardPanel.java RegistryPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard AbstractPanel.java,NONE,1.1 DashboardPanel.java,NONE,1.1 RegistryPanel.java,NONE,1.1 From fgibbons at pub.open-bio.org Fri Sep 2 10:29:30 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri Sep 2 11:13:31 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509021429.j82ETU9n010579@pub.open-bio.org> fgibbons Fri Sep 2 10:29:30 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv10554/t Modified Files: Client-Service.t Log Message: - Call autoload methods to generate code. Still fails on serviceName method. moby-live/Perl/t Client-Service.t,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Service.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/01 20:20:13 1.3 +++ /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/02 14:29:30 1.4 @@ -26,28 +26,23 @@ }; -TODO: { - local $TODO = "Test: new, execute, name, and autoload methods."; - -} - -my $opinion = <new(), undef) +my @autoload = qw/serviceName/; +my @API = (@autoload, qw/new execute/); +my $service = MOBY::Client::Service->new(); +is($service, undef) or diag("Created a new service without supplying any WSDL - it ain't right, I tell you!"); # Can't do nothing without WSDL +foreach (@autoload) { eval{$service->$_()}; } # Call all autoloads, to create them. +can_ok("MOBY::Client::Service", @API) + or diag("MOBY::Client::Service doesn't implement full API."); + # Find a service at MOBY Central, try to create a local instance. my $C = MOBY::Client::Central->new(); my ($s, $r) = $C->findService( authURI => 'www.illuminae.com', name => 'getDragonLocusAlleles' ); ok($s) or diag("Couldn't retrieve service details from MOBY Central"); my $wsdl = $C->retrieveService($$s[0]); -my $service = MOBY::Client::Service->new (service => $wsdl); +$service = MOBY::Client::Service->new (service => $wsdl); isa_ok($service, "MOBY::Client::Service") or diag("Expected new to return MOBY::Client::Service"); From fgibbons at pub.open-bio.org Fri Sep 2 10:32:15 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri Sep 2 11:15:12 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509021432.j82EWFBJ010628@pub.open-bio.org> fgibbons Fri Sep 2 10:32:15 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv10603/t Modified Files: Client-SimpleArticle.t Log Message: - Check API for SimpleArticle. Looks like calls to ->XML() don't do what you'd expect: parse the XML, and modify the object. moby-live/Perl/t Client-SimpleArticle.t,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t 2005/08/31 14:17:11 1.1 +++ /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t 2005/09/02 14:32:15 1.2 @@ -31,7 +31,7 @@ my @autoload = qw/articleName objectType objectLSID namespaces id XML XML_DOM isSimple isCollection isSecondary/; -my @API = (@autoload, qw/new createFromXML createFromDOM/); +my @API = (@autoload, qw/new addNamespace value /); # createFrom[XML|DOM] are not meant to be public my $smpl = MOBY::Client::SimpleArticle->new(); foreach (@autoload) {eval{$smpl->$_};} # Call all AUTOLOAD methods, to create them. @@ -43,3 +43,105 @@ is($smpl->isSecondary, 0) or diag("SimpleArticle cannot be Secondary"); is($smpl->isCollection, 0) or diag("SimpleArticle cannot be Collection"); +my $aName = 'my Article'; +is($smpl->articleName($aName), $aName) or diag("Couldn't set articleName"); +is($smpl->articleName(), $aName) or diag("Couldn't get articleName"); + +my $obj_type = 'String'; +is($smpl->objectType($obj_type), $obj_type) or diag("Couldn't set objectType"); +is($smpl->objectType(), $obj_type) or diag("Couldn't get objectType"); + +my $obj_lsid = 'String'; +is($smpl->objectLSID($obj_lsid), $obj_lsid) or diag("Couldn't set objectLSID"); +is($smpl->objectLSID(), $obj_lsid) or diag("Couldn't get objectLSID"); + +my @ns = qw/SGD FB GO/; +eq_array($smpl->namespaces(\@ns), \@ns) or diag("Couldn't set namespaces"); +eq_array($smpl->namespaces(), \@ns) or diag("Couldn't get namespaces"); + +my $new_ns = 'NCBI_gi'; +# Order is critical in this test: FIRST get existing namespaces, THEN add one, and CHECK +eq_array( [@{$smpl->namespaces()}, $new_ns ], $smpl->addNamespace($new_ns)) + or diag("Couldn't add new namespace ('$new_ns')"); + +# Check XML-generation code. +# In reality, (XML, createFromXML) and (XML_DOM, createFromDOM) should behave the same. +# Let's not assume that though. + +my ($artName, $ns, $id, $obj, $lsid) + = ('my Article', 'SGD', 'S0005111', 'Object', 'urn:foo:bar:my_lsid'); +my $xml_smpl = < + + +XML + +$smpl = MOBY::Client::SimpleArticle->new( XML => $xml_smpl); + +is($smpl->objectLSID(), $lsid) + or diag("SimpleArticle not correctly built from XML (LSID wrong)"); + +is($smpl->articleName(), $artName) + or diag("SimpleArticle not correctly built from XML (articleName wrong)"); + +is($smpl->objectType(), $obj) + or diag("SimpleArticle not correctly built from XML (objectType wrong)"); + +eq_array($smpl->namespaces(), [$ns]) + or diag("SimpleArticle not correctly built from XML (namespace wrong)"); + +is($smpl->id(), $id) + or diag("SimpleArticle not correctly built from XML (id wrong)"); + +sub XML_maker { # Turn XML text into DOM. + my $XML = shift; + my $parser = XML::LibXML->new(); + my $doc; + eval { $doc = $parser->parse_string( $XML ); }; + return '' if ( $EVAL_ERROR ); #("Couldn't parse '$XML' because:\n\t$EVAL_ERROR") + return $doc->getDocumentElement(); +} + + +$smpl = MOBY::Client::SimpleArticle->new( XML_DOM => XML_maker($xml_smpl)); + +is($smpl->objectLSID(), $lsid) + or diag("SimpleArticle not correctly built from XML_DOM (LSID wrong)"); + +is($smpl->articleName(), $artName) + or diag("SimpleArticle not correctly built from XML_DOM (articleName wrong)"); + +is($smpl->objectType(), $obj) + or diag("SimpleArticle not correctly built from XML_DOM (objectType wrong)"); + +eq_array($smpl->namespaces(), [$ns]) + or diag("SimpleArticle not correctly built from XML_DOM (namespace wrong)"); + +is($smpl->id(), $id) + or diag("SimpleArticle not correctly built from XML_DOM (id wrong)"); + + +TODO: { + local $TODO = <new()->XML(\$xml), +I expect that the XML will be *parsed*, to modify the object, +not that the attribute 'XML' will be set, and the rest left unchanged." +TODO + + $smpl = MOBY::Client::SimpleArticle->new(); + $smpl->XML($xml_smpl); + is($smpl->objectLSID(), $lsid) + or diag("Couldn't create SimpleArticle from autoloaded method XML(): LSID wrong"); + + is($smpl->articleName, $artName) + or diag("Couldn't create SimpleArticle from autoloaded method XML(): articleName wrong"); + + is($smpl->objectType(), $obj) + or diag("Couldn't create SimpleArticle from autoloaded method XML(): objectType wrong"); + + eq_array($smpl->namespaces(), [$ns]) + or diag("Couldn't create SimpleArticle from autoloaded method XML(): namespaces wrong"); + + is($smpl->id(), $id) + or diag("Couldn't create SimpleArticle from autoloaded method XML(): id wrong"); +} From fgibbons at pub.open-bio.org Fri Sep 2 10:39:21 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri Sep 2 11:21:59 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509021439.j82EdLtE010687@pub.open-bio.org> fgibbons Fri Sep 2 10:39:20 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv10661 Modified Files: SimpleArticle.pm Log Message: - The tests drove out a few bugs: * extraction of lsid from element was incorrect. * call to the XML method does nothing except set the value of the $self->XML component to the string passed in as the argument. This isn't what you'd expect, since everything else is a get/set method, and setting the XML to a string that doesn't reflect the actual object is not likely to be useful in an API. Solution: Either we remove it from the API, i.e., make it a private method; or we make it do the right thing (see above). - Removed redundant 'Title' lines in perldoc. moby-live/Perl/MOBY/Client SimpleArticle.pm,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm 2005/07/29 18:58:44 1.8 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm 2005/09/02 14:39:20 1.9 @@ -53,7 +53,6 @@ =head2 new - Title : new Usage : my $SA = MOBY::Client::SimpleArticle->new(%args) Function : create SimpleArticle object Returns : MOBY::Client::SimpleArticle object @@ -64,81 +63,60 @@ XML_DOM => $XML::DOM::NODE -=cut =head2 articleName - Title : articleName Usage : $name = $SA->articleName($name) Function : get/set articleName Returns : string Arguments : (optional) string representing articleName to set -=cut - =head2 objectType - Title : objectType Usage : $type = $SA->objectType($type) Function : get/set name Returns : string Arguments : (optional) string representing objectType to set -=cut - =head2 objectLSID - Title : objectLSID Usage : $type = $SA->objectLSID($type) Function : get/set LSID Returns : string Arguments : (optional) string representing objectLSID to set -=cut - =head2 namespaces - Title : namespaces Usage : $namespaces = $SA->namespaces(\@namespaces) Function : get/set namespaces for the objectType Returns : arrayref of namespace strings Arguments : (optional) arrayref of namespace strings to set -=cut =head2 XML - Title : XML Usage : $SA = $SA->XML($XML) Function : set/reset all parameters for this object from the XML Returns : MOBY::Client::SimpleArticle Arguments : (optional) XML fragment from and including ... -=cut - =head2 XML_DOM - Title : XML_DOM Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) Function : set/reset all parameters for this object from the XML::DOM node for Returns : MOBY::Client::SimpleArticle Arguments : (optional) an $XML::DOM node from the article of a DOM -=cut =head2 addNamespace - Title : addNamespace Usage : $namespaces = $IN->addNamespace($namespace) Function : add another namespace for the objectType Returns : namespace string -=cut - =head2 isSimple - Title : isSimple Usage : $boolean = $IN->isSimple() Function : is this a SimpleArticle type (yes, I know this is obvious, but since you can @@ -147,11 +125,9 @@ to test what you have in-hand) Returns : 1 (true) -=cut =head2 isCollection - Title : isCollection Usage : $boolean = $IN->isCollection() Function : is this a CollectionArticle type (yes, I know this is obvious, but since you can @@ -160,11 +136,8 @@ to test what you have in-hand) Returns : 0 for false -=cut - =head2 isSecondary - Title : isSecondary Usage : $boolean = $IN->isSecondary() Function : is this a SecondaryArticle type? (yes, I know this is obvious) @@ -220,68 +193,65 @@ } sub new { - my ( $caller, %args ) = @_; - my $caller_is_obj = ref( $caller ); - return $caller if $caller_is_obj; - my $class = $caller_is_obj || $caller; - my $proxy; - my $self = bless {}, $class; - foreach my $attrname ( $self->_standard_keys ) { - if ( exists $args{$attrname} ) { - $self->{$attrname} = $args{$attrname}; - } elsif ( $caller_is_obj ) { - $self->{$attrname} = $caller->{$attrname}; - } else { - $self->{$attrname} = $self->_default_for( $attrname ); - } - } - if ( $self->XML && ref( $self->XML ) ) { - return 0; - } elsif ( $self->XML_DOM && !( ref( $self->XML_DOM ) =~ /libxml/i ) ) { - return 0; - } - $self->createFromXML if ( $self->XML ); - $self->createFromDOM( $self->XML_DOM ) if ( $self->XML_DOM ); - return $self; + my ( $caller, %args ) = @_; + my $caller_is_obj = ref( $caller ); + return $caller if $caller_is_obj; + my $class = $caller_is_obj || $caller; + my $proxy; + my $self = bless {}, $class; + foreach my $attrname ( $self->_standard_keys ) { + if ( exists $args{$attrname} ) { + $self->{$attrname} = $args{$attrname}; + } elsif ( $caller_is_obj ) { + $self->{$attrname} = $caller->{$attrname}; + } else { + $self->{$attrname} = $self->_default_for( $attrname ); + } + } + if ( $self->XML && ref( $self->XML ) ) { + return 0; + } elsif ( $self->XML_DOM && !( ref( $self->XML_DOM ) =~ /XML\:\:LibXML/ ) ) { + return 0; + } + + $self->createFromXML if ( $self->XML ); + $self->createFromDOM( $self->XML_DOM ) if ( $self->XML_DOM ); + return $self; } sub createFromXML { - my ( $self ) = @_; - my $p = XML::LibXML->new; - my $doc = $p->parse_string( $self->XML ); - my $root = $doc->getDocumentElement; - return 0 unless ( $root && ( $root->nodeName eq "Simple" ) ); - return $self->createFromDOM( $root ); + my ( $self ) = @_; + my $p = XML::LibXML->new; + my $doc = $p->parse_string( $self->XML ); + my $root = $doc->getDocumentElement; + return 0 unless ( $root && ( $root->nodeName eq "Simple" ) ); + return $self->createFromDOM( $root ); } sub createFromDOM { - my ( $self, $dom ) = @_; - return 0 unless ( $dom && ( $dom->nodeName eq "Simple" ) ); - $self->XML( $dom->toString ); # set the string version of the DOM - $self->namespaces( [] ); # reset! - $self->articleName( "" ); - $self->objectType( "" ); - my $attr = $dom->getAttributeNode( 'articleName' ); - my $lsid = $dom->getAttributeNode( 'lsid' ); - my $articleName = ""; - $articleName = $attr->getValue if $attr; - $lsid = $attr->getValue if $lsid; - - $self->articleName( $articleName ) - if $articleName - ; # it may have already been set if this Simple is part of a Collection... - $self->objectLSID( $lsid) if $lsid; - -# fork here - it may be an instantiated object (coming from a service invocation/response) -# or it may be a template object as in the SimpleArticle element of a registration call -# if the objectType tag exists, then it is a template object - if ( @{ $dom->getElementsByTagName( "objectType" ) }[0] ) { - return $self->_createTemplateArticle( $dom ); - } else { - return $self->_createInstantiatedArticle( $dom ); - } - - # otherwise it should simpy contain an instantiated MOBY object + my ( $self, $dom ) = @_; + return 0 unless ( $dom && ( $dom->nodeName eq "Simple" ) ); + $self->namespaces( [] ); # reset! + $self->articleName( "" ); + $self->objectType( "" ); + my $attr = $dom->getAttributeNode( 'articleName' ); + my $articleName = $attr ? $attr->getValue : ""; + $attr = $dom->getAttributeNode( 'lsid' ); + my $lsid = $attr ? $attr->getValue : ""; + + $self->articleName( $articleName ) + if $articleName; # it may have already been set if this Simple is part of a Collection... + $self->objectLSID( $lsid) if $lsid; + + # fork here - it may be an instantiated object (coming from a service invocation/response) + # or it may be a template object as in the SimpleArticle element of a registration call + # if the objectType tag exists, then it is a template object + if ( @{ $dom->getElementsByTagName( "objectType" ) }[0] ) { + return $self->_createTemplateArticle( $dom ); + } else { + return $self->_createInstantiatedArticle( $dom ); + } + # otherwise it should simpy contain an instantiated MOBY object } sub _createInstantiatedArticle { @@ -333,29 +303,30 @@ } sub AUTOLOAD { - no strict "refs"; - my ( $self, $newval ) = @_; - $AUTOLOAD =~ /.*::(\w+)/; - my $attr = $1; - if ( $self->_accessible( $attr, 'write' ) ) { - *{$AUTOLOAD} = sub { - if ( defined $_[1] ) { $_[0]->{$attr} = $_[1] } - return $_[0]->{$attr}; - }; ### end of created subroutine -### this is called first time only - if ( defined $newval ) { - $self->{$attr} = $newval; - } - return $self->{$attr}; - } elsif ( $self->_accessible( $attr, 'read' ) ) { - *{$AUTOLOAD} = sub { - return $_[0]->{$attr}; - }; ### end of created subroutine - return $self->{$attr}; - } - - # Must have been a mistake then... - croak "No such method: $AUTOLOAD"; + # It seems desirable that if the XML() method is called, the XML should be parsed, rather than just being + no strict "refs"; + my ( $self, $newval ) = @_; + $AUTOLOAD =~ /.*::(\w+)/; + my $attr = $1; + if ( $self->_accessible( $attr, 'write' ) ) { + *{$AUTOLOAD} = sub { + if ( defined $_[1] ) { $_[0]->{$attr} = $_[1]; } + return $_[0]->{$attr}; + }; ### end of created subroutine + ### this is called first time only + if ( defined $newval ) { + $self->{$attr} = $newval; + } + return $self->{$attr}; + } elsif ( $self->_accessible( $attr, 'read' ) ) { + *{$AUTOLOAD} = sub { + return $_[0]->{$attr}; + }; ### end of created subroutine + return $self->{$attr}; + } + + # Must have been a mistake then... + croak "No such method: $AUTOLOAD"; } sub DESTROY { } 1; From senger at pub.open-bio.org Sun Sep 4 09:15:58 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 4 09:58:30 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041315.j84DFwnF027181@pub.open-bio.org> senger Sun Sep 4 09:15:55 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv27126 Modified Files: activation.jar alltools2.jar axis-ant.jar axis.jar jaxrpc.jar saaj.jar servlet.jar xercesImpl.jar xmlParserAPIs.jar Added Files: commons-discovery-0.2.jar commons-httpclient-3.0-rc2.jar commons-logging-1.0.4.jar log4j-1.2.8.jar mailapi_1_3_1.jar wsdl4j-1.5.1.jar Removed Files: commons-discovery.jar commons-logging.jar log4j-1.2.4.jar wsdl4j.jar Log Message: jars-archive/current commons-discovery-0.2.jar,NONE,1.1 commons-httpclient-3.0-rc2.jar,NONE,1.1 commons-logging-1.0.4.jar,NONE,1.1 log4j-1.2.8.jar,NONE,1.1 mailapi_1_3_1.jar,NONE,1.1 wsdl4j-1.5.1.jar,NONE,1.1 activation.jar,1.1,1.2 alltools2.jar,1.1,1.2 axis-ant.jar,1.1,1.2 axis.jar,1.1,1.2 jaxrpc.jar,1.1,1.2 saaj.jar,1.1,1.2 servlet.jar,1.1,1.2 xercesImpl.jar,1.1,1.2 xmlParserAPIs.jar,1.1,1.2 commons-discovery.jar,1.1,NONE commons-logging.jar,1.1,NONE log4j-1.2.4.jar,1.1,NONE wsdl4j.jar,1.1,NONE =================================================================== RCS file: /home/repository/moby/jars-archive/current/activation.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/activation.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/activation.jar 2005/09/04 13:15:54 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/activation.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/08/24 14:24:18 1.1 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/04 13:15:54 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/axis-ant.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/axis-ant.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/axis-ant.jar 2005/09/04 13:15:54 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/axis-ant.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/axis.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/axis.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/axis.jar 2005/09/04 13:15:54 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/axis.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/jaxrpc.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/jaxrpc.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/jaxrpc.jar 2005/09/04 13:15:55 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/jaxrpc.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/saaj.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/saaj.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/saaj.jar 2005/09/04 13:15:55 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/saaj.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/servlet.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/servlet.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/servlet.jar 2005/09/04 13:15:55 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/servlet.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/xercesImpl.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/xercesImpl.jar 2005/06/10 13:55:36 1.1 and /home/repository/moby/jars-archive/current/xercesImpl.jar 2005/09/04 13:15:55 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/xercesImpl.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/xmlParserAPIs.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/xmlParserAPIs.jar 2005/06/10 13:55:36 1.1 and /home/repository/moby/jars-archive/current/xmlParserAPIs.jar 2005/09/04 13:15:55 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/xmlParserAPIs.jar: diff failed rcsdiff: /home/repository/moby/jars-archive/current/RCS/commons-discovery.jar,v: No such file or directory rcsdiff: /home/repository/moby/jars-archive/current/RCS/commons-logging.jar,v: No such file or directory rcsdiff: /home/repository/moby/jars-archive/current/RCS/log4j-1.2.4.jar,v: No such file or directory rcsdiff: /home/repository/moby/jars-archive/current/RCS/wsdl4j.jar,v: No such file or directory From senger at pub.open-bio.org Sun Sep 4 09:45:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 4 10:32:45 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjbGP027859@pub.open-bio.org> senger Sun Sep 4 09:45:36 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv27838 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.28,1.29 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/02 07:38:35 1.28 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/04 13:45:36 1.29 @@ -66,6 +66,21 @@ + + + + + + + + + + + + + + + @@ -148,42 +163,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -214,6 +193,11 @@ + + + + @@ -489,26 +473,9 @@ - - - - - - - - - - - + - - - - @@ -521,6 +488,9 @@ + + + @@ -534,11 +504,66 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -596,114 +621,213 @@ - - - - - - - - - - - - - - + - - - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + <undeployment xmlns="http://xml.apache.org/axis/wsdd/"> + <service name="${service.name}"/> + </undeployment> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - + - - - - + + - + - - - + - - No list of service names found. - =============================== - A list can be defined in one of the following ways: - a) Create a property 'services.list' containing - a comma-delimited list of names of services, or - b) For each service, create a property 'service.<service-name> - (replace <service-name> with a real name of service). + No list of service names found. + =============================== + Each service that you want to deploy should de defined + by a property of the following form (parts in upper-cases should be + replaced by the real values): + service.SERVICE-NAME = IMPLEMENTATION-CLASS-NAME + + Each service that you want to undeploy can be defined in the same + way (implementation class is not needed), or simpler by creating + a property 'services.list' containing a comma-delimited list of + names of services to be undeployed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <undeployment xmlns="http://xml.apache.org/axis/wsdd/"> - <service name="${service.name}"/> - </undeployment> - - - - - - - - - - @@ -976,6 +1052,10 @@ + + + + @@ -991,18 +1071,7 @@ - - - - - - - - - - - - + @@ -1044,7 +1113,7 @@ - + @@ -1070,21 +1139,8 @@ - - - - - - - - - - - - - - - + + @@ -1114,7 +1170,7 @@ - + @@ -1156,6 +1212,16 @@ + + + + + + + + + + From senger at pub.open-bio.org Sun Sep 4 09:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 4 10:32:57 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjcVm028109@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser In directory pub.open-bio.org:/tmp/cvs-serv27838/src/main/org/biomoby/shared/parser Modified Files: MobyParser.java Log Message: moby-live/Java/src/main/org/biomoby/shared/parser MobyParser.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/MobyParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/MobyParser.java 2005/08/26 06:27:05 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/MobyParser.java 2005/09/04 13:45:38 1.2 @@ -16,11 +16,12 @@ import org.biomoby.shared.datatypes.MobyXref; import org.biomoby.shared.datatypes.MapDataTypesIfc; -import embl.ebi.tools.ICreator; -import embl.ebi.utils.GException; -import embl.ebi.utils.DGUtils; -import embl.ebi.xml.XMLUtils2; -import embl.ebi.xml.XMLErrorHandler; +import org.tulsoft.tools.loaders.ICreator; +import org.tulsoft.shared.GException; +import org.tulsoft.tools.debug.DGUtils; +import org.tulsoft.tools.xml.XMLUtils2; +import org.tulsoft.tools.xml.XMLErrorHandler; + import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.xml.sax.Locator; From senger at pub.open-bio.org Sun Sep 4 09:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 4 10:32:57 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84Djc7t028086@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator In directory pub.open-bio.org:/tmp/cvs-serv27838/src/main/org/biomoby/service/generator Modified Files: Generator.java ServicesGenerator.java Log Message: moby-live/Java/src/main/org/biomoby/service/generator Generator.java,1.1,1.2 ServicesGenerator.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/Generator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/Generator.java 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/Generator.java 2005/09/04 13:45:38 1.2 @@ -8,8 +8,11 @@ package org.biomoby.service.generator; -import embl.ebi.utils.FileUtils; -import embl.ebi.utils.GException; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.shared.GException; +import org.tulsoft.tools.external.Executor; +import org.tulsoft.tools.servlets.Html; +import org.tulsoft.tools.servlets.HtmlConstants; import org.biomoby.shared.MobyException; import org.biomoby.shared.Central; @@ -21,8 +24,6 @@ import org.biomoby.client.CentralDigestCachedImpl; import org.biomoby.client.Graphviz; -import embl.ebi.tools.Executor; -import embl.ebi.utils.GException; import java.util.Properties; import java.util.HashMap; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/ServicesGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/ServicesGenerator.java 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/ServicesGenerator.java 2005/09/04 13:45:38 1.2 @@ -27,7 +27,8 @@ import org.biomoby.client.FilterServices; import org.biomoby.client.Graphviz; -import embl.ebi.servlets.Html; +import org.tulsoft.tools.servlets.Html; +import org.tulsoft.tools.servlets.HtmlConstants; import java.util.Properties; import java.util.Iterator; From senger at pub.open-bio.org Sun Sep 4 09:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 4 10:32:59 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84Djcxa028148@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/xmls In directory pub.open-bio.org:/tmp/cvs-serv27838/xmls Modified Files: libraries.xml Log Message: moby-live/Java/xmls libraries.xml,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/libraries.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/08/26 06:27:05 1.3 +++ /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/09/04 13:45:38 1.4 @@ -11,19 +11,19 @@ - - - + + + - + - + @@ -43,12 +43,12 @@ + - @@ -57,6 +57,7 @@ + @@ -82,6 +83,7 @@ + @@ -98,7 +100,15 @@ - + + + + + + + + + @@ -109,6 +119,7 @@ + @@ -136,6 +147,7 @@ + From senger at pub.open-bio.org Sun Sep 4 09:45:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 4 10:33:01 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjbEg027932@pub.open-bio.org> senger Sun Sep 4 09:45:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv27838/src/Clients Modified Files: CacheRegistryClient.java MobyCmdLineClient.java MobyDigestClient.java MobyGraphs.java MosesGenerators.java TestArgs.java TestingMobyParser.java UnregisterByAuthority.java Log Message: moby-live/Java/src/Clients CacheRegistryClient.java,1.1,1.2 MobyCmdLineClient.java,1.10,1.11 MobyDigestClient.java,1.1,1.2 MobyGraphs.java,1.8,1.9 MosesGenerators.java,1.1,1.2 TestArgs.java,1.1,1.2 TestingMobyParser.java,1.1,1.2 UnregisterByAuthority.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2004/11/14 16:12:50 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/04 13:45:37 1.2 @@ -8,8 +8,9 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import embl.ebi.tools.*; -import embl.ebi.utils.*; +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.shared.GException; import java.net.*; import java.util.*; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/08/07 06:30:49 1.10 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/09/04 13:45:37 1.11 @@ -8,8 +8,10 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import embl.ebi.tools.*; -import embl.ebi.utils.*; +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.shared.StringUtils; +import org.tulsoft.shared.GException; import java.net.*; import java.util.*; @@ -268,12 +270,12 @@ data.setAuthority (cmd.getParam ("-rd-auth")); data.setEmailContact (cmd.getParam ("-rd-email")); if ((param = cmd.getParam ("-rd-isa")) != null ) { - String[] isas = StringUtils.split (param, ","); + String[] isas = param.split (","); for (int i = 0; i < isas.length; i++) data.addParentName (isas [i]); } if ((param = cmd.getParam ("-rd-hasa")) != null ) { - String[] hasas = StringUtils.split (param, ","); + String[] hasas = param.split (","); for (int i = 0; i < hasas.length; i++) { int pos = hasas[i].indexOf (":"); if (pos == -1) { @@ -286,7 +288,7 @@ } } if ((param = cmd.getParam ("-rd-has")) != null ) { - String[] hasas = StringUtils.split (param, ","); + String[] hasas = param.split (","); for (int i = 0; i < hasas.length; i++) { int pos = hasas[i].indexOf (":"); if (pos == -1) { @@ -310,7 +312,7 @@ stype.setAuthority (cmd.getParam ("-rt-auth")); stype.setEmailContact (cmd.getParam ("-rt-email")); if ((param = cmd.getParam ("-rt-isa")) != null ) { - String[] isas = StringUtils.split (param, ","); + String[] isas = param.split (","); for (int i = 0; i < isas.length; i++) stype.addParentName (isas [i]); } @@ -351,9 +353,9 @@ } if ( (param = cmd.getParam ("-rs-in")) != null ) { - String[] inputs = StringUtils.split (param, ","); + String[] inputs = param.split (","); for (int i = 0; i < inputs.length; i++) { - String[] parts = StringUtils.split (inputs[i], "="); + String[] parts = inputs[i].split ("="); if (parts.length >= 2) { MobyPrimaryDataSimple data = new MobyPrimaryDataSimple ("dummy"); data.setDataType (new MobyDataType (parts[0])); @@ -367,7 +369,7 @@ } } if ((param = cmd.getParam ("-rs-ifile")) != null ) { - String[] files = StringUtils.split (param, ","); + String[] files = param.split (","); for (int i = 0; i < files.length; i++) { Properties props = new Properties(); try { @@ -421,9 +423,9 @@ } } if ((param = cmd.getParam ("-rs-out")) != null ) { - String[] outs = StringUtils.split (param, ","); + String[] outs = param.split (","); for (int i = 0; i < outs.length; i++) { - String[] parts = StringUtils.split (outs[i], "="); + String[] parts = outs[i].split ("="); if (parts.length >= 2) { MobyPrimaryDataSimple data = new MobyPrimaryDataSimple ("dummy"); data.setDataType (new MobyDataType (parts[0])); @@ -437,7 +439,7 @@ } } if ((param = cmd.getParam ("-rs-ofile")) != null ) { - String[] files = StringUtils.split (param, ","); + String[] files = param.split (","); for (int i = 0; i < files.length; i++) { Properties props = new Properties(); try { @@ -535,7 +537,7 @@ if ((param = cmd.getParam ("-f")) != null ) { decorationLn ("Looking for services related to: '" + param + "':"); decorationLn ("--------------------------------"); - printServices (worker.findService (StringUtils.split (param, ",")), + printServices (worker.findService (param.split (",")), cmd.hasOption ("-on")); } @@ -555,9 +557,9 @@ pattern.setType (cmd.getParam ("-fs-type")); pattern.setAuthority (cmd.getParam ("-fs-auth")); if ((param = cmd.getParam ("-fs-in")) != null ) { - String[] inputs = StringUtils.split (param, ","); + String[] inputs = param.split (","); for (int i = 0; i < inputs.length; i++) { - String[] parts = StringUtils.split (inputs[i], "="); + String[] parts = inputs[i].split ("="); MobyPrimaryDataSimple input = new MobyPrimaryDataSimple ("dummy"); input.setDataType (new MobyDataType (parts[0])); if (parts.length >= 2) @@ -566,7 +568,7 @@ } } if ((param = cmd.getParam ("-fs-out")) != null ) { - String[] outs = StringUtils.split (param, ","); + String[] outs = param.split (","); for (int i = 0; i < outs.length; i++) { MobyPrimaryDataSimple output = new MobyPrimaryDataSimple ("dummy"); output.setDataType (new MobyDataType (outs[i])); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2004/11/14 16:43:49 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/09/04 13:45:37 1.2 @@ -7,8 +7,9 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import embl.ebi.tools.*; -import embl.ebi.utils.*; +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.shared.GException; /** * A simple client retrieving and printing cummulative (digestive) =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2005/07/19 12:39:58 1.8 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2005/09/04 13:45:37 1.9 @@ -8,8 +8,11 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import embl.ebi.tools.*; -import embl.ebi.utils.*; +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.tools.Printf; +import org.tulsoft.shared.UUtils; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.shared.GException; import java.net.*; import java.util.*; @@ -146,7 +149,7 @@ while ((line = data.readLine()) != null) { if (line.trim().equals ("")) continue; if (line.trim().startsWith ("#")) continue; - String[] fields = StringUtils.split (line); + String[] fields = line.split ("\\s+"); if (fields.length > 1) { if (fields[0].equalsIgnoreCase ("start")) { DataServiceEdge dse = new DataServiceEdge (new MobyDataType ("start"), @@ -181,9 +184,9 @@ String[] serviceNames = null; int depth = 1; if ((param = cmd.getParam ("-auth")) != null ) - authorities = StringUtils.split (param, ","); + authorities = param.split (","); if ((param = cmd.getParam ("-name")) != null ) - serviceNames = StringUtils.split (param, ","); + serviceNames = param.split (","); param = cmd.getParam ("-depth"); if (param != null) { try { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MosesGenerators.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/MosesGenerators.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/MosesGenerators.java 2005/09/04 13:45:37 1.2 @@ -12,7 +12,7 @@ import org.biomoby.shared.MobyException; import org.biomoby.shared.Utils; -import embl.ebi.tools.BaseCmdLine; +import org.tulsoft.tools.BaseCmdLine; import java.util.Properties; /** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestArgs.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/TestArgs.java 2005/09/01 05:51:18 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/TestArgs.java 2005/09/04 13:45:37 1.2 @@ -6,6 +6,9 @@ // Copyright Martin Senger (martin.senger@gmail.com). // +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.shared.UUtils; + /** * Work in progress... * @@ -16,8 +19,17 @@ public static void main (String[] args) throws Exception { - for (int i = 0; i < args.length; i++) { - System. out.println (i + ": " + args[i]); + String withTools = System.getProperty ("with_tools"); + if (UUtils.is (withTools)) { + System.out.println ("Using BaseCmdLine:\n"); + BaseCmdLine cmd = new BaseCmdLine (args, true); + for (int i = 0; i < cmd.params.length; i++) { + System. out.println (i + ": " + cmd.params[i]); + } + } else { + for (int i = 0; i < args.length; i++) { + System. out.println (i + ": " + args[i]); + } } } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestingMobyParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/TestingMobyParser.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/TestingMobyParser.java 2005/09/04 13:45:37 1.2 @@ -10,7 +10,7 @@ import org.biomoby.shared.MobyException; import org.biomoby.shared.Utils; -import embl.ebi.tools.BaseCmdLine; +import org.tulsoft.tools.BaseCmdLine; import java.io.File; /** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java 2005/09/04 13:45:37 1.2 @@ -11,7 +11,7 @@ import org.biomoby.shared.Central; import org.biomoby.client.CentralImpl; -import embl.ebi.tools.BaseCmdLine; +import org.tulsoft.tools.BaseCmdLine; import java.util.Map; import java.util.Map.Entry; From senger at pub.open-bio.org Sun Sep 4 09:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 4 10:33:03 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjcT5028036@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service In directory pub.open-bio.org:/tmp/cvs-serv27838/src/main/org/biomoby/service Modified Files: BaseService.java Log Message: moby-live/Java/src/main/org/biomoby/service BaseService.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/BaseService.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/BaseService.java 2005/08/28 10:19:08 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/BaseService.java 2005/09/04 13:45:37 1.3 @@ -8,9 +8,9 @@ package org.biomoby.service; -import embl.ebi.soap.SOAPToolkit; -import embl.ebi.soap.SoapUtils; -import embl.ebi.utils.GException; +import org.tulsoft.tools.soap.SOAPToolkit; +import org.tulsoft.tools.soap.SoapUtils; +import org.tulsoft.shared.GException; import org.biomoby.shared.MobyException; import org.biomoby.shared.parser.MobyParser; @@ -197,7 +197,7 @@ * useful for session management.

* * See details what a toolkit can provide in - * embl.ebi.soap.SOAPToolkit. + * org.tulsoft.tools.soap.SOAPToolkit. *************************************************************************/ public SOAPToolkit getToolkit() { return toolkit; From senger at pub.open-bio.org Sun Sep 4 09:45:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 4 10:33:04 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84Djb0L028017@pub.open-bio.org> senger Sun Sep 4 09:45:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv27838/src/main/org/biomoby/client Modified Files: BaseClient.java BaseCmdLineClient.java CentralDigestImpl.java CentralImpl.java GraphsServlet.java Log Message: moby-live/Java/src/main/org/biomoby/client BaseClient.java,1.1,1.2 BaseCmdLineClient.java,1.1,1.2 CentralDigestImpl.java,1.3,1.4 CentralImpl.java,1.24,1.25 GraphsServlet.java,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java 2005/09/04 13:45:37 1.2 @@ -15,8 +15,8 @@ import org.biomoby.shared.parser.MobyPackage; import org.biomoby.shared.parser.MobyJob; -import embl.ebi.soap.axis.AxisCall; -import embl.ebi.utils.GException; +import org.tulsoft.tools.soap.axis.AxisCall; +import org.tulsoft.shared.GException; import java.net.URL; import java.net.MalformedURLException; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/09/04 13:45:37 1.2 @@ -17,11 +17,11 @@ import org.biomoby.shared.datatypes.MobyObject; import org.biomoby.shared.datatypes.MapDataTypesIfc; -import embl.ebi.tools.BaseCmdLine; -import embl.ebi.tools.ICreator; -import embl.ebi.utils.GException; -import embl.ebi.utils.FileUtils; -import embl.ebi.utils.DGUtils; +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.tools.loaders.ICreator; +import org.tulsoft.shared.GException; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.tools.debug.DGUtils; import java.util.Vector; import java.util.HashMap; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/04/18 23:57:45 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/09/04 13:45:37 1.4 @@ -6,18 +6,17 @@ package org.biomoby.client; -import java.util.Iterator; -import java.util.Map; -import java.util.Vector; - import org.biomoby.shared.CentralDigest; import org.biomoby.shared.MobyDataType; import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; import org.biomoby.shared.MobyServiceType; -import embl.ebi.utils.DGUtils; -// import java.net.*; +import org.tulsoft.tools.debug.DGUtils; + +import java.util.Iterator; +import java.util.Map; +import java.util.Vector; /** * A default implementation of {@link =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/08/26 06:27:04 1.24 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/04 13:45:37 1.25 @@ -23,7 +23,7 @@ import org.biomoby.shared.Utils; import org.biomoby.shared.MobyResourceRef; -import embl.ebi.soap.axis.AxisUtils; +import org.tulsoft.tools.soap.axis.AxisUtils; import org.w3c.dom.Document; import org.w3c.dom.Element; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/05/19 15:57:25 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/09/04 13:45:37 1.11 @@ -8,6 +8,31 @@ package org.biomoby.client; +import org.biomoby.shared.CentralAll; +import org.biomoby.shared.MobyDataType; +import org.biomoby.shared.MobyException; +import org.biomoby.shared.MobyNamespace; +import org.biomoby.shared.MobyPrimaryDataSimple; +import org.biomoby.shared.MobyService; +import org.biomoby.shared.MobyServiceType; +import org.biomoby.shared.Utils; + +import org.tulsoft.tools.servlets.Html; +import org.tulsoft.tools.servlets.HtmlConstants; +import org.tulsoft.tools.external.CatchOutputDefaultImpl; +import org.tulsoft.tools.external.Executor; +import org.tulsoft.tools.Printf; +import org.tulsoft.tools.Sorter; +import org.tulsoft.shared.GException; +import org.tulsoft.shared.StringUtils; +import org.tulsoft.shared.UUtils; + +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -23,32 +48,6 @@ import java.util.Properties; import java.util.Vector; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.biomoby.shared.CentralAll; -import org.biomoby.shared.MobyDataType; -import org.biomoby.shared.MobyException; -import org.biomoby.shared.MobyNamespace; -import org.biomoby.shared.MobyPrimaryDataSimple; -import org.biomoby.shared.MobyService; -import org.biomoby.shared.MobyServiceType; -import org.biomoby.shared.Utils; - -import embl.ebi.servlets.Html; -import embl.ebi.servlets.HtmlConstants; -import embl.ebi.tools.CatchOutputDefaultImpl; -import embl.ebi.tools.Executor; -import embl.ebi.tools.Printf; -import embl.ebi.tools.Sorter; -import embl.ebi.utils.GException; -import embl.ebi.utils.StringUtils; -import embl.ebi.utils.UUtils; - - /** * A servlet making graphs of Moby service instances, Moby data types, * and Moby service types.

@@ -1489,7 +1488,7 @@ // where is the 'dot' program String dotProg = "dot"; String dotPath = (String)initParams.get (DOT_PATH); - if (! UUtils.isEmpty (dotPath)) + if ( ! UUtils.isEmpty (dotPath) && ! "\"\"".equals (dotPath) ) dotProg = dotPath + System.getProperty ("file.separator") + dotProg; // depending on the cache implementation we may ask From senger at pub.open-bio.org Sun Sep 4 09:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 4 10:33:20 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjcvT028060@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv27838/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java RegistryPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard AbstractPanel.java,1.1,1.2 RegistryPanel.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/02 07:38:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/04 13:45:38 1.2 @@ -9,11 +9,14 @@ package org.biomoby.service.dashboard; import javax.swing.JLabel; +import javax.swing.JPanel; import javax.swing.text.html.HTMLDocument; import javax.swing.Icon; import javax.swing.JComponent; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeSupport; /** * WORK IN PROGRESS.

@@ -23,6 +26,7 @@ */ public abstract class AbstractPanel + extends JPanel implements DashboardPanel { /************************************************************************** @@ -39,20 +43,23 @@ return null; } - /************************************************************************** - * - **************************************************************************/ - public void addPropertyChangeListener (PropertyChangeListener listener) { + /********************************************************************* + * Property change stuff + ********************************************************************/ + protected PropertyChangeSupport support; + + public void addPropertyChangeListener (PropertyChangeListener l) { + if (support != null) + support.addPropertyChangeListener(l); } - /************************************************************************** - * - **************************************************************************/ - public void removePropertyChangeListener(PropertyChangeListener listener) { + public void removePropertyChangeListener (PropertyChangeListener l) { + if (support != null) + support.removePropertyChangeListener(l); } /************************************************************************** - * + * Here we get notified when a property chnage happen. **************************************************************************/ public void propertyChange (PropertyChangeEvent event) { } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/02 07:38:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/04 13:45:38 1.2 @@ -12,7 +12,9 @@ import javax.swing.text.html.HTMLDocument; import javax.swing.Icon; import javax.swing.JComponent; + import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeEvent; /** * @@ -26,6 +28,20 @@ public class RegistryPanel extends AbstractPanel { + /********************************************************************* + * propertyChange() + ********************************************************************/ + public void propertyChange (PropertyChangeEvent e) { + String prop = e.getPropertyName(); + String newVal = (String)e.getNewValue(); + if (newVal == null) return; // no interest in non-defined new values + if (prop == null) return; // no interest in non-specific changes +// else if (prop.equalsIgnoreCase (PROP_MODE)) setMode (checkAndGetOperMode (newVal)); +// else if (prop.equalsIgnoreCase (PROP_BEAN_VISIBLE)) setBeanVisible (BBConfig.getBoolFromString (newVal)); +// else if (prop.equalsIgnoreCase (PROP_LISTEN_TO)) setListenTo (newVal); +// else if (prop.equalsIgnoreCase (PROP_DATA_IDENTITY)) setDataIdentity (newVal); + } + /************************************************************************** * **************************************************************************/ From senger at pub.open-bio.org Sun Sep 4 09:45:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 4 10:50:50 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjbQf027878@pub.open-bio.org> senger Sun Sep 4 09:45:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/images In directory pub.open-bio.org:/tmp/cvs-serv27838/docs/images Modified Files: ant-snapshot.png Log Message: moby-live/Java/docs/images ant-snapshot.png,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/images/ant-snapshot.png,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 Binary files /home/repository/moby/moby-live/Java/docs/images/ant-snapshot.png 2005/08/26 06:27:02 1.2 and /home/repository/moby/moby-live/Java/docs/images/ant-snapshot.png 2005/09/04 13:45:36 1.3 differ rcsdiff: /home/repository/moby/moby-live/Java/docs/images/ant-snapshot.png: diff failed From senger at pub.open-bio.org Sun Sep 4 09:45:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 4 10:50:50 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjbNv027977@pub.open-bio.org> senger Sun Sep 4 09:45:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv27838/src/Clients/help Modified Files: BaseCmdLineClient_usage.txt CacheRegistryClient_usage.txt MobyCmdLineClient_usage.txt MobyDigest_usage.txt MobyGraphs_usage.txt MosesGenerators_usage.txt TestingMobyParser_usage.txt Added Files: argsfile.example Log Message: moby-live/Java/src/Clients/help argsfile.example,NONE,1.1 BaseCmdLineClient_usage.txt,1.1,1.2 CacheRegistryClient_usage.txt,1.2,1.3 MobyCmdLineClient_usage.txt,1.9,1.10 MobyDigest_usage.txt,1.2,1.3 MobyGraphs_usage.txt,1.6,1.7 MosesGenerators_usage.txt,1.1,1.2 TestingMobyParser_usage.txt,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/BaseCmdLineClient_usage.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/help/BaseCmdLineClient_usage.txt 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/help/BaseCmdLineClient_usage.txt 2005/09/04 13:45:37 1.2 @@ -52,3 +52,5 @@ -outxml ... show results as XML -o +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt 2005/08/26 06:27:03 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt 2005/09/04 13:45:37 1.3 @@ -38,3 +38,6 @@ other Moby registries stored in the same -cachedir directory) -q ... quiet mode + +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt 2005/08/07 06:31:03 1.9 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt 2005/09/04 13:45:37 1.10 @@ -210,3 +210,6 @@ format of : service-name[,service-authority] + +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/08/26 06:27:03 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/09/04 13:45:37 1.3 @@ -29,3 +29,6 @@ -details ... print the above with all details (by default only names are printed) + +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2005/08/26 06:27:03 1.6 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2005/09/04 13:45:37 1.7 @@ -120,3 +120,5 @@ workflow creation will produce many messages. By default it does not. +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MosesGenerators_usage.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/help/MosesGenerators_usage.txt 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MosesGenerators_usage.txt 2005/09/04 13:45:37 1.2 @@ -62,4 +62,5 @@ using an external program 'dot' (from Graphviz package). If this program is not on your PATH, specify here where it is. - +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/TestingMobyParser_usage.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/help/TestingMobyParser_usage.txt 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/help/TestingMobyParser_usage.txt 2005/09/04 13:45:37 1.2 @@ -25,3 +25,6 @@ (this is not usually needed at all - only when your data type definitions, the generated data types, are not up-to-date) + +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] From senger at pub.open-bio.org Sun Sep 4 09:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 4 10:50:52 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84Djcir028126@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv27838/src/webapps Added Files: standard.wsdd.template Log Message: moby-live/Java/src/webapps standard.wsdd.template,NONE,1.1 From fgibbons at pub.open-bio.org Tue Sep 6 16:23:40 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue Sep 6 17:06:36 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062023.j86KNe0m004114@pub.open-bio.org> fgibbons Tue Sep 6 16:23:40 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv4089/MOBY Modified Files: CrossReference.pm Log Message: - Cleaned up docs (removed redundant Title: attributes). - Enforced the fact that type() can take one of only two values: "xref" and "object" - Puzzled about why these methods return the old value of the parameter, when used to set a parameter. Seems like it'd make more sense to either return the new value (to indicate success), or better yet return the object, to allow chaining. moby-live/Perl/MOBY CrossReference.pm,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CrossReference.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/MOBY/CrossReference.pm 2004/12/14 20:47:04 1.6 +++ /home/repository/moby/moby-live/Perl/MOBY/CrossReference.pm 2005/09/06 20:23:40 1.7 @@ -11,31 +11,23 @@ =head1 SYNOPSIS -=cut - =head1 DESCRIPTION -this holds all of the relevant information for a MOBY -cross reference of either the Xref type, or the -Object type. Object cross-references have only -namespace and id attributes, while Xref cross-references -have namespace, id, authURI, serviceName, xref_type, -and evidence_code attributes. To determine which -type of cross-reference you have in-hand, call the -"type" method. +This holds all of the relevant information for a MOBY cross reference +of either the Xref type, or the Object type. Object cross-references +have only namespace and id attributes, while Xref cross-references +have namespace, id, authURI, serviceName, xref_type, and evidence_code +attributes. To determine which type of cross-reference you have +in-hand, call the "type" method. =head1 AUTHORS Mark Wilkinson (markw at illuminae dot com) -=cut - =head1 METHODS - =head2 new - Title : new Usage : my $XR = MOBY::Client::CrossReference->new(%args) Function : create SimpleArticle object Returns : MOBY::Client::CrossReference object @@ -49,82 +41,58 @@ Object => The XML of a base MOBY Object in this ns/id -=cut - =head2 type - Title : type Usage : $type = $XR->type($name) Function : get/set type attribute Returns : string; returns last value if new value set Arguments : (required)one of "xref" or "object", depending on the type of cross-ref you are making (new, or v0.5 API) -=cut - =head2 namespace - Title : namespace Usage : $ns = $XR->namespace($ns) Function : get/set namespace Returns : string; returns last value if new value set Arguments : (optional) string representing namespace to set -=cut - =head2 id - Title : id Usage : $id = $XR->id($id) Function : get/set id for the cross-reference Returns : string; returns last value if new value set Arguments : (optional) the id of the cross-reference -=cut - =head2 authURI - Title : authURI Usage : $auth = $XR->authURI($auth) Function : get/set id for the authority for the xref Returns : string; returns last value if new value set Arguments : (optional) the new authority of the xref type reference -=cut - =head2 serviceName - Title : serviceName Usage : $name = $XR->serviceName($name) Function : get/set serviceName for the cross-reference Returns : string; returns last value if new value set Arguments : (optional) the new serviceName of the cross-reference -=cut - =head2 evidence_code - Title : evidence_code Usage : $code = $XR->evidence_code($code) Function : get/set evidence_code for the cross-reference Returns : string; returns last value if new value set Arguments : (optional) the evidence_code of the cross-reference -=cut - =head2 xref_type - Title : xref_type Usage : $xreftype = $XR->xref_type($xreftype) Function : get/set xref_type for the cross-reference Returns : string; returns last value if new value set Arguments : (optional) the xref_type of the cross-reference -=cut - =head2 Object - Title : Object Usage : $XML = $XR->Object() Function : retrieve a base MOBY Object XML (e.g. to send to a service) Returns : XML or empty string if there is no namespace or id value @@ -133,98 +101,102 @@ { - sub type { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_type}; - $self->{_type} = $type; - return $old; - } - return $self->{_type}; - } - - sub namespace { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_namespace}; - $self->{_namespace} = $type; - return $old; - } - return $self->{_namespace}; - } - - sub id { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_id}; - $self->{_id} = $type; - return $old; - } - return $self->{_id}; - } - - sub authURI { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_authURI}; - $self->{_authURI} = $type; - return $old; - } - return $self->{_authURI}; - } - - sub serviceName { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_serviceName}; - $self->{_serviceName} = $type; - return $old; - } - return $self->{_serviceName}; - } - - sub evidence_code { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_evidenceCode}; - $self->{_evidenceCode} = $type; - return $old; - } - return $self->{_evidenceCode}; - } - - sub xref_type { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_xref_type}; - $self->{_xref_type} = $type; - return $old; - } - return $self->{_xref_type}; - } +# Why do these methods return the PREVIOUS value of their respective variables? +# How would that be useful? +# Seems more intuitive to return new value, or perhaps even the object itself. + sub type { + # only two types are permitted. + my ( $self, $type ) = @_; + if ($type && ($type =~ /^(xref|object)$/)) { + my $old = $self->{_type}; + $self->{_type} = $type; + return $old; + } + return $self->{_type}; + } + + sub namespace { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_namespace}; + $self->{_namespace} = $type; + return $old; + } + return $self->{_namespace}; + } + + sub id { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_id}; + $self->{_id} = $type; + return $old; + } + return $self->{_id}; + } + + sub authURI { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_authURI}; + $self->{_authURI} = $type; + return $old; + } + return $self->{_authURI}; + } + + sub serviceName { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_serviceName}; + $self->{_serviceName} = $type; + return $old; + } + return $self->{_serviceName}; + } + + sub evidence_code { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_evidenceCode}; + $self->{_evidenceCode} = $type; + return $old; + } + return $self->{_evidenceCode}; + } + + sub xref_type { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_xref_type}; + $self->{_xref_type} = $type; + return $old; + } + return $self->{_xref_type}; + } } sub new { - my ( $caller, %args ) = @_; - my $caller_is_obj = ref($caller); - return $caller if $caller_is_obj; - my $class = $caller_is_obj || $caller; - my $proxy; - my $self = bless {}, $class; - while ( my ( $key, $value ) = each %args ) { - $self->$key($value); - } - return undef unless ( $self->type && $self->namespace && $self->id ); - return $self; + my ( $caller, %args ) = @_; + my $caller_is_obj = ref($caller); + return $caller if $caller_is_obj; + my $class = $caller_is_obj || $caller; + my $proxy; + my $self = bless {}, $class; + while ( my ( $key, $value ) = each %args ) { + $self->$key($value); + } + return undef unless ( $self->type && $self->namespace && $self->id ); + return $self; } sub Object { - my ($self) = @_; - return "" unless ( $self->namespace && $self->id ); - return ""; + my ($self) = @_; + return "" unless ( $self->namespace && $self->id ); + return ""; } sub DESTROY { } 1; From fgibbons at pub.open-bio.org Tue Sep 6 16:24:19 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue Sep 6 17:06:50 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062024.j86KOJfc004155@pub.open-bio.org> fgibbons Tue Sep 6 16:24:19 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4134/t Added Files: CrossReference.t Log Message: - Test MOBY/CrossReference.pm module. moby-live/Perl/t CrossReference.t,NONE,1.1 From fgibbons at pub.open-bio.org Tue Sep 6 16:28:34 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue Sep 6 17:10:54 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062028.j86KSYrh004200@pub.open-bio.org> fgibbons Tue Sep 6 16:28:34 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv4175/MOBY/Client Modified Files: SecondaryArticle.pm Log Message: - Clean up code, replace duplicate blocks of code (default/datatype/max/min) with single generic. moby-live/Perl/MOBY/Client SecondaryArticle.pm,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/SecondaryArticle.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/MOBY/Client/SecondaryArticle.pm 2004/12/14 22:31:30 1.6 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/SecondaryArticle.pm 2005/09/06 20:28:34 1.7 @@ -22,14 +22,11 @@ Mark Wilkinson (markw at illuminae dot com) -=cut - =head1 METHODS =head2 new - Title : new Usage : my $SA = MOBY::Client::SecondaryArticle->new(%args) Function : create SecondaryArticle object Returns : MOBY::Client::SecondaryArticle object @@ -42,90 +39,57 @@ XML_DOM => $XML_DOM node of the Secondary article (optional) XML => $XML XML string representing the Secondary article (optional) -=cut - =head2 articleName - Title : articleName Usage : $name = $SA->articleName($name) Function : get/set articleName Returns : string Arguments : (optional) string representing articleName to set -=cut - =head2 objectType - Title : objectType Usage : $type = $SA->objectType($type) Function : get/set name Returns : string Arguments : (optional) string representing objectType to set -=cut - =head2 namespaces - Title : namespaces Usage : $namespaces = $SA->namespaces(\@namespaces) Function : get/set namespaces for the objectType Returns : arrayref of namespace strings Arguments : (optional) arrayref of namespace strings to set -=cut - =head2 XML - Title : XML Usage : $SA = $SA->XML($XML) Function : set/reset all parameters for this object from the XML Returns : MOBY::Client::SecondaryArticle Arguments : (optional) XML fragment from and including ... -=cut - =head2 XML_DOM - Title : XML_DOM Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) Function : set/reset all parameters for this object from the XML::DOM node for Returns : MOBY::Client::SecondaryArticle Arguments : (optional) an $XML::DOM node from the article of a DOM -=cut - =head2 isSecondary - Title : isSecondary Usage : $boolean = $IN->isSecondary() - Function : is this a SecondaryArticle type? - (yes, I know this is obvious) + Function : is this a SecondaryArticle type? (yes, I know this is obvious) Returns : 1 (true) -=cut - =head2 isSimple - Title : isSimple Usage : $boolean = $IN->isSimple() Function : is this a SimpleArticle type - (yes, I know this is obvious, but since you can - get both Simple and Collection objects in your - Input and output lists, it is good to be able - to test what you have in-hand) Returns : 0 (false) -=cut - =head2 isCollection - Title : isCollection Usage : $boolean = $IN->isCollection() Function : is this a CollectionArticle type - (yes, I know this is obvious, but since you can - get both Simple and Collection objects in your - Input and output lists, it is good to be able - to test what you have in-hand) Returns : 0 for false =cut @@ -136,11 +100,11 @@ # DATA #___________________________________________________________ #ATTRIBUTES - my %_attr_data = # DEFAULT ACCESSIBILITY + my %_attr_data = # DEFAULT ACCESSIBILITY ( - articleName => [ undef, 'read/write' ], - objectType => [ undef, 'read/write' ], - namespaces => [ [], 'read/write' ], + articleName => [ undef, 'read/write' ], + objectType => [ undef, 'read/write' ], + namespaces => [ [], 'read/write' ], XML_DOM => [ undef, 'read/write' ], XML => [ undef, 'read/write' ], isSecondary => [ 1, 'read' ], @@ -174,39 +138,39 @@ } sub addEnum { - my ( $self, $enum ) = @_; - $self->{enum} = [] unless $self->{enum}; - return $self->{enum} unless defined( $enum ); - push @{ $self->{enum} }, $enum; - return $self->{enum}; + # No return value necessary + my ( $self, $enum ) = @_; + $self->{enum} = [] unless $self->{enum}; + return() unless defined ($enum); + push @{ $self->{enum} }, $enum; } } sub new { - my ( $caller, %args ) = @_; - my $caller_is_obj = ref( $caller ); - return $caller if $caller_is_obj; - my $class = $caller_is_obj || $caller; - my $proxy; - my $self = bless {}, $class; - foreach my $attrname ( $self->_standard_keys ) { - if ( exists $args{$attrname} ) { - $self->{$attrname} = $args{$attrname}; - } elsif ( $caller_is_obj ) { - $self->{$attrname} = $caller->{$attrname}; - } else { - $self->{$attrname} = $self->_default_for( $attrname ); - } - } - $self->{enum} = [] unless $self->enum; - if ( $self->XML && ref( $self->XML ) ) { - return 0; - } elsif ( $self->XML_DOM && !( ref( $self->XML_DOM ) =~ /libxml/i ) ) { - return 0; - } - $self->createFromXML if ( $self->XML ); - $self->createFromDOM( $self->XML_DOM ) if ( $self->XML_DOM ); - return $self; + my ( $caller, %args ) = @_; + my $caller_is_obj = ref( $caller ); + return $caller if $caller_is_obj; + my $class = $caller_is_obj || $caller; + my $proxy; + my $self = bless {}, $class; + foreach my $attrname ( $self->_standard_keys ) { + if ( exists $args{$attrname} ) { + $self->{$attrname} = $args{$attrname}; + } elsif ( $caller_is_obj ) { + $self->{$attrname} = $caller->{$attrname}; + } else { + $self->{$attrname} = $self->_default_for( $attrname ); + } + } + $self->{enum} = [] unless $self->enum; + if ( $self->XML && ref( $self->XML ) ) { + return 0; + } elsif ( $self->XML_DOM && !( ref( $self->XML_DOM ) =~ /libxml/i ) ) { + return 0; + } + $self->createFromXML if ( $self->XML ); + $self->createFromDOM( $self->XML_DOM ) if ( $self->XML_DOM ); + return $self; } sub createFromXML { @@ -226,91 +190,66 @@ $self->articleName( "" ); $self->objectType( "" ); my $attr = $dom->getAttributeNode( 'articleName' ); - my $articleName = ""; - $articleName = $attr->getValue if $attr; - $self->articleName( $articleName ); - + $self->articleName( $attr ? $attr->getValue : "" ); if ( @{ $dom->getElementsByTagName( 'Value' ) }[0] ) { - return $self->_createInstantiatedArticle( $dom ); + return $self->_createInstantiatedArticle( $dom ); } else { - return $self->_createTemplateArticle( $dom ); + return $self->_createTemplateArticle( $dom ); } } sub _createTemplateArticle { - my ( $self, $dom ) = @_; + my ( $self, $dom ) = @_; - #datatype => [undef, 'read/write' ], - #default => [undef, 'read/write' ], - #max => [undef, 'read/write' ], - #min => [undef, 'read/write' ], - #enum => [[], 'read/write' ], - my $objects = $dom->getElementsByTagName( "datatype" ); - if ( $objects->get_node( 1 ) ) { - my $data; - foreach my $child ( $objects->get_node( 1 )->childNodes ) { - next unless $child->nodeType == TEXT_NODE; - $data .= $child->toString; - $data =~ s/\s//g; - } - $self->datatype( $data ); - } - $objects = $dom->getElementsByTagName( "default" ); - if ( $objects->get_node( 1 ) ) { - my $def; - foreach my $child ( $objects->get_node( 1 )->childNodes ) { - next unless $child->nodeType == TEXT_NODE; - $def .= $child->toString; - $def =~ s/\s//g; - } - $self->default( $def ); - } - $objects = $dom->getElementsByTagName( "max" ); - if ( $objects->get_node( 1 ) ) { - my $max; - foreach my $child ( $objects->get_node( 1 )->childNodes ) { - next unless $child->nodeType == TEXT_NODE; - $max .= $child->toString; - $max =~ s/\s//g; - } - $self->max( $max ); - } - $objects = $dom->getElementsByTagName( "min" ); - if ( $objects->get_node( 1 ) ) { - my $min; - foreach my $child ( $objects->get_node( 1 )->childNodes ) { - next unless $child->nodeType == TEXT_NODE; - $min .= $child->toString; - $min =~ s/\s//g; - } - $self->min( $min ); - } - $objects = $dom->getElementsByTagName( "enum" ); - if ( $objects->get_node( 1 ) ) { - foreach ( 1 .. $objects->size() ) { - foreach my $child ( $objects->get_node( $_ )->childNodes ) { - my $val; - next unless $child->nodeType == TEXT_NODE; - $val = $child->toString; - next unless defined( $val ); - $val =~ s/^\s//; - $val =~ s/\s$//; - $self->addEnum( $val ); - } - } - } - return $self; + #datatype => [undef, 'read/write' ], + #default => [undef, 'read/write' ], + #max => [undef, 'read/write' ], + #min => [undef, 'read/write' ], + #enum => [[], 'read/write' ], + my @single_valued = qw/datatype default max min/; + my $objects; + foreach my $param (@single_valued) { + $objects = $dom->getElementsByTagName( $param ); + if ( $objects->get_node( 1 ) ) { + my $data; + foreach my $child ( $objects->get_node( 1 )->childNodes ) { + next unless $child->nodeType == TEXT_NODE; + $data .= $child->toString; + $data =~ s/\s//g; # Trim all whitespace + } + $self->$param( $data ); + } + } + # Since it is (array)multi-valued, 'enum' is a little different from the others. + $objects = $dom->getElementsByTagName( "enum" ); + if ( $objects->get_node( 1 ) ) { + foreach ( 1 .. $objects->size() ) { + foreach my $child ( $objects->get_node( $_ )->childNodes ) { + my $val; + next unless $child->nodeType == TEXT_NODE; + $val = $child->toString; + next unless defined( $val ); + # Trim space from front and back, but leave alone in middle....? + $val =~ s/^\s//; + $val =~ s/\s$//; + $self->addEnum( $val ); + } + } + } + return $self; } sub _createInstantiatedArticle { - my ( $self, $dom ) = @_; + my ( $self, $dom ) = @_; - #43764 - my $values = $dom->getElementsByTagName( 'Value' ); - foreach my $child ( $values->get_node( 1 )->childNodes ) { - next unless $child->nodeType == TEXT_NODE; - $self->value( $self->value . $child->toString ); - } + #43764 + my $values = $dom->getElementsByTagName( 'Value' ); + $self->value( "" ); # Initialize to 1) avoid Perl warnings 2) be good. + foreach my $child ( $values->get_node( 1 )->childNodes ) { + next unless $child->nodeType == TEXT_NODE; + # Would we *really* want to catenate values like this? + $self->value( $self->value . $child->toString ); + } } sub AUTOLOAD { From fgibbons at pub.open-bio.org Tue Sep 6 16:30:08 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue Sep 6 17:12:15 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062030.j86KU80e004246@pub.open-bio.org> fgibbons Tue Sep 6 16:30:08 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4225/t Added Files: Client-SecondaryArticle.t Log Message: - Test MOBY::Client::SecondaryArticle (i.e., ). moby-live/Perl/t Client-SecondaryArticle.t,NONE,1.1 From fgibbons at pub.open-bio.org Tue Sep 6 16:31:06 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue Sep 6 17:13:14 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062031.j86KV6ZL004279@pub.open-bio.org> fgibbons Tue Sep 6 16:31:06 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4254/t Modified Files: Client-CollectionArticle.t Log Message: - More tests for CollectionArticle. moby-live/Perl/t Client-CollectionArticle.t,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-CollectionArticle.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/t/Client-CollectionArticle.t 2005/08/31 14:17:11 1.1 +++ /home/repository/moby/moby-live/Perl/t/Client-CollectionArticle.t 2005/09/06 20:31:06 1.2 @@ -25,12 +25,7 @@ }; -TODO: { - local $TODO = "Everything."; -} - -my @autoload = qw/articleName Simples isSimple isCollection isSecondary -XML XML_DOM/; +my @autoload = qw/articleName Simples isSimple isCollection isSecondary XML XML_DOM/; my @API = (@autoload, qw/new createFromXML createFromDOM addSimple/); my $coll = MOBY::Client::CollectionArticle->new(); @@ -42,3 +37,64 @@ is($coll->isSecondary, 0) or diag("CollectionArticle cannot be Secondary"); is($coll->isCollection, 1) or diag("CollectionArticle must return isCollection=1"); +my $aName = 'my Article'; +# Check XML-generation code. +# In reality, (XML, createFromXML) and (XML_DOM, createFromDOM) should behave the same. +# Let's not assume that though. + +my ($artName, $ns, $id, $obj, $lsid) + = ('my Simple Article', 'SGD', 'S0005111', 'Object', 'urn:foo:bar:my_lsid'); +my ($collArtName) = "my Collection"; +my $xml_coll = < + + + + + + + +XML + +$coll = MOBY::Client::CollectionArticle->new( XML => $xml_coll); + +is($coll->articleName(), $collArtName) + or diag("CollectionArticle not correctly built from XML (articleName wrong)"); + +is(scalar @{$coll->Simples()}, 2) + or diag("CollectionArticle didn't return correct number of Simples"); + +TODO: { + local $TODO = "We should ideally check the contents of the Simples that are returned...."; +} + +sub XML_maker { # Turn XML text into DOM. + my $XML = shift; + my $parser = XML::LibXML->new(); + my $doc; + eval { $doc = $parser->parse_string( $XML ); }; + return '' if ( $EVAL_ERROR ); #("Couldn't parse '$XML' because:\n\t$EVAL_ERROR") + return $doc->getDocumentElement(); +} + + +$coll = MOBY::Client::CollectionArticle->new( XML_DOM => XML_maker($xml_coll)); + +is($coll->articleName(), $collArtName) + or diag("CollectionArticle not correctly built from XML_DOM (articleName wrong)"); + + + +TODO: { + local $TODO = <new()->XML(\$xml), +I expect that the XML will be *parsed*, to modify the object, +not that the attribute 'XML' will be set, and the rest left unchanged." +TODO + + $coll = MOBY::Client::CollectionArticle->new(); + $coll->XML($xml_coll); + is($coll->articleName, $collArtName) + or diag("Couldn't create CollectionArticle from autoloaded method XML(): articleName wrong"); + +} From fgibbons at pub.open-bio.org Tue Sep 6 16:43:22 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue Sep 6 17:26:54 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062043.j86KhM6u004331@pub.open-bio.org> fgibbons Tue Sep 6 16:43:22 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4306/t Modified Files: Client-OntologyServer.t Log Message: - Augment a little, and move tests on relationshipExists() to TODO, since it doesn't appear to work. moby-live/Perl/t Client-OntologyServer.t,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/01 16:09:39 1.2 +++ /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/06 20:43:21 1.3 @@ -43,32 +43,40 @@ # and check them all here? Ditto for Objects, Service-types # my ($success, $msg, $existingURI); -my @check_ns = qw/SGD NCBI_gi/; +my @check_ns = qw/SGD NCBI_gi GO FB PMID/; # These seem pretty solid foreach (@check_ns) { ($success, $msg, $existingURI) = $os->namespaceExists( term => $_); is($success, 1) or diag("Namespace '$_' reported erroneously as non-existent."); } -my @check_obj = qw/ Object String Integer Float/; +# Could get these allowed datatypes from MOBY::Config, +# except that module only works when you've got a local registry set up. +my @check_obj = qw/ Object String Integer Float DateTime/; # At least we can be confident that primitive types will always be valid foreach (@check_obj) { ($success, $msg, $existingURI) = $os->objectExists(term => $_); is($success, 1) or diag("Object '$_' reported erroneously as non-existent."); } -my @check_servicetype = qw/Retrieval/; +my @check_servicetype = qw/Alignment Analysis Conversion Edit +NCBI_Blast Parsing SetIntersection SetOperation SetUnion +Retrieval Registration Resolution +StructuralPrediction/; # Service types don't change much, but who knows.... foreach (@check_servicetype) { ($success, $msg, $existingURI) = $os->serviceExists(term => $_); is($success, 1) or diag("Service type '$_' reported erroneously as non-existent."); } -my @check_rel = qw/ISA HASA HAS/; -foreach (@check_rel) { - ($success, $msg, $existingURI) = $os->relationshipExists(term => $_); - is($success, 1) - or diag("Relationship '$_' reported erroneously as non-existent."); +TODO: { + local $TODO = "Fix whatever is broken with these relationship types - or else fix this test."; + my @check_rel = qw/ISA HASA HAS/; # There should only be very few valid relationship types. + foreach (@check_rel) { + ($success, $msg, $existingURI) = $os->relationshipExists(term => $_); + is($success, 1) + or diag("Relationship '$_' reported erroneously as non-existent."); + } } From fgibbons at pub.open-bio.org Tue Sep 6 16:46:18 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue Sep 6 17:28:28 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062046.j86KkIfc004374@pub.open-bio.org> fgibbons Tue Sep 6 16:46:18 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4353/t Added Files: lsid-authority-ClassResolver.t lsid-authority-Error.t lsid-authority-NamespaceResolver.t lsid-authority-PredicateResolver.t lsid-authority-RDFConfigure.t lsid-authority-RelationshipResolver.t lsid-authority-ServiceInstanceResolver.t lsid-authority-ServiceResolver.t lsid-authority-dbConnect.t Log Message: - Add tests for LSID components. moby-live/Perl/t lsid-authority-ClassResolver.t,NONE,1.1 lsid-authority-Error.t,NONE,1.1 lsid-authority-NamespaceResolver.t,NONE,1.1 lsid-authority-PredicateResolver.t,NONE,1.1 lsid-authority-RDFConfigure.t,NONE,1.1 lsid-authority-RelationshipResolver.t,NONE,1.1 lsid-authority-ServiceInstanceResolver.t,NONE,1.1 lsid-authority-ServiceResolver.t,NONE,1.1 lsid-authority-dbConnect.t,NONE,1.1 From fgibbons at pub.open-bio.org Tue Sep 6 16:47:04 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue Sep 6 17:29:12 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062047.j86Kl4xc004418@pub.open-bio.org> fgibbons Tue Sep 6 16:47:04 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4393/t Added Files: Central.t Config.t dbConnect.t Log Message: - Add tests for various components. moby-live/Perl/t Central.t,1.2,1.3 Config.t,NONE,1.1 dbConnect.t,NONE,1.1 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Central.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/t/Central.t 2003/11/12 17:05:48 1.2 +++ /home/repository/moby/moby-live/Perl/t/Central.t 2005/09/06 20:47:04 1.3 @@ -1,15 +1,76 @@ # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl 1.t' +# !!!!STOP!!!! +# This test file is for the MOBY::Central module. +# As a regular Perl user, you probably intend to use MOBY::Client::Central, +# which is discouragingly similarly named, and has many similarly named methods, +# but quite different functionality. +# This code runs on the server side, responding to incoming requests, +# and constructing XML messages that communicate the results of those requests. + +# Note added by Frank Gibbons. +# Tests should, as far as possible, avoid the use of literals. +# If you register a service with authURI => mysite.com, +# and you want to test a retrieved description of the service, don't test that the service returns authURI eq "mysite.com", +# test so that it returns the same value as you used to register it in the first place. + ######################### # change 'tests => 1' to 'tests => last_test_to_print'; - -use Test::More tests => 1; +#use SOAP::Lite +trace; +use Test::More 'no_plan'; +use strict; +use Data::Dumper; +#Is the client-code even installed? BEGIN { use_ok('MOBY::Central') }; + +END {}; -######################### +############ ENFORCE REGISTRY API ############### -# Insert your test code below, the Test::More module is use()ed here so read -# its man page ( perldoc Test::More ) for help writing this test script. +# First, mandatory methods for all registries. +# Notice: new() is NOT defined here, since it is deprecated. +my @API = qw/Registration +registerObjectClass _registerObjectPayload +deregisterObjectClass _deregisterObjectPayload +_testObjectTypeAgainstPrimitives +registerServiceType _registerServiceTypePayload +deregisterServiceType _deregisterServiceTypePayload +retrieveNamespaces _registerNamespacePayload +deregisterNamespace _deregisterNamespacePayload +registerService _registerServicePayload +_getServiceInstanceRDF _registerArticles +deregisterService _deregisterServicePayload +findService _findServicePayload +_extractObjectTypes registerServiceWSDL +_extract_ids +_searchForServicesWithArticle _searchForSimple _searchForCollection +_extractObjectTypesAndNamespaces +retrieveService _retrieveServicePayload +retrieveResourceURLs retrieveServiceProviders retrieveServiceNames +retrieveServiceTypes retrieveRelationshipTypes retrieveObjectNames +retrieveObjectDefinition retrieveNamespaces +retrieveObject _retrieveObjectPayload +Relationships DUMP_MySQL _ISAPayload/; + +can_ok("MOBY::Central", @API) + or diag("MOBY::Central failed to implement full API"); + +################## MOBY Registration Tests ################# + +################## OBJECT REGISTRATION ############# +# Test 3 inherits from two isas - should fail +my %Obj = ( objectType => "Rubbish", + description => "a human-readable description of the object", + contactEmail => 'your@email.address', + authURI => "test.suite.com", + Relationships => { + ISA => [ + ['Object', 'article1'], + ['Object', 'articleName2']], + HASA => [ + ['Object', 'articleName3']] + } + ); From kawas at pub.open-bio.org Tue Sep 6 17:29:10 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue Sep 6 18:11:48 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062129.j86LTAip004582@pub.open-bio.org> kawas Tue Sep 6 17:29:10 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema In directory pub.open-bio.org:/tmp/cvs-serv4557/org/biomoby/shared/schema Modified Files: RdfParser.java Log Message: Removed some imports statements that werent used. Added a check that basically checks if a certain property exists for a datatype and if not then null is returned. moby-live/Java/src/main/org/biomoby/shared/schema RdfParser.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/RdfParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/RdfParser.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/RdfParser.java 2005/09/06 21:29:10 1.2 @@ -1,269 +1,269 @@ -/* - * Created on Jun 17, 2005 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.biomoby.shared.schema; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.StringReader; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.LinkedList; - -import org.biomoby.client.rdf.vocabulary.Predicates; -import org.biomoby.client.ui.graphical.servlet.jresources.RESOURCE; -import org.biomoby.shared.MobyException; - -import com.hp.hpl.jena.graph.Node; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; -import com.hp.hpl.jena.rdf.model.NodeIterator; -import com.hp.hpl.jena.rdf.model.Property; -import com.hp.hpl.jena.rdf.model.RDFNode; -import com.hp.hpl.jena.rdf.model.RDFReader; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.rdf.model.Statement; -import com.hp.hpl.jena.rdf.model.StmtIterator; -import com.hp.hpl.jena.vocabulary.RDF; -import com.hp.hpl.jena.vocabulary.RDFS; - -/** - * @author Eddie - * - * TODO To change the template for this generated type comment go to Window - - * Preferences - Java - Code Style - Code Templates - */ -public class RdfParser { - - public static String OBJECT_URI = "http://biomoby.org/RESOURCES/MOBY-S/Objects#"; - - public static MElement buildMElement(String name) { - String rdf = null; - try { - rdf = getObjectRdf(); - } catch (MobyException e) { - e.printStackTrace(); - } - // return null if i cant build the element - if (rdf == null) - return null; - - // create the model - Model model = ModelFactory.createDefaultModel(); // the RESOURCE model - RDFReader reader = model.getReader(); - reader.read(model, new StringReader(rdf), null); - - // start querying model for what we need and create the MElement - String rootDescription = getDescription(model, name); - MElement root = new MElement(name, "", rootDescription); - String rootsParent = getParentDataType(model, name); - if (rootsParent == null) - rootsParent = ""; - if (MElement.isPrimitive(rootsParent)) { - root.setType(rootsParent); - } else { - root.setType(null); - } - // go through the isa relationships and extract the has/hasa - processRelationships(root, model, name); - - return root; - } - - /** - * @param root - * @param model - * @param name - */ - private static void processRelationships(MElement root, Model model, String name) { - if (name.indexOf("#") > 0) { - name = name.substring(name.indexOf("#")+1); - } - Resource resource = model.getResource(OBJECT_URI + name); - if (resource.hasProperty(RDFS.subClassOf)) { - String parent = resource.getProperty(RDFS.subClassOf) - .getObject().asNode().getURI(); - processRelationships(root, model, parent); - } - // process the has children - processChildrenTypes(root, model, Predicates.has, name); - // process the hasa children - processChildrenTypes(root, model, Predicates.hasa, name); - } - - /** - * @param root - * @param model - * @param has - * @param name - */ - private static void processChildrenTypes(MElement root, Model model, - Property property, String name) { - Resource resource = model.getResource(OBJECT_URI + name); - StmtIterator iterator = resource.listProperties(property); - if (iterator != null) - while (iterator.hasNext()) { - Statement next = (Statement) iterator.next(); - RDFNode object = next.getObject(); - if (object instanceof Resource) { - Resource child = (Resource) object; - String qualifiedName = null; - String childName = ""; - String childArticleName = ""; - String childDescription = ""; - if (child.hasProperty(RDF.type)) { - qualifiedName = child.getProperty(RDF.type).getObject() - .toString(); - childName = stripOutURI(child.getProperty(RDF.type) - .getObject().toString()); - } - if (child.hasProperty(Predicates.articleName)) { - childArticleName = stripOutLiteral(child.getProperty( - Predicates.articleName).getObject().toString()); - } - childDescription = stripOutLiteral(model.getResource( - qualifiedName).getProperty(RDFS.comment) - .getObject().toString()); - - MElement element = new MElement(childName, - childArticleName, childDescription); - String rootsParent = getParentDataType(model, childName); - if (MElement.isPrimitive(rootsParent)) { - element.setType(rootsParent); - } else { - element.setType(null); - } - processChildrenTypes(element, model, Predicates.has, - childName); - processChildrenTypes(element, model, Predicates.hasa, - childName); - if (property.getLocalName().equalsIgnoreCase("hasa")) { - root.addHasaMElement(element); - } else { - root.addHasMElement(element); - } - } - } - } - - /** - * @param model - * @param name - * @return - */ - private static String getParentDataType(Model model, String name) { - - // the statement should return null iff the object is the Moby root - // object - if (name.equals("Object")) - return null; - LinkedList list = new LinkedList(); - list.addFirst(name); - name = OBJECT_URI + name; - String parent = ""; - String previousParent = ""; - Resource resource = model.getResource(name); - Statement statement = resource.getProperty(RDFS.subClassOf); - do { - parent = statement.getObject().toString(); - if (!((String) list.getFirst()).equals(parent)) { - list.addFirst(parent); - } - resource = model.getResource(parent); - statement = resource.getProperty(RDFS.subClassOf); - - } while (statement != null); - // check to see if we have a primitive - parent = (String) list.removeFirst(); - if (list.size() > 0) { - previousParent = (String) list.removeFirst(); - previousParent = stripOutURI(previousParent); - if (MElement.isPrimitive(previousParent)) { - return previousParent; - } - } - // no primitive parent, so every object inherits from object - parent = stripOutURI(parent); - return parent; - } - - /** - * @param model - * @param name - * @return - */ - private static String getDescription(Model model, String name) { - Resource resource = model.getResource(OBJECT_URI + name); - Statement comment = resource.getProperty(RDFS.comment); - String description = comment.getObject().toString(); - description = stripOutLiteral(description); - return description; - } - - private static String getObjectRdf() throws MobyException { - String s = null; - StringBuffer sb = new StringBuffer(); - URL url = null; - try { - url = new URL(OBJECT_URI); - } catch (MalformedURLException e1) { - e1.printStackTrace(); - return null; - } - try { - BufferedReader in = null; - in = new BufferedReader(new InputStreamReader(url.openStream())); - while ((s = in.readLine()) != null) { - sb.append(s); - } - - } catch (IOException e) { - e.printStackTrace(); - return null; - } - return sb.toString(); - } - - private static String stripOutURI(String object) { - if (object.indexOf("#") > 0) - object = object.substring(object.indexOf("#") + 1); - return object; - } - - private static String stripOutLiteral(String object) { - if (object.indexOf("~") > 0) - object = object.substring(0, object.indexOf("~")); - return object; - } - - public static void main(String[] args) { - System.out.println("Is it me?"); - System.out.println("\nOutput Imag Object\n"); - System.out.println(RdfParser.buildMElement("DNASequence")); -/* System.out.println("###########################################"); - System.out.println("Outputting a String object"); - System.out.println(RdfParser.buildMElement("String")); - - System.out.println("###########################################"); - System.out.println("Outputting the base object"); - System.out.println(RdfParser.buildMElement("Object")); - - System.out.println("###########################################"); - System.out.println("Outputting a DNA sequence object"); - System.out.println(RdfParser.buildMElement("DNASequence")); - - System.out.println("###########################################"); - System.out.println("Outputting a GFF object"); - System.out.println(RdfParser.buildMElement("GFF")); - - System.out.println("###########################################"); - System.out.println("Outputting a BasicGFFSequenceFeature object"); - System.out.println(RdfParser.buildMElement("BasicGFFSequenceFeature")); -*/ - } -} +/* + * Created on Jun 17, 2005 + * + * TODO To change the template for this generated file go to + * Window - Preferences - Java - Code Style - Code Templates + */ +package org.biomoby.shared.schema; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.LinkedList; + +import org.biomoby.client.rdf.vocabulary.Predicates; +import org.biomoby.shared.MobyException; + +import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.ModelFactory; +import com.hp.hpl.jena.rdf.model.Property; +import com.hp.hpl.jena.rdf.model.RDFNode; +import com.hp.hpl.jena.rdf.model.RDFReader; +import com.hp.hpl.jena.rdf.model.Resource; +import com.hp.hpl.jena.rdf.model.Statement; +import com.hp.hpl.jena.rdf.model.StmtIterator; +import com.hp.hpl.jena.vocabulary.RDF; +import com.hp.hpl.jena.vocabulary.RDFS; + +/** + * @author Eddie + * + * TODO To change the template for this generated type comment go to Window - + * Preferences - Java - Code Style - Code Templates + */ +public class RdfParser { + + public static String OBJECT_URI = "http://biomoby.org/RESOURCES/MOBY-S/Objects#"; + + public static MElement buildMElement(String name) { + String rdf = null; + try { + rdf = getObjectRdf(); + } catch (MobyException e) { + e.printStackTrace(); + } + // return null if i cant build the element + if (rdf == null) + return null; + + // create the model + Model model = ModelFactory.createDefaultModel(); // the RESOURCE model + RDFReader reader = model.getReader(); + reader.read(model, new StringReader(rdf), null); + + // check if a certain property exists to ensure that you a valid object + if (model.getResource(OBJECT_URI + name).getProperty(RDFS.comment) == null) { + return null; + } + // start querying model for what we need and create the MElement + String rootDescription = getDescription(model, name); + MElement root = new MElement(name, "", rootDescription); + String rootsParent = getParentDataType(model, name); + if (rootsParent == null) + rootsParent = ""; + if (MElement.isPrimitive(rootsParent)) { + root.setType(rootsParent); + } else { + root.setType(null); + } + // go through the isa relationships and extract the has/hasa + processRelationships(root, model, name); + + return root; + } + + /** + * @param root + * @param model + * @param name + */ + private static void processRelationships(MElement root, Model model, String name) { + if (name.indexOf("#") > 0) { + name = name.substring(name.indexOf("#")+1); + } + Resource resource = model.getResource(OBJECT_URI + name); + if (resource.hasProperty(RDFS.subClassOf)) { + String parent = resource.getProperty(RDFS.subClassOf) + .getObject().asNode().getURI(); + processRelationships(root, model, parent); + } + // process the has children + processChildrenTypes(root, model, Predicates.has, name); + // process the hasa children + processChildrenTypes(root, model, Predicates.hasa, name); + } + + /** + * @param root + * @param model + * @param has + * @param name + */ + private static void processChildrenTypes(MElement root, Model model, + Property property, String name) { + Resource resource = model.getResource(OBJECT_URI + name); + StmtIterator iterator = resource.listProperties(property); + if (iterator != null) + while (iterator.hasNext()) { + Statement next = (Statement) iterator.next(); + RDFNode object = next.getObject(); + if (object instanceof Resource) { + Resource child = (Resource) object; + String qualifiedName = null; + String childName = ""; + String childArticleName = ""; + String childDescription = ""; + if (child.hasProperty(RDF.type)) { + qualifiedName = child.getProperty(RDF.type).getObject() + .toString(); + childName = stripOutURI(child.getProperty(RDF.type) + .getObject().toString()); + } + if (child.hasProperty(Predicates.articleName)) { + childArticleName = stripOutLiteral(child.getProperty( + Predicates.articleName).getObject().toString()); + } + childDescription = stripOutLiteral(model.getResource( + qualifiedName).getProperty(RDFS.comment) + .getObject().toString()); + + MElement element = new MElement(childName, + childArticleName, childDescription); + String rootsParent = getParentDataType(model, childName); + if (MElement.isPrimitive(rootsParent)) { + element.setType(rootsParent); + } else { + element.setType(null); + } + processChildrenTypes(element, model, Predicates.has, + childName); + processChildrenTypes(element, model, Predicates.hasa, + childName); + if (property.getLocalName().equalsIgnoreCase("hasa")) { + root.addHasaMElement(element); + } else { + root.addHasMElement(element); + } + } + } + } + + /** + * @param model + * @param name + * @return + */ + private static String getParentDataType(Model model, String name) { + + // the statement should return null iff the object is the Moby root + // object + if (name.equals("Object")) + return null; + LinkedList list = new LinkedList(); + list.addFirst(name); + name = OBJECT_URI + name; + String parent = ""; + String previousParent = ""; + Resource resource = model.getResource(name); + Statement statement = resource.getProperty(RDFS.subClassOf); + do { + parent = statement.getObject().toString(); + if (!((String) list.getFirst()).equals(parent)) { + list.addFirst(parent); + } + resource = model.getResource(parent); + statement = resource.getProperty(RDFS.subClassOf); + + } while (statement != null); + // check to see if we have a primitive + parent = (String) list.removeFirst(); + if (list.size() > 0) { + previousParent = (String) list.removeFirst(); + previousParent = stripOutURI(previousParent); + if (MElement.isPrimitive(previousParent)) { + return previousParent; + } + } + // no primitive parent, so every object inherits from object + parent = stripOutURI(parent); + return parent; + } + + /** + * @param model + * @param name + * @return + */ + private static String getDescription(Model model, String name) { + Resource resource = model.getResource(OBJECT_URI + name); + Statement comment = resource.getProperty(RDFS.comment); + String description = comment.getObject().toString(); + description = stripOutLiteral(description); + return description; + } + + private static String getObjectRdf() throws MobyException { + String s = null; + StringBuffer sb = new StringBuffer(); + URL url = null; + try { + url = new URL(OBJECT_URI); + } catch (MalformedURLException e1) { + e1.printStackTrace(); + return null; + } + try { + BufferedReader in = null; + in = new BufferedReader(new InputStreamReader(url.openStream())); + while ((s = in.readLine()) != null) { + sb.append(s); + } + + } catch (IOException e) { + e.printStackTrace(); + return null; + } + return sb.toString(); + } + + private static String stripOutURI(String object) { + if (object.indexOf("#") > 0) + object = object.substring(object.indexOf("#") + 1); + return object; + } + + private static String stripOutLiteral(String object) { + if (object.indexOf("~") > 0) + object = object.substring(0, object.indexOf("~")); + return object; + } + + public static void main(String[] args) { + System.out.println("Is it me?"); + System.out.println("\nOutput Imag Object\n"); + System.out.println(RdfParser.buildMElement("DNASequence")); +/* System.out.println("###########################################"); + System.out.println("Outputting a String object"); + System.out.println(RdfParser.buildMElement("String")); + + System.out.println("###########################################"); + System.out.println("Outputting the base object"); + System.out.println(RdfParser.buildMElement("Object")); + + System.out.println("###########################################"); + System.out.println("Outputting a DNA sequence object"); + System.out.println(RdfParser.buildMElement("DNASequence")); + + System.out.println("###########################################"); + System.out.println("Outputting a GFF object"); + System.out.println(RdfParser.buildMElement("GFF")); + + System.out.println("###########################################"); + System.out.println("Outputting a BasicGFFSequenceFeature object"); + System.out.println(RdfParser.buildMElement("BasicGFFSequenceFeature")); +*/ + } +} From kawas at pub.open-bio.org Tue Sep 6 17:29:50 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue Sep 6 18:12:05 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062129.j86LTopo004632@pub.open-bio.org> kawas Tue Sep 6 17:29:50 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema In directory pub.open-bio.org:/tmp/cvs-serv4603/org/biomoby/shared/schema Modified Files: Frame.java MainGUI.java Log Message: Removed some unused import statements moby-live/Java/src/main/org/biomoby/shared/schema Frame.java,1.1,1.2 MainGUI.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java 2005/09/06 21:29:50 1.2 @@ -5,13 +5,21 @@ * Window - Preferences - Java - Code Style - Code Templates */ package org.biomoby.shared.schema; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.FileWriter; + +import javax.swing.BoxLayout; +import javax.swing.JButton; import javax.swing.JFrame; -import javax.swing.*; -import java.awt.event.*; -import java.awt.*; -import org.jdom.*; -import org.jdom.output.*; -import java.io.*; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextField; + +import org.jdom.Document; +import org.jdom.Element; +import org.jdom.output.Format; +import org.jdom.output.XMLOutputter; /** * @author lixin =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MainGUI.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MainGUI.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MainGUI.java 2005/09/06 21:29:50 1.2 @@ -12,8 +12,6 @@ * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ -import java.awt.event.*; -import java.io.*; public class MainGUI { public static void main(String[] args) throws Exception From gss at pub.open-bio.org Wed Sep 7 12:01:16 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed Sep 7 12:43:17 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509071601.j87G1GfY007839@pub.open-bio.org> gss Wed Sep 7 12:01:16 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/doc/User In directory pub.open-bio.org:/tmp/cvs-serv7812/S-MOBY/doc/User Modified Files: devguide.doc Log Message: Changed "Service Provider" to Service; spell check. moby-live/S-MOBY/doc/User devguide.doc,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/doc/User/devguide.doc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/S-MOBY/doc/User/devguide.doc 2005/06/27 20:40:27 1.1 and /home/repository/moby/moby-live/S-MOBY/doc/User/devguide.doc 2005/09/07 16:01:16 1.2 differ rcsdiff: /home/repository/moby/moby-live/S-MOBY/doc/User/devguide.doc: diff failed From kawas at pub.open-bio.org Tue Sep 6 17:31:11 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Thu Sep 8 11:56:47 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062131.j86LVBnl004678@pub.open-bio.org> kawas Tue Sep 6 17:31:11 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema In directory pub.open-bio.org:/tmp/cvs-serv4653/org/biomoby/shared/schema Modified Files: Builder.java Log Message: Added a method that generates a schema for the complete moby message Modified the main method so that 2 different type of schemas could potentially be retrieved. moby-live/Java/src/main/org/biomoby/shared/schema Builder.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Builder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Builder.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Builder.java 2005/09/06 21:31:11 1.2 @@ -1,1033 +1,1124 @@ -/** - *This class is used to generate a XML schema for a moby objet; To builder a XML schema element, call the method of - *buildSchem of the class; when a name of object is given, we find a MElement for this name; By analysis of the has Vector - *and hasa Vector of the MElement, we get the XML Schema for the object which has the inputed name. - *@author Lixin - *@author Eddie - *@version 1.0 - */ -package org.biomoby.shared.schema; - -import org.jdom.*; -import org.jdom.output.*; -import java.util.*; -import java.io.*; - - - -public class Builder { - - private int typeCount=0; //Everytime we create a type (complexType or simpleType), the variable will increase one. - - private Element root; //The root element of the XML Schema - - private Element firstComplexType; - - public static Namespace namespace; //This namespace is "http://www.3w.org/2001/XMLSchem". - - /** - *Given a string, we will give a element represnting an xml schema which describe the object of the name. - *@param name the name of object - *@return XML Element which represents an XML Schema - */ - public Element buildSchema(String name) - { -/* MElement mElement=new MElement("DNASequence"); - MElement m1=new MElement("string","SequenceString"); - MElement m2=new MElement("Integer","Length"); - mElement.addHasaMElement(m1); - mElement.addHasaMElement(m2);*/ - MElement mElement=new MElement(); - try{ - mElement=RdfParser.buildMElement(name); //find the MElement object representing the moby object - - } - catch(Exception e) - { - e.printStackTrace(); - } - - - - String nameOf=mElement.getName(); - root=getRoot(nameOf); //create a root element for the XML Schema of the moby object - - getElement(mElement); //add the rest part of XML schema to the root element - - return root; - - } - - /** - *the input is a MElement object; we will find all its hasa and has relations with other object; then modify the root - * element of the output xml file; the root element is the root element of a xml schema xml file. - *@param m a MElement - */ - public void getElement(MElement m) - { - Vector hasa=m.getHasaMElements(); - - Vector has=m.getHasMElements(); - - //if this MElement does not have hasa or has relation with other object, only need to return - //the first level. - if((hasa.size()==0)&&(has.size()==0)) - { - getFirstLevel(m, root); - Vector vcc=new Vector(); //create an empty vector as a parameter of function set3Attributes - set3Attributes(m, firstComplexType,vcc); - - - return; - } - else //this MElement have either has or hasa relation with ohter MElment - { - - - getFirstLevel(m,root); - Element sequence=new Element("sequence",namespace); //need a sequence element in XML schema for has - //and hasa object - firstComplexType.addContent(sequence); - - - - //find the primitive element and add them to schema - Vector tempt1; - Vector tempt2; - tempt1=(Vector)has.clone();//do not change tempt1 and tempt2, so clone two vector for them. - tempt2=(Vector)hasa.clone(); - - PrimitiveVector pri=new PrimitiveVector(tempt1, tempt2); - - - - addPrimitiveElement(pri, sequence);//add these primitive elements to the squences - - /*for object other than primitive type*/ - if(has.size()>0) - { - - - for (int i=0; i0)//the following dealing with the object in the hasa vector - { - /*create a MElementHastable for the hasa Vector. The key of the hashtabel is MElement, - and the value of hashtable of a vector containing article names*/ - MElementHashtable hss=new MElementHashtable(hasa); - - Hashtable hs=hss.getHashtable();//get a hashtable - int count=0; - - Enumeration e=hs.keys();//get all keys of the hashtable - - while(e.hasMoreElements())//go through the Enumeration - { - MElement ml=(MElement)e.nextElement(); - - Vector vc=(Vector)hs.get(ml);//get value, a vector of article names, of the hashtable - String namem=ml.getName(); - - - if(!(MElement.isPrimitive(namem))) - { - Element a=new Element("element", namespace);//add the element to the sequence - Attribute at=new Attribute("name",namem); - - String typeNamem=namem+"Typep"+typeCount; - typeCount++; - Attribute at2=new Attribute("type","moby:"+ typeNamem); - - Vector hasaNamesV=getHasaNameVector(ml); - addUniqueElement(a,"unique_1",hasaNamesV);//add an unique element - - - String st=ml.getDescription(); - addDescriptNote(st,sequence); - sequence.addContent(a); - a.setAttribute(at); - a.setAttribute(at2); - - String size=""+vc.size(); - - Attribute o1=new Attribute("minOccurs",size);//add occurence of element - Attribute o2=new Attribute("maxOccurs",size); - a.setAttribute(o1); - a.setAttribute(o2); - - //recursively to find the complex type - Element myCom=getComplexTypeRec(ml,typeNamem,vc); - root.addContent(myCom); - } - } - - - } - Vector vcc2=new Vector();//the empty vector is only used to as a parameter of set3Attributes() - set3Attributes( m,firstComplexType,vcc2); - - - } - - } - - /** - *Given a vector containing possible article names and type name, add an XML Schema element to describe - *the restriction. - *@param roots the root element of the XML Schema - *@param types the name of XML Schema simpleType - *@param articles a vector containing different article names - */ - public void addArticleNameType(Element roots, String types, Vector articles) - { - //create a simpleType XML Schema element - Element simpleType=new Element("simpleType", namespace); - Attribute at=new Attribute("name",types); - simpleType.setAttribute(at); - - //create a XML schema restriction element - Element restriction=new Element("restriction", namespace); - Attribute base=new Attribute("base","xs:string"); - restriction.setAttribute(base); - - simpleType.addContent(restriction); - - //put all article names into the enumeration of the restriction element - for(int i=0;i0) ||(has.size()>0))//if true, we can not use simpleContent XML Schema element - { - flag=0; - } - String articleName=m.getArticleName(); - - Element e1=getNamespaceAttribute(); - Element e2=getIDAttribute(); - Element e3; - - if(ar.size()==0) - { - e3=getArticleName(articleName); - } - else - { - /*if this object can has many article names, we put restriction on the article names*/ - e3=getRestrictionArticleName(ar); - } - - //check whether the type of this element is null or not - String typeName=m.getType(); - - /*check if the name of the element is primitive*/ - String priName=m.getName(); - if(MElement.isPrimitive(priName)) - { - typeName=priName; - } - - if(typeName==null||typeName.length()==0||flag==0) - { - - types.addContent(e1); - types.addContent(e2); - types.addContent(e3); - } - - /*if the type is not empty, and use extensionin schema to describe this relation*/ - else - { - typeName=typeName.toLowerCase(); - - /*create a simpleContent XML Schema element*/ - Element simpleContent=new Element("simpleContent",namespace); - - Element extension=new Element("extension", namespace); - - Attribute base=new Attribute("base","xs:"+typeName); - extension.setAttribute(base); - - extension.addContent(e1); - extension.addContent(e2); - extension.addContent(e3); - - simpleContent.addContent(extension); - - types.addContent(simpleContent); - } - - } - - /** - *create the top level of xml schema element for a moby object. - *@param m a MElement - *@param rt a xML Schema root element - */ - public void getFirstLevel(MElement m, Element rt) - { - String name=m.getName(); - String type=name+"Type"; - - Element tem1=new Element("element",namespace); - Attribute attr1=new Attribute("name",name); - Attribute attr2=new Attribute("type", "moby:"+type); - tem1.setAttribute(attr1); - tem1.setAttribute(attr2); - - /*add unique element for moby objects in the hasa relationship*/ - Vector hasaNames=getHasaNameVector(m); - //add an unique element to the first level - addUniqueElement(tem1,"first", hasaNames); - rt.addContent(tem1); - - String str=m.getDescription(); - addDescriptNote(str,rt); - - /*add the complexType element of XML Schema to the root element*/ - firstComplexType=getComplexType(m, type); - - - rt.addContent(firstComplexType); - } - - /** - *recursively get a complexType XML Shema element for MElement; when this MElement does - *not have has and hasa relation, we use another method called getComplexType; - *@param m a MElement object - *@param typeName the name of complexType - *@param vc1 a vector containing all possible article names for the MElement - *@return the complexType element for this MElement object - */ - public Element getComplexTypeRec(MElement m, String typeName, Vector vc1) - { - - root.addContent(new Comment("This is definition of complexType "+typeName)); - - /*get has and hasa vector for this MElement object*/ - Vector hasa1=m.getHasaMElements(); - - Vector has1=m.getHasMElements(); - - /*create a complexType element*/ - Element complexType=new Element("complexType",namespace); - Attribute at1=new Attribute("name",typeName); - complexType.setAttribute(at1); - - /*if this MElement does not have has or hasa relationship with other object, we have done*/ - if((hasa1.size()==0)&&(has1.size()==0)) - { - - set3Attributes(m,complexType,vc1); - - return complexType; - } - /*if this MElement has has or hasa relationshipe with other object, need puts all object into sequence XML - schema element*/ - else - { - Element sequence1=new Element("sequence",namespace); - complexType.addContent(sequence1); - - //find the primitive elements and add these to schema - PrimitiveVector pri=new PrimitiveVector(hasa1,has1); - addPrimitiveElement(pri, sequence1); - - /*deal with objects in the hasa vector*/ - if(hasa1.size()>0) - { - - MElementHashtable hss=new MElementHashtable(hasa1); - Hashtable hs=hss.getHashtable(); - int count=0; - - Enumeration e=hs.keys(); - - while(e.hasMoreElements()) - { - MElement ml=(MElement)e.nextElement(); - Vector vc=(Vector)hs.get(ml); - String namem=ml.getName(); - - /*we has handled the primitive element before*/ - if(!(MElement.isPrimitive(namem))) - { - Element a=new Element("element",namespace); - Attribute at=new Attribute("name",namem); - - String typeNamem=namem+"Typehasa"+typeCount; - typeCount++; - Attribute at2=new Attribute("type","moby:"+typeNamem); - - Vector hasaNameV=getHasaNameVector(ml); - addUniqueElement(a,"unique_1", hasaNameV); - - a.setAttribute(at); - a.setAttribute(at2); - - String size=""+vc.size(); - Attribute o1=new Attribute("minOccurs",size); - Attribute o2=new Attribute("maxOccurs",size); - a.setAttribute(o1); - a.setAttribute(o2); - sequence1.addContent(a); - - Element myCom=getComplexTypeRec(ml,typeNamem,vc); - root.addContent(myCom); - } - } - - - } - if(has1.size()>0) - { - - - for(int i=0;i + + // this is the line that is modified when handing out the full scale moby schema + + + + */ + + + return moby; + } + + /** + *the input is a MElement object; we will find all its hasa and has relations with other object; then modify the root + * element of the output xml file; the root element is the root element of a xml schema xml file. + *@param m a MElement + */ + public void getElement(MElement m) + { + Vector hasa=m.getHasaMElements(); + + Vector has=m.getHasMElements(); + + //if this MElement does not have hasa or has relation with other object, only need to return + //the first level. + if((hasa.size()==0)&&(has.size()==0)) + { + getFirstLevel(m, root); + Vector vcc=new Vector(); //create an empty vector as a parameter of function set3Attributes + set3Attributes(m, firstComplexType,vcc); + + + return; + } + else //this MElement have has and/or hasa relation with ohter MElment + { + + + getFirstLevel(m,root); + Element sequence=new Element("sequence",namespace); //need a sequence element in XML schema for has + //and hasa object + firstComplexType.addContent(sequence); + + + + //find the primitive element and add them to schema + Vector tempt1; + Vector tempt2; + tempt1=(Vector)has.clone();//do not change tempt1 and tempt2, so clone two vector for them. + tempt2=(Vector)hasa.clone(); + + PrimitiveVector pri=new PrimitiveVector(tempt1, tempt2); + + + + addPrimitiveElement(pri, sequence);//add these primitive elements to the squences + + /*for object other than primitive type*/ + if(has.size()>0) + { + + + for (int i=0; i0)//the following dealing with the object in the hasa vector + { + /*create a MElementHastable for the hasa Vector. The key of the hashtabel is MElement, + and the value of hashtable of a vector containing article names*/ + MElementHashtable hss=new MElementHashtable(hasa); + + Hashtable hs=hss.getHashtable();//get a hashtable + int count=0; + + Enumeration e=hs.keys();//get all keys of the hashtable + + while(e.hasMoreElements())//go through the Enumeration + { + MElement ml=(MElement)e.nextElement(); + + Vector vc=(Vector)hs.get(ml);//get value, a vector of article names, of the hashtable + String namem=ml.getName(); + + + if(!(MElement.isPrimitive(namem))) + { + Element a=new Element("element", namespace);//add the element to the sequence + Attribute at=new Attribute("name",namem); + + String typeNamem=namem+"Typep"+typeCount; + typeCount++; + Attribute at2=new Attribute("type","moby:"+ typeNamem); + + Vector hasaNamesV=getHasaNameVector(ml); + addUniqueElement(a,"unique_1",hasaNamesV);//add an unique element + + + String st=ml.getDescription(); + addDescriptNote(st,sequence); + sequence.addContent(a); + a.setAttribute(at); + a.setAttribute(at2); + + String size=""+vc.size(); + + Attribute o1=new Attribute("minOccurs",size);//add occurence of element + Attribute o2=new Attribute("maxOccurs",size); + a.setAttribute(o1); + a.setAttribute(o2); + + //recursively to find the complex type + Element myCom=getComplexTypeRec(ml,typeNamem,vc); + root.addContent(myCom); + } + } + + + } + Vector vcc2=new Vector();//the empty vector is only used to as a parameter of set3Attributes() + set3Attributes( m,firstComplexType,vcc2); + + + } + + } + + /** + *Given a vector containing possible article names and type name, add an XML Schema element to describe + *the restriction. + *@param roots the root element of the XML Schema + *@param types the name of XML Schema simpleType + *@param articles a vector containing different article names + */ + public void addArticleNameType(Element roots, String types, Vector articles) + { + //create a simpleType XML Schema element + Element simpleType=new Element("simpleType", namespace); + Attribute at=new Attribute("name",types); + simpleType.setAttribute(at); + + //create a XML schema restriction element + Element restriction=new Element("restriction", namespace); + Attribute base=new Attribute("base","xs:string"); + restriction.setAttribute(base); + + simpleType.addContent(restriction); + + //put all article names into the enumeration of the restriction element + for(int i=0;i0) ||(has.size()>0))//if true, we can not use simpleContent XML Schema element + { + flag=0; + } + String articleName=m.getArticleName(); + + Element e1=getNamespaceAttribute(); + Element e2=getIDAttribute(); + Element e3; + + if(ar.size()==0) + { + e3=getArticleName(articleName); + } + else + { + /*if this object can has many article names, we put restriction on the article names*/ + e3=getRestrictionArticleName(ar); + } + + //check whether the type of this element is null or not + String typeName=m.getType(); + + /*check if the name of the element is primitive*/ + String priName=m.getName(); + if(MElement.isPrimitive(priName)) + { + typeName=priName; + } + + if(typeName==null||typeName.length()==0||flag==0) + { + + types.addContent(e1); + types.addContent(e2); + types.addContent(e3); + } + + /*if the type is not empty, and use extensionin schema to describe this relation*/ + else + { + typeName=typeName.toLowerCase(); + + /*create a simpleContent XML Schema element*/ + Element simpleContent=new Element("simpleContent",namespace); + + Element extension=new Element("extension", namespace); + + Attribute base=new Attribute("base","xs:"+typeName); + extension.setAttribute(base); + + extension.addContent(e1); + extension.addContent(e2); + extension.addContent(e3); + + simpleContent.addContent(extension); + + types.addContent(simpleContent); + } + + } + + /** + *create the top level of xml schema element for a moby object. + *@param m a MElement + *@param rt a xML Schema root element + */ + public void getFirstLevel(MElement m, Element rt) + { + String name=m.getName(); + String type=name+"Type"; + + Element tem1=new Element("element",namespace); + Attribute attr1=new Attribute("name",name); + Attribute attr2=new Attribute("type", "moby:"+type); + tem1.setAttribute(attr1); + tem1.setAttribute(attr2); + + /*add unique element for moby objects in the hasa relationship*/ + Vector hasaNames=getHasaNameVector(m); + //add an unique element to the first level + addUniqueElement(tem1,"first", hasaNames); + rt.addContent(tem1); + + String str=m.getDescription(); + addDescriptNote(str,rt); + + /*add the complexType element of XML Schema to the root element*/ + firstComplexType=getComplexType(m, type); + + + rt.addContent(firstComplexType); + } + + /** + *recursively get a complexType XML Shema element for MElement; when this MElement does + *not have has and hasa relation, we use another method called getComplexType; + *@param m a MElement object + *@param typeName the name of complexType + *@param vc1 a vector containing all possible article names for the MElement + *@return the complexType element for this MElement object + */ + public Element getComplexTypeRec(MElement m, String typeName, Vector vc1) + { + + root.addContent(new Comment("This is definition of complexType "+typeName)); + + /*get has and hasa vector for this MElement object*/ + Vector hasa1=m.getHasaMElements(); + + Vector has1=m.getHasMElements(); + + /*create a complexType element*/ + Element complexType=new Element("complexType",namespace); + Attribute at1=new Attribute("name",typeName); + complexType.setAttribute(at1); + + /*if this MElement does not have has or hasa relationship with other object, we have done*/ + if((hasa1.size()==0)&&(has1.size()==0)) + { + + set3Attributes(m,complexType,vc1); + + return complexType; + } + /*if this MElement has has or hasa relationshipe with other object, need puts all object into sequence XML + schema element*/ + else + { + Element sequence1=new Element("sequence",namespace); + complexType.addContent(sequence1); + + //find the primitive elements and add these to schema + PrimitiveVector pri=new PrimitiveVector(hasa1,has1); + addPrimitiveElement(pri, sequence1); + + /*deal with objects in the hasa vector*/ + if(hasa1.size()>0) + { + + MElementHashtable hss=new MElementHashtable(hasa1); + Hashtable hs=hss.getHashtable(); + int count=0; + + Enumeration e=hs.keys(); + + while(e.hasMoreElements()) + { + MElement ml=(MElement)e.nextElement(); + Vector vc=(Vector)hs.get(ml); + String namem=ml.getName(); + + /*we has handled the primitive element before*/ + if(!(MElement.isPrimitive(namem))) + { + Element a=new Element("element",namespace); + Attribute at=new Attribute("name",namem); + + String typeNamem=namem+"Typehasa"+typeCount; + typeCount++; + Attribute at2=new Attribute("type","moby:"+typeNamem); + + Vector hasaNameV=getHasaNameVector(ml); + addUniqueElement(a,"unique_1", hasaNameV); + + a.setAttribute(at); + a.setAttribute(at2); + + String size=""+vc.size(); + Attribute o1=new Attribute("minOccurs",size); + Attribute o2=new Attribute("maxOccurs",size); + a.setAttribute(o1); + a.setAttribute(o2); + sequence1.addContent(a); + + Element myCom=getComplexTypeRec(ml,typeNamem,vc); + root.addContent(myCom); + } + } + + + } + if(has1.size()>0) + { + + + for(int i=0;i moby_data_type"); + System.out.println("where possible options include:"); + System.out.println(" -m generate a schema that describes the complete moby message"); + System.out.println(); + System.exit(1); + } +} + + + + From carrere at pub.open-bio.org Thu Sep 8 09:44:48 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Thu Sep 8 11:56:49 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509081344.j88Dimem016358@pub.open-bio.org> carrere Thu Sep 8 09:44:48 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/xsl In directory pub.open-bio.org:/tmp/cvs-serv16334/xsl Log Message: Directory /home/repository/moby/moby-live/Perl/MOBY/xsl added to the repository moby-live/Perl/MOBY/xsl - New directory rcsdiff: /home/repository/moby/moby-live/Perl/MOBY/xsl/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/MOBY/xsl/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/MOBY/xsl/RCS/directory,v: No such file or directory From carrere at pub.open-bio.org Thu Sep 8 09:46:45 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Thu Sep 8 11:56:50 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509081346.j88DkjGa016400@pub.open-bio.org> carrere Thu Sep 8 09:46:45 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/xsl In directory pub.open-bio.org:/tmp/cvs-serv16379 Added Files: parseMobyMessage.xsl Log Message: This XSL style-sheet is used by MOBYXSLT.pm module to parse MOBY messages with xsltproc binary. moby-live/Perl/MOBY/xsl parseMobyMessage.xsl,NONE,1.1 From carrere at pub.open-bio.org Thu Sep 8 09:51:06 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Thu Sep 8 11:56:51 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509081351.j88Dp6Kj016446@pub.open-bio.org> carrere Thu Sep 8 09:51:06 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv16419 Added Files: MOBYXSLT.pm Log Message: This module contains many of CommonSubs methods but doesn't use XML::DOM to parse MOBY message. It uses a first pass xsl transformation (with xsltproc and ./xsl/parseMobyMessage.xsl as a style-sheet) and then build Perl structure upon this parsing. This module has been tested on a 10Mb MOBY message and it's OK. 3 Globals Variable have to be edited before use. moby-live/Perl/MOBY MOBYXSLT.pm,NONE,1.1 From gss at pub.open-bio.org Thu Sep 8 15:46:47 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 8 16:28:43 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509081946.j88JklED017703@pub.open-bio.org> gss Thu Sep 8 15:46:47 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org In directory pub.open-bio.org:/tmp/cvs-serv17681 Removed Files: .classpath Log Message: Not needed moby-live/S-MOBY/ref-impl/semanticmoby.org .classpath,1.4,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/RCS/.classpath,v: No such file or directory From gss at pub.open-bio.org Thu Sep 8 15:47:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 8 16:28:55 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509081947.j88Jl2FH017738@pub.open-bio.org> gss Thu Sep 8 15:47:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev In directory pub.open-bio.org:/tmp/cvs-serv17716/src/org/semanticmoby/ref/servlets/dev Removed Files: OWLValidationServlet.java Log Message: No longer needed moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev OWLValidationServlet.java,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/RCS/OWLValidationServlet.java,v: No such file or directory From senger at pub.open-bio.org Sun Sep 11 22:45:47 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 11 23:27:45 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509120245.j8C2jlsI006937@pub.open-bio.org> senger Sun Sep 11 22:45:46 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv6918 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.29,1.30 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/04 13:45:36 1.29 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/12 02:45:46 1.30 @@ -1316,6 +1316,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + From kawas at pub.open-bio.org Mon Sep 12 14:21:13 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon Sep 12 15:03:34 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509121821.j8CILDLQ009118@pub.open-bio.org> kawas Mon Sep 12 14:21:13 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test In directory pub.open-bio.org:/tmp/cvs-serv9097/org/biomoby/registry/rdfagent/test Added Files: RDFAgentTestSuite.java Log Message: adding a test driver for the agent. I have to still commit the actual test files that this driver utilizes. moby-live/Java/src/main/org/biomoby/registry/rdfagent/test RDFAgentTestSuite.java,NONE,1.1 From kawas at pub.open-bio.org Mon Sep 12 14:22:10 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon Sep 12 15:04:38 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509121822.j8CIMAas009153@pub.open-bio.org> kawas Mon Sep 12 14:22:10 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util In directory pub.open-bio.org:/tmp/cvs-serv9124/org/biomoby/registry/rdfagent/util Modified Files: Report.java Constants.java Log Message: made various bug fixes and added a sendmail option for sending out the results to service providers. moby-live/Java/src/main/org/biomoby/registry/rdfagent/util Report.java,1.6,1.7 Constants.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java 2005/08/04 12:58:40 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java 2005/09/12 18:22:10 1.7 @@ -8,7 +8,7 @@ /** * @author Nina Opushneva - * + * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ @@ -22,132 +22,170 @@ import org.biomoby.registry.rdfagent.verifier.DataMngr; public class Report { - - static ArrayList mr = null; + + static ArrayList mr = null; + static ArrayList ds = null; - - public static void add(String line){ - - if(mr == null){ - mr = new ArrayList(); - } - mr.add(line); - - } - - public static void doBuild(String line){ - - if(ds == null){ - ds = new ArrayList(); - } - ds.add(line); - - } - - public static void send(String signURL){ - - String message = ""; - - if(mr != null){ - - StringBuffer mes1 = new StringBuffer(); - - for (int i=0; i < mr.size(); i++){ - mes1.append(mr.get(i).toString()+"\n"); - } - message += mes1; - } - if(ds != null){ - - StringBuffer mes2 = new StringBuffer(); - - for (int i=0; i < ds.size(); i++){ - mes2.append(ds.get(i).toString()+"\n"); - } - message += mes2; - } - - if (Constants.MB_MAIL_SERVER != null || !Constants.MB_MAIL_SERVER.equals("") ){ - - String to = ""; - to = DataMngr.getContactEmail(signURL); - - if (to.equals("")){ - to = "edward.kawas@gmail.com"; - - } - String subject = "The RDFagent Report"; - Log.info("email message is\n" + message); - Communicator.sendMail(to,subject,message.toString(),Constants.MB_FROM); // send message to the service provider - that service was deregistered - ds = null; - mr = null; - } - } - - public static void createFile(String fileName){ - try { - File file = new File(fileName); - - // Create file if it does not exist - boolean success = file.createNewFile(); - if (success) { - // File did not exist and was created - } else { - // File already exists - file.delete(); - file.createNewFile(); - } - } catch (IOException e) { - Log.warning(e.getMessage()); - } - } - - public static void doWrite(String line) { - - try { - String path = Constants.RDFagentHome; - BufferedWriter out = new BufferedWriter(new FileWriter(path+Constants.SV_REPORT_PATH, true)); - out.write(line); - out.newLine(); - out.close(); - } catch (IOException e) { - Log.warning(e.getMessage()); - } - - } - -/* public static void doBuild(String line) { - - try { - String path = Constants.RDFagentHome; - BufferedWriter out = new BufferedWriter(new FileWriter(path+Constants.SV_DELFILE_PATH, true)); - out.write(line); - out.newLine(); - out.close(); - } catch (IOException e) { - Log.warning(e.getMessage()); - } - - } -*/ - - public static void doSave(String file,String line) { - - try { - - BufferedWriter out = new BufferedWriter(new FileWriter(file, true)); - out.write(line); - out.newLine(); - out.close(); - } catch (IOException e) { - Log.warning(e.getMessage()); - } - - } - - - } + public static void add(String line) { + + if (mr == null) { + mr = new ArrayList(); + } + mr.add(line); + + } + + public static void doBuild(String line) { + + if (ds == null) { + ds = new ArrayList(); + } + ds.add(line); + + } + + public static void send(String signURL) { + + String message = ""; + + if (mr != null) { + + StringBuffer mes1 = new StringBuffer(); + + for (int i = 0; i < mr.size(); i++) { + mes1.append(mr.get(i).toString() + "\n"); + } + message += mes1; + } + if (ds != null) { + + StringBuffer mes2 = new StringBuffer(); + + for (int i = 0; i < ds.size(); i++) { + mes2.append(ds.get(i).toString() + "\n"); + } + message += mes2; + } + + if (Constants.MB_MAIL_SERVER != null + || !Constants.MB_MAIL_SERVER.equals("") + || Constants.MB_MAIL_PRGM != null + || !Constants.MB_MAIL_PRGM.equals("")) { + + String to = ""; + to = DataMngr.getContactEmail(signURL); + + if (to.equals("")) { + to = "edward.kawas@gmail.com"; + + } + String subject = "The RDFagent Report"; + Log.info("email message is\n" + message); + if (Constants.MB_MAIL_PRGM != null + || !Constants.MB_MAIL_PRGM.equals("")) + try { + + //String cmd ="echo \"" + message.toString() + "\" | "+ + // Constants.MB_MAIL_PRGM+ " -s 'The RDFagent Report :-(' '" + // + "markw@illuminae.com"+ "'"; + String cmd = "echo \"" + message.toString() + "\" | " + + Constants.MB_MAIL_PRGM + + " -s 'The RDFagent Report :-(' '" + to + "'"; + File file = new File("_script_.sh"); + FileWriter fw = new FileWriter(file); + fw.write(_shellScriptHeader + cmd); + fw.close(); + + Process p = Runtime.getRuntime().exec( + "chmod +x _script_.sh"); + p.waitFor(); + p = Runtime.getRuntime().exec("./_script_.sh"); + p.waitFor(); + Log.info("_script_.sh has " + + ((file.delete()) ? "" : "not ") + "been deleted" + + System.getProperty("line.separator") + + "The exit value of the spawned process was : " + + p.exitValue()); + } catch (IOException e) { + e.printStackTrace(); + Log.severe("Could not send message using cmd line mail to " + + to); + Report + .doWrite("Could not send message using cmd line mail to " + + to); + // use this only as a last resort + if (Constants.MB_MAIL_SERVER != null + || !Constants.MB_MAIL_SERVER.equals("")) + Communicator.sendMail(to, subject, message.toString(), + Constants.MB_FROM); + } catch (InterruptedException e) { + e.printStackTrace(); + } + //Communicator.sendMail(to,subject,message.toString(),Constants.MB_FROM); + ds = null; + mr = null; + } + } + + public static void createFile(String fileName) { + try { + File file = new File(fileName); + + // Create file if it does not exist + boolean success = file.createNewFile(); + if (success) { + // File did not exist and was created + } else { + // File already exists + file.delete(); + file.createNewFile(); + } + } catch (IOException e) { + Log.warning(e.getMessage()); + } + } + + public static void doWrite(String line) { + + try { + String path = Constants.RDFagentHome; + BufferedWriter out = new BufferedWriter(new FileWriter(path + + Constants.SV_REPORT_PATH, true)); + out.write(line); + out.newLine(); + out.close(); + } catch (IOException e) { + Log.warning(e.getMessage()); + } + + } + + /* + * public static void doBuild(String line) { + * + * try { String path = Constants.RDFagentHome; BufferedWriter out = new + * BufferedWriter(new FileWriter(path+Constants.SV_DELFILE_PATH, true)); + * out.write(line); out.newLine(); out.close(); } catch (IOException e) { + * Log.warning(e.getMessage()); } } + */ + + public static void doSave(String file, String line) { + + try { + + BufferedWriter out = new BufferedWriter(new FileWriter(file, true)); + out.write(line); + out.newLine(); + out.close(); + } catch (IOException e) { + Log.warning(e.getMessage()); + } + + } + private final static String _shellScriptHeader = "#!/bin/sh" + + System.getProperty("line.separator"); +} =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Constants.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Constants.java 2005/04/16 14:32:47 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Constants.java 2005/09/12 18:22:10 1.7 @@ -40,6 +40,7 @@ public static String MB_MAIL_USER = null; public static String MB_MAIL_PSWD = null; public static String MB_FROM = null; + public static String MB_MAIL_PRGM = null; public static String SP_SUBJECT = null; public static String SP_ERR_MSG_CON = null; @@ -78,6 +79,7 @@ MB_SUBJECT = moby.getChildTextTrim("subject"); MB_ERR_MSG = moby.getChildTextTrim("errMessage"); MB_MAIL_SERVER = moby.getChildTextTrim("mailServer"); + MB_MAIL_PRGM = moby.getChildTextTrim("cmdLnMailProgram"); MB_MAIL_USER = moby.getChildTextTrim("mailUser"); MB_MAIL_PSWD = moby.getChildTextTrim("mailPswd"); MB_FROM = moby.getChildTextTrim("from"); From kawas at pub.open-bio.org Mon Sep 12 14:21:08 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon Sep 12 15:05:17 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509121821.j8CIL8aV009084@pub.open-bio.org> kawas Mon Sep 12 14:21:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test In directory pub.open-bio.org:/tmp/cvs-serv9060/org/biomoby/registry/rdfagent/test Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test added to the repository moby-live/Java/src/main/org/biomoby/registry/rdfagent/test - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test/RCS/directory,v: No such file or directory From kawas at pub.open-bio.org Mon Sep 12 14:22:11 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon Sep 12 15:06:47 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509121822.j8CIMB84009172@pub.open-bio.org> kawas Mon Sep 12 14:22:10 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier In directory pub.open-bio.org:/tmp/cvs-serv9124/org/biomoby/registry/rdfagent/verifier Modified Files: Communicator.java Log Message: made various bug fixes and added a sendmail option for sending out the results to service providers. moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier Communicator.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/Communicator.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/Communicator.java 2005/08/04 12:58:41 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/Communicator.java 2005/09/12 18:22:10 1.8 @@ -174,7 +174,6 @@ + " > WILL BE DEREGISTERED FROM mobycentral REGISTRY"); Report .doWrite("======================================================================================="); - // TODO send the report here? } } else { From kawas at pub.open-bio.org Mon Sep 12 22:50:56 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon Sep 12 23:32:36 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130250.j8D2ouWj010280@pub.open-bio.org> kawas Mon Sep 12 22:50:56 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test In directory pub.open-bio.org:/tmp/cvs-serv10259/org/biomoby/registry/rdfagent/test Added Files: TestException.java Log Message: silly exception class that isnt really used, but caused compile problems. moby-live/Java/src/main/org/biomoby/registry/rdfagent/test TestException.java,NONE,1.1 From senger at pub.open-bio.org Tue Sep 13 02:42:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Sep 13 03:24:25 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130642.j8D6gQeI010723@pub.open-bio.org> senger Tue Sep 13 02:42:26 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv10704 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.2,1.3 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/04 13:15:54 1.2 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/13 06:42:26 1.3 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Tue Sep 13 02:46:35 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Sep 13 03:28:10 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130646.j8D6kZPV010887@pub.open-bio.org> senger Tue Sep 13 02:46:33 EDT 2005 Update of /home/repository/moby/moby-live/Java/lib/ant_home/lib In directory pub.open-bio.org:/tmp/cvs-serv10759 Modified Files: ant-antlr.jar ant-apache-bcel.jar ant-apache-bsf.jar ant-apache-log4j.jar ant-apache-oro.jar ant-apache-regexp.jar ant-apache-resolver.jar ant-commons-logging.jar ant-commons-net.jar ant-icontract.jar ant-jai.jar ant-javamail.jar ant-jdepend.jar ant-jmf.jar ant-jsch.jar ant-junit.jar ant-launcher.jar ant-netrexx.jar ant-nodeps.jar ant-starteam.jar ant-stylebook.jar ant-swing.jar ant-trax.jar ant-vaj.jar ant-weblogic.jar ant-xalan1.jar ant-xslp.jar ant.jar Log Message: ant version 1.6.5 moby-live/Java/lib/ant_home/lib ant-antlr.jar,1.1,1.2 ant-apache-bcel.jar,1.1,1.2 ant-apache-bsf.jar,1.1,1.2 ant-apache-log4j.jar,1.1,1.2 ant-apache-oro.jar,1.1,1.2 ant-apache-regexp.jar,1.1,1.2 ant-apache-resolver.jar,1.1,1.2 ant-commons-logging.jar,1.1,1.2 ant-commons-net.jar,1.1,1.2 ant-icontract.jar,1.1,1.2 ant-jai.jar,1.1,1.2 ant-javamail.jar,1.1,1.2 ant-jdepend.jar,1.1,1.2 ant-jmf.jar,1.1,1.2 ant-jsch.jar,1.1,1.2 ant-junit.jar,1.1,1.2 ant-launcher.jar,1.1,1.2 ant-netrexx.jar,1.1,1.2 ant-nodeps.jar,1.1,1.2 ant-starteam.jar,1.1,1.2 ant-stylebook.jar,1.1,1.2 ant-swing.jar,1.1,1.2 ant-trax.jar,1.1,1.2 ant-vaj.jar,1.1,1.2 ant-weblogic.jar,1.1,1.2 ant-xalan1.jar,1.1,1.2 ant-xslp.jar,1.1,1.2 ant.jar,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-antlr.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-antlr.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-antlr.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-antlr.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bcel.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bcel.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bcel.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bcel.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bsf.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bsf.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bsf.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bsf.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-log4j.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-log4j.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-log4j.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-log4j.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-oro.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-oro.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-oro.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-oro.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-regexp.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-regexp.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-regexp.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-regexp.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-resolver.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-resolver.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-resolver.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-resolver.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-logging.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-logging.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-logging.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-logging.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-net.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-net.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-net.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-net.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-icontract.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-icontract.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-icontract.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-icontract.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jai.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jai.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jai.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jai.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-javamail.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-javamail.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-javamail.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-javamail.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jdepend.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jdepend.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jdepend.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jdepend.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jmf.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jmf.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jmf.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jmf.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jsch.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jsch.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jsch.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jsch.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-junit.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-junit.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-junit.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-junit.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-launcher.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-launcher.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-launcher.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-launcher.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-netrexx.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-netrexx.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-netrexx.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-netrexx.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-nodeps.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-nodeps.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-nodeps.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-nodeps.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-starteam.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-starteam.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-starteam.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-starteam.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-stylebook.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-stylebook.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-stylebook.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-stylebook.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-swing.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-swing.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-swing.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-swing.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-trax.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-trax.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-trax.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-trax.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-vaj.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-vaj.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-vaj.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-vaj.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-weblogic.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-weblogic.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-weblogic.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-weblogic.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xalan1.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xalan1.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xalan1.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xalan1.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xslp.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xslp.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xslp.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xslp.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant.jar,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant.jar 2005/05/19 15:57:21 1.3 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant.jar 2005/09/13 06:46:33 1.4 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant.jar: diff failed From senger at pub.open-bio.org Tue Sep 13 02:53:28 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Sep 13 03:35:05 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130653.j8D6rSLI010936@pub.open-bio.org> senger Tue Sep 13 02:53:28 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv10917 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.30,1.31 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/12 02:45:46 1.30 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/13 06:53:28 1.31 @@ -817,7 +817,7 @@ - + @@ -1347,5 +1347,28 @@ + + + + + + + + + + + + + + + From senger at pub.open-bio.org Tue Sep 13 02:53:28 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Sep 13 03:35:38 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130653.j8D6rSee010963@pub.open-bio.org> senger Tue Sep 13 02:53:28 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv10917/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java DashboardPanel.java RegistryPanel.java Added Files: NOTES Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard NOTES,NONE,1.1 AbstractPanel.java,1.2,1.3 DashboardPanel.java,1.1,1.2 RegistryPanel.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/04 13:45:38 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/13 06:53:28 1.3 @@ -8,12 +8,17 @@ package org.biomoby.service.dashboard; +import org.tulsoft.tools.gui.SwingUtils; + import javax.swing.JLabel; import javax.swing.JPanel; -import javax.swing.text.html.HTMLDocument; import javax.swing.Icon; import javax.swing.JComponent; +import javax.swing.AbstractButton; +import javax.swing.text.html.HTMLDocument; +import java.awt.GridBagConstraints; +import java.awt.Insets; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeSupport; @@ -29,6 +34,40 @@ extends JPanel implements DashboardPanel { + + // copy here some often used constants + protected static final int RELATIVE = GridBagConstraints.RELATIVE; + protected static final int REMAINDER = GridBagConstraints.REMAINDER; + protected static final int NONE = GridBagConstraints.NONE; + protected static final int BOTH = GridBagConstraints.BOTH; + protected static final int HORIZONTAL = GridBagConstraints.HORIZONTAL; + protected static final int VERTICAL = GridBagConstraints.VERTICAL; + protected static final int CENTER = GridBagConstraints.CENTER; + protected static final int NORTH = GridBagConstraints.NORTH; + protected static final int NORTHEAST = GridBagConstraints.NORTHEAST; + protected static final int EAST = GridBagConstraints.EAST; + protected static final int SOUTHEAST = GridBagConstraints.SOUTHEAST; + protected static final int SOUTH = GridBagConstraints.SOUTH; + protected static final int SOUTHWEST = GridBagConstraints.SOUTHWEST; + protected static final int WEST = GridBagConstraints.WEST; + protected static final int NORTHWEST = GridBagConstraints.NORTHWEST; + protected static final int PAGE_START = GridBagConstraints.PAGE_START; + protected static final int PAGE_END = GridBagConstraints.PAGE_END; + protected static final int LINE_START = GridBagConstraints.LINE_START; + protected static final int LINE_END = GridBagConstraints.LINE_END; + protected static final int FIRST_LINE_START = GridBagConstraints.FIRST_LINE_START; + protected static final int FIRST_LINE_END = GridBagConstraints.FIRST_LINE_END; + protected static final int LAST_LINE_START = GridBagConstraints.LAST_LINE_START; + protected static final int LAST_LINE_END = GridBagConstraints.LAST_LINE_END; + + + /********************************************************************* + * Default constructor (just for the sub-classes). + ********************************************************************/ + protected AbstractPanel() { + support = new PropertyChangeSupport (this); + } + /************************************************************************** * **************************************************************************/ @@ -59,7 +98,7 @@ } /************************************************************************** - * Here we get notified when a property chnage happen. + * Here we get notified when a property change happen. **************************************************************************/ public void propertyChange (PropertyChangeEvent event) { } @@ -83,4 +122,25 @@ **************************************************************************/ abstract public JLabel getTitle(); + // + // Methods to be used by sub-classes + // + + /********************************************************************* + * Set a button to a common look-and-feel. + ********************************************************************/ + protected static void commonButtonLookAndFeel (AbstractButton but) { +// but.setMargin (new Insets (0,0,0,0)); +// but.setBorderPainted (false); + but.setFocusPainted (false); +// but.setContentAreaFilled (false); + } + + /********************************************************************* + * Return true if confirmation dialog passed. + ********************************************************************/ + public boolean confirm (Object msg) { + return SwingUtils.confirm (this, msg, null); + } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/02 07:38:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/13 06:53:28 1.2 @@ -29,7 +29,7 @@ */ public interface DashboardPanel - extends PropertyChangeListener { + extends PropertyChangeListener, DashboardProperties { /************************************************************************** * A name identifies a panel in the dashboard's tabs. It should be =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/04 13:45:38 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/13 06:53:28 1.3 @@ -8,16 +8,22 @@ package org.biomoby.service.dashboard; +import org.tulsoft.tools.gui.SwingUtils; + import javax.swing.JLabel; -import javax.swing.text.html.HTMLDocument; import javax.swing.Icon; import javax.swing.JComponent; +import javax.swing.text.html.HTMLDocument; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; /** - * + * A panel displaying contents of a Biomoby registry. It also select + * what Biomoby registry to work with, and what cache directory to + * use.

* * WORK IN PROGRESS.

* @@ -60,7 +66,7 @@ * **************************************************************************/ public JLabel getTitle() { - return null; + return new JLabel (getName()); } } From senger at pub.open-bio.org Tue Sep 13 02:54:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Sep 13 03:36:08 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130654.j8D6saEL011005@pub.open-bio.org> senger Tue Sep 13 02:54:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv10990/src/main/org/biomoby/service/dashboard Added Files: ConsolePanel.java Dashboard.java DashboardProperties.java EventGeneratorPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard ConsolePanel.java,NONE,1.1 Dashboard.java,NONE,1.1 DashboardProperties.java,NONE,1.1 EventGeneratorPanel.java,NONE,1.1 From pieter at pub.open-bio.org Mon Sep 12 09:51:03 2005 From: pieter at pub.open-bio.org (Pieter Neerincs) Date: Tue Sep 13 08:08:47 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509121351.j8CDp3Up008568@pub.open-bio.org> pieter Mon Sep 12 09:51:03 EDT 2005 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv8543/Perl/scripts Modified Files: CloneCentralDatabases.pl Log Message: Fixed small SQL GRANT PRIVILEGES bug in Perl/scripts/CloneCentralDatabases.pl moby-live/Perl/scripts CloneCentralDatabases.pl,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/scripts/CloneCentralDatabases.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/scripts/CloneCentralDatabases.pl 2005/07/07 11:39:54 1.1 +++ /home/repository/moby/moby-live/Perl/scripts/CloneCentralDatabases.pl 2005/09/12 13:51:03 1.2 @@ -143,7 +143,7 @@ $data .= "FLUSH PRIVILEGES\;\n"; $data .= "CREATE DATABASE IF NOT EXISTS $dbname\;\n"; $data .= "USE $dbname\;\n"; - $data .= "GRANT ALL PRIVILEGES ON $dbname TO \"$username\"\@\"localhost\" identified by \"$password\"\;\n"; + $data .= "GRANT ALL PRIVILEGES ON $dbname.* TO \"$username\"\@\"localhost\" identified by \"$password\"\;\n"; $data .= "FLUSH PRIVILEGES\;\n"; } From kawas at pub.open-bio.org Tue Sep 13 09:17:58 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue Sep 13 10:08:01 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509131317.j8DDHwUB012224@pub.open-bio.org> kawas Tue Sep 13 09:17:58 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi In directory pub.open-bio.org:/tmp/cvs-serv12199/Adaptor/moby/queryapi Modified Files: mysql.pm Log Message: commented out an unused line that was causing grief. The variable that has been removed is unused. moby-live/Perl/MOBY/Adaptor/moby/queryapi mysql.pm,1.72,1.73 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/08/29 22:36:32 1.72 +++ /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/09/13 13:17:58 1.73 @@ -1,1430 +1,1430 @@ -package MOBY::Adaptor::moby::queryapi::mysql; - -use strict; -use vars qw($AUTOLOAD @ISA); -use Carp; -use MOBY::Adaptor::moby::queryapi; -use DBI; -use DBD::mysql; - -@ISA = qw{MOBY::Adaptor::moby::queryapi}; # implements the interface - -{ - #Encapsulated class data - - #___________________________________________________________ - #ATTRIBUTES - my %_attr_data = # DEFAULT ACCESSIBILITY - ( - driver => ["DBI:mysql", 'read/write'], - dbh => [undef, 'read/write'], - - ); - - #_____________________________________________________________ - - # METHODS, to operate on encapsulated class data - - # Is a specified object attribute accessible in a given mode - sub _accessible { - my ($self, $attr, $mode) = @_; - $_attr_data{$attr}[1] =~ /$mode/ - } - - # Classwide default value for a specified object attribute - sub _default_for { - my ($self, $attr) = @_; - $_attr_data{$attr}[0]; - } - - # List of names of all specified object attributes - sub _standard_keys { - keys %_attr_data; - } - - sub driver { - my ($self, $arg) = @_; - $self->{driver} = $arg if defined $arg; - return $self->{driver}; - } - sub dbh { - my ($self, $arg) = @_; - $self->{dbh} = $arg if defined $arg; - return $self->{dbh}; - } - -} - -sub _getDBHandle { - my ($ontology) = @_; - my $CONF = MOBY::Config->new; - my $adap = $CONF->getDataAdaptor(source => $ontology); - return $adap->dbh; -} - -sub new { - my ($caller, %args) = @_; - my $self = $caller->SUPER::new(%args); - - my $caller_is_obj = ref($caller); - my $class = $caller_is_obj || $caller; - - foreach my $attrname ( $self->_standard_keys ) { - if (exists $args{$attrname} && defined $args{$attrname}) { - $self->{$attrname} = $args{$attrname} } - elsif ($caller_is_obj) { - $self->{$attrname} = $caller->{$attrname} } - else { - $self->{$attrname} = $self->_default_for($attrname) } - } - - return unless $self->driver; - my $driver = $self->driver; # inherited from the adaptorI (queryapi) - my $username = $self->username; - my $password = $self->password; - my $port = $self->port; - my $url = $self->url; - my $dbname = $self->dbname; - - my ($dsn) = "$driver:$dbname:$url:$port"; - my $dbh = DBI->connect($dsn, $username, $password, {RaiseError => 1}) or die "can't connect to database"; - - - ############################################################## - unless ($dbh) { - print STDERR "Couldn't connect to the datasource \n",($self->_dump()),"\n\n"; - return undef; - } - - $self->dbh($dbh); - ############################################################# - - return undef unless $self->dbh; - return $self; - -} - -sub _add_condition{ - my ($statement, @params) = @_; - my @bindvalues = (); - my $condition = "where "; - - foreach my $param (@params ) - { - if (($param eq 'and') || ($param eq 'or')) - { - $condition .= $param . " "; - } - else - { - my %pair = %$param; - - for my $key (keys %pair) - { - if (defined $pair{$key}) - { - $condition .= $key . " = ? "; - push(@bindvalues, $pair{$key}); - } - else - { - $condition .= $key . " IS NULL " - } - } - } - } - $statement .= $condition; - return ($statement, @bindvalues); - } - -# preforms query but returns a reference to an array containing hash references -sub do_query{ - my ($dbh, $statement, @bindvalues) = @_; - my $sth = $dbh -> prepare($statement); - if (@bindvalues < 1) - { - $sth->execute; - } - else - { - $sth->execute(@bindvalues); - } - # returns an array of hash references - my $arrayHashRef = $sth->fetchall_arrayref({}); - return $arrayHashRef; -} - -sub get_value{ - my ($key, @params) = @_; - - foreach my $param (@params ) - { - my %pair = %$param; - for my $tmp (keys %pair) - { - if ($tmp eq $key){ - return $pair{$key}; - } - } - } -} - -sub _getSIIDFromLSID { - my ($self, $lsid) = @_; - my $dbh = $self->dbh; - my $sth = $dbh->prepare("select service_instance_id from service_instance where lsid = ?"); - $sth->execute($lsid); - my ($siid) = $sth->fetchrow_array(); - return $siid; -} - -# this should NOT retun a collection ID... needs more work... -# args passed in: service_lsid -sub query_collection_input{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $serv_lsid = $args{'service_instance_lsid'}; - - my $statement = "select - collection_input_id, - article_name - from collection_input as c, service_instance as si where si.service_instance_id = c.service_instance_id and si.lsid = ?"; - my $result = do_query($dbh, $statement, ($serv_lsid)); - return $result; -} - -# args passed in: service_instance_lsid, article_name -sub insert_collection_input { - my ($self, %args) = @_; - my $article = $args{article_name}; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - - $self->dbh->do("insert into collection_input (service_instance_id, article_name) values (?,?)", - undef, $siid, $article); - my $id=$self->dbh->{mysql_insertid}; - return $id; -} - -# pass in service_instance_lsid -sub delete_collection_input{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - - my $statement = "delete from collection_input where service_instance_id = ?"; - $self->dbh->do( $statement, undef, $siid); - - if ($self->dbh->err){ - return (1, $self->dbh->errstr); - } - else{ - return 0; - } -} - -# pass service_instance_lsid -sub query_collection_output{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - - my $statement = "select - collection_output_id, - article_name, - service_instance_id - from collection_output where service_instance_id = ? "; - my $result = do_query($dbh, $statement, ($siid)); - return $result; -} - -# pass service_instance_lsid, article_name -sub insert_collection_output { - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - $self->dbh->do("insert into collection_output (service_instance_id, article_name) values (?,?)", - undef, $siid,$args{'article_name'}); - my $id=$self->dbh->{mysql_insertid}; - return $id; -} - -# pass argument service_instance_lsid -sub delete_collection_output{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - my $statement = "delete from collection_output where service_instance_id = ?"; - my @bindvalues = (); - $dbh->do( $statement, undef, ($siid)); - - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -# pass service_instance_lsid -sub query_simple_input{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $collid = $args{collection_input_id}; - my $id_to_use = $siid?$siid:$collid; - - my $dbh = $self->dbh; - - my $statement = "select - simple_input_id, - object_type_uri, - namespace_type_uris, - article_name, - service_instance_id, - collection_input_id - from simple_input where "; - - my $condition; - $siid && ($condition = " service_instance_id = ? and collection_input_id IS NULL"); - $collid && ($condition = " collection_input_id = ?"); - $statement .= $condition; - - my $result = do_query($dbh, $statement, ($id_to_use)); - return $result; -} - -# pass service_instance_lsid, object_type_uri, namespace_type_uris, article_name, collection_input_id -sub insert_simple_input { - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - $dbh->do("insert into simple_input - (object_type_uri, - namespace_type_uris, - article_name, - service_instance_id, - collection_input_id) - values (?,?,?,?,?)", - undef, - $args{'object_type_uri'}, - $args{'namespace_type_uris'}, - $args{'article_name'}, - $siid, - $args{'collection_input_id'}); - my $id=$dbh->{mysql_insertid}; - return $id; -} - -# pass service_instance_lsid -sub delete_simple_input{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my ($collid) = $args{collection_input_id}; - my $statement1; my $statement2; - $siid && ($statement1 = "delete from simple_input where service_instance_id = ?"); - $collid && ($statement2 = "delete from simple_input where collection_input_id = ?"); - - $siid && ($dbh->do( $statement1, undef,($siid))); - $collid && ($dbh->do($statement2, undef,($collid))); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -sub delete_inputs { # this should replace all other delete_*_input - my ($self, %args) = @_; - my $dbh = $self->dbh; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $result_ids = $self->query_collection_input(service_instance_lsid => $self->lsid); - - my $statement = "delete from simple_input where service_instance_id = ?"; - - $dbh->do( $statement, undef,($siid)); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } - -} - -sub delete_output { # this should replace all other delete_*_output - -} - -# UGH this has to know too much bout the underlying database structure e.g. that one is null and other is full -# this problem is in MOBY::Central line 3321 3346 and 3374 -#****** FIX -# send service_instance_lsid, collection_input_id -sub query_simple_output{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $collid = $args{collection_output_id}; - my $dbh = $self->dbh; - my $id_to_use = $siid?$siid:$collid; - - my $statement = "select - simple_output_id, - object_type_uri, - namespace_type_uris, - article_name, - service_instance_id, - collection_output_id - from simple_output where "; - my $condition; - $siid && ($condition = " service_instance_id = ? and collection_output_id IS NULL"); - $collid && ($condition = " collection_output_id = ?"); - $statement .= $condition; - - - my $result = do_query($dbh, $statement, ($id_to_use)); - return $result; -} - -# pass args service_instance_id and collection_output_id -sub insert_simple_output { - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - - $dbh->do("insert into simple_output - (object_type_uri, - namespace_type_uris, - article_name, - service_instance_id, - collection_output_id) - values (?,?,?,?,?)", - undef,( - $args{'object_type_uri'}, - $args{'namespace_type_uris'}, - $args{'article_name'}, - $siid, - $args{'collection_output_id'})); - my $id=$dbh->{mysql_insertid}; - return $id; - -} - -# pass service_instance_id or collection_output_id -sub delete_simple_output{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my ($collid) = $args{collection_output_id}; - my $statement1; my $statement2; - $siid && ($statement1 = "delete from simple_output where service_instance_id = ?"); - $collid && ($statement2 = "delete from simple_output where collection_output_id = ?"); - - $siid && ($dbh->do( $statement1, undef,($siid))); - $collid && ($dbh->do($statement2, undef,($collid))); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -# pass service_instance_lsid -sub query_secondary_input{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - - my $statement = "select - secondary_input_id, - default_value, - maximum_value, - minimum_value, - enum_value, - datatype, - article_name, - service_instance_id - from secondary_input where service_instance_id = ?"; - my $result = do_query($dbh, $statement, ($siid)); - return $result; -} - -# pass default_value, maximum_value minimum_value enum_value datatype article_name service_instance_lsid -sub insert_secondary_input{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - $dbh->do(q{insert into secondary_input (default_value,maximum_value,minimum_value,enum_value,datatype,article_name,service_instance_id) values (?,?,?,?,?,?,?)}, - undef, - ( - $args{'default_value'}, $args{'maximum_value'}, - $args{'minimum_value'}, $args{'enum_value'}, - $args{'datatype'}, $args{'article_name'},$siid) - ); - return $dbh->{mysql_insertid}; -} - -# pass service_instance_lsid -sub delete_secondary_input{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - my $statement = "delete from secondary_input where service_instance_id=?"; - - $dbh->do( $statement, undef, ($siid)); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - - -# receives argument "type", that may be either an LSID or a type term -sub query_object { - my ($self, %args) = @_; - my $type = $args{type}; - my $condition = ""; - if ($type =~ /^urn\:lsid/){ - $condition = "where object_lsid = ?"; - } elsif ($type) { - $condition = "where object_type = ?"; - } - my $statement = "select - object_id, - object_lsid, - object_type, - description, - authority, - contact_email - from object $condition"; - - my $dbh = _getDBHandle("mobyobject"); - my $result; - if ($type){ - $result = do_query($dbh, $statement, ($type)); - } else { - $result = do_query($dbh, $statement); - } - return $result; -} - -# inserts a new tuple into object table -# pass object_type object_lsid description authority contact_email -sub insert_object{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - $dbh->do("insert into object - (object_type, - object_lsid, - description, - authority, - contact_email) - values (?,?,?,?,?)", - undef, - $args{'object_type'}, - $args{'object_lsid'}, - $args{'description'}, - $args{'authority'}, - $args{'contact_email'}); - my $id=$dbh->{mysql_insertid}; - return $id; -} - -# pass 'type' which is either an LSID or a term -sub delete_object{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $term = $args{type}; - return 0 unless $term; - my $result = $self->query_object(type => $term); - my $row = shift(@$result); - my $id = $row->{object_id}; - my $lsid = $row->{object_lsid}; - my $statement = "delete from object where object_lsid = ?"; - $dbh->do( $statement,undef, ($lsid) ); - - $self->_delete_object_term2term(id => $id); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -# pass "type" here, should be an LSID, preferably... -sub query_object_term2term{ - my ($self, %args) = @_; - my $type = $args{type}; - my $result = $self->query_object(type => $type); - my $row = shift(@$result); - my $id = $row->{object_id}; - return [{}] unless $id; - my $dbh = $self->dbh; - - my $statement = "select - assertion_id, - relationship_type, - object1_id, - object2_id, - object2_articlename - from object_term2term where object2_id = ?"; - my $result2 = do_query($dbh, $statement, ($id)); - return $result2; -} - -# pass object1_type, object2_type, object2_articlename, relationship_type -sub insert_object_term2term{ - my ($self, %args) = @_; - my $type1 = $args{object1_type}; - my $result = $self->query_object(type => $type1); - my $row = shift(@$result); - my $id1 = $row->{object_id}; - my $type2 = $args{object2_type}; - $result = $self->query_object(type => $type2); - $row = shift(@$result); - my $id2 = $row->{object_id}; - my $relationship_type = $args{relationship_type}; - my $object2_articlename = $args{object2_articlename}; - - my $dbh = $self->dbh; - $dbh->do( - q{insert into object_term2term (relationship_type, object1_id, object2_id, object2_articlename) values (?,?,?,?)}, - undef, - $relationship_type, - $id1, - $id2, - $object2_articlename - ); - - return $dbh->{mysql_insertid}; -} - -# pass object 'type' as term or lsid -# this should be a private routine, not a public one. -# SHOULD NOT BE DOCUMENTED IN THE API -sub _delete_object_term2term{ - my ($self, %args) = @_; - my $o1id = $args{id}; - return 0 unless defined($o1id); - my $dbh = $self->dbh; - my $statement = "delete from object_term2term where object1_id=?"; - $dbh->do( $statement,undef, ($o1id)); - - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -# pass servicename and authority_uri -sub query_service_existence { - my ($self, %args) = @_; - my $dbh = $self->dbh; - - my $servicename = $args{'servicename'}; - my $authURI = $args{'authority_uri'}; - my $result = $self->_query_authority(authority_uri => $authURI); - return 0 unless @$result[0]; - my $id = @$result[0]->{authority_id}; - return 0 unless $id; - my $statement = "select - service_instance_id, - category, - servicename, - service_type_uri, - authority_id, - url, - contact_email, - authoritative, - description, - signatureURL, - lsid - from service_instance where servicename = ? and authority_id = ?"; - my $final = do_query($dbh, $statement, ($servicename, $id)); - if (@$final[0]){return 1} else {return 0} - -} -# selects all the columns from service_instance table -# PAY ATTENTION to what this returns. Not auth_id but auth_uri!! -# IMPORTANT: must use quotes for the keys of the hash (eg. 'authority.authority_uri' => $value ) -sub query_service_instance { - my ($self, %args) = @_; - my $dbh = $self->dbh; - - my @args; - while (my ($k, $v) = each %args){ - push @args, ({$k => $v}, "and"); # format for the_add_condition subroutine - # but too bad won't be scalable for "or" - } - - if (keys(%args)){ pop @args;} # remove final "and" - - my $statement = "select - service_instance_id, - category, - servicename, - service_type_uri, - authority.authority_uri, - url, - service_instance.contact_email, - authoritative, - description, - signatureURL, - lsid - from service_instance, authority "; - my @bindvalues; - ($statement, @bindvalues) =_add_condition($statement, @args); - if (keys(%args)){ - $statement .= " and authority.authority_id = service_instance.authority_id"; - } else { - $statement .= " where authority.authority_id = service_instance.authority_id"; - } - my $final = do_query($dbh, $statement, @bindvalues); - return $final; -} - -# custom query for Moby::Central.pm->findService() -# hmmmmmmm.... I'm not sure that this routine should exist... -# it is redundant to the routine above, if the routine above were executed -# multiple times. I think that is the more correct (though less efficient) -# way to go, since it is "scalable" to every possible underlying data source -# ********FIX change this later... -sub match_service_type_uri{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $uri_list = $args{'service_type_uri'}; - my $statement = "select service_instance_id,category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid from service_instance where service_type_uri in ($uri_list)"; - my @bindvalues = (); - my $result = do_query($dbh, $statement, @bindvalues); - return $result; -} - -# passs........ blah blah..... -sub insert_service_instance { - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $authority_id; - if ($args{'authority_uri'}){ # need to transform URI to a row ID - my $result = $self->_query_authority(authority_uri => $args{'authority_uri'}); - return undef unless @$result[0]; - $authority_id = @$result[0]->{authority_id}; - return undef unless $authority_id; - } - - $dbh->do(q{insert into service_instance (category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid) values (?,?,?,?,?,?,?,?,?,?)}, - undef,( - $args{'category'}, - $args{'servicename'}, - $args{'service_type_uri'}, - $authority_id, - $args{'url'}, - $args{'contact_email'}, - $args{'authoritative'}, - $args{'description'}, - $args{'signatureURL'}, - $args{'lsid'})); - - my $id = $dbh->{mysql_insertid}; - return $id; -} - -# pass service_instance_lsid -sub delete_service_instance{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $statement = "delete from service_instance where lsid = ?"; - $dbh->do( $statement,undef, ($args{service_instance_lsid}) ); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -# Selects all columns EXCEPT authority_id -# pass authority_uri -sub query_authority { - my ($self, %args) = @_; - my $authURI = $args{authority_uri}; - my $dbh = $self->dbh; - - my $statement = "select - authority_common_name, - authority_uri, - contact_email - from authority where authority_uri = ?"; - my $result = do_query($dbh, $statement, ($authURI)); - return $result; -} - -# Selects all columns including authority_id -# pass authority_uri. NOTE THAT THIS IS A PRIVATE ROUTINE -# SHOULD NOT BE DOCUMENTED IN THE API -sub _query_authority { - my ($self, %args) = @_; - my $authURI = $args{authority_uri}; - my $dbh = $self->dbh; - - my $statement = "select - authority_common_name, - authority_uri, - authority_id, - contact_email - from authority where authority_uri = ?"; - my $result = do_query($dbh, $statement, ($authURI)); - return $result; -} - -# custom query routine used in Moby::Central.pm -> retrieveServiceProviders() -# no args passed -sub get_all_authorities{ - my ($self, @args) = @_; - my $dbh = $self->dbh; - my $statement = "select distinct authority_uri from authority"; - my @bindvalues = (); - my $result = do_query($dbh, $statement, @bindvalues); - return $result; -} - -# pass authority_common_name, authority_uri, contact_email, return ID of some sort -sub insert_authority{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - $dbh->do("insert into authority - (authority_common_name, - authority_uri, - contact_email) - values (?,?,?)", - undef, - ($args{'authority_common_name'}, - $args{'authority_uri'}, - $args{'contact_email'})); - my $id = $dbh->{mysql_insertid}; - return $id; -} - -# pass service_type, as term or LSID -sub query_service{ - my ($self, %args) = @_; - my $type = $args{type}; - my $condition = ""; - if ($type =~ /^urn\:lsid/){ - $condition = "where service_lsid = ?"; - } elsif ($type) { - $condition = "where service_type = ?"; - } else { - $condition = ""; - } - - my $dbh = _getDBHandle("mobyservice"); - - my $statement = "select - service_id, - service_lsid, - service_type, - description, - authority, - contact_email - from service $condition"; - my $result; - if ($type){ - $result = do_query($dbh, $statement, ($type)); - } else { - $result = do_query($dbh, $statement); - } - return $result; -} - -# pass in .... -sub insert_service{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - $dbh->do(q{insert into service (service_type, service_lsid, description, authority, contact_email) values (?,?,?,?,?)}, - undef, - ( - $args{'service_type'}, $args{'service_lsid'}, $args{'description'}, - $args{'authority'}, $args{'contact_email'} - ) - ); - return $dbh->{mysql_insertid}; -} - -# pass in 'type' as a term or lsid -sub delete_service{ - my ($self, %args) = @_; - my $type = $args{type}; - my $result = $self->query_service(type => $type); - my $row = shift(@$result); - my $id = $row->{service_id}; - my $lsid = $row->{service_lsid}; - return 0 unless $lsid; - my $dbh = $self->dbh; - my $statement = "delete from service where service_lsid = ?"; - $dbh->do( $statement, undef, ($lsid)); - $self->_delete_service_term2term(id => $id); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -sub query_service_term2term{ - my ($self, %args) = @_; - my $type = $args{type}; - my $result = $self->query_service(type => $type); - my $row = shift(@$result); - my $id = $row->{service_id}; - return [{}] unless $id; - my $dbh = $self->dbh; - - my $statement = "select - assertion_id, - relationship_type, - service1_id, - service2_id - from service_term2term where service2_id = ?"; - my $result2 = do_query($dbh, $statement, ($id)); - return $result2; -} - -#pass relationshiptype, servce1_type, service2_type -sub insert_service_term2term{ - my ($self, %args) = @_; - my $type1 = $args{service1_type}; - my $result = $self->query_service(type => $type1); - my $row = shift(@$result); - my $id1 = $row->{service_id}; - my $type2 = $args{service2_type}; - $result = $self->query_service(type => $type2); - $row = shift(@$result); - my $id2 = $row->{service_id}; - my $relationship_type = $args{relationship_type}; - - my $dbh = $self->dbh; - $dbh->do(q{insert into service_term2term (relationship_type, service1_id, service2_id) values (?,?,?)}, - undef, - ($relationship_type, - $id1, - $id2) - ); - - return $dbh->{mysql_insertid}; -} - - -# NOTE THAT THIS IS A PRIVATE FUNCTION AND SHOULD -# NOT BE DOCUMENTED IN THE API. -sub _delete_service_term2term{ - my ($self, %args) = @_; - my $id = $args{id}; - return 0 unless (defined($id)); - my $dbh = $self->dbh; - my $statement = "delete from service_term2term where service1_id=?"; - $dbh->do( $statement,undef, ($id)); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - - -sub query_relationship{ - my ($self, %args) = @_; - my $type = $args{type} || ""; -# return [{}] unless $type; - my $condition = ""; - if ($type =~ /^urn\:lsid/){ - $condition = " relationship_lsid = ? and "; - } elsif ($type) { - $condition = " relationship_type = ? and "; - } - my $ont = $args{ontology}; - - my $dbh = $self->dbh; - - my $statement = "select - relationship_id, - relationship_lsid, - relationship_type, - container, - description, - authority, - contact_email, - ontology - from relationship where $condition ontology = ?"; - - if ($type){ - return do_query($dbh, $statement, ($type, $ont)); - } else { - return do_query($dbh, $statement, ($ont)); - } -} - -sub query_namespace{ - my ($self, %args) = @_; - my $type = $args{type}; - my $condition = ""; - if ($type =~ /^urn\:lsid/){ - $condition = " where namespace_lsid = ?"; - } elsif ($type) { - $condition = " where namespace_type = ?"; - } else { - $condition = ""; - } - - my $dbh = _getDBHandle("mobynamespace"); - - my $statement = "select - namespace_id, - namespace_lsid, - namespace_type, - description, - authority, - contact_email - from namespace $condition"; - my $result; - if ($type){ - $result = do_query($dbh, $statement, ($type)); - } else { - $result = do_query($dbh, $statement); - } - return $result; -} - - -sub insert_namespace{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - $dbh->do(q{insert into namespace (namespace_type, namespace_lsid, description, authority,contact_email) values (?,?,?,?,?)}, - undef, - ( - $args{'namespace_type'}, $args{'namespace_lsid'},$args{'description'},$args{'authority'},$args{'contact_email'} - ) - ); - return $dbh->{mysql_insertid}; -} - -# pass namesapce_lsid -sub delete_namespace{ - my ($self, %args) = @_; - my $type = $args{type}; - my $result = $self->query_namespace(type => $type); - my $row = shift(@$result); - my $id = $row->{namespace_id}; - my $lsid = $row->{namespace_lsid}; - return 0 unless $lsid; - my $dbh = $self->dbh; - my $statement = "delete from namespace where namespace_lsid = ?"; - $dbh->do( $statement, undef, ($lsid)); - $self->_delete_namespace_term2term(id => $id); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -sub query_namespace_term2term{ - my ($self, %args) = @_; - my $type = $args{type}; - my $result = $self->query_namespace(type => $type); - my $row = shift(@$result); - my $id = $row->{namespace_id}; - return [{}] unless $id; - my $dbh = $self->dbh; - - my $statement = "select - assertion_id, - relationship_type, - namespace1_id, - namespace2_id - from namespace_term2term where namespace2_id = ?"; - my $result2 = do_query($dbh, $statement, ($id)); - return $result2; -} - -# PRIVATE, NOT PART OF API! -sub _delete_namespace_term2term{ - my ($self, %args) = @_; - my $id = $args{id}; - return 0 unless defined($id); - my $dbh = $self->dbh; - my $statement = "delete from namespace_term2term where namespace1_id=?"; - $dbh->do( $statement,undef, ($id)); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} -# pass type as LSID or term -sub check_object_usage{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $errorMsg = 1; - my $type = $args{type}; - return 0 unless $type; - my $result = $self->query_object(type => $type); - my $row = shift @$result; - my $lsid = $row->{object_lsid}; - - my ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join simple_input where object_type_uri = ?}, - undef, $lsid - ); - return $errorMsg - if ($id); - - ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join simple_output where object_type_uri = ?}, - undef, $lsid - ); - return $errorMsg - if ($id); - - ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join collection_input natural join simple_input where object_type_uri = ?}, - undef, $lsid - ); - return $errorMsg - if ($id); - - ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join collection_output natural join simple_output where object_type_uri = ?}, - undef, $lsid - ); - return $errorMsg - if ($id); - - return 0; -} - -# custom query routine for Moby::Central.pm -> deregisterNamespace() -sub check_namespace_usage{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $errorMsg = 1; - my $type = $args{type}; - return 0 unless $type; - my $result = $self->query_namespace(type => $type); - my $row = shift @$result; - my $lsid = $row->{namespace_lsid}; - - my $sth = $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join simple_input where INSTR(namespace_type_uris,'$lsid')" - ); - $sth->execute; - - while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { - my @nss = split ",", $ns; - foreach (@nss) { - $_ =~ s/\s//g; - my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; - return (1, $errstr) - if ( $_ eq $lsid ); - } - } - $sth = $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join simple_output where INSTR(namespace_type_uris,'$lsid')" - ); - $sth->execute; - while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { - my @nss = split ",", $ns; - foreach (@nss) { - $_ =~ s/\s//g; - my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; - return (1, $errstr) - if ( $_ eq $lsid ); - } - } - $sth = - $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join collection_input natural join simple_input where INSTR(namespace_type_uris, '$lsid')" - ); - $sth->execute; - while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { - my @nss = split ",", $ns; - foreach (@nss) { - $_ =~ s/\s//g; - my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; - return (1, $errstr) - if ( $_ eq $lsid ); - } - } - $sth = - $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join collection_output natural join simple_output where INSTR(namespace_type_uris, '$lsid')" - ); - $sth->execute; - while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { - my @nss = split ",", $ns; - foreach (@nss) { - $_ =~ s/\s//g; - my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; - return (1, $errstr) - if ( $_ eq $lsid ); - } - } - return (0, ""); -} - -# custom query routine for Moby::Central.pm -> findService() -sub check_keywords{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $param = $args{keywords}; - return ([{}]) unless (ref($param) =~ /ARRAY/); - my @keywords = @$param; - my %findme = %$param; - my $searchstring; - foreach my $kw ( @keywords ) { - $kw =~ s/\*//g; - $kw = $dbh->quote("%$kw%"); - $searchstring .= " OR description like $kw "; - } - $searchstring =~ s/OR//; # remove just the first OR in the longer statement - - my $statement = "select service_instance_id,category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid from service_instance where $searchstring"; - my @bindvalues = (); - - my $ids = do_query($dbh, $statement, @bindvalues); - return ($ids); -} - -# custom query subroutine for Moby::Central.pm->_searchForSimple() -sub find_by_simple{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $inout = $args{'inout'}; - my $ancestor_string = $args{'ancestor_string'}; - my $namespaceURIs = $args{'namespaceURIs'}; - - my $query ="select service_instance_id, namespace_type_uris from simple_$inout where object_type_uri in ($ancestor_string) and service_instance_id IS NOT NULL " - ; # if service_instance_id is null then it must be a collection input. - my $nsquery; - foreach my $ns ( @{$namespaceURIs} ) { # namespaces are already URI's - $nsquery .= " OR INSTR(namespace_type_uris, '$ns') "; - } - if ($nsquery) { - $nsquery =~ s/OR//; # just the first - $nsquery .= " OR namespace_type_uris IS NULL"; - $query .= " AND ($nsquery) "; - } - - my $result = do_query($dbh, $query, ()); - return $result; -} - -# custom query subroutine for Moby::Central.pm->_searchForCollection() -sub find_by_collection{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $inout = $args{'inout'}; - my $objectURI = $args{'objectURI'}; - my $namespaceURIs = $args{'namespaceURIs'}; - - my $query = "select - c.service_instance_id, - s.namespace_type_uris - from - simple_$inout as s, - collection_$inout as c - where - s.collection_${inout}_id IS NOT NULL - AND s.collection_${inout}_id = c.collection_${inout}_id - AND object_type_uri = '$objectURI' "; - my $nsquery; - foreach my $ns ( @{$namespaceURIs} ) { # namespaces are already URI's - $nsquery .= " OR INSTR(namespace_type_uris, '$ns') "; - } - if ($nsquery) { - $nsquery =~ s/^\sOR//; # just the first - $nsquery .= " OR namespace_type_uris IS NULL"; - $query .= " AND ($nsquery) "; # add the AND clause - } - - my $result = do_query($dbh, $query, ()); - return $result; -} - -# custom query subroutine for Moby::Central.pm->RetrieveServiceNames -sub get_service_names{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $statement = "select authority_uri, servicename from authority as a, service_instance as s where s.authority_id = a.authority_id"; - my @bindvalues = (); - - my $result = do_query($dbh, $statement, @bindvalues); - return $result; -} - -# custom query for Moby::Central.pm->_flatten -sub get_parent_terms{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - - my $type_id = $args{'relationship_type_id'}; - my $statement = " - select - OE1.term - from - OntologyEntry as OE1, - OntologyEntry as OE2, - Term2Term as TT - where - ontologyentry2_id = OE2.id - and ontologyentry1_id = OE1.id - and relationship_type_id = $type_id - and OE2.term = ?"; - - my @bindvalues = (); - push(@bindvalues, $args{'term'}); - - my $result = do_query($dbh, $statement, @bindvalues); - return $result; -} - -# custom query subroutine for selecting from object_term2term and object tables -# used in Moby::OntologyServer.pm->retrieveObject() -sub get_object_relationships{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $type = $args{type}; - return 0 unless $type; - my $result = $self->query_object(type => $type); - my $row = shift @$result; - my $id = $row->{object_id}; - - my $statement = "select - relationship_type, - object_type, - object_lsid, - description, - authority, - contact_email, - object2_articlename - from object_term2term, object - where object1_id = ? and object2_id = object_id"; - - my $result2 = do_query($dbh, $statement, ($id)); - return $result2; -} - -# relationship query for any table used in Moby::OntologyServer->_doRelationshipQuery() -# note: returns a reference to an array containing ARRAY references -sub get_relationship{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $direction = $args{'direction'}; - my $ontology = $args{'ontology'}; - my $relationship = $args{'relationship'}; # this is assumed to be an LSID - - my $type = $args{'term'}; - return 0 unless $type; - my $lsid; - if ($ontology eq "service"){ - my $result = $self->query_service(type => $type); - my $row = shift @$result; - $lsid = $row->{service_lsid}; - } else { - my $result = $self->query_object(type => $type); - my $row = shift @$result; - $lsid = $row->{object_lsid}; - } - my $defs; - my $extra_columns; - $extra_columns = ", relationship_type "; - if ($ontology eq "object"){$extra_columns .=", object2_articlename ";} - if ( $direction eq 'root' ) { - unless ( defined $relationship ) { - $defs = $self->dbh->selectall_arrayref( " - select distinct s2.${ontology}_lsid $extra_columns from - ${ontology}_term2term as t2t, - $ontology as s1, - $ontology as s2 - where - s1.${ontology}_id = t2t.${ontology}1_id and - s2.${ontology}_id = t2t.${ontology}2_id and - s1.${ontology}_lsid = ?", undef, $lsid ); # ") - } else { - $defs = $self->dbh->selectall_arrayref( " - select distinct s2.${ontology}_lsid $extra_columns from - ${ontology}_term2term as t2t, - $ontology as s1, - $ontology as s2 - where - relationship_type = ? and - s1.${ontology}_id = t2t.${ontology}1_id and - s2.${ontology}_id = t2t.${ontology}2_id and - s1.${ontology}_lsid = ?", undef, $relationship, $lsid ); # ") - } - } else { - unless ( defined $relationship ) { - $defs = $self->dbh->selectall_arrayref( " - select distinct s2.${ontology}_lsid $extra_columns from - ${ontology}_term2term as t2t, - $ontology as s1, - $ontology as s2 - where - s1.${ontology}_id = t2t.${ontology}1_id and - s2.${ontology}_id = t2t.${ontology}2_id and - s2.${ontology}_lsid = ?", undef, $lsid); # ") - } else { - $defs = $self->dbh->selectall_arrayref( " - select distinct s2.${ontology}_lsid $extra_columns from - ${ontology}_term2term as t2t, - $ontology as s1, - $ontology as s2 - where - relationship_type = ? and - s1.${ontology}_id = t2t.${ontology}1_id and - s2.${ontology}_id = t2t.${ontology}2_id and - s2.${ontology}_lsid = ?", undef, $relationship, $lsid ); # ") - } - } - return $defs; -} - -sub _checkURI { - -# my $uri = "http://www.ics.uci.edu/pub/ietf/uri/#Related"; -#print "$1, $2, $3, $4, $5, $6, $7, $8, $9" if -# $uri =~ m{^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?}; -# -#The license for this recipe is available here. -# -#Discussion: -# -#If the match is successful, a URL such as -# -#http://www.ics.uci.edu/pub/ietf/uri/#Related -# -#will be broken down into the following group match variables: -# -#$1 = http: -#$2 = http -#$3 = //www.ics.uci.edu -#$4 = www.ics.uci.edu -#$5 = /pub/ietf/uri/ -#$6 = -#$7 = -#$8 = #Related -#$9 = Related -# -#In general, this regular expression breaks a URI down into the following parts, -#as defined in the RFC: -# -#scheme = $2 -#authority = $4 -#path = $5 -#query = $7 -#fragment = $9 - -} - -sub DESTROY {} - -1; +package MOBY::Adaptor::moby::queryapi::mysql; + +use strict; +use vars qw($AUTOLOAD @ISA); +use Carp; +use MOBY::Adaptor::moby::queryapi; +use DBI; +use DBD::mysql; + +@ISA = qw{MOBY::Adaptor::moby::queryapi}; # implements the interface + +{ + #Encapsulated class data + + #___________________________________________________________ + #ATTRIBUTES + my %_attr_data = # DEFAULT ACCESSIBILITY + ( + driver => ["DBI:mysql", 'read/write'], + dbh => [undef, 'read/write'], + + ); + + #_____________________________________________________________ + + # METHODS, to operate on encapsulated class data + + # Is a specified object attribute accessible in a given mode + sub _accessible { + my ($self, $attr, $mode) = @_; + $_attr_data{$attr}[1] =~ /$mode/ + } + + # Classwide default value for a specified object attribute + sub _default_for { + my ($self, $attr) = @_; + $_attr_data{$attr}[0]; + } + + # List of names of all specified object attributes + sub _standard_keys { + keys %_attr_data; + } + + sub driver { + my ($self, $arg) = @_; + $self->{driver} = $arg if defined $arg; + return $self->{driver}; + } + sub dbh { + my ($self, $arg) = @_; + $self->{dbh} = $arg if defined $arg; + return $self->{dbh}; + } + +} + +sub _getDBHandle { + my ($ontology) = @_; + my $CONF = MOBY::Config->new; + my $adap = $CONF->getDataAdaptor(source => $ontology); + return $adap->dbh; +} + +sub new { + my ($caller, %args) = @_; + my $self = $caller->SUPER::new(%args); + + my $caller_is_obj = ref($caller); + my $class = $caller_is_obj || $caller; + + foreach my $attrname ( $self->_standard_keys ) { + if (exists $args{$attrname} && defined $args{$attrname}) { + $self->{$attrname} = $args{$attrname} } + elsif ($caller_is_obj) { + $self->{$attrname} = $caller->{$attrname} } + else { + $self->{$attrname} = $self->_default_for($attrname) } + } + + return unless $self->driver; + my $driver = $self->driver; # inherited from the adaptorI (queryapi) + my $username = $self->username; + my $password = $self->password; + my $port = $self->port; + my $url = $self->url; + my $dbname = $self->dbname; + + my ($dsn) = "$driver:$dbname:$url:$port"; + my $dbh = DBI->connect($dsn, $username, $password, {RaiseError => 1}) or die "can't connect to database"; + + + ############################################################## + unless ($dbh) { + print STDERR "Couldn't connect to the datasource \n",($self->_dump()),"\n\n"; + return undef; + } + + $self->dbh($dbh); + ############################################################# + + return undef unless $self->dbh; + return $self; + +} + +sub _add_condition{ + my ($statement, @params) = @_; + my @bindvalues = (); + my $condition = "where "; + + foreach my $param (@params ) + { + if (($param eq 'and') || ($param eq 'or')) + { + $condition .= $param . " "; + } + else + { + my %pair = %$param; + + for my $key (keys %pair) + { + if (defined $pair{$key}) + { + $condition .= $key . " = ? "; + push(@bindvalues, $pair{$key}); + } + else + { + $condition .= $key . " IS NULL " + } + } + } + } + $statement .= $condition; + return ($statement, @bindvalues); + } + +# preforms query but returns a reference to an array containing hash references +sub do_query{ + my ($dbh, $statement, @bindvalues) = @_; + my $sth = $dbh -> prepare($statement); + if (@bindvalues < 1) + { + $sth->execute; + } + else + { + $sth->execute(@bindvalues); + } + # returns an array of hash references + my $arrayHashRef = $sth->fetchall_arrayref({}); + return $arrayHashRef; +} + +sub get_value{ + my ($key, @params) = @_; + + foreach my $param (@params ) + { + my %pair = %$param; + for my $tmp (keys %pair) + { + if ($tmp eq $key){ + return $pair{$key}; + } + } + } +} + +sub _getSIIDFromLSID { + my ($self, $lsid) = @_; + my $dbh = $self->dbh; + my $sth = $dbh->prepare("select service_instance_id from service_instance where lsid = ?"); + $sth->execute($lsid); + my ($siid) = $sth->fetchrow_array(); + return $siid; +} + +# this should NOT retun a collection ID... needs more work... +# args passed in: service_lsid +sub query_collection_input{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $serv_lsid = $args{'service_instance_lsid'}; + + my $statement = "select + collection_input_id, + article_name + from collection_input as c, service_instance as si where si.service_instance_id = c.service_instance_id and si.lsid = ?"; + my $result = do_query($dbh, $statement, ($serv_lsid)); + return $result; +} + +# args passed in: service_instance_lsid, article_name +sub insert_collection_input { + my ($self, %args) = @_; + my $article = $args{article_name}; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + + $self->dbh->do("insert into collection_input (service_instance_id, article_name) values (?,?)", + undef, $siid, $article); + my $id=$self->dbh->{mysql_insertid}; + return $id; +} + +# pass in service_instance_lsid +sub delete_collection_input{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + + my $statement = "delete from collection_input where service_instance_id = ?"; + $self->dbh->do( $statement, undef, $siid); + + if ($self->dbh->err){ + return (1, $self->dbh->errstr); + } + else{ + return 0; + } +} + +# pass service_instance_lsid +sub query_collection_output{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + + my $statement = "select + collection_output_id, + article_name, + service_instance_id + from collection_output where service_instance_id = ? "; + my $result = do_query($dbh, $statement, ($siid)); + return $result; +} + +# pass service_instance_lsid, article_name +sub insert_collection_output { + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + $self->dbh->do("insert into collection_output (service_instance_id, article_name) values (?,?)", + undef, $siid,$args{'article_name'}); + my $id=$self->dbh->{mysql_insertid}; + return $id; +} + +# pass argument service_instance_lsid +sub delete_collection_output{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + my $statement = "delete from collection_output where service_instance_id = ?"; + my @bindvalues = (); + $dbh->do( $statement, undef, ($siid)); + + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +# pass service_instance_lsid +sub query_simple_input{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $collid = $args{collection_input_id}; + my $id_to_use = $siid?$siid:$collid; + + my $dbh = $self->dbh; + + my $statement = "select + simple_input_id, + object_type_uri, + namespace_type_uris, + article_name, + service_instance_id, + collection_input_id + from simple_input where "; + + my $condition; + $siid && ($condition = " service_instance_id = ? and collection_input_id IS NULL"); + $collid && ($condition = " collection_input_id = ?"); + $statement .= $condition; + + my $result = do_query($dbh, $statement, ($id_to_use)); + return $result; +} + +# pass service_instance_lsid, object_type_uri, namespace_type_uris, article_name, collection_input_id +sub insert_simple_input { + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + $dbh->do("insert into simple_input + (object_type_uri, + namespace_type_uris, + article_name, + service_instance_id, + collection_input_id) + values (?,?,?,?,?)", + undef, + $args{'object_type_uri'}, + $args{'namespace_type_uris'}, + $args{'article_name'}, + $siid, + $args{'collection_input_id'}); + my $id=$dbh->{mysql_insertid}; + return $id; +} + +# pass service_instance_lsid +sub delete_simple_input{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my ($collid) = $args{collection_input_id}; + my $statement1; my $statement2; + $siid && ($statement1 = "delete from simple_input where service_instance_id = ?"); + $collid && ($statement2 = "delete from simple_input where collection_input_id = ?"); + + $siid && ($dbh->do( $statement1, undef,($siid))); + $collid && ($dbh->do($statement2, undef,($collid))); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +sub delete_inputs { # this should replace all other delete_*_input + my ($self, %args) = @_; + my $dbh = $self->dbh; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $result_ids = $self->query_collection_input(service_instance_lsid => $self->lsid); + + my $statement = "delete from simple_input where service_instance_id = ?"; + + $dbh->do( $statement, undef,($siid)); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } + +} + +sub delete_output { # this should replace all other delete_*_output + +} + +# UGH this has to know too much bout the underlying database structure e.g. that one is null and other is full +# this problem is in MOBY::Central line 3321 3346 and 3374 +#****** FIX +# send service_instance_lsid, collection_input_id +sub query_simple_output{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $collid = $args{collection_output_id}; + my $dbh = $self->dbh; + my $id_to_use = $siid?$siid:$collid; + + my $statement = "select + simple_output_id, + object_type_uri, + namespace_type_uris, + article_name, + service_instance_id, + collection_output_id + from simple_output where "; + my $condition; + $siid && ($condition = " service_instance_id = ? and collection_output_id IS NULL"); + $collid && ($condition = " collection_output_id = ?"); + $statement .= $condition; + + + my $result = do_query($dbh, $statement, ($id_to_use)); + return $result; +} + +# pass args service_instance_id and collection_output_id +sub insert_simple_output { + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + + $dbh->do("insert into simple_output + (object_type_uri, + namespace_type_uris, + article_name, + service_instance_id, + collection_output_id) + values (?,?,?,?,?)", + undef,( + $args{'object_type_uri'}, + $args{'namespace_type_uris'}, + $args{'article_name'}, + $siid, + $args{'collection_output_id'})); + my $id=$dbh->{mysql_insertid}; + return $id; + +} + +# pass service_instance_id or collection_output_id +sub delete_simple_output{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my ($collid) = $args{collection_output_id}; + my $statement1; my $statement2; + $siid && ($statement1 = "delete from simple_output where service_instance_id = ?"); + $collid && ($statement2 = "delete from simple_output where collection_output_id = ?"); + + $siid && ($dbh->do( $statement1, undef,($siid))); + $collid && ($dbh->do($statement2, undef,($collid))); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +# pass service_instance_lsid +sub query_secondary_input{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + + my $statement = "select + secondary_input_id, + default_value, + maximum_value, + minimum_value, + enum_value, + datatype, + article_name, + service_instance_id + from secondary_input where service_instance_id = ?"; + my $result = do_query($dbh, $statement, ($siid)); + return $result; +} + +# pass default_value, maximum_value minimum_value enum_value datatype article_name service_instance_lsid +sub insert_secondary_input{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + $dbh->do(q{insert into secondary_input (default_value,maximum_value,minimum_value,enum_value,datatype,article_name,service_instance_id) values (?,?,?,?,?,?,?)}, + undef, + ( + $args{'default_value'}, $args{'maximum_value'}, + $args{'minimum_value'}, $args{'enum_value'}, + $args{'datatype'}, $args{'article_name'},$siid) + ); + return $dbh->{mysql_insertid}; +} + +# pass service_instance_lsid +sub delete_secondary_input{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + my $statement = "delete from secondary_input where service_instance_id=?"; + + $dbh->do( $statement, undef, ($siid)); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + + +# receives argument "type", that may be either an LSID or a type term +sub query_object { + my ($self, %args) = @_; + my $type = $args{type}; + my $condition = ""; + if ($type =~ /^urn\:lsid/){ + $condition = "where object_lsid = ?"; + } elsif ($type) { + $condition = "where object_type = ?"; + } + my $statement = "select + object_id, + object_lsid, + object_type, + description, + authority, + contact_email + from object $condition"; + + my $dbh = _getDBHandle("mobyobject"); + my $result; + if ($type){ + $result = do_query($dbh, $statement, ($type)); + } else { + $result = do_query($dbh, $statement); + } + return $result; +} + +# inserts a new tuple into object table +# pass object_type object_lsid description authority contact_email +sub insert_object{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + $dbh->do("insert into object + (object_type, + object_lsid, + description, + authority, + contact_email) + values (?,?,?,?,?)", + undef, + $args{'object_type'}, + $args{'object_lsid'}, + $args{'description'}, + $args{'authority'}, + $args{'contact_email'}); + my $id=$dbh->{mysql_insertid}; + return $id; +} + +# pass 'type' which is either an LSID or a term +sub delete_object{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $term = $args{type}; + return 0 unless $term; + my $result = $self->query_object(type => $term); + my $row = shift(@$result); + my $id = $row->{object_id}; + my $lsid = $row->{object_lsid}; + my $statement = "delete from object where object_lsid = ?"; + $dbh->do( $statement,undef, ($lsid) ); + + $self->_delete_object_term2term(id => $id); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +# pass "type" here, should be an LSID, preferably... +sub query_object_term2term{ + my ($self, %args) = @_; + my $type = $args{type}; + my $result = $self->query_object(type => $type); + my $row = shift(@$result); + my $id = $row->{object_id}; + return [{}] unless $id; + my $dbh = $self->dbh; + + my $statement = "select + assertion_id, + relationship_type, + object1_id, + object2_id, + object2_articlename + from object_term2term where object2_id = ?"; + my $result2 = do_query($dbh, $statement, ($id)); + return $result2; +} + +# pass object1_type, object2_type, object2_articlename, relationship_type +sub insert_object_term2term{ + my ($self, %args) = @_; + my $type1 = $args{object1_type}; + my $result = $self->query_object(type => $type1); + my $row = shift(@$result); + my $id1 = $row->{object_id}; + my $type2 = $args{object2_type}; + $result = $self->query_object(type => $type2); + $row = shift(@$result); + my $id2 = $row->{object_id}; + my $relationship_type = $args{relationship_type}; + my $object2_articlename = $args{object2_articlename}; + + my $dbh = $self->dbh; + $dbh->do( + q{insert into object_term2term (relationship_type, object1_id, object2_id, object2_articlename) values (?,?,?,?)}, + undef, + $relationship_type, + $id1, + $id2, + $object2_articlename + ); + + return $dbh->{mysql_insertid}; +} + +# pass object 'type' as term or lsid +# this should be a private routine, not a public one. +# SHOULD NOT BE DOCUMENTED IN THE API +sub _delete_object_term2term{ + my ($self, %args) = @_; + my $o1id = $args{id}; + return 0 unless defined($o1id); + my $dbh = $self->dbh; + my $statement = "delete from object_term2term where object1_id=?"; + $dbh->do( $statement,undef, ($o1id)); + + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +# pass servicename and authority_uri +sub query_service_existence { + my ($self, %args) = @_; + my $dbh = $self->dbh; + + my $servicename = $args{'servicename'}; + my $authURI = $args{'authority_uri'}; + my $result = $self->_query_authority(authority_uri => $authURI); + return 0 unless @$result[0]; + my $id = @$result[0]->{authority_id}; + return 0 unless $id; + my $statement = "select + service_instance_id, + category, + servicename, + service_type_uri, + authority_id, + url, + contact_email, + authoritative, + description, + signatureURL, + lsid + from service_instance where servicename = ? and authority_id = ?"; + my $final = do_query($dbh, $statement, ($servicename, $id)); + if (@$final[0]){return 1} else {return 0} + +} +# selects all the columns from service_instance table +# PAY ATTENTION to what this returns. Not auth_id but auth_uri!! +# IMPORTANT: must use quotes for the keys of the hash (eg. 'authority.authority_uri' => $value ) +sub query_service_instance { + my ($self, %args) = @_; + my $dbh = $self->dbh; + + my @args; + while (my ($k, $v) = each %args){ + push @args, ({$k => $v}, "and"); # format for the_add_condition subroutine + # but too bad won't be scalable for "or" + } + + if (keys(%args)){ pop @args;} # remove final "and" + + my $statement = "select + service_instance_id, + category, + servicename, + service_type_uri, + authority.authority_uri, + url, + service_instance.contact_email, + authoritative, + description, + signatureURL, + lsid + from service_instance, authority "; + my @bindvalues; + ($statement, @bindvalues) =_add_condition($statement, @args); + if (keys(%args)){ + $statement .= " and authority.authority_id = service_instance.authority_id"; + } else { + $statement .= " where authority.authority_id = service_instance.authority_id"; + } + my $final = do_query($dbh, $statement, @bindvalues); + return $final; +} + +# custom query for Moby::Central.pm->findService() +# hmmmmmmm.... I'm not sure that this routine should exist... +# it is redundant to the routine above, if the routine above were executed +# multiple times. I think that is the more correct (though less efficient) +# way to go, since it is "scalable" to every possible underlying data source +# ********FIX change this later... +sub match_service_type_uri{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $uri_list = $args{'service_type_uri'}; + my $statement = "select service_instance_id,category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid from service_instance where service_type_uri in ($uri_list)"; + my @bindvalues = (); + my $result = do_query($dbh, $statement, @bindvalues); + return $result; +} + +# passs........ blah blah..... +sub insert_service_instance { + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $authority_id; + if ($args{'authority_uri'}){ # need to transform URI to a row ID + my $result = $self->_query_authority(authority_uri => $args{'authority_uri'}); + return undef unless @$result[0]; + $authority_id = @$result[0]->{authority_id}; + return undef unless $authority_id; + } + + $dbh->do(q{insert into service_instance (category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid) values (?,?,?,?,?,?,?,?,?,?)}, + undef,( + $args{'category'}, + $args{'servicename'}, + $args{'service_type_uri'}, + $authority_id, + $args{'url'}, + $args{'contact_email'}, + $args{'authoritative'}, + $args{'description'}, + $args{'signatureURL'}, + $args{'lsid'})); + + my $id = $dbh->{mysql_insertid}; + return $id; +} + +# pass service_instance_lsid +sub delete_service_instance{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $statement = "delete from service_instance where lsid = ?"; + $dbh->do( $statement,undef, ($args{service_instance_lsid}) ); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +# Selects all columns EXCEPT authority_id +# pass authority_uri +sub query_authority { + my ($self, %args) = @_; + my $authURI = $args{authority_uri}; + my $dbh = $self->dbh; + + my $statement = "select + authority_common_name, + authority_uri, + contact_email + from authority where authority_uri = ?"; + my $result = do_query($dbh, $statement, ($authURI)); + return $result; +} + +# Selects all columns including authority_id +# pass authority_uri. NOTE THAT THIS IS A PRIVATE ROUTINE +# SHOULD NOT BE DOCUMENTED IN THE API +sub _query_authority { + my ($self, %args) = @_; + my $authURI = $args{authority_uri}; + my $dbh = $self->dbh; + + my $statement = "select + authority_common_name, + authority_uri, + authority_id, + contact_email + from authority where authority_uri = ?"; + my $result = do_query($dbh, $statement, ($authURI)); + return $result; +} + +# custom query routine used in Moby::Central.pm -> retrieveServiceProviders() +# no args passed +sub get_all_authorities{ + my ($self, @args) = @_; + my $dbh = $self->dbh; + my $statement = "select distinct authority_uri from authority"; + my @bindvalues = (); + my $result = do_query($dbh, $statement, @bindvalues); + return $result; +} + +# pass authority_common_name, authority_uri, contact_email, return ID of some sort +sub insert_authority{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + $dbh->do("insert into authority + (authority_common_name, + authority_uri, + contact_email) + values (?,?,?)", + undef, + ($args{'authority_common_name'}, + $args{'authority_uri'}, + $args{'contact_email'})); + my $id = $dbh->{mysql_insertid}; + return $id; +} + +# pass service_type, as term or LSID +sub query_service{ + my ($self, %args) = @_; + my $type = $args{type}; + my $condition = ""; + if ($type =~ /^urn\:lsid/){ + $condition = "where service_lsid = ?"; + } elsif ($type) { + $condition = "where service_type = ?"; + } else { + $condition = ""; + } + + my $dbh = _getDBHandle("mobyservice"); + + my $statement = "select + service_id, + service_lsid, + service_type, + description, + authority, + contact_email + from service $condition"; + my $result; + if ($type){ + $result = do_query($dbh, $statement, ($type)); + } else { + $result = do_query($dbh, $statement); + } + return $result; +} + +# pass in .... +sub insert_service{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + $dbh->do(q{insert into service (service_type, service_lsid, description, authority, contact_email) values (?,?,?,?,?)}, + undef, + ( + $args{'service_type'}, $args{'service_lsid'}, $args{'description'}, + $args{'authority'}, $args{'contact_email'} + ) + ); + return $dbh->{mysql_insertid}; +} + +# pass in 'type' as a term or lsid +sub delete_service{ + my ($self, %args) = @_; + my $type = $args{type}; + my $result = $self->query_service(type => $type); + my $row = shift(@$result); + my $id = $row->{service_id}; + my $lsid = $row->{service_lsid}; + return 0 unless $lsid; + my $dbh = $self->dbh; + my $statement = "delete from service where service_lsid = ?"; + $dbh->do( $statement, undef, ($lsid)); + $self->_delete_service_term2term(id => $id); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +sub query_service_term2term{ + my ($self, %args) = @_; + my $type = $args{type}; + my $result = $self->query_service(type => $type); + my $row = shift(@$result); + my $id = $row->{service_id}; + return [{}] unless $id; + my $dbh = $self->dbh; + + my $statement = "select + assertion_id, + relationship_type, + service1_id, + service2_id + from service_term2term where service2_id = ?"; + my $result2 = do_query($dbh, $statement, ($id)); + return $result2; +} + +#pass relationshiptype, servce1_type, service2_type +sub insert_service_term2term{ + my ($self, %args) = @_; + my $type1 = $args{service1_type}; + my $result = $self->query_service(type => $type1); + my $row = shift(@$result); + my $id1 = $row->{service_id}; + my $type2 = $args{service2_type}; + $result = $self->query_service(type => $type2); + $row = shift(@$result); + my $id2 = $row->{service_id}; + my $relationship_type = $args{relationship_type}; + + my $dbh = $self->dbh; + $dbh->do(q{insert into service_term2term (relationship_type, service1_id, service2_id) values (?,?,?)}, + undef, + ($relationship_type, + $id1, + $id2) + ); + + return $dbh->{mysql_insertid}; +} + + +# NOTE THAT THIS IS A PRIVATE FUNCTION AND SHOULD +# NOT BE DOCUMENTED IN THE API. +sub _delete_service_term2term{ + my ($self, %args) = @_; + my $id = $args{id}; + return 0 unless (defined($id)); + my $dbh = $self->dbh; + my $statement = "delete from service_term2term where service1_id=?"; + $dbh->do( $statement,undef, ($id)); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + + +sub query_relationship{ + my ($self, %args) = @_; + my $type = $args{type} || ""; +# return [{}] unless $type; + my $condition = ""; + if ($type =~ /^urn\:lsid/){ + $condition = " relationship_lsid = ? and "; + } elsif ($type) { + $condition = " relationship_type = ? and "; + } + my $ont = $args{ontology}; + + my $dbh = $self->dbh; + + my $statement = "select + relationship_id, + relationship_lsid, + relationship_type, + container, + description, + authority, + contact_email, + ontology + from relationship where $condition ontology = ?"; + + if ($type){ + return do_query($dbh, $statement, ($type, $ont)); + } else { + return do_query($dbh, $statement, ($ont)); + } +} + +sub query_namespace{ + my ($self, %args) = @_; + my $type = $args{type}; + my $condition = ""; + if ($type =~ /^urn\:lsid/){ + $condition = " where namespace_lsid = ?"; + } elsif ($type) { + $condition = " where namespace_type = ?"; + } else { + $condition = ""; + } + + my $dbh = _getDBHandle("mobynamespace"); + + my $statement = "select + namespace_id, + namespace_lsid, + namespace_type, + description, + authority, + contact_email + from namespace $condition"; + my $result; + if ($type){ + $result = do_query($dbh, $statement, ($type)); + } else { + $result = do_query($dbh, $statement); + } + return $result; +} + + +sub insert_namespace{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + $dbh->do(q{insert into namespace (namespace_type, namespace_lsid, description, authority,contact_email) values (?,?,?,?,?)}, + undef, + ( + $args{'namespace_type'}, $args{'namespace_lsid'},$args{'description'},$args{'authority'},$args{'contact_email'} + ) + ); + return $dbh->{mysql_insertid}; +} + +# pass namesapce_lsid +sub delete_namespace{ + my ($self, %args) = @_; + my $type = $args{type}; + my $result = $self->query_namespace(type => $type); + my $row = shift(@$result); + my $id = $row->{namespace_id}; + my $lsid = $row->{namespace_lsid}; + return 0 unless $lsid; + my $dbh = $self->dbh; + my $statement = "delete from namespace where namespace_lsid = ?"; + $dbh->do( $statement, undef, ($lsid)); + $self->_delete_namespace_term2term(id => $id); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +sub query_namespace_term2term{ + my ($self, %args) = @_; + my $type = $args{type}; + my $result = $self->query_namespace(type => $type); + my $row = shift(@$result); + my $id = $row->{namespace_id}; + return [{}] unless $id; + my $dbh = $self->dbh; + + my $statement = "select + assertion_id, + relationship_type, + namespace1_id, + namespace2_id + from namespace_term2term where namespace2_id = ?"; + my $result2 = do_query($dbh, $statement, ($id)); + return $result2; +} + +# PRIVATE, NOT PART OF API! +sub _delete_namespace_term2term{ + my ($self, %args) = @_; + my $id = $args{id}; + return 0 unless defined($id); + my $dbh = $self->dbh; + my $statement = "delete from namespace_term2term where namespace1_id=?"; + $dbh->do( $statement,undef, ($id)); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} +# pass type as LSID or term +sub check_object_usage{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $errorMsg = 1; + my $type = $args{type}; + return 0 unless $type; + my $result = $self->query_object(type => $type); + my $row = shift @$result; + my $lsid = $row->{object_lsid}; + + my ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join simple_input where object_type_uri = ?}, + undef, $lsid + ); + return $errorMsg + if ($id); + + ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join simple_output where object_type_uri = ?}, + undef, $lsid + ); + return $errorMsg + if ($id); + + ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join collection_input natural join simple_input where object_type_uri = ?}, + undef, $lsid + ); + return $errorMsg + if ($id); + + ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join collection_output natural join simple_output where object_type_uri = ?}, + undef, $lsid + ); + return $errorMsg + if ($id); + + return 0; +} + +# custom query routine for Moby::Central.pm -> deregisterNamespace() +sub check_namespace_usage{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $errorMsg = 1; + my $type = $args{type}; + return 0 unless $type; + my $result = $self->query_namespace(type => $type); + my $row = shift @$result; + my $lsid = $row->{namespace_lsid}; + + my $sth = $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join simple_input where INSTR(namespace_type_uris,'$lsid')" + ); + $sth->execute; + + while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { + my @nss = split ",", $ns; + foreach (@nss) { + $_ =~ s/\s//g; + my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; + return (1, $errstr) + if ( $_ eq $lsid ); + } + } + $sth = $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join simple_output where INSTR(namespace_type_uris,'$lsid')" + ); + $sth->execute; + while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { + my @nss = split ",", $ns; + foreach (@nss) { + $_ =~ s/\s//g; + my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; + return (1, $errstr) + if ( $_ eq $lsid ); + } + } + $sth = + $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join collection_input natural join simple_input where INSTR(namespace_type_uris, '$lsid')" + ); + $sth->execute; + while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { + my @nss = split ",", $ns; + foreach (@nss) { + $_ =~ s/\s//g; + my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; + return (1, $errstr) + if ( $_ eq $lsid ); + } + } + $sth = + $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join collection_output natural join simple_output where INSTR(namespace_type_uris, '$lsid')" + ); + $sth->execute; + while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { + my @nss = split ",", $ns; + foreach (@nss) { + $_ =~ s/\s//g; + my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; + return (1, $errstr) + if ( $_ eq $lsid ); + } + } + return (0, ""); +} + +# custom query routine for Moby::Central.pm -> findService() +sub check_keywords{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $param = $args{keywords}; + return ([{}]) unless (ref($param) =~ /ARRAY/); + my @keywords = @$param; + #my %findme = %$param; + my $searchstring; + foreach my $kw ( @keywords ) { + $kw =~ s/\*//g; + $kw = $dbh->quote("%$kw%"); + $searchstring .= " OR description like $kw "; + } + $searchstring =~ s/OR//; # remove just the first OR in the longer statement + + my $statement = "select service_instance_id,category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid from service_instance where $searchstring"; + my @bindvalues = (); + + my $ids = do_query($dbh, $statement, @bindvalues); + return ($ids); +} + +# custom query subroutine for Moby::Central.pm->_searchForSimple() +sub find_by_simple{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $inout = $args{'inout'}; + my $ancestor_string = $args{'ancestor_string'}; + my $namespaceURIs = $args{'namespaceURIs'}; + + my $query ="select service_instance_id, namespace_type_uris from simple_$inout where object_type_uri in ($ancestor_string) and service_instance_id IS NOT NULL " + ; # if service_instance_id is null then it must be a collection input. + my $nsquery; + foreach my $ns ( @{$namespaceURIs} ) { # namespaces are already URI's + $nsquery .= " OR INSTR(namespace_type_uris, '$ns') "; + } + if ($nsquery) { + $nsquery =~ s/OR//; # just the first + $nsquery .= " OR namespace_type_uris IS NULL"; + $query .= " AND ($nsquery) "; + } + + my $result = do_query($dbh, $query, ()); + return $result; +} + +# custom query subroutine for Moby::Central.pm->_searchForCollection() +sub find_by_collection{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $inout = $args{'inout'}; + my $objectURI = $args{'objectURI'}; + my $namespaceURIs = $args{'namespaceURIs'}; + + my $query = "select + c.service_instance_id, + s.namespace_type_uris + from + simple_$inout as s, + collection_$inout as c + where + s.collection_${inout}_id IS NOT NULL + AND s.collection_${inout}_id = c.collection_${inout}_id + AND object_type_uri = '$objectURI' "; + my $nsquery; + foreach my $ns ( @{$namespaceURIs} ) { # namespaces are already URI's + $nsquery .= " OR INSTR(namespace_type_uris, '$ns') "; + } + if ($nsquery) { + $nsquery =~ s/^\sOR//; # just the first + $nsquery .= " OR namespace_type_uris IS NULL"; + $query .= " AND ($nsquery) "; # add the AND clause + } + + my $result = do_query($dbh, $query, ()); + return $result; +} + +# custom query subroutine for Moby::Central.pm->RetrieveServiceNames +sub get_service_names{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $statement = "select authority_uri, servicename from authority as a, service_instance as s where s.authority_id = a.authority_id"; + my @bindvalues = (); + + my $result = do_query($dbh, $statement, @bindvalues); + return $result; +} + +# custom query for Moby::Central.pm->_flatten +sub get_parent_terms{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + + my $type_id = $args{'relationship_type_id'}; + my $statement = " + select + OE1.term + from + OntologyEntry as OE1, + OntologyEntry as OE2, + Term2Term as TT + where + ontologyentry2_id = OE2.id + and ontologyentry1_id = OE1.id + and relationship_type_id = $type_id + and OE2.term = ?"; + + my @bindvalues = (); + push(@bindvalues, $args{'term'}); + + my $result = do_query($dbh, $statement, @bindvalues); + return $result; +} + +# custom query subroutine for selecting from object_term2term and object tables +# used in Moby::OntologyServer.pm->retrieveObject() +sub get_object_relationships{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $type = $args{type}; + return 0 unless $type; + my $result = $self->query_object(type => $type); + my $row = shift @$result; + my $id = $row->{object_id}; + + my $statement = "select + relationship_type, + object_type, + object_lsid, + description, + authority, + contact_email, + object2_articlename + from object_term2term, object + where object1_id = ? and object2_id = object_id"; + + my $result2 = do_query($dbh, $statement, ($id)); + return $result2; +} + +# relationship query for any table used in Moby::OntologyServer->_doRelationshipQuery() +# note: returns a reference to an array containing ARRAY references +sub get_relationship{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $direction = $args{'direction'}; + my $ontology = $args{'ontology'}; + my $relationship = $args{'relationship'}; # this is assumed to be an LSID + + my $type = $args{'term'}; + return 0 unless $type; + my $lsid; + if ($ontology eq "service"){ + my $result = $self->query_service(type => $type); + my $row = shift @$result; + $lsid = $row->{service_lsid}; + } else { + my $result = $self->query_object(type => $type); + my $row = shift @$result; + $lsid = $row->{object_lsid}; + } + my $defs; + my $extra_columns; + $extra_columns = ", relationship_type "; + if ($ontology eq "object"){$extra_columns .=", object2_articlename ";} + if ( $direction eq 'root' ) { + unless ( defined $relationship ) { + $defs = $self->dbh->selectall_arrayref( " + select distinct s2.${ontology}_lsid $extra_columns from + ${ontology}_term2term as t2t, + $ontology as s1, + $ontology as s2 + where + s1.${ontology}_id = t2t.${ontology}1_id and + s2.${ontology}_id = t2t.${ontology}2_id and + s1.${ontology}_lsid = ?", undef, $lsid ); # ") + } else { + $defs = $self->dbh->selectall_arrayref( " + select distinct s2.${ontology}_lsid $extra_columns from + ${ontology}_term2term as t2t, + $ontology as s1, + $ontology as s2 + where + relationship_type = ? and + s1.${ontology}_id = t2t.${ontology}1_id and + s2.${ontology}_id = t2t.${ontology}2_id and + s1.${ontology}_lsid = ?", undef, $relationship, $lsid ); # ") + } + } else { + unless ( defined $relationship ) { + $defs = $self->dbh->selectall_arrayref( " + select distinct s2.${ontology}_lsid $extra_columns from + ${ontology}_term2term as t2t, + $ontology as s1, + $ontology as s2 + where + s1.${ontology}_id = t2t.${ontology}1_id and + s2.${ontology}_id = t2t.${ontology}2_id and + s2.${ontology}_lsid = ?", undef, $lsid); # ") + } else { + $defs = $self->dbh->selectall_arrayref( " + select distinct s2.${ontology}_lsid $extra_columns from + ${ontology}_term2term as t2t, + $ontology as s1, + $ontology as s2 + where + relationship_type = ? and + s1.${ontology}_id = t2t.${ontology}1_id and + s2.${ontology}_id = t2t.${ontology}2_id and + s2.${ontology}_lsid = ?", undef, $relationship, $lsid ); # ") + } + } + return $defs; +} + +sub _checkURI { + +# my $uri = "http://www.ics.uci.edu/pub/ietf/uri/#Related"; +#print "$1, $2, $3, $4, $5, $6, $7, $8, $9" if +# $uri =~ m{^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?}; +# +#The license for this recipe is available here. +# +#Discussion: +# +#If the match is successful, a URL such as +# +#http://www.ics.uci.edu/pub/ietf/uri/#Related +# +#will be broken down into the following group match variables: +# +#$1 = http: +#$2 = http +#$3 = //www.ics.uci.edu +#$4 = www.ics.uci.edu +#$5 = /pub/ietf/uri/ +#$6 = +#$7 = +#$8 = #Related +#$9 = Related +# +#In general, this regular expression breaks a URI down into the following parts, +#as defined in the RFC: +# +#scheme = $2 +#authority = $4 +#path = $5 +#query = $7 +#fragment = $9 + +} + +sub DESTROY {} + +1; From fgibbons at pub.open-bio.org Thu Sep 15 10:09:44 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Thu Sep 15 18:01:02 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509151409.j8FE9iGI019624@pub.open-bio.org> fgibbons Thu Sep 15 10:09:44 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory pub.open-bio.org:/tmp/cvs-serv19603 Added Files: RFC.html Log Message: - How to we handle changes to the API (RFCs) moby-live/Docs/MOBY-S_API RFC.html,NONE,1.1 From gss at pub.open-bio.org Wed Sep 14 18:05:49 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 15 18:01:10 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142205.j8EM5nii016998@pub.open-bio.org> gss Wed Sep 14 18:05:48 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core In directory pub.open-bio.org:/tmp/cvs-serv16973 Modified Files: .cvsignore Log Message: More to ignore moby-live/S-MOBY/ref-impl/core .cvsignore,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.cvsignore,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.cvsignore 2005/03/21 21:32:01 1.7 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.cvsignore 2005/09/14 22:05:48 1.8 @@ -1,3 +1,4 @@ classes .classpath .project +.settings From gss at pub.open-bio.org Wed Sep 14 18:06:10 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 15 18:01:12 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6ADW017093@pub.open-bio.org> gss Wed Sep 14 18:06:10 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph In directory pub.open-bio.org:/tmp/cvs-serv17011/src/org/semanticmoby/graph Modified Files: MOBYCollection.java MOBYSubject.java MOBYGraphNode.java MOBYOrderedCollection.java MOBYResizableCollection.java MOBYEnumeration.java MOBYFixedCollection.java MOBYObject.java MOBYGraph.java MOBYMappingElement.java MOBYUnorderedCollection.java Added Files: MOBYServiceSet.java MOBYPropValStmt.java CollectionWrapper.java ContainerWrapper.java MOBYService.java ListWrapper.java Removed Files: MOBYPropertyValueConstraint.java MOBYProviderSet.java MOBYDescriptor.java MOBYDocument.java MOBYOntology.java MOBYNonPositiveIntegerConstraint.java MOBYPropertyValue.java MOBYDateConstraint.java MOBYSingleElement.java MOBYIntegerConstraint.java MOBYNonNegativeIntegerConstraint.java MOBYProvider.java MOBYPropertyValueStatement.java MOBYNumericConstraint.java MOBYLiteral.java MOBYPropertyValueException.java MOBYResource.java Log Message: Major API overhaul moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph MOBYServiceSet.java,NONE,1.1 MOBYPropValStmt.java,NONE,1.1 CollectionWrapper.java,NONE,1.1 ContainerWrapper.java,NONE,1.1 MOBYService.java,NONE,1.1 ListWrapper.java,NONE,1.1 MOBYCollection.java,1.2,1.3 MOBYSubject.java,1.2,1.3 MOBYGraphNode.java,1.2,1.3 MOBYOrderedCollection.java,1.2,1.3 MOBYResizableCollection.java,1.2,1.3 MOBYEnumeration.java,1.2,1.3 MOBYFixedCollection.java,1.2,1.3 MOBYObject.java,1.2,1.3 MOBYGraph.java,1.1,1.2 MOBYMappingElement.java,1.2,1.3 MOBYUnorderedCollection.java,1.2,1.3 MOBYPropertyValueConstraint.java,1.1,NONE MOBYProviderSet.java,1.2,NONE MOBYDescriptor.java,1.2,NONE MOBYDocument.java,1.2,NONE MOBYOntology.java,1.2,NONE MOBYNonPositiveIntegerConstraint.java,1.1,NONE MOBYPropertyValue.java,1.1,NONE MOBYDateConstraint.java,1.1,NONE MOBYSingleElement.java,1.2,NONE MOBYIntegerConstraint.java,1.1,NONE MOBYNonNegativeIntegerConstraint.java,1.1,NONE MOBYProvider.java,1.2,NONE MOBYPropertyValueS! tatement.java,1.1,NONE MOBYNumericConstraint.java,1.1,NONE MOBYLiteral.java,1.1,NONE MOBYPropertyValueException.java,1.1,NONE MOBYResource.java,1.1,NONE =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYCollection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYCollection.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYCollection.java 2005/09/14 22:06:10 1.3 @@ -3,6 +3,7 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.util.iterator.ExtendedIterator; /** * A common abstract class for collections, both fixed sized and @@ -10,54 +11,61 @@ */ public abstract class MOBYCollection extends MOBYGraphNode { - /** - * A list to hold the elements of the collection - */ - protected List elements = new ArrayList(); + protected CollectionWrapper wrapper; /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements + * Creates an instance for the given model and defining statement */ - public MOBYCollection(List initialElements, Resource resource, - Model model) - { - super(resource, model); + public MOBYCollection(Model jenaModel, Statement definingStmt, + CollectionWrapper wrapper, List items) { + super(jenaModel, definingStmt); + this.wrapper = wrapper; - if (initialElements != null) { - elements.addAll(initialElements); + for (Iterator it = items.iterator(); it.hasNext();) + { + MOBYGraphNode node = (MOBYGraphNode) it.next(); + wrapper.add(node); } } /** - * Return the size of the collection. + * Returns the size of the collection. */ public int size() { - return elements.size(); + return wrapper.size(); } - + /** - * Return an iterator for traversing the elements + * Returns an iterator for traversing the elements */ - public Iterator iterator() + public ExtendedIterator iterator() { - return elements.iterator(); + return wrapper.iterator(); } - /** - * Return whether or not this object is a collection. - */ - public boolean isCollection() + public void add(MOBYGraphNode node) { - return true; + wrapper.add(node); } + /** - * Return whether or not this object is a singular element. + * Remove from the model all statements that make up this API object. + * This includes the defining statement (bnode rdf:type rdf:List), the + * statements that make up each of the nested API objects, and the + * statements that make this an RDF List, which are encapsulated in + * the Jena RDFList object. */ - public boolean isSingular() + public void removeStatements() { - return false; + ExtendedIterator it = wrapper.iterator(); + while (it.hasNext()) + { + MOBYGraphNode node = (MOBYGraphNode) it.next(); + node.removeStatements(); + } + it.close(); + wrapper.removeStatements(); } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYSubject.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYSubject.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYSubject.java 2005/09/14 22:06:10 1.3 @@ -1,12 +1,19 @@ package org.semanticmoby.graph; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + import org.semanticmoby.graph.*; +import org.semanticmoby.vocabulary.MOBY; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.Resource; +import com.hp.hpl.jena.rdf.model.Statement; +import com.hp.hpl.jena.vocabulary.RDF; /** - * An object that represents the subject of one or more mappings. In + * A class that represents the subject of one or more mappings. In * RDF graph terms, this represents a node (either blank or a resource) * that is a moby:Subject, an RDF data structure (List, Bag, Seq, Alt), * or both. @@ -23,24 +30,87 @@ { /** * The collection of direct mappings, i.e. moby:mapsTo statements - * whose subject is this. + * whose subject is this; keyed by the mapsTo statement. */ - private MOBYUnorderedCollection directMappings; + private Map directMappingStmts; - public MOBYSubject(Resource resource, MOBYFixedCollection statements, - MOBYUnorderedCollection directMappings, - MOBYCollection nestedMappings, Model underlying) + /** + * Creates an instance with the given parameters; should be called from + * parsing code. + */ + public MOBYSubject(Model jenaModel, Statement definingStmt, List propValStmts, + Map directMappingStmts, MOBYCollection nestedMappings) { - super(resource, statements, nestedMappings, underlying); - this.directMappings = directMappings; + super(jenaModel, definingStmt, propValStmts, nestedMappings); + this.directMappingStmts = directMappingStmts; } - + + /** + * Creates an instance with the given parameters; should be called + * when creating an instance from scratch (i.e. not from parsing). + */ + public MOBYSubject(Model jenaModel, Resource head, List propValStmts, + List directMappings, MOBYCollection nestedMappings) + { + super(jenaModel, + jenaModel.createStatement(head, RDF.type, MOBY.Subject), + propValStmts, nestedMappings); + + for (Iterator it = directMappings.iterator(); it.hasNext();) + { + MOBYGraphNode node = (MOBYGraphNode) it.next(); + addDirectMapping(node); + } + } + + /** + * Add the given node to the direct mappings, and add a mapsTo + * statement to the underlying model + */ + public void addDirectMapping(MOBYGraphNode node) + { + this.directMappingStmts.put( + node, + jenaModel.createStatement( + getResource(), MOBY.mapsTo, node.getResource())); + } + + /** + * Remove the given node from the direct mappings and remove the + * underlying RDF statements from the Jena model + */ + public void removeDirectMapping(MOBYGraphNode node) + { + Statement stmt = (Statement) directMappingStmts.get(node); + if (stmt != null) { + jenaModel.remove(stmt); + } + node.removeStatements(); + } + /** - * Return the collection of direct mappings, i.e. moby:mapsTo statements - * whose subject is this. + * Return an iterator over the direct mappings + */ + public Iterator getDirectMappings() + { + return directMappingStmts.keySet().iterator(); + } + + /* + * (non-Javadoc) + * @see org.semanticmoby.graph.MOBYGraphNode#removeStatements() */ - public MOBYUnorderedCollection getDirectMappings() + public void removeStatements() { - return directMappings; + super.removeStatements(); + if (directMappingStmts != null) + { + for (Iterator it = directMappingStmts.keySet().iterator(); it.hasNext();) + { + MOBYGraphNode node = (MOBYGraphNode) it.next(); + removeDirectMapping(node); + } + directMappingStmts = null; + } } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraphNode.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraphNode.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraphNode.java 2005/09/14 22:06:10 1.3 @@ -3,31 +3,88 @@ import com.hp.hpl.jena.rdf.model.*; /** - * An abstract class for nodes in an RDF graph; these nodes are either - * collections or singular elements. + * An abstract class for representing parts of a MOBY graph structure. */ -public abstract class MOBYGraphNode extends MOBYDescriptor +public abstract class MOBYGraphNode { - public MOBYGraphNode(Resource resource, Model model) + /** + * The underlying Jena model that holds the statements for this + * graph component + */ + protected Model jenaModel; + + /** + * Graph nodes all have an rdf:type statement that makes them what they + * are, with the exception of MOBYMappingElement instances, which can at + * times have no defining statement (see the discussion in the class + * documentation for MOBYMappingElement). + */ + protected Statement definingStmt; + + /** + * Creates an instance for the given model and defining statement + */ + protected MOBYGraphNode(Model jenaModel, Statement definingStmt) { - super(resource, model); + this.jenaModel = jenaModel; + this.definingStmt = definingStmt; + + if (definingStmt != null) { + jenaModel.add(definingStmt); + } } - + /** - * Return whether or not this node represents a blank node + * Returns the model that holds statements describing this component */ - public boolean isBlank() + public Model getJenaModel() { - return (resource == null) || (resource.getURI() == null); + return jenaModel; } /** - * Return whether or not this object is a collection. + * Returns the defining statement for this component */ - public abstract boolean isCollection(); + public Statement getDefiningStmt() + { + return definingStmt; + } /** - * Return whether or not this object is a singular element. + * Returns the resource that is the subject of the defining statement + * if it has one, else returns null; */ - public abstract boolean isSingular(); + public Resource getResource() + { + return (definingStmt == null) ? null : definingStmt.getSubject(); + } + + /** + * Removes the statements representing this component; subclasses should + * also call removeDefiningStatement() and call removeStatements() on all + * MOBYGraphNode instances nested within them. + */ + public abstract void removeStatements(); + + /** + * Removes and nulls out the defining statement if it has not already + * been removed and nulled out. + */ + protected void removeDefiningStatement() + { + if (definingStmt != null) + { + jenaModel.remove(definingStmt); + definingStmt = null; + } + } + + /** + * Returns the URI of the underlying resource if there is a defining + * statement, else returns null. + */ + public String getURI() + { + return (getResource() == null) ? null : getResource().getURI(); + } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYOrderedCollection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYOrderedCollection.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYOrderedCollection.java 2005/09/14 22:06:10 1.3 @@ -3,6 +3,7 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.vocabulary.RDF; /** * A class representing collections that can be resized (i.e. @@ -12,47 +13,24 @@ public class MOBYOrderedCollection extends MOBYResizableCollection { /** - * Create an instance with no elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Constructor for creating a fixed collection API object from scratch. */ - public MOBYOrderedCollection(Resource resource, - Model underlyingJenaModel) + public MOBYOrderedCollection(Model jenaModel, Resource head, List items) { - super(null, resource, underlyingJenaModel); + super(jenaModel, + jenaModel.createStatement(head, RDF.type, RDF.Seq), + new ContainerWrapper((Seq) head.as(Seq.class)), items); } /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Create an instance with the list of items */ - public MOBYOrderedCollection(List initialElements, Resource resource, - Model underlyingJenaModel) + public MOBYOrderedCollection(Model jenaModel, Statement definingStmt, + List items) { - super(initialElements, resource, underlyingJenaModel); - } - - /** - * Return the element at the given index - * @param index the zero-based index of the element to retrieve - * @return the element - */ - public Object get(int index) - { - return elements.get(index); - } - - /** - * Add the given element to the collection so that its new - * zero-based index is given index - * @param index the zero-based index at which the new element - * should be added - * @param elementToAdd the element to add - */ - public void add(int index, Object elementToAdd) - { - elements.add(index, elementToAdd); + super(jenaModel, + definingStmt, + new ContainerWrapper((Seq) definingStmt.getSubject().as(Seq.class)), + items); } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYResizableCollection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYResizableCollection.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYResizableCollection.java 2005/09/14 22:06:10 1.3 @@ -3,59 +3,23 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.util.iterator.ExtendedIterator; +import com.hp.hpl.jena.vocabulary.RDF; /** * A class representing collections that can be resized (i.e. * elements added to or removed from); such collections can be - * either ordered or unordered. + * either ordered or unordered. This corresponds to the three + * RDF container classes, namely Bag, Seq, and Alt. */ public abstract class MOBYResizableCollection extends MOBYCollection { /** - * Create an instance with no elements - * @param resource the resource node that represents this collection - * @param model the Jena model from which this is derived + * Constructor for creating a resizable collection API object from scratch. */ - public MOBYResizableCollection(Resource resource, Model model) + public MOBYResizableCollection(Model jenaModel, Statement definingStmt, + CollectionWrapper wrapper, List items) { - super(null, resource, model); - } - - /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored - */ - public MOBYResizableCollection(List initialElements, Resource resource, - Model underlyingJenaModel) - { - super(initialElements, resource, underlyingJenaModel); - } - - /** - * Add an element to the collection - * @param elementToAdd the element to add to the collection - */ - public void add(Object elementToAdd) - { - elements.add(elementToAdd); - } - - /** - * Remove an element from the collection - * @param elementToRemove the element to remove - */ - public void remove(Object elementToRemove) - { - elements.remove(elementToRemove); - } - - /** - * Remove all the elements from the collection - */ - public void clear() - { - elements.clear(); + super(jenaModel, definingStmt, wrapper, items); } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYEnumeration.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYEnumeration.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYEnumeration.java 2005/09/14 22:06:10 1.3 @@ -3,6 +3,7 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.vocabulary.RDF; /** * A class representing collections that can be resized (i.e. @@ -14,25 +15,24 @@ public class MOBYEnumeration extends MOBYUnorderedCollection { /** - * Create an instance with no elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Constructor for creating a fixed collection API object from scratch. */ - public MOBYEnumeration(Resource resource, - Model underlyingJenaModel) + public MOBYEnumeration(Model jenaModel, Resource head, List items) { - super(null, resource, underlyingJenaModel); + super(jenaModel, + jenaModel.createStatement(head, RDF.type, RDF.Alt), + new ContainerWrapper((Alt) head.as(Alt.class)), items); } /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Create an instance with the list of items */ - public MOBYEnumeration(List initialElements, Resource resource, - Model underlyingJenaModel) + public MOBYEnumeration(Model jenaModel, Statement definingStmt, + List items) { - super(initialElements, resource, underlyingJenaModel); + super(jenaModel, + definingStmt, + new ContainerWrapper((Alt) definingStmt.getSubject().as(Alt.class)), + items); } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYFixedCollection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYFixedCollection.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYFixedCollection.java 2005/09/14 22:06:10 1.3 @@ -3,32 +3,34 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.util.iterator.ExtendedIterator; +import com.hp.hpl.jena.vocabulary.RDF; /** - * A class for holding an ordered, fixed sized collection - * of objects; corresponds to an RDF List. + * A class for holding an ordered, fixed sized collection of API objects + * (subclasses of MOBYGraphNode); corresponds to an RDF List. */ public class MOBYFixedCollection extends MOBYCollection { /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements - * @param resource the resource node that represents this collection - * @param model the Jena model from which this is derived + * Constructor for creating a fixed collection API object from scratch. */ - public MOBYFixedCollection(List initialElements, Resource resource, - Model model) + public MOBYFixedCollection(Model jenaModel, Resource head, List items) { - super(initialElements, resource, model); + super(jenaModel, + jenaModel.createStatement(head, RDF.type, RDF.List), + new ListWrapper((RDFList) head.as(RDFList.class)), items); } /** - * Return the element at the given index - * @param index the zero-based index of the element to retrieve - * @return the element + * Create an instance with the list of items */ - public Object get(int index) + public MOBYFixedCollection(Model jenaModel, Statement definingStmt, + List items) { - return elements.get(index); + super(jenaModel, + definingStmt, + new ListWrapper((RDFList) definingStmt.getSubject().as(RDFList.class)), + items); } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYObject.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYObject.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYObject.java 2005/09/14 22:06:10 1.3 @@ -1,16 +1,44 @@ package org.semanticmoby.graph; +import java.util.List; + +import org.semanticmoby.vocabulary.MOBY; + import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.vocabulary.RDF; /** - * An object that represents the object of a mapping. + * A class that represents the object of one or more mappings. In + * RDF graph terms, this represents a node (either blank or a resource) + * that is a moby:Subject, an RDF data structure (List, Bag, Seq, Alt), + * or both. + *

+ * As an RDF data structure, it can have one or more elements, each + * of which can itself be either a moby:Object, an RDF data structure, + * or both. This collection of elements is returned by getNestedMappings(). */ public class MOBYObject extends MOBYMappingElement { - public MOBYObject(Resource resource, MOBYFixedCollection statements, - MOBYCollection nestedElements, Model underlying) + /** + * Creates an instance with the given parameters; should be called from + * parsing code. + */ + public MOBYObject(Model jenaModel, Statement definingStmt, + List propValStmts, MOBYCollection nestedMappings) + { + super(jenaModel, definingStmt, propValStmts, nestedMappings); + } + + /** + * Creates an instance with the given parameters; should be called + * when creating an instance from scratch (i.e. not from parsing). + */ + public MOBYObject(Model jenaModel, Resource head, List propValStmts, + MOBYCollection nestedMappings) { - super(resource, statements, nestedElements, underlying); + super(jenaModel, + jenaModel.createStatement(head, RDF.type, MOBY.Object), + propValStmts, nestedMappings); } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraph.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraph.java 2004/11/23 00:18:46 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraph.java 2005/09/14 22:06:10 1.2 @@ -1,26 +1,105 @@ package org.semanticmoby.graph; +import org.semanticmoby.vocabulary.MOBY; + import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.vocabulary.RDF; /** - * This class represents singular (i.e. not collection) subgraphs - * that have a single mapping. + * This class represents a singular (i.e. not collection) subgraph + * that has a single mapping. */ -public class MOBYGraph extends MOBYSingleElement +public class MOBYGraph extends MOBYGraphNode { + /** + * Wrapper object for the underlying subgraph pointed to by a + * hasMapping property + */ private MOBYGraphNode hasMapping; - public MOBYGraph(Resource resource, MOBYGraphNode hasMapping, Model underlying) + /** + * The statement that asserts that this graph has the mapping wrapped + * by the hasMapping instance variable + */ + private Statement hasMappingStmt; + + /** + * Creates an instance for the given model, defining statement, + * hasMapping statement, and MOBYGraphNode that was parsed from + * the value of the hasMapping statement + */ + public MOBYGraph(Model jenaModel, Statement definingStmt, + Statement hasMappingStmt, MOBYGraphNode hasMapping) { - super(resource, underlying); + super(jenaModel, definingStmt); + this.hasMappingStmt = hasMappingStmt; this.hasMapping = hasMapping; } + + /** + * Creates an instance from scratch + */ + public MOBYGraph(Model jenaModel) + { + super(jenaModel, + jenaModel.createStatement( + jenaModel.createResource(), RDF.type, MOBY.Graph)); + } + + /** + * Creates an instance from scratch, and includes an initial mapping + */ + public MOBYGraph(Model jenaModel, MOBYGraphNode hasMapping) + { + this(jenaModel); + setHasMapping(hasMapping); + } + + /** + * Sets the value of a hasMapping instance variable, and adds a hasMapping + * statement to the underlying model. + */ + public void setHasMapping(MOBYGraphNode hasMapping) + { + removeHasMapping(); + this.hasMapping = hasMapping; + hasMappingStmt = jenaModel.createStatement( + getResource(), MOBY.hasMapping, hasMapping.getResource()); + jenaModel.add(hasMappingStmt); + } + + /** + * Removes the hasMapping statement from the underlying model and nulls + * the hasMapping instance variable + */ + public void removeHasMapping() + { + if (hasMapping != null) + { + jenaModel.remove(hasMappingStmt); + hasMappingStmt = null; + hasMapping.removeStatements(); + hasMapping = null; + } + } /** - * Return the object of this graph's hasMapping property. + * Returns the object of this graph's hasMapping property. */ public MOBYGraphNode getHasMapping() { return hasMapping; } + + /* + * (non-Javadoc) + * @see org.semanticmoby.graph.MOBYGraphNode#removeStatements() + */ + public void removeStatements() + { + removeDefiningStatement(); + if (hasMapping != null) { + hasMapping.removeStatements(); + } + } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYMappingElement.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYMappingElement.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYMappingElement.java 2005/09/14 22:06:10 1.3 @@ -1,37 +1,91 @@ package org.semanticmoby.graph; - +import java.util.Iterator; +import java.util.List; import com.hp.hpl.jena.rdf.model.*; - -public class MOBYMappingElement extends MOBYSingleElement +/** + * This class represents graph nodes that are within a containing subgraph, + * which is pointed to by a hasMapping or mapsTo property. Such nodes can have + * property value setting statements (instances of MOBYPropertyValueStatement) + * associated with them. If the containing subgraph is pointed to by a + * hasMapping property, the node can optionally be an instance of moby:Subject, + * in which case its defining statement is the rdf:type statement making that + * assertion; if it is not a moby:Subject, then the defining statement is null. + * Similarly, if the containing subgraph is pointed to by a mapsTo property, + * the node can optionally be an instance of moby:Object, in which case its + * defining statement is the rdf:type statement making that assertion; if it + * is not a moby:Object, then the defining statement is null. + *

+ * Nodes represented by this class can also optionally be instances of + * collections (subclasses of MOBYCollection), in which case their collective + * nature is expressed through the nestedMappings instance variable. + */ +public abstract class MOBYMappingElement extends MOBYGraphNode { - private MOBYFixedCollection statements; - private MOBYCollection nestedElements; + /** + * Property value statements whose subjects are this node's resource + */ + private List propValStmts; - public MOBYMappingElement(Resource resource, MOBYFixedCollection statements, - MOBYCollection nestedElements, Model underlying) + /** + * A view of this node as a collection + */ + private MOBYCollection nestedMappings; + + /** + * Creates an instance with the given parameters. + */ + protected MOBYMappingElement(Model jenaModel, Statement definingStmt, + List propValStmts, MOBYCollection nestedMappings) { - super(resource, underlying); - this.statements = statements; - this.nestedElements = nestedElements; + super(jenaModel, definingStmt); + this.propValStmts = propValStmts; + this.nestedMappings = nestedMappings; } - + /** - * Return the collection of property-setting statements associated + * Returns the collection of property-setting statements associated * with this mapping element. */ - public MOBYFixedCollection getPropertyValueStatements() + public List getPropValStmts() { - return statements; + return propValStmts; } /** - * Return the collection of mappings that are nested within this + * Returns the collection of mappings that are nested within this * mapping element through its role as a data structure. */ - public MOBYCollection getNestedElements() { - return nestedElements; + public MOBYCollection getNestedMappings() + { + return nestedMappings; } - -} + + /** + * Removes the statements associated with this objects nested within + * this object. + */ + public void removeStatements() + { + removeDefiningStatement(); + if (propValStmts != null) + { + for (Iterator it = propValStmts.iterator(); it.hasNext();) + { + MOBYPropValStmt stmt = (MOBYPropValStmt) it.next(); + stmt.removeStatements(); + } + propValStmts = null; + } + if (nestedMappings != null) + { + for (Iterator it = nestedMappings.iterator(); it.hasNext();) + { + MOBYGraphNode node = (MOBYGraphNode) it.next(); + node.removeStatements(); + } + nestedMappings = null; + } + } +} \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYUnorderedCollection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYUnorderedCollection.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYUnorderedCollection.java 2005/09/14 22:06:10 1.3 @@ -3,6 +3,8 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.util.iterator.ExtendedIterator; +import com.hp.hpl.jena.vocabulary.RDF; /** * A class representing collections that can be resized (i.e. @@ -12,25 +14,33 @@ public class MOBYUnorderedCollection extends MOBYResizableCollection { /** - * Create an instance with no elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Constructor for creating a fixed collection API object from scratch. */ - public MOBYUnorderedCollection(Resource resource, - Model underlyingJenaModel) + public MOBYUnorderedCollection(Model jenaModel, Resource head, List items) { - super(null, resource, underlyingJenaModel); + super(jenaModel, + jenaModel.createStatement(head, RDF.type, RDF.Bag), + new ContainerWrapper((Bag) head.as(Bag.class)), items); } /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Create an instance with the list of items */ - public MOBYUnorderedCollection(List initialElements, Resource resource, - Model underlyingJenaModel) + public MOBYUnorderedCollection(Model jenaModel, Statement definingStmt, + List items) { - super(initialElements, resource, underlyingJenaModel); + super(jenaModel, + definingStmt, + new ContainerWrapper((Bag) definingStmt.getSubject().as(Bag.class)), + items); + } + + /** + * Constructor for creating an unordered collection API object from scratch. + */ + public MOBYUnorderedCollection(Model jenaModel, Statement definingStmt, + CollectionWrapper wrapper, List items) + { + super(jenaModel, definingStmt, wrapper, items); } } \ No newline at end of file rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYPropertyValueConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYProviderSet.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYDescriptor.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYDocument.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYOntology.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYNonPositiveIntegerConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYPropertyValue.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYDateConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYSingleElement.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYIntegerConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYNonNegativeIntegerConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYProvider.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYPropertyValueStatement.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYNumericConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYLiteral.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYPropertyValueException.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYResource.java,v: No such file or directory From gss at pub.open-bio.org Wed Sep 14 18:06:11 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 15 18:01:22 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6BPu017112@pub.open-bio.org> gss Wed Sep 14 18:06:10 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser In directory pub.open-bio.org:/tmp/cvs-serv17011/src/org/semanticmoby/parser Modified Files: Parser.java Added Files: NamespaceBasedPropertyDetector.java MOBYPropertyDetector.java Log Message: Major API overhaul moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser NamespaceBasedPropertyDetector.java,NONE,1.1 MOBYPropertyDetector.java,NONE,1.1 Parser.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser/Parser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser/Parser.java 2005/03/21 21:32:38 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser/Parser.java 2005/09/14 22:06:10 1.3 @@ -12,9 +12,9 @@ import com.hp.hpl.jena.vocabulary.*; /** - * This class is used to parse RDF models, stored as Jena2 models, into - * objects that implement interfaces from the org.semanticmoby.graph - * package. + * This class is used to parse RDF models, stored as Jena2 Model objects, + * into API wrapper objects that insulate the programmer from the details + * of RDF. */ public class Parser { @@ -28,6 +28,9 @@ */ public final static String LANGUAGE_N3 = "N3"; + private MOBYPropertyDetector propDetector = + new NamespaceBasedPropertyDetector(); + /** * Since models are stored in a single Jena model, we * segregate the single model into multiple sub-models, @@ -35,12 +38,6 @@ * plus all statements that are reachable from it. */ private List subModels = new ArrayList(); - - /** - * A map relating a property's URI to an Inference model derived from - * its base model - */ - private Map cachedPropertyModels = new HashMap(); /** * Create and return a parser for parsing an N3 file @@ -130,7 +127,7 @@ */ public Parser(Model model) { - StmtIterator it = model.listStatements(null, RDF.type, MOBY.Provider); + StmtIterator it = model.listStatements(null, RDF.type, MOBY.Service); while (it.hasNext()) { Statement stmt = it.nextStatement(); @@ -143,84 +140,86 @@ } /** - * Parse a provider from the model. If the model contains - * multiple providers, only one will be returned (at random). If - * the model is expected to contain multiple providers, then call - * parseProviders() instead to get all the providers in a + * Parse a MOBYService from the model. If the model contains multiple + * services, only one will be returned (at random), so if the model is + * expected to contain multiple services, then call parseServices() instead to get all the providers in a * MOBYCollection. */ - public MOBYProvider parseProvider() + public MOBYService parseService() + throws NonCanonicalException { - MOBYUnorderedCollection providers = parseProviders(); + List services = parseServices(); - if (providers.size() == 0) { + if (services.size() == 0) { return null; } else { - return (MOBYProvider) providers.iterator().next(); + return (MOBYService) services.iterator().next(); } } /** - * Parse and return an unordered collection of providers + * Parse and return an list of MOBYService objects */ - public MOBYUnorderedCollection parseProviders() + public List parseServices() + throws NonCanonicalException { - ArrayList providers = new ArrayList(); + ArrayList services = new ArrayList(); - // Parse each provider - // Iterator it = subModels.iterator(); while (it.hasNext()) { Model model = (Model) it.next(); - StmtIterator it2 = model.listStatements(null, RDF.type, MOBY.Provider); + StmtIterator it2 = model.listStatements(null, RDF.type, MOBY.Service); if (it2 != null) { Statement stmt = it2.nextStatement(); - Resource provider = stmt.getSubject(); - providers.add(parseProvider(provider)); + services.add(parseService(stmt)); } } - - // Create and return an unordered collection of the parsed providers - // - return new MOBYUnorderedCollection(providers, null, null); + return services; } /** - * Parse a provider starting from the given resource (i.e. a resource that - * is the subject of an rdf:type statement with object of moby:Provider) + * Parse a service starting from the given resource (i.e. a resource that + * is the subject of an rdf:type statement with object of moby:Service) */ - public MOBYProvider parseProvider(Resource provider) + public MOBYService parseService(Statement typeStmt) + throws NonCanonicalException { - Model model = provider.getModel(); + Resource headResource = typeStmt.getSubject(); + + Model model = headResource.getModel(); - // First parse the scalar properties name, oneLineDescription, and aboutURI - // - Statement nameStmt = model.getProperty(provider, MOBY.name); - Statement oneLineDescriptionStmt = model.getProperty(provider, MOBY.oneLineDescription); - Statement aboutURIStmt = model.getProperty(provider, MOBY.aboutURI); + // First parse the scalar properties + + Statement nameStmt = + model.getProperty(headResource, MOBY.name); - // A provider can have multiple operatesOn properties, each of + Statement oneLineDescriptionStmt = + model.getProperty(headResource, MOBY.oneLineDescription); + + Statement aboutURIStmt = + model.getProperty(headResource, MOBY.aboutURI); + + // A service can have multiple operatesOn properties, each of // which leads to a subgraph. Parse each of these subgraphs. - // - List operatesOn = new ArrayList(); - StmtIterator it = model.listStatements(provider, MOBY.operatesOn, (RDFNode) null); + Map operatesOn = new HashMap(); + StmtIterator it = + model.listStatements(headResource, MOBY.operatesOn, (RDFNode) null); while (it.hasNext()) { - Statement stmt = it.nextStatement(); - Resource r = (Resource) stmt.getObject(); - operatesOn.add(parseOperatesOn(r)); + Statement operatesOnStmt = it.nextStatement(); + Resource r = (Resource) operatesOnStmt.getObject(); + operatesOn.put(operatesOnStmt, parseOperatesOn(r)); } - // Create and return a new Provider object using the provider URI, name, + // Create and return a new Service object using the service URI, name, // oneLineDescription, aboutURI, and collection of operatesOn subgraphs // - return new MOBYProvider( - provider, nameStmt, oneLineDescriptionStmt, aboutURIStmt, - new MOBYUnorderedCollection(operatesOn, provider, model), - model); + return new MOBYService(model, typeStmt, nameStmt, + oneLineDescriptionStmt, + aboutURIStmt, operatesOn); } /** @@ -231,25 +230,48 @@ * each element of the data structure should be a mapping subgraph. */ private MOBYGraphNode parseOperatesOn(Resource res) + throws NonCanonicalException { Model model = res.getModel(); if (isGraph(res)) { - // The resource is a MOBY Graph, so should have exactly one + // Throw an exception if it is also a data structure + if (isDataStructure(res)) + { + throw new NonCanonicalException( + "A resource was found to be both a Graph " + + "and Data Structure", model); + } + + // The defining statement for the MOBYGraph instance + Statement typeStmt = model.listStatements( + res, RDF.type, MOBY.Graph).nextStatement(); + + // The statement that asserts the hasMapping property + Statement hasMappingStmt = model.listStatements( + res, MOBY.hasMapping, (RDFNode) null).nextStatement(); + + // Since the resource is a MOBY Graph, it should have exactly one // hasMapping property that leads to its mapping subgraph. - // Resource hasMapping = getResourcePropertyValue(res, MOBY.hasMapping); - return new MOBYGraph(res, parseHasMapping(hasMapping), model); + return new MOBYGraph(model, typeStmt, hasMappingStmt, + parseHasMapping(hasMapping)); } else { + // Throw an exception if it is also a graph + if (isGraph(res)) + { + throw new NonCanonicalException( + "A resource was found to be both a Graph " + + "and Data Structure", model); + } // The resource is a data structure, so has multiple mapping // subgraphs, each of which is headed by an element in the // data structure. Iterate through the data structure elements, // parsing a mapping subgraph from each by recursively calling // this method. - // Iterator it = iteratorFor(res); List subgraphs = new ArrayList(); while (it.hasNext()) @@ -260,7 +282,6 @@ // Create and return a collection of the subgraphs; the type // of the collection depends on the type of the passed resource - // return collectionFor(res, subgraphs); } } @@ -273,37 +294,52 @@ * each element of the data structure should be a mapped subgraph. */ private MOBYSubject parseHasMapping(Resource res) + throws NonCanonicalException { - Model model = res.getModel(); - - // Collect the properties of this subject resource that are - // subproperties of moby:Property, and create MOBY statements - // for each. - // - List statements = mobyPropertyStatementsOf(res); + Model model = res.getModel(); + + // It is *not* legal for the object of a hasMapping to be *neither* + // a Subject nor a data structure, so throw an exception if this is + // the case. + if ((! isSubject(res)) && (! isDataStructure(res))) + { + throw new NonCanonicalException( + "A hasMapping property was found to have a value that " + + "is neither a Subject nor a data structure", model); + } + + // Collect the properties of this subject that are + // meant to be filled in by the client + List propValStmts = mobyPropertyStatementsOf(res); // List of direct mappings, i.e. those related through hasMapping // properties. - // - List directMappings = new ArrayList(); + Map directMappings = new HashMap(); // List of nested hasMapping subgraphs - // List nestedMappings = new ArrayList(); + // The statement that asserts this to be of rdf:type moby:Subject. + // Since it is legal for this to not be a Subject, then the statement + // can be null + Statement typeStmt = null; + if (isSubject(res)) { + typeStmt = model.listStatements( + res, RDF.type, MOBY.Subject).nextStatement(); + // The resource is a MOBY Subject, so should have one or more // mapsTo properties that lead to its mapped subgraphs. - // List mapsTo = new ArrayList(); - StmtIterator it = model.listStatements(res, MOBY.mapsTo, (RDFNode) null); + StmtIterator it = + model.listStatements(res, MOBY.mapsTo, (RDFNode) null); while (it.hasNext()) { - Statement stmt = it.nextStatement(); - Resource mapsToSubject = stmt.getResource(); + Statement mapsToStmt = it.nextStatement(); + Resource mapsToSubject = mapsToStmt.getResource(); MOBYGraphNode object = parseMapsTo(mapsToSubject); - directMappings.add(object); + directMappings.put(object, mapsToStmt); } } @@ -313,7 +349,6 @@ // nested in each element. For each element in the data structure, // recursively call this method to create a mapping subgraph, an // save the parsed object in the nestedMappings list. - // Iterator it = iteratorFor(res); while (it.hasNext()) { @@ -322,13 +357,66 @@ } } - // Create and return a Subject to describe this hasMapping subgraph - // - return new MOBYSubject(res, - new MOBYFixedCollection(statements, res, model), - new MOBYUnorderedCollection(directMappings, res, model), - collectionFor(res, nestedMappings), - model); + return new MOBYSubject(model, typeStmt, propValStmts, directMappings, + collectionFor(res, nestedMappings)); + } + + /** + * Parse the object of an mapsTo statement, which should be a + * Subject, a data structure, or both. If the object is a Subject, + * then it should be connected to one or more mapped subgraphs through + * mapsTo properties. If the object is a data structure, then + * each element of the data structure should be a mapped subgraph. + */ + private MOBYObject parseMapsTo(Resource res) + throws NonCanonicalException + { + Model model = res.getModel(); + + // It is *not* legal for the object of a mapsTo to be *neither* + // an Object nor a data structure, so throw an exception if this is + // the case. + if ((! isObject(res)) && (! isDataStructure(res))) + { + throw new NonCanonicalException( + "A mapsTo property was found to have a value " + + "is neither an Object nor a data structure", model); + } + + // Collect the properties of this subject that are + // meant to be filled in by the client + List propValStmts = mobyPropertyStatementsOf(res); + + // List of nested Object subgraphs + List nestedObjects = new ArrayList(); + + // The statement that asserts this to be of rdf:type moby:Object. + // Since it is legal for this to not be an Object, then the statement + // can be null + Statement typeStmt = null; + + if (isObject(res)) + { + typeStmt = model.listStatements( + res, RDF.type, MOBY.Object).nextStatement(); + } + + if (isDataStructure(res)) + { + // The resource is a data structure, so has a mapping subgraph + // nested in each element. For each element in the data structure, + // recursively call this method to create a mapping subgraph, an + // save the parsed object in the nestedMappings list. + Iterator it = iteratorFor(res); + while (it.hasNext()) + { + Resource r = (Resource) it.next(); + nestedObjects.add(parseMapsTo(r)); + } + } + + return new MOBYObject(model, typeStmt, propValStmts, + collectionFor(res, nestedObjects)); } @@ -336,14 +424,15 @@ * Parse the object of a mapsTo statement, which should be an * Object, a data structure, or both. If the object is a data * structure, then each element of the data structure should - * be a mapped subgraph. + * in turn be an Object, a data structure, or both. */ + /* private MOBYObject parseMapsTo(Resource res) { - // Collect the properties of this subject resource that are - // subproperties of moby:Property, and create MOBY statements - // for each. - // + Model model = res.getModel(); + + // Collect the properties of this object that are + // meant to be filled in by the service List statements = mobyPropertyStatementsOf(res); // List of nested mapsTo statements @@ -364,14 +453,11 @@ nested.add(parseMapsTo(r)); } } - - // Create and return a new MOBYObject - // - Model model = res.getModel(); return new MOBYObject(res, new MOBYFixedCollection(statements, res, model), collectionFor(res, nested), model); } + */ /** * Return a list of statements for whom the subject is a given resource, @@ -381,86 +467,22 @@ private List mobyPropertyStatementsOf(Resource res) { // The statements to return - // List stmts = new ArrayList(); // Iterate over the statements whose subjects are the resource - // StmtIterator it = res.listProperties(); while (it.hasNext()) { Statement stmt = it.nextStatement(); - Property p = stmt.getPredicate(); - RDFNode pval = stmt.getObject(); - - // Try to retrieve a description of the property at - // its URI. - // - InfModel model = getPropertyModel(p); - - if (isMobyProperty(p, model)) + if (stmt.getObject().isAnon() && + !propDetector.isMOBYProperty(stmt.getPredicate())) { - MOBYPropertyValueStatement pvalStmt = - new MOBYPropertyValueStatement(stmt, model); - - Statement s = p.getProperty(RDFS.range); - - if ((s != null) && (s.getObject().canAs(Resource.class))) - { - Resource range = (Resource) s.getObject(); - if (range.equals(XSD.date)) { - pvalStmt.setConstraint(new MOBYDateConstraint()); - } else if (range.equals(XSD.integer)) { - pvalStmt.setConstraint(new MOBYIntegerConstraint()); - } else if (range.equals(XSD.nonNegativeInteger)) { - pvalStmt.setConstraint( - new MOBYNonNegativeIntegerConstraint()); - } else if (range.equals(XSD.nonPositiveInteger)) { - pvalStmt.setConstraint( - new MOBYNonPositiveIntegerConstraint()); - } - } - - stmts.add(pvalStmt); + stmts.add(stmt); } } return stmts; } - /** - * Get the model describing a given property by doing a GET - * on its URI, and creating an inference model from it. - */ - private InfModel getPropertyModel(Property p) - { - InfModel cachedModel = (InfModel) - cachedPropertyModels.get(p.getURI()); - - if (cachedModel == null) - { - Model model = ModelRetriever.retrieveModel(p.getURI()); - - if (model != null) - { - cachedModel = ModelFactory.createRDFSModel(model); - cachedPropertyModels.put(p.getURI(), cachedModel); - } - } - return cachedModel; - } - - /** - * Return whether or not the given property is a MOBY property. - * This will be true if there is a statement in the model saying - * that the property is an rdfs:subPropertyOf moby:Property. - */ - private boolean isMobyProperty(Property p, InfModel model) - { - return - model != null && - model.contains(p, RDFS.subPropertyOf, MOBY.Property); - } - private Resource getResourcePropertyValue(Resource subject, Property property) { Statement s = subject.getModel().getProperty(subject, property); @@ -490,21 +512,31 @@ * an RDF:Seq yields a MOBYOrderedCollection; an RDF Alt yields a * MOBYEnumeration. */ - private MOBYCollection collectionFor(Resource res, List elements) + private MOBYCollection collectionFor(Resource res, List items) { + Model model = res.getModel(); if (isList(res)) { - return new MOBYFixedCollection(elements, res, res.getModel()); + return new MOBYFixedCollection( + model, typeStatement(res, RDF.List), items); } else if (isBag(res)) { - return new MOBYUnorderedCollection(elements, res, res.getModel()); + return new MOBYUnorderedCollection( + model, typeStatement(res, RDF.Bag), items); } else if (isSeq(res)) { - return new MOBYOrderedCollection(elements, res, res.getModel()); + return new MOBYOrderedCollection( + model, typeStatement(res, RDF.Seq), items); } else if (isAlt(res)) { - return new MOBYEnumeration(elements, res, res.getModel()); + return new MOBYEnumeration( + model, typeStatement(res, RDF.Alt), items); } else { return null; } } + private Statement typeStatement(Resource subject, Resource objectType) { + return subject.getModel().listStatements( + subject, RDF.type, objectType).nextStatement(); + } + /** * Return whether or not the given resource is an RDF List */ From gss at pub.open-bio.org Wed Sep 14 18:06:11 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 15 18:01:23 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6B0i017132@pub.open-bio.org> gss Wed Sep 14 18:06:11 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv17011/src/org/semanticmoby/vocabulary Modified Files: MOBY.java Log Message: Major API overhaul moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/vocabulary MOBY.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java 2004/11/23 00:18:46 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java 2005/09/14 22:06:10 1.2 @@ -31,7 +31,7 @@ model.setNsPrefix(getNsPrefix(), getURI()); } - public static final Resource Provider = resource(getURI(), "Provider"); + public static final Resource Service = resource(getURI(), "Service"); public static final Resource Graph = resource(getURI(), "Graph"); public static final Resource Subject = resource(getURI(), "Subject"); public static final Resource Object = resource(getURI(), "Object"); From gss at pub.open-bio.org Wed Sep 14 18:06:11 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 15 18:01:24 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6BH0017151@pub.open-bio.org> gss Wed Sep 14 18:06:11 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/servlet In directory pub.open-bio.org:/tmp/cvs-serv17011/src/org/semanticmoby/servlet Modified Files: AbstractMobyServlet.java Log Message: Major API overhaul moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/servlet AbstractMobyServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java 2004/11/23 00:18:46 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java 2005/09/14 22:06:11 1.2 @@ -58,7 +58,7 @@ * in, that serves as "input" to the provider. * @return a graph containing the work product of the provider. */ - protected abstract void handleRequest(MOBYProvider requestGraph); + protected abstract void handleRequest(MOBYService requestGraph); /** * A utility method for getting a buffered reader (as returned by @@ -108,16 +108,16 @@ MOBY.GRAPH_PARAMETER_NAME, request); Parser parser = Parser.forString( graphString, Parser.LANGUAGE_RDF_XML); - MOBYProvider provider = parser.parseProvider(); + MOBYService service = parser.parseService(); // Invoke the abstract handleRequest() method in order for the // provider servlet to do whatever it does to the graph. // - handleRequest(provider); + handleRequest(service); // Send the graph back in response // - provider.serialize(out); + service.serialize(out); } catch (Throwable t) { From gss at pub.open-bio.org Wed Sep 14 18:06:55 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 15 18:01:48 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6tJN017217@pub.open-bio.org> gss Wed Sep 14 18:06:55 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools In directory pub.open-bio.org:/tmp/cvs-serv17172/src/org/semanticmoby/ref/tools Modified Files: InvocationBroker.java KeywordFinder.java KeywordList.java URIInvestigator.java KeywordQuery.java DiscoveryQuery.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools InvocationBroker.java,1.2,1.3 KeywordFinder.java,1.2,1.3 KeywordList.java,1.1,1.2 URIInvestigator.java,1.2,1.3 KeywordQuery.java,1.2,1.3 DiscoveryQuery.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/InvocationBroker.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/InvocationBroker.java 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/InvocationBroker.java 2005/09/14 22:06:55 1.3 @@ -16,7 +16,7 @@ /** * This class is used to invoke and display the results of Semantic - * MOBY providers. + * MOBY services. */ public class InvocationBroker { @@ -55,64 +55,64 @@ this.out = out; } - private String rdfxmlString(MOBYProvider provider) + private String rdfxmlString(MOBYService service) { StringWriter writer = new StringWriter(); - provider.getModel().write(writer); + service.getJenaModel().write(writer); return writer.toString(); } - private String n3String(MOBYProvider provider) + private String n3String(MOBYService service) { StringWriter writer = new StringWriter(); - provider.getModel().write(writer, "N3"); + service.getJenaModel().write(writer, "N3"); return writer.toString(); } /** - * Handle a request to invoke a provider at a given URI. - * If the provider requires inputs, and the provider has + * Handle a request to invoke a service at a given URI. + * If the service requires inputs, and the service has * a valid inputURI property, redirect to the URI that is - * the value of the property. If the provider requires input + * the value of the property. If the service requires input * and has no inputURI property, then build a simple input * GUI from scratch. *

- * If the provider doesn't require any inputs, then do an HTTP - * POST to the provider URI, passing the graph as a parameter. + * If the service doesn't require any inputs, then do an HTTP + * POST to the service URI, passing the graph as a parameter. */ - public void invokeURI(String providerURI) + public void invokeURI(String serviceURI) { - // Try to retrieve and parse a provider graph from the URI; + // Try to retrieve and parse a service graph from the URI; // on failure, print a message and return. // - MOBYProvider canonicalProvider = null; + MOBYService service = null; try { Model model = ModelFactory.createDefaultModel(); - model.read(providerURI); + model.read(serviceURI); Parser parser = new Parser(model); - canonicalProvider = parser.parseProvider(); + service = parser.parseService(); } catch (Throwable t) { - out.println("No valid provider could be found at"); - out.print(""); - out.print(" "); out.println(providerURI); out.println(""); + out.println("No valid service could be found at"); + out.print(""); + out.print(" "); out.println(serviceURI); out.println(""); return; } - if (requiresInputs(canonicalProvider)) + if (requiresInputs(service)) { - // Since the provider requires input, either redirect to its + // Since the service requires input, either redirect to its // inputURI (if it has one) or build a simple GUI for it. // try { - String inputURI = getInputURI(canonicalProvider); + String inputURI = getInputURI(service); if (inputURI == null) { - buildInputGUI(canonicalProvider); + buildInputGUI(service); } else { @@ -128,23 +128,23 @@ if (status == HttpStatus.SC_OK) { response.sendRedirect(inputURI); } else { - buildInputGUI(canonicalProvider); + buildInputGUI(service); } } } catch (Throwable t) { - buildInputGUI(canonicalProvider); + buildInputGUI(service); } } else // No input required { try { - // Invoke the provider + // Invoke the service // HTTPRequest rqst = - HTTPRequest.newPostRequest(canonicalProvider.getURI()); + HTTPRequest.newPostRequest(service.getURI()); rqst.addParameter(MOBY.GRAPH_PARAMETER_NAME, - rdfxmlString(canonicalProvider)); + rdfxmlString(service)); HTTPResponse resp = rqst.send(); // Check the status @@ -158,16 +158,16 @@ Model model = ModelFactory.createDefaultModel(); model.read(resp.getBodyAsStream(), ""); Parser parser = new Parser(model); - MOBYProvider resultsProvider = parser.parseProvider(); + MOBYService resultsService = parser.parseService(); - String outputURI = getOutputURI(resultsProvider); + String outputURI = getOutputURI(resultsService); if (outputURI == null) { // No output URI was specified, so build a generic // display of the results // - buildOutputGUI(resultsProvider); + buildOutputGUI(resultsService); } else { @@ -186,7 +186,7 @@ // by trying to invoke it. // rqst = HTTPRequest.newPostRequest(outputURI); - String graphString = rdfxmlString(resultsProvider); + String graphString = rdfxmlString(resultsService); rqst.addParameter( MOBY.GRAPH_PARAMETER_NAME, graphString); resp = rqst.send(); @@ -204,22 +204,22 @@ // The output URI returned a status other than // 200 OK, so fall back to a default output GUI // - buildOutputGUI(resultsProvider); + buildOutputGUI(resultsService); } } catch (Throwable t) { - buildOutputGUI(resultsProvider); + buildOutputGUI(resultsService); } } } else { - out.println("Sorry - an error occurred invoking the provider"); + out.println("Sorry - an error occurred invoking the service"); } } catch (Throwable t) { - out.println("Sorry - an error occurred invoking the provider"); + out.println("Sorry - an error occurred invoking the service"); return; } } @@ -243,57 +243,55 @@ dispatcher.forward(request, response); } - private String getInputURI(MOBYProvider provider) + private String getInputURI(MOBYService service) { try { - Model model = provider.getModel(); - Statement stmt = model.listStatements( - provider.getResource(), MOBY.inputURI, - (String) null).nextStatement(); + Model model = service.getJenaModel(); + Statement stmt = + model.getProperty(service.getResource(), MOBY.inputURI); return stmt.getString(); } catch (Throwable t) { return null; } } - private String getOutputURI(MOBYProvider provider) + private String getOutputURI(MOBYService service) { try { - Model model = provider.getModel(); - Statement stmt = model.listStatements( - provider.getResource(), MOBY.outputURI, - (String) null).nextStatement(); + Model model = service.getJenaModel(); + Statement stmt = + model.getProperty(service.getResource(), MOBY.outputURI); return stmt.getString(); } catch (Throwable t) { return null; } } - public void buildInputGUI(MOBYProvider provider) + public void buildInputGUI(MOBYService service) { - out.println("This provider has not provided a valid URL for"); + out.println("This service has not provided a valid URL for"); out.println("gathering its required inputs."); } - public void buildOutputGUI(MOBYProvider provider) + public void buildOutputGUI(MOBYService service) throws IOException, ServletException { HttpSession session = request.getSession(true); session.setAttribute("n3Graph", - n3String(provider) + n3String(service) .replaceAll("<", "<") .replaceAll(">", ">") .replaceAll("\"", """)); session.setAttribute("rdfxmlGraph", - rdfxmlString(provider) + rdfxmlString(service) .replaceAll("<", "<") .replaceAll(">", ">") .replaceAll("\"", """)); redirectToPage("/jsp/display.jsp"); } - private boolean requiresInputs(MOBYProvider provider) + private boolean requiresInputs(MOBYService service) { - return getInputURI(provider) != null; + return getInputURI(service) != null; } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordFinder.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordFinder.java 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordFinder.java 2005/09/14 22:06:55 1.3 @@ -12,15 +12,15 @@ public class KeywordFinder { /** - * The MOBY provider for which to find keywords + * The MOBY service for which to find keywords */ - private MOBYProvider provider; + private MOBYService service; /** - * The underlying Jena model on which the MOBY provider + * The underlying Jena model on which the MOBY service * is based */ - private Model providerModel; + private Model serviceModel; /** * A keyword list object to hold the keywords that are @@ -29,17 +29,17 @@ private KeywordList keywords = null; /** - * Construct an instance for the given provider and model + * Construct an instance for the given service and model */ - public KeywordFinder(MOBYProvider provider, Model providerModel) + public KeywordFinder(MOBYService service) { - this.provider = provider; - this.providerModel = providerModel; + this.service = service; + this.serviceModel = service.getJenaModel(); } /** * Retrieve, if necessary, and return the keywords associated - * with the provider. + * with the service. */ public KeywordList getKeywords() throws Exception @@ -53,21 +53,20 @@ } /** - * Collect keywords for the provider + * Collect keywords for the service */ private void collectKeywords() { - // Add keywords from classes that the provider is asserted to - // be an instance of (i.e. provider rdf:type ) + // Add keywords from classes that the service is asserted to + // be an instance of (i.e. service rdf:type ) // - Resource res = provider.getResource(); - keywords.addProviderKeywords(getKeywordsFor(res)); + Resource res = service.getResource(); + keywords.addServiceKeywords(getKeywordsFor(res)); // Add keywords from subjects and objects of each // operatesOn subgraph // - MOBYCollection coll = provider.getOperatesOn(); - for (Iterator it = coll.iterator(); it.hasNext();) + for (Iterator it = service.getOperatesOn(); it.hasNext();) { MOBYGraphNode node = (MOBYGraphNode) it.next(); addGraphKeywordsFor(node); @@ -104,10 +103,11 @@ MOBYSubject subject = (MOBYSubject) node; keywords.addSubjectKeywords( getKeywordsFor(subject.getResource())); - Iterator it = subject.getDirectMappings().iterator(); + Iterator it = subject.getDirectMappings(); while (it.hasNext()) { - MOBYGraphNode node2 = (MOBYGraphNode) it.next(); + Object obj = it.next(); + MOBYGraphNode node2 = (MOBYGraphNode) obj; addObjectKeywordsFor(node2); } } @@ -123,6 +123,11 @@ } } + // TODO: Note that in some cases, this doesn't work, + // when node is a MOBYObject that has no defining + // statement (see the discussion in the class doc for + // its parent class MappingObject). So, this as well + // as addSubjectKeywordsFor() needs to be fixed private void addObjectKeywordsFor(MOBYGraphNode node) { if (node instanceof MOBYObject) @@ -153,9 +158,9 @@ // Iterate over the resource's rdf:type properties // - StmtIterator it = providerModel.listStatements( - res, RDF.type, (RDFNode) null); - + StmtIterator it = + serviceModel.listStatements(res, RDF.type, (RDFNode) null); + while (it.hasNext()) { Statement s1 = it.nextStatement(); @@ -163,7 +168,7 @@ // If the value of the rdf:type property is a resource // - if (node.canAs(Resource.class)) + if ((res != null) && (node.canAs(Resource.class))) { Resource classNode = (Resource) node.as(Resource.class); @@ -188,7 +193,7 @@ } } - if (res.canAs(Bag.class)) + if ((res != null) && (res.canAs(Bag.class))) { Bag bag = (Bag) res.as(Bag.class); for (Iterator it2 = bag.iterator(); it2.hasNext();) @@ -236,40 +241,4 @@ return list; } - - public static void main(String[] args) - throws Exception - { - Model model = ModelFactory.createDefaultModel(); -// model.read("http://brebiou.cshl.org:8080/get-individuals"); - model.read("http://www.semanticmoby.org/examples/hello-world"); - Parser parser = new Parser(model); - MOBYProvider provider = parser.parseProvider(); - KeywordFinder kf = new KeywordFinder(provider, model); - KeywordList list = kf.getKeywords(); - - System.out.print("Provider keywords: "); - for (Iterator it = list.getProviderKeywords(); it.hasNext();) { - System.out.print("\""); - System.out.print(it.next().toString()); - System.out.print("\" "); - } - System.out.println(); - - System.out.print("Subject keywords: "); - for (Iterator it = list.getSubjectKeywords(); it.hasNext();) { - System.out.print("\""); - System.out.print(it.next().toString()); - System.out.print("\" "); - } - System.out.println(); - - System.out.print("Object keywords: "); - for (Iterator it = list.getObjectKeywords(); it.hasNext();) { - System.out.print("\""); - System.out.print(it.next().toString()); - System.out.print("\" "); - } - System.out.println(); - } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordList.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordList.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordList.java 2005/09/14 22:06:55 1.2 @@ -6,20 +6,20 @@ public class KeywordList { - private Set providerKeywords = new HashSet(); + private Set serviceKeywords = new HashSet(); private Set subjectKeywords = new HashSet(); private Set objectKeywords = new HashSet(); - public void addProviderKeyword(String keyword) { - providerKeywords.add(keyword); + public void addServiceKeyword(String keyword) { + serviceKeywords.add(keyword); } - public void addProviderKeywords(List keywords) { - providerKeywords.addAll(keywords); + public void addServiceKeywords(List keywords) { + serviceKeywords.addAll(keywords); } - public Iterator getProviderKeywords() { - return providerKeywords.iterator(); + public Iterator getServiceKeywords() { + return serviceKeywords.iterator(); } public void addSubjectKeyword(String keyword) { =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/URIInvestigator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/URIInvestigator.java 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/URIInvestigator.java 2005/09/14 22:06:55 1.3 @@ -16,7 +16,7 @@ import com.hp.hpl.jena.rdf.model.Model; /** - * This class is used to investigate URIs that potentially contain MOBY graphs. + * This class is used to investigate URLs that potentially contain MOBY graphs. * Multiple instances can exist, each investigating a different URL. Keeping a * map of URL->instance mappings in the instances class variable is a simple * way to prevent multiple instances from investigating the same URL at any one @@ -36,7 +36,7 @@ * The URL that is to be investigated for possible inclusion in the * metadata repository. */ - private String providerURI; + private String serviceURL; private final static Log syncLog = LogFactory.getLog("SYNC"); @@ -47,17 +47,17 @@ * investigated, then this call is a NO-OP. * @param providerURL the URL to investigate */ - public synchronized static void investigate(String providerURL) + public synchronized static void investigate(String serviceURL) { synchronized (instances) { - if (instances.get(providerURL) != null) { - syncLog.warn("Already investigating " + providerURL); + if (instances.get(serviceURL) != null) { + syncLog.warn("Already investigating " + serviceURL); return; } - URIInvestigator investigator = new URIInvestigator(providerURL); - instances.put(providerURL, investigator); + URIInvestigator investigator = new URIInvestigator(serviceURL); + instances.put(serviceURL, investigator); investigator.start(); } } @@ -66,9 +66,9 @@ * Create an instance for investingating the given provider URL * @param providerURL the URL to investigate */ - private URIInvestigator(String providerURL) + private URIInvestigator(String serviceURL) { - this.providerURI = providerURL; + this.serviceURL = serviceURL; } /** @@ -108,7 +108,7 @@ // synchronized (instances) { - instances.remove(providerURI); + instances.remove(serviceURL); } } } @@ -137,18 +137,20 @@ boolean alreadyRegistered = false; try { - lastModifiedDate = manager.getLastModifiedDate(providerURI); + lastModifiedDate = manager.getLastModifiedDate(serviceURL); alreadyRegistered = (lastModifiedDate != null); } catch (StorageException e) { - syncLog.error("Couldn't check for last modified date of provider URL " + providerURI, e); + syncLog.error( + "Couldn't check for last modified date of provider URL " + + serviceURL, e); return; } // Helper class for making the HTTP GET call // - HTTPRequest request = HTTPRequest.newGetRequest(providerURI); + HTTPRequest request = HTTPRequest.newGetRequest(serviceURL); // If there was a last modified date, then request that the graph only // be sent if it has been modified since that date @@ -170,7 +172,7 @@ } catch (HTTPException e) { - syncLog.warn("Couldn't reach suggested provider " + providerURI); + syncLog.warn("Couldn't reach suggested provider " + serviceURL); return; } @@ -181,7 +183,7 @@ // The resource has not been modified since it was // registered, so there is nothing to do but log a message. // - syncLog.info("IN-SYNC : " + providerURI); + syncLog.info("IN-SYNC : " + serviceURL); break; case HttpServletResponse.SC_NOT_FOUND: @@ -190,9 +192,9 @@ // from the database. // if (alreadyRegistered) { - deregisterProvider(manager, true); + deregisterService(manager, true); } else { - syncLog.info("IGNORED : " + providerURI + " doesn't exist"); + syncLog.info("IGNORED : " + serviceURL + " doesn't exist"); } break; @@ -203,11 +205,12 @@ // lastModifiedDate = null; - // Try to parse the Last-Modified header to store in the database + // Try to parse the Last-Modified header to store in the DB // String dateString = ""; try { - dateString = response.getHeaderValue(MOBY.LAST_MODIFIED_HEADER); + dateString = + response.getHeaderValue(MOBY.LAST_MODIFIED_HEADER); lastModifiedDate = DateParser.parseDate(dateString); } catch (HTTPException e) @@ -216,7 +219,7 @@ // retrievable, but register the graph anyway // syncLog.warn("Unable to get Last-Modified date for " - + providerURI + "; using current date"); + + serviceURL + "; using current date"); lastModifiedDate = new Date(); } catch (Throwable t) @@ -224,8 +227,9 @@ // Log a message about the last modified date not being // parsable, but register the graph anyway // - syncLog.warn("Unparsable Last-Modified date " + "(\"" + dateString + - "\") for " + providerURI + "; ignoring"); + syncLog.warn( + "Unparsable Last-Modified date " + "(\"" + dateString + + "\") for " + serviceURL + "; ignoring"); } // The client sent back a graph; so try to parse it. If the @@ -238,38 +242,41 @@ } catch (HTTPException e) { - syncLog.error("Couldn't retrieve graph from " + providerURI); + syncLog.error("Couldn't retrieve graph from " + serviceURL); return; } - MOBYProvider provider = null; + MOBYService service = null; try { Parser parser = Parser.forInputStream(in, Parser.LANGUAGE_RDF_XML); - provider = parser.parseProvider(); + service = parser.parseService(); } catch (Throwable t) { System.err.println("Parse error: " + t); } // De-register the provider, printing a removal message if - // a provider couldn't be parsed + // a service couldn't be parsed // - deregisterProvider(manager, provider==null); + deregisterService(manager, service==null); - // If a provider was parsed, then register it + // If a service was parsed, then register it // - if (provider != null) + if (service != null) { try { - manager.registerProvider(provider, lastModifiedDate); + manager.registerProvider(service, lastModifiedDate); // Log a message about successfully registering the graph: // - syncLog.info((alreadyRegistered ? "UPDATED : " : "ADDED : ") + providerURI); + syncLog.info( + (alreadyRegistered ? "UPDATED : " : "ADDED : ") + + serviceURL); } catch (StorageException e) { - syncLog.error("Error storing graph for " + providerURI, e); + syncLog.error( + "Error storing graph for " + serviceURL, e); } } @@ -280,21 +287,21 @@ // Log a message about the failed attempt to contact the URL // syncLog.error("Status " + status + " received while trying " + - "to contact provider " + providerURI); + "to contact provider " + serviceURL); break; } } - private void deregisterProvider(StorageManager manager, boolean removing) + private void deregisterService(StorageManager manager, boolean removing) { try { - manager.deregisterProvider(providerURI); + manager.deregisterProvider(serviceURL); if (removing) { - syncLog.info("REMOVED : " + providerURI); + syncLog.info("REMOVED : " + serviceURL); } } catch (StorageException e) { - syncLog.error("Unable to de-register provider " + providerURI, e); + syncLog.error("Unable to de-register provider " + serviceURL, e); } } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordQuery.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordQuery.java 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordQuery.java 2005/09/14 22:06:55 1.3 @@ -44,7 +44,7 @@ while (rs.next()) { String uri = rs.getString("provider_uri"); - MOBYProvider provider = providerAt(uri, model); + MOBYService provider = serviceAt(uri, model); if (provider != null) { matching.add(provider); } @@ -65,7 +65,7 @@ return matching; } - private MOBYProvider providerAt(String uri, Model model) + private MOBYService serviceAt(String uri, Model model) { Model providerModel = ModelFactory.createDefaultModel(); Resource provider = providerModel.createResource(uri); @@ -74,7 +74,7 @@ try { Parser parser = new Parser(providerModel); - return parser.parseProvider(); + return parser.parseService(); } catch (Throwable t) { return null; } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/DiscoveryQuery.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/DiscoveryQuery.java 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/DiscoveryQuery.java 2005/09/14 22:06:55 1.3 @@ -46,7 +46,7 @@ /** * The graph that serves as a template for providers that match. */ - private MOBYProvider queryProvider; + private MOBYService queryProvider; /** * Flag indicating which statements should be returned: URI_ONLY, @@ -65,17 +65,17 @@ */ private int lastBnodeNumber; - public static DiscoveryQuery newMinimalStmtsQuery(MOBYProvider provider) + public static DiscoveryQuery newMinimalStmtsQuery(MOBYService provider) { return new DiscoveryQuery(provider, MINIMAL_STMTS); } - public static DiscoveryQuery newQueryStmtsQuery(MOBYProvider provider) + public static DiscoveryQuery newQueryStmtsQuery(MOBYService provider) { return new DiscoveryQuery(provider, QUERY_STMTS); } - public static DiscoveryQuery newReachableStmtsQuery(MOBYProvider provider) + public static DiscoveryQuery newReachableStmtsQuery(MOBYService provider) { return new DiscoveryQuery(provider, REACHABLE_STMTS); } @@ -87,7 +87,7 @@ * @param statementsToReturn which statements should be returned: URI_ONLY, * QUERY_STMTS_ONLY, or ALL_STMTS (use the static constants on this class). */ - private DiscoveryQuery(MOBYProvider queryProvider, int statementsToReturn) + private DiscoveryQuery(MOBYService queryProvider, int statementsToReturn) { this.queryProvider = queryProvider; this.statementsToReturn = statementsToReturn; @@ -103,14 +103,14 @@ lastBnodeNumber = 0; } - public MOBYProviderSet findMatchingGraphs() + public MOBYServiceSet findMatchingGraphs() { init(); Model dbModel = null; try { - Model queryModel = ((MOBYProvider) queryProvider).getModel(); + Model queryModel = ((MOBYService) queryProvider).getJenaModel(); String queryString = buildQueryString(queryModel); StorageManager manager = new StorageManager(); dbModel = manager.openDBModel(); @@ -128,14 +128,14 @@ } results.close(); - MOBYProviderSet returnSet = new MOBYProviderSet(); + MOBYServiceSet returnSet = new MOBYServiceSet(); for (Iterator it = matching.iterator(); it.hasNext();) { Object next = it.next(); - MOBYProvider mp = buildGraphModel(dbModel, + MOBYService mp = buildGraphModel(dbModel, queryModel, (ResultBinding) next); - returnSet.addProvider(mp); + returnSet.addService(mp); } return returnSet; @@ -244,8 +244,9 @@ * @param binding bindings for variables * @return */ - private MOBYProvider buildGraphModel( + private MOBYService buildGraphModel( Model dbModel, Model queryModel, ResultBinding binding) + throws NonCanonicalException { // Create a default model to return // @@ -279,7 +280,7 @@ // Parse and return a MOBY provider using the adjusted model // Parser parser = new Parser(adjusted); - return parser.parseProvider(); + return parser.parseService(); } /** @@ -319,7 +320,7 @@ // try { Statement providerTypeStmt = original.listStatements( - null, RDF.type, MOBY.Provider).nextStatement(); + null, RDF.type, MOBY.Service).nextStatement(); minimal.add(providerTypeStmt); Resource subject = providerTypeStmt.getSubject(); @@ -370,7 +371,7 @@ // try { Statement providerTypeStmt = original.listStatements( - null, RDF.type, MOBY.Provider).nextStatement(); + null, RDF.type, MOBY.Service).nextStatement(); Resource subject = providerTypeStmt.getSubject(); Util.addReachableStmts(dbModel, reachable, subject, subject.getURI()); } From gss at pub.open-bio.org Wed Sep 14 18:06:55 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 15 18:01:49 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6tpn017240@pub.open-bio.org> gss Wed Sep 14 18:06:55 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev In directory pub.open-bio.org:/tmp/cvs-serv17172/src/org/semanticmoby/ref/servlets/dev Modified Files: MOBYGraphValidationServlet.java ProviderListServlet.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev MOBYGraphValidationServlet.java,1.1,1.2 ProviderListServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/MOBYGraphValidationServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/MOBYGraphValidationServlet.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/MOBYGraphValidationServlet.java 2005/09/14 22:06:55 1.2 @@ -1,6 +1,7 @@ package org.semanticmoby.ref.servlets.dev; import org.semanticmoby.graph.*; +import org.semanticmoby.parser.NonCanonicalException; import org.semanticmoby.parser.Parser; import org.semanticmoby.ref.servlets.BaseServlet; import org.semanticmoby.servlet.*; @@ -28,18 +29,18 @@ StringReader reader = new StringReader(graphString); baseModel.read(reader, null); Parser parser = new Parser(baseModel); - parser.parseProvider(); + parser.parseService(); out.println("Model is canonical"); } catch (ParameterException e) { response.sendError(HttpServletResponse.SC_NOT_ACCEPTABLE, e.getMessage()); } -// catch (NonCanonicalException e) -// { -// out.println("Model failed canonicality test:"); -// out.println(e); -// } + catch (NonCanonicalException e) + { + out.println("Model failed canonicality test:"); + out.println(e); + } catch (IllegalArgumentException e) {} } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/ProviderListServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/ProviderListServlet.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/ProviderListServlet.java 2005/09/14 22:06:55 1.2 @@ -23,7 +23,7 @@ Model dbModel = manager.openDBModel(); int count = 0; StmtIterator it = dbModel.listStatements( - null, RDF.type, MOBY.Provider); + null, RDF.type, MOBY.Service); while (it.hasNext()) { Statement stmt = it.nextStatement(); From gss at pub.open-bio.org Wed Sep 14 18:06:56 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 15 18:01:51 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6uZY017260@pub.open-bio.org> gss Wed Sep 14 18:06:55 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/db In directory pub.open-bio.org:/tmp/cvs-serv17172/src/org/semanticmoby/ref/tools/db Modified Files: StorageManager.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/db StorageManager.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/db/StorageManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/db/StorageManager.java 2005/03/21 21:42:02 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/db/StorageManager.java 2005/09/14 22:06:55 1.3 @@ -52,16 +52,16 @@ * are in the provider graph's namespace will be stored in the global repository, * and all statements from the provider graph are stored in a separate model * that has as its name the fully expanded URI of the provider. - * @param provider the Provider to store + * @param service the Provider to store * @param lastModifiedDate when the graph was last modified * @throws StorageException if unable to access the database */ - public void registerProvider(MOBYProvider provider, Date lastModifiedDate) + public void registerProvider(MOBYService service, Date lastModifiedDate) throws StorageException { - Model model = ((MOBYProvider) provider).getModel(); + Model model = service.getJenaModel(); Model dbModel = null; - String uriString = provider.getResource().getURI(); + String uriString = service.getResource().getURI(); Resource uri = model.createResource(uriString); try @@ -103,8 +103,8 @@ // Add keywords associated with the provider // - KeywordFinder finder = new KeywordFinder(provider, model); - addKeywords(provider.getResource().getURI(), + KeywordFinder finder = new KeywordFinder(service); + addKeywords(service.getResource().getURI(), finder.getKeywords(), dbModel); // Commit the transaction on the database model @@ -134,7 +134,7 @@ java.sql.Statement sql = conn.createStatement(); - doAddKeywords(providerURI, list.getProviderKeywords(), "P", sql); + doAddKeywords(providerURI, list.getServiceKeywords(), "P", sql); doAddKeywords(providerURI, list.getSubjectKeywords(), "S", sql); doAddKeywords(providerURI, list.getObjectKeywords(), "O", sql); From gss at pub.open-bio.org Wed Sep 14 18:06:56 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 15 18:01:52 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6uRt017287@pub.open-bio.org> gss Wed Sep 14 18:06:55 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets In directory pub.open-bio.org:/tmp/cvs-serv17172/src/org/semanticmoby/ref/servlets Modified Files: DiscoveryServlet.java KeywordSearchServlet.java ResultsDisplayServlet.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets DiscoveryServlet.java,1.1,1.2 KeywordSearchServlet.java,1.2,1.3 ResultsDisplayServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/DiscoveryServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/DiscoveryServlet.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/DiscoveryServlet.java 2005/09/14 22:06:55 1.2 @@ -44,7 +44,7 @@ // Parse the query graph into a MOBYGraph object // Parser parser = Parser.forString(graphString, Parser.LANGUAGE_RDF_XML); - MOBYProvider provider = parser.parseProvider(); + MOBYService service = parser.parseService(); // Find which statements the user wishes to have returned // @@ -59,14 +59,14 @@ DiscoveryQuery q = null; if (statements.equalsIgnoreCase("minimal")) { - q = DiscoveryQuery.newMinimalStmtsQuery(provider); + q = DiscoveryQuery.newMinimalStmtsQuery(service); } else if (statements.equalsIgnoreCase("query")) { - q = DiscoveryQuery.newQueryStmtsQuery(provider); + q = DiscoveryQuery.newQueryStmtsQuery(service); } else { - q = DiscoveryQuery.newReachableStmtsQuery(provider); + q = DiscoveryQuery.newReachableStmtsQuery(service); } - MOBYProviderSet matching = q.findMatchingGraphs(); + MOBYServiceSet matching = q.findMatchingGraphs(); if ((matching == null) || (matching.size() == 0)) { =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java 2005/03/21 21:42:02 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java 2005/09/14 22:06:55 1.3 @@ -60,7 +60,7 @@ { for (Iterator it = matching.iterator(); it.hasNext();) { - MOBYProvider p = (MOBYProvider) it.next(); + MOBYService p = (MOBYService) it.next(); showProvider(p, out); } } @@ -171,7 +171,7 @@ /** * Show a provider that matches the keyword search criteria. */ - private void showProvider(MOBYProvider provider, PrintStream out) + private void showProvider(MOBYService provider, PrintStream out) { String uri = provider.getResource().getURI(); String name = provider.getName(); =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/ResultsDisplayServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/ResultsDisplayServlet.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/ResultsDisplayServlet.java 2005/09/14 22:06:55 1.2 @@ -5,7 +5,7 @@ import javax.servlet.*; import javax.servlet.http.*; -import org.semanticmoby.graph.MOBYProvider; +import org.semanticmoby.graph.MOBYService; import org.semanticmoby.parser.Parser; import org.semanticmoby.ref.tools.*; import org.semanticmoby.servlet.*; @@ -27,14 +27,14 @@ MOBY.GRAPH_PARAMETER_NAME, request); Parser parser = Parser.forString( graphString, Parser.LANGUAGE_RDF_XML); - MOBYProvider provider = parser.parseProvider(); + MOBYService service = parser.parseService(); response.setContentType("text/html"); startHTML(response, "Semantic MOBY results display", out); InvocationBroker broker = new InvocationBroker(this, request, response, out); - broker.buildOutputGUI(provider); + broker.buildOutputGUI(service); finishHTML(out); } catch (Throwable t) From gss at pub.open-bio.org Wed Sep 14 18:06:56 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 15 18:01:56 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6uXH017310@pub.open-bio.org> gss Wed Sep 14 18:06:56 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/example In directory pub.open-bio.org:/tmp/cvs-serv17172/src/org/semanticmoby/ref/servlets/example Modified Files: HelloWorldServlet.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/example HelloWorldServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/example/HelloWorldServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/example/HelloWorldServlet.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/example/HelloWorldServlet.java 2005/09/14 22:06:56 1.2 @@ -26,24 +26,21 @@ return getFileReader(DESCRIPTION_GRAPH_FILE); } - protected void handleRequest(MOBYProvider provider) + protected void handleRequest(MOBYService service) { try { - MOBYGraph graph = (MOBYGraph) - provider.getOperatesOn().iterator().next(); + MOBYGraph graph = (MOBYGraph) service.getOperatesOn().next(); MOBYSubject subject = (MOBYSubject) graph.getHasMapping(); MOBYObject object = (MOBYObject) - subject.getDirectMappings().iterator().next(); + subject.getDirectMappings().next(); - MOBYPropertyValueStatement stmt = (MOBYPropertyValueStatement) - object.getPropertyValueStatements().iterator().next(); + MOBYPropValStmt stmt = (MOBYPropValStmt) + object.getPropValStmts().iterator().next(); - stmt.setPropertyValue( - new MOBYLiteral("Hello, world!")); - + stmt.getDefiningStmt().changeObject("Hello, world!"); } // Silently ignore graphs without the required form catch (Throwable t) {} From gss at pub.open-bio.org Wed Sep 14 18:06:56 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 15 18:01:57 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6uk3017329@pub.open-bio.org> gss Wed Sep 14 18:06:56 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org In directory pub.open-bio.org:/tmp/cvs-serv17172 Modified Files: .mymetadata Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org .mymetadata,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/.mymetadata,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/.mymetadata 2005/03/21 21:40:30 1.4 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/.mymetadata 2005/09/14 22:06:56 1.5 @@ -1,13 +1,13 @@ - + - - - - - + type="WEB" + name="semanticmoby.org" + id="myeclipse.1109704976982" + context-root="/semanticmoby.org" + j2ee-spec="1.4" + archive="semanticmoby.org.war"> + + + + + From gss at pub.open-bio.org Wed Sep 14 18:06:57 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 15 18:02:00 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6v6q017373@pub.open-bio.org> gss Wed Sep 14 18:06:57 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org In directory pub.open-bio.org:/tmp/cvs-serv17344 Modified Files: .mymetadata .classpath Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org .mymetadata,1.1,1.2 .classpath,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.mymetadata,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.mymetadata 2005/01/26 18:51:47 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.mymetadata 2005/09/14 22:06:57 1.2 @@ -1,13 +1,13 @@ - + - - - - - + type="WEB" + name="brebiou.cshl.org" + id="myeclipse.1089924010313" + context-root="/brebiou.cshl.org" + j2ee-spec="1.3" + archive="brebiou.cshl.org.war"> + + + + + =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.classpath,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.classpath 2005/01/26 18:51:47 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.classpath 2005/09/14 22:06:57 1.2 @@ -4,21 +4,16 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + From gss at pub.open-bio.org Wed Sep 14 18:06:57 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 15 18:02:04 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6vPP017396@pub.open-bio.org> gss Wed Sep 14 18:06:57 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv17344/WebRoot Modified Files: get-individuals.rdf get-individuals.n3 Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot get-individuals.rdf,1.1,1.2 get-individuals.n3,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.rdf,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.rdf 2005/01/26 18:51:48 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.rdf 2005/09/14 22:06:57 1.2 @@ -6,29 +6,30 @@ xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > + + + + + + http://brebiou.cshl.org:8080/get-individuals.html - Retrieve all individuals for a panel - + get-individuals - - - + + + - - + + - - + + - - - - \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.n3,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.n3 2005/01/26 18:51:48 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.n3 2005/09/14 22:06:57 1.2 @@ -7,7 +7,7 @@ @prefix cshlterms: . cshl:get-individuals - a moby:Provider ; + a moby:Service ; moby:name "get-individuals" ; moby:oneLineDescription "Retrieve all individuals for a panel" ; moby:inputURI "http://brebiou.cshl.org:8080/get-individuals.html" ; @@ -19,7 +19,7 @@ moby:mapsTo [ a rdf:Bag ; rdf:_1 [ - a cshlterms:Individual ; + a moby:Object, cshlterms:Individual ; cshlterms:individualName [] ] ] From gss at pub.open-bio.org Wed Sep 14 18:06:57 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 15 18:02:05 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6vt1017416@pub.open-bio.org> gss Wed Sep 14 18:06:57 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/src/org/cshl/servlets In directory pub.open-bio.org:/tmp/cvs-serv17344/src/org/cshl/servlets Modified Files: GetIndividualsServlet.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/src/org/cshl/servlets GetIndividualsServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/src/org/cshl/servlets/GetIndividualsServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/src/org/cshl/servlets/GetIndividualsServlet.java 2005/01/26 18:51:48 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/src/org/cshl/servlets/GetIndividualsServlet.java 2005/09/14 22:06:57 1.2 @@ -40,14 +40,13 @@ /** * Fill a rdf:Bag with Individual instances, given a panel name */ - protected void handleRequest(MOBYProvider provider) + protected void handleRequest(MOBYService provider) { try { // The provider operates on a single moby:Graph; retrieve it // - MOBYGraph graph = (MOBYGraph) - provider.getOperatesOn().iterator().next(); + MOBYGraph graph = (MOBYGraph) provider.getOperatesOn().next(); // The subject of the graph should be a moby:Subject; retrieve it // @@ -55,13 +54,13 @@ // Retrieve the statement that sets a value for the panelName property // - MOBYPropertyValueStatement stmt = (MOBYPropertyValueStatement) - subject.getPropertyValueStatements().iterator().next(); + MOBYPropValStmt pvStmt = (MOBYPropValStmt) + subject.getPropValStmts().iterator().next(); + Statement stmt = pvStmt.getDefiningStmt(); // Retrieve the panel name from the statement - // - MOBYLiteral literal = (MOBYLiteral) stmt.getValue(); - String panelName = literal.getStringValue(); + Literal lit = (Literal) stmt.getObject(); + String panelName = lit.getString(); // Get an iterator over the individual names for the panel // in order to populate the Bag of results @@ -77,8 +76,7 @@ // Empty the Bag that contains the example Individual // - MOBYObject object = (MOBYObject) subject.getDirectMappings() - .iterator().next(); + MOBYObject object = (MOBYObject) subject.getDirectMappings().next(); Resource res = object.getResource(); Model model = res.getModel(); Bag bag = (Bag) res.as(Bag.class); From gordonp at pub.open-bio.org Wed Sep 14 16:06:49 2005 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Thu Sep 15 18:02:10 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142006.j8EK6n89016329@pub.open-bio.org> gordonp Wed Sep 14 16:06:49 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory pub.open-bio.org:/tmp/cvs-serv16304 Modified Files: MobyDataComposite.java Log Message: Fixed typo moby-live/Java/src/main/org/biomoby/shared/data MobyDataComposite.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java 2005/08/15 17:41:41 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java 2005/09/14 20:06:49 1.5 @@ -115,7 +115,7 @@ StringBuffer instanceXML = new StringBuffer(); // Open tag - instanceXML.append("<"+getDataType().getName()+ + instanceXML.append("<"+getDataType().getName()+" "+ getAttrXML() + ">\n"); //getAttrXML defined in super // Add the info blocks if available From fgibbons at pub.open-bio.org Fri Sep 16 12:36:39 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri Sep 16 13:29:09 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161636.j8GGadFC023705@pub.open-bio.org> fgibbons Fri Sep 16 12:36:39 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv23680/t Modified Files: Client-Central.t Log Message: - Relationships property works now, remove from TODO. retrieveObjectSchema not implemented, put on TODO list. moby-live/Perl/t Client-Central.t,1.41,1.42 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Central.t,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- /home/repository/moby/moby-live/Perl/t/Client-Central.t 2005/09/01 13:50:46 1.41 +++ /home/repository/moby/moby-live/Perl/t/Client-Central.t 2005/09/16 16:36:39 1.42 @@ -61,7 +61,7 @@ my @mandatory = qw/findService retrieveService retrieveResourceURLs retrieveServiceProviders retrieveServiceNames retrieveServiceTypes retrieveObjectNames retrieveObjectDefinition -retrieveNamespaces retrieveObjectSchema Relationships/; +retrieveNamespaces Relationships/; my @mandatory_if_write_access = qw/registerObjectClass deregisterObjectClass registerServiceType deregisterServiceType @@ -80,6 +80,12 @@ can_ok($C, @optional_recommended) or diag("Registry does not supply certain optional methods;\n" . "you should consider adding them"); + +TODO: { + local $TODO = "Method 'retrieveObjectSchema yet to be implemented"; + can_ok($C, "retrieveObjectSchema") + or diag("Registry should be able to return Object Schema"); +} ################## MOBY Registration Tests ################# ################## OBJECT REGISTRATION ############# @@ -154,11 +160,8 @@ or diag("Relationships didn't return a hashref for object types") ; isa_ok( $r->{'isa'}, 'ARRAY') or diag("Relationships didn't return a hash of arrayrefs"); -TODO: { - local $TODO = "Objects don't correctly prepend LSID"; - is(shift @{$r->{'isa'}}, "Object") - or diag("Relationships(objectType) doesn't have the right parentage."); -} +is(shift @{$r->{'isa'}}, "Object") + or diag("Relationships(objectType) doesn't have the right parentage."); $r = $C->Relationships(serviceType => $ServiceType{serviceType}); isa_ok($r, "HASH", "Relationship types hash") @@ -166,12 +169,9 @@ #print STDERR "\n\n\nkeys ",(keys %rel), "\n\n\n"; isa_ok($r->{'isa'}, 'ARRAY') or diag("Relationships didn't return a hash of arrayrefs for services"); -TODO: { - local $TODO = "Objects don't correctly prepend LSID"; - is(shift @{$r->{'isa'}}, - $ServiceType{Relationships}->{ISA}->[0]) - or diag("Relationships (serviceType) doesn't have the right parentage."); -} +is(shift @{$r->{'isa'}}, + $ServiceType{Relationships}->{ISA}->[0]) + or diag("Relationships (serviceType) doesn't have the right parentage."); ############# SERVICE INSTANCE REGISTRATION ########### # Set up a service registration hash. We'll mess with it piece by piece in the next several tests, @@ -498,11 +498,8 @@ $r = $C->retrieveObjectDefinition(objectType => $Obj{objectType}); isa_ok($r , "HASH", "Object definition returns hashref") or diag("Object definition did not return as a hashref") ; -TODO: { - local $TODO = "Objects don't correctly prepend LSID"; - is($r->{objectType}, $Obj{objectType}, "Object reporting correct type") - or diag("Object definition did not report correct type"); -} +is($r->{objectType}, $Obj{objectType}, "Object reporting correct type") + or diag("Object definition did not report correct type"); is($r->{description}, $Obj{description}, "Object reporting correct desccription") or diag("Object definition did not report correct desc"); @@ -529,15 +526,12 @@ or diag("Object didn't return an array of arrays for its ISA relationships"); isa_ok($hasa, 'ARRAY', "") or diag("Object didn't return an array of arrays for its HASA relationships"); -TODO: { - local $TODO = "Objects don't correctly prepend LSID prefix"; - is(${$isa}[0], $Obj{Relationships}->{ISA}->[0]->[0]) or diag("ISA reporting wrong object type"); - is(${$isa}[1], $Obj{Relationships}->{ISA}->[0]->[1]) or diag("ISA reporting wrong object name"); - is(${$hasa}[0], $Obj{Relationships}->{HASA}->[0]->[0]) or diag("HASA reporting wrong object type"); - is(${$hasa}[1], $Obj{Relationships}->{HASA}->[0]->[1]) or diag("HASA reporting wrong object name"); - is($r->{objectLSID}, "urn:lsid:biomoby.org:objectclass:" . $Obj{objectType}) - or diag("Object class LSID reported incorrectly"); -} +is(${$isa}[0], $Obj{Relationships}->{ISA}->[0]->[0]) or diag("ISA reporting wrong object type"); +is(${$isa}[1], $Obj{Relationships}->{ISA}->[0]->[1]) or diag("ISA reporting wrong object name"); +is(${$hasa}[0], $Obj{Relationships}->{HASA}->[0]->[0]) or diag("HASA reporting wrong object type"); +is(${$hasa}[1], $Obj{Relationships}->{HASA}->[0]->[1]) or diag("HASA reporting wrong object name"); +is($r->{objectLSID}, "urn:lsid:biomoby.org:objectclass:" . $Obj{objectType}) + or diag("Object class LSID reported incorrectly"); $r = $C->retrieveNamespaces(); From fgibbons at pub.open-bio.org Fri Sep 16 12:38:15 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri Sep 16 13:30:39 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161638.j8GGcFTB023739@pub.open-bio.org> fgibbons Fri Sep 16 12:38:15 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv23713/t Modified Files: Client-OntologyServer.t Log Message: - TODO list updated: * "Everything" removed (I'm an optimist). * Can't set proxy to default value 'undef', once changed. * relationshipExists is not implemented, so it's SKIPped. (Leaving it on the TODO list creates error messages on 'make test') moby-live/Perl/t Client-OntologyServer.t,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/06 20:43:21 1.3 +++ /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/16 16:38:15 1.4 @@ -12,7 +12,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; #use SOAP::Lite +trace; -use Test::More 'no_plan'; # perldoc Test::More for details +use Test::More 'no_plan'; #skip_all => "Skipped for development"; #'no_plan'; # perldoc Test::More for details use strict; use MOBY::Client::OntologyServer; #Is the client-code even installed? @@ -23,19 +23,30 @@ }; -TODO: { - local $TODO = "Everything."; -} - my @autoload = qw/host proxy/; my @API = (@autoload, qw/new getUserAgent -objectExists serviceExists namespaceExists relationshipExists/); +objectExists serviceExists namespaceExists /); my $os = MOBY::Client::OntologyServer->new(); foreach (@autoload) {eval{$os->$_};} # Call all AUTOLOAD methods, to create them. can_ok("MOBY::Client::OntologyServer", @API) or diag("OntologyServer doesn't implement full API"); +# Check that accessor methods work correctly; +my ($old_host, $old_proxy) = ($os->host(), $os->proxy()); +my ($new_host, $new_proxy) = ("foo.cgi", "bar"); +is($os->host($new_host), $new_host) or diag("Couldn't set new host"); +is($os->host(), $new_host) or diag("Couldn't get host"); +is($os->host($old_host), $old_host) or diag("Couldn't return host to previous value"); + is($os->proxy($new_proxy), $new_proxy) or diag("Couldn't set proxy to new value"); + is($os->proxy(), $new_proxy) or diag("Couldn't get proxy"); +TODO: { + local $TODO = "How come I cant' set proxy back to its original value?"; + is($os->proxy($old_proxy), $old_proxy) or diag("Couldn't return proxy to previous value"); +} + +# Start fresh.... +$os = MOBY::Client::OntologyServer->new(); ################ CHECK THAT VALID STUFF RETURNS CORRECTLY ########## # # It would really be better not to have literal lists of valid namespaces here, @@ -69,14 +80,23 @@ or diag("Service type '$_' reported erroneously as non-existent."); } -TODO: { - local $TODO = "Fix whatever is broken with these relationship types - or else fix this test."; +SKIP: { + skip "relationshipExists not implemented", 5 + unless MOBY::Client::OntologyServer->can("relationshipExists"); + + can_ok("MOBY::Client::OntologyServer", "relationshipExists") + or diag("OntologyServer should be able to tell whether a relationship exists"); my @check_rel = qw/ISA HASA HAS/; # There should only be very few valid relationship types. foreach (@check_rel) { ($success, $msg, $existingURI) = $os->relationshipExists(term => $_); is($success, 1) or diag("Relationship '$_' reported erroneously as non-existent."); } + + my $invalid_rel = "HA"; + ($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel); + is($success, 0) + or diag("Relationship '$invalid_rel' reported erroneously as existent."); } @@ -100,7 +120,3 @@ is($success, 0) or diag("Service type '$invalid_st' reported erroneously as existent."); -my $invalid_rel = "HA"; -($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel); -is($success, 0) - or diag("Relationship '$invalid_rel' reported erroneously as existent."); From fgibbons at pub.open-bio.org Fri Sep 16 12:38:47 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri Sep 16 13:31:10 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161638.j8GGclPb023772@pub.open-bio.org> fgibbons Fri Sep 16 12:38:47 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv23747/t Modified Files: Client-Service.t Log Message: - Update to reflect new API. moby-live/Perl/t Client-Service.t,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Service.t,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/02 14:29:30 1.4 +++ /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/16 16:38:47 1.5 @@ -26,16 +26,12 @@ }; -my @autoload = qw/serviceName/; +my @autoload = qw/serviceName service uri smessageVersion _soapService/; my @API = (@autoload, qw/new execute/); my $service = MOBY::Client::Service->new(); is($service, undef) or diag("Created a new service without supplying any WSDL - it ain't right, I tell you!"); # Can't do nothing without WSDL -foreach (@autoload) { eval{$service->$_()}; } # Call all autoloads, to create them. -can_ok("MOBY::Client::Service", @API) - or diag("MOBY::Client::Service doesn't implement full API."); - # Find a service at MOBY Central, try to create a local instance. my $C = MOBY::Client::Central->new(); my ($s, $r) = $C->findService( authURI => 'www.illuminae.com', @@ -46,6 +42,10 @@ isa_ok($service, "MOBY::Client::Service") or diag("Expected new to return MOBY::Client::Service"); +foreach (@autoload) { eval{$service->$_()}; } # Call all autoloads, to create them. +can_ok("MOBY::Client::Service", @API) + or diag("MOBY::Client::Service doesn't implement full API."); + # Empty WSDL should cause 'undef' to be returned, rather than empty Service object. my $emptyWSDL = ""; is(MOBY::Client::Service->new ( service => $emptyWSDL), undef) From fgibbons at pub.open-bio.org Fri Sep 16 12:39:17 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri Sep 16 13:31:40 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161639.j8GGdHiP023805@pub.open-bio.org> fgibbons Fri Sep 16 12:39:17 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv23780/t Modified Files: Client-SimpleArticle.t Log Message: - TODO list no longer contains 'Everything' moby-live/Perl/t Client-SimpleArticle.t,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t 2005/09/02 14:32:15 1.2 +++ /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t 2005/09/16 16:39:17 1.3 @@ -24,11 +24,6 @@ # Clean up after yourself, in case tests fail, or the interpreter is interrupted partway though... }; - -TODO: { - local $TODO = "Everything."; -} - my @autoload = qw/articleName objectType objectLSID namespaces id XML XML_DOM isSimple isCollection isSecondary/; my @API = (@autoload, qw/new addNamespace value /); # createFrom[XML|DOM] are not meant to be public From fgibbons at pub.open-bio.org Fri Sep 16 12:53:35 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri Sep 16 13:45:58 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161653.j8GGrZtQ023874@pub.open-bio.org> fgibbons Fri Sep 16 12:53:35 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv23849/MOBY Modified Files: Config.pm Log Message: - Replace '||' with 'or' for correct behavior when file cannot be opened. moby-live/Perl/MOBY Config.pm,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Config.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Perl/MOBY/Config.pm 2005/08/02 15:18:00 1.8 +++ /home/repository/moby/moby-live/Perl/MOBY/Config.pm 2005/09/16 16:53:35 1.9 @@ -1,7 +1,6 @@ package MOBY::Config; -BEGIN { -} +BEGIN {} use strict; use Carp; use MOBY::dbConfig; @@ -15,7 +14,7 @@ #Encapsulated class data #___________________________________________________________ #ATTRIBUTES - my %_attr_data = # DEFAULT ACCESSIBILITY + my %_attr_data = # DEFAULT ACCESSIBILITY ( mobycentral => [ undef, 'read/write' ], mobyobject => [ undef, 'read/write' ], @@ -47,7 +46,7 @@ } } -# the expected sectionons (listed above) will have their dbCOnfig objects available +# the expected sections (listed above) will have their dbConfig objects available # as methods. The unexpected sections will have their dbConfig objects available # by $dbConfig = $CONFIG->{section_title} sub new { @@ -70,10 +69,9 @@ ( -e $file ) || die "MOBY Configuration file $file doesn't exist $!\n"; chomp $file; if ( ( -e $file ) && ( !( -d $file ) ) ) { - open IN, - $file - || die - "can't open MOBY Configuration file $file for unknown reasons$!\n"; + open IN, $file + or die + "can't open MOBY Configuration file $file for unknown reasons: $!\n"; } my @sections = split /(\[\s*\S+\s*\][^\[]*)/s, join "", ; @@ -97,14 +95,10 @@ sub getDataAdaptor { my ( $self, %args ) = @_; - my $source = $args{datasource}; - $source ||= $args{source}; - $source ||= "mobycentral"; + my $source = $args{datasource} || $args{source} || "mobycentral"; if ( $self->{"${source}Adaptor"} ) { return $self->{"${source}Adaptor"} } ; # read from cache - my $username = - $self->$source - ->{username}; # $self->$source returns a MOBY::dbConfig object + my $username = $self->$source->{username};# $self->$source returns a MOBY::dbConfig object my $password = $self->$source->{password}; my $port = $self->$source->{port}; my $dbname = $self->$source->{dbname}; From fgibbons at pub.open-bio.org Fri Sep 16 13:01:11 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri Sep 16 13:53:38 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161701.j8GH1Bmq023927@pub.open-bio.org> fgibbons Fri Sep 16 13:01:11 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv23895/MOBY/Client Modified Files: Central.pm Log Message: - Clean up some regular expressions, make easier to read. - ref operator returns scalar (string), so we should use string comparison. - Remove redundant "Title" in docs. That's what =head2 is for. - Clean up setting default values using short-circuiting || operator. moby-live/Perl/MOBY/Client Central.pm,1.123,1.124 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.123 retrieving revision 1.124 diff -u -r1.123 -r1.124 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/08/31 22:32:27 1.123 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/09/16 17:01:10 1.124 @@ -55,6 +55,9 @@ be sufficient for most or all MOBY Client activities written in Perl. +=cut + + =head1 AUTHORS Mark Wilkinson (markw@illuminae.com) @@ -70,7 +73,6 @@ =head2 new - Title : new Usage : my $MOBY = MOBY::Client::Central->new(Registries => \%regrefs) Function : connect to one or more MOBY-Central registries for searching @@ -140,8 +142,7 @@ ( Connections => [ undef, 'read/write' ], default_MOBY_servername => [ 'mobycentral', 'read/write' ], - default_MOBY_server => [ - + default_MOBY_server => [ 'http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl', 'read/write' ], @@ -239,119 +240,119 @@ } sub new { - my ( $caller, %args ) = @_; - my $caller_is_obj = ref($caller); - return $caller if $caller_is_obj; - my $class = $caller_is_obj || $caller; - my $proxy; - my $self = bless {}, $class; - foreach my $attrname ( $self->_standard_keys ) { - if ( exists $args{$attrname} ) { - $self->{$attrname} = $args{$attrname}; - } - elsif ($caller_is_obj) { - $self->{$attrname} = $caller->{$attrname}; - } - else { - $self->{$attrname} = $self->_default_for($attrname); - } - } - $self->Connections( [] ); # initialize; - - # if user has set up preferred servers, then use those by default - $self->default_MOBY_server( $ENV{MOBY_SERVER} ) if $ENV{MOBY_SERVER}; - $self->default_MOBY_uri( $ENV{MOBY_URI} ) if $ENV{MOBY_URI}; - $self->default_MOBY_type( $ENV{MOBY_TYPE} ) if $ENV{MOBY_TYPE}; - $self->default_MOBY_proxy( $ENV{MOBY_PROXY} ) if $ENV{MOBY_PROXY}; - if ( $self->Registries ) { - my $regno = 0; - my %reg = %{ $self->Registries }; - while ( my ( $name, $acc ) = each %reg ) { - $regno++; # count how many registries we have in total - my $url = $acc->{URL} ? $acc->{URL} : $self->default_MOBY_server; - my $uri = $acc->{URI} ? $acc->{URI} : $self->default_MOBY_uri; - my $type = $acc->{TYPE} ? $acc->{TYPE} : $self->default_MOBY_type; - my $proxy = - $acc->{PROXY} ? $acc->{PROXY} : $self->default_MOBY_proxy; - $type ||= 'soap'; - if ( lc($type) eq "get" ) { - push @{ $self->Connections }, [ $name, $type, $url ]; - } - else { - my @soapargs; - if ($proxy) { - @soapargs = ( $url, proxy => [ 'http' => $proxy ] ); - } - else { - @soapargs = ($url); - } - push @{ $self->Connections }, [ - $name, $type, - SOAP::Lite->proxy(@soapargs)->uri($uri)->on_fault( - sub { - my ( $soap, $res ) = @_; - die ref $res - ? $res->faultstring - : $soap->transport->status, - "\n ERROR ERROR ERROR\n"; - } - ) - ]; - } - } - $self->multiple_registries( $regno - 1 ) - ; # one is not "multiple", it is just a change in default -> set to "false" if only one + my ( $caller, %args ) = @_; + my $caller_is_obj = ref($caller); + return $caller if $caller_is_obj; + my $class = $caller_is_obj || $caller; + my $proxy; + my $self = bless {}, $class; + foreach my $attrname ( $self->_standard_keys ) { + if ( exists $args{$attrname} ) { + $self->{$attrname} = $args{$attrname}; + } + elsif ($caller_is_obj) { + $self->{$attrname} = $caller->{$attrname}; + } + else { + $self->{$attrname} = $self->_default_for($attrname); + } + } + $self->Connections( [] ); # initialize; + + # if user has set up preferred servers, then use those by default + $self->default_MOBY_server( $ENV{MOBY_SERVER} ) if $ENV{MOBY_SERVER}; + $self->default_MOBY_uri( $ENV{MOBY_URI} ) if $ENV{MOBY_URI}; + $self->default_MOBY_type( $ENV{MOBY_TYPE} ) if $ENV{MOBY_TYPE}; + $self->default_MOBY_proxy( $ENV{MOBY_PROXY} ) if $ENV{MOBY_PROXY}; + if ( $self->Registries ) { + my $regno = 0; + my %reg = %{ $self->Registries }; + while ( my ( $name, $acc ) = each %reg ) { + $regno++; # count how many registries we have in total + my $url = $acc->{URL} ? $acc->{URL} : $self->default_MOBY_server; + my $uri = $acc->{URI} ? $acc->{URI} : $self->default_MOBY_uri; + my $type = $acc->{TYPE} ? $acc->{TYPE} : $self->default_MOBY_type; + my $proxy = $acc->{PROXY} ? $acc->{PROXY} : $self->default_MOBY_proxy; + $type ||= 'soap'; + if ( lc($type) eq "get" ) { + push @{ $self->Connections }, [ $name, $type, $url ]; + } + else { + my @soapargs; + if ($proxy) { + @soapargs = ( $url, proxy => [ 'http' => $proxy ] ); } else { - $self->multiple_registries(0); - if ( lc( $self->default_MOBY_type ) eq "get" ) { - push @{ $self->Connections }, - [ - $self->default_MOBY_servername, $self->default_MOBY_type, - $self->default_MOBY_server - ]; - } - else { - $self->Registries( - { - $self->default_MOBY_servername => { - URL => $self->default_MOBY_server, - URI => $self->default_MOBY_uri - } - } - ); - my @soapargs; - if ( $self->default_MOBY_proxy ) { - @soapargs = ( - $self->default_MOBY_server, - proxy => [ 'http' => $self->default_MOBY_proxy ] - ); - } - else { - @soapargs = ( $self->default_MOBY_server ); - } - push @{ $self->Connections }, [ - $self->default_MOBY_servername, - $self->default_MOBY_type, - SOAP::Lite->proxy(@soapargs)->uri( $self->default_MOBY_uri ) - ->on_fault( - sub { - my ( $soap, $res ) = @_; - die ref $res - ? $res->faultstring - : $soap->transport->status, "\n ERROR ERROR ERROR\n"; - } - ) - ]; - } + @soapargs = ($url); } - return undef unless $self->Connection(); # gotta have at least one... - return $self; + push @{ $self->Connections }, + [ + $name, $type, + SOAP::Lite->proxy(@soapargs)->uri($uri)->on_fault( + sub { + my ( $soap, $res ) = @_; + die ref $res + ? $res->faultstring + : $soap->transport->status, + "\n ERROR ERROR ERROR\n"; + } + ) + ]; + } + } + $self->multiple_registries( $regno - 1 ) + ; # one is not "multiple", it is just a change in default -> set to "false" if only one + } + else { + $self->multiple_registries(0); + if ( lc( $self->default_MOBY_type ) eq "get" ) { + push @{ $self->Connections }, + [ + $self->default_MOBY_servername, $self->default_MOBY_type, + $self->default_MOBY_server + ]; + } + else { + $self->Registries( + { + $self->default_MOBY_servername => { + URL => $self->default_MOBY_server, + URI => $self->default_MOBY_uri + } + } + ); + my @soapargs; + if ( $self->default_MOBY_proxy ) { + @soapargs = ( + $self->default_MOBY_server, + proxy => [ 'http' => $self->default_MOBY_proxy ] + ); + } + else { + @soapargs = ( $self->default_MOBY_server ); + } + push @{ $self->Connections }, + [ + $self->default_MOBY_servername, + $self->default_MOBY_type, + SOAP::Lite->proxy(@soapargs)->uri( $self->default_MOBY_uri ) + ->on_fault( + sub { + my ( $soap, $res ) = @_; + die ref $res + ? $res->faultstring + : $soap->transport->status, "\n ERROR ERROR ERROR\n"; + } + ) + ]; + } + } + return undef unless $self->Connection(); # gotta have at least one... + return $self; } =head2 registerObject a.k.a registerObjectClass - Title : registerObject ; registerObjectClass Usage : $REG = $MOBY->registerObject(%args) Usage : $REG = $MOBY->registerObjectClass(%args) Function : register a new type of MOBY Object @@ -383,18 +384,13 @@ "Contact email address (contactEmail parameter) is required for object registration" ) if ( !$a{contactEmail} ); - my $term = $a{'objectType'}; - $term ||= ""; - my $desc = $a{'description'}; - $desc ||= ""; + my $term = $a{'objectType'} || ""; + my $desc = $a{'description'} || ""; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - my $contactEmail = $a{'contactEmail'}; - $contactEmail ||= ""; - my $authURI = $a{'authURI'}; - $authURI ||= ""; - $authURI ||= ""; + my $contactEmail = $a{'contactEmail'} || ""; + my $authURI = $a{'authURI'} || ""; my %Relationships = %{ $a{'Relationships'} }; my $clobber = $a{'Clobber'} ? $a{'Clobber'} : 0; my $message = " @@ -427,7 +423,6 @@ =head2 deregisterObject a.k.a. deregisterObjectClass - Title : deregisterObject ; deregisterObjectClass Usage : $REG = $MOBY->deregisterObject(%args) Usage : $REG = $MOBY->deregisterObjectClass(%args) Function : deregister a MOBY Object @@ -447,8 +442,7 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $id = $a{'objectType'}; - $id ||= ""; + my $id = $a{'objectType'} || ""; my $message = " $id @@ -461,7 +455,6 @@ =head2 retrieveObjectDefinition - Title : retrieveObjectDefinition Usage : $DEF = $MOBY->retrieveObjectDefinition($objectType[,$registry]) Function : retrieve the $XML that was used to register an object and its relationships Returns : hashref, identical to the hash sent during Object registration, plus @@ -567,7 +560,6 @@ =head2 registerServiceType - Title : registerServiceType Usage : $REG = $MOBY->registerServiceType(%args) Function : register a new MOBY Service type Returns : MOBY::Registration object @@ -585,17 +577,14 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $type = $a{'serviceType'}; - $type ||= ""; + my $type = $a{'serviceType'} || ""; my $desc = $a{'description'}; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } $desc ||= ""; - my $email = $a{'contactEmail'}; - $email ||= ""; - my $auth = $a{'authURI'}; - $auth ||= ""; + my $email = $a{'contactEmail'} || ""; + my $auth = $a{'authURI'} || ""; my %Relationships = %{ $a{'Relationships'} }; my $message = " @@ -620,7 +609,6 @@ =head2 deregisterServiceType - Title : deregisterServiceType Usage : $REG = $MOBY->deregisterServiceType(%args) Function : deregister a deprecated MOBY Service Type Returns : MOBY::Registration object @@ -634,8 +622,7 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $id = $a{'serviceType'}; - $id ||= ""; + my $id = $a{'serviceType'} || ""; my $message = " $id @@ -648,7 +635,6 @@ =head2 registerNamespace - Title : registerNamespace Usage : $REG = $MOBY->registerNamespace(%args) Function : register a new Namespace Returns : MOBY::Registration object @@ -665,17 +651,14 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $type = $a{'namespaceType'}; - $type ||= ""; - my $authURI = $a{'authURI'}; - $authURI ||= ""; + my $type = $a{'namespaceType'} || ""; + my $authURI = $a{'authURI'} || ""; my $desc = $a{'description'}; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } $desc ||= ""; - my $contact = $a{'contactEmail'}; - $contact ||= ""; + my $contact = $a{'contactEmail'} || ""; my $message = " $type @@ -691,7 +674,6 @@ =head2 deregisterNamespace - Title : deregisterNamespace Usage : $REG = $MOBY->deregisterNamespace(%args) Function : deregister a deprecated MOBY Namespace Returns : MOBY::Registration object @@ -705,8 +687,7 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $id = $a{'namespaceType'}; - $id ||= ""; + my $id = $a{'namespaceType'} || ""; my $message = " $id @@ -719,7 +700,6 @@ =head2 registerService - Title : registerService Usage : $REG = $MOBY->registerService(%args) Function : register a new MOBY Service instance Returns : MOBY::Registration object @@ -774,24 +754,17 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $name = $a{serviceName}; - $name ||= ""; - my $type = $a{serviceType}; - $type ||= ""; - my $authURI = $a{authURI}; - $authURI ||= ""; - my $email = $a{contactEmail}; - $email ||= ""; - my $URL = $a{URL}; - $URL ||= ""; - my $desc = $a{description}; - $desc ||= ""; + my $name = $a{serviceName} || ""; + my $type = $a{serviceType} || ""; + my $authURI = $a{authURI} || ""; + my $email = $a{contactEmail} || ""; + my $URL = $a{URL} || ""; + my $desc = $a{description} || ""; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - my $signatureURL = $a{signatureURL}; - $signatureURL ||= ""; + my $signatureURL = $a{signatureURL} || ""; my $Category = lc( $a{category} ); chomp $Category; $Category ||= ""; @@ -856,10 +829,10 @@ if ( $Category eq "moby" || $Category eq 'soap' ) { my %SEC; - if ( $a{'secondary'} && ( ref( $a{'secondary'} ) =~ /hash/i ) ) { + if ( $a{'secondary'} && ( ref( $a{'secondary'} ) eq 'HASH' ) ) { %SEC = %{ $a{secondary} }; } - elsif ( $a{'secondary'} && !( ref( $a{'secondary'} ) =~ /hash/i ) ) { + elsif ( $a{'secondary'} && ( ref( $a{'secondary'} ) ne 'HASH' ) ) { return $self->errorRegXML( "invalid structure of secondary parameters. Expected hashref." ); @@ -880,11 +853,11 @@ my ( $articleName, $def ) = @{$article}; $articleName ||= ""; my @Objects; # - unless ( (ref($def) =~ /array/i)) { # $def = [objType => \@ns] or $def=[[objType => \@ns]] + unless ( ref($def) eq 'ARRAY') { # $def = [objType => \@ns] or $def=[[objType => \@ns]] return $self->errorRegXML("invalid structure of $inout objects, expected SINGLE arrayref for article $articleName as required by the 0.86 API"); } my @objectdefs; - if ( ( ref $def->[0] ) =~ /array/i ) { # collection $def->[0] = [objType => \@ns] + if ( ( ref $def->[0] ) eq 'ARRAY' ) { # collection $def->[0] = [objType => \@ns] # def= [[objType2 => [ns3, ns4...]], ...] $message .= "\n"; if (scalar(@{$def->[0]} > 2)){ @@ -899,7 +872,7 @@ @objectdefs = ($def); } foreach my $objectdef (@objectdefs) { - if ( ( ref( $def->[0] ) ) =~ /array/i ) { + if ( ref( $def->[0] ) eq 'ARRAY' ) { $message .= "\n"; } else { @@ -908,7 +881,7 @@ my ( $type, $Namespaces ) = @{$objectdef}; $type ||= ""; $message .= "$type\n"; - unless ( ref($Namespaces) =~ /array/i ) { + unless ( ref($Namespaces) eq 'ARRAY' ) { return $self->errorRegXML( "invalid structure of $inout namespaces for object $type in article $articleName; expected arrayref" ); @@ -918,7 +891,7 @@ } $message .= "\n"; } - if ( ( ref( $def->[0] ) ) =~ /array/i ) { + if ( ref( $def->[0] ) eq 'ARRAY' ) { $message .= "\n"; } } @@ -939,7 +912,7 @@ # $message .= "\n"; while ( my ( $param, $desc ) = each %SEC ) { - unless ( ( ref($desc) ) =~ /hash/i ) { + unless ( ref($desc) eq 'HASH' ) { return $self->errorRegXML( "invalid structure of secondary article $param; expected hashref of limitations" ); } @@ -953,15 +926,12 @@ return $self->errorRegXML("a secondaryArticle must contain at least a datatype value in secondary article $param" ); } - unless ( ( $datatype =~ /Integer/ ) - || ( $datatype =~ /Float/ ) - || ( $datatype =~ /String/ ) - || ( $datatype =~ /DateTime/ ) ) + unless ( $datatype =~ /Integer|Float|String|DateTime/ ) { return $self->errorRegXML("a secondaryArticle must have a datatype of Integer, Float, String, or DateTime" ); } - unless ( ( ref($enums) ) =~ /array/i ) { + unless ( ref($enums) eq 'ARRAY' ) { return $self->errorRegXML("invalid structure of enum limits in secondary article $param; expected arrayref" ); } @@ -1029,9 +999,7 @@ =head2 registerServiceWSDL - Title : registerServiceWSDL - Usage : not yet implemented - + Usage : Needs documentation =cut @@ -1050,7 +1018,6 @@ =head2 deregisterService - Title : deregisterService Usage : $REG = $MOBY->deregisterService(%args) Function : deregister a registered MOBY Service Returns : MOBY::Registration object @@ -1087,7 +1054,6 @@ =head2 findService - Title : findService Usage : ($ServiceInstances, $RegObject) = $MOBY->findService(%args) Function : Find services that match certain search criterion Returns : ON SUCCESS: arrayref of MOBY::Client::ServiceInstance objects, and undef @@ -1123,23 +1089,15 @@ my ( $self, %a ) = @_; my $reg = ( $a{Registry} ) ? $a{Registry} : $self->default_MOBY_servername; my $id = $a{'serviceID'}; - my $servicename = $a{'serviceName'}; - $servicename ||= ""; - my $authoritative = $a{'authoritative'}; - $authoritative ||= 0; - my $serviceType = $a{'serviceType'}; - $serviceType ||= ""; - my $authURI = $a{'authURI'}; - $authURI ||= ""; - my $category = $a{'category'}; - $category ||= "moby"; - my $exObj = $a{'expandObjects'}; - $exObj ||= 0; - my $exServ = $a{'expandServices'}; - $exServ ||= 0; - my $kw = $a{'keywords'}; - $kw ||= []; - ref($kw) =~ /array/i || return ( + my $servicename = $a{'serviceName'} || ""; + my $authoritative = $a{'authoritative'} || 0; + my $serviceType = $a{'serviceType'} || ""; + my $authURI = $a{'authURI'} || ""; + my $category = $a{'category'} || "moby"; + my $exObj = $a{'expandObjects'} || 0; + my $exServ = $a{'expandServices'} || 0; + my $kw = $a{'keywords'} || []; + ref($kw) eq 'ARRAY' || return ( undef, $self->errorRegXML( "invalid structure of keywords. Expected arrayref" @@ -1168,7 +1126,7 @@ #$a{input} = [[]] unless (defined $a{input}); #$a{output} = [[]] unless (defined $a{output}); - if ( defined $a{input} && !( ref( $a{input} ) =~ /array/i ) ) { + if ( defined $a{input} && ( ref( $a{input} ) ne 'ARRAY' ) ) { return ( undef, $self->errorRegXML( @@ -1176,7 +1134,7 @@ ) ); } - if ( defined $a{output} && !( ref( $a{output} ) =~ /array/i ) ) { + if ( defined $a{output} && ( ref( $a{output} ) ne 'ARRAY' ) ) { return ( undef, $self->errorRegXML( @@ -1198,12 +1156,12 @@ die "no inout parameter from teh funkyhash" unless defined $inout; die "no param parameter from teh funkyhash" unless defined $param; die "param parameter should be a listref" - unless ( ref($param) =~ /ARRAY/ ); + unless ( ref($param) eq 'ARRAY' ); my $inout_lc = lc($inout); my @PARAM = @{$param}; $message .= "<${inout_lc}Objects><${inout}>\n"; foreach my $param (@PARAM) { - unless ( ref($param) =~ /array/i ) { + unless ( ref($param) eq 'ARRAY' ) { return ( undef, $self->errorRegXML( @@ -1216,7 +1174,7 @@ #warn "no namespace part of the param" unless defined $namespaces; my @objectdefs; - if ( ( ref $class ) =~ /array/i ) { # collection + if ( ref $class eq 'ARRAY' ) { # collection $message .= "\n"; @objectdefs = $class; } @@ -1229,7 +1187,7 @@ die "type is missing from objectdef " unless $type; $message .= "$type\n"; if ( defined($Namespaces) - && !( ref($Namespaces) =~ /array/i ) ) + && ( ref($Namespaces) ne 'ARRAY' ) ) { return ( undef, @@ -1244,7 +1202,7 @@ } $message .= "\n"; } - if ( ( ref($class) ) =~ /array/i ) { + if ( ref($class) eq 'ARRAY' ) { $message .= "\n"; } } @@ -1259,7 +1217,6 @@ =head2 retrieveService - Title : retrieveService Usage : $WSDL = $MOBY->retrieveService($ServiceInstance) Function : get the WSDL definition of the service with this name/authority URI Returns : a WSDL string @@ -1304,7 +1261,6 @@ =head2 retrieveResourceURLs - Title : retrieveResourceURLs() Usage : $names = $MOBY->retrieveResourceURLs() Function : get a hash of the URL's for each of the MOBY ontologies Returns : hashref to the following hash @@ -1336,7 +1292,6 @@ =head2 retrieveServiceNames - Title : retrieveServiceNames(%args) Usage : $names = $MOBY->retrieveServiceNames([$reg_name]) Function : get a (redundant) list of all registered service names (N.B. NOT service types!) @@ -1382,7 +1337,6 @@ =head2 retrieveServiceProviders - Title : retrieveServiceProviders Usage : @URIs = $MOBY->retrieveServiceProviders([$reg_name]) Function : get the list of all provider's AuthURI's Returns : list of service provider URI strings @@ -1413,7 +1367,6 @@ =head2 retrieveServiceTypes - Title : retrieveServiceTypes(%args) Usage : $types = $MOBY->retrieveServiceTypes([$reg_name]) Function : get the list of all registered service types Returns : hashref of $types{$type} = $definition @@ -1463,7 +1416,6 @@ =head2 retrieveObjectNames - Title : retrieveObjectNames(%args) Usage : $names = $MOBY->retrieveObjectNames([$reg_name]) Function : get the list of all registered Object types Returns : hashref of hash: @@ -1511,7 +1463,6 @@ =head2 retrieveNamespaces - Title : retrieveNamespaces(%args) Usage : $ns = $MOBY->retrieveNamespaces([$reg_name]) Function : get the list of all registered Namespace types Returns : hashref of hash: @@ -1562,7 +1513,6 @@ =head2 retrieveObject - Title : retrieveObject Usage : $objects = $MOBY->retrieveObjectNames(%args) Function : get the object xsd Returns : hashref of hash: @@ -1616,7 +1566,6 @@ =head2 Relationships - Title : Relationships Usage : $def = $MOBY->Relationships(%args) Function : traverse and return the relationships in the ontology Returns : hashref of $hash{relationship_type}=\@lsids @@ -1639,7 +1588,7 @@ my @relationships; @relationships = @{ $args{'Relationships'} } if ( $args{'Relationships'} - && ( ref( $args{'Relationships'} ) =~ /array/i ) ); + && ( ref( $args{'Relationships'} ) eq 'ARRAY' ) ); push @relationships, 'isa' unless $relationships[0]; # need to have at least one relationship my $reg = $args{'Registry'}; my $m; @@ -1714,7 +1663,6 @@ =head2 ISA - Title : ISA Usage : $def = $MOBY->ISA($class1, $class2) Function : a pre-canned use of the Relationships function to quickly get an answer to whether class1 ISA class2 @@ -1760,8 +1708,6 @@ =head2 DUMP - - Title : DUMP Usage : ($mobycentral, $mobyobject, $mobyservice, $mobynamespace, $mobyrelationship) = $MOBY->DUMP(['registry']) Function : DUMP the mysql for the current MOBY Central database Returns : text @@ -1919,7 +1865,6 @@ =head2 LSID_CACHE - Title : LSID_CACHE Usage : $lsid = $MOBY->LSID_CACHE($term, $lsid) Function : get/set LSID from the cache Returns : lsid as a scalar @@ -1944,7 +1889,6 @@ =head2 ISA_CACHE - Title : ISA_CACHE Usage : @lsids = $MOBY->ISA_CACHE($lsid, \@isas) Function : get/set the ISA relationships in the cache Returns : list of ISA relationships. The ISA list @@ -1959,7 +1903,7 @@ sub ISA_CACHE { my ( $self, $desiredterm, $isas ) = @_; my $term = $desiredterm; - return (undef) if $isas && !( ref($isas) =~ /ARRAY/ ); + return (undef) if $isas && ( ref($isas) ne 'ARRAY'); if ( $term && $isas ) { my @isalsids; foreach (@$isas){ From fgibbons at pub.open-bio.org Fri Sep 16 13:02:01 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri Sep 16 13:54:25 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161702.j8GH21nX023960@pub.open-bio.org> fgibbons Fri Sep 16 13:02:01 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv23935/MOBY/Client Modified Files: CollectionArticle.pm Log Message: - No "title" in pod. moby-live/Perl/MOBY/Client CollectionArticle.pm,1.11,1.12 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm 2004/12/14 22:31:30 1.11 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm 2005/09/16 17:02:01 1.12 @@ -8,7 +8,10 @@ =head1 NAME -MOBY::Client::CollectionArticle - a small object describing the Collection articles from the findService Response message of MOBY Central or representing the collection part of a MOBY invocation or response block +MOBY::Client::CollectionArticle - a small object describing the +Collection articles from the findService Response message of MOBY +Central or representing the collection part of a MOBY invocation or +response block =head1 SYNOPSIS @@ -39,10 +42,6 @@ } - - -=cut - =head1 DESCRIPTION This describes the Collection articles from either the findService Response of MOBY Central @@ -86,14 +85,11 @@ Mark Wilkinson (markw at illuminae dot com) -=cut - =head1 METHODS =head2 new - Title : new Usage : my $IN = MOBY::Client::CollectionArticle->new(%args) Function : create CollectionArticle object Returns : MOBY::Client::SimpleArticle object @@ -103,62 +99,44 @@ XML => $XML XML_DOM => $XML::DOM::NODE -=cut - =head2 articleName - Title : articleName Usage : $name = $IN->articleName($name) Function : get/set articleName Returns : string Arguments : (optional) string to set articleName -=cut - =head2 Simples - Title : Simples Usage : $type = $IN->Simples(\@SimpleArticles) Function : get/set name Returns : arrayRef of MOBY::Client::SimpleArticle's in this collection Arguments : (optional) arrayRef of MOBY::Client::SimpleArticle's in this collection -=cut - =head2 addSimple - Title : addSimple Usage : $namespaces = $IN->addNamespace($SimpleArticle) Function : add another SimpleArticle Returns : arrayref of MOBY::Client::SimpleArticle's or 0 if argument was not a MOBY::Client::SimpleArticle (or other failure) Arguments : a new MOBY::Client::SimpleArticle to add to collection -=cut - =head2 XML - Title : XML Usage : $SA = $SA->XML($XML) Function : set/reset all parameters for this object from the XML Returns : MOBY::Client::SimpleArticle Arguments : (optional) XML fragment from and including ... -=cut - =head2 XML_DOM - Title : XML_DOM Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) Function : set/reset all parameters for this object from the XML::DOM node for Returns : MOBY::Client::SimpleArticle Arguments : (optional) an $XML::DOM node from the article of a DOM -=cut - =head2 isSimple - Title : isSimple Usage : $boolean = $IN->isSimple() Function : is this a SimpleArticle type (yes, I know this is obvious, but since you can @@ -167,11 +145,8 @@ to test what you have in-hand) Returns : 0 (false) -=cut - =head2 isCollection - Title : isCollection Usage : $boolean = $IN->isCollection() Function : is this a CollectionArticle type (yes, I know this is obvious, but since you can @@ -180,11 +155,8 @@ to test what you have in-hand) Returns : 1 (true) -=cut - =head2 isSecondary - Title : isSecondary Usage : $boolean = $IN->isSecondary() Function : is this a SecondaryArticle type? (yes, I know this is obvious) @@ -198,10 +170,10 @@ # DATA #___________________________________________________________ #ATTRIBUTES - my %_attr_data = # DEFAULT ACCESSIBILITY + my %_attr_data = # DEFAULT ACCESSIBILITY ( - articleName => [ undef, 'read/write' ], - Simples => [ [], 'read/write' ], + articleName => [ undef, 'read/write' ], + Simples => [ [], 'read/write' ], isSimple => [ 0, 'read' ], isSecondary => [ 0, 'read' ], isCollection => [ 1, 'read' ], From senger at pub.open-bio.org Sun Sep 18 03:26:07 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 04:20:18 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180726.j8I7Q7X5010118@pub.open-bio.org> senger Sun Sep 18 03:26:07 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv10099 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.3,1.4 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/13 06:42:26 1.3 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 07:26:06 1.4 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Sun Sep 18 04:35:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 05:27:57 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180835.j8I8ZWHV022465@pub.open-bio.org> senger Sun Sep 18 04:35:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard In directory pub.open-bio.org:/tmp/cvs-serv22447/src/config/dashboard Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard added to the repository moby-live/Java/src/config/dashboard - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:35:44 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 05:28:01 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180835.j8I8Zi3c022515@pub.open-bio.org> senger Sun Sep 18 04:35:44 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF In directory pub.open-bio.org:/tmp/cvs-serv22497/src/config/dashboard/META-INF Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF added to the repository moby-live/Java/src/config/dashboard/META-INF - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:35:56 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 05:28:08 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180835.j8I8ZuJr022567@pub.open-bio.org> senger Sun Sep 18 04:35:56 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv22547/src/config/dashboard/META-INF/services Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services added to the repository moby-live/Java/src/config/dashboard/META-INF/services - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:36:21 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 05:28:32 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180836.j8I8aLPH022625@pub.open-bio.org> senger Sun Sep 18 04:36:20 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org In directory pub.open-bio.org:/tmp/cvs-serv22607/src/config/dashboard/org Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/org added to the repository moby-live/Java/src/config/dashboard/org - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:36:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 05:28:44 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180836.j8I8aWrj022675@pub.open-bio.org> senger Sun Sep 18 04:36:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby In directory pub.open-bio.org:/tmp/cvs-serv22657/src/config/dashboard/org/biomoby Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby added to the repository moby-live/Java/src/config/dashboard/org/biomoby - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:36:43 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 05:28:56 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180836.j8I8ahIv022725@pub.open-bio.org> senger Sun Sep 18 04:36:43 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service In directory pub.open-bio.org:/tmp/cvs-serv22707/src/config/dashboard/org/biomoby/service Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service added to the repository moby-live/Java/src/config/dashboard/org/biomoby/service - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:36:53 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 05:29:06 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180836.j8I8ar6Y022774@pub.open-bio.org> senger Sun Sep 18 04:36:53 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv22755/src/config/dashboard/org/biomoby/service/dashboard Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard added to the repository moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:37:04 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 05:29:16 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180837.j8I8b4dT022823@pub.open-bio.org> senger Sun Sep 18 04:37:04 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv22805/src/config/dashboard/org/biomoby/service/dashboard/images Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images added to the repository moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:43:50 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 05:36:03 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180843.j8I8hoVG023191@pub.open-bio.org> senger Sun Sep 18 04:43:50 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv23173/src/main/org/biomoby/service/dashboard/images Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images added to the repository moby-live/Java/src/main/org/biomoby/service/dashboard/images - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 05:38:48 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQPh023399@pub.open-bio.org> senger Sun Sep 18 04:46:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv23355/src/config Modified Files: run-any-client run-any-client.bat Log Message: moby-live/Java/src/config run-any-client,1.3,1.4 run-any-client.bat,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-any-client,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/config/run-any-client 2005/09/02 07:38:36 1.3 +++ /home/repository/moby/moby-live/Java/src/config/run-any-client 2005/09/18 08:46:25 1.4 @@ -15,6 +15,5 @@ CLASSPATH=${PROJECT_HOME}/build/others/skeletons:$CLASSPATH CLASSPATH=${PROJECT_HOME}/build/others/samples:$CLASSPATH CLASSPATH=`echo ${PROJECT_HOME}/lib/*.jar | tr ' ' ':'`:$CLASSPATH -###CLASSPATH=`echo ${PROJECT_HOME}/lib/ant_home/lib/*.jar | tr ' ' ':'`:$CLASSPATH exec java -cp $CLASSPATH "$@" =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-any-client.bat,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/09/01 08:01:16 1.3 +++ /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/09/18 08:46:25 1.4 @@ -1,12 +1,13 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd %PROJECT_HOME% set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" -set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" -set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" -set "CP=%PROJECT_HOME%\build\others\samples;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% +set CP=build\others\datatypes;%CP% +set CP=build\others\skeletons;%CP% +set CP=build\others\samples;%CP% java -classpath "%CP%" %1 %2 %3 %4 %5 %6 %7 %8 %9 From senger at pub.open-bio.org Sun Sep 18 04:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 05:38:59 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQ2g023503@pub.open-bio.org> senger Sun Sep 18 04:46:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv23355/src/main/org/biomoby/service/dashboard/images Added Files: registry.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images registry.gif,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 04:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 05:39:04 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQLn023376@pub.open-bio.org> senger Sun Sep 18 04:46:25 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv23355 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.31,1.32 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/13 06:53:28 1.31 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/18 08:46:25 1.32 @@ -211,6 +211,9 @@ + + + @@ -1325,48 +1328,28 @@ + + - + - - - - - - - - + - - - - - - - - + - + From senger at pub.open-bio.org Sun Sep 18 04:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 05:39:19 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQLt023415@pub.open-bio.org> senger Sun Sep 18 04:46:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv23355/src/config/dashboard/META-INF/services Added Files: org.biomoby.service.dashboard.DashboardPanel Log Message: moby-live/Java/src/config/dashboard/META-INF/services org.biomoby.service.dashboard.DashboardPanel,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 04:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 05:39:57 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQxl023431@pub.open-bio.org> senger Sun Sep 18 04:46:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv23355/src/config/dashboard/org/biomoby/service/dashboard/images Added Files: moby-small.gif whale-tail-small.jpg Log Message: moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images moby-small.gif,NONE,1.1 whale-tail-small.jpg,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 04:48:17 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 05:40:30 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180848.j8I8mHFF023621@pub.open-bio.org> senger Sun Sep 18 04:48:17 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard In directory pub.open-bio.org:/tmp/cvs-serv23606/src/config/dashboard Added Files: dashboard.properties Log Message: moby-live/Java/src/config/dashboard dashboard.properties,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 04:48:51 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 05:41:03 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180848.j8I8mpPc023684@pub.open-bio.org> senger Sun Sep 18 04:48:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard In directory pub.open-bio.org:/tmp/cvs-serv23669/src/config/dashboard Added Files: README Log Message: moby-live/Java/src/config/dashboard README,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 08:50:17 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 09:42:29 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181250.j8ICoHLr025902@pub.open-bio.org> senger Sun Sep 18 08:50:17 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv25883 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.4,1.5 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 07:26:06 1.4 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 12:50:17 1.5 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Sun Sep 18 09:02:35 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 09:54:47 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181302.j8ID2ZVd025966@pub.open-bio.org> senger Sun Sep 18 09:02:35 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv25947 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.5,1.6 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 12:50:17 1.5 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 13:02:35 1.6 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Sun Sep 18 10:05:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 10:57:46 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181405.j8IE5WYj026144@pub.open-bio.org> senger Sun Sep 18 10:05:32 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv26125 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.32,1.33 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/18 08:46:25 1.32 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/18 14:05:32 1.33 @@ -1338,9 +1338,12 @@ + + + From senger at pub.open-bio.org Sun Sep 18 10:05:33 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 10:57:48 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181405.j8IE5Xn1026159@pub.open-bio.org> senger Sun Sep 18 10:05:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv26125/src/config Added Files: run-dashboard run-dashboard.bat Log Message: moby-live/Java/src/config run-dashboard,NONE,1.1 run-dashboard.bat,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 10:09:42 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 11:01:57 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181409.j8IE9g67026288@pub.open-bio.org> senger Sun Sep 18 10:09:42 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/images In directory pub.open-bio.org:/tmp/cvs-serv26273/docs/images Added Files: whale-tail.jpg Log Message: moby-live/Java/docs/images whale-tail.jpg,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 10:09:42 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 11:02:29 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181409.j8IE9gr2026324@pub.open-bio.org> senger Sun Sep 18 10:09:42 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv26273/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java ConsolePanel.java Dashboard.java NOTES RegistryPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard AbstractPanel.java,1.4,1.5 ConsolePanel.java,1.2,1.3 Dashboard.java,1.2,1.3 NOTES,1.2,1.3 RegistryPanel.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/18 08:46:26 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/18 14:09:42 1.5 @@ -81,6 +81,7 @@ // something need to be done only once - keep it here protected Icon panelIcon; protected JComponent pComponent; + protected Icon confirmIcon; // re-use "style" components protected static final Insets BREATH_TOP = new Insets (10,0,0,0); @@ -276,7 +277,10 @@ * Return true if confirmation dialog passed. ********************************************************************/ public boolean confirm (Object msg) { - return SwingUtils.confirm (this, msg, null); + if (confirmIcon == null) + confirmIcon = + SwingUtils.createIcon ("images/confirmButton.gif", Dashboard.class); + return SwingUtils.confirm (this, msg, confirmIcon); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/18 08:46:26 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/18 14:09:42 1.3 @@ -15,7 +15,6 @@ import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JScrollPane; -import javax.swing.JViewport; import javax.swing.JTextArea; import javax.swing.JPanel; import javax.swing.text.html.HTMLDocument; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/18 08:46:26 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/18 14:09:42 1.3 @@ -10,6 +10,7 @@ import org.tulsoft.tools.gui.SwingUtils; import org.tulsoft.tools.gui.AwtUtils; +import org.tulsoft.tools.gui.ProgressView; import org.apache.commons.discovery.tools.Service; @@ -50,6 +51,7 @@ private JComponent dashboard; private StatusBar statusBar; private DashboardHeader header; + public static boolean useLoadMonitor = true; protected JTabbedPane tabbedPane; protected DashboardPanel[] panels; protected static Properties dashboardProperties; @@ -185,6 +187,11 @@ if (dashboard != null) return dashboard; + if (useLoadMonitor) { + ProgressView.monitor = new ProgressView (panels.length); + ProgressView.monitor.show ("Welcome to Biomoby Dashboard"); + } + // create itself JPanel p = new JPanel (new GridBagLayout(), true); @@ -192,10 +199,16 @@ tabbedPane = new JTabbedPane(); tabbedPane.addChangeListener (this); for (int i = 0; i < panels.length; i++) { - tabbedPane.addTab (panels[i].getName(), panels[i].getIcon(), panels[i].getComponent()); + String name = panels[i].getName(); + if (useLoadMonitor) + ProgressView.monitor.setTextAndAdd ("Loading " + name + "..."); + tabbedPane.addTab (name, panels[i].getIcon(), panels[i].getComponent()); } statusBar = getStatusBar(); + if (useLoadMonitor) + ProgressView.monitor.destroy(); + // put it all together SwingUtils.addComponent (p, header, 0, 0, 1, 1, AbstractPanel.HORI, AbstractPanel.NWEST, 1.0, 0.0); SwingUtils.addComponent (p, tabbedPane, 0, 1, 1, 1, AbstractPanel.BOTH, AbstractPanel.NWEST, 1.0, 1.0); @@ -295,6 +308,8 @@ * **************************************************************************/ public static void main (String[] args) { + if (args.length > 0 && args[0].equals ("-nop")) + Dashboard.useLoadMonitor = false; new Dashboard().show(); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/18 08:46:26 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/18 14:09:42 1.3 @@ -9,9 +9,7 @@ * configure dashbard (add/remove dynamically panels) * configure user preferences -* Registry panel: - - trees should be in panned blocks (user-resizable) - +* running from run-dashboard does not work Registry panel -------------- =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/18 08:46:26 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/18 14:09:42 1.5 @@ -18,10 +18,14 @@ import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JFileChooser; +import javax.swing.JSplitPane; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; import javax.swing.JComponent; import javax.swing.text.html.HTMLDocument; import java.awt.GridBagLayout; +import java.awt.Font; import java.awt.event.KeyEvent; import java.awt.event.ActionEvent; @@ -80,16 +84,38 @@ DataTypesTree dataTypesTree = new DataTypesTree(); NamespacesTree namespacesTree = new NamespacesTree(); + JSplitPane split1 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, + servicesTree.scrollable(), + dataTypesTree.scrollable()); + split1.setResizeWeight (0.5); + split1.setContinuousLayout (true); + split1.setOneTouchExpandable (true); + JSplitPane split2 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, + split1, + namespacesTree.scrollable()); + split2.setResizeWeight (0.7); + split2.setContinuousLayout (true); + split2.setOneTouchExpandable (true); + + // console panel + JPanel console = getConsole(); + + JSplitPane split3 = new JSplitPane (JSplitPane.VERTICAL_SPLIT, + split2, + console); + split3.setResizeWeight (0.75); + split3.setContinuousLayout (true); + split3.setOneTouchExpandable (true); + + // registry and cache locations JPanel regLocation = getRegistryLocation(); JPanel cacheLocation = getCacheLocation(); // put all together - SwingUtils.addComponent (pComponent, servicesTree.scrollable(), 0, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); - SwingUtils.addComponent (pComponent, dataTypesTree.scrollable(), 1, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); - SwingUtils.addComponent (pComponent, namespacesTree.scrollable(), 2, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); - SwingUtils.addComponent (pComponent, regLocation, 3, 0, 1, 1, HORI, NWEST, 0.1, 0.0); - SwingUtils.addComponent (pComponent, cacheLocation, 3, 1, 1, 1, HORI, NWEST, 0.1, 0.0); + SwingUtils.addComponent (pComponent, split3, 0, 0, 1, 2, BOTH, NWEST, 1.0, 1.0); + SwingUtils.addComponent (pComponent, regLocation, 1, 0, 1, 1, HORI, NWEST, 0.0, 0.0); + SwingUtils.addComponent (pComponent, cacheLocation, 1, 1, 1, 1, HORI, NWEST, 0.0, 0.0); return pComponent; } @@ -235,6 +261,35 @@ /************************************************************************** * **************************************************************************/ + protected JPanel getConsole() { + JPanel p = new JPanel (new GridBagLayout()); + + JTextArea textArea = new JTextArea(); + textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); + textArea.setEditable (false); + JScrollPane scroller = new JScrollPane (textArea); + +// JButton cleanButton = +// createButton (" Clean ", +// "Remove all messages from the console area", +// KeyEvent.VK_C, +// new ActionListener() { +// public void actionPerformed (ActionEvent e) { +// if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) +// textArea.setText (""); +// } +// }); + + // put it together + SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); +// SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); + + return p; + } + + /************************************************************************** + * + **************************************************************************/ class ServicesTree extends CommonTree { public ServicesTree() { super ("Services"); From senger at pub.open-bio.org Sun Sep 18 10:12:01 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 11:04:18 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181412.j8IEC117026412@pub.open-bio.org> senger Sun Sep 18 10:12:01 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv26397/src/main/org/biomoby/service/dashboard/images Added Files: confirmButton.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images confirmButton.gif,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 10:36:13 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 11:28:42 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181436.j8IEaDWV026495@pub.open-bio.org> senger Sun Sep 18 10:36:13 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard In directory pub.open-bio.org:/tmp/cvs-serv26477/src/samples-resources/GCP-dashboard Log Message: Directory /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard added to the repository moby-live/Java/src/samples-resources/GCP-dashboard - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 10:36:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 11:29:03 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181436.j8IEaqUc026537@pub.open-bio.org> senger Sun Sep 18 10:36:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv26519/images Log Message: Directory /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images added to the repository moby-live/Java/src/samples-resources/GCP-dashboard/images - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 10:36:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 11:29:05 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181436.j8IEaqV3026555@pub.open-bio.org> senger Sun Sep 18 10:36:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF In directory pub.open-bio.org:/tmp/cvs-serv26519/META-INF Log Message: Directory /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF added to the repository moby-live/Java/src/samples-resources/GCP-dashboard/META-INF - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 10:36:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 11:29:06 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181436.j8IEaq05026573@pub.open-bio.org> senger Sun Sep 18 10:36:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv26519/META-INF/services Log Message: Directory /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services added to the repository moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 10:38:27 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 11:30:37 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181438.j8IEcRaA026639@pub.open-bio.org> senger Sun Sep 18 10:38:27 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard In directory pub.open-bio.org:/tmp/cvs-serv26624/src/samples-resources/GCP-dashboard Added Files: README dashboard.properties Log Message: moby-live/Java/src/samples-resources/GCP-dashboard README,NONE,1.1 dashboard.properties,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 10:38:27 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 11:30:40 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181438.j8IEcRBb026654@pub.open-bio.org> senger Sun Sep 18 10:38:27 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv26624/src/samples-resources/GCP-dashboard/META-INF/services Added Files: org.biomoby.service.dashboard.DashboardPanel Log Message: moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services org.biomoby.service.dashboard.DashboardPanel,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 10:38:27 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 11:30:42 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181438.j8IEcR7Y026670@pub.open-bio.org> senger Sun Sep 18 10:38:27 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv26624/src/samples-resources/GCP-dashboard/images Added Files: dashboard.jpg dashboard2.jpg dashboard3.jpg gcp.png Log Message: moby-live/Java/src/samples-resources/GCP-dashboard/images dashboard.jpg,NONE,1.1 dashboard2.jpg,NONE,1.1 dashboard3.jpg,NONE,1.1 gcp.png,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 22:24:51 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 18 23:18:12 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190224.j8J2OphA028109@pub.open-bio.org> senger Sun Sep 18 22:24:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv28089/src/Clients Modified Files: CacheRegistryClient.java Log Message: remove Eclipse warnings moby-live/Java/src/Clients CacheRegistryClient.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/04 13:45:37 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/19 02:24:51 1.3 @@ -12,9 +12,7 @@ import org.tulsoft.shared.FileUtils; import org.tulsoft.shared.GException; -import java.net.*; import java.util.*; -import java.io.*; /** * This is a command-line client creating (and removing) a cache of a @@ -108,9 +106,9 @@ if (cmd.hasOption ("-fill")) { castWorker.removeFromCache (null); decorationLn ("Retrieving data types..."); - MobyDataType[] dataTypes = worker.getDataTypes(); + worker.getDataTypes(); decorationLn ("Retrieving services..."); - MobyService[] services = worker.getServices(); + worker.getServices(); } // From senger at pub.open-bio.org Mon Sep 19 04:08:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon Sep 19 05:01:21 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88WHH029116@pub.open-bio.org> senger Mon Sep 19 04:08:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv29075/docs Modified Files: ChangeLog Log Message: caching also namespaces moby-live/Java/docs ChangeLog,1.39,1.40 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/01 08:01:16 1.39 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/19 08:08:32 1.40 @@ -1,3 +1,7 @@ +2005-09-19 Martin Senger + + * Added caching for namespaces to CentralDigestCachedImpl + 2005-09-01 Martin Senger * Fixed the Windows run...bat scripts in order to accept spaces in From senger at pub.open-bio.org Mon Sep 19 04:08:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon Sep 19 05:01:33 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88WgU029097@pub.open-bio.org> senger Mon Sep 19 04:08:31 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv29075 Modified Files: build.xml Log Message: caching also namespaces moby-live/Java build.xml,1.33,1.34 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/18 14:05:32 1.33 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/19 08:08:31 1.34 @@ -545,7 +545,15 @@ ---> + --> + + + From senger at pub.open-bio.org Mon Sep 19 04:08:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon Sep 19 05:01:35 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88WBr029240@pub.open-bio.org> senger Mon Sep 19 04:08:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv29075/src/main/org/biomoby/client Modified Files: CentralDigestCachedImpl.java CentralImpl.java Log Message: caching also namespaces moby-live/Java/src/main/org/biomoby/client CentralDigestCachedImpl.java,1.5,1.6 CentralImpl.java,1.25,1.26 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/08/26 06:27:04 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/19 08:08:32 1.6 @@ -50,6 +50,7 @@ private String cacheDir; // as defined in the constructor protected File dataTypesCache; protected File servicesCache; + protected File namespacesCache; // cache age private long cacheAge = -1; @@ -95,11 +96,15 @@ long dataTypesCacheAge = (isCacheEmpty (dataTypesCache) ? -1 : dataTypesCache.lastModified()); servicesCache = createSubCacheDir (cache, "services"); long servicesCacheAge = (isCacheEmpty (servicesCache) ? -1 : servicesCache.lastModified()); + namespacesCache = createSubCacheDir (cache, "namespaces"); + long namespacesCacheAge = (isCacheEmpty (namespacesCache) ? -1 : namespacesCache.lastModified()); - if (dataTypesCacheAge > -1 && servicesCacheAge > -1) - cacheAge = Math.min (dataTypesCacheAge, servicesCacheAge); + if (dataTypesCacheAge > -1 && servicesCacheAge > -1 && namespacesCacheAge > -1) + cacheAge = Math.min (Math.min (dataTypesCacheAge, servicesCacheAge), + namespacesCacheAge); else - cacheAge = Math.max (dataTypesCacheAge, servicesCacheAge); + cacheAge = Math.max (Math.max (dataTypesCacheAge, servicesCacheAge), + namespacesCacheAge); } } @@ -318,6 +323,20 @@ } } + // + protected void fillNamespacesCache() + throws MobyException { + try { + String xml = getNamespacesAsXML(); + store (namespacesCache, "all_namespaces_in_one_go", xml); + if (cacheAge <= 0) + cacheAge = namespacesCache.lastModified(); + + } catch (Exception e) { + throw new MobyException (formatException (e)); + } + } + // read all data types public MobyDataType[] getDataTypes() throws MobyException { @@ -375,6 +394,35 @@ } } +// public MobyNamespace[] getNamespaces() + public Map getNamespaces() + throws MobyException { + if (namespacesCache == null) + return super.getNamespaces(); + synchronized (namespacesCache) { + if (isCacheEmpty (namespacesCache)) { + initCache(); + fillNamespacesCache(); + } + File[] list = namespacesCache.listFiles(); + if (list == null) + throw new MobyException + ("Surprisingly, '" + namespacesCache.getAbsolutePath() + "' is not a directory. Strange..."); + for (int i = 0; i < list.length; i++) { + try { + if (list[i].getPath().endsWith ("~")) + continue; // ignore some files + return createNamespacesFromXML (load (list[i])); + } catch (MobyException e) { + System.err.println ("Ignoring '" + list[i].getPath() + + "'. It should not be in the cache directory:" + + e.getMessage()); + } + } + } + return null; + } + /************************************************************************** * It always (if it functions as a cache which is when 'cacheDir' * was given) disables caching in the parent (so no memory caching =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/04 13:45:37 1.25 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/19 08:08:32 1.26 @@ -848,14 +848,26 @@ public Map getNamespaces() throws MobyException { + String result = getNamespacesAsXML(); + return createNamespacesFromXML (result); + } + + // + protected String getNamespacesAsXML() + throws MobyException { + return (String)doCall ("retrieveNamespaces", + new Object[] {}); + } + + // + protected Map createNamespacesFromXML (String result) + throws MobyException { + String cacheId = "retrieveNamespaces"; Map cachedResults = (Map)getContents (cacheId); if (cachedResults != null) return cachedResults; - String result = (String)doCall ("retrieveNamespaces", - new Object[] {}); - // parse returned XML Map results = new HashMap(); Document document = null; From senger at pub.open-bio.org Mon Sep 19 04:08:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon Sep 19 05:01:36 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88WMT029153@pub.open-bio.org> senger Mon Sep 19 04:08:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv29075/src/Clients Modified Files: MobyCmdLineClient.java MobyDigestClient.java MobyGraphs.java PopulateLocalCentralForTesting.java TestingCentral.java Log Message: caching also namespaces moby-live/Java/src/Clients MobyCmdLineClient.java,1.11,1.12 MobyDigestClient.java,1.2,1.3 MobyGraphs.java,1.9,1.10 PopulateLocalCentralForTesting.java,1.4,1.5 TestingCentral.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/09/04 13:45:37 1.11 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/09/19 08:08:32 1.12 @@ -13,7 +13,6 @@ import org.tulsoft.shared.StringUtils; import org.tulsoft.shared.GException; -import java.net.*; import java.util.*; import java.io.*; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/09/04 13:45:37 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/09/19 08:08:32 1.3 @@ -1,7 +1,9 @@ // MobyDigestClient.java // -// senger@ebi.ac.uk -// September 2004 +// Created: September 2004 +// +// This file is a component of the BioMoby project. +// Copyright Martin Senger (martin.senger@gmail.com). // import org.biomoby.shared.*; @@ -11,12 +13,15 @@ import org.tulsoft.shared.FileUtils; import org.tulsoft.shared.GException; +import java.util.Map; +import java.util.Iterator; + /** * A simple client retrieving and printing cummulative (digestive) * registry entries. It can collaborate with the locally cached * registry entries.

* - * @author Martin Senger + * @author Martin Senger * @version $Id$ */ @@ -101,6 +106,17 @@ } } + // read all namespaces + if (cmd.hasOption ("-n")) { + Map namespaces = worker.getNamespaces(); + for (Iterator it = namespaces.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + System.out.println (entry.getKey()); + if (details) + System.out.println ("\t" + entry.getValue()); + } + } + } catch (Exception e) { System.err.println ("===ERROR==="); e.printStackTrace(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2005/09/04 13:45:37 1.9 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2005/09/19 08:08:32 1.10 @@ -14,7 +14,6 @@ import org.tulsoft.shared.FileUtils; import org.tulsoft.shared.GException; -import java.net.*; import java.util.*; import java.io.*; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/PopulateLocalCentralForTesting.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/Clients/PopulateLocalCentralForTesting.java 2005/05/19 15:57:24 1.4 +++ /home/repository/moby/moby-live/Java/src/Clients/PopulateLocalCentralForTesting.java 2005/09/19 08:08:32 1.5 @@ -7,9 +7,6 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import java.net.*; -import java.util.*; - /** * This is a very specialized client, meant solely for testing * purposes, and to be used on a local installation of a Moby Central =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/08/31 00:48:39 1.5 +++ /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/09/19 08:08:32 1.6 @@ -8,7 +8,6 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import java.net.*; import java.util.*; /** From senger at pub.open-bio.org Mon Sep 19 04:08:33 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon Sep 19 05:01:38 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88WK6029270@pub.open-bio.org> senger Mon Sep 19 04:08:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv29075/src/main/org/biomoby/service/dashboard Modified Files: NOTES RegistryPanel.java Log Message: caching also namespaces moby-live/Java/src/main/org/biomoby/service/dashboard NOTES,1.3,1.4 RegistryPanel.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/18 14:09:42 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/19 08:08:32 1.4 @@ -1,9 +1,16 @@ TODO with views: ---------------- +* change onMethods() to be protected or even private... + +* add a progress bar to the status bar (on the right) + - add also a cancel buton there + - do not allow more than one progressbar-aware action in the same time + file:///c/Development/java-tutorial/uiswing/components/progress.html + ? small icons to buttons ? use FileSystemView in file choosers -* alltools2: - PrefsUtils may become just a common parent for both *WithHistory classes - - combo box history is not updated if exit happened while focus is till in the text field +? alltools2: + - combo box history is not updated if exit happened while focus is till in the text field ? configure dashboard from menu: * configure dashbard (add/remove dynamically panels) @@ -11,6 +18,20 @@ * running from run-dashboard does not work +TODO for cache: +--------------- +* add namespaces and service types +* store services under names: authority-service_name +* emit log events +* poor-man update: keep what's there but add what is not there + (and perhaps delete what should not be thre) - but do not + check any age of existing +* getInfo() method +* corresponding changes with command-line clients for cache + implementations + +? start to work on/think of the RDF-based cache + Registry panel -------------- =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/18 14:09:42 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/19 08:08:32 1.6 @@ -52,6 +52,9 @@ // names of user preferences keys static final String USE_CACHE = "use-cache"; + // associated model working behind the scenes + RegistryModel registryModel; + // components that are used from more methods JFileChooserWithHistory cacheDir; JLabel labelCacheDir; @@ -70,6 +73,15 @@ // else if (prop.equalsIgnoreCase (PROP_DATA_IDENTITY)) setDataIdentity (newVal); } + /********************************************************************* + * Default constructor + ********************************************************************/ + public RegistryPanel() { + super(); +// registryModel = new RegistryModel (this); + registryModel = new RegistryModel(); + } + /************************************************************************** * **************************************************************************/ @@ -153,7 +165,7 @@ /************************************************************************** * **************************************************************************/ - public void onUseCache (boolean enabled) { + protected void onUseCache (boolean enabled) { cacheDir.setEnabled (enabled); labelCacheDir.setEnabled (enabled); setPrefValue (USE_CACHE, enabled); @@ -331,4 +343,34 @@ } +// public void actionPerformed(ActionEvent e) { +// ... +// if (icon == null) { //haven't viewed this photo before +// loadImage(imagedir + pic.filename, current); +// } else { +// updatePhotograph(current, pic); +// } +// } +// ... +// //Load an image in a separate thread. +// private void loadImage(final String imagePath, final int index) { +// final SwingWorker worker = new SwingWorker() { +// ImageIcon icon = null; + +// public Object construct() { +// icon = new ImageIcon(getURL(imagePath)); +// return icon; //return value not used by this program +// } + +// //Runs on the event-dispatching thread. +// public void finished() { +// Photo pic = (Photo)pictures.elementAt(index); +// pic.setIcon(icon); +// if (index == current) +// updatePhotograph(index, pic); +// } +// }; +// worker.start(); +// } + } From senger at pub.open-bio.org Mon Sep 19 04:08:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon Sep 19 05:01:44 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88Wj6029217@pub.open-bio.org> senger Mon Sep 19 04:08:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/templates In directory pub.open-bio.org:/tmp/cvs-serv29075/src/config/templates Modified Files: DataTypeTemplate.java MembersHASTemplate.java MethodsHASTemplate.java MethodsHAS_string_Template.java ServicePISetTemplate.java ServicePISimpleTemplate.java ServicePOSetTemplate.java ServicePOSimpleTemplate.java ServiceParameterTemplate.java ServiceSkeletonTemplate.java ToStringHASTemplate.java ToXMLHASTemplate.java Log Message: caching also namespaces moby-live/Java/src/config/templates DataTypeTemplate.java,1.1,1.2 MembersHASTemplate.java,1.1,1.2 MethodsHASTemplate.java,1.1,1.2 MethodsHAS_string_Template.java,1.1,1.2 ServicePISetTemplate.java,1.1,1.2 ServicePISimpleTemplate.java,1.1,1.2 ServicePOSetTemplate.java,1.1,1.2 ServicePOSimpleTemplate.java,1.1,1.2 ServiceParameterTemplate.java,1.1,1.2 ServiceSkeletonTemplate.java,1.1,1.2 ToStringHASTemplate.java,1.1,1.2 ToXMLHASTemplate.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/DataTypeTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/DataTypeTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/DataTypeTemplate.java 2005/09/19 08:08:32 1.2 @@ -6,11 +6,6 @@ package org.biomoby.shared.datatypes; -import org.biomoby.shared.MobyException; -import org.jdom.Element; -import java.util.Vector; -import java.util.Enumeration; - /** * Data type name: @DATATYPE@.
* Authority: @AUTHORITY@
@@ -57,8 +52,8 @@ /************************************************************************** * *************************************************************************/ - public Element toXML() { - Element elem_I_am_sorry_that_this_produces_a_warning = super.toXML(); + public org.jdom.Element toXML() { + org.jdom.Element elem_I_am_sorry_that_this_produces_a_warning = super.toXML(); elem_I_am_sorry_that_this_produces_a_warning.setName (DATA_TYPE_NAME); @TO_XML@ return elem_I_am_sorry_that_this_produces_a_warning; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/MembersHASTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/MembersHASTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/MembersHASTemplate.java 2005/09/19 08:08:32 1.2 @@ -1,5 +1,5 @@ /** An article name for a member of this object. */ public static final String ARTICLE_NAME_@ESC_UPPER_ARTICLE_NAME@ = "@ARTICLE_NAME@"; // elements are of type @CHILDTYPE_NAME@ - protected Vector @ESC_ARTICLE_NAME@ = new Vector(); + protected java.util.Vector @ESC_ARTICLE_NAME@ = new java.util.Vector(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/MethodsHASTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/MethodsHASTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/MethodsHASTemplate.java 2005/09/19 08:08:32 1.2 @@ -19,7 +19,7 @@ * only one value *************************************************************************/ public void set_@ESC_ARTICLE_NAME@ (@CHILDTYPE_NAME@[] value) { - this.@ESC_ARTICLE_NAME@ = new Vector(); + this.@ESC_ARTICLE_NAME@ = new java.util.Vector(); for (int i = 0; i < value.length; i++) set_@ESC_ARTICLE_NAME@ (value[i]); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/MethodsHAS_string_Template.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/MethodsHAS_string_Template.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/MethodsHAS_string_Template.java 2005/09/19 08:08:32 1.2 @@ -21,7 +21,7 @@ * only one value *************************************************************************/ public void set_@ESC_ARTICLE_NAME@ (String[] value) { - this.@ESC_ARTICLE_NAME@ = new Vector(); + this.@ESC_ARTICLE_NAME@ = new java.util.Vector(); for (int i = 0; i < value.length; i++) set_@ESC_ARTICLE_NAME@ (value[i]); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServicePISetTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServicePISetTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServicePISetTemplate.java 2005/09/19 08:08:32 1.2 @@ -3,10 +3,10 @@ * * @param request represents input data coming from a client * @return a type specific object (that is known to this service) - * @throws MobyException if something goes wrong + * @throws org.biomoby.shared.MobyException if something goes wrong *************************************************************************/ public @DATATYPE@[] get_@ESC_ARTICLE_NAME@Set (MobyJob request) - throws MobyException { + throws org.biomoby.shared.MobyException { return (@DATATYPE@[])request.getDataSet ("@ARTICLE_NAME@", "@DATATYPE@"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServicePISimpleTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServicePISimpleTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServicePISimpleTemplate.java 2005/09/19 08:08:32 1.2 @@ -3,9 +3,9 @@ * * @param request represents input data coming from a client * @return a type specific object (that is known to this service) - * @throws MobyException if something goes wrong + * @throws org.biomoby.shared.MobyException if something goes wrong *************************************************************************/ public @DATATYPE@ get_@ESC_ARTICLE_NAME@ (MobyJob request) - throws MobyException { + throws org.biomoby.shared.MobyException { return (@DATATYPE@)request.getData ("@ARTICLE_NAME@", "@DATATYPE@"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSetTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSetTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSetTemplate.java 2005/09/19 08:08:32 1.2 @@ -3,10 +3,10 @@ * * @param response represents output data that will go to a client * @param values is to be stored in the 'response' - * @throws MobyException if something goes wrong + * @throws org.biomoby.shared.MobyException if something goes wrong *************************************************************************/ public void set_@ESC_ARTICLE_NAME@Set (MobyJob response, @DATATYPE@[] values) - throws MobyException { + throws org.biomoby.shared.MobyException { response.setDataSet (values, "@ARTICLE_NAME@"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSimpleTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSimpleTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSimpleTemplate.java 2005/09/19 08:08:32 1.2 @@ -3,10 +3,10 @@ * * @param response represents output data that will go to a client * @param value is to be stored in the 'response' - * @throws MobyException if something goes wrong + * @throws org.biomoby.shared.MobyException if something goes wrong *************************************************************************/ public void set_@ESC_ARTICLE_NAME@ (MobyJob response, @DATATYPE@ value) - throws MobyException { + throws org.biomoby.shared.MobyException { response.setData (value, "@ARTICLE_NAME@"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServiceParameterTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServiceParameterTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServiceParameterTemplate.java 2005/09/19 08:08:32 1.2 @@ -4,10 +4,10 @@ * * @param request represents input data coming from a client * @return value of a "secondary" parameter - * @throws MobyException if something goes wrong + * @throws org.biomoby.shared.MobyException if something goes wrong *************************************************************************/ public String getParameter_@ESC_ARTICLE_NAME@ (MobyJob request) - throws MobyException { + throws org.biomoby.shared.MobyException { return request.getParameter ("@ARTICLE_NAME@"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServiceSkeletonTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServiceSkeletonTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServiceSkeletonTemplate.java 2005/09/19 08:08:32 1.2 @@ -4,8 +4,6 @@ package @PACKAGE_NAME@; import org.biomoby.service.BaseService; -import org.biomoby.shared.MobyException; -import org.biomoby.shared.parser.MobyParameter; import org.biomoby.shared.parser.MobyJob; import org.biomoby.shared.parser.MobyPackage; import org.biomoby.shared.datatypes.*; @@ -61,7 +59,7 @@ // and return an XML back return mobyOutput.toXML(); - } catch (MobyException e) { + } catch (org.biomoby.shared.MobyException e) { return error (e.getMessage(), mobyOutput); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ToStringHASTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ToStringHASTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ToStringHASTemplate.java 2005/09/19 08:08:32 1.2 @@ -1,2 +1,2 @@ - for (Enumeration en = @ESC_ARTICLE_NAME@.elements(); en.hasMoreElements(); ) + for (java.util.Enumeration en = @ESC_ARTICLE_NAME@.elements(); en.hasMoreElements(); ) buf_I_am_sorry_that_this_produces_a_warning.append ( ((@CHILDTYPE_NAME@)en.nextElement()).format (1) ); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ToXMLHASTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ToXMLHASTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ToXMLHASTemplate.java 2005/09/19 08:08:32 1.2 @@ -1,2 +1,2 @@ - for (Enumeration en = @ESC_ARTICLE_NAME@.elements(); en.hasMoreElements(); ) + for (java.util.Enumeration en = @ESC_ARTICLE_NAME@.elements(); en.hasMoreElements(); ) elem_I_am_sorry_that_this_produces_a_warning.addContent ( ((@CHILDTYPE_NAME@)en.nextElement()).toXML() ); From senger at pub.open-bio.org Mon Sep 19 04:09:22 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon Sep 19 05:01:45 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190809.j8J89Mqj029314@pub.open-bio.org> senger Mon Sep 19 04:09:22 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv29299/src/main/org/biomoby/service/dashboard Added Files: RegistryModel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard RegistryModel.java,NONE,1.1 From senger at pub.open-bio.org Mon Sep 19 04:11:53 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon Sep 19 05:04:15 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190811.j8J8Briq029359@pub.open-bio.org> senger Mon Sep 19 04:11:53 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv29344/src/Clients Added Files: TestAnt.java Log Message: moby-live/Java/src/Clients TestAnt.java,NONE,1.1 From senger at pub.open-bio.org Mon Sep 19 12:19:27 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon Sep 19 13:11:49 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509191619.j8JGJRgQ030536@pub.open-bio.org> senger Mon Sep 19 12:19:27 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv30520/Java/src/Clients Removed Files: TestAnt.java Log Message: moby-live/Java/src/Clients TestAnt.java,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/Clients/RCS/TestAnt.java,v: No such file or directory From senger at pub.open-bio.org Tue Sep 20 03:30:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Sep 20 04:23:18 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509200730.j8K7U9YS003941@pub.open-bio.org> senger Tue Sep 20 03:30:09 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/images In directory pub.open-bio.org:/tmp/cvs-serv3903/images Modified Files: stylesheet.css Added Files: smile.gif smile_sad.gif Log Message: moby-live/Java/docs/images smile.gif,NONE,1.1 smile_sad.gif,NONE,1.1 stylesheet.css,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/images/stylesheet.css,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/docs/images/stylesheet.css 2005/08/29 13:21:59 1.4 +++ /home/repository/moby/moby-live/Java/docs/images/stylesheet.css 2005/09/20 07:30:09 1.5 @@ -93,3 +93,8 @@ color: navy; } +b.step { + background-color: white; + color: navy; + font-size: 8pt; + } From senger at pub.open-bio.org Tue Sep 20 03:30:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Sep 20 04:23:40 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509200730.j8K7U9nq003922@pub.open-bio.org> senger Tue Sep 20 03:30:09 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv3903 Modified Files: index.html Added Files: EclipseAndJMoby.html Log Message: moby-live/Java/docs EclipseAndJMoby.html,NONE,1.1 index.html,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/index.html,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Java/docs/index.html 2005/08/28 10:43:27 1.13 +++ /home/repository/moby/moby-live/Java/docs/index.html 2005/09/20 07:30:09 1.14 @@ -44,6 +44,7 @@

  • How to use jMoby @@ -89,7 +90,7 @@
    Martin Senger
    -Last modified: Sun Aug 28 19:37:25 2005 +Last modified: Tue Sep 20 12:21:24 2005
    From senger at pub.open-bio.org Tue Sep 20 03:43:25 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Sep 20 04:38:08 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509200743.j8K7hP2j004055@pub.open-bio.org> senger Tue Sep 20 03:43:25 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv4036 Modified Files: ToDo.html Log Message: moby-live/Java/docs ToDo.html,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ToDo.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/docs/ToDo.html 2005/05/19 11:00:41 1.3 +++ /home/repository/moby/moby-live/Java/docs/ToDo.html 2005/09/20 07:43:25 1.4 @@ -40,24 +40,10 @@
    MS - Generate a complete XML Schema for registered services. This -will allow to have complete WSDLs for BioMoby services, which will -further allow to use all existing tools using such WSDLs for -generating code and documentation. + Biomoby Dashboard - an ultimate GUI for maintaining and browsing Biomoby.

    -

    MS - Support for auto-generated clients (using the outcome of the -previous issue). -

    - -

    MS - Similar support for BioMoby service providers - a library -helping to hide SOAP and BioMoby envelope layers so service providers -can concentrate only on the business logic. -

    - -

    MS +
    ED More support for BioMoby complex data type in Taverna.

    @@ -84,9 +70,6 @@ reading directly RDF files with BioMoby entities.

    -

    - Consolidate all SOAP calls using (already in jMoby existing) -libraries SoapUtils and AxisUtils.

    @@ -94,7 +77,7 @@

    -

    Known bugs

    +

    Known bugs (see also Open-bio Bugzilla)

    @@ -119,7 +102,7 @@
    Martin Senger
    -Last modified: Thu May 19 11:20:08 2005 +Last modified: Tue Sep 20 16:34:17 2005
    From senger at pub.open-bio.org Tue Sep 20 03:48:14 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Sep 20 04:40:38 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509200748.j8K7mEK3004147@pub.open-bio.org> senger Tue Sep 20 03:48:14 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv4128 Modified Files: EclipseAndJMoby.html Log Message: moby-live/Java/docs EclipseAndJMoby.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/20 07:30:09 1.1 +++ /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/20 07:48:14 1.2 @@ -319,6 +319,10 @@ outside Eclipse you need refresh Eclipse: F5 or (jMoby) -> Refresh.

    +And, of course, for us, dinosaurs, change Windows +-> Preferences -> General -> Keys -> Modify -> +Schema to Emacs.

    + Good luck.

    @@ -326,7 +330,7 @@

    Martin Senger
    -Last modified: Tue Sep 20 16:21:13 2005 +Last modified: Tue Sep 20 16:39:39 2005
    From senger at pub.open-bio.org Tue Sep 20 11:17:55 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Sep 20 12:11:54 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509201517.j8KFHt51005654@pub.open-bio.org> senger Tue Sep 20 11:17:55 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv5631 Modified Files: ChangeLog EclipseAndJMoby.html Log Message: moby-live/Java/docs ChangeLog,1.40,1.41 EclipseAndJMoby.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/19 08:08:32 1.40 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/20 15:17:55 1.41 @@ -1,3 +1,8 @@ +2005-09-20 Martin Senger + + * Fixed CentralDigestImpl - it shows now correct service type + description. + 2005-09-19 Martin Senger * Added caching for namespaces to CentralDigestCachedImpl =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/20 07:48:14 1.2 +++ /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/20 15:17:55 1.3 @@ -32,7 +32,7 @@ ways to do" things in Eclipse (but not as many as in Perl ) so the steps described below may not represent the only way, and I do not claim that are the most -efficient - but TGB (The Good Thing) is that they work.

    +efficient - but TGT (The Good Thing) is that they work.

    jMoby is just like any other Ant-based Java project. It has its own build.xml and it has many @@ -330,7 +330,7 @@

    Martin Senger
    -Last modified: Tue Sep 20 16:39:39 2005 +Last modified: Wed Sep 21 00:09:16 2005
    From kawas at pub.open-bio.org Tue Sep 20 17:16:11 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue Sep 20 18:10:05 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202116.j8KLGBJP006460@pub.open-bio.org> kawas Tue Sep 20 17:16:11 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv6435 Modified Files: Central.pm Log Message: added the suggestions asked for by martin. Code that has been added is commented out until a decision is made on whether to support the changes. Code marked by: #UNCOMMENT denotes code that should be uncommented to add functionality #COMMENT/REMOVE denotes code that should be removed in conjunction with the additions. Lines subject to removal: 2620, 2626, 2806 Lines subject to addition: 2621, 2627, 2807 moby-live/Perl/MOBY Central.pm,1.215,1.216 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.215 retrieving revision 1.216 diff -u -r1.215 -r1.216 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/08/31 22:44:29 1.215 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/20 21:16:11 1.216 @@ -2617,12 +2617,14 @@ my $OS = MOBY::OntologyServer->new( ontology => 'service' ); my %types = %{ $OS->retrieveAllServiceTypes() }; my $types = "\n"; - while ( my ( $serv, $descr ) = each %types ) { + while ( my ( $serv, $descr ) = each %types ) { #COMMENT/REMOVE +# while ( my ( $serv, $descr, $contact, $auth ) = each %types ) { #UNCOMMENT my ($desc, $lsid) = @$descr; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - $types .="\n\n\n"; + $types .="\n\n\n"; #COMMENT/REMOVE +# $types .="\n\n$contact\n$auth\n\n"; #UNCOMMENT } $types .= "\n"; return $types; @@ -2801,7 +2803,8 @@ if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - $ns .= "\n\n\n"; + $ns .= "\n\n\n"; #COMMENT/REMOVE +# $ns .= "\n\n$contact\n$auth\n\n";#UNCOMMENT } $ns .= ""; return $ns; From gss at pub.open-bio.org Tue Sep 20 18:37:03 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Tue Sep 20 19:29:01 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202237.j8KMb33n006752@pub.open-bio.org> gss Tue Sep 20 18:37:03 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org In directory pub.open-bio.org:/tmp/cvs-serv6729 Removed Files: .mymetadata .project Log Message: Removed unused files moby-live/S-MOBY/ref-impl/semanticmoby.org .mymetadata,1.5,NONE .project,1.4,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/RCS/.mymetadata,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/RCS/.project,v: No such file or directory From gss at pub.open-bio.org Tue Sep 20 18:39:03 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Tue Sep 20 19:30:59 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202239.j8KMd3jC006793@pub.open-bio.org> gss Tue Sep 20 18:39:03 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/.settings In directory pub.open-bio.org:/tmp/cvs-serv6771/S-MOBY/ref-impl/semanticmoby.org/.settings Removed Files: org.eclipse.core.resources.prefs Log Message: Removed unused files moby-live/S-MOBY/ref-impl/semanticmoby.org/.settings org.eclipse.core.resources.prefs,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/.settings/RCS/org.eclipse.core.resources.prefs,v: No such file or directory From gss at pub.open-bio.org Tue Sep 20 18:42:18 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Tue Sep 20 19:34:15 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202242.j8KMgIsD006852@pub.open-bio.org> gss Tue Sep 20 18:42:18 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv6829/S-MOBY/ref-impl/semanticmoby.org/WebRoot Removed Files: log4j.properties smoby.example.properties Log Message: Removed unused files moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot log4j.properties,1.1,NONE smoby.example.properties,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/RCS/log4j.properties,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/RCS/smoby.example.properties,v: No such file or directory From gss at pub.open-bio.org Tue Sep 20 18:43:04 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Tue Sep 20 19:34:59 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202243.j8KMh499006893@pub.open-bio.org> gss Tue Sep 20 18:43:04 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv6871/S-MOBY/ref-impl/semanticmoby.org/WebRoot Removed Files: .cvsignore Log Message: Removed unused files moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot .cvsignore,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/RCS/.cvsignore,v: No such file or directory From senger at pub.open-bio.org Tue Sep 20 21:12:21 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Sep 20 22:06:12 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210112.j8L1CLfm007280@pub.open-bio.org> senger Tue Sep 20 21:12:20 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv7261 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.34,1.35 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/19 08:08:31 1.34 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/21 01:12:20 1.35 @@ -100,6 +100,21 @@ + + + + + + + + + + @@ -276,7 +291,7 @@ packagenames="*.*" excludepackagenames="notyet" destdir="${javadoc.dir}" - classpathref="build.classpath" + classpathref="build.classpath.for.javadoc" defaultexcludes="yes" breakiterator="yes" windowtitle="jMoby" From senger at pub.open-bio.org Tue Sep 20 21:20:01 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue Sep 20 22:12:38 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210120.j8L1K1Xe007374@pub.open-bio.org> senger Tue Sep 20 21:20:01 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv7350 Modified Files: EclipseAndJMoby.html Log Message: moby-live/Java/docs EclipseAndJMoby.html,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/20 15:17:55 1.3 +++ /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/21 01:20:01 1.4 @@ -310,6 +310,25 @@ class="step">Window -> Preferences -> Java -> Compiler -> Errors/Warnings not to see them.

    +

    Fix javadoc location

    + +Ant's targets using javadoc (such as docs or +moses-docs) may fail reporting an error +CreateProcess...javadoc.exe.... This is because the +executable javadoc.exe was not found. Eclipse has not +impressed me here: it can find java but but javadoc (even though I am +aware that javadoc in this case is considered as an external tool). So +you need to tell where is your javadoc.

    + +Either outside of Eclipse: add it to the environment variable PATH (a +usual way). Or inside Eclipse (but here I know only how to set it for +an individual project, not generally): Run -> +External Tools -> External Tool -> Ant Build -> jMoby +build.xml, select tab Environment -> New, +and create a new environment variable PATH and +give it directory where is javadoc, e.g. c:\Program +Files\Java\jdk1.5.0_05\bin.

    +

    Misc

    The project name now should have attached the CVS location. If not you @@ -330,7 +349,7 @@
    Martin Senger
    -Last modified: Wed Sep 21 00:09:16 2005 +Last modified: Wed Sep 21 10:11:37 2005
    From senger at pub.open-bio.org Wed Sep 21 00:02:15 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Sep 21 00:54:12 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210402.j8L42F87007753@pub.open-bio.org> senger Wed Sep 21 00:02:15 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv7734 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.35,1.36 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/21 01:12:20 1.35 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/21 04:02:15 1.36 @@ -72,8 +72,8 @@ - - + + @@ -1205,11 +1205,11 @@ - + - + - Property 'moses.service' is not set. + Neither property 'moses.service' or 'moses.authority is set. This means that skeletons for ALL services will be generated. If this is what you want, press 'y'. Continue? @@ -1248,6 +1248,13 @@ + + + + + + + From senger at pub.open-bio.org Wed Sep 21 01:26:18 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Sep 21 02:18:46 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210526.j8L5QIT7008156@pub.open-bio.org> senger Wed Sep 21 01:26:18 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv8101/src/config Modified Files: run-any-client.bat run-cache-client.bat run-cmdline-client.bat run-dashboard.bat run-digest-client.bat run-generator.bat run-graphs-client.bat run-moby-parser.bat run-service.bat run-testing-central.bat Log Message: making windows scripts better \(but not much\) moby-live/Java/src/config run-any-client.bat,1.4,1.5 run-cache-client.bat,1.2,1.3 run-cmdline-client.bat,1.3,1.4 run-dashboard.bat,1.1,1.2 run-digest-client.bat,1.2,1.3 run-generator.bat,1.2,1.3 run-graphs-client.bat,1.2,1.3 run-moby-parser.bat,1.2,1.3 run-service.bat,1.2,1.3 run-testing-central.bat,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-any-client.bat,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/09/18 08:46:25 1.4 +++ /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/09/21 05:26:18 1.5 @@ -1,7 +1,7 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" -cd %PROJECT_HOME% +cd "%PROJECT_HOME%" set CP= for %%i in (lib\*.jar) do call cp.bat %%i set CP=build\classes;%CP% =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat 2005/09/21 05:26:18 1.3 @@ -1,9 +1,10 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% java -classpath "%CP%" CacheRegistryClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2005/09/21 05:17:32 1.3 +++ /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2005/09/21 05:26:18 1.4 @@ -1,7 +1,7 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" -cd %PROJECT_HOME% +cd "%PROJECT_HOME%" set CP= for %%i in (lib\*.jar) do call cp.bat %%i set CP=build\classes;%CP% =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat 2005/09/18 14:05:32 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat 2005/09/21 05:26:18 1.2 @@ -1,12 +1,13 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" -set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" -set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" -set "CP=%PROJECT_HOME%\build\others\samples;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% +set CP=build\others\datatypes;%CP% +set CP=build\others\skeletons;%CP% +set CP=build\others\samples;%CP% java -classpath "%CP%" org.biomoby.service.dashboard.Dashboard %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat 2005/09/21 05:26:18 1.3 @@ -1,9 +1,10 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% java -classpath "%CP%" MobyDigestClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-generator.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-generator.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-generator.bat 2005/09/21 05:26:18 1.3 @@ -1,11 +1,12 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" -set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" -set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% +set CP=build\others\datatypes;%CP% +set CP=build\others\skeletons;%CP% java -classpath "%CP%" MosesGenerators %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat 2005/09/21 05:26:18 1.3 @@ -1,9 +1,10 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% java -classpath "%CP%" MobyGraphs %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat 2005/09/21 05:26:18 1.3 @@ -1,10 +1,11 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" -set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% +set CP=build\others\datatypes;%CP% java -classpath "%CP%" TestingMobyParser %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-service.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-service.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-service.bat 2005/09/21 05:26:18 1.3 @@ -1,12 +1,13 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" -set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" -set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" -set "CP=%PROJECT_HOME%\build\others\samples;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% +set CP=build\others\datatypes;%CP% +set CP=build\others\skeletons;%CP% +set CP=build\others\samples;%CP% java -classpath "%CP%" org.biomoby.client.BaseCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat 2005/09/21 05:26:18 1.3 @@ -1,9 +1,10 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% java -classpath "%CP%" TestingCentral %1 %2 %3 %4 %5 %6 %7 %8 %9 From senger at pub.open-bio.org Wed Sep 21 02:03:49 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Sep 21 02:55:54 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210603.j8L63nsa008383@pub.open-bio.org> senger Wed Sep 21 02:03:49 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv8360 Modified Files: ChangeLog EclipseAndJMoby.html Log Message: moby-live/Java/docs ChangeLog,1.41,1.42 EclipseAndJMoby.html,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/20 15:17:55 1.41 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/21 06:03:49 1.42 @@ -1,3 +1,8 @@ +2005-09-21 Martin Senger + + * Fixed build.xml not to produce javadoc warnings with Java 1.5 in + Eclipse. + 2005-09-20 Martin Senger * Fixed CentralDigestImpl - it shows now correct service type =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/21 01:20:01 1.4 +++ /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/21 06:03:49 1.5 @@ -329,6 +329,34 @@ give it directory where is javadoc, e.g. c:\Program Files\Java\jdk1.5.0_05\bin.

    +

    Running jMoby command-line scripts

    + +jMoby has a few scripts that can be invoked from a command-line with +number of arguments. From the Eclipse point of view, they are the same +as any other external tools. Perhaps the only difference is that they +must be first copied from their source directory (src/config) +to their destination place (build/run). The copying is not +used because it matters where they are invoked from, but because they +are not only copied but also updated. That's why - before you use them +- you need (at least once) to run a jMoby Ant's task compile or config. Eclipse own +compilation (called building) is not enough, it does not copy +the scripts.

    + +Once you have them in build/run you can run them from Eclipse +(as always with external scripts, you type more the first time you use +a script, but Eclipse remembers it and the next time you will see +already your script name in a menu): Run -> +External Tools -> External Tools -> Program -> New. Name +it (e.g. run-cmdline-client), and Location +-> Browse Workspace to select it (in our example find and +select build/run/run-cmdline-client.bat). Most of these +scripts have an option -help - so put it in Arguments - and change it each time you wish to +invoke them with different arguments.

    + + +

    Misc

    The project name now should have attached the CVS location. If not you @@ -349,7 +377,7 @@
    Martin Senger
    -Last modified: Wed Sep 21 10:11:37 2005 +Last modified: Wed Sep 21 14:55:00 2005
    From senger at pub.open-bio.org Wed Sep 21 01:17:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Sep 21 03:00:24 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210517.j8L5HWaS008047@pub.open-bio.org> senger Wed Sep 21 01:17:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv8028/src/config Modified Files: run-cmdline-client.bat Log Message: make it better for windows moby-live/Java/src/config run-cmdline-client.bat,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2005/09/21 05:17:32 1.3 @@ -1,9 +1,10 @@ -@echo off - -set "PROJECT_HOME=@PROJECT_HOME@" -set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" - -java -classpath "%CP%" MobyCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 +@echo off + +set "PROJECT_HOME=@PROJECT_HOME@" +cd %PROJECT_HOME% +set CP= +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% + +java -classpath "%CP%" MobyCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 From senger at pub.open-bio.org Wed Sep 21 02:13:28 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Sep 21 03:05:41 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210613.j8L6DSAa008441@pub.open-bio.org> senger Wed Sep 21 02:13:28 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv8418 Modified Files: run-dashboard run-dashboard.bat Log Message: moby-live/Java/src/config run-dashboard,1.1,1.2 run-dashboard.bat,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-dashboard,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-dashboard 2005/09/18 14:05:32 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-dashboard 2005/09/21 06:13:28 1.2 @@ -12,6 +12,7 @@ CLASSPATH=${PROJECT_HOME}/build/others/datatypes:$CLASSPATH CLASSPATH=${PROJECT_HOME}/build/others/skeletons:$CLASSPATH CLASSPATH=${PROJECT_HOME}/build/others/samples:$CLASSPATH +CLASSPATH=${PROJECT_HOME}/build/lib/dashboard-config.jar:$CLASSPATH CLASSPATH=`echo ${PROJECT_HOME}/lib/*.jar | tr ' ' ':'`:$CLASSPATH exec java -cp $CLASSPATH org.biomoby.service.dashboard.Dashboard "$@" =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat 2005/09/21 05:26:18 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat 2005/09/21 06:13:28 1.3 @@ -9,5 +9,6 @@ set CP=build\others\datatypes;%CP% set CP=build\others\skeletons;%CP% set CP=build\others\samples;%CP% +set CP=build\lib\dashboard-config.jar;%CP% java -classpath "%CP%" org.biomoby.service.dashboard.Dashboard %1 %2 %3 %4 %5 %6 %7 %8 %9 From senger at pub.open-bio.org Wed Sep 21 03:56:55 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Sep 21 04:50:05 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210756.j8L7ut1R008830@pub.open-bio.org> senger Wed Sep 21 03:56:55 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv8807 Modified Files: EclipseAndJMoby.html index.html Added Files: WindowsAndJMoby.html Log Message: moby-live/Java/docs WindowsAndJMoby.html,NONE,1.1 EclipseAndJMoby.html,1.5,1.6 index.html,1.14,1.15 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/21 06:03:49 1.5 +++ /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/21 07:56:55 1.6 @@ -331,17 +331,17 @@

    Running jMoby command-line scripts

    -jMoby has a few scripts that can be invoked from a command-line with -number of arguments. From the Eclipse point of view, they are the same -as any other external tools. Perhaps the only difference is that they -must be first copied from their source directory (src/config) -to their destination place (build/run). The copying is not -used because it matters where they are invoked from, but because they -are not only copied but also updated. That's why - before you use them -- you need (at least once) to run a jMoby Ant's task compile or config. Eclipse own -compilation (called building) is not enough, it does not copy -the scripts.

    +jMoby has a few scripts that can be +invoked from a command-line with number of arguments. From the Eclipse +point of view, they are the same as any other external tools. Perhaps +the only difference is that they must be first copied from their +source directory (src/config) to their destination place +(build/run). The copying is not used because it matters where +they are invoked from, but because they are not only copied but also +updated. That's why - before you use them - you need (at least once) +to run a jMoby Ant's task compile or config. Eclipse own compilation (called +building) is not enough, it does not copy the scripts.

    Once you have them in build/run you can run them from Eclipse (as always with external scripts, you type more the first time you use @@ -377,7 +377,7 @@

    Martin Senger
    -Last modified: Wed Sep 21 14:55:00 2005 +Last modified: Wed Sep 21 15:07:18 2005
    =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/index.html,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- /home/repository/moby/moby-live/Java/docs/index.html 2005/09/20 07:30:09 1.14 +++ /home/repository/moby/moby-live/Java/docs/index.html 2005/09/21 07:56:55 1.15 @@ -45,6 +45,7 @@ @@ -90,7 +91,7 @@
    Martin Senger
    -Last modified: Tue Sep 20 12:21:24 2005 +Last modified: Wed Sep 21 15:27:30 2005
    From kawas at pub.open-bio.org Wed Sep 21 13:11:39 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed Sep 21 14:05:36 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509211711.j8LHBd6h012052@pub.open-bio.org> kawas Wed Sep 21 13:11:39 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/errorpages In directory pub.open-bio.org:/tmp/cvs-serv12027/org/biomoby/client/ui/graphical/servlet/errorpages Modified Files: Error404.java Log Message: removed carriage returns moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/errorpages Error404.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/errorpages/Error404.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/errorpages/Error404.java 2005/04/07 21:02:01 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/errorpages/Error404.java 2005/09/21 17:11:39 1.3 @@ -86,7 +86,7 @@ + " contents='';" + " row=Math.max(0,index-7);" + " while(row kawas Wed Sep 21 13:13:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources In directory pub.open-bio.org:/tmp/cvs-serv12084/org/biomoby/client/ui/graphical/servlet/jresources Modified Files: RESOURCE.java Log Message: removed carriage returns and replaced \n with more portable java system calls. moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources RESOURCE.java,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java 2005/08/29 23:11:08 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java 2005/09/21 17:13:51 1.11 @@ -130,7 +130,7 @@ + " contents='';" + " row=Math.max(0,index-7);" + " while(row\r\n"); + "" + System.getProperty("line.separator") + ""); // add the predicates here buffer.append(createOntologyBlock("http://biomoby.org/RESOURCES/MOBY-S/Predicates#", "The BioMoby Predicates Vocabulary (moby)", @@ -1163,7 +1163,7 @@ // end the addition of predicates here buffer.append( - "\r\n" + + "" + System.getProperty("line.separator") + "" + ""); return buffer.toString(); } @@ -1171,56 +1171,56 @@ private String createPropertyBlock(String about, String definedBy, String label, String comment, String domain, String range) { String s = - "\r\n\r\n" + - " \r\n" + - " " + label + "\r\n" + - " " + comment + "\r\n" + - " \r\n" + - " \r\n" + - "\r\n"; + "" + System.getProperty("line.separator") + "" + System.getProperty("line.separator") + "" + + " " + System.getProperty("line.separator") + "" + + " " + label + "" + System.getProperty("line.separator") + "" + + " " + comment + "" + System.getProperty("line.separator") + "" + + " " + System.getProperty("line.separator") + "" + + " " + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + ""; return s; } private String createClassBlock(String about, String definedBy, String label, String comment, String subClassOf) { String s = - "\r\n\r\n" + - " \r\n" + - " "+ label +"\r\n" + - " "+ comment +"\r\n" + - " \r\n" + - "\r\n"; + "" + System.getProperty("line.separator") + "" + System.getProperty("line.separator") + "" + + " " + System.getProperty("line.separator") + "" + + " "+ label +"" + System.getProperty("line.separator") + "" + + " "+ comment +"" + System.getProperty("line.separator") + "" + + " " + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + ""; return s; } private String createDescriptionBlock(String about, String[] seeAlsos) { if (seeAlsos == null) - return "\r\n"; + return "" + System.getProperty("line.separator") + ""; StringBuffer sb = new StringBuffer(); - sb.append(" \r\n"); + sb.append(" " + System.getProperty("line.separator") + ""); for (int x = 0; x < seeAlsos.length; x++) { - sb.append(" \r\n"); + sb.append(" " + System.getProperty("line.separator") + ""); } - sb.append("\r\n"); + sb.append("" + System.getProperty("line.separator") + ""); return sb.toString(); } private String createOntologyBlock(String about, String title, String description) { - String s ="\r\n\r\n" + " " + title + "\r\n" - + " " + description + "\r\n" - + "\r\n"; + String s ="" + System.getProperty("line.separator") + "" + System.getProperty("line.separator") + "" + " " + title + "" + System.getProperty("line.separator") + "" + + " " + description + "" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + ""; return s; } private String createEscapedComment(String comment) { - String s = "\r\n\r\n"; + String s = "" + System.getProperty("line.separator") + "" + System.getProperty("line.separator") + ""; return s; } public static void main(String[] args) throws Exception { - System.out.println(new RESOURCE().getRESOURCES("Namespaces")); + System.out.println(new RESOURCE().getRESOURCES("Predicates")); } } \ No newline at end of file From fgibbons at pub.open-bio.org Wed Sep 21 15:08:28 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Wed Sep 21 16:01:05 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509211908.j8LJ8Sc0012462@pub.open-bio.org> fgibbons Wed Sep 21 15:08:28 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv12437/t Modified Files: CommonSubs.t Log Message: - Added new test of collectionResponse, including tests for correct failure. - Still needs tests for complexResponse, whatever that is .... - Fixed earlier test that tried to create article from empty string. moby-live/Perl/t CommonSubs.t,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/CommonSubs.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/t/CommonSubs.t 2005/08/30 15:19:05 1.2 +++ /home/repository/moby/moby-live/Perl/t/CommonSubs.t 2005/09/21 19:08:28 1.3 @@ -11,13 +11,13 @@ # change 'tests => 1' to 'tests => last_test_to_print'; #use SOAP::Lite +trace; -use Test::More 'no_plan'; #tests => 127; # perldoc Test::More for details +use Test::More 'no_plan'; #skip_all => "Turned off for development"; #'no_plan'; use strict; use English; use Data::Dumper; #Is the client-code even installed? BEGIN { use_ok('MOBY::CommonSubs') }; -use MOBY::CommonSubs qw /:all/; +use MOBY::CommonSubs qw/:all/; use XML::LibXML; use MOBY::MobyXMLConstants; @@ -26,33 +26,34 @@ }; my @must_implement = qw/ - genericServiceInputParser - genericServiceInputParserAsObject + collectionResponse + complexResponse complexServiceInputParser extractRawContent - validateNamespaces - validateThisNamespace + extractResponseArticles + genericServiceInputParser + genericServiceInputParserAsObject + getArticles + getCollectedSimples + getCrossReferences getInputArticles - getInputs getInputID - getArticles + getInputs + getNodeContentWithArticle + getResponseArticles + getServiceNotes getSimpleArticleIDs getSimpleArticleNamespaceURI - getCollectedSimples - getNodeContentWithArticle - isSimpleArticle isCollectionArticle isSecondaryArticle - extractResponseArticles - getResponseArticles - getCrossReferences - simpleResponse - collectionResponse - complexResponse - responseHeader + isSimpleArticle responseFooter + responseHeader + simpleResponse + validateNamespaces + validateThisNamespace whichDeepestParentObject - getServiceNotes/; +/; can_ok('MOBY::CommonSubs', @must_implement) or diag("CommonSubs doesn't implement all the methods that it should"); @@ -65,21 +66,21 @@ # complexServiceInputParser ######## EXTRACT CONTENTS ######### +my @query_ids = (1, 'a', 23, 24); my $msg = < - - -foo + + + +foo EOF my @inputs = getInputs(responseHeader() . $msg . responseFooter()); -is(scalar @inputs, 4) +is(scalar @inputs, scalar @query_ids) or diag("Wrong number of inputs returned from getInputs"); -is(getInputID($inputs[0]), 1) or diag("Wrong input ID returned for $inputs[0]"); -is(getInputID($inputs[1]), 'a') or diag("Wrong input ID returned for $inputs[1]"); -is(getInputID($inputs[2]), 23) or diag("Wrong input ID returned for $inputs[2]"); -is(getInputID($inputs[3]), 24) or diag("Wrong input ID returned for $inputs[3]"); - +for (my $i = 0; $i < @query_ids; $i++) { + is(getInputID($inputs[$i]), $query_ids[$i]) + or diag("Wrong input ID returned for queryID $i: $inputs[$i]"); +} # This message contains two articles: Collection, and Parameter # The Collection, of course, contains some Simple Articles, but they are not top-level articles. my $article_msg = < - + " @@ -252,7 +258,11 @@ my $parser = XML::LibXML->new(); my $doc; eval { $doc = $parser->parse_string( $XML ); }; - return '' if ( $EVAL_ERROR ); #("Couldn't parse '$XML' because:\n\t$EVAL_ERROR") + if ($EVAL_ERROR) { + my ($package, $filename, $line) = caller; + die "XML_maker called from line $line:Couldn't parse '$XML' because:\n\t" + . "$EVAL_ERROR"; + } return $doc->getDocumentElement(); } @@ -280,7 +290,7 @@ # and for completely fictitious parameters. # Examples here should be syntactically correct (namespace should be correct) # just wrong article-types. -my @not_articles = ("", "", "foo", +my @not_articles = ("", "foo", "", "", ""); for my $a (@not_articles) { for my $test (\&isSimpleArticle, \&isCollectionArticle, \&isSecondaryArticle) { @@ -322,18 +332,19 @@ my $sresp = XML_maker(responseHeader() # Need header for namespace def . simpleResponse($data, $articleName, $qID) . responseFooter()); -$sresp = $sresp->getElementsByTagName('moby:mobyData') - || $sresp->getElementsByTagName('mobyData'); +$sresp = $sresp->getElementsByTagName('moby:mobyData'); +# || $sresp->getElementsByTagName('mobyData'); is($sresp->size(), 1) or diag("SimpleResponse should contain only a single mobyData element."); my $mobyData = $sresp->get_node(1); -is($mobyData->getAttribute('queryID') || $mobyData->getAttribute('moby:queryID'), $qID) +is($mobyData->getAttribute('moby:queryID') || $mobyData->getAttribute('queryID'), + $qID) or diag("SimpleResponse didn't contain right queryID"); -my $children = $mobyData->childNodes; + my $simple; my $count_elements = 0; -foreach ($children->get_nodelist) { - if ($_->nodeType == ELEMENT_NODE) { $simple = $_; $count_elements++;} +foreach ($mobyData->childNodes->get_nodelist) { + if ($_->nodeType == ELEMENT_NODE) { $count_elements++ } } is($count_elements, 1) or diag("SimpleResponse's mobyData should have only a single child element:"); @@ -347,10 +358,80 @@ TODO: { local $TODO = "Need tests for collectionResponse and complexResponse"; - # collectionResponse - # complexResponse +# complexResponse takes two arguments: $data, $qID +# $data is arrayref, elements can also be arrayref, or string. +#my $data = ''; + +} +{ + # collectionResponse takes 3 args: $data, $articlename, $qID + # $data is a arrayref of MOBY OBjects as raw XML. + my ($qID, $aname, $ns, $id, $string) = ("23", "my_artIcLe", "taxon", "foo", "some_text"); + my $simple = "$string"; + my $data = [$simple, $simple, $simple]; + my $coll_resp = collectionResponse($data, $aname, $qID); + + # Regular expressions are not the best way (!) to validate XML, but it's worth a quick check. + ok($coll_resp =~ /^\s* \ # Top-level tag should be mobyData +\s* \ +.* # Don't worry too much about the innermost details - we'll get them with DOM. +\s* \<\/moby\:Collection\> +\s* \<\/moby\:mobyData\> \s* $/sx) + # In above regexpt, 's' allows matching in multiline strings; + # 'x' ignores comments and literal whitespace in regexp + # Because we attempt to return 'pretty' XML, we need to allow for whitespace between all tags, + # which explains why the regexp is peppered with '\s*' + or diag("collectionResponse should have mobyData as outermost tag: got '$coll_resp'"); + # Now parse the XML, and make sure it checks out according to DOM + my $coll_resp_dom = XML_maker(responseHeader() . $coll_resp . responseFooter()); + my $mData = $coll_resp_dom->getElementsByTagName('moby:mobyData'); + is($mData->size(), 1) + or diag("CollectionResponse should contain only a single mobyData element."); + $mData = $mData->get_node(1); + is($mData->getAttribute('moby:queryID') || $mData->getAttribute('queryID'), + $qID) + or diag("CollectionResponse's mobyData element didn't contain correct queryID"); + my $colls = $mData->getElementsByTagName("moby:Collection"); + is ($colls->size(), 1) + or diag("CollectionResponse should have only a single child: Collection."); + my $Coll = $colls->get_node(1); + is($Coll->getAttribute('moby:articleName') || $Coll->getAttribute('articleName'), + $aname) + or diag("CollectionResponse didn't contain correct articleName"); + my $simples = $Coll->getElementsByTagName("moby:Simple") + || $Coll->getElementsByTagName("Simple"); + is(scalar @{$simples}, scalar @{$data}) + or diag("CollectionResponse contains wrong number of Simples"); + + # # Finally, parse the sucker with the tools in CommonSubs: it should be able to understand its own creations! + my @inputs = getInputs(responseHeader() . $coll_resp . responseFooter() ); + is(scalar @inputs, 1) + or diag("CollectionResponse should contain only one mobyData block"); + is(getInputID($inputs[0]), $qID) + or diag("CollectionResponse returned mobyData block with incorrect queryID attribute"); + my @articles = getArticles($inputs[0]); + is(scalar @articles, 1) + or diag("CollectionResponse should contain only one Collection"); + is($articles[0]->[0], $aname) + or diag("CollectionResponse had incorrect articleName"); + my @collected_simples = getCollectedSimples($articles[0]->[1]); + is(scalar @collected_simples , scalar @{$data}) + or diag("CollectionResponse contained incorrect number of Simples"); + +# Test response when one or more simples are empty/undef. +# They should result in empty Simple tags, but the total response should NOT be empty. + $coll_resp = collectionResponse([], $aname, $qID); + ok($coll_resp =~ /^\s*\$/) + or diag("CollectionResponse should be empty mobyData tag when empty data supplied"); + $data = [undef, $simple, $simple]; + $coll_resp = collectionResponse($data, $aname, $qID); + ok( !($coll_resp =~ /^\s*\$/sx)) + or diag("CollectionResponse should not be empty " + . "just because first element evaluates to false"); } +#------------------ # Check header/footer # How can we parse incomplete XML for correctness....? my ($authURI, $service_notes) = ("your.site.here", From senger at pub.open-bio.org Sun Sep 18 04:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed Sep 21 16:14:42 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQgF023487@pub.open-bio.org> senger Sun Sep 18 04:46:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv23355/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java ConsolePanel.java Dashboard.java DashboardPanel.java DashboardProperties.java EventGeneratorPanel.java NOTES RegistryPanel.java Added Files: CommonTree.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard CommonTree.java,NONE,1.1 AbstractPanel.java,1.3,1.4 ConsolePanel.java,1.1,1.2 Dashboard.java,1.1,1.2 DashboardPanel.java,1.2,1.3 DashboardProperties.java,1.1,1.2 EventGeneratorPanel.java,1.1,1.2 NOTES,1.1,1.2 RegistryPanel.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/13 06:53:28 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/18 08:46:26 1.4 @@ -8,21 +8,48 @@ package org.biomoby.service.dashboard; +import org.tulsoft.shared.UUtils; +import org.tulsoft.shared.PrefsUtils; import org.tulsoft.tools.gui.SwingUtils; +import org.tulsoft.tools.gui.JTextFieldWithHistory; +import org.tulsoft.tools.gui.JFileChooserWithHistory; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.Icon; -import javax.swing.JComponent; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JTextField; +import javax.swing.JFileChooser; import javax.swing.AbstractButton; +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.border.Border; +import javax.swing.border.TitledBorder; +import javax.swing.border.CompoundBorder; +import javax.swing.border.EmptyBorder; +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.filechooser.FileFilter; import javax.swing.text.html.HTMLDocument; +import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import java.awt.Insets; +import java.awt.Font; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import java.awt.event.ItemListener; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeSupport; +import java.io.File; +import java.util.prefs.Preferences; + /** * WORK IN PROGRESS.

    * @@ -34,31 +61,29 @@ extends JPanel implements DashboardPanel { - // copy here some often used constants protected static final int RELATIVE = GridBagConstraints.RELATIVE; protected static final int REMAINDER = GridBagConstraints.REMAINDER; protected static final int NONE = GridBagConstraints.NONE; protected static final int BOTH = GridBagConstraints.BOTH; - protected static final int HORIZONTAL = GridBagConstraints.HORIZONTAL; - protected static final int VERTICAL = GridBagConstraints.VERTICAL; + protected static final int HORI = GridBagConstraints.HORIZONTAL; + protected static final int VERT = GridBagConstraints.VERTICAL; protected static final int CENTER = GridBagConstraints.CENTER; protected static final int NORTH = GridBagConstraints.NORTH; - protected static final int NORTHEAST = GridBagConstraints.NORTHEAST; + protected static final int NEAST = GridBagConstraints.NORTHEAST; protected static final int EAST = GridBagConstraints.EAST; - protected static final int SOUTHEAST = GridBagConstraints.SOUTHEAST; + protected static final int SEAST = GridBagConstraints.SOUTHEAST; protected static final int SOUTH = GridBagConstraints.SOUTH; - protected static final int SOUTHWEST = GridBagConstraints.SOUTHWEST; + protected static final int SWEST = GridBagConstraints.SOUTHWEST; protected static final int WEST = GridBagConstraints.WEST; - protected static final int NORTHWEST = GridBagConstraints.NORTHWEST; - protected static final int PAGE_START = GridBagConstraints.PAGE_START; - protected static final int PAGE_END = GridBagConstraints.PAGE_END; - protected static final int LINE_START = GridBagConstraints.LINE_START; - protected static final int LINE_END = GridBagConstraints.LINE_END; - protected static final int FIRST_LINE_START = GridBagConstraints.FIRST_LINE_START; - protected static final int FIRST_LINE_END = GridBagConstraints.FIRST_LINE_END; - protected static final int LAST_LINE_START = GridBagConstraints.LAST_LINE_START; - protected static final int LAST_LINE_END = GridBagConstraints.LAST_LINE_END; + protected static final int NWEST = GridBagConstraints.NORTHWEST; + + // something need to be done only once - keep it here + protected Icon panelIcon; + protected JComponent pComponent; + + // re-use "style" components + protected static final Insets BREATH_TOP = new Insets (10,0,0,0); /********************************************************************* @@ -82,6 +107,16 @@ return null; } + /************************************************************************** + * + **************************************************************************/ + public JLabel getTitle() { + JLabel title = new JLabel (getName(), getIcon(), JLabel.CENTER); + title.setFont (new Font ("Serif", Font.BOLD, 20)); + title.setForeground (new Color (12, 55, 241)); + return title; + } + /********************************************************************* * Property change stuff ********************************************************************/ @@ -117,11 +152,6 @@ **************************************************************************/ abstract public String getName(); - /************************************************************************** - * - **************************************************************************/ - abstract public JLabel getTitle(); - // // Methods to be used by sub-classes // @@ -137,6 +167,112 @@ } /********************************************************************* + * Create a button (with a unified style). + ********************************************************************/ + protected static JButton createButton (String name, + String toolTipText, + int mnemonic, + ActionListener listener) { + JButton button = new JButton (name); + commonButtonLookAndFeel (button); + button.setToolTipText (toolTipText); + if (mnemonic > 0) + button.setMnemonic (mnemonic); + button.addActionListener (listener); + return button; + } + + /********************************************************************* + * Create a check-box (with a unified style). + ********************************************************************/ + protected static JCheckBox createCheckBox (String label, + boolean isSelected, + int mnemonic, + ItemListener listener) { + JCheckBox box = new JCheckBox (label, isSelected); + if (mnemonic > 0) + box.setMnemonic (mnemonic); + box.addItemListener (listener); + box.setFocusPainted (false); + return box; + } + + /********************************************************************* + * Create a horizontal panel with given buttons. + ********************************************************************/ + protected static JPanel createButtonPanel (JButton[] buttons) { + + JPanel buttonPanel = new JPanel(); + buttonPanel.setLayout (new BoxLayout (buttonPanel, BoxLayout.LINE_AXIS)); + buttonPanel.setBorder (BorderFactory.createEmptyBorder (10, 0, 0, 10)); + buttonPanel.add (Box.createHorizontalGlue()); + for (int i = 0; i < buttons.length; i++) + buttonPanel.add (buttons[i]); + return buttonPanel; + } + + /********************************************************************* + * Create a titled panel using the given title and GridBagLayout. + ********************************************************************/ + protected static JPanel createTitledPanel (String title) { + JPanel titledPanel = new JPanel (new GridBagLayout()); + Border blackline = BorderFactory.createLineBorder (Color.black); + CompoundBorder compoundBorder = + BorderFactory.createCompoundBorder (BorderFactory.createTitledBorder (blackline, title), + BorderFactory.createEmptyBorder (5, 5, 5, 5)); + titledPanel.setBorder (compoundBorder); + return titledPanel; + } + + /********************************************************************* + * Create a panel with given text field and with a directory/file + * browser button attached. + * + * @param chooserMode should be one of + * JFileChooser.DIRECTORIES_ONLY, JFileChooser.FILES_ONLY, and + * JFileChooser.FILES_AND_DIRECTORIES (but it is not tested) + ********************************************************************/ + protected JFileChooserWithHistory createFileSelector (String chooserTitle, + String approveButtonText, + int chooserMode, + String defaultValue, + FileFilter filter) { + JFileChooserWithHistory chooser = + new JFileChooserWithHistory (null, this, "cacheDirectory"); + + JFileChooser ch = chooser.getFileChooser(); + ch.setFileSelectionMode (chooserMode); + if (filter != null) + ch.setFileFilter (filter); + ch.setApproveButtonText (approveButtonText); + ch.setDialogTitle (chooserTitle); + + if (UUtils.notEmpty (defaultValue) && + chooser.getSelectedFile() == null) + chooser.setSelectedFile (new File (defaultValue)); + + return chooser; + } + + /********************************************************************* + * + ********************************************************************/ + protected boolean getPrefValue (String key, + boolean defaultValue) { + Preferences node = PrefsUtils.getNode (this.getClass()); + return node.getBoolean (key, defaultValue); + } + + /********************************************************************* + * + ********************************************************************/ + protected void setPrefValue (String key, + boolean value) { + Preferences node = PrefsUtils.getNode (this.getClass()); + node.putBoolean (key, value); + } + + /********************************************************************* * Return true if confirmation dialog passed. ********************************************************************/ public boolean confirm (Object msg) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/13 06:54:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/18 08:46:26 1.2 @@ -22,6 +22,7 @@ import java.awt.Font; import java.awt.GridBagLayout; +import java.awt.event.KeyEvent; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.beans.PropertyChangeListener; @@ -85,19 +86,20 @@ textArea.setEditable (false); JScrollPane scroller = new JScrollPane (textArea); - JButton cleanButton = new JButton (" Clean "); - commonButtonLookAndFeel (cleanButton); - cleanButton.setToolTipText ("Remove all messages from the console area"); - cleanButton.addActionListener (new ActionListener() { - public void actionPerformed (ActionEvent e) { - if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) - textArea.setText (""); - } - }); + JButton cleanButton = + createButton (" Clean ", + "Remove all messages from the console area", + KeyEvent.VK_C, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) + textArea.setText (""); + } + }); // put it together - SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, FIRST_LINE_START, 1.0, 1.0); - SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, FIRST_LINE_START, 0.0, 0.0); + SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); + SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); return p; } @@ -109,11 +111,4 @@ return "Debugging Console"; } - /************************************************************************** - * - **************************************************************************/ - public JLabel getTitle() { - return new JLabel (getName()); - } - } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/13 06:54:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/18 08:46:26 1.2 @@ -20,7 +20,11 @@ import javax.swing.JLabel; import javax.swing.Icon; import javax.swing.text.html.HTMLDocument; +import javax.swing.event.ChangeListener; +import javax.swing.event.ChangeEvent; + import java.awt.GridBagLayout; +import java.awt.Font; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; @@ -29,7 +33,9 @@ import java.util.Vector; import java.util.Enumeration; import java.util.Properties; +import java.util.Date; import java.net.URL; +import java.text.DateFormat; /** * WORK IN PROGRESS.

    @@ -39,13 +45,16 @@ */ public class Dashboard - implements DashboardPanel { + implements DashboardPanel, ChangeListener { + private JComponent dashboard; + private StatusBar statusBar; + private DashboardHeader header; + protected JTabbedPane tabbedPane; protected DashboardPanel[] panels; protected static Properties dashboardProperties; static { - final String DASHBOARD_PROPERTIES_FILE = "dashboard.properties"; try { // get the classloader for this class ClassLoader loader = Dashboard.class.getClassLoader(); @@ -53,11 +62,8 @@ loader = Thread.currentThread().getContextClassLoader(); } -// unknownProcessorIcon = -// new ImageIcon(loader.getResource("org/embl/ebi/escience/scuflui/icons/explorer/unknownprocessor.png")); - - // load values from any dashboard.properties file located - // by the class resource loader + // load dashboard properties from a file located by the + // class resource loader Enumeration en = loader.getResources (DASHBOARD_PROPERTIES_FILE); dashboardProperties = new Properties(); while (en.hasMoreElements()) { @@ -71,6 +77,16 @@ } /************************************************************************** + * Default constructor. It loads all panels, connect them and + * creates the GUI - but does not show it yet. + **************************************************************************/ + public Dashboard() { + loadPanels(); + dashboard = getComponent(); + connectPanels(); + } + + /************************************************************************** * Load all available Dashboard panels... **************************************************************************/ public void loadPanels() { @@ -84,31 +100,26 @@ } /************************************************************************** - * Connect all available Dashboard panels... + * Connect all available Dashboard panels: a) together, and b) + * with the status bar. **************************************************************************/ public void connectPanels() { for (int i = 0; i < panels.length; i++) { for (int j = 0; j < i; j++) - connect (panels[i], panels[j]); + panels[i].addPropertyChangeListener (panels[j]); for (int j = i+1; j < panels.length; j++) - connect (panels[i], panels[j]); + panels[i].addPropertyChangeListener (panels[j]); + if (statusBar != null) + panels[i].addPropertyChangeListener (statusBar); } } - // - void connect (DashboardPanel one, DashboardPanel two) { - one.addPropertyChangeListener (two); - } - /************************************************************************** * Show the main frame. **************************************************************************/ public void show() { - JComponent dashboard = getComponent(); - - JFrame frame = SwingUtils.createMainFrame (dashboard, getName()); + JFrame frame = SwingUtils.createMainFrame (getComponent(), getName()); SwingUtils.showMainFrame (frame, dashboard.getPreferredSize()); -// SwingUtils.showMainFrame (frame, dashboard.getPreferredFrameSize()); } /************************************************************************** @@ -125,20 +136,6 @@ return new String (buf); } - /************************************************************************** - * - **************************************************************************/ - public static void main (String[] args) { - SwingUtils.checkJavaVersion(); - - Dashboard dashboard = new Dashboard(); - dashboard.loadPanels(); - dashboard.connectPanels(); -// System.out.println ("DASHBOARD:\n" + dashboard.toString()); - dashboard.show(); - - } - // // Implement DashboardPanel interface // @@ -154,7 +151,15 @@ * **************************************************************************/ public JLabel getTitle() { - return new JLabel (getName()); + Icon titleIcon = + SwingUtils.createIcon (dashboardProperties.getProperty (DP_TITLE_ICON), + this); + String titleStr = dashboardProperties.getProperty (DP_TITLE); + if (titleStr == null && titleIcon == null) + titleStr = getName(); + JLabel title = new JLabel (titleStr, titleIcon, JLabel.CENTER); + title.setFont (new Font ("Serif", Font.BOLD, 30)); + return title; } /************************************************************************** @@ -168,7 +173,8 @@ * **************************************************************************/ public Icon getIcon() { - return null; + return SwingUtils.createIcon (dashboardProperties.getProperty (DP_TITLE_ICON), + this); } /************************************************************************** @@ -176,24 +182,93 @@ **************************************************************************/ public JComponent getComponent() { + if (dashboard != null) + return dashboard; + + // create itself JPanel p = new JPanel (new GridBagLayout(), true); - JComponent header = createHeader(); - JTabbedPane tabbedPane = new JTabbedPane(); + header = getHeader(); + tabbedPane = new JTabbedPane(); + tabbedPane.addChangeListener (this); for (int i = 0; i < panels.length; i++) { tabbedPane.addTab (panels[i].getName(), panels[i].getIcon(), panels[i].getComponent()); } + statusBar = getStatusBar(); // put it all together - SwingUtils.addComponent (p, header, 0, 0, 1, 1, AbstractPanel.HORIZONTAL, AbstractPanel.FIRST_LINE_START, 1.0, 0.0); - SwingUtils.addComponent (p, tabbedPane, 0, 1, 1, 1, AbstractPanel.BOTH, AbstractPanel.FIRST_LINE_START, 1.0, 1.0); + SwingUtils.addComponent (p, header, 0, 0, 1, 1, AbstractPanel.HORI, AbstractPanel.NWEST, 1.0, 0.0); + SwingUtils.addComponent (p, tabbedPane, 0, 1, 1, 1, AbstractPanel.BOTH, AbstractPanel.NWEST, 1.0, 1.0); + SwingUtils.addComponent (p, statusBar, 0, 2, 1, 1, AbstractPanel.HORI, AbstractPanel.WEST, 1.0, 0.0); return p; } - // - JComponent createHeader() { - return getTitle(); + /************************************************************************** + * + **************************************************************************/ + DashboardHeader getHeader() { + DashboardHeader h = new DashboardHeader (dashboardProperties); + if (panels.length > 0) + h.setPanelTitle (panels[0].getTitle()); + return h; + } + + class DashboardHeader extends JPanel { + public DashboardHeader (Properties props) { + super (new GridBagLayout()); + JLabel mainTitle = getTitle(); + JLabel mainIcon = + new JLabel ("", + SwingUtils.createIcon (props.getProperty (DP_ICON), this), + JLabel.CENTER); + JLabel panelTitle = new JLabel(); + + // put it all together (keep 'panelTitle' always as the 3rd component) + SwingUtils.addComponent (this, mainIcon, 0, 0, 1, 2, AbstractPanel.NONE, AbstractPanel.NWEST, 0.0, 0.0); + SwingUtils.addComponent (this, mainTitle, 1, 0, 1, 1, AbstractPanel.NONE, AbstractPanel.NORTH, 1.0, 0.0); + SwingUtils.addComponent (this, panelTitle, 1, 1, 1, 1, AbstractPanel.NONE, AbstractPanel.SOUTH, 0.0, 0.0); + } + public void setPanelTitle (JLabel newTitle) { + remove (2); + SwingUtils.addComponent (this, newTitle, 1, 1, 1, 1, AbstractPanel.NONE, AbstractPanel.SOUTH, 0.0, 0.0); + AwtUtils.redisplay (this); + } + } + + /************************************************************************** + * Return a component representing status bar (usually placed at + * the bottom of a dashboard). + **************************************************************************/ + StatusBar getStatusBar() { + return new StatusBar ("Status: Work in progress"); + } + + class StatusBar extends JLabel implements PropertyChangeListener { + DateFormat df = DateFormat.getTimeInstance(); + public StatusBar (String text) { + super (text); + } + public void propertyChange (PropertyChangeEvent e) { + String prop = e.getPropertyName(); + if (prop == null) return; // no interest in non-specific changes + Object value = e.getNewValue(); + if (value == null) return; // no interest in non-defined new values + if (prop.equalsIgnoreCase (DP_STATUS_MSG)) + setText ("[" + df.format (new Date()) + "] " + value.toString()); + } + } + + /************************************************************************** + * Dashboard is listening to the changes of panels in order to + * repaint the header with a label of a currently selected panel. + **************************************************************************/ + public void stateChanged (ChangeEvent e) { + int panelIndex = tabbedPane.getSelectedIndex(); + if (panelIndex < 0 || panelIndex >= panels.length) + header.setPanelTitle (null); + else + header.setPanelTitle (panels[panelIndex].getTitle()); } /************************************************************************** @@ -214,9 +289,13 @@ public void propertyChange (PropertyChangeEvent event) { } -// Preferences prefs = Preferences.userNodeForPackage (DataThingViewer.class); -// String curDir = prefs.get ("currentDir", System.getProperty("user.home")); -// ... -// prefs.put ("currentDir", fc.getCurrentDirectory().toString()); + /************************************************************************** + * + * An entry point... + * + **************************************************************************/ + public static void main (String[] args) { + new Dashboard().show(); + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/13 06:53:28 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/18 08:46:26 1.3 @@ -16,7 +16,7 @@ /** * An interface that must be implemented by each panel that wants to - * sit on the dashboard.

    + * sit on a dashboard.

    * * WORK IN PROGRESS

    * @@ -32,6 +32,11 @@ extends PropertyChangeListener, DashboardProperties { /************************************************************************** + * Return a graphical representation of this panel. + **************************************************************************/ + JComponent getComponent(); + + /************************************************************************** * A name identifies a panel in the dashboard's tabs. It should be * relatively short, without newlines, or any other special * characters.

    @@ -63,11 +68,6 @@ Icon getIcon(); /************************************************************************** - * The main contents. Here is everything... - **************************************************************************/ - JComponent getComponent(); - - /************************************************************************** * Add a PropertyChangeListener to the listener list of a * panel. All listeners will be notified if this panel changes * some property.

    =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/09/13 06:54:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/09/18 08:46:26 1.2 @@ -18,7 +18,8 @@ /** * A list of names of most/all recognized properties that can be fired - * by dashboard panels.

    + * by dashboard panels, and a list of names of Java properties that + * can be used to configure the dashboard.

    * * @author Martin Senger * @version $Id$ @@ -27,7 +28,34 @@ public interface DashboardProperties { static final String DP_LOG_MSG = "log-msg"; + static final String DP_STATUS_MSG = "status-msg"; static final String DP_SERVICE_NAME = "dp-service-name"; static final String DP_DATATYPE_NAME = "dp-datatype-name"; + /** A filename containing Java properties that configure the + dashboard. */ + static final String DASHBOARD_PROPERTIES_FILE = "dashboard.properties"; + + /** A property name. Its value contains a title that will appear + * in big fonts on top of the dashboard. It may be empty if + * property {@link #DP_TITLE_ICON} is defined; otherwise a default + * value will be used. + */ + static final String DP_TITLE = "dashboard.title"; + + /** A property name. Its value contains a filename with an icon + * accompanying a dashboard title (defined by property {@link + * #DP_TITLE}. No default value used. Specify here either an + * absolute path (not recommended) or a relative path whose + * beginning can be found somewhere on the CLASSPATH. + */ + static final String DP_TITLE_ICON = "dashboard.title.icon"; + + /** A property name. Its value contains a filename with the main + * dashboard icon. Specify here either an absolute path (not + * recommended) or a relative path whose beginning can be found + * somewhere on the CLASSPATH. + */ + static final String DP_ICON = "dashboard.icon"; + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java 2005/09/13 06:54:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java 2005/09/18 08:46:26 1.2 @@ -48,13 +48,14 @@ "Some buttons may use a text put in the adjacent form field.
    " + "For some events, the form field accepts a comma-separated list."); - SwingUtils.addComponent (p, desc, 0, 0, REMAINDER, 1, HORIZONTAL, FIRST_LINE_START, 0.0, 0.0); + SwingUtils.addComponent (p, desc, 0, 0, REMAINDER, 1, HORI, NWEST, 0.0, 0.0); addStringEvent (p, "Service name", DP_SERVICE_NAME); addStringEvent (p, "Data type name", DP_DATATYPE_NAME); + addStringEvent (p, "Status bar message", DP_STATUS_MSG); JLabel empty = new JLabel(); - SwingUtils.addComponent (p, empty, 0, RELATIVE, 2, 1, HORIZONTAL, FIRST_LINE_START, 0.0, 0.1); + SwingUtils.addComponent (p, empty, 0, RELATIVE, 2, 1, HORI, NWEST, 0.0, 0.1); return p; } @@ -74,8 +75,8 @@ }); // add it to the common panel - SwingUtils.addComponent (p, button, 0, RELATIVE, 1, 1, HORIZONTAL, FIRST_LINE_START, 0.0, 0.0); - SwingUtils.addComponent (p, text, 1, RELATIVE, 1, 1, HORIZONTAL, LINE_START, 1.0, 0.0); + SwingUtils.addComponent (p, button, 0, RELATIVE, 1, 1, HORI, NWEST, 0.0, 0.0); + SwingUtils.addComponent (p, text, 1, RELATIVE, 1, 1, HORI, WEST, 1.0, 0.0); } // @@ -90,11 +91,5 @@ return "Debugging Event Generator"; } - /************************************************************************** - * - **************************************************************************/ - public JLabel getTitle() { - return new JLabel (getName()); - } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/13 06:53:28 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/18 08:46:26 1.2 @@ -1,18 +1,17 @@ +TODO with views: +---------------- +? small icons to buttons +? use FileSystemView in file choosers +* alltools2: - PrefsUtils may become just a common parent for both *WithHistory classes + - combo box history is not updated if exit happened while focus is till in the text field + +? configure dashboard from menu: + * configure dashbard (add/remove dynamically panels) + * configure user preferences -src/main/org/biomoby/service/dashboard/Dashboard.java - -Dashboard configuration - by getResource() ------------------------ - -* SPI for panel interfaces (Apache - commons - Discovery) - -* persistence of the last used properties (at least those easily -serializable) - -* own properties, such as: - - title, icon, sub-title (will be replaced by a panel title) +* Registry panel: + - trees should be in panned blocks (user-resizable) -* java.beans (property chnages) Registry panel -------------- @@ -42,3 +41,10 @@ * model (worker: antWorker) +Other (future, possible) panels: +-------------------------------- +- verify registry +- browsing in graphs +- RDF resources +- Log panel +- Configure a new Dashboard =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/13 06:53:28 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/18 08:46:26 1.4 @@ -9,14 +9,25 @@ package org.biomoby.service.dashboard; import org.tulsoft.tools.gui.SwingUtils; +import org.tulsoft.tools.gui.JTextFieldWithHistory; +import org.tulsoft.tools.gui.JFileChooserWithHistory; +import javax.swing.JPanel; import javax.swing.JLabel; import javax.swing.Icon; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JFileChooser; import javax.swing.JComponent; import javax.swing.text.html.HTMLDocument; +import java.awt.GridBagLayout; + +import java.awt.event.KeyEvent; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; @@ -34,6 +45,13 @@ public class RegistryPanel extends AbstractPanel { + // names of user preferences keys + static final String USE_CACHE = "use-cache"; + + // components that are used from more methods + JFileChooserWithHistory cacheDir; + JLabel labelCacheDir; + /********************************************************************* * propertyChange() ********************************************************************/ @@ -52,21 +70,210 @@ * **************************************************************************/ public JComponent getComponent() { - return null; + if (pComponent != null) + return pComponent; + + pComponent = new JPanel (new GridBagLayout(), true); + + // ontology trees + ServicesTree servicesTree = new ServicesTree(); + DataTypesTree dataTypesTree = new DataTypesTree(); + NamespacesTree namespacesTree = new NamespacesTree(); + + // registry and cache locations + JPanel regLocation = getRegistryLocation(); + JPanel cacheLocation = getCacheLocation(); + + // put all together + SwingUtils.addComponent (pComponent, servicesTree.scrollable(), 0, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); + SwingUtils.addComponent (pComponent, dataTypesTree.scrollable(), 1, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); + SwingUtils.addComponent (pComponent, namespacesTree.scrollable(), 2, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); + SwingUtils.addComponent (pComponent, regLocation, 3, 0, 1, 1, HORI, NWEST, 0.1, 0.0); + SwingUtils.addComponent (pComponent, cacheLocation, 3, 1, 1, 1, HORI, NWEST, 0.1, 0.0); + + return pComponent; + } + + /************************************************************************** + * + **************************************************************************/ + public void onReloadAll() { + } + + /************************************************************************** + * + **************************************************************************/ + public void onDefaults() { + } + + /************************************************************************** + * + **************************************************************************/ + public void onCacheInfo() { + } + + /************************************************************************** + * + **************************************************************************/ + public void onCacheErase() { + } + + /************************************************************************** + * + **************************************************************************/ + public void onCacheUpdate() { + } + + /************************************************************************** + * + **************************************************************************/ + public void onUseCache (boolean enabled) { + cacheDir.setEnabled (enabled); + labelCacheDir.setEnabled (enabled); + setPrefValue (USE_CACHE, enabled); + } + + /************************************************************************** + * Panel for registry. + **************************************************************************/ + protected JPanel getRegistryLocation() { + JLabel labelRegistryURL = new JLabel("Endpoint"); + JTextFieldWithHistory registryURL = + new JTextFieldWithHistory ("", this, "registryEndpoint"); + JLabel labelRegistryNS = new JLabel("Namespace (URI)"); + JTextFieldWithHistory registryNS = + new JTextFieldWithHistory ("", this, "registryNamespace"); + JButton reloadAllButton = + createButton (" Reload all ", + "Reload all ontology trees from the Biomoby registry", + KeyEvent.VK_R, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + onReloadAll(); + } + }); + JButton defaultsButton = + createButton (" Restore defaults ", + "Fill the text fields above with the default values", + KeyEvent.VK_D, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + onDefaults(); + } + }); + JPanel buttonPanel = createButtonPanel (new JButton[] { reloadAllButton, + defaultsButton }); + JPanel rLocation = createTitledPanel ("Biomoby registry location"); + SwingUtils.addComponent (rLocation, labelRegistryURL, 0, 0, 1, 1, NONE, NWEST, 0.0, 0.0); + SwingUtils.addComponent (rLocation, registryURL, 0, 1, 1, 1, HORI, NWEST, 1.0, 0.0); + SwingUtils.addComponent (rLocation, labelRegistryNS, 0, 2, 1, 1, NONE, NWEST, 0.0, 0.0, BREATH_TOP); + SwingUtils.addComponent (rLocation, registryNS, 0, 3, 1, 1, HORI, NWEST, 1.0, 0.0); + SwingUtils.addComponent (rLocation, buttonPanel, 0, 4, 1, 1, NONE, SWEST, 0.0, 0.0); + + return rLocation; + } + + /************************************************************************** + * Panel for local cache. + **************************************************************************/ + protected JPanel getCacheLocation() { + boolean usingCache = getPrefValue (USE_CACHE, true); + JCheckBox useCache = + createCheckBox ("Use local cache", usingCache, KeyEvent.VK_C, + new ItemListener() { + public void itemStateChanged (ItemEvent e) { + onUseCache (e.getStateChange() == ItemEvent.SELECTED); + } + }); + labelCacheDir = new JLabel("Cache directory"); + cacheDir = createFileSelector ("Select directory for/with local cache", + "Select", + JFileChooser.DIRECTORIES_ONLY, + System.getProperty ("java.io.tmpdir"), + null); + onUseCache (usingCache); + JButton infoButton = + createButton (" Info ", + "Show current information about the local cache", + KeyEvent.VK_I, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + onCacheInfo(); + } + }); + JButton updateButton = + createButton (" Update ", + "Update local cache from Biomoby registry", + KeyEvent.VK_U, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + onCacheUpdate(); + } + }); + JButton eraseButton = + createButton (" Erase ", + "Remove everything from the local cache", + KeyEvent.VK_E, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + onCacheErase(); + } + }); + JPanel buttonPanel = createButtonPanel (new JButton[] { infoButton, + updateButton, + eraseButton }); + + JPanel cLocation = createTitledPanel ("Local cache"); + SwingUtils.addComponent (cLocation, useCache, 0, 0, 1, 1, NONE, NWEST, 0.0, 0.0); + SwingUtils.addComponent (cLocation, labelCacheDir, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0, BREATH_TOP); + SwingUtils.addComponent (cLocation, cacheDir, 0, 2, 1, 1, HORI, NWEST, 1.0, 0.0); + SwingUtils.addComponent (cLocation, buttonPanel, 0, 3, 1, 1, NONE, SWEST, 0.0, 0.0); + + return cLocation; + } + + /************************************************************************** + * + **************************************************************************/ + class ServicesTree extends CommonTree { + public ServicesTree() { + super ("Services"); + } + } + + /************************************************************************** + * + **************************************************************************/ + class DataTypesTree extends CommonTree { + public DataTypesTree() { + super ("DataTypes"); + } + } + + /************************************************************************** + * + **************************************************************************/ + class NamespacesTree extends CommonTree { + public NamespacesTree() { + super ("Namespaces"); + } } /************************************************************************** * **************************************************************************/ public String getName() { - return "Biomoby Registry"; + return "Registry Browser"; } /************************************************************************** * **************************************************************************/ - public JLabel getTitle() { - return new JLabel (getName()); + public Icon getIcon() { + if (panelIcon == null) + panelIcon = SwingUtils.createIcon ("images/registry.gif", this); + return panelIcon; } + } From kawas at pub.open-bio.org Tue Sep 20 17:16:34 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed Sep 21 16:14:53 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202116.j8KLGYkp006490@pub.open-bio.org> kawas Tue Sep 20 17:16:34 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv6465 Modified Files: OntologyServer.pm Log Message: added the suggestions asked for by martin. Code that has been added is commented out until a decision is made on whether to support the changes. Code marked by: #UNCOMMENT denotes code that should be uncommented to add functionality #COMMENT/REMOVE denotes code that should be removed in conjunction with the additions. Lines subject to removal: 927 Lines subject to addition: 928 moby-live/Perl/MOBY OntologyServer.pm,1.83,1.84 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.83 retrieving revision 1.84 diff -u -r1.83 -r1.84 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/08/30 14:52:15 1.83 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/20 21:16:34 1.84 @@ -1,1315 +1,1316 @@ -#$Id$ -# this module needs to talk to the 'real' ontology -# server as well as the MOBY Central database -# in order to ensure that they are both in sync - -=head1 NAME - -MOBY::OntologyServer - A way for MOBY Central to query the -object, service, namespace, and relationship ontologies - -=cut - -=head1 SYNOPSIS - - use MOBY::OntologyServer; - my $OS = MOBY::OntologyServer->new(ontology => "object"); - - my ($success, $message, $existingURI) = $OS->objectExists(term => "Object"); - - if ($success){ - print "object exists and it has the LSID $existingURI\n"; - } else { - print "object does not exist; additional message from server: $message\n"; - } - - -=cut - -=head1 DESCRIPTION - -Swappable interface to ontologies. It should deal with LSID's 100% -of the time, and also deal with MOBY-specific common names for objects, -services, namespaces, and relationship types. - - - -=head1 AUTHORS - -Mark Wilkinson (markw@illuminae.com) - -BioMOBY Project: http://www.biomoby.org - - -=cut - -=head1 METHODS - - -=head2 new - - Title : new - Usage : my $OS = MOBY::OntologyServer->new(%args) - Function : - Returns : MOBY::OntologyServer object - Args : ontology => [object || service || namespace || relationship] - database => mysql databasename that holds the ontologies - host => mysql hostname - username => mysql username - password => mysql password - port => mysql port - dbh => pre-existing database handle to a mysql database - -=cut - -package MOBY::OntologyServer; -use strict; -use Carp; -use vars qw($AUTOLOAD); -use DBI; -use DBD::mysql; -use MOBY::Config; -my $debug = 0; -{ - - #Encapsulated class data - #___________________________________________________________ - #ATTRIBUTES - my %_attr_data = # DEFAULT ACCESSIBILITY - ( - ontology => [ undef, 'read/write' ], - database => [ undef, 'read/write' ], - host => [ undef, 'read/write' ], - username => [ undef, 'read/write' ], - password => [ undef, 'read/write' ], - port => [ undef, 'read/write' ], - dbh => [ undef, 'read/write' ], - ); - - #_____________________________________________________________ - # METHODS, to operate on encapsulated class data - # Is a specified object attribute accessible in a given mode - sub _accessible { - my ( $self, $attr, $mode ) = @_; - $_attr_data{$attr}[1] =~ /$mode/; - } - - # Classwide default value for a specified object attribute - sub _default_for { - my ( $self, $attr ) = @_; - $_attr_data{$attr}[0]; - } - - # List of names of all specified object attributes - sub _standard_keys { - keys %_attr_data; - } -} - -sub new { - my ( $caller, %args ) = @_; - my $caller_is_obj = ref($caller); - my $class = $caller_is_obj || $caller; - my $self = bless {}, $class; - foreach my $attrname ( $self->_standard_keys ) { - if ( exists $args{$attrname} && defined $args{$attrname} ) { - $self->{$attrname} = $args{$attrname}; - } elsif ($caller_is_obj) { - $self->{$attrname} = $caller->{$attrname}; - } else { - $self->{$attrname} = $self->_default_for($attrname); - } - } - $self->ontology eq 'object' && $self->database('mobyobject'); - $self->ontology eq 'namespace' && $self->database('mobynamespace'); - $self->ontology eq 'service' && $self->database('mobyservice'); - $self->ontology eq 'relationship' && $self->database('mobyrelationship'); - - #print STDERR "\n\nCONFIG object is $CONFIG\n\n"; - $CONFIG ||= MOBY::Config->new; - -#print STDERR "got username ",($CONFIG->{mobycentral}->{username})," for mobycentral\n"; - $self->username( $CONFIG->{ $self->database }->{username} ) - unless $self->username; - $self->password( $CONFIG->{ $self->database }->{password} ) - unless $self->password; - $self->port( $CONFIG->{ $self->database }->{port} ) unless $self->port; - $self->host( $CONFIG->{ $self->database }->{url} ) unless $self->host; - my $host = $self->host ? $self->host : $ENV{MOBY_CENTRAL_URL}; - chomp $host; - my $username = - $self->username ? $self->username : $ENV{MOBY_CENTRAL_DBUSER}; - chomp $username; - my $password = - $self->password ? $self->password : $ENV{MOBY_CENTRAL_DBPASS}; - chomp $password if $password; - $password =~ s/\s//g if $password; - my $port = $self->port ? $self->port : $ENV{MOBY_CENTRAL_DBPORT}; - chomp $port; - my ($dsn) = - "DBI:mysql:" - . ( $CONFIG->{ $self->database }->{dbname} ) . ":" - . ($host) . ":" - . ($port); - - #print STDERR "\n\nDSN was $dsn\n\n"; - my $dbh; - -# $debug && &_LOG("connecting to db with params ",$self->database, $self->username, $self->password,"\n"); - if ( defined $password ) { - $dbh = DBI->connect( $dsn, $username, $password, { RaiseError => 1 } ) - or die "can't connect to database"; - } else { - $dbh = DBI->connect( $dsn, $username, undef, { RaiseError => 1 } ) - or die "can't connect to database"; - } - - # $debug && &_LOG("CONNECTED!\n"); - if ($dbh) { - $self->dbh($dbh); - return $self; - } else { - return undef; - } -} - -=head2 objectExists - - moby:newterm will return (0, $message, $MOBYLSID) - newterm will return (0, $message, $MOBYLSID - oldterm will return (1, $message, undef) - newLSID will return (0, $desc, $lsid) -=cut - -sub objectExists { - my ( $self, %args ) = @_; - - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - - my $term = $args{term}; - $term =~ s/^moby://; # if the term is namespaced, then remove that - my $sth; - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); - - my $result; - - $result = $adaptor->query_object(type => $term); - - my $row = shift(@$result); - my $lsid = $row->{object_lsid}; - my $type = $row->{object_type}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $email = $row->{contact_email}; - - if ($lsid) - { # if it is in there, then it has been discovered regardless of being foreign or not - return ( 1, $desc, $lsid ); - } elsif ( _isForeignLSID($term) ) - { # if not in our ontology, but is a foreign LSID, then pass it back verbatim - return ( - 0, -"LSID $term does not exist in the biomoby.org Object Class system\n", - $term - ); - } else { # under all other circumstances (i.e. not a term, or a non-existent biomoby LSID) then fail - return ( - 0, -"Object type $term does not exist in the biomoby.org Object Class system\n", - '' - ); - } -} - -sub _isMOBYLSID { - my ($lsid) = @_; - return 1 if $lsid =~ /^urn\:lsid\:biomoby.org/; - return 0; -} - -sub _isForeignLSID { - my ($lsid) = @_; - return 0 if $lsid =~ /^urn\:lsid\:biomoby.org/; - return 1; -} - -=head2 createObject - -=cut - -sub createObject { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); - return ( 0, "requires a object type node", '' ) unless ( $args{node} ); - return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); - return ( 0, "requires a contact email address", '' ) - unless ( $args{contact_email} ); - return ( 0, "requires a object description", '' ) - unless ( $args{description} ); - my $term = $args{node}; - - my $LSID = - ( $args{'node'} =~ /urn\:lsid/ ) - ? $args{'node'} - : $self->setURI( $args{'node'} ); - unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } - my $result; - $result = $adaptor->query_object(type => $term); - my $row = shift(@$result); - my $lsid = $row->{object_lsid}; - my $type = $row->{object_type}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $email = $row->{contact_email}; - - if ($lsid) { # if it is in there, then the object exists - return ( 0, "This term already exists: $lsid", $lsid ); - } - $args{description} =~ s/^\s+(.*?)\s+$/$1/s; - $args{node} =~ s/^\s+(.*?)\s+$/$1/s; - $args{contact_email} =~ s/^\s+(.*?)\s+$/$1/s; - $args{authority} =~ s/^\s+(.*?)\s+$/$1/s; - - my $insertid = $adaptor->insert_object(object_type => $args{'node'}, - object_lsid => $LSID, - description => $args{'description'}, - authority => $args{'authority'}, - contact_email => $args{'contact_email'}); - unless ( $insertid ) { - return ( 0, "Object creation failed for unknown reasons", '' ); - } - return ( 1, "Object creation succeeded", $LSID ); -} - -=head2 retrieveObject - -=cut - -sub retrieveObject { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - my $term = $args{'type'}; - $term ||=$args{'node'}; - - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); - return ( 0, "requires a object type node as an argument", '' ) - unless ( $term ); - my $LSID = - ( $term =~ /urn\:lsid/ ) - ? $term - : $self->getObjectURI($term); - unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } - my $result = $adaptor->query_object(type => $LSID); - my $row = shift(@$result); -# my $id = $row->{object_id}; - my $type = $row->{object_type}; - my $lsid = $row->{object_lsid}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $contact = $row->{contact_email}; - - unless ($lsid) { return ( 0, "Object doesn't exist in ontology", "" ) } - - # my $OS = MOBY::OntologyServer->new(ontology => "relationship"); - - $result = $adaptor->get_object_relationships(type => $lsid); - my %rel; - foreach my $row (@$result) - { - my $relationship_type = $row->{relationship_type}; - my $objectlsid = $row->{object_lsid}; - my $article = $row->{object2_articlename}; - my $contact = $row->{contact_email}; - my $def = $row->{definition}; - my $auth = $row->{authority}; - my $type = $row->{object_type}; - - push @{ $rel{$relationship_type} }, [ $objectlsid, $article, $type, $def, $auth, $contact ]; - } - return { - objectType => $type, - objectLSID => $lsid, - description => $desc, - contactEmail => $contact, - authURI => $auth, - Relationships => \%rel - }; -} - -=head2 deprecateObject - -=cut - -sub deprecateObject { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - - return ( 0, "WRONG ONTOLOGY", '' ) unless ( $self->ontology eq 'object' ); - my $term = $args{term}; - -# if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ -# return (0, "can't delete from external ontology", $term); -# } - my $LSID; - unless ( $term =~ /urn\:lsid/ ) { $LSID = $self->getObjectURI($term) } else { $LSID = $term } - return ( 0, q{Object type $term cannot be resolved to an LSID}, "" ) - unless $LSID; - - my $result = $adaptor->query_object(type => $LSID); - my $row = shift(@$result); - my $id = $row->{object_id}; - my $lsid = $row->{object_lsid}; - - # object1_id ISA object2_id? - my $isa = $adaptor->query_object_term2term(type => $lsid); - my $isas = shift @$isa; - if ( $isas->{object1_id}) { - return ( 0, - qq{Object type $term has object dependencies in the ontology}, - $lsid ); - } - - my ($err, $errstr) = $adaptor->delete_object(type => $lsid); - if ( $err ) { - return ( 0, "Delete from Object Class table failed: $errstr", - $lsid ); - } - return ( 1, "Object $term Deleted", $lsid ); -} - -=head2 deleteObject - -=cut - -sub deleteObject { - my $self = shift; - $self->deprecateObject(@_); -} - -=head2 relationshipExists - -=cut - -sub relationshipExists { - - # term => $term - # ontology => $ontology - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); - return ( 0, "WRONG ONTOLOGY!", '' ) - unless ( $self->ontology eq 'relationship' ); - my $term = lc( $args{term} ); - $term =~ s/^moby://; # if the term is namespaced, then remove that - my $ont = $args{ontology}; - return ( 0, "requires both term and ontology arguments\n", '' ) - unless ( defined($term) && defined($ont) ); - my $result; - if ( $term =~ /^urn\:lsid/ ) { - - $result = $adaptor->query_relationship( - type => $term, - ontology => $ont); - - } else { - - $result = $adaptor->query_relationship(type => $term, ontology => $ont); - - } - my $row = shift(@$result); - my $lsid = $row->{relationship_lsid}; - my $type = $row->{relationship_type}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $email = $row->{contact_email}; - if ($lsid) { - return ( 1, $desc, $lsid, $type, $auth, $email ); - } else { - return ( - 0,"Relationship Type $term does not exist in the biomoby.org Relationship Type system\n", - '', '', '', '' - ); - } -} - -=head2 addObjectRelationship - -=cut - -sub addObjectRelationship { - - # adds a relationship - #subject_node => $term, - #relationship => $reltype, - #object_node => $objectType, - #articleName => $articleName, - #authority => $auth, - #contact_email => $email - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); - - my $result = $adaptor->query_object(type => $args{subject_node}); - my $row = shift(@$result); - my $subj_lsid = $row->{object_lsid}; - return ( 0, qq{Object type $args{subject_node} does not exist in the ontology}, '' ) - unless defined $subj_lsid; - - $result = $adaptor->query_object(type => $args{object_node}); - $row = shift(@$result); - my $obj_lsid = $row->{object_lsid}; - return ( 0,qq{Object type $args{object_node} does not exist in the ontology},'' ) - unless defined $obj_lsid; - my $isa = $adaptor->query_object_term2term(type => $subj_lsid); - my $isarow = shift @$isa; - if ( $isarow->{object_lsid} ) { - return ( - 0, - qq{Object type $args{subject_node} has existing object dependencies in the ontology. It cannot be changed.}, - $subj_lsid - ); - } - my $OE = MOBY::OntologyServer->new( ontology => 'relationship' ); - my ( $success, $desc, $rel_lsid ) = $OE->relationshipExists( - term => $args{relationship}, - ontology => 'object' ); - ($success) || return ( 0, - qq{Relationship $args{relationship} does not exist in the ontology}, - '' ); - - # need to ensure that identical article names dont' end up at the same level - my $articleNameInvalid = &_testIdenticalArticleName(term => $subj_lsid, articleName => $args{articleName}); - return (0, "Object will have conflicting articleName ".($args{articleName}), '') if $articleNameInvalid; - - my $insertid = $adaptor->insert_object_term2term(relationship_type => $rel_lsid, - object1_type => $subj_lsid, - object2_type => $obj_lsid, - object2_articlename => $args{articleName}); - - - if ($insertid ) { - return ( 1, "Object relationsihp created successfully", '' ); - } else { - return ( 0, "Object relationship creation failed for unknown reasons", - '' ); - } -} - -sub _testIdenticalArticleName { - my (%args)= @_; - my $term = $args{term}; - my $articleName = $args{articleName}; - my $foundCommonArticleNameFlag = 0; - # need to first traverse down the ISA pathway to root - # then for each ISA test the hAS and HASA's for their articlenames and see if they are the same - # case insensitive? - my $OS = MOBY::OntologyServer->new(ontology => 'object'); - my $OSrel = MOBY::OntologyServer->new(ontology => 'relationship'); - my ($exists1, $desc, $isalsid) = $OSrel->relationshipExists(term => 'isa', ontology => 'object'); - my ($exists2, $desc2, $hasalsid) = $OSrel->relationshipExists(term => 'hasa', ontology => 'object'); - my ($exists3, $desc3, $haslsid) = $OSrel->relationshipExists(term => 'has', ontology => 'object'); - - return 1 unless ($exists1 && $exists2 && $exists3); # this is bad, since it returns boolean suggesting that it found a common articlename rather than finding that a given relationship doesn't exist, but... hey.... - # check the hasa relationships for common articleName - $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $args{term}, relationship => $hasalsid, targetArticleName => $articleName); - # check the has relationships for common articleName - $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $args{term}, relationship => $haslsid, targetArticleName => $articleName); - - # now get all of its inherited parents - my $relationships = $OS->Relationships( - ontology => 'object', - term => $args{term}, - relationship => $isalsid, - direction => 'root', - expand => 1); - #relationships{relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] - my ($isa) = keys(%$relationships); # can only be one key returned, and must be isa in this case - my @ISAlist; - (@ISAlist = @{$relationships->{$isa}}) if ($relationships->{$isa}) ; - # for each of the inherited parents, check their articleNames - foreach my $ISA(@ISAlist){ # $ISA = [lsid, articleName] (but articleName shuld be null anyway in this case) - my $what_it_is = shift @$ISA; - # check the hasa relationships for common articleName - $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $what_it_is, relationship => $hasalsid, targetArticleName => $articleName); - # check the has relationships for common articleName - $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $what_it_is, relationship => $haslsid, targetArticleName => $articleName); - } - return $foundCommonArticleNameFlag; -} - -sub _compareArticleNames { - my (%args) = @_; - my $OS = $args{OS}; - my $what_it_is = $args{type}; - my $lsid = $args{relationship}; - my $targetArticleName = $args{targetArticleName}; - my $foundCommonArticleNameFlag = 0; - my $contents = $OS->Relationships( - ontology => 'object', - term => $what_it_is, - relationship => $lsid, - direction => 'root', - ); - if ($contents){ - #$hasarelationships{relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] - my ($content) = keys(%$contents); - if ($contents->{$content}){ - my @CONTENTlist = @{$contents->{$content}}; - foreach my $CONTAINED(@CONTENTlist){ - $foundCommonArticleNameFlag = 1 if ($CONTAINED->[1] eq $targetArticleName); #->[1] is the articleName field - } - } - } - return $foundCommonArticleNameFlag; -} - -=head2 addServiceRelationship - -=cut - -sub addServiceRelationship { - - # adds an ISA relationship - # fail if another object is in relation to this objevt - #subject_node => $term, - #relationship => $relationship, - #predicate_node => $pred - #authority => $auth, - #contact_email => $email); - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); - - my $result = $adaptor->query_service(type => $args{subject_node}); - my $row = shift(@$result); - my $sbj_lsid = $row->{service_lsid}; - - return (0, - qq{Service type $args{subject_node} has object dependencies in the ontology. It can not be changed}, - $sbj_lsid - ) unless defined $sbj_lsid; - - my $isa = $adaptor->query_service_term2term(service2_id => $sbj_lsid); - my $isarow = shift @$isa; - if ( $isarow->{service_lsid} ) { - return ( - 0, - qq{Service type $args{subject_node} has object dependencies in the ontology. It can not be changed}, - $sbj_lsid - ); - } - $result = $adaptor->query_service(type => $args{object_node}); - $row = shift(@$result); - my $obj_lsid = $row->{service_lsid}; - # get ID of the related service - - defined $obj_lsid - || return ( 0, - qq{Service $args{object_node} does not exist in the service ontology}, - '' ); - my $OE = MOBY::OntologyServer->new( ontology => 'relationship' ); - my ( $success, $desc, $rel_lsid ) = $OE->relationshipExists( - term => $args{relationship}, - ontology => 'service' ); - ($success) - || return ( 0, - qq{Relationship $args{relationship} does not exist in the ontology}, - '' ); - - my $insertid = $adaptor->insert_service_term2term(relationship_type => $rel_lsid, - service1_type => $sbj_lsid, - service2_type => $obj_lsid); - if ( defined($insertid)) { - return ( 1, "Service relationship created successfully", '' ); - } else { - return ( 0, "Service relationship creation failed for unknown reasons", - '' ); - } -} - -=head2 serviceExists - -=cut - -sub serviceExists { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); - my $term = $args{term}; - $term =~ s/^moby://; # if the term is namespaced, then remove that - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) - { - return ( 1, "external ontology", $term ); - } - my $result; - $result = $adaptor->query_service(type => $term); - my $row = shift(@$result); - my $id = $row->{service_id}; - my $type = $row->{service_type}; - my $lsid = $row->{service_lsid}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $email = $row->{contact_email}; - - if ($id) { - return ( 1, $desc, $lsid ); - } else { - return ( - 0, -"Service Type $term does not exist in the biomoby.org Service Type ontology\n", - '' - ); - } -} - -=head2 createServiceType - -=cut - -sub createServiceType { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - - #node => $term, - #descrioption => $desc, - #authority => $auth, - #contact_email => $email); - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); - return ( 0, "requires a object type node", '' ) unless ( $args{node} ); - return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); - return ( 0, "requires a contact email address", '' ) - unless ( $args{contact_email} ); - return ( 0, "requires a object description", '' ) - unless ( $args{description} ); - my $term = $args{node}; - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) - { # if it is an LSID, but not a MOBY LSID, than barf - return ( 0, "can't create a term in a non-MOBY ontology!", $term ); - } - my $LSID = - ( $args{'node'} =~ /urn\:lsid/ ) - ? $args{'node'} - : $self->setURI( $args{'node'} ); - unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } - - my $insertid = $adaptor->insert_service(service_type => $args{'node'}, - service_lsid => $LSID, - description => $args{'description'}, - authority => $args{'authority'}, - contact_email => $args{'contact_email'}); - - unless ( $insertid ) { - return ( 0, "Service creation failed for unknown reasons", '' ); - } - return ( 1, "Service creation succeeded", $LSID ); -} - -=head2 deleteServiceType - -=cut - -sub deleteServiceType { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); - my $term = $args{term}; - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) - { - return ( 0, "can't delete from external ontology", $term ); - } - my $LSID; - unless ( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) { - $LSID = $self->getServiceURI($term); - } else { - $LSID = $term; - } - return ( - 0, q{Service type $term cannot be resolved to an LSID in the MOBY ontologies},"" - ) unless $LSID; - - my $result = $adaptor->query_service(type => $LSID); - my $row = shift(@$result); - my $lsid = $row->{service_lsid}; - - if ( !defined $lsid ) { - return ( 0, q{Service type $term does not exist in the ontology}, - $lsid ); - } - - # service1_id ISA service2_id? - my $isa = $adaptor->query_service_term2term(type => $lsid); - my $isas = shift(@$isa); - - if ( $isas->{service1_id} ) { - return ( 0, qq{Service type $term has dependencies in the ontology}, - $lsid ); - } - my ($err, $errstr) = $adaptor->delete_service(type => $lsid); - - if ( $err ) { - return ( 0, "Delete from Service Type table failed: $errstr", - $lsid ); - } - - return ( 1, "Service Type $term Deleted", $lsid ); -} - -=head2 namespaceExists - -=cut - -sub namespaceExists { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - - return ( 0, "WRONG ONTOLOGY!", '' ) - unless ( $self->ontology eq 'namespace' ); - my $term = $args{term}; - $term =~ s/^moby://; # if the term is namespaced, then remove that - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) - { - return ( 1, "external ontology", $term ); - } - my $result; - $result = $adaptor->query_namespace(type => $term); - my $row = shift(@$result); - my $id = $row->{namespace_id}; - my $type = $row->{namespace_type}; - my $lsid = $row->{namespace_lsid}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $email = $row->{contact_email}; - - if ($id) { - return ( 1, $desc, $lsid ); - } else { - return ( - 0, -"Namespace Type $term does not exist in the biomoby.org Namespace Type ontology\n", - '' - ); - } -} - -=head2 createNamespace - -=cut - -sub createNamespace { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - #node => $term, - #descrioption => $desc, - #authority => $auth, - #contact_email => $email); - return ( 0, "WRONG ONTOLOGY!", '' ) - unless ( $self->ontology eq 'namespace' ); - return ( 0, "requires a namespace type node", '' ) unless ( $args{node} ); - return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); - return ( 0, "requires a contact email address", '' ) - unless ( $args{contact_email} ); - return ( 0, "requires a object description", '' ) - unless ( $args{description} ); - my $term = $args{node}; - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) - { # if it is an LSID, but not a MOBY LSID, than barf - return ( 0, "can't create a term in a non-MOBY ontology!", $term ); - } - my $LSID = - ( $args{'node'} =~ /urn\:lsid/ ) - ? $args{'node'} - : $self->setURI( $args{'node'} ); - unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } - - my $insertid = $adaptor->insert_namespace(namespace_type => $args{'node'}, - namespace_lsid => $LSID, - description => $args{'description'}, - authority => $args{'authority'}, - contact_email => $args{'contact_email'}); - - unless ( $insertid ) { - return ( 0, "Namespace creation failed for unknown reasons", '' ); - } - return ( 1, "Namespace creation succeeded", $LSID ); -} - -=head2 deleteNamespace - -=cut - -sub deleteNamespace { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - return ( 0, "WRONG ONTOLOGY!", '' ) - unless ( $self->ontology eq 'namespace' ); - my $term = $args{term}; - my $LSID; - unless ( $term =~ /urn\:lsid/ ) { $LSID = $self->getNamespaceURI($term) } else { $LSID = $term } - return ( 0, q{Namespace type $term cannot be resolved to an LSID}, "" ) - unless $LSID; - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) - { - return ( 0, "cannot delete a term from an external ontology", $term ); - } - - my $result = $adaptor->query_namespace(type => $LSID); - my $row = shift(@$result); - my $lsid = $row->{namespace_lsid}; - - unless ($lsid) { - return ( 0, q{Namespace type $term does not exist in the ontology}, - $lsid ); - } - - # service1_id ISA service2_id? - my $isa = $adaptor->query_namespace_term2term(type => $lsid); - my $isas = shift @$isa; - - if ($isas->{namespace1_id} ) { - return ( 0, qq{Namespace type $term has dependencies in the ontology}, - $lsid ); - } - - my ($err, $errstr) = $adaptor->delete_namespace(type => $lsid); - - if ( $err ) { - return ( 0, "Delete from namespace table failed: $errstr", - $lsid ); - } - - #($err, $errstr) = $adaptor->delete_namespace_term2term(namespace1_id => $lsid); - # - #if ( $err ) { - # return ( - # 0, - # "Delete from namespace term2term table failed: $errstr", - # $lsid - # ); - #} - return ( 1, "Namespace Type $term Deleted", $lsid ); -} - -=head2 retrieveAllServiceTypes - -=cut - -sub retrieveAllServiceTypes { - my ($self) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - my $types = $adaptor->query_service(); - - my %response; - foreach (@$types) { - $response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}]; - } - return \%response; -} - -=head2 retrieveAllNamespaceTypes - -=cut - -sub retrieveAllNamespaceTypes { - my ($self) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - my $types = $adaptor->query_namespace(); - - my %response; - foreach (@$types) { - $response{ $_->{namespace_type} } = [$_->{description}, $_->{namespace_lsid}, $_->{authority}, $_->{contact_email}]; - } - return \%response; -} - -=head2 retrieveAllObjectClasses - -=cut - -sub retrieveAllObjectClasses { - my ($self) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - my $types = $adaptor->query_object(); - - my %response; - foreach (@$types) { - $response{ $_->{object_type} } = [$_->{description}, $_->{object_lsid}]; - } - return \%response; -} -*retrieveAllObjectTypes = \&retrieveAllObjectClasses; -*retrieveAllObjectTypes = \&retrieveAllObjectClasses; - -=head2 getObjectCommonName - -=cut - -sub getObjectCommonName { - my ( $self, $URI ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - return undef unless $URI =~ /urn\:lsid/; - my $result = $adaptor->query_object(type => $URI); - my $row = shift(@$result); - my $name = $row->{object_type}; - - return $name ? $name : $URI; -} - -=head2 getNamespaceCommonName - -=cut - -sub getNamespaceCommonName { - my ( $self, $URI ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - return undef unless $URI =~ /urn\:lsid/; - my $result = $adaptor->query_namespace(type => $URI); - my $row = shift(@$result); - my $name = $row->{namespace_type}; - - return $name ? $name : $URI; -} - -=head2 getServiceCommonName - -=cut - -sub getServiceCommonName { - my ( $self, $URI ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - return undef unless $URI =~ /urn\:lsid/; - my $result = $adaptor->query_service(type => $URI); - my $row = shift(@$result); - my $name = $row->{service_type}; - - return $name ? $name : $URI; -} - -=head2 getServiceURI - -=cut - -sub getServiceURI { - my ( $self, $term ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - return $term if $term =~ /urn\:lsid/; - - my $result = $adaptor->query_service(type => $term); - my $row = shift(@$result); - my $id = $row->{service_lsid}; - - return $id; -} - -=head2 getObjectURI - -=cut - -sub getObjectURI { - my ( $self, $term ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - return $term if $term =~ /urn\:lsid/; - - my $result = $adaptor->query_object(type => $term); - my $row = shift(@$result); - my $id = $row->{object_lsid}; - - return $id; -} - -=head2 getNamespaceURI - -=cut - -sub getNamespaceURI { - my ( $self, $term ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - - return $term if $term =~ /urn\:lsid/; - - my $result = $adaptor->query_namespace(type => $term); - my $row = shift(@$result); - my $id = $row->{namespace_lsid}; - - return $id; -} - -=head2 getRelationshipURI - -consumes ontology (object/service) -consumes relationship term as term or LSID - -=cut - -sub getRelationshipURI { - my ( $self, $ontology, $term ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); - - return $term if $term =~ /urn\:lsid/; - - my $result = $adaptor->query_relationship(type => $term, ontology => $ontology); - my $row = shift(@$result); - my $id = $row->{relationship_lsid}; - - return $id; -} - -=head2 getRelationshipTypes - -=cut - -sub getRelationshipTypes { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); - - my $ontology = $args{'ontology'}; - my $OS = MOBY::OntologyServer->new( ontology => "relationship" ); - - my $defs = $adaptor->query_relationship(ontology => $ontology); - - my %result; - foreach ( @$defs ) { - $result{ $_->{relationship_lsid} } = [ $_->{relationship_type}, $_->{authority}, $_->{description} ]; - } - return \%result; -} - -=head2 Relationships - -=cut - -sub Relationships { - - # this entire subroutine assumes that there is NOT multiple parenting!! - my ( $self, %args ) = @_; - my $ontology = $args{ontology} ? $args{ontology} : $self->ontology; - my $term = $args{term}; - my $relationship = $args{relationship}; - my $direction = $args{direction} ? $args{direction} : 'root'; - my $expand = $args{expand} ? 1 : 0; - return - unless ( $ontology - && $term - && ( ( $ontology eq 'service' ) || ( $ontology eq 'object' ) ) ); - - # convert $term into an LSID if it isn't already - if ( $ontology eq 'service' ) { - $term = $self->getServiceURI($term); - $relationship ||="isa"; - my $OS = MOBY::OntologyServer->new(ontology => 'relationship'); - $relationship = $OS->getRelationshipURI("service", $relationship); - } elsif ( $ontology eq 'object' ) { - $term = $self->getObjectURI($term); - $relationship ||="isa"; - my $OS = MOBY::OntologyServer->new(ontology => 'relationship'); - $relationship = $OS->getRelationshipURI("object", $relationship); - } - my %results; - while ( ( $term ne 'urn:lsid:biomoby.org:objectclass:Object' ) - && ( $term ne 'urn:lsid:biomoby.org:servicetype:Service' ) ) - { - my $defs = $self->_doRelationshipsQuery( $ontology, $term, - $relationship, $direction ); - return {[]} unless $defs; # somethig has gone terribly wrong! - my $lsid; - my $rel; - my $articleName; - foreach ( @{$defs} ) { - $lsid = $_->[0]; - $rel = $_->[1]; - $articleName = $_->[2]; - $articleName ||=""; - $debug - && _LOG("\t\tADDING RELATIONSHIP $_ : $lsid to $rel\n"); - push @{ $results{$rel} }, [$lsid, $articleName]; - } - last unless ($expand); - last unless ( $direction eq "root" ); # if we aren't going to root, then be careful or we'll loop infnitely - $term = $lsid; # this entire subroutine assumes that there is NOT multiple parenting... - } - return \%results; #results(relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] -} - -sub _doRelationshipsQuery { - my ( $self, $ontology, $term, $relationship, $direction ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $datasource = "moby$ontology"; # like mobyobject, or mobyservice - my $adaptor = $CONFIG->getDataAdaptor( datasource => $datasource ); - my $defs; - # query returns a reference to an array containing array references - $defs = $adaptor->get_relationship(direction => $direction, - ontology => $ontology, - term => $term, - relationship => $relationship); - # a very long piece of SQL statements have been refactored into Moby::Adaptor::moby::queryapi::mysql.pm - return $defs; -} - -=head2 setURI - -=cut - -sub setURI { - my ( $self, $id ) = @_; - my $URI; - - # $id = lc($id); - if ( $self->ontology eq 'object' ) { - $URI = "urn:lsid:biomoby.org:objectclass:$id"; - } elsif ( $self->ontology eq 'namespace' ) { - $URI = "urn:lsid:biomoby.org:namespacetype:$id"; - } elsif ( $self->ontology eq 'service' ) { - $URI = "urn:lsid:biomoby.org:servicetype:$id"; - } elsif ( $self->ontology eq 'relationship' ) { - $URI = "urn:lsid:biomoby.org:relationshiptype:$id"; - } else { - $URI = 0; - } - return $URI; -} - -=head2 traverseDAG - -=cut - -sub traverseDAG { - my ( $self, $term, $direction ) = @_; - my $ontology = $self->ontology; - return {} unless $ontology; - return {} unless $term; - $direction = "root" unless ($direction); - return {} unless ( ( $direction eq 'root' ) || ( $direction eq 'leaves' ) ); - if ( $ontology eq 'service' ) { - $term = $self->getServiceURI($term); - } elsif ( $ontology eq 'object' ) { - $term = $self->getObjectURI($term); - } - return {} unless $term =~ /^urn\:lsid/; # now its a URI - my $relhash = $self->getRelationshipTypes( ontology => $ontology ); # get teh types of relationships for the object/service ontology - return {} unless $relhash; - my @rels = keys %{$relhash}; #@rels is the list of relationship types for that ontology - my %relationships; - foreach my $relationship (@rels) { - my %IDS; - my $OS = MOBY::OntologyServer->new( ontology => 'relationship' ); - my $reluri = - $OS->getRelationshipURI( $ontology, $relationship ) - ; # get the URI for that relationship type if it ins't already a URI - $IDS{$term} = "untestedroot"; # mark the one in-hand as being untested - while ( grep /untested/, ( values %IDS ) ) - { # now, while there are untested services in our list... - foreach my $termthingy ( keys %IDS ) - { # start parsing through the current list (hash keys) - $debug && _LOG("testing $relationship of $termthingy\n"); - next - if ( $IDS{$termthingy} eq "tested" ) - ; # if it has been tested already then move on - my $lsids = $self->Relationships( - term => $termthingy, - relationship => $relationship, - direction => $direction - ) - ; # get the related terms for this type; this should return a single hash value - if ( $IDS{$termthingy} =~ /root/ ) - { # here is where we remove self - delete $IDS{$termthingy}; - $debug && _LOG("deleting $termthingy\n"); - } else { - $debug && _LOG("marking $termthingy as TESTED\n"); - $IDS{$termthingy} = - "tested"; # mark the current one as now being "done" - } - - #${$lsids}{relationshiptype}=[lsid, lsid, lsid]; - foreach my $lsid_article ( @{ $lsids->{$relationship} } ) - { # go through the related terms - my ($lsid, $article) = @{$lsid_article}; - $debug && _LOG("found $lsid as relationship"); - next - if ( defined $IDS{$lsid} ) - ; # if we have already seen that term, skip it - $debug && _LOG("setting $lsid as untested\n"); - $IDS{$lsid} = - "untested" # otherwise add it to the list and loop again. - } - } - } - my @IDS = keys %IDS; - $relationships{$relationship} = - \@IDS; # and associate them all with the current relationship type - } - return \%relationships; -} - -sub _LOG { - return unless $debug; - - #print join "\n", @_; - #print "\n---\n"; - #return; - open LOG, ">>/tmp/OntologyServer.txt" or die "can't open logfile $!\n"; - print LOG join "\n", @_; - print LOG "\n---\n"; - close LOG; -} -sub DESTROY { } - -sub AUTOLOAD { - no strict "refs"; - my ( $self, $newval ) = @_; - $AUTOLOAD =~ /.*::(\w+)/; - my $attr = $1; - if ( $self->_accessible( $attr, 'write' ) ) { - *{$AUTOLOAD} = sub { - if ( defined $_[1] ) { $_[0]->{$attr} = $_[1] } - return $_[0]->{$attr}; - }; ### end of created subroutine -### this is called first time only - if ( defined $newval ) { - $self->{$attr} = $newval; - } - return $self->{$attr}; - } elsif ( $self->_accessible( $attr, 'read' ) ) { - *{$AUTOLOAD} = sub { - return $_[0]->{$attr}; - }; ### end of created subroutine - return $self->{$attr}; - } - - # Must have been a mistake then... - croak "No such method: $AUTOLOAD"; -} -1; +#$Id$ +# this module needs to talk to the 'real' ontology +# server as well as the MOBY Central database +# in order to ensure that they are both in sync + +=head1 NAME + +MOBY::OntologyServer - A way for MOBY Central to query the +object, service, namespace, and relationship ontologies + +=cut + +=head1 SYNOPSIS + + use MOBY::OntologyServer; + my $OS = MOBY::OntologyServer->new(ontology => "object"); + + my ($success, $message, $existingURI) = $OS->objectExists(term => "Object"); + + if ($success){ + print "object exists and it has the LSID $existingURI\n"; + } else { + print "object does not exist; additional message from server: $message\n"; + } + + +=cut + +=head1 DESCRIPTION + +Swappable interface to ontologies. It should deal with LSID's 100% +of the time, and also deal with MOBY-specific common names for objects, +services, namespaces, and relationship types. + + + +=head1 AUTHORS + +Mark Wilkinson (markw@illuminae.com) + +BioMOBY Project: http://www.biomoby.org + + +=cut + +=head1 METHODS + + +=head2 new + + Title : new + Usage : my $OS = MOBY::OntologyServer->new(%args) + Function : + Returns : MOBY::OntologyServer object + Args : ontology => [object || service || namespace || relationship] + database => mysql databasename that holds the ontologies + host => mysql hostname + username => mysql username + password => mysql password + port => mysql port + dbh => pre-existing database handle to a mysql database + +=cut + +package MOBY::OntologyServer; +use strict; +use Carp; +use vars qw($AUTOLOAD); +use DBI; +use DBD::mysql; +use MOBY::Config; +my $debug = 0; +{ + + #Encapsulated class data + #___________________________________________________________ + #ATTRIBUTES + my %_attr_data = # DEFAULT ACCESSIBILITY + ( + ontology => [ undef, 'read/write' ], + database => [ undef, 'read/write' ], + host => [ undef, 'read/write' ], + username => [ undef, 'read/write' ], + password => [ undef, 'read/write' ], + port => [ undef, 'read/write' ], + dbh => [ undef, 'read/write' ], + ); + + #_____________________________________________________________ + # METHODS, to operate on encapsulated class data + # Is a specified object attribute accessible in a given mode + sub _accessible { + my ( $self, $attr, $mode ) = @_; + $_attr_data{$attr}[1] =~ /$mode/; + } + + # Classwide default value for a specified object attribute + sub _default_for { + my ( $self, $attr ) = @_; + $_attr_data{$attr}[0]; + } + + # List of names of all specified object attributes + sub _standard_keys { + keys %_attr_data; + } +} + +sub new { + my ( $caller, %args ) = @_; + my $caller_is_obj = ref($caller); + my $class = $caller_is_obj || $caller; + my $self = bless {}, $class; + foreach my $attrname ( $self->_standard_keys ) { + if ( exists $args{$attrname} && defined $args{$attrname} ) { + $self->{$attrname} = $args{$attrname}; + } elsif ($caller_is_obj) { + $self->{$attrname} = $caller->{$attrname}; + } else { + $self->{$attrname} = $self->_default_for($attrname); + } + } + $self->ontology eq 'object' && $self->database('mobyobject'); + $self->ontology eq 'namespace' && $self->database('mobynamespace'); + $self->ontology eq 'service' && $self->database('mobyservice'); + $self->ontology eq 'relationship' && $self->database('mobyrelationship'); + + #print STDERR "\n\nCONFIG object is $CONFIG\n\n"; + $CONFIG ||= MOBY::Config->new; + +#print STDERR "got username ",($CONFIG->{mobycentral}->{username})," for mobycentral\n"; + $self->username( $CONFIG->{ $self->database }->{username} ) + unless $self->username; + $self->password( $CONFIG->{ $self->database }->{password} ) + unless $self->password; + $self->port( $CONFIG->{ $self->database }->{port} ) unless $self->port; + $self->host( $CONFIG->{ $self->database }->{url} ) unless $self->host; + my $host = $self->host ? $self->host : $ENV{MOBY_CENTRAL_URL}; + chomp $host; + my $username = + $self->username ? $self->username : $ENV{MOBY_CENTRAL_DBUSER}; + chomp $username; + my $password = + $self->password ? $self->password : $ENV{MOBY_CENTRAL_DBPASS}; + chomp $password if $password; + $password =~ s/\s//g if $password; + my $port = $self->port ? $self->port : $ENV{MOBY_CENTRAL_DBPORT}; + chomp $port; + my ($dsn) = + "DBI:mysql:" + . ( $CONFIG->{ $self->database }->{dbname} ) . ":" + . ($host) . ":" + . ($port); + + #print STDERR "\n\nDSN was $dsn\n\n"; + my $dbh; + +# $debug && &_LOG("connecting to db with params ",$self->database, $self->username, $self->password,"\n"); + if ( defined $password ) { + $dbh = DBI->connect( $dsn, $username, $password, { RaiseError => 1 } ) + or die "can't connect to database"; + } else { + $dbh = DBI->connect( $dsn, $username, undef, { RaiseError => 1 } ) + or die "can't connect to database"; + } + + # $debug && &_LOG("CONNECTED!\n"); + if ($dbh) { + $self->dbh($dbh); + return $self; + } else { + return undef; + } +} + +=head2 objectExists + + moby:newterm will return (0, $message, $MOBYLSID) + newterm will return (0, $message, $MOBYLSID + oldterm will return (1, $message, undef) + newLSID will return (0, $desc, $lsid) +=cut + +sub objectExists { + my ( $self, %args ) = @_; + + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + + my $term = $args{term}; + $term =~ s/^moby://; # if the term is namespaced, then remove that + my $sth; + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); + + my $result; + + $result = $adaptor->query_object(type => $term); + + my $row = shift(@$result); + my $lsid = $row->{object_lsid}; + my $type = $row->{object_type}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $email = $row->{contact_email}; + + if ($lsid) + { # if it is in there, then it has been discovered regardless of being foreign or not + return ( 1, $desc, $lsid ); + } elsif ( _isForeignLSID($term) ) + { # if not in our ontology, but is a foreign LSID, then pass it back verbatim + return ( + 0, +"LSID $term does not exist in the biomoby.org Object Class system\n", + $term + ); + } else { # under all other circumstances (i.e. not a term, or a non-existent biomoby LSID) then fail + return ( + 0, +"Object type $term does not exist in the biomoby.org Object Class system\n", + '' + ); + } +} + +sub _isMOBYLSID { + my ($lsid) = @_; + return 1 if $lsid =~ /^urn\:lsid\:biomoby.org/; + return 0; +} + +sub _isForeignLSID { + my ($lsid) = @_; + return 0 if $lsid =~ /^urn\:lsid\:biomoby.org/; + return 1; +} + +=head2 createObject + +=cut + +sub createObject { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); + return ( 0, "requires a object type node", '' ) unless ( $args{node} ); + return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); + return ( 0, "requires a contact email address", '' ) + unless ( $args{contact_email} ); + return ( 0, "requires a object description", '' ) + unless ( $args{description} ); + my $term = $args{node}; + + my $LSID = + ( $args{'node'} =~ /urn\:lsid/ ) + ? $args{'node'} + : $self->setURI( $args{'node'} ); + unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } + my $result; + $result = $adaptor->query_object(type => $term); + my $row = shift(@$result); + my $lsid = $row->{object_lsid}; + my $type = $row->{object_type}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $email = $row->{contact_email}; + + if ($lsid) { # if it is in there, then the object exists + return ( 0, "This term already exists: $lsid", $lsid ); + } + $args{description} =~ s/^\s+(.*?)\s+$/$1/s; + $args{node} =~ s/^\s+(.*?)\s+$/$1/s; + $args{contact_email} =~ s/^\s+(.*?)\s+$/$1/s; + $args{authority} =~ s/^\s+(.*?)\s+$/$1/s; + + my $insertid = $adaptor->insert_object(object_type => $args{'node'}, + object_lsid => $LSID, + description => $args{'description'}, + authority => $args{'authority'}, + contact_email => $args{'contact_email'}); + unless ( $insertid ) { + return ( 0, "Object creation failed for unknown reasons", '' ); + } + return ( 1, "Object creation succeeded", $LSID ); +} + +=head2 retrieveObject + +=cut + +sub retrieveObject { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + my $term = $args{'type'}; + $term ||=$args{'node'}; + + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); + return ( 0, "requires a object type node as an argument", '' ) + unless ( $term ); + my $LSID = + ( $term =~ /urn\:lsid/ ) + ? $term + : $self->getObjectURI($term); + unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } + my $result = $adaptor->query_object(type => $LSID); + my $row = shift(@$result); +# my $id = $row->{object_id}; + my $type = $row->{object_type}; + my $lsid = $row->{object_lsid}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $contact = $row->{contact_email}; + + unless ($lsid) { return ( 0, "Object doesn't exist in ontology", "" ) } + + # my $OS = MOBY::OntologyServer->new(ontology => "relationship"); + + $result = $adaptor->get_object_relationships(type => $lsid); + my %rel; + foreach my $row (@$result) + { + my $relationship_type = $row->{relationship_type}; + my $objectlsid = $row->{object_lsid}; + my $article = $row->{object2_articlename}; + my $contact = $row->{contact_email}; + my $def = $row->{definition}; + my $auth = $row->{authority}; + my $type = $row->{object_type}; + + push @{ $rel{$relationship_type} }, [ $objectlsid, $article, $type, $def, $auth, $contact ]; + } + return { + objectType => $type, + objectLSID => $lsid, + description => $desc, + contactEmail => $contact, + authURI => $auth, + Relationships => \%rel + }; +} + +=head2 deprecateObject + +=cut + +sub deprecateObject { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + + return ( 0, "WRONG ONTOLOGY", '' ) unless ( $self->ontology eq 'object' ); + my $term = $args{term}; + +# if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ +# return (0, "can't delete from external ontology", $term); +# } + my $LSID; + unless ( $term =~ /urn\:lsid/ ) { $LSID = $self->getObjectURI($term) } else { $LSID = $term } + return ( 0, q{Object type $term cannot be resolved to an LSID}, "" ) + unless $LSID; + + my $result = $adaptor->query_object(type => $LSID); + my $row = shift(@$result); + my $id = $row->{object_id}; + my $lsid = $row->{object_lsid}; + + # object1_id ISA object2_id? + my $isa = $adaptor->query_object_term2term(type => $lsid); + my $isas = shift @$isa; + if ( $isas->{object1_id}) { + return ( 0, + qq{Object type $term has object dependencies in the ontology}, + $lsid ); + } + + my ($err, $errstr) = $adaptor->delete_object(type => $lsid); + if ( $err ) { + return ( 0, "Delete from Object Class table failed: $errstr", + $lsid ); + } + return ( 1, "Object $term Deleted", $lsid ); +} + +=head2 deleteObject + +=cut + +sub deleteObject { + my $self = shift; + $self->deprecateObject(@_); +} + +=head2 relationshipExists + +=cut + +sub relationshipExists { + + # term => $term + # ontology => $ontology + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); + return ( 0, "WRONG ONTOLOGY!", '' ) + unless ( $self->ontology eq 'relationship' ); + my $term = lc( $args{term} ); + $term =~ s/^moby://; # if the term is namespaced, then remove that + my $ont = $args{ontology}; + return ( 0, "requires both term and ontology arguments\n", '' ) + unless ( defined($term) && defined($ont) ); + my $result; + if ( $term =~ /^urn\:lsid/ ) { + + $result = $adaptor->query_relationship( + type => $term, + ontology => $ont); + + } else { + + $result = $adaptor->query_relationship(type => $term, ontology => $ont); + + } + my $row = shift(@$result); + my $lsid = $row->{relationship_lsid}; + my $type = $row->{relationship_type}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $email = $row->{contact_email}; + if ($lsid) { + return ( 1, $desc, $lsid, $type, $auth, $email ); + } else { + return ( + 0,"Relationship Type $term does not exist in the biomoby.org Relationship Type system\n", + '', '', '', '' + ); + } +} + +=head2 addObjectRelationship + +=cut + +sub addObjectRelationship { + + # adds a relationship + #subject_node => $term, + #relationship => $reltype, + #object_node => $objectType, + #articleName => $articleName, + #authority => $auth, + #contact_email => $email + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); + + my $result = $adaptor->query_object(type => $args{subject_node}); + my $row = shift(@$result); + my $subj_lsid = $row->{object_lsid}; + return ( 0, qq{Object type $args{subject_node} does not exist in the ontology}, '' ) + unless defined $subj_lsid; + + $result = $adaptor->query_object(type => $args{object_node}); + $row = shift(@$result); + my $obj_lsid = $row->{object_lsid}; + return ( 0,qq{Object type $args{object_node} does not exist in the ontology},'' ) + unless defined $obj_lsid; + my $isa = $adaptor->query_object_term2term(type => $subj_lsid); + my $isarow = shift @$isa; + if ( $isarow->{object_lsid} ) { + return ( + 0, + qq{Object type $args{subject_node} has existing object dependencies in the ontology. It cannot be changed.}, + $subj_lsid + ); + } + my $OE = MOBY::OntologyServer->new( ontology => 'relationship' ); + my ( $success, $desc, $rel_lsid ) = $OE->relationshipExists( + term => $args{relationship}, + ontology => 'object' ); + ($success) || return ( 0, + qq{Relationship $args{relationship} does not exist in the ontology}, + '' ); + + # need to ensure that identical article names dont' end up at the same level + my $articleNameInvalid = &_testIdenticalArticleName(term => $subj_lsid, articleName => $args{articleName}); + return (0, "Object will have conflicting articleName ".($args{articleName}), '') if $articleNameInvalid; + + my $insertid = $adaptor->insert_object_term2term(relationship_type => $rel_lsid, + object1_type => $subj_lsid, + object2_type => $obj_lsid, + object2_articlename => $args{articleName}); + + + if ($insertid ) { + return ( 1, "Object relationsihp created successfully", '' ); + } else { + return ( 0, "Object relationship creation failed for unknown reasons", + '' ); + } +} + +sub _testIdenticalArticleName { + my (%args)= @_; + my $term = $args{term}; + my $articleName = $args{articleName}; + my $foundCommonArticleNameFlag = 0; + # need to first traverse down the ISA pathway to root + # then for each ISA test the hAS and HASA's for their articlenames and see if they are the same + # case insensitive? + my $OS = MOBY::OntologyServer->new(ontology => 'object'); + my $OSrel = MOBY::OntologyServer->new(ontology => 'relationship'); + my ($exists1, $desc, $isalsid) = $OSrel->relationshipExists(term => 'isa', ontology => 'object'); + my ($exists2, $desc2, $hasalsid) = $OSrel->relationshipExists(term => 'hasa', ontology => 'object'); + my ($exists3, $desc3, $haslsid) = $OSrel->relationshipExists(term => 'has', ontology => 'object'); + + return 1 unless ($exists1 && $exists2 && $exists3); # this is bad, since it returns boolean suggesting that it found a common articlename rather than finding that a given relationship doesn't exist, but... hey.... + # check the hasa relationships for common articleName + $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $args{term}, relationship => $hasalsid, targetArticleName => $articleName); + # check the has relationships for common articleName + $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $args{term}, relationship => $haslsid, targetArticleName => $articleName); + + # now get all of its inherited parents + my $relationships = $OS->Relationships( + ontology => 'object', + term => $args{term}, + relationship => $isalsid, + direction => 'root', + expand => 1); + #relationships{relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] + my ($isa) = keys(%$relationships); # can only be one key returned, and must be isa in this case + my @ISAlist; + (@ISAlist = @{$relationships->{$isa}}) if ($relationships->{$isa}) ; + # for each of the inherited parents, check their articleNames + foreach my $ISA(@ISAlist){ # $ISA = [lsid, articleName] (but articleName shuld be null anyway in this case) + my $what_it_is = shift @$ISA; + # check the hasa relationships for common articleName + $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $what_it_is, relationship => $hasalsid, targetArticleName => $articleName); + # check the has relationships for common articleName + $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $what_it_is, relationship => $haslsid, targetArticleName => $articleName); + } + return $foundCommonArticleNameFlag; +} + +sub _compareArticleNames { + my (%args) = @_; + my $OS = $args{OS}; + my $what_it_is = $args{type}; + my $lsid = $args{relationship}; + my $targetArticleName = $args{targetArticleName}; + my $foundCommonArticleNameFlag = 0; + my $contents = $OS->Relationships( + ontology => 'object', + term => $what_it_is, + relationship => $lsid, + direction => 'root', + ); + if ($contents){ + #$hasarelationships{relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] + my ($content) = keys(%$contents); + if ($contents->{$content}){ + my @CONTENTlist = @{$contents->{$content}}; + foreach my $CONTAINED(@CONTENTlist){ + $foundCommonArticleNameFlag = 1 if ($CONTAINED->[1] eq $targetArticleName); #->[1] is the articleName field + } + } + } + return $foundCommonArticleNameFlag; +} + +=head2 addServiceRelationship + +=cut + +sub addServiceRelationship { + + # adds an ISA relationship + # fail if another object is in relation to this objevt + #subject_node => $term, + #relationship => $relationship, + #predicate_node => $pred + #authority => $auth, + #contact_email => $email); + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); + + my $result = $adaptor->query_service(type => $args{subject_node}); + my $row = shift(@$result); + my $sbj_lsid = $row->{service_lsid}; + + return (0, + qq{Service type $args{subject_node} has object dependencies in the ontology. It can not be changed}, + $sbj_lsid + ) unless defined $sbj_lsid; + + my $isa = $adaptor->query_service_term2term(service2_id => $sbj_lsid); + my $isarow = shift @$isa; + if ( $isarow->{service_lsid} ) { + return ( + 0, + qq{Service type $args{subject_node} has object dependencies in the ontology. It can not be changed}, + $sbj_lsid + ); + } + $result = $adaptor->query_service(type => $args{object_node}); + $row = shift(@$result); + my $obj_lsid = $row->{service_lsid}; + # get ID of the related service + + defined $obj_lsid + || return ( 0, + qq{Service $args{object_node} does not exist in the service ontology}, + '' ); + my $OE = MOBY::OntologyServer->new( ontology => 'relationship' ); + my ( $success, $desc, $rel_lsid ) = $OE->relationshipExists( + term => $args{relationship}, + ontology => 'service' ); + ($success) + || return ( 0, + qq{Relationship $args{relationship} does not exist in the ontology}, + '' ); + + my $insertid = $adaptor->insert_service_term2term(relationship_type => $rel_lsid, + service1_type => $sbj_lsid, + service2_type => $obj_lsid); + if ( defined($insertid)) { + return ( 1, "Service relationship created successfully", '' ); + } else { + return ( 0, "Service relationship creation failed for unknown reasons", + '' ); + } +} + +=head2 serviceExists + +=cut + +sub serviceExists { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); + my $term = $args{term}; + $term =~ s/^moby://; # if the term is namespaced, then remove that + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) + { + return ( 1, "external ontology", $term ); + } + my $result; + $result = $adaptor->query_service(type => $term); + my $row = shift(@$result); + my $id = $row->{service_id}; + my $type = $row->{service_type}; + my $lsid = $row->{service_lsid}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $email = $row->{contact_email}; + + if ($id) { + return ( 1, $desc, $lsid ); + } else { + return ( + 0, +"Service Type $term does not exist in the biomoby.org Service Type ontology\n", + '' + ); + } +} + +=head2 createServiceType + +=cut + +sub createServiceType { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + + #node => $term, + #descrioption => $desc, + #authority => $auth, + #contact_email => $email); + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); + return ( 0, "requires a object type node", '' ) unless ( $args{node} ); + return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); + return ( 0, "requires a contact email address", '' ) + unless ( $args{contact_email} ); + return ( 0, "requires a object description", '' ) + unless ( $args{description} ); + my $term = $args{node}; + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) + { # if it is an LSID, but not a MOBY LSID, than barf + return ( 0, "can't create a term in a non-MOBY ontology!", $term ); + } + my $LSID = + ( $args{'node'} =~ /urn\:lsid/ ) + ? $args{'node'} + : $self->setURI( $args{'node'} ); + unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } + + my $insertid = $adaptor->insert_service(service_type => $args{'node'}, + service_lsid => $LSID, + description => $args{'description'}, + authority => $args{'authority'}, + contact_email => $args{'contact_email'}); + + unless ( $insertid ) { + return ( 0, "Service creation failed for unknown reasons", '' ); + } + return ( 1, "Service creation succeeded", $LSID ); +} + +=head2 deleteServiceType + +=cut + +sub deleteServiceType { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); + my $term = $args{term}; + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) + { + return ( 0, "can't delete from external ontology", $term ); + } + my $LSID; + unless ( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) { + $LSID = $self->getServiceURI($term); + } else { + $LSID = $term; + } + return ( + 0, q{Service type $term cannot be resolved to an LSID in the MOBY ontologies},"" + ) unless $LSID; + + my $result = $adaptor->query_service(type => $LSID); + my $row = shift(@$result); + my $lsid = $row->{service_lsid}; + + if ( !defined $lsid ) { + return ( 0, q{Service type $term does not exist in the ontology}, + $lsid ); + } + + # service1_id ISA service2_id? + my $isa = $adaptor->query_service_term2term(type => $lsid); + my $isas = shift(@$isa); + + if ( $isas->{service1_id} ) { + return ( 0, qq{Service type $term has dependencies in the ontology}, + $lsid ); + } + my ($err, $errstr) = $adaptor->delete_service(type => $lsid); + + if ( $err ) { + return ( 0, "Delete from Service Type table failed: $errstr", + $lsid ); + } + + return ( 1, "Service Type $term Deleted", $lsid ); +} + +=head2 namespaceExists + +=cut + +sub namespaceExists { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + + return ( 0, "WRONG ONTOLOGY!", '' ) + unless ( $self->ontology eq 'namespace' ); + my $term = $args{term}; + $term =~ s/^moby://; # if the term is namespaced, then remove that + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) + { + return ( 1, "external ontology", $term ); + } + my $result; + $result = $adaptor->query_namespace(type => $term); + my $row = shift(@$result); + my $id = $row->{namespace_id}; + my $type = $row->{namespace_type}; + my $lsid = $row->{namespace_lsid}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $email = $row->{contact_email}; + + if ($id) { + return ( 1, $desc, $lsid ); + } else { + return ( + 0, +"Namespace Type $term does not exist in the biomoby.org Namespace Type ontology\n", + '' + ); + } +} + +=head2 createNamespace + +=cut + +sub createNamespace { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + #node => $term, + #descrioption => $desc, + #authority => $auth, + #contact_email => $email); + return ( 0, "WRONG ONTOLOGY!", '' ) + unless ( $self->ontology eq 'namespace' ); + return ( 0, "requires a namespace type node", '' ) unless ( $args{node} ); + return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); + return ( 0, "requires a contact email address", '' ) + unless ( $args{contact_email} ); + return ( 0, "requires a object description", '' ) + unless ( $args{description} ); + my $term = $args{node}; + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) + { # if it is an LSID, but not a MOBY LSID, than barf + return ( 0, "can't create a term in a non-MOBY ontology!", $term ); + } + my $LSID = + ( $args{'node'} =~ /urn\:lsid/ ) + ? $args{'node'} + : $self->setURI( $args{'node'} ); + unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } + + my $insertid = $adaptor->insert_namespace(namespace_type => $args{'node'}, + namespace_lsid => $LSID, + description => $args{'description'}, + authority => $args{'authority'}, + contact_email => $args{'contact_email'}); + + unless ( $insertid ) { + return ( 0, "Namespace creation failed for unknown reasons", '' ); + } + return ( 1, "Namespace creation succeeded", $LSID ); +} + +=head2 deleteNamespace + +=cut + +sub deleteNamespace { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + return ( 0, "WRONG ONTOLOGY!", '' ) + unless ( $self->ontology eq 'namespace' ); + my $term = $args{term}; + my $LSID; + unless ( $term =~ /urn\:lsid/ ) { $LSID = $self->getNamespaceURI($term) } else { $LSID = $term } + return ( 0, q{Namespace type $term cannot be resolved to an LSID}, "" ) + unless $LSID; + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) + { + return ( 0, "cannot delete a term from an external ontology", $term ); + } + + my $result = $adaptor->query_namespace(type => $LSID); + my $row = shift(@$result); + my $lsid = $row->{namespace_lsid}; + + unless ($lsid) { + return ( 0, q{Namespace type $term does not exist in the ontology}, + $lsid ); + } + + # service1_id ISA service2_id? + my $isa = $adaptor->query_namespace_term2term(type => $lsid); + my $isas = shift @$isa; + + if ($isas->{namespace1_id} ) { + return ( 0, qq{Namespace type $term has dependencies in the ontology}, + $lsid ); + } + + my ($err, $errstr) = $adaptor->delete_namespace(type => $lsid); + + if ( $err ) { + return ( 0, "Delete from namespace table failed: $errstr", + $lsid ); + } + + #($err, $errstr) = $adaptor->delete_namespace_term2term(namespace1_id => $lsid); + # + #if ( $err ) { + # return ( + # 0, + # "Delete from namespace term2term table failed: $errstr", + # $lsid + # ); + #} + return ( 1, "Namespace Type $term Deleted", $lsid ); +} + +=head2 retrieveAllServiceTypes + +=cut + +sub retrieveAllServiceTypes { + my ($self) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + my $types = $adaptor->query_service(); + + my %response; + foreach (@$types) { + $response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}]; #COMMENT/REMOVE + #$response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}, $_->{contact_email}, $_->{authority}]; #UNCOMMENT + } + return \%response; +} + +=head2 retrieveAllNamespaceTypes + +=cut + +sub retrieveAllNamespaceTypes { + my ($self) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + my $types = $adaptor->query_namespace(); + + my %response; + foreach (@$types) { + $response{ $_->{namespace_type} } = [$_->{description}, $_->{namespace_lsid}, $_->{authority}, $_->{contact_email}]; + } + return \%response; +} + +=head2 retrieveAllObjectClasses + +=cut + +sub retrieveAllObjectClasses { + my ($self) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + my $types = $adaptor->query_object(); + + my %response; + foreach (@$types) { + $response{ $_->{object_type} } = [$_->{description}, $_->{object_lsid}]; + } + return \%response; +} +*retrieveAllObjectTypes = \&retrieveAllObjectClasses; +*retrieveAllObjectTypes = \&retrieveAllObjectClasses; + +=head2 getObjectCommonName + +=cut + +sub getObjectCommonName { + my ( $self, $URI ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + return undef unless $URI =~ /urn\:lsid/; + my $result = $adaptor->query_object(type => $URI); + my $row = shift(@$result); + my $name = $row->{object_type}; + + return $name ? $name : $URI; +} + +=head2 getNamespaceCommonName + +=cut + +sub getNamespaceCommonName { + my ( $self, $URI ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + return undef unless $URI =~ /urn\:lsid/; + my $result = $adaptor->query_namespace(type => $URI); + my $row = shift(@$result); + my $name = $row->{namespace_type}; + + return $name ? $name : $URI; +} + +=head2 getServiceCommonName + +=cut + +sub getServiceCommonName { + my ( $self, $URI ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + return undef unless $URI =~ /urn\:lsid/; + my $result = $adaptor->query_service(type => $URI); + my $row = shift(@$result); + my $name = $row->{service_type}; + + return $name ? $name : $URI; +} + +=head2 getServiceURI + +=cut + +sub getServiceURI { + my ( $self, $term ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + return $term if $term =~ /urn\:lsid/; + + my $result = $adaptor->query_service(type => $term); + my $row = shift(@$result); + my $id = $row->{service_lsid}; + + return $id; +} + +=head2 getObjectURI + +=cut + +sub getObjectURI { + my ( $self, $term ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + return $term if $term =~ /urn\:lsid/; + + my $result = $adaptor->query_object(type => $term); + my $row = shift(@$result); + my $id = $row->{object_lsid}; + + return $id; +} + +=head2 getNamespaceURI + +=cut + +sub getNamespaceURI { + my ( $self, $term ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + + return $term if $term =~ /urn\:lsid/; + + my $result = $adaptor->query_namespace(type => $term); + my $row = shift(@$result); + my $id = $row->{namespace_lsid}; + + return $id; +} + +=head2 getRelationshipURI + +consumes ontology (object/service) +consumes relationship term as term or LSID + +=cut + +sub getRelationshipURI { + my ( $self, $ontology, $term ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); + + return $term if $term =~ /urn\:lsid/; + + my $result = $adaptor->query_relationship(type => $term, ontology => $ontology); + my $row = shift(@$result); + my $id = $row->{relationship_lsid}; + + return $id; +} + +=head2 getRelationshipTypes + +=cut + +sub getRelationshipTypes { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); + + my $ontology = $args{'ontology'}; + my $OS = MOBY::OntologyServer->new( ontology => "relationship" ); + + my $defs = $adaptor->query_relationship(ontology => $ontology); + + my %result; + foreach ( @$defs ) { + $result{ $_->{relationship_lsid} } = [ $_->{relationship_type}, $_->{authority}, $_->{description} ]; + } + return \%result; +} + +=head2 Relationships + +=cut + +sub Relationships { + + # this entire subroutine assumes that there is NOT multiple parenting!! + my ( $self, %args ) = @_; + my $ontology = $args{ontology} ? $args{ontology} : $self->ontology; + my $term = $args{term}; + my $relationship = $args{relationship}; + my $direction = $args{direction} ? $args{direction} : 'root'; + my $expand = $args{expand} ? 1 : 0; + return + unless ( $ontology + && $term + && ( ( $ontology eq 'service' ) || ( $ontology eq 'object' ) ) ); + + # convert $term into an LSID if it isn't already + if ( $ontology eq 'service' ) { + $term = $self->getServiceURI($term); + $relationship ||="isa"; + my $OS = MOBY::OntologyServer->new(ontology => 'relationship'); + $relationship = $OS->getRelationshipURI("service", $relationship); + } elsif ( $ontology eq 'object' ) { + $term = $self->getObjectURI($term); + $relationship ||="isa"; + my $OS = MOBY::OntologyServer->new(ontology => 'relationship'); + $relationship = $OS->getRelationshipURI("object", $relationship); + } + my %results; + while ( ( $term ne 'urn:lsid:biomoby.org:objectclass:Object' ) + && ( $term ne 'urn:lsid:biomoby.org:servicetype:Service' ) ) + { + my $defs = $self->_doRelationshipsQuery( $ontology, $term, + $relationship, $direction ); + return {[]} unless $defs; # somethig has gone terribly wrong! + my $lsid; + my $rel; + my $articleName; + foreach ( @{$defs} ) { + $lsid = $_->[0]; + $rel = $_->[1]; + $articleName = $_->[2]; + $articleName ||=""; + $debug + && _LOG("\t\tADDING RELATIONSHIP $_ : $lsid to $rel\n"); + push @{ $results{$rel} }, [$lsid, $articleName]; + } + last unless ($expand); + last unless ( $direction eq "root" ); # if we aren't going to root, then be careful or we'll loop infnitely + $term = $lsid; # this entire subroutine assumes that there is NOT multiple parenting... + } + return \%results; #results(relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] +} + +sub _doRelationshipsQuery { + my ( $self, $ontology, $term, $relationship, $direction ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $datasource = "moby$ontology"; # like mobyobject, or mobyservice + my $adaptor = $CONFIG->getDataAdaptor( datasource => $datasource ); + my $defs; + # query returns a reference to an array containing array references + $defs = $adaptor->get_relationship(direction => $direction, + ontology => $ontology, + term => $term, + relationship => $relationship); + # a very long piece of SQL statements have been refactored into Moby::Adaptor::moby::queryapi::mysql.pm + return $defs; +} + +=head2 setURI + +=cut + +sub setURI { + my ( $self, $id ) = @_; + my $URI; + + # $id = lc($id); + if ( $self->ontology eq 'object' ) { + $URI = "urn:lsid:biomoby.org:objectclass:$id"; + } elsif ( $self->ontology eq 'namespace' ) { + $URI = "urn:lsid:biomoby.org:namespacetype:$id"; + } elsif ( $self->ontology eq 'service' ) { + $URI = "urn:lsid:biomoby.org:servicetype:$id"; + } elsif ( $self->ontology eq 'relationship' ) { + $URI = "urn:lsid:biomoby.org:relationshiptype:$id"; + } else { + $URI = 0; + } + return $URI; +} + +=head2 traverseDAG + +=cut + +sub traverseDAG { + my ( $self, $term, $direction ) = @_; + my $ontology = $self->ontology; + return {} unless $ontology; + return {} unless $term; + $direction = "root" unless ($direction); + return {} unless ( ( $direction eq 'root' ) || ( $direction eq 'leaves' ) ); + if ( $ontology eq 'service' ) { + $term = $self->getServiceURI($term); + } elsif ( $ontology eq 'object' ) { + $term = $self->getObjectURI($term); + } + return {} unless $term =~ /^urn\:lsid/; # now its a URI + my $relhash = $self->getRelationshipTypes( ontology => $ontology ); # get teh types of relationships for the object/service ontology + return {} unless $relhash; + my @rels = keys %{$relhash}; #@rels is the list of relationship types for that ontology + my %relationships; + foreach my $relationship (@rels) { + my %IDS; + my $OS = MOBY::OntologyServer->new( ontology => 'relationship' ); + my $reluri = + $OS->getRelationshipURI( $ontology, $relationship ) + ; # get the URI for that relationship type if it ins't already a URI + $IDS{$term} = "untestedroot"; # mark the one in-hand as being untested + while ( grep /untested/, ( values %IDS ) ) + { # now, while there are untested services in our list... + foreach my $termthingy ( keys %IDS ) + { # start parsing through the current list (hash keys) + $debug && _LOG("testing $relationship of $termthingy\n"); + next + if ( $IDS{$termthingy} eq "tested" ) + ; # if it has been tested already then move on + my $lsids = $self->Relationships( + term => $termthingy, + relationship => $relationship, + direction => $direction + ) + ; # get the related terms for this type; this should return a single hash value + if ( $IDS{$termthingy} =~ /root/ ) + { # here is where we remove self + delete $IDS{$termthingy}; + $debug && _LOG("deleting $termthingy\n"); + } else { + $debug && _LOG("marking $termthingy as TESTED\n"); + $IDS{$termthingy} = + "tested"; # mark the current one as now being "done" + } + + #${$lsids}{relationshiptype}=[lsid, lsid, lsid]; + foreach my $lsid_article ( @{ $lsids->{$relationship} } ) + { # go through the related terms + my ($lsid, $article) = @{$lsid_article}; + $debug && _LOG("found $lsid as relationship"); + next + if ( defined $IDS{$lsid} ) + ; # if we have already seen that term, skip it + $debug && _LOG("setting $lsid as untested\n"); + $IDS{$lsid} = + "untested" # otherwise add it to the list and loop again. + } + } + } + my @IDS = keys %IDS; + $relationships{$relationship} = + \@IDS; # and associate them all with the current relationship type + } + return \%relationships; +} + +sub _LOG { + return unless $debug; + + #print join "\n", @_; + #print "\n---\n"; + #return; + open LOG, ">>/tmp/OntologyServer.txt" or die "can't open logfile $!\n"; + print LOG join "\n", @_; + print LOG "\n---\n"; + close LOG; +} +sub DESTROY { } + +sub AUTOLOAD { + no strict "refs"; + my ( $self, $newval ) = @_; + $AUTOLOAD =~ /.*::(\w+)/; + my $attr = $1; + if ( $self->_accessible( $attr, 'write' ) ) { + *{$AUTOLOAD} = sub { + if ( defined $_[1] ) { $_[0]->{$attr} = $_[1] } + return $_[0]->{$attr}; + }; ### end of created subroutine +### this is called first time only + if ( defined $newval ) { + $self->{$attr} = $newval; + } + return $self->{$attr}; + } elsif ( $self->_accessible( $attr, 'read' ) ) { + *{$AUTOLOAD} = sub { + return $_[0]->{$attr}; + }; ### end of created subroutine + return $self->{$attr}; + } + + # Must have been a mistake then... + croak "No such method: $AUTOLOAD"; +} +1; From fgibbons at pub.open-bio.org Wed Sep 21 15:05:14 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Wed Sep 21 16:14:59 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509211905.j8LJ5EKD012429@pub.open-bio.org> fgibbons Wed Sep 21 15:05:14 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv12383/MOBY Modified Files: CommonSubs.pm Log Message: - Major re-arrangement of code, with a few small additions, which I try to describe below: - Code re-arranged into blocks, according to broad functional category. This module is one of the most confusing to newbies, since there's all this stuff just thrown in, with no apparent order to it. - POD adjusted to take more advantage of HTML output. Previously, it was just all one big dump of text - it's a lot easier to read when there's bolding and different sized fonts. Also those annoying "Title" headings are gone. - Because we're so lax about namespaces, any time we try to getAttribute() on a DOM node, we have to check for two things. Now there are two new routines that take care of that: _moby_getAttribute and _moby_getAttributeNode They're not exported, since they're intended for internal use only. - In generating a collectionResponse, we want to return an empty message if the $data passed in is empty. There's a bug fix that tests for an entirely empty $data arrayref. Previously, it just tested the first element. - Most tags are tightened up, and regexps are contracted. moby-live/Perl/MOBY CommonSubs.pm,1.68,1.69 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.68 retrieving revision 1.69 diff -u -r1.68 -r1.69 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/09/01 14:00:00 1.68 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/09/21 19:05:14 1.69 @@ -6,14 +6,21 @@ useful in clients and services to deal with the input/output from MOBY Services -=cut +=head1 DESCRIPTION + +CommonSubs are used to do various manipulations of MOBY Messages. It is useful +both Client and Service side to construct and parse MOBY Messages, and ensure +that the message structure is valid as per the API. + +It DOES NOT connect to MOBY Central for any of its functions, though it does +contact the ontology server, so it will require a network connection. + +=head1 SYNTAX =head2 Client Side Paradigm not written yet -=cut - =head2 Service-Side Paradigm The following is a generalized architecture for *all* @@ -23,7 +30,7 @@ sub myServiceName { my ($caller, $data) = @_; my $MOBY_RESPONSE; # holds the response raw XML - + # genericServiceInputParser # unpacks incoming message into an array of arrarefs. # Each element of the array is a queryInput block, or a mobyData block @@ -31,11 +38,11 @@ # [SIMPLE, $queryID, $simple] # the first element is an exported constant SIMPLE, COLLECTION, SECONDARY # the second element is the queryID (required for enumerating the responses) - # the third element is the XML::LibXML for the Simple, Collection, or Parameter block - my (@inputs)= genericServiceInputParser($data); + # the third element is the XML::LibXML for the Simple, Collection, or Parameter block + my (@inputs)= genericServiceInputParser($data); # or fail properly with an empty response return SOAP::Data->type('base64' => responseHeader("my.authURI.com") . responseFooter()) unless (scalar(@inputs)); - + # you only need to do this if you are intending to be namespace aware # some services might not care what namespace the data is in, so long # as there is data... @@ -53,16 +60,15 @@ # (see pod docs for other possibilities) my $namespace = getSimpleArticleNamespaceURI($input); # get namespace my ($identifier) = getSimpleArticleIDs($input); # get ID (note array output! see pod) - + # here is where you do whatever manipulation you need to do # for your particular service. - # you will be building an XML document into $MOBY_RESPONSE + # you will be building an XML document into $MOBY_RESPONSE } } - return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter)); + return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter)); } -=cut =head1 EXAMPLE @@ -113,7 +119,7 @@ unless ($accession =~/^GO:/){ $accession = "GO:$accession"; # we still haven't decided on whether id's should include the prefix... } - $sth->execute($accession); + $sth->execute($accession); my ($term, $def) = $sth->fetchrow_array; if ($term){ $MOBY_RESPONSE .= simpleResponse(" @@ -126,19 +132,9 @@ } } } - - return SOAP::Data->type('base64' => (responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter)); - } - - -=head1 DESCRIPTION - -CommonSubs are used to do various manipulations of MOBY Messages. It is useful -both Client and Service side to construct and parse MOBY Messages, and ensure -that the message structure is valid as per the API. -It DOES NOT connect to MOBY Central for any of its functions, though it does -contact the ontology server, so it will require a network connection. + return SOAP::Data->type('base64' => (responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter)); + } =head1 AUTHORS @@ -147,9 +143,7 @@ BioMOBY Project: http://www.biomoby.org -=cut - -=head1 METHODS +=head1 PARSING INPUT =cut @@ -172,41 +166,6 @@ use constant BE_STRICT => 0; our @ISA = qw(Exporter); our @EXPORT = qw(COLLECTION SIMPLE SECONDARY PARAMETER BE_NICE BE_STRICT); -our @EXPORT_OK = qw( - getSimpleArticleIDs - getSimpleArticleNamespaceURI - simpleResponse - collectionResponse - complexResponse - responseHeader - responseFooter - getInputArticles - getInputs - getInputID - getArticles - getCollectedSimples - getNodeContentWithArticle - extractRawContent - validateNamespaces - validateThisNamespace - isSimpleArticle - isCollectionArticle - isSecondaryArticle - extractResponseArticles - getResponseArticles - getCrossReferences - genericServiceInputParser - genericServiceInputParserAsObject - complexServiceInputParser - whichDeepestParentObject - getServiceNotes - COLLECTION - SIMPLE - SECONDARY - PARAMETER - BE_NICE - BE_STRICT -); our %EXPORT_TAGS = ( all => [ qw( @@ -244,98 +203,127 @@ BE_STRICT ) ] -); +);# complexResponse is *not* here, but is in @EXPORT_OK + + +our @EXPORT_OK = ("collectionResponse", @{$EXPORT_TAGS{'all'}}); =head2 genericServiceInputParser - function : For the MOST SIMPLE SERVICES that take single Simple or Collection inputs - and no Secondaries/Parameters this routine takes the MOBY message and - breaks the objects out of it in a useful way - usage : my @inputs = genericServiceInputParser($MOBY_mssage)); - args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message - returns : @inputs - the structure of @inputs is a list of listrefs. - Each listref has three components: - 1. COLLECTION|SIMPLE (i.e. constants 1, 2) - 2. queryID - 3. $data - the data takes several forms - a. $article XML::LibXML node for Simples - ... - b. \@article XML:LibXML nodes for Collections - - for example, the input message: - - - - - - - - - - - +B For the MOST SIMPLE SERVICES that take single Simple or +Collection inputs and no Secondaries/Parameters this routine takes the +MOBY message and breaks the objects out of it in a useful way + +B + my @inputs = genericServiceInputParser($MOBY_mssage)); + +B C<$message> - this is the SOAP payload; i.e. the XML document containing the MOBY message + +B C<@inputs> - the structure of @inputs is a list of listrefs. + +Each listref has three components: + +=over 4 + +=item * +COLLECTION|SIMPLE (i.e. constants 1, 2) + +=item * +queryID + +=item * +$data - the data takes several forms + +=over 4 + +=item * +$article XML::LibXML node for Simples ... + +=item * +\@article XML:LibXML nodes for Collections - will become: +=back + +=back + +For example, the input message: + + + + + + + + + + + +will become: (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module) @inputs = ([SIMPLE, 1, $DOM], [SIMPLE, 2, $DOM]) # the block - for example, the input message: - - - - - - - - - - - +For example, the input message: - will become: + + + + + + + + + + - @inputs = ( [COLLECTION, 1, [$DOM, $DOM]] ) # the block +will become: + + @inputs = ( [COLLECTION, 1, [$DOM, $DOM]] ) # the block =cut sub genericServiceInputParser { - my ( $message ) = @_; # get the incoming MOBY query XML - my @inputs; # set empty response - my @queries = - getInputs( $message ); # returns XML::LibXML nodes ... - foreach my $query ( @queries ) { - my $queryID = - getInputID( $query ); # get the queryID attribute of the mobyData - my @input_articles = - getArticles( $query ) - ; # get the Simple/Collection/Secondary articles making up this query ... or ... or ... - foreach my $input ( @input_articles ) { # input is a listref - my ( $articleName, $article ) = @{$input}; # get the named article - if ( isCollectionArticle( $article ) ) { - my @simples = getCollectedSimples( $article ); - push @inputs, [ COLLECTION, $queryID, \@simples ]; - } elsif ( isSimpleArticle( $article ) ) { - push @inputs, [ SIMPLE, $queryID, $article ]; - } elsif ( isSecondaryArticle( $article ) ) - { # should never happen in a generic service parser! - push @inputs, [ SECONDARY, $queryID, $article ]; - } - } + my ( $message ) = @_; # get the incoming MOBY query XML + my @inputs; # set empty response + my @queries = getInputs( $message ); # returns XML::LibXML nodes ... + foreach my $query ( @queries ) { + my $queryID = getInputID( $query ); # get the queryID attribute of the mobyData + my @input_articles = + getArticles( $query ) + ; # get the Simple/Collection/Secondary articles making up this query ... or ... or ... + foreach my $input ( @input_articles ) { # input is a listref + my ( $articleName, $article ) = @{$input}; # get the named article + if ( isCollectionArticle( $article ) ) { + my @simples = getCollectedSimples( $article ); + push @inputs, [ COLLECTION, $queryID, \@simples ]; + } elsif ( isSimpleArticle( $article ) ) { + push @inputs, [ SIMPLE, $queryID, $article ]; + } elsif ( isSecondaryArticle( $article ) ) + { # should never happen in a generic service parser! + push @inputs, [ SECONDARY, $queryID, $article ]; } - return @inputs; + } + } + return @inputs; } =head2 serviceInputParser - DO NOT USE!! - function : to take a MOBY message and break the objects out of it. This is identical - to the genericServiceInputParser method above, except that it returns the data as - Objects rather than XML::LibXML nodes. This is an improvement! - usage : my @inputs = serviceInputParser($MOBY_mssage)); - args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message - returns : @inputs - the structure of @inputs is a list of listrefs. - Each listref has three components: +DO NOT USE!! + +B to take a MOBY message and break the objects out of it. +This is identical to the genericServiceInputParser method above, +except that it returns the data as Objects rather than XML::LibXML +nodes. This is an improvement! + +B C + +B C<$message> - this is the SOAP payload; i.e. the XML document containing the MOBY message + +B C<@inputs> - the structure of @inputs is a list of listrefs. + +Each listref has three components: + 1. COLLECTION|SIMPLE|SECONDARY (i.e. constants 1, 2, 3) 2. queryID (undef for Secondary parameters) 3. $data - either MOBY::Client::SimpleArticle, CollectionArticle, or SecondaryArticle @@ -343,108 +331,103 @@ =cut sub serviceInputParser { - my ( $message ) = @_; # get the incoming MOBY query XML - my @inputs; # set empty response - my @queries = - getInputs( $message ); # returns XML::LibXML nodes ... - -# mark, this doesn't work for complex services. We need to allow more than one input per invocation - foreach my $query ( @queries ) { - my $queryID = - getInputID( $query ); # get the queryID attribute of the mobyData - my @input_articles = - getArticlesAsObjects( $query ) - ; # get the Simple/Collection articles making up this query ... or ... or ...isCollection ) { - my @simples = getCollectedSimples( $article->XML ); - push @inputs, [ COLLECTION, $queryID, \@simples ]; - } elsif ( $article->isSimple ) { - push @inputs, [ SIMPLE, $queryID, $article ]; - } elsif ( $article->isSecondary ) { - push @inputs, [ SECONDARY, $queryID, $article ]; - } - } - } - return @inputs; + my ( $message ) = @_; # get the incoming MOBY query XML + my @inputs; # set empty response + my @queries = getInputs( $message ); # returns XML::LibXML nodes ... + + # mark, this doesn't work for complex services. We need to allow more than one input per invocation + foreach my $query ( @queries ) { + my $queryID = getInputID( $query ); # get the queryID attribute of the mobyData + # get the Simple/Collection articles making up this query + # ... or ... + # or ...isCollection ) { + my @simples = getCollectedSimples( $article->XML ); + push @inputs, [ COLLECTION, $queryID, \@simples ]; + } elsif ( $article->isSimple ) { + push @inputs, [ SIMPLE, $queryID, $article ]; + } elsif ( $article->isSecondary ) { + push @inputs, [ SECONDARY, $queryID, $article ]; + } + } + } + return @inputs; } =head2 complexServiceInputParser - function : For more complex services that have multiple articles for each input - and/or accept parameters, this routine will take a MOBY message and - extract the Simple/Collection/Parameter objects out of it in a - useful way. - usage : my $inputs = complexServiceInputParser($MOBY_mssage)); - args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message - returns : $inputs is a hashref with the following structure: - +B For more complex services that have multiple articles for +each input and/or accept parameters, this routine will take a MOBY +message and extract the Simple/Collection/Parameter objects out of it +in a useful way. + +B C + +B C<$message> - this is the SOAP payload; i.e. the XML document containing the MOBY message + +B C<$inputs> is a hashref with the following structure: + $inputs->{$queryID} = [ [TYPE, $DOM], [TYPE, $DOM], [TYPE, $DOM] ] - - Simples ------------------------ - - for example, the input message: - - - - - - - 10 - - - will become: - (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module) - +=head3 Simples + +For example, the input message: + + + + + + + 10 + + + +will become: (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module) + $inputs->{1} = [ [SIMPLE, $DOM_name1], # the block [SECONDARY, $DOM_cutoff] # $DOM_cutoff= block ] - Please see the XML::LibXML pod documentation for information about how - to parse XML DOM objects. +Please see the XML::LibXML pod documentation for information about how to parse XML DOM objects. +=head3 Collections - Collections -------------------- - - With inputs that have collections these are presented as a - listref of Simple article DOM's. So for the following message: - - - - - - - - - - - - 10 - - +With inputs that have collections these are presented as a listref of +Simple article DOM's. So for the following message: + + + + + + + + + + + + 10 + + + +will become - will become - $inputs->{1} = [ [COLLECTION, [$DOM, $DOM] ], # $DOM is the Block! [SECONDARY, $DOM_cutoff] # $DOM_cutoff = Block ] - Please see the XML::LibXML pod documentation for information about how - to parse XML DOM objects. - +Please see the XML::LibXML pod documentation for information about how to parse XML DOM objects. =cut sub complexServiceInputParser { my ( $message ) = @_; # get the incoming MOBY query XML my @inputs; # set empty response - my @queries = - getInputs( $message ); # returns XML::LibXML nodes ... + my @queries = getInputs( $message ); # returns XML::LibXML nodes ... my %input_parameters; # $input_parameters{$queryID} = [ foreach my $query ( @queries ) { - my $queryID = - getInputID( $query ); # get the queryID attribute of the mobyData + my $queryID = getInputID( $query ); # get the queryID attribute of the mobyData my @input_articles = getArticles( $query ) ; # get the Simple/Collection/Secondary articles making up this query ... or ... or ... @@ -466,14 +449,17 @@ =head2 getArticles - function : get the Simple/Collection/Parameter articles for a single mobyData - usage : @articles = getArticles($XML) - args : raw XML or XML::LibXML of a queryInput, mobyData, or queryResponse block (e.g. from getInputs) - returns : a list of listrefs; each listref is one component of the queryInput or mobyData block - a single block may consist of one or more named or unnamed - simple, collection, or parameter articles. - The listref structure is thus [name, $ARTICLE_DOM]: - +B get the Simple/Collection/Parameter articles for a single mobyData + +B C<@articles = getArticles($XML)> + +B raw XML or XML::LibXML of a queryInput, mobyData, or queryResponse block (e.g. from getInputs) + +B a list of listrefs; each listref is one component of the +queryInput or mobyData block a single block may consist of one or more +named or unnamed simple, collection, or parameter articles. The +listref structure is thus C<[name, $ARTICLE_DOM]>: + e.g.: @articles = ['name1', $SIMPLE_DOM] generated from the following sample XML: @@ -483,24 +469,24 @@ - + or : @articles = ['name1', $COLL_DOM], ['paramname1', $PARAM_DOM] generated from the following sample XML: - - - - - - - - - - - 10 - - + + + + + + + + + + + 10 + + =cut @@ -509,16 +495,15 @@ $moby = _string_to_DOM($moby); return undef unless ( ($moby->nodeType == ELEMENT_NODE) - && ( $moby->nodeName =~ /queryInput|queryResponse|mobyData/ ) ); + && ( $moby->nodeName =~ /^(moby:|)(queryInput|queryResponse|mobyData)$/ ) ); my @articles; foreach my $child ( $moby->childNodes ) { # there may be more than one Simple/Collection per input; iterate over them next unless ( ($child->nodeType == ELEMENT_NODE) # ignore whitespace - && ( $child->nodeName =~ /Simple|Collection|Parameter/ ) ); - my $articleName = $child->getAttribute( 'articleName' ) - || $child->getAttribute( 'moby:articleName' ); + && ( $child->nodeName =~ /^(moby:|)(Simple|Collection|Parameter)$/ ) ); + my $articleName = _moby_getAttribute($child, 'articleName' ); # push the named child DOM elements (which are or , ) - push @articles, [ $articleName, $child ]; + push @articles, [ $articleName, $child ]; } return @articles; # return them. } @@ -532,25 +517,34 @@ =head2 getSimpleArticleIDs - function : to get the IDs of simple articles that are in the given namespace - usage : my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles); - my @ids = getSimpleArticleIDs(\@SimpleArticles); - args : $Namespace - (optional) a namespace stringfrom the MOBY namespace ontology, or undef if you don't care - \@Simples - (required) a listref of Simple XML::LibXML nodes - i.e. the XML::LibXML representing an XML structure like this: - - - - note : If you provide a namespace, it will return *only* the ids that are in the given namespace, - but will return 'undef' for any articles in the WRONG namespace so that you get an - equivalent number of outputs to inputs. - - Note that if you call this with a single argument, this is assumed to - be \@Articles, so you will get ALL id's regardless of namespace! +B to get the IDs of simple articles that are in the given namespace + +B + + my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles); + my @ids = getSimpleArticleIDs(\@SimpleArticles); + +B + +C<$Namespace> - (optional) a namespace stringfrom the MOBY namespace ontology, or undef if you don't care + +C<\@Simples> - (required) a listref of Simple XML::LibXML nodes i.e. the XML::LibXML representing an XML structure like this: + + + + + +Note : If you provide a namespace, it will return *only* the ids that +are in the given namespace, but will return 'undef' for any articles +in the WRONG namespace so that you get an equivalent number of outputs +to inputs. + +Note that if you call this with a single argument, this is assumed to +be C<\@Articles>, so you will get ALL id's regardless of namespace! =cut -#Eddie - converted + sub getSimpleArticleIDs { my ( $desired_namespace, $input_nodes ) = @_; if ( $desired_namespace && !$input_nodes ) @@ -569,9 +563,10 @@ $OS->namespaceExists( term => $desired_namespace ); # returns (success, message, lsid) unless ( $s ) { # bail if not successful # Printing to STDERR is not very helpful - we should probably return something that can be dealt iwth programatically.... - print STDERR "MOBY::CommonSubs WARNING ** the namespace '$desired_namespace' " - . "does not exist in the MOBY ontology, and does not have a valid LSID\n"; - return undef; + die("MOBY::CommonSubs: the namespace '$desired_namespace' " + . "does not exist in the MOBY ontology, " + . "and does not have a valid LSID"); +# return undef; } $desired_namespace = $namespace_lsid; # Replace namespace with fully-qualified LSID } @@ -579,13 +574,12 @@ foreach my $in ( @input_nodes ) { next unless $in; #$in = "" - next unless $in->nodeName =~ /Simple/; # only allow simples + next unless $in->nodeName =~ /^(moby:|)Simple$/; # only allow simples my @simples = $in->childNodes; foreach ( @simples ) { # $_ = next unless $_->nodeType == ELEMENT_NODE; if ( $desired_namespace ) { - my $ns = $_->getAttributeNode( 'namespace' ) # get the namespace DOM node - || $_->getAttributeNode( 'moby:namespace' ); + my $ns = _moby_getAttributeNode($_, 'namespace' ); # get the namespace DOM node unless ( $ns ) { # if we don't get it at all, then move on to the next input push @ids, undef; # but push an undef onto teh stack in order next; @@ -594,7 +588,7 @@ ( $s, $m, $ns ) = $OS->namespaceExists( term => $ns ); # A bad namespace will return 'undef' which makes for a bad comparison (Perl warning). # Better to check directly for success ($s), THEN check that namespace is the one we wanted. - unless ( $s && $ns eq $desired_namespace ) + unless ( $s && $ns eq $desired_namespace ) { # we are registering as working in a particular namespace, so check this push @ids, undef; # and push undef onto the stack if it isn't next; @@ -602,7 +596,7 @@ } # Now do the same thing for ID's - my $id = $_->getAttributeNode( 'id' ) || $_->getAttributeNode( 'moby:id' ); + my $id = _moby_getAttributeNode($_, 'id' ); unless ( $id ) { push @ids, undef; next; @@ -620,31 +614,34 @@ =head2 getSimpleArticleNamespaceURI - function : to get the namespace of a simple article - usage : my $ns = getSimpleArticleNamespaceURI($SimpleArticle); - args : $Simple - (required) a single XML::LibXML node representing a Simple Article - i.e. the XML::LibXML representing an XML structure like this: - - - +B to get the namespace of a simple article + +B C + +B C<$Simple> - (required) a single XML::LibXML node +representing a Simple Article i.e. the XML::LibXML representing an XML +structure like this: + + + + =cut -#Eddie - converted + sub getSimpleArticleNamespaceURI { # pass me a input node and I will give you the lsid of the namespace of that input object my ( $input_node ) = @_; return undef unless $input_node; my $OS = MOBY::Client::OntologyServer->new; - + #$input_node = "" my @simples = $input_node->childNodes; foreach ( @simples ) { # $_ = # should be just one, so I will return at will from this routine next unless $_->nodeType == ELEMENT_NODE; - my $ns = $_->getAttributeNode( 'namespace' ) # get the namespace DOM node - || $_->getAttributeNode( 'moby:namespace' ); + my $ns = _moby_getAttributeNode($_, 'namespace' ); # get the namespace DOM node return undef unless ( $ns ); # if we don't get it at all, then move on to the next input my ( $s, $m, $lsid ) = $OS->namespaceExists( term => $ns->getValue ); # if we have a namespace, then get its value @@ -653,306 +650,111 @@ } } -=head2 simpleResponse +sub _string_to_DOM { +# Convert string to DOM. +# If DOM passed in, just return it (i.e., this should be idempotent) +# By Frank Gibbons, Aug. 2005 +# Utility subroutine, not for external use (no export), widely used in this package. + my $XML = shift; + my $moby; + return $XML if ( ref($XML) =~ /^XML\:\:LibXML/ ); - function : wraps a simple article in the appropriate (mobyData) structure - usage : $resp .= &simpleResponse($object, 'MyArticleName', $queryID); - args : (in order) - $object - (optional) a MOBY Object as raw XML - $article - (optional) an articeName for this article - $query - (optional, but strongly recommended) the queryID value for the - mobyData block to which you are responding - notes : as required by the API you must return a response for every input. - If one of the inputs was invalid, you return a valid (empty) MOBY - response by calling &simpleResponse(undef, undef, $queryID) with no arguments. + my $parser = XML::LibXML->new(); + my $doc; + eval { $doc = $parser->parse_string( $XML ) }; + die("CommonSubs couldn't parse XML '$XML' because\n\t$@") if $@; + return $doc->getDocumentElement(); +} -=cut +=head2 getInputs -sub simpleResponse { - my ( $data, $articleName, $qID ) = @_; # articleName optional - $qID = &_getQueryID( $qID ) - if ref( $qID ) =~ /XML\:\:LibXML/; # in case they send the DOM instead of the ID - $data ||= ''; # initialize to avoid uninit value errors - $articleName ||= ""; - $qID ||= ""; - if ( $articleName || $data) { # Linebreaks in XML make it easier for human debuggers to read! - return " - - $data - - "; - } else { - return " - - "; - } -} +B get the mobyData block(s) as XML::LibXML nodes -#Eddie - converted -sub _getQueryID { - my ( $query ) = @_; - $query = _string_to_XML($query); - return '' unless ( $query->nodeName =~ /queryInput|mobyData/ ); #Eddie - unsure - return ($query->getAttribute( 'queryID' ) - || $query->getAttribute( 'moby:queryID' )); -} +B C<@queryInputs = getInputArticles($XML)> -=head2 collectionResponse +B the raw XML of a query, or an XML::LibXML document - function : wraps a set of articles in the appropriate mobyData structure - usage : return responseHeader . &collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter; - args : (in order) - \@objects - (optional) a listref of MOBY Objects as raw XML - $article - (optional) an articeName for this article - $queryID - (optional, but strongly recommended) the mobyData ID - to which you are responding - notes : as required by the API you must return a response for every input. - If one of the inputs was invalid, you return a valid (empty) MOBY - response by calling &collectionResponse(undef, undef, $queryID). +B a list of XML::LibXML::Node's, each is a queryInput or mobyData block. + +B< Note:> Remember that these blocks are enumerated! This is what you +pass as the third argument to the simpleResponse or collectionResponse +subroutine to associate the numbered input to the numbered response =cut -sub collectionResponse { - my ( $data, $articleName, $qID ) = @_; # articleName optional - my $content = ""; - $data ||= []; - $qID ||= ''; - unless ( ( ref($data) eq 'ARRAY' ) && $data->[0] ) - { # we're expecting an arrayref as input data,and it must not be empty - return ""; - } - foreach ( @{$data} ) { - if ( $_ ) { - $content .= " - $_ - "; - } else { - $content .= " - - "; +sub getInputs { + my ( $XML ) = @_; + my $moby = _string_to_DOM($XML); + my @queries; + foreach my $querytag qw( queryInput moby:queryInput mobyData moby:mobyData ) + { + my $x = $moby->getElementsByTagName( $querytag ); # get the mobyData block + for ( 1 .. $x->size() ) { # there may be more than one mobyData per message + push @queries, $x->get_node( $_ ); + } } - } - if ( $articleName ) { - return " - - - $content - - - "; - } else { - return " - - $content - - "; - } + return @queries; # return them in the order that they were discovered. } -=head2 complexResponse +=head2 getInputID - function : wraps articles in the appropriate (mobyData) structure - usage : $resp .= &complexResponse(\@data, $qID); - args : (in order) - \@data - (optional) a listref of arrays. - each element of @data is itself a listref of [$articleName, $XML] - $qID - (optional, but strongly recommended) the queryID value for the - mobyData block to which you are responding - notes : as required by the API you must return a response for every input. - If one of the inputs was invalid, you return a valid (empty) MOBY - response by calling &complexResponse(undef, $queryID) with no arguments. +B get the value of the queryID element -=cut +B C<@queryInputs = getInputID($XML)> -sub complexResponse { - my ( $data, $qID ) = @_; - #return 'ERROR: expected listref [element1, element2, ...] for data' unless ( ref( $data ) =~ /array/i ); - return "\n" - unless ( ref( $data ) eq 'ARRAY' ); - $qID = &_getQueryID( $qID ) - if ref( $qID ) =~ /XML\:\:LibXML/; # in case they send the DOM instead of the ID - my @inputs = @{$data}; - my $output = ""; - foreach ( @inputs ) { - #return 'ERROR: expected listref [articleName, XML] for data element' unless ( ref( $_ ) =~ /array/i ); - return "\n" unless ( ref($_) eq 'ARRAY' ); - while ( my ( $articleName, $XML ) = splice( @{$_}, 0, 2 ) ) { - if ( ref($XML) ne 'ARRAY' ) { - $articleName ||= ""; - $XML ||= ""; - if ( ( $XML =~ /\/ ) || ( $XML =~ /\/ ) ) - { - $output .= - "$XML"; - } else { - $output .= - "\n$XML\n\n"; - } - - # need to do this for collections also!!!!!! - } elsif ( ref($XML) eq 'ARRAY' ) { - my @objs = @{$XML}; - $output .= "\n"; - foreach ( @objs ) { - $output .= "$_\n"; - } - $output .= "\n"; - } - } - } - $output .= "\n"; - return $output; -} +B the raw XML or XML::LibXML of a queryInput or mobyData block (e.g. from getInputs) -=head2 responseHeader +B integer, or '' - function : print the XML string of a MOBY response header +/- serviceNotes - usage : responseHeader('illuminae.com') - responseHeader( - -authority => 'illuminae.com', - -note => 'here is some data from the service provider') - args : a string representing the service providers authority URI, - OR a set of named arguments with the authority and the - service provision notes. - caveat : - notes : returns everything required up to the response articles themselves. - i.e. something like: - - - - - -=cut - -sub responseHeader { - use HTML::Entities (); - my ( $auth, $notes ) = &_rearrange( [qw[AUTHORITY NOTE]], @_ ); - $auth ||= "not_provided"; - $notes ||= ""; - my $xml = - "" - . "" - . ""; - if ( $notes ) { - my $encodednotes = HTML::Entities::encode( $notes ); - $xml .= "$encodednotes"; - } - return $xml; -} - -=head2 responseFooter - - function : print the XML string of a MOBY response footer - usage : return responseHeader('illuminae.com') . $DATA . responseFooter; - notes : returns everything required after the response articles themselves - i.e. something like: - - - - -=cut - -sub responseFooter { - return ""; -} - - -sub _string_to_DOM { -# Convert string to DOM. -# If DOM passed in, just return it (i.e., this should be idempotent) -# By Frank Gibbons, Aug. 2005 -# Utility subroutine, not for external use (no export), widely used in this package. - my $XML = shift; - my $moby; - return $XML if ( ref($XML) =~ /^XML\:\:LibXML/ ); - - my $parser = XML::LibXML->new(); - my $doc; - eval { $doc = $parser->parse_string( $XML ) }; - die("CommonSubs couldn't parse XML '$XML' because\n\t$@") if $@; - return $doc->getDocumentElement(); -} - -=head2 getInputs - - function : get the mobyData block(s) as XML::LibXML nodes - usage : @queryInputs = getInputArticles($XML) - args : the raw XML of a query, or an XML::LibXML document - returns : a list of XML::LibXML::Node's, each is a queryInput or mobyData block. - Note : Remember that these blocks are enumerated! This is what you - pass as the third argument to the simpleResponse or collectionResponse - subroutine to associate the numbered input to the numbered response - -=cut - -#Eddie - converted -sub getInputs { - my ( $XML ) = @_; - my $moby = _string_to_DOM($XML); - my @queries; - foreach my $querytag qw( queryInput moby:queryInput mobyData moby:mobyData ) - { - my $x = $moby->getElementsByTagName( $querytag ); # get the mobyData block - for ( 1 .. $x->size() ) { # there may be more than one mobyData per message - push @queries, $x->get_node( $_ ); - } - } - return @queries; # return them in the order that they were discovered. -} - -=head2 getInputID - - function : get the value of the queryID element - usage : @queryInputs = getInputID($XML) - args : the raw XML or XML::LibXML of a queryInput or mobyData block (e.g. from getInputs) - returns : integer, or '' - Note : Inputs and Responses are coordinately enumerated! - The integer you get here is what you - pass as the third argument to the simpleResponse or collectionResponse - subroutine to associate the numbered input to the numbered response +B< Note:> Inputs and Responses are coordinately enumerated! The +integer you get here is what you pass as the third argument to the +simpleResponse or collectionResponse subroutine to associate the +numbered input to the numbered response =cut sub getInputID { my ( $XML ) = @_; my $moby = _string_to_DOM($XML); - return '' unless ( $moby->nodeName =~ /queryInput|mobyData/ ); - my $qid = $moby->getAttribute( 'queryID' ) - || $moby->getAttribute( 'moby:queryID' ); + return '' unless ( $moby->nodeName =~ /^(moby:|)queryInput|mobyData$/ ); + my $qid = _moby_getAttribute($moby, 'queryID' ); return defined( $qid ) ? $qid : ''; } =head2 getArticlesAsObjects DO NOT USE!! - function : get the Simple/Collection articles for a single mobyData - or queryResponse node, rethrning them as SimpleArticle, - SecondaryArticle, or ServiceInstance objects - usage : @articles = getArticles($XML) - args : raw XML or XML::LibXML of a moby:mobyData block - returns : + +B get the Simple/Collection articles for a single mobyData +or queryResponse node, rethrning them as SimpleArticle, +SecondaryArticle, or ServiceInstance objects + +B C<@articles = getArticles($XML)> + +B raw XML or XML::LibXML of a moby:mobyData block + +B =cut -#Eddie - converted sub getArticlesAsObjects { my ( $moby ) = @_; $moby = _string_to_DOM($moby); return undef unless $moby->nodeType == ELEMENT_NODE; return undef - unless ($moby->nodeName =~ /queryInput|queryResponse|mobyData/); + unless ($moby->nodeName =~ /^(moby:|)(queryInput|queryResponse|mobyData)$/); my @articles; foreach my $child ( $moby->childNodes ) { # there may be more than one Simple/Collection per input; iterate over them next unless $child->nodeType == ELEMENT_NODE; # ignore whitespace next - unless ( $child->nodeName =~ /Simple|Collection|Parameter/ ); + unless ( $child->nodeName =~ /^(moby:|)(Simple|Collection|Parameter)$/ ); my $object; - if ( $child->nodeName =~ /Simple/ ) { + if ( $child->nodeName =~ /^(moby:|)Simple$/ ) { $object = MOBY::Client::SimpleArticle->new( XML_DOM => $child ); - } elsif ( $child->nodeName =~ /Collection/ ) { + } elsif ( $child->nodeName =~ /^(moby:|)Collection$/ ) { $object = MOBY::Client::CollectionArticle->new( XML_DOM => $child ); - } elsif ( $child->nodeName =~ /Parameter/ ) { + } elsif ( $child->nodeName =~ /^(moby:|)Parameter$/ ) { $object = MOBY::Client::SecondaryArticle->new( XML_DOM => $child ); } next unless $object; @@ -963,10 +765,13 @@ =head2 getCollectedSimples - function : get the Simple articles collected in a moby:Collection block - usage : @Simples = getCollectedSimples($XML) - args : raw XML or XML::LibXML of a moby:Collection block - returns : a list of XML::LibXML nodes, each of which is a moby:Simple block +B get the Simple articles collected in a moby:Collection block + +B C<@Simples = getCollectedSimples($XML)> + +B raw XML or XML::LibXML of a moby:Collection block + +B a list of XML::LibXML nodes, each of which is a moby:Simple block =cut @@ -974,31 +779,36 @@ my ( $moby ) = @_; $moby = _string_to_DOM($moby); return undef unless $moby->nodeType == ELEMENT_NODE; - return undef unless ( $moby->nodeName =~ /Collection$/ ); + return undef unless ( $moby->nodeName =~ /^(moby\:|)Collection$/ ); my @articles; foreach my $child ( $moby->childNodes ) { # there may be more than one Simple/Collection per input; iterate over them next unless $child->nodeType == ELEMENT_NODE; # ignore whitespace - next unless ( $child->nodeName =~ /Simple$/ ); + next unless ( $child->nodeName =~ /^(moby\:|)Simple$/ ); push @articles, $child; # take the child elements, which are or } - return ( @articles ); # return them. + return @articles; # return them. } =head2 getInputArticles - function : get the Simple/Collection articles for each input query, in order - usage : @queries = getInputArticles($XML) - args : the raw XML of a moby:MOBY query - returns : a list of listrefs, each listref is the input to a single query. - Remember that the input to a single query may be one or more Simple - and/or Collection articles. These are provided as XML::LibXML nodes. - + +B get the Simple/Collection articles for each input query, in order + +B C<@queries = getInputArticles($XML)> + +B the raw XML of a moby:MOBY query + +B a list of listrefs, each listref is the input to a single +query. Remember that the input to a single query may be one or more +Simple and/or Collection articles. These are provided as XML::LibXML +nodes. + i.e.: @queries = ([$SIMPLE_DOM_NODE], [$SIMPLE_DOM_NODE2]) or : @queries = ([$COLLECTION_DOM_NODE], [$COLLECTION_DOM_NODE2]) - + The former is generated from the following XML: - + ... @@ -1016,7 +826,6 @@ =cut -#Eddie - converted sub getInputArticles { my ( $moby ) = @_; $moby = _string_to_DOM($moby); @@ -1039,71 +848,17 @@ return @queries; # return them in the order that they were discovered. } -=head2 isSimpleArticle - - function : tests XML (text) or an XML DOM node to see if it represents a Simple article - usage : if (isSimpleArticle($node)){do something to it} - input : an XML::LibXML node, an XML::LibXML::Document or straight XML - returns : boolean - -=cut - -#Eddie - converted -sub isSimpleArticle { - my ( $DOM ) = @_; - eval { $DOM = _string_to_DOM($DOM) }; - if ($@) { - return 0; - } - $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); - return ($DOM->nodeName =~ /^(moby:|)Simple$/) ? 1 : 0; #Optional 'moby:' namespace prefix -} - -=head2 isCollectionArticle - - function : tests XML (text) or an XML DOM node to see if it represents a Collection article - usage : if (isCollectionArticle($node)){do something to it} - input : an XML::LibXML node, an XML::LibXML::Document or straight XML - returns : boolean - -=cut - -#Eddie - converted -sub isCollectionArticle { - my ( $DOM ) = @_; - eval {$DOM = _string_to_DOM($DOM) }; - return 0 if $@; - $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); - return ( $DOM->nodeName =~ /^(moby\:|)Collection$/ ) ? 1 : 0; #Optional 'moby:' prefix -} - -=head2 isSecondaryArticle - - function : tests XML (text) or an XML DOM node to see if it represents a Secondary article - usage : if (isSecondaryArticle($node)){do something to it} - input : an XML::LibXML node, an XML::LibXML::Document or straight XML - returns : boolean - -=cut +=head2 extractRawContent -#Eddie - converted -sub isSecondaryArticle { - my ( $XML ) = @_; - my $DOM; - eval {$DOM = _string_to_DOM($XML)} ; - return 0 if $@; - $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); - return ($DOM->nodeName =~ /^(moby\:|)Parameter$/) ? 1 : 0; #Optional 'moby:' prefix -} +B pass me an article (Simple, or Collection) and I'll give +you the content AS A STRING - i.e. the raw XML of the contained MOBY +Object(s) +B C -=head2 extractRawContent +B the one element of the output from getArticles - function : pass me an article (Simple, or Collection) and I'll give you the - content AS A STRING - i.e. the raw XML of the contained MOBY Object(s) - usage : extractRawContent($simple) - input : the one element of the output from getArticles - returns : string +B string =cut @@ -1114,37 +869,36 @@ foreach ( $article->childNodes ) { $response .= $_->toString; } - print STDERR "RESPONSE = $response\n"; +# print STDERR "RESPONSE = $response\n"; return $response; } =head2 getNodeContentWithArticle - function : a very flexible way to get the stringified content of a node - that has the correct element and article name - or get the value of a Parameter element. - usage : @strings = getNodeContentWithArticle($node, $tagname, $articleName) - args : (in order) - $node - an XML::LibXML node, or straight XML. It may even - be the entire mobyData block. - $tagname - the tagname (effectively from the Object type ontology), - or "Parameter" if you are trying to get secondaries - $articleName - the articleName that we are searching for. - to get the content of the primary object, leave - this field blank! - - returns : an ARRAY of the stringified text content for each - node that matched the tagname/articleName specified; one - array element for each matching node. Newlines are NOT considered - new nodes (as they are in normal XML). - - notes : This was written for the purpose of getting the values of - String, Integer, Float, Date_Time, and other such primitives. +B a very flexible way to get the stringified content of a +node that has the correct element and article name or get the value of +a Parameter element. + +B C<@strings = getNodeContentWithArticle($node, $tagname, $articleName)> + +B (in order) + +C<$node> - an XML::LibXML node, or straight XML. It may even be the entire mobyData block. +C<$tagname> - the tagname (effectively from the Object type ontology), or "Parameter" if you are trying to get secondaries +C<$articleName> - the articleName that we are searching for. to get the content of the primary object, leave this field blank! + + +B an ARRAY of the stringified text content for each +node that matched the tagname/articleName specified; one +array element for each matching node. Newlines are NOT considered +new nodes (as they are in normal XML). + +B This was written for the purpose of getting the values of +String, Integer, Float, Date_Time, and other such primitives. For example, in the following XML: ... - ... @@ -1156,8 +910,7 @@ ... - ... - + would be analysed as follows: # get $input - e.g. from genericServiceInputParser or complexServiceInputParser @@ -1166,7 +919,6 @@ For Parameters, such as the following ... - ... @@ -1181,7 +933,6 @@ ... - ... You would parse it as follows: @@ -1208,7 +959,6 @@ =cut -#Eddie - converted sub getNodeContentWithArticle { # give me a DOM, a TagName, an articleName and I will return you the content # of that node **as a string** (beware if there are additional XML tags in there!) @@ -1241,13 +991,8 @@ # if there is an articleName, then get that specific node for ( 1 .. $nodes->size() ) { my $child = $nodes->get_node( $_ ); - if ( - ( $child->getAttribute("articleName") - && ( $child->getAttribute("articleName") eq $articleName ) - ) - || ( $child->getAttribute("moby:articleName") - && ( $child->getAttribute("moby:articleName") eq $articleName ) - ) + if ( _moby_getAttribute($child, "articleName") + && ( $child->getAttribute("articleName") eq $articleName ) ) { # now we have a valid child, get the content... stringified... regardless of what it is @@ -1280,62 +1025,21 @@ return @contents; } -=head2 validateNamespaces - - function : checks the namespace ontology for the namespace lsid - usage : @LSIDs = validateNamespaces(@namespaces) - args : ordered list of either human-readable or lsid presumptive namespaces - returns : ordered list of the LSID's corresponding to those - presumptive namespaces; undef for each namespace that was invalid - - -=cut - -sub validateNamespaces { - # give me a list of namespaces and I will return the LSID's in order - # I return undef in that list position if the namespace is invalid - my ( @namespaces ) = @_; - my $OS = MOBY::Client::OntologyServer->new; - my @lsids; - foreach ( @namespaces ) { - my ( $s, $m, $LSID ) = $OS->namespaceExists( term => $_ ); - push @lsids, $s ? $LSID : undef; - } - return @lsids; -} - -=head2 validateThisNamespace +*getResponseArticles = \&extractResponseArticles; +*getResponseArticles = \&extractResponseArticles; - function : checks a given namespace against a list of valid namespaces - usage : $valid = validateThisNamespace($ns, @validNS); - args : ordered list of the namespace of interest and the list of valid NS's - returns : boolean +=head2 getResponseArticles (a.k.a. extractResponseArticles) -=cut +B get the DOM nodes corresponding to individual Simple or Collection outputs from a MOBY Response -sub validateThisNamespace { - my ( $ns, @namespaces ) = @_; - return 1 unless scalar @namespaces; # if you don't give me a list, I assume everything is valid... - @namespaces = @{$namespaces[0]} # if you send me an arrayref I should be kind... DWIM! - if ( ref $namespaces[0] eq 'ARRAY' ); - return grep /$ns/, @namespaces; -} +B C<($collections, $simples) = getResponseArticles($node)> -=head2 getResponseArticles (a.k.a. extractResponseArticles) +B C<$node> - either raw XML or an XML::LibXML::Document to be searched - function : get the DOM nodes corresponding to individual - Simple or Collection outputs from a MOBY Response - usage : ($collections, $simples) = getResponseArticles($node) - args : $node - either raw XML or an XML::LibXML::Document to be searched - returns : an array-ref of Collection article XML::LibXML::Node's - an array-ref of Simple article XML::LibXML::Node's +B an array-ref of Collection article XML::LibXML::Node's or an array-ref of Simple article XML::LibXML::Node's =cut -*getResponseArticles = \&extractResponseArticles; -*getResponseArticles = \&extractResponseArticles; - -#Eddie - converted sub extractResponseArticles { my ( $result ) = @_; return ( [], [] ) unless $result; @@ -1351,8 +1055,8 @@ my @collections; my @Xrefs; my $success = 0; - foreach my $which ( 'moby:queryResponse', 'queryResponse', 'mobyData', - 'moby:mobyData' ) + foreach my $which ( 'moby:queryResponse', 'queryResponse', + 'mobyData', 'moby:mobyData' ) { my $responses = $moby->getElementsByTagName( $which ); next unless $responses; @@ -1360,23 +1064,19 @@ my $resp = $responses->get_node( $n ); foreach my $response_component ( $resp->childNodes ) { next unless $response_component->nodeType == ELEMENT_NODE; - if ( ( $response_component->nodeName eq "Simple" ) - || ( $response_component->nodeName eq "moby:Simple" ) ) - { + if ( $response_component->nodeName =~ /^(moby:|)Simple$/ ) + { foreach my $Object ( $response_component->childNodes ) { next unless $Object->nodeType == ELEMENT_NODE; $success = 1; push @objects, $Object; } - } elsif ( ( $response_component->nodeName eq "Collection" ) - || ( $response_component->nodeName eq "moby:Collection" ) ) + } elsif ( $response_component->nodeName =~ /^(moby:|)Collection$/ ) { my @objects; foreach my $simple ( $response_component->childNodes ) { next unless $simple->nodeType == ELEMENT_NODE; - next - unless ( ( $simple->nodeName eq "Simple" ) - || ( $simple->nodeName eq "moby:Simple" ) ); + next unless ( $simple->nodeName =~ /^(moby:|)Simple$/ ); foreach my $Object ( $simple->childNodes ) { next unless $Object->nodeType == ELEMENT_NODE; $success = 1; @@ -1392,16 +1092,125 @@ return ( \@collections, \@objects ); } + + +=head1 IDENTITY AND VALIDATION + +This section describes functionality associated with identifying parts of a message, +and checking that it is valid. + +=head2 isSimpleArticle, isCollectionArticle, isSecondaryArticle + +B tests XML (text) or an XML DOM node to see if it represents a Simple, Collection, or Secondary article + +B + + if (isSimpleArticle($node)){do something to it} + +or + + if (isCollectionArticle($node)){do something to it} + +or + + if (isSecondaryArticle($node)){do something to it} + +B< input :> an XML::LibXML node, an XML::LibXML::Document or straight XML + +B boolean + +=cut + +sub isSimpleArticle { + my ( $DOM ) = @_; + eval { $DOM = _string_to_DOM($DOM) }; + return 0 if $@; + $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); + return ($DOM->nodeName =~ /^(moby:|)Simple$/) ? 1 : 0; #Optional 'moby:' namespace prefix +} + +sub isCollectionArticle { + my ( $DOM ) = @_; + eval {$DOM = _string_to_DOM($DOM) }; + return 0 if $@; + $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); + return ( $DOM->nodeName =~ /^(moby\:|)Collection$/ ) ? 1 : 0; #Optional 'moby:' prefix +} + +sub isSecondaryArticle { + my ( $XML ) = @_; + my $DOM; + eval {$DOM = _string_to_DOM($XML)} ; + return 0 if $@; + $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); + return ($DOM->nodeName =~ /^(moby\:|)Parameter$/) ? 1 : 0; #Optional 'moby:' prefix +} + + +=head2 validateNamespaces + +B checks the namespace ontology for the namespace lsid + +B C<@LSIDs = validateNamespaces(@namespaces)> + +B ordered list of either human-readable or lsid presumptive namespaces + +B ordered list of the LSID's corresponding to those +presumptive namespaces; undef for each namespace that was invalid + +=cut + +sub validateNamespaces { + # give me a list of namespaces and I will return the LSID's in order + # I return undef in that list position if the namespace is invalid + my ( @namespaces ) = @_; + my $OS = MOBY::Client::OntologyServer->new; + my @lsids; + foreach ( @namespaces ) { + my ( $s, $m, $LSID ) = $OS->namespaceExists( term => $_ ); + push @lsids, $s ? $LSID : undef; + } + return @lsids; +} + +=head2 validateThisNamespace + +B checks a given namespace against a list of valid namespaces + +B C<$valid = validateThisNamespace($ns, @validNS);> + +B ordered list of the namespace of interest and the list of valid NS's + +B boolean + +=cut + +sub validateThisNamespace { + my ( $ns, @namespaces ) = @_; + return 1 unless scalar @namespaces; # if you don't give me a list, I assume everything is valid... + @namespaces = @{$namespaces[0]} # if you send me an arrayref I should be kind... DWIM! + if ( ref $namespaces[0] eq 'ARRAY' ); + return grep /$ns/, @namespaces; +} + + +=head1 ANCILIARY ELEMENTS + +This section contains subroutines that handle processing of optional message elements containing +meta-data. Examples are the ServiceNotes, and CrossReference blocks. + =head2 getServiceNotes - function : to get the content of the Service Notes block of the MOBY message - usage : getServiceNotes($message) - args : $message is either the XML::LibXML of the MOBY message, or plain XML - returns : String content of the ServiceNotes block of the MOBY Message +B to get the content of the Service Notes block of the MOBY message + +B C + +B C<$message> is either the XML::LibXML of the MOBY message, or plain XML + +B String content of the ServiceNotes block of the MOBY Message =cut -#Eddie - converted sub getServiceNotes { my ( $result ) = @_; return ( "" ) unless $result; @@ -1425,13 +1234,17 @@ =head2 getCrossReferences - function : to get the cross-references for a Simple article - usage : @xrefs = getCrossReferences($XML) - args : $XML is either a SIMPLE article (...) - or an object (the payload of a Simple article), and - may be either raw XML or an XML::LibXML node. - returns : an array of MOBY::CrossReference objects - example : +B to get the cross-references for a Simple article + +B C<@xrefs = getCrossReferences($XML)> + +B C<$XML> is either a SIMPLE article (...) or an +object (the payload of a Simple article), and may be either raw XML or +an XML::LibXML node. + +B an array of MOBY::CrossReference objects + +B my (($colls, $simps) = getResponseArticles($query); # returns DOM nodes foreach (@{$simps}){ @@ -1448,14 +1261,13 @@ =cut -#Eddie - converted sub getCrossReferences { my ( $XML ) = @_; $XML = _string_to_DOM($XML); my @xrefs; my @XREFS; - return () if ( $XML->nodeName =~ /Collection/ ); - if ( $XML->nodeName =~ /Simple/ ) { + return () if ( $XML->nodeName =~ /^(moby:|)Collection$/ ); + if ( $XML->nodeName =~ /^(moby:|)Simple$/ ) { foreach my $child ( $XML->childNodes ) { next unless $child->nodeType == ELEMENT_NODE; $XML = $child; @@ -1464,54 +1276,352 @@ } foreach ( $XML->childNodes ) { next unless (($_->nodeType == ELEMENT_NODE) - || ($_->nodeName =~ /CrossReference/) ); + || ($_->nodeName =~ /^(moby:|)CrossReference$/) ); foreach my $xref ( $_->childNodes ) { next unless ( ($xref->nodeType == ELEMENT_NODE) - || ($xref->nodeName =~ /Xref|Object/) ); + || ($xref->nodeName =~ /^(moby:|)(Xref|Object)$/) ); push @xrefs, $xref; } } foreach ( @xrefs ) { my $x; - if ($_->nodeName =~ /Xref/) { $x = &_makeXrefType( $_ ) } - elsif ($_->nodeName =~ /Object/) { $x = &_makeObjectType( $_ ) } + if ($_->nodeName =~ /^(moby:|)Xref$/) { $x = _makeXrefType( $_ ) } + elsif ($_->nodeName =~ /^(moby:|)Object$/) { $x = _makeObjectType( $_ ) } push @XREFS, $x if $x; } return @XREFS; } + +=head1 CONSTRUCTING OUTPUT + +This section describes how to construct output, in response to an +incoming message. Responses come in three varieties: 'Simple', 'Collection', and +'Complex' (Collections and Simples together). + +=head2 simpleResponse + +B wraps a simple article in the appropriate (mobyData) structure + +B + + $resp .= simpleResponse($object, 'MyArticleName', $queryID); + +B (in order) +C<$object> - (optional) a MOBY Object as raw XML +C<$article> - (optional) an articeName for this article +C<$query> - (optional, but strongly recommended) the queryID value for the mobyData block to which you are responding + +B As required by the API you must return a response for every +input. If one of the inputs was invalid, you return a valid (empty) +MOBY response by calling simpleResponse(undef, undef, $queryID) with +no arguments. + +=cut + +sub simpleResponse { + my ( $data, $articleName, $qID ) = @_; # articleName optional + $qID = _getQueryID( $qID ) + if ref( $qID ) =~ /XML\:\:LibXML/; # in case they send the DOM instead of the ID + $data ||= ''; # initialize to avoid uninit value errors + $articleName ||= ""; + $qID ||= ""; + if ( $articleName || $data) { # Linebreaks in XML make it easier for human debuggers to read! + return " + + $data + + "; + } else { + return " + + "; + } +} + + +=head2 collectionResponse + +B wraps a set of articles in the appropriate mobyData structure + +B + + return responseHeader . collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter; + +B (in order) +C<\@objects> - (optional) a listref of MOBY Objects as raw XML +C<$article> - (optional) an articeName for this article +C<$queryID> - (optional, but strongly recommended) the mobyData ID to which you are responding + +B as required by the API you must return a response for every +input. If one of the inputs was invalid, you return a valid (empty) +MOBY response by calling collectionResponse(undef, undef, $queryID). + +=cut + +sub collectionResponse { + my ( $data, $articleName, $qID ) = @_; # articleName optional + my $content = ""; + $data ||= []; + $qID ||= ''; + # The response should only be completely empty when the input $data is completely empty. + # Testing just the first element is incorrect. + my $not_completely_empty = 0; + foreach (@{$data}) { $not_completely_empty += defined $_ } + unless ( ( ref($data) eq 'ARRAY' ) && $not_completely_empty ) + { # we're expecting an arrayref as input data, and it must not be empty + return ""; + } + foreach ( @{$data} ) { # Newlines are for ease of human reading (pretty-printing). + # It's really hard to keep this kind of thing in sync with itself, but for what it's worth, let's leave it in. + if ( $_ ) { + $content .= "$_\n"; + } else { + $content .= "\n"; + } + } + if ( $articleName ) { + return " + + + $content + + + "; + } else { + return " + + $content + + "; + } +} + +=head2 complexResponse + +B wraps articles in the appropriate (mobyData) structure + +B $resp .= complexResponse(\@data, $qID); + +B (in order) + +C<\@data> - (optional) a listref of arrays. each element of @data is +itself a listref of [$articleName, $XML] + +C<$qID> - (optional, but strongly recommended) the queryID value for +the mobyData block to which you are responding + +B as required by the API you must return a response for every +input. If one of the inputs was invalid, you return a valid (empty) +MOBY response by calling complexResponse(undef, $queryID) with no +arguments. + +=cut + +sub complexResponse { + my ( $data, $qID ) = @_; + #return 'ERROR: expected listref [element1, element2, ...] for data' unless ( ref( $data ) =~ /array/i ); + return "\n" + unless ( ref( $data ) eq 'ARRAY' ); + $qID = _getQueryID( $qID ) + if ref( $qID ) =~ /XML\:\:LibXML/; # in case they send the DOM instead of the ID + my @inputs = @{$data}; + my $output = ""; + foreach ( @inputs ) { + #return 'ERROR: expected listref [articleName, XML] for data element' unless ( ref( $_ ) =~ /array/i ); + return "\n" + unless ( ref($_) eq 'ARRAY' ); + while ( my ( $articleName, $XML ) = splice( @{$_}, 0, 2 ) ) { + if ( ref($XML) ne 'ARRAY' ) { + $articleName ||= ""; + $XML ||= ""; + if ( $XML =~ /\<(moby:|)Value\>/ ) + { + $output .= + "$XML\n"; + } else { + $output .= + "\n$XML\n\n"; + } + + # need to do this for collections also!!!!!! + } else { + my @objs = @{$XML}; + $output .= "\n"; + foreach ( @objs ) { + $output .= "$_\n"; + } + $output .= "\n"; + } + } + } + $output .= "\n"; + return $output; +} + +=head2 responseHeader + +B print the XML string of a MOBY response header +/- serviceNotes + +B + + responseHeader('illuminae.com') + + responseHeader( + -authority => 'illuminae.com', + -note => 'here is some data from the service provider') + +B a string representing the service providers authority URI, OR +a set of named arguments with the authority and the service provision +notes. + +B< caveat :> + +B returns everything required up to the response articles themselves. i.e. something like: + + + + + +=cut + +sub responseHeader { + use HTML::Entities (); + my ( $auth, $notes ) = _rearrange( [qw[AUTHORITY NOTE]], @_ ); + $auth ||= "not_provided"; + $notes ||= ""; + my $xml = + "" + . "" + . ""; + if ( $notes ) { + my $encodednotes = HTML::Entities::encode( $notes ); + $xml .= "$encodednotes"; + } + return $xml; +} + +=head2 responseFooter + +B print the XML string of a MOBY response footer + +B + + return responseHeader('illuminae.com') . $DATA . responseFooter; + +B returns everything required after the response articles themselves i.e. something like: + + + + +=cut + +sub responseFooter { + return ""; +} + + + +=head1 MISCELLANEOUS + +This section contains routines that didn't quite seem to fit anywhere else. + +=cut + +=head2 _moby_getAttributeNode, _moby_getAttribute + +B Perform the same task as the DOM routine +getAttribute(Node), but check for both the prefixed and un-prefixed +attribute name (the prefix in question being, of course, +"moby:"). + +B + + $id = _moby_getAttribute($xml_libxml, "id"); + +where C is an attribute in the XML block given as C<$xml_libxml> + +B This function is intended for use internal to this package +only. It's not exported. + +=cut + +sub _moby_getAttributeNode { + # Mimics behavior of XML::LibXML method getAttributeNode, but if the unqualified attribute cannot be found, + # we qualify it with "moby:" and try again. + # We do this so often this module, it's worth having a separate subroutine to do this. + my ($xref, $attr) = @_; + my ($package, $filename, $line) = caller; + if ( !(ref($xref) =~ "^XML\:\:LibXML") ) { + warn "_moby_getAttributeNode: Looking for attribute '$attr'" + . "Can't parse non-XML argument '$xref',\n" + . " called from line $line"; + return ''; + } + if (!defined $attr) { + warn "_moby_getAttributeNode: Non-empty attribute is required" + . "\n called from line $line"; + return ''; + } + return ( $xref->getAttributeNode($attr) || $xref->getAttributeNode( "moby:$attr" ) ); +} + +sub _moby_getAttribute { + # Mimics behavior of XML::LibXML method getAttribute, but if the unqualified attribute cannot be found, + # we qualify it with "moby:" and try again. + # We do this so often this module, it's worth having a separate subroutine to do this. + my ($xref, $attr) = @_; + my ($package, $filename, $line) = caller; + if ( !(ref($xref) =~ "^XML\:\:LibXML")) { + warn "_moby_getAttribute: Looking for attribute '$attr', " + ."can't parse non-XML argument '$xref'\n" + . "_moby_getAttribute called from line $line"; + return ''; + } + if (!defined $attr) { + warn "_moby_getAttribute: Non-empty attribute is required" + . "\n called from line $line"; + return ''; + } + return ( $xref->getAttribute($attr) || $xref->getAttribute("moby:$attr") ); +} + =head2 whichDeepestParentObject - function : select the parent node from nodeList that is - closest to the querynode - usage : ($term, $lsid) = whichDeepestParentObject($CENTRAL, $queryTerm, \@termList) - args : $CENTRAL - your MOBY::Client::Central object - $queryTerm - the object type I am interested in - \@termlist - the list of object types that I know about - returns : an ontology term and LSID as a scalar, or undef if there - is no parent of this node in the nodelist. - (note that it will only return the term if you give it - term names in the @termList. If you give it - LSID's in the termList, then both the parameters - returned will be LSID's - it doesn't back-translate...) +B select the parent node from nodeList that is closest to the querynode + +B + + ($term, $lsid) = whichDeepestParentObject($CENTRAL, $queryTerm, \@termList) + +B + +C<$CENTRAL> - your MOBY::Client::Central object + +C<$queryTerm> - the object type I am interested in + +C<\@termlist> - the list of object types that I know about + +B an ontology term and LSID as a scalar, or undef if there is +no parent of this node in the nodelist. note that it will only return +the term if you give it term names in the @termList. If you give it +LSID's in the termList, then both the parameters returned will be +LSID's - it doesn't back-translate...) =cut sub whichDeepestParentObject { my ( $CENTRAL, $queryTerm, $termlist ) = @_; return ( undef, undef ) - unless ( $CENTRAL - && $queryTerm - && $termlist - && ( ref( $termlist ) =~ /ARRAY/ ) ); + unless ( $CENTRAL && $queryTerm + && $termlist && ( ref( $termlist ) eq 'ARRAY' ) ); my %nodeLSIDs; my $queryLSID = $CENTRAL->ObjLSID( $queryTerm ); foreach ( @$termlist ) { # get list of known LSIDs - my $lsid = $CENTRAL->ObjLSID( $_ ); - return ( $_, $lsid ) - if ( $lsid eq $queryLSID ) - ; # of course, if we find it in the list, then return it right away! - $nodeLSIDs{$lsid} = $_; + my $lsid = $CENTRAL->ObjLSID( $_ ); + return ( $_, $lsid ) + if ( $lsid eq $queryLSID ); # of course, if we find it in the list, then return it right away! + $nodeLSIDs{$lsid} = $_; } return ( undef, undef ) unless keys( %nodeLSIDs ); my $isa = @@ -1528,26 +1638,20 @@ return ( undef, undef ); } -#Eddie - converted + sub _makeXrefType { my ( $xref ) = @_; - my $ns = $xref->getAttributeNode( 'namespace' ) - || $xref->getAttributeNode( 'moby:namespace' ); + my $ns = _moby_getAttributeNode($xref, 'namespace' ); return undef unless $ns; - my $id = $xref->getAttributeNode( 'id' ) - || $xref->getAttributeNode( 'moby:id' ); + my $id = _moby_getAttributeNode($xref, 'id' ); return undef unless $id; - my $xr = $xref->getAttributeNode( 'xref_type' ) - || $xref->getAttributeNode( 'moby:xref_type' ); + my $xr = _moby_getAttributeNode($xref, 'xref_type' ); return undef unless $xr; - my $ec = $xref->getAttributeNode( 'evidence_code' ) - || $xref->getAttributeNode( 'moby:evidence_code' ); + my $ec = _moby_getAttributeNode($xref, 'evidence_code' ); return undef unless $ec; - my $au = $xref->getAttributeNode( 'authURI' ) - || $xref->getAttributeNode( 'moby:authURI' ); + my $au = _moby_getAttributeNode($xref, 'authURI' ); return undef unless $au; - my $sn = $xref->getAttributeNode( 'serviceName' ) - || $xref->getAttributeNode( 'moby:serviceName' ); + my $sn = _moby_getAttributeNode($xref, 'serviceName' ); return undef unless $sn; my $XREF = MOBY::CrossReference->new( type => "xref", @@ -1561,14 +1665,12 @@ return $XREF; } -#Eddie - converted + sub _makeObjectType { my ( $xref ) = @_; - my $ns = $xref->getAttributeNode( 'namespace' ) - || $xref->getAttributeNode( 'moby:namespace' ); + my $ns = _moby_getAttributeNode($xref, 'namespace' ); return undef unless $ns; - my $id = $xref->getAttributeNode( 'id' ) - || $xref->getAttributeNode( 'moby:id' ); + my $id = _moby_getAttributeNode($xref, 'id'); return undef unless $id; my $XREF = MOBY::CrossReference->new( type => "object", @@ -1577,76 +1679,72 @@ ); } -# _rearrange stolen from BioPerl's Bio::RootI.pm -# because it is just so useful! - =head2 _rearrange (stolen from BioPerl ;-) ) - Usage : $object->_rearrange( array_ref, list_of_arguments) - Purpose : Rearranges named parameters to requested order. - Example : $self->_rearrange([qw(SEQUENCE ID DESC)],@param); - : Where @param = (-sequence => $s, - : -desc => $d, - : -id => $i); - Returns : @params - an array of parameters in the requested order. - : The above example would return ($s, $i, $d). - : Unspecified parameters will return undef. For example, if - : @param = (-sequence => $s); - : the above _rearrange call would return ($s, undef, undef) - Argument : $order : a reference to an array which describes the desired - : order of the named parameters. - : @param : an array of parameters, either as a list (in - : which case the function simply returns the list), - : or as an associative array with hyphenated tags - : (in which case the function sorts the values - : according to @{$order} and returns that new array.) - : The tags can be upper, lower, or mixed case - : but they must start with a hyphen (at least the - : first one should be hyphenated.) - Source : This function was taken from CGI.pm, written by Dr. Lincoln - : Stein, and adapted for use in Bio::Seq by Richard Resnick and - : then adapted for use in Bio::Root::Object.pm by Steve Chervitz, - : then migrated into Bio::Root::RootI.pm by Ewan Birney. - Comments : - : Uppercase tags are the norm, - : (SAC) - : This method may not be appropriate for method calls that are - : within in an inner loop if efficiency is a concern. - : - : Parameters can be specified using any of these formats: - : @param = (-name=>'me', -color=>'blue'); - : @param = (-NAME=>'me', -COLOR=>'blue'); - : @param = (-Name=>'me', -Color=>'blue'); - : @param = ('me', 'blue'); - : A leading hyphenated argument is used by this function to - : indicate that named parameters are being used. - : Therefore, the ('me', 'blue') list will be returned as-is. - : - : Note that Perl will confuse unquoted, hyphenated tags as - : function calls if there is a function of the same name - : in the current namespace: - : -name => 'foo' is interpreted as -&name => 'foo' - : - : For ultimate safety, put single quotes around the tag: - : ('-name'=>'me', '-color' =>'blue'); - : This can be a bit cumbersome and I find not as readable - : as using all uppercase, which is also fairly safe: - : (-NAME=>'me', -COLOR =>'blue'); - : - : Personal note (SAC): I have found all uppercase tags to - : be more managable: it involves less single-quoting, - : the key names stand out better, and there are no method naming - : conflicts. - : The drawbacks are that it's not as easy to type as lowercase, - : and lots of uppercase can be hard to read. - : - : Regardless of the style, it greatly helps to line - : the parameters up vertically for long/complex lists. +B + $object->_rearrange( array_ref, list_of_arguments) + +B Rearranges named parameters to requested order. + +B + $self->_rearrange([qw(SEQUENCE ID DESC)],@param); +Where C<@param = (-sequence => $s, -desc => $d, -id => $i);> + +B C<@params> - an array of parameters in the requested order. + +The above example would return ($s, $i, $d). +Unspecified parameters will return undef. For example, if + C<@param = (-sequence => $s);> +the above _rearrange call would return ($s, undef, undef) + +B C<$order> : a reference to an array which describes the desired order of the named parameters. + +C<@param :> an array of parameters, either as a list (in which case the function +simply returns the list), or as an associative array with hyphenated +tags (in which case the function sorts the values according to +@{$order} and returns that new array.) The tags can be upper, lower, +or mixed case but they must start with a hyphen (at least the first +one should be hyphenated.) + +B< Source:> This function was taken from CGI.pm, written by +Dr. Lincoln Stein, and adapted for use in Bio::Seq by Richard Resnick +and then adapted for use in Bio::Root::Object.pm by Steve Chervitz, +then migrated into Bio::Root::RootI.pm by Ewan Birney. + +B +Uppercase tags are the norm, (SAC) This method may not be appropriate +for method calls that are within in an inner loop if efficiency is a +concern. + +Parameters can be specified using any of these formats: + @param = (-name=>'me', -color=>'blue'); + @param = (-NAME=>'me', -COLOR=>'blue'); + @param = (-Name=>'me', -Color=>'blue'); + @param = ('me', 'blue'); + +A leading hyphenated argument is used by this function to indicate +that named parameters are being used. Therefore, the ('me', 'blue') +list will be returned as-is. + +Note that Perl will confuse unquoted, hyphenated tags as function +calls if there is a function of the same name in the current +namespace: C<-name => 'foo'> is interpreted as C<-&name => 'foo'> + +For ultimate safety, put single quotes around the tag: C<('-name'=>'me', '-color' =>'blue');> + +This can be a bit cumbersome and I find not as readable as using all +uppercase, which is also fairly safe:C<(-NAME=>'me', -COLOR =>'blue');> + +Personal note (SAC): I have found all uppercase tags to be more +managable: it involves less single-quoting, the key names stand out +better, and there are no method naming conflicts. The drawbacks are +that it's not as easy to type as lowercase, and lots of uppercase can +be hard to read. Regardless of the style, it greatly helps to line the parameters up +vertically for long/complex lists. =cut sub _rearrange { - # my $dummy = shift; my $order = shift; return @_ unless ( substr( $_[0] || '', 0, 1 ) eq '-' ); @@ -1659,3 +1757,11 @@ map { $_ = uc( $_ ) } @$order; # for bug #1343, but is there perf hit here? return @param{@$order}; } + +sub _getQueryID { + my ( $query ) = @_; + $query = _string_to_XML($query); + return '' unless ( $query->nodeName =~ /^(moby:|)(queryInput|mobyData)$/ ); #Eddie - unsure + return _moby_getAttribute($query, 'queryID' ); +} + From gss at pub.open-bio.org Wed Sep 21 17:54:20 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed Sep 21 18:46:36 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212154.j8LLsKgf012809@pub.open-bio.org> gss Wed Sep 21 17:54:20 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api In directory pub.open-bio.org:/tmp/cvs-serv12775 Removed Files: allclasses-frame.html allclasses-noframe.html constant-values.html deprecated-list.html help-doc.html index.html overview-frame.html overview-summary.html overview-tree.html package-list packages.html serialized-form.html stylesheet.css Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api allclasses-frame.html,1.2,NONE allclasses-noframe.html,1.2,NONE constant-values.html,1.2,NONE deprecated-list.html,1.2,NONE help-doc.html,1.2,NONE index.html,1.2,NONE overview-frame.html,1.2,NONE overview-summary.html,1.2,NONE overview-tree.html,1.2,NONE package-list,1.2,NONE packages.html,1.2,NONE serialized-form.html,1.2,NONE stylesheet.css,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/allclasses-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/allclasses-noframe.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/constant-values.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/deprecated-list.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/help-doc.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/index.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/overview-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/overview-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/overview-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/package-list,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/packages.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/serialized-form.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/stylesheet.css,v: No such file or directory From gss at pub.open-bio.org Wed Sep 21 18:17:41 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed Sep 21 19:13:11 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212217.j8LMHfX7012905@pub.open-bio.org> gss Wed Sep 21 18:17:41 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer In directory pub.open-bio.org:/tmp/cvs-serv12884/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer Added Files: .cvsignore Log Message: Don't keep javadoc under CVS control moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer .cvsignore,NONE,1.1 From gss at pub.open-bio.org Wed Sep 21 18:40:31 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed Sep 21 19:32:47 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212240.j8LMeVhB012972@pub.open-bio.org> gss Wed Sep 21 18:40:31 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv12947/S-MOBY/ref-impl/semanticmoby.org/WebRoot Modified Files: index.html Log Message: Changed to reference new location of API docs moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot index.html,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/index.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/index.html 2005/03/21 21:42:01 1.6 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/index.html 2005/09/21 22:40:31 1.7 @@ -42,7 +42,7 @@ About Semantic MOBY   Help on Searching
    - + Developers: see the JavaDoc for the Semantic MOBY API!

    From gss at pub.open-bio.org Wed Sep 21 18:56:37 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed Sep 21 19:48:29 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212256.j8LMubU8013026@pub.open-bio.org> gss Wed Sep 21 18:56:37 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/lib In directory pub.open-bio.org:/tmp/cvs-serv13002/lib Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/lib added to the repository moby-live/S-MOBY/ref-impl/lib - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/lib/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/lib/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/lib/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Wed Sep 21 19:01:52 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed Sep 21 19:53:40 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212301.j8LN1qAd013126@pub.open-bio.org> gss Wed Sep 21 19:01:52 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/lib In directory pub.open-bio.org:/tmp/cvs-serv13105 Added Files: .cvsignore README.txt antlr-2.7.5.jar antlr.jar commons-codec-1.3.jar commons-httpclient-3.0-rc3.jar commons-logging.jar concurrent.jar icu4j.jar jakarta-oro-2.0.8.jar jena.jar log4j-1.2.12.jar servlet-api.jar xercesImpl.jar xml-apis.jar Log Message: Initial jar files needed to build core and semanticmoby.org moby-live/S-MOBY/ref-impl/lib .cvsignore,NONE,1.1 README.txt,NONE,1.1 antlr-2.7.5.jar,NONE,1.1 antlr.jar,NONE,1.1 commons-codec-1.3.jar,NONE,1.1 commons-httpclient-3.0-rc3.jar,NONE,1.1 commons-logging.jar,NONE,1.1 concurrent.jar,NONE,1.1 icu4j.jar,NONE,1.1 jakarta-oro-2.0.8.jar,NONE,1.1 jena.jar,NONE,1.1 log4j-1.2.12.jar,NONE,1.1 servlet-api.jar,NONE,1.1 xercesImpl.jar,NONE,1.1 xml-apis.jar,NONE,1.1 From gss at pub.open-bio.org Wed Sep 21 19:07:16 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed Sep 21 19:59:05 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212307.j8LN7GYS013162@pub.open-bio.org> gss Wed Sep 21 19:07:16 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build In directory pub.open-bio.org:/tmp/cvs-serv13137 Modified Files: .cvsignore Log Message: Ignore the war file; built it each time it's needed moby-live/S-MOBY/ref-impl/semanticmoby.org/build .cvsignore,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/.cvsignore 2005/03/21 21:40:00 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/.cvsignore 2005/09/21 23:07:16 1.2 @@ -1,2 +1,2 @@ -classes semanticmoby.org.war +javadoc From gss at pub.open-bio.org Wed Sep 21 19:08:04 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed Sep 21 19:59:52 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212308.j8LN84r5013195@pub.open-bio.org> gss Wed Sep 21 19:08:04 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build In directory pub.open-bio.org:/tmp/cvs-serv13170 Modified Files: build.xml Log Message: Build standalone instead of being invoked from ../../build.xml moby-live/S-MOBY/ref-impl/semanticmoby.org/build build.xml,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/03/21 21:40:00 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/09/21 23:08:04 1.2 @@ -5,9 +5,6 @@ - - - @@ -20,36 +17,78 @@ - - - + + + + + + + + + - + + + + + + + + + + + + + + + + - - - - - + + + + + + - - + + + + + + + + + + + + + + + From senger at pub.open-bio.org Thu Sep 22 03:55:44 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Sep 22 04:48:01 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509220755.j8M7tiRa014444@pub.open-bio.org> senger Thu Sep 22 03:55:44 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv14429 Added Files: cp.bat deploy deploy.bat remote.deploy.build.xml.template Log Message: moby-live/Java/src/webapps cp.bat,NONE,1.1 deploy,NONE,1.1 deploy.bat,NONE,1.1 remote.deploy.build.xml.template,NONE,1.1 From senger at pub.open-bio.org Thu Sep 22 04:54:40 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Sep 22 05:47:05 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509220854.j8M8se9w015241@pub.open-bio.org> senger Thu Sep 22 04:54:40 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv15222 Modified Files: Moses.html Added Files: Moses-deploy.html Log Message: moby-live/Java/docs Moses-deploy.html,NONE,1.1 Moses.html,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/Moses.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/docs/Moses.html 2005/08/29 13:21:59 1.5 +++ /home/repository/moby/moby-live/Java/docs/Moses.html 2005/09/22 08:54:40 1.6 @@ -52,7 +52,7 @@

    -

  • Support for service deployment (not yet fully implemented) +
  • Support for service deployment

    @@ -302,21 +302,10 @@


    -

    - -Documentation in progress... (as long as I can keep my eyes open):

    - -

    - -Will be (almost) finished before the end of August 2005...

    - -

    - -


    Martin Senger
    -Last modified: Mon Aug 29 16:07:55 2005 +Last modified: Thu Sep 22 08:42:37 2005
    From senger at pub.open-bio.org Thu Sep 22 05:47:43 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Sep 22 06:41:26 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509220947.j8M9lhdQ015744@pub.open-bio.org> senger Thu Sep 22 05:47:43 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv15725 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.36,1.37 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/21 04:02:15 1.36 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/22 09:47:43 1.37 @@ -95,9 +95,11 @@ + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + @@ -799,6 +784,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -897,8 +917,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +=========================================================== +File ${build.dir}/${result.file}.tar.gz +for a remote deployment was created. Copy it to the machine +where you wish the services to be deployed. Untar it, +change to the created directory, and invoke: + sh deploy (or deploy.bat on Windows) +=========================================================== + + + + + + + + + + + + + + + + +<undeployment xmlns="http://xml.apache.org/axis/wsdd/"> + <service name="${service.name}"/> +</undeployment> + + + + + + From senger at pub.open-bio.org Thu Sep 22 12:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Sep 22 12:59:00 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG78vX017258@pub.open-bio.org> senger Thu Sep 22 12:07:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv17235/docs Modified Files: ChangeLog Moses-deploy.html Log Message: moby-live/Java/docs ChangeLog,1.42,1.43 Moses-deploy.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/21 06:03:49 1.42 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/22 16:07:08 1.43 @@ -1,3 +1,11 @@ +2005-09-23 Martin Senger + + * Add a new method getFullNamespaces() to CentralDigest interface. + + * Changed some outputs of the command-line clients. + + * Significantly improved local caching. + 2005-09-21 Martin Senger * Fixed build.xml not to produce javadoc warnings with Java 1.5 in =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/Moses-deploy.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/Moses-deploy.html 2005/09/22 08:54:40 1.1 +++ /home/repository/moby/moby-live/Java/docs/Moses-deploy.html 2005/09/22 16:07:08 1.2 @@ -52,7 +52,7 @@ times.

    - +

    Deployment properties

    The deployment is an Ant target (task) - so everything is driven by @@ -419,7 +419,7 @@
    Martin Senger
    -Last modified: Thu Sep 22 17:42:41 2005 +Last modified: Thu Sep 22 18:24:09 2005
    From senger at pub.open-bio.org Thu Sep 22 12:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Sep 22 12:59:10 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG79j4017284@pub.open-bio.org> senger Thu Sep 22 12:07:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv17235/src/Clients Modified Files: CacheRegistryClient.java MobyDigestClient.java TestingCentral.java Log Message: moby-live/Java/src/Clients CacheRegistryClient.java,1.3,1.4 MobyDigestClient.java,1.3,1.4 TestingCentral.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/19 02:24:51 1.3 +++ /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/22 16:07:08 1.4 @@ -17,14 +17,14 @@ /** * This is a command-line client creating (and removing) a cache of a * Moby registry. It allows to store locally (in a file system) - * objects representing data types and service instances (the service - * types are ignored, at least for now).

    + * objects representing data types, service instances, namespaces, and + * service types.

    * * The client is quite simple and its basic functionality is included * also in other clients (such as {@link MobyGraphs}. The reason for * having this client separately is also to show how to use {@link * org.biomoby.client.CentralDigestCachedImpl CentralDigestCachedImpl} - * - a real caching worker.

    + * - which is a real caching worker.

    * * @author Martin Senger * @version $Id$ @@ -86,40 +86,65 @@ // // how old is the current cache? // - if (cmd.hasOption ("-age") || cmd.hasOption ("-rawage")) { + if (cmd.hasOption ("-age") || cmd.hasOption ("-rawage") || cmd.hasOption ("-agediff")) { decorationLn ("Cache age for " + worker.getRegistryEndpoint() + ":"); long age = castWorker.getCacheAge(); if (age < 0) - decoration ("(cache is empty)"); + decorationLn ("(cache is empty)"); else { if (cmd.hasOption ("-age")) - System.out.print (new Date (castWorker.getCacheAge()).toString()); - else - System.out.print (castWorker.getCacheAge()); + System.out.println (new Date (age).toString()); + if (cmd.hasOption ("-agediff")) + System.out.println (ms2Human (new Date().getTime() - age)); + if (cmd.hasOption ("-ageraw")) + System.out.println (age); } - decorationLn (""); } // // [re-]fill the cache // - if (cmd.hasOption ("-fill")) { - castWorker.removeFromCache (null); + if (cmd.hasOption ("-fill") || cmd.hasOption ("-fill-d")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_DATATYPES); decorationLn ("Retrieving data types..."); worker.getDataTypes(); + } + if (cmd.hasOption ("-fill") || cmd.hasOption ("-fill-s")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_SERVICES); decorationLn ("Retrieving services..."); worker.getServices(); } + if (cmd.hasOption ("-fill") || cmd.hasOption ("-fill-t")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_SERVICETYPES); + decorationLn ("Retrieving service types..."); + worker.getFullServiceTypes(); + } + if (cmd.hasOption ("-fill") || cmd.hasOption ("-fill-n")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_NAMESPACES); + decorationLn ("Retrieving namespaces..."); + worker.getNamespaces(); + } // // remove the cache // - if (cmd.hasOption ("-remove")) { - castWorker.removeFromCache (null); - decorationLn ("Cache removed."); + if (cmd.hasOption ("-remove") || cmd.hasOption ("-remove-d")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_DATATYPES); + decorationLn ("Cache for data types removed."); + } + if (cmd.hasOption ("-remove") || cmd.hasOption ("-remove-s")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_SERVICES); + decorationLn ("Cache for services removed."); + } + if (cmd.hasOption ("-remove") || cmd.hasOption ("-remove-t")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_SERVICETYPES); + decorationLn ("Cache for service types removed."); + } + if (cmd.hasOption ("-remove") || cmd.hasOption ("-remove-n")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_NAMESPACES); + decorationLn ("Cache for namespaces removed."); } - } catch (Exception e) { System.err.println ("===ERROR==="); e.printStackTrace(); @@ -128,6 +153,21 @@ } /************************************************************************* + * Give me an elapsed time (given in milllis) in a human readable form. + *************************************************************************/ + public static String ms2Human (long millis) { + StringBuffer buf = new StringBuffer (100); + long seconds = millis / 1000; + long minutes = seconds / 60; + long hours = minutes / 60; + long days = hours / 24; + if (days > 0) + buf.append (days + " days and "); + buf.append ((hours % 24) + ":" + (minutes % 60) + ":" + (seconds % 60) + "." + (millis % 1000)); + return new String (buf); + } + + /************************************************************************* * Print 'msg' but only if in verbose mode *************************************************************************/ static void decoration (String msg) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/09/19 08:08:32 1.3 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/09/22 16:07:08 1.4 @@ -67,15 +67,19 @@ if (cmd.hasOption ("-verbose")) worker.setDebug (true); - // read all data types and their relationships + // read (sometimes all) data types and their relationships if (cmd.hasOption ("-d")) { - MobyDataType[] dataTypes = worker.getDataTypes(); - for (int i = 0; i < dataTypes.length; i++) { - if (details) { + if (details) { + MobyDataType[] dataTypes = worker.getDataTypes(); + for (int i = 0; i < dataTypes.length; i++) { System.out.println (dataTypes[i].toString()); System.out.println ("---"); - } else { - System.out.println (dataTypes[i].getName()); + } + } else { + Map dataTypeNames = worker.getDataTypeNames(); + for (Iterator it = dataTypeNames.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + System.out.println (entry.getKey()); } } } @@ -95,13 +99,21 @@ // read all services if (cmd.hasOption ("-s")) { - MobyService[] services = worker.getServices(); - for (int i = 0; i < services.length; i++) { - if (details) { + if (details) { + MobyService[] services = worker.getServices(); + for (int i = 0; i < services.length; i++) { System.out.println (services[i].toString()); System.out.println ("---"); - } else { - System.out.println (services[i].getName()); + } + } else { + Map authorities = worker.getServiceNamesByAuthority(); + for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String authority = (String)entry.getKey(); + String[] names = (String[])entry.getValue(); + for (int i = 0; i < names.length; i++) { + System.out.println (names[i] + " (" + authority + ")"); + } } } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/09/19 08:08:32 1.6 +++ /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/09/22 16:07:08 1.7 @@ -162,37 +162,35 @@ worker.setDebug (debug); // ...and call other methods: - String result; - - + // retrieve things try { start ("retrieveServiceNames"); - Map serviceNames = worker.getServiceNames(); + worker.getServiceNamesByAuthority(); ok(); } catch (MobyException e) { error (e); } try { start ("retrieveServiceProviders"); - String[] providers = worker.getProviders(); + worker.getProviders(); ok(); } catch (MobyException e) { error (e); } try { start ("retrieveServiceTypes"); - Map serviceTypes = worker.getServiceNames(); + worker.getServiceTypes(); ok(); } catch (MobyException e) { error (e); } try { start ("retrieveNamespaces"); - Map namespaces = worker.getNamespaces(); + worker.getNamespaces(); ok(); } catch (MobyException e) { error (e); } try { start ("retrieveObjectNames"); - Map typeNames = worker.getDataTypeNames(); + worker.getDataTypeNames(); ok(); } catch (MobyException e) { error (e); } From senger at pub.open-bio.org Thu Sep 22 12:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Sep 22 12:59:11 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG79RK017308@pub.open-bio.org> senger Thu Sep 22 12:07:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv17235/src/Clients/help Modified Files: CacheRegistryClient_usage.txt MobyDigest_usage.txt Log Message: moby-live/Java/src/Clients/help CacheRegistryClient_usage.txt,1.3,1.4 MobyDigest_usage.txt,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt 2005/09/04 13:45:37 1.3 +++ /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt 2005/09/22 16:07:08 1.4 @@ -23,20 +23,34 @@ (or print nothing if the cache is empty; - in verbose mode print 'cache is empty'); format: dow mon dd hh:mm:ss zzz yyyy + -agediff ... print how old is cache + (or print nothing if the cache is empty; + - in verbose mode print 'cache is empty') -rawage ... print date when the cache was created (or print nothing if the cache is empty; - in verbose mode print 'cache is empty'); format: number of milliseconds since the standard base time known as "the epoch" (January 1, 1970, 00:00:00 GMT) + -fill ... remove the current cache and reread all data from the given Moby registry and cache them (note that this does not influence data from other Moby registries stored in the same -cachedir directory) + -fill-d ... ditto as -fill but only for data types + -fill-s ... ditto as -fill but only for services + -fill-t ... ditto as -fill but only for service types + -fill-n ... ditto as -fill but only for namespaces + -remove ... remove the current cache of the given Moby registry (again it does not influence data from other Moby registries stored in the same -cachedir directory) + -remove-d ...ditto as -remove but only for data types + -remove-s ...ditto as -remove but only for services + -remove-t ...ditto as -remove but only for service types + -remove-n ...ditto as -remove but only for namespaces + -q ... quiet mode [Note: You can also use -argsfile to read arguments from a =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/09/04 13:45:37 1.3 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/09/22 16:07:08 1.4 @@ -26,6 +26,7 @@ -t ... print all service types -s ... print all service instances -d ... print all data types + -n ... print all namespaces -details ... print the above with all details (by default only names are printed) From senger at pub.open-bio.org Thu Sep 22 12:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Sep 22 12:59:13 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG79Jn017371@pub.open-bio.org> senger Thu Sep 22 12:07:09 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv17235/src/main/org/biomoby/service/dashboard Modified Files: NOTES Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard NOTES,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/19 08:08:32 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/22 16:07:09 1.5 @@ -10,26 +10,25 @@ ? small icons to buttons ? use FileSystemView in file choosers ? alltools2: - - combo box history is not updated if exit happened while focus is till in the text field + - combo box history is not updated if exit happened while focus is still in the text field ? configure dashboard from menu: * configure dashbard (add/remove dynamically panels) * configure user preferences -* running from run-dashboard does not work - TODO for cache: --------------- -* add namespaces and service types -* store services under names: authority-service_name -* emit log events +* emit log events; use them also in cmdline clients * poor-man update: keep what's there but add what is not there - (and perhaps delete what should not be thre) - but do not + (and perhaps delete what should not be there) - but do not check any age of existing * getInfo() method * corresponding changes with command-line clients for cache implementations +* remove memory-caching from CentralImpl +* graphics by default: yes for datatyeps and no for services +? improve API javadoc of all these Central*Impl ? start to work on/think of the RDF-based cache Registry panel From senger at pub.open-bio.org Thu Sep 22 12:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Sep 22 12:59:14 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG794k017420@pub.open-bio.org> senger Thu Sep 22 12:07:09 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv17235/src/main/org/biomoby/shared Modified Files: CentralDigest.java MobyDataType.java MobyNamespace.java MobyPrimaryDataSet.java MobyPrimaryDataSimple.java MobySecondaryData.java MobyService.java Log Message: moby-live/Java/src/main/org/biomoby/shared CentralDigest.java,1.1,1.2 MobyDataType.java,1.7,1.8 MobyNamespace.java,1.1,1.2 MobyPrimaryDataSet.java,1.2,1.3 MobyPrimaryDataSimple.java,1.4,1.5 MobySecondaryData.java,1.3,1.4 MobyService.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java 2004/10/18 14:49:30 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java 2005/09/22 16:07:09 1.2 @@ -1,14 +1,16 @@ // CentralDigest.java // -// senger@ebi.ac.uk -// September 2004 +// Created: September 2004 +// +// This file is a component of the BioMoby project. +// Copyright Martin Senger (martin.senger@gmail.com). // package org.biomoby.shared; /** - * An interface to the cumulated (digested) contents of the Moby Registry. - *

    + * An interface to the cumulated (digested) contents of the Moby + * Registry.

    * * The main purpose of this interface is for those clients that are * accessing the whole, or a substantial part of, Moby registry. The @@ -16,7 +18,7 @@ * registry API that allow to get more information in one go - saving * significantly network and time.

    * - * @author Martin Senger + * @author Martin Senger * @version $Id$ */ @@ -44,6 +46,17 @@ throws MobyException; /************************************************************************* + * Get definition of all known namespaces. It differs from the + * {@link Central#getNamespaces} because it returns an array of + * full definitions of namespaces, and not just their names and + * descriptions.

    + * + * @throws MobyException if communication with the Moby Registry fails + *************************************************************************/ + MobyNamespace[] getFullNamespaces() + throws MobyException; + + /************************************************************************* * Get definition of all registered service instances. It is a * cumulation of many individual calls to {@link * Central#findService(MobyService) findService by name} for all =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/08/26 06:27:04 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/09/22 16:07:09 1.8 @@ -7,6 +7,7 @@ package org.biomoby.shared; +import org.tulsoft.shared.UUtils; /** @@ -246,20 +247,27 @@ public String toString() { StringBuffer buf = new StringBuffer(); buf.append ("Name: " + name + "\n"); - buf.append ("Auth: " + authority + "\n"); - buf.append ("Desc: " + description + "\n"); - buf.append ("Contact: " + emailContact + "\n"); + if (UUtils.notEmpty (authority)) buf.append ("Auth: " + authority + "\n"); + if (UUtils.notEmpty (description)) buf.append ("Desc: " + description + "\n"); + if (UUtils.notEmpty (emailContact)) buf.append ("Contact: " + emailContact + "\n"); if (id != null) buf.append ("ID: " + id + "\n"); - buf.append ("Parents:\n"); - for (int i = 0 ; i < parentNames.length; i++) { - buf.append (Utils.format (null, 1)); - buf.append (parentNames [i]); + if (parentNames.length > 0) { + buf.append ("Parents: "); + for (int i = 0 ; i < parentNames.length; i++) { + if (i > 0) buf.append (", "); + buf.append (parentNames [i]); + } buf.append ("\n"); } - buf.append ("Children (only those registered here):\n"); - for (int i = 0 ; i < children.length; i++) { - buf.append (Utils.format (null, 1)); - buf.append (children[i].toString()); + int chLen = children.length; + if (chLen > 0) { + buf.append ("Children (only those registered here): "); + if (chLen > 1) + buf.append ("\n"); + for (int i = 0 ; i < chLen; i++) { + if (i > 0) buf.append ("\n\t"); + buf.append (children[i].toString()); + } buf.append ("\n"); } return new String (buf); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java 2003/09/24 14:33:37 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java 2005/09/22 16:07:09 1.2 @@ -6,6 +6,7 @@ // package org.biomoby.shared; +import org.tulsoft.shared.UUtils; /** * A container representing a namespace used in the Moby registry. @@ -69,10 +70,12 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name + "\n"); - buf.append ("Auth: " + authority + "\n"); - buf.append ("Desc: " + description + "\n"); - buf.append ("ID: " + id + "\n"); + buf.append ("Name: " + name); + if (UUtils.notEmpty (authority)) + buf.append (", Auth: " + authority); + if (id != null) buf.append (", ID: " + id); + if (UUtils.notEmpty (description)) + buf.append ("\n\t" + description); return new String (buf); } public String format (int indent) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSet.java 2005/04/07 16:37:02 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSet.java 2005/09/22 16:07:09 1.3 @@ -6,6 +6,8 @@ package org.biomoby.shared; +import org.tulsoft.shared.UUtils; + import java.util.Enumeration; import java.util.Vector; @@ -106,8 +108,9 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name + "\n"); - buf.append ("ID: " + id + "\n"); + if (UUtils.notEmpty (name)) + buf.append ("Name: " + name + "\n"); + if (id != null) buf.append ("ID: " + id + "\n"); buf.append ("Elements in collection:\n"); for (Enumeration en = elements.elements(); en.hasMoreElements(); ) { buf.append (((MobyPrimaryDataSimple)en.nextElement()).format (1)); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSimple.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSimple.java 2005/04/07 16:37:02 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSimple.java 2005/09/22 16:07:09 1.5 @@ -6,6 +6,8 @@ package org.biomoby.shared; +import org.tulsoft.shared.UUtils; + import java.util.Enumeration; import java.util.Vector; @@ -130,15 +132,18 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name + "\n"); + if (UUtils.notEmpty (name)) + buf.append ("Name: " + name + "\n"); if (id != null) buf.append ("ID: " + id + "\n"); if (dataType != null) buf.append ("Data Type:\n" + dataType.format (1)); - buf.append ("Namespaces:\n"); - for (Enumeration en = namespaces.elements(); en.hasMoreElements(); ) { - buf.append (((MobyNamespace)en.nextElement()).format (1)); + if (namespaces.size() > 0) { + buf.append ("Namespaces:\n"); + for (Enumeration en = namespaces.elements(); en.hasMoreElements(); ) { + buf.append (((MobyNamespace)en.nextElement()).format (1)); + buf.append ("\n"); + } } - buf.append ("\n"); return new String (buf); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobySecondaryData.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobySecondaryData.java 2005/04/19 17:58:49 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobySecondaryData.java 2005/09/22 16:07:09 1.4 @@ -6,6 +6,8 @@ package org.biomoby.shared; +import org.tulsoft.shared.UUtils; + import java.util.Enumeration; import java.util.Vector; @@ -178,19 +180,23 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name + "\n"); - buf.append ("ID: " + id + "\n"); + if (UUtils.notEmpty (name)) + buf.append ("Name: " + name + "\n"); + if (id != null) buf.append ("ID: " + id + "\n"); buf.append ("Data Type: " + dataType + "\n"); - buf.append ("Default: " + defaultValue + "\n"); + if (UUtils.notEmpty (defaultValue)) + buf.append ("Default: " + defaultValue + "\n"); if (minimumValue != Integer.MIN_VALUE) buf.append ("Min: " + minimumValue + "\n"); if (maximumValue != Integer.MAX_VALUE) buf.append ("Max: " + maximumValue + "\n"); - buf.append ("Allowed values: "); - for (Enumeration en = allowedValues.elements(); en.hasMoreElements(); ) { - buf.append (en.nextElement() + " "); + if (allowedValues.size() > 0) { + buf.append ("Allowed values: "); + for (Enumeration en = allowedValues.elements(); en.hasMoreElements(); ) { + buf.append (en.nextElement() + " "); + } + buf.append ("\n"); } - buf.append ("\n"); return new String (buf); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2005/08/26 06:27:04 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2005/09/22 16:07:09 1.7 @@ -7,6 +7,8 @@ package org.biomoby.shared; +import org.tulsoft.shared.UUtils; + import java.util.Enumeration; import java.util.Vector; @@ -70,6 +72,15 @@ setName (name); } + /************************************************************************** + * Even more normal constructor - because a service is fully + * qualified only by its name and its authority.

    + *************************************************************************/ + public MobyService (String name, String authority) { + setName (name); + setAuthority (authority); + } + public String getUniqueName() { return name + "/" + authority; } @@ -302,24 +313,25 @@ buf.append ("Desc: " + description + "\n"); buf.append ("URL: " + url + "\n"); buf.append ("Contact: " + emailContact + "\n"); - buf.append ("Signature URL: " + signatureURL + "\n"); - buf.append ("Path to RDF: " + pathToRDF + "\n"); + if (UUtils.notEmpty (signatureURL)) + buf.append ("Signature URL: " + signatureURL + "\n"); + if (UUtils.notEmpty (pathToRDF)) + buf.append ("Path to RDF: " + pathToRDF + "\n"); if (id != null) buf.append ("ID: " + id + "\n"); - buf.append ("\nPrimary inputs:\n"); + buf.append ("Primary inputs:\n"); for (Enumeration en = primaryInputs.elements(); en.hasMoreElements(); ) buf.append (((MobyData)en.nextElement()).format (1)); - buf.append ("\n"); - buf.append ("\nSecondary inputs:\n"); - for (Enumeration en = secondaryInputs.elements(); en.hasMoreElements(); ) - buf.append (en.nextElement().toString()); - buf.append ("\n"); + if (secondaryInputs.size() > 0) { + buf.append ("Secondary inputs:\n"); + for (Enumeration en = secondaryInputs.elements(); en.hasMoreElements(); ) + buf.append (((MobyData)en.nextElement()).format (1)); + } - buf.append ("\nOutputs:\n"); + buf.append ("Outputs:\n"); for (Enumeration en = primaryOutputs.elements(); en.hasMoreElements(); ) - buf.append (en.nextElement().toString()); - buf.append ("\n"); + buf.append (((MobyData)en.nextElement()).format (1)); return new String (buf); } From senger at pub.open-bio.org Thu Sep 22 12:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu Sep 22 12:59:17 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG79XJ017350@pub.open-bio.org> senger Thu Sep 22 12:07:09 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv17235/src/main/org/biomoby/client Modified Files: BaseCmdLineClient.java CentralDigestCachedImpl.java CentralDigestImpl.java CentralImpl.java GraphsServlet.java ServiceConnections.java Log Message: moby-live/Java/src/main/org/biomoby/client BaseCmdLineClient.java,1.2,1.3 CentralDigestCachedImpl.java,1.6,1.7 CentralDigestImpl.java,1.4,1.5 CentralImpl.java,1.26,1.27 GraphsServlet.java,1.11,1.12 ServiceConnections.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/09/04 13:45:37 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/09/22 16:07:08 1.3 @@ -288,8 +288,7 @@ *************************************************************************/ protected MobyObject createInstance (String className) throws MobyException { - MobyObject data = null; - try { + try { Class theClass = mapDataTypes.getClass (className); if (theClass == null) throw new MobyException ("Cannot instantiate data type '" + className + "'. Does it exist?"); @@ -533,7 +532,6 @@ throw new MobyException ("Service name was not given. Try to add parameter: -service "); - String xmlResponse = null; String methodName = serviceName; Method method = null; Object service = null; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/19 08:08:32 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/22 16:07:08 1.7 @@ -21,6 +21,7 @@ import org.biomoby.shared.MobyDataType; import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; +import org.biomoby.shared.MobyServiceType; import org.biomoby.shared.NoSuccessException; /** @@ -29,7 +30,7 @@ * does not need to access Moby registry all the time. The other * methods of the Central interface do not use the results of the * cached cumulative results (their implementation is just passed to - * the parent class). It does not cache service types.

    + * the parent class).

    * * The caching is done in the file system, not in memory, so the * results are permanent (until someone removes the caching @@ -46,14 +47,27 @@ extends CentralDigestImpl implements CentralAll { + // filename for a list of cached entities + protected static final String LIST_FILE = "__L__I__S__T__"; + + /** An ID used in {@link #removeFromCache} indicating data types part. */ + public static final String CACHE_PART_DATATYPES = "c1"; + + /** An ID used in {@link #removeFromCache} indicating services part. */ + public static final String CACHE_PART_SERVICES = "c2"; + + /** An ID used in {@link #removeFromCache} indicating service types part. */ + public static final String CACHE_PART_SERVICETYPES = "c3"; + + /** An ID used in {@link #removeFromCache} indicating namespaces part. */ + public static final String CACHE_PART_NAMESPACES = "c4"; + // cache location private String cacheDir; // as defined in the constructor protected File dataTypesCache; protected File servicesCache; protected File namespacesCache; - - // cache age - private long cacheAge = -1; + protected File serviceTypesCache; // for optimalization private String fileSeparator; @@ -93,31 +107,40 @@ File cache = createCacheDir (cacheDir, getRegistryEndpoint()); messageLn ("Using cache directory: " + cache); dataTypesCache = createSubCacheDir (cache, "dataTypes"); - long dataTypesCacheAge = (isCacheEmpty (dataTypesCache) ? -1 : dataTypesCache.lastModified()); servicesCache = createSubCacheDir (cache, "services"); - long servicesCacheAge = (isCacheEmpty (servicesCache) ? -1 : servicesCache.lastModified()); namespacesCache = createSubCacheDir (cache, "namespaces"); - long namespacesCacheAge = (isCacheEmpty (namespacesCache) ? -1 : namespacesCache.lastModified()); - - if (dataTypesCacheAge > -1 && servicesCacheAge > -1 && namespacesCacheAge > -1) - cacheAge = Math.min (Math.min (dataTypesCacheAge, servicesCacheAge), - namespacesCacheAge); - else - cacheAge = Math.max (Math.max (dataTypesCacheAge, servicesCacheAge), - namespacesCacheAge); + serviceTypesCache = createSubCacheDir (cache, "serviceTypes"); } } /************************************************************************** - * It removes the whole cache (for the Moby registry this instance - * as initiated for), regardless of the 'id' passed. + * Removes object groups from the cache. If 'id' is null it + * removes the whole cache (for the Moby registry this instance as + * initiated for). Otherwise 'id' indicates what part of the cache + * that will be removed.

    + * + * @param id should be either null, or one of the fillowing: + * {@link #CACHE_PART_DATATYPES}, {@link #CACHE_PART_SERVICES}, + * {@link #CACHE_PART_SERVICETYPES}, and {@link + * #CACHE_PART_NAMESPACES}. **************************************************************************/ public void removeFromCache (String id) { try { if (cacheDir != null) { - removeCacheDir (cacheDir, getRegistryEndpoint(), - new String[] { "dataTypes", "services" }); - cacheAge= -1; + String[] parts = null; + if (id == null) + parts = new String[] { "dataTypes", "services", "serviceTypes", "namespaces" }; + else if (id.equals (CACHE_PART_SERVICES)) + parts = new String[] { "services" }; + else if (id.equals (CACHE_PART_DATATYPES)) + parts = new String[] { "dataTypes" }; + else if (id.equals (CACHE_PART_SERVICETYPES)) + parts = new String[] { "serviceTypes" }; + else if (id.equals (CACHE_PART_NAMESPACES)) + parts = new String[] { "namespaces" }; + if (parts != null) { + removeCacheDir (cacheDir, getRegistryEndpoint(), parts); + } } } catch (MobyException e) { // TBD: keep this here at least for some time (until we @@ -255,8 +278,10 @@ } } - // read a cached file - protected String load (File file) + /************************************************************************** + * Read a cached file + *************************************************************************/ + protected static String load (File file) throws MobyException { try { StringBuffer buf = new StringBuffer(); @@ -280,6 +305,7 @@ // protected boolean isCacheEmpty (File cache) throws MobyException { + if (cache == null) return true; String[] list = cache.list(); return ( list == null || list.length == 0 ); } @@ -287,7 +313,9 @@ protected void fillDataTypesCache() throws MobyException { try { - Map types = getDataTypeNames(); + String typesAsXML = getDataTypeNamesAsXML(); + store (dataTypesCache, LIST_FILE, typesAsXML); + Map types = createDataTypeNamesFromXML (typesAsXML); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); @@ -295,9 +323,6 @@ String xml = getDataTypeAsXML (name); store (dataTypesCache, name, xml); } - if (cacheAge <= 0) - cacheAge = dataTypesCache.lastModified(); - } catch (Exception e) { throw new MobyException (formatException (e)); } @@ -307,17 +332,36 @@ throws MobyException { try { messageLn ("(CDCI) Asking for all service names..."); - Map names = getServiceNames(); - for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { + String byAuthorityAsXML = getServiceNamesByAuthorityAsXML(); + store (servicesCache, LIST_FILE, byAuthorityAsXML); + Map authorities = createServiceNamesByAuthorityFromXML (byAuthorityAsXML); + for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); - String name = (String)entry.getKey(); - messageLn ("(CDCI) Processing service " + name + "..."); - String xml = getServicesAsXML (new MobyService (name), null, true, true); - store (servicesCache, name, xml); + String authority = (String)entry.getKey(); + messageLn ("(CDCI) Processing authority " + authority + "..."); + String xml = getServicesAsXML (new MobyService (MobyService.DUMMY_NAME, authority), null, true, true); + store (servicesCache, authority, xml); } - if (cacheAge <= 0) - cacheAge = servicesCache.lastModified(); + } catch (Exception e) { + throw new MobyException (formatException (e)); + } + } + // + protected void fillServiceTypesCache() + throws MobyException { + try { + messageLn ("(CDCI) Asking for all service type names..."); + String typesAsXML = getServiceTypesAsXML(); + store (serviceTypesCache, LIST_FILE, typesAsXML); + Map types = createServiceTypesFromXML (typesAsXML); + for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String name = (String)entry.getKey(); + messageLn ("(CDCI) Processing service type " + name + "..."); + String xml = getServiceTypeRelationshipsAsXML (name, false); + store (serviceTypesCache, name, xml); + } } catch (Exception e) { throw new MobyException (formatException (e)); } @@ -328,16 +372,34 @@ throws MobyException { try { String xml = getNamespacesAsXML(); - store (namespacesCache, "all_namespaces_in_one_go", xml); - if (cacheAge <= 0) - cacheAge = namespacesCache.lastModified(); - + store (namespacesCache, LIST_FILE, xml); } catch (Exception e) { throw new MobyException (formatException (e)); } } - // read all data types + /************************************************************************* + * + *************************************************************************/ + public Map getDataTypeNames() + throws MobyException { + if (dataTypesCache == null) + return super.getDataTypeNames(); + synchronized (dataTypesCache) { + if (isCacheEmpty (dataTypesCache)) { + initCache(); + fillDataTypesCache(); + } + + // get a list file (with all data type names) + String xmlList = getListFile (dataTypesCache); + return createDataTypeNamesFromXML (xmlList); + } + } + + /************************************************************************* + * + *************************************************************************/ public MobyDataType[] getDataTypes() throws MobyException { if (dataTypesCache == null) @@ -350,15 +412,14 @@ } File[] list = dataTypesCache.listFiles(); if (list == null) - throw new MobyException ("Surprisingly, '" + dataTypesCache.getAbsolutePath() + "' is not a directory. Strange..."); + throw new MobyException (MSG_CACHE_NOT_DIR (dataTypesCache)); + for (int i = 0; i < list.length; i++) { try { - if (list[i].getPath().endsWith ("~")) - continue; // ignore some files + if (ignored (list[i])) continue; v.addElement (createDataTypeFromXML (load (list[i]), "-dummy-")); } catch (NoSuccessException e) { - System.err.println ("Ignoring '" + list[i].getPath() + "'. It should not be in the cache directory."); -// throw new MobyException (e.getMessage() + " (" + e.getCulprit() + ")"); + System.err.println (MSG_CACHE_BAD_FILE (list[i], e)); } } MobyDataType[] result = new MobyDataType [v.size()]; @@ -367,7 +428,28 @@ } } - // read all services + /************************************************************************* + * + *************************************************************************/ + public Map getServiceNamesByAuthority() + throws MobyException { + if (servicesCache == null) + return super.getServiceNamesByAuthority(); + synchronized (servicesCache) { + if (isCacheEmpty (servicesCache)) { + initCache(); + fillServicesCache(); + } + + // get a list file (with all service names) + String xmlList = getListFile (servicesCache); + return createServiceNamesByAuthorityFromXML (xmlList); + } + } + + /************************************************************************* + * + *************************************************************************/ public MobyService[] getServices() throws MobyException { if (servicesCache == null) @@ -380,13 +462,17 @@ } File[] list = servicesCache.listFiles(); if (list == null) - throw new MobyException ("Surprisingly, '" + servicesCache.getAbsolutePath() + "' is not a directory. Strange..."); + throw new MobyException (MSG_CACHE_NOT_DIR (servicesCache)); for (int i = 0; i < list.length; i++) { - if (list[i].getPath().endsWith ("~")) - continue; // ignore some files - MobyService[] servs = extractServices (load (list[i])); - for (int j = 0; j < servs.length; j++) - v.addElement (servs[j]); + try { + if (ignored (list[i])) continue; + MobyService[] servs = extractServices (load (list[i])); + for (int j = 0; j < servs.length; j++) { + v.addElement (servs[j]); + } + } catch (MobyException e) { + System.err.println (MSG_CACHE_BAD_FILE (list[i], e)); + } } MobyService[] result = new MobyService [v.size()]; v.copyInto (result); @@ -394,7 +480,10 @@ } } -// public MobyNamespace[] getNamespaces() + /************************************************************************* + * + *************************************************************************/ +// public MobyNamespace[] getNamespaces() //TBD: later, when API allows it public Map getNamespaces() throws MobyException { if (namespacesCache == null) @@ -404,23 +493,89 @@ initCache(); fillNamespacesCache(); } - File[] list = namespacesCache.listFiles(); - if (list == null) - throw new MobyException - ("Surprisingly, '" + namespacesCache.getAbsolutePath() + "' is not a directory. Strange..."); - for (int i = 0; i < list.length; i++) { + + // get a list file (with all namespaces) + String xmlList = getListFile (namespacesCache); + return createNamespacesFromXML (xmlList); + } + } + + /************************************************************************* + * + *************************************************************************/ + protected MobyServiceType[] readServiceTypes() + throws MobyException { + if (serviceTypesCache == null) + return super.readServiceTypes(); + synchronized (serviceTypesCache) { + if (isCacheEmpty (serviceTypesCache)) { + initCache(); + fillServiceTypesCache(); + } + + // get a list file (with all service type names) + String xmlList = getListFile (serviceTypesCache); + Map types = createServiceTypesFromXML (xmlList); + + // get individual (almost) full service types + Vector v = new Vector(); + for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String name = (String)entry.getKey(); + File file = new File (serviceTypesCache, name); try { - if (list[i].getPath().endsWith ("~")) - continue; // ignore some files - return createNamespacesFromXML (load (list[i])); + MobyServiceType serviceType = new MobyServiceType (name); + serviceType.setParentNames (createServiceTypeRelationshipsFromXML (load (file))); + serviceType.setDescription ((String)entry.getValue()); + v.addElement (serviceType); } catch (MobyException e) { - System.err.println ("Ignoring '" + list[i].getPath() + - "'. It should not be in the cache directory:" + - e.getMessage()); + System.err.println (MSG_CACHE_BAD_FILE (file, e)); } } + MobyServiceType[] result = new MobyServiceType [v.size()]; + v.copyInto (result); + return result; } - return null; + } + + /************************************************************************** + * + *************************************************************************/ + protected static String getListFile (File cache) + throws MobyException { + File listFile = new File (cache, LIST_FILE); + if (! listFile.exists()) + throw new MobyException ("Corrupted cache '" + cache + "': Missing a LIST file."); + return load (listFile); + } + + /************************************************************************** + * Some file (when being read from a cache directory) are ignored. + *************************************************************************/ + protected static boolean ignored (File file) { + String path = file.getPath(); + return + path.endsWith ("~") || + path.endsWith (LIST_FILE); + } + + /************************************************************************** + * + *************************************************************************/ + protected static String MSG_CACHE_NOT_DIR (File cache) { + return + "Surprisingly, '" + cache.getAbsolutePath() + + "' is not a directory. Strange..."; + } + + /************************************************************************** + * + *************************************************************************/ + protected static String MSG_CACHE_BAD_FILE (File file, Exception e) { + return + "Ignoring '" + file.getPath() + + "'. It should not be in the cache directory:" + + e.getMessage(); } /************************************************************************** @@ -434,7 +589,7 @@ /************************************************************************** * It always (again, if it functions as a cache which is when - * 'cacheDir' was given) reports that caching is disabled (even + * 'cacheDir' is given) reports that caching is disabled (even * though for the cumulative results is actually always enabled - * but that is obvious from the name of this class, isn't it?). **************************************************************************/ @@ -445,12 +600,28 @@ /************************************************************************** * Return age of the current (whole) cache in millis from the * beginning of the Epoch; or -1 if cache is empty, or the age is - * unknown. + * unknown.

    * - * The cache age is taken as the oldest (but filled) cache part. + * @return the cache age which is taken as the oldest (but filled) + * cache part (part is considered e.g. 'services', or 'data + * types', not their individual entities) **************************************************************************/ public long getCacheAge() { - return cacheAge; + try { + long dataTypesCacheAge = + (isCacheEmpty (dataTypesCache) ? Long.MAX_VALUE : dataTypesCache.lastModified()); + long servicesCacheAge = + (isCacheEmpty (servicesCache) ? Long.MAX_VALUE : servicesCache.lastModified()); + long namespacesCacheAge = + (isCacheEmpty (namespacesCache) ? Long.MAX_VALUE : namespacesCache.lastModified()); + long serviceTypesCacheAge = + (isCacheEmpty (serviceTypesCache) ? Long.MAX_VALUE : serviceTypesCache.lastModified()); + long age = Math.min (Math.min (dataTypesCacheAge, servicesCacheAge), + Math.min (namespacesCacheAge, serviceTypesCacheAge)); + return (age == Long.MAX_VALUE ? -1 : age); + } catch (MobyException e) { + return -1; + } } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/09/04 13:45:37 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/09/22 16:07:09 1.5 @@ -11,6 +11,7 @@ import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; import org.biomoby.shared.MobyServiceType; +import org.biomoby.shared.MobyNamespace; import org.tulsoft.tools.debug.DGUtils; @@ -35,6 +36,7 @@ protected MobyDataType[] dataTypes = new MobyDataType[] {}; protected MobyServiceType[] serviceTypes = new MobyServiceType[] {}; protected MobyService[] services = new MobyService[] {}; + protected MobyNamespace[] namespaces = new MobyNamespace[] {}; /************************************************************************* @@ -101,7 +103,7 @@ String typeName = (String)entry.getKey(); messageLn ("(CDI) Processing service type " + typeName + "..."); MobyServiceType serviceType = new MobyServiceType (typeName); - serviceType.setDescription ((String)entry.getKey()); + serviceType.setDescription ((String)entry.getValue()); serviceType.setParentNames (getServiceTypeRelationships (typeName, false)); v.addElement (serviceType); } @@ -115,6 +117,36 @@ } /************************************************************************* + * Physically gather together all namespaces. It is not that hard + * (comparing to other Biomoby entities) because all namespaces + * are delivered by a single call to Biomoby. This method differs + * form the Central.getNamespaces() in the type of returned + * result, and - hopefully in the future - also in the amount of + * information stored in the returned value (but at the monent, + * because of a limitation of the Biomoby API, both result types + * contain the same information). + *************************************************************************/ + protected MobyNamespace[] readNamespaces() + throws MobyException { + try { + Map names = getNamespaces(); + MobyNamespace[] result = new MobyNamespace [ names.size() ]; + int i = 0; + for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String name = (String)entry.getKey(); + MobyNamespace ns = new MobyNamespace (name); + ns.setDescription ((String)entry.getValue()); + result[i++] = ns; + } + return result; + + } catch (Exception e) { + throw new MobyException (formatException (e)); + } + } + + /************************************************************************* * Physically gather together all service instances. *************************************************************************/ protected MobyService[] readServices() @@ -122,14 +154,17 @@ try { Vector v = new Vector(); messageLn ("(CDI) Asking for all service names..."); - Map names = getServiceNames(); - for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { + Map authorities = getServiceNamesByAuthority(); + for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); - String name = (String)entry.getKey(); - messageLn ("(CDI) Processing service " + name + "..."); - MobyService[] servs = findService (new MobyService (name)); - for (int i = 0; i < servs.length; i++) - v.addElement (servs[i]); + String authority = (String)entry.getKey(); + String[] names = (String[])entry.getValue(); + for (int i = 0; i < names.length; i++) { + messageLn ("(CDI) Processing service " + names[i] + "..."); + MobyService[] servs = findService (new MobyService (names[i], authority)); + for (int j = 0; j < servs.length; j++) + v.addElement (servs[j]); + } } MobyService[] result = new MobyService [v.size()]; v.copyInto (result); @@ -227,6 +262,22 @@ /************************************************************************* * *************************************************************************/ + public MobyNamespace[] getFullNamespaces() + throws MobyException { + synchronized (namespaces) { + if (getCacheMode()) { + if (namespaces.length == 0) + namespaces = readNamespaces(); + return namespaces; + } else { + return readNamespaces(); + } + } + } + + /************************************************************************* + * + *************************************************************************/ public MobyService[] getServices() throws MobyException { synchronized (services) { @@ -240,7 +291,6 @@ } } - // Work in progress - implement the methods above by getting RDF // graphs in-one-go and parsing them. Actually ability to get such // graphs was the main motivation for this implementation, and for =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/19 08:08:32 1.26 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/22 16:07:09 1.27 @@ -23,6 +23,7 @@ import org.biomoby.shared.Utils; import org.biomoby.shared.MobyResourceRef; +import org.tulsoft.shared.UUtils; import org.tulsoft.tools.soap.axis.AxisUtils; import org.w3c.dom.Document; @@ -401,7 +402,7 @@ buf.append ("" + service.getType() + "\n"); String name = service.getName(); - if (!name.equals ("") && !name.equals ("dummy")) + if (!name.equals ("") && !name.equals ("dummy") && !name.equals (MobyService.DUMMY_NAME)) buf.append ("" + service.getName() + "\n"); buf.append ("" + service.getCategory() + "\n"); @@ -622,7 +623,7 @@ * further calls unless it is set to true again.

    * * @param shouldCache whether retrieveXXX call results should be - * cached in case they are called again (i.e. don't requery + * cached in case they are called again (i.e. don't request * MobyCentral every time) **************************************************************************/ public void setCacheMode (boolean shouldCache) { @@ -659,11 +660,6 @@ public Map getServiceNames() throws MobyException { - String cacheId = "retrieveServiceNames"; - Map cachedResults = (Map)getContents (cacheId); - if (cachedResults != null) - return cachedResults; - String result = (String)doCall ("retrieveServiceNames", new Object[] {}); @@ -683,9 +679,6 @@ elem.getAttribute ("authURI")); } - // Add this data to the cache in case we get called again - setContents (cacheId, results); - return results; } @@ -701,14 +694,20 @@ *************************************************************************/ public Map getServiceNamesByAuthority() throws MobyException { + String result = getServiceNamesByAuthorityAsXML(); + return createServiceNamesByAuthorityFromXML (result); + } - String cacheId = "retrieveServiceNamesByAuthority"; - Map cachedResults = (Map)getContents (cacheId); - if (cachedResults != null) - return cachedResults; + // + protected String getServiceNamesByAuthorityAsXML() + throws MobyException { + return (String)doCall ("retrieveServiceNames", + new Object[] {}); + } - String result = (String)doCall ("retrieveServiceNames", - new Object[] {}); + // + protected Map createServiceNamesByAuthorityFromXML (String result) + throws MobyException { // parse returned XML Map results = new HashMap(); @@ -738,9 +737,6 @@ entry.setValue (servNames); } - // Add this data to the cache in case we get called again - setContents (cacheId, results); - return results; } @@ -798,14 +794,20 @@ *************************************************************************/ public Map getServiceTypes() throws MobyException { + String result = getServiceTypesAsXML(); + return createServiceTypesFromXML (result); + } - String cacheId = "retrieveServiceTypes"; - Map cachedResults = (Map)getContents (cacheId); - if (cachedResults != null) - return cachedResults; + // + protected String getServiceTypesAsXML() + throws MobyException { + return (String)doCall ("retrieveServiceTypes", + new Object[] {}); + } - String result = (String)doCall ("retrieveServiceTypes", - new Object[] {}); + // + protected Map createServiceTypesFromXML (String result) + throws MobyException { // parse returned XML Map results = new HashMap(); @@ -826,10 +828,6 @@ } } } - - // Add this data to the cache in case we get called again - setContents (cacheId, results); - return results; } @@ -863,11 +861,6 @@ protected Map createNamespacesFromXML (String result) throws MobyException { - String cacheId = "retrieveNamespaces"; - Map cachedResults = (Map)getContents (cacheId); - if (cachedResults != null) - return cachedResults; - // parse returned XML Map results = new HashMap(); Document document = null; @@ -898,9 +891,6 @@ } } - // Add this data to the cache in case we get called again - setContents (cacheId, results); - return results; } @@ -918,14 +908,20 @@ *************************************************************************/ public Map getDataTypeNames() throws MobyException { + String result = getDataTypeNamesAsXML(); + return createDataTypeNamesFromXML (result); + } - String cacheId = "retrieveObjectNames"; - Map cachedResults = (Map)getContents (cacheId); - if (cachedResults != null) - return cachedResults; + // + protected String getDataTypeNamesAsXML() + throws MobyException { + return (String)doCall ("retrieveObjectNames", + new Object[] {}); + } - String result = (String)doCall ("retrieveObjectNames", - new Object[] {}); + // + protected Map createDataTypeNamesFromXML (String result) + throws MobyException { // parse returned XML Map results = new HashMap(); @@ -949,7 +945,6 @@ } } - setContents (cacheId, results); return results; } @@ -986,20 +981,12 @@ protected String getDataTypeAsXML (String dataTypeName) throws MobyException, NoSuccessException { - String cacheId = "retrieveObjectDefinition_" + dataTypeName; - String cachedResults = (String)getContents (cacheId); - if (cachedResults != null) - return cachedResults; - - String results = - (String)doCall ("retrieveObjectDefinition", - new Object[] { - "" + - "" + dataTypeName + "" + - "" - }); - setContents (cacheId, results); - return results; + return (String)doCall ("retrieveObjectDefinition", + new Object[] { + "" + + "" + dataTypeName + "" + + "" + }); } protected MobyDataType createDataTypeFromXML (String xmlSource, String dataTypeName) @@ -1475,13 +1462,15 @@ public String[] getServiceTypeRelationships (String serviceTypeName, boolean expand) throws MobyException { + String result = getServiceTypeRelationshipsAsXML (serviceTypeName, expand); + return createServiceTypeRelationshipsFromXML (result); + } - String cacheId = "Relationships_" + serviceTypeName + ":" + expand; - String[] cachedResults = (String[])getContents (cacheId); - if (cachedResults != null) - return cachedResults; - - String result = + // + protected String getServiceTypeRelationshipsAsXML (String serviceTypeName, + boolean expand) + throws MobyException { + return (String)doCall ("Relationships", new Object[] { "" + @@ -1490,6 +1479,11 @@ "" + (expand ? "1" : "0") + "" + "" }); + } + + // + protected String[] createServiceTypeRelationshipsFromXML (String result) + throws MobyException { // parse returned XML Vector v = new Vector(); @@ -1509,8 +1503,6 @@ } String[] results = new String [v.size()]; v.copyInto (results); - - setContents (cacheId, results); return results; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/09/04 13:45:37 1.11 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/09/22 16:07:09 1.12 @@ -275,10 +275,10 @@ // read some suggested defaults from the init parameters defaultEndpoint = (String)initParams.get (DEFAULT_ENDPOINT); - if (UUtils.isEmpty (defaultEndpoint)) + if ( UUtils.isEmpty (defaultEndpoint) || defaultEndpoint.equals ("\"\"") ) defaultEndpoint = CentralImpl.DEFAULT_ENDPOINT; defaultNamespace = (String)initParams.get (DEFAULT_NAMESPACE); - if (UUtils.isEmpty (defaultNamespace)) + if ( UUtils.isEmpty (defaultNamespace) || defaultNamespace.equals ("\"\"") ) defaultNamespace = CentralImpl.DEFAULT_NAMESPACE; registryCacheDir = (String)initParams.get (REGISTRY_CACHE_DIR); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java 2005/08/26 06:27:04 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java 2005/09/22 16:07:09 1.7 @@ -244,7 +244,6 @@ // we need to remember all connections (edges) created for this output // because only after we finish with it we will find if the connections // are 'weak' or not (as described in ServicesEdge.isWeakConnection) - int startingFrom = v.size(); boolean headCollection = false; MobyPrimaryDataSimple output; From kawas at pub.open-bio.org Thu Sep 22 12:23:13 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Thu Sep 22 13:15:10 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221623.j8MGNDlp017500@pub.open-bio.org> kawas Thu Sep 22 12:23:13 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi In directory pub.open-bio.org:/tmp/cvs-serv17475/Adaptor/moby/queryapi Modified Files: mysql.pm Log Message: added case sensitive servicename queries moby-live/Perl/MOBY/Adaptor/moby/queryapi mysql.pm,1.73,1.74 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/09/13 13:17:58 1.73 +++ /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/09/22 16:23:13 1.74 @@ -123,7 +123,12 @@ { if (defined $pair{$key}) { - $condition .= $key . " = ? "; + #added a check for servicename to support case sensitivity + if ($key eq "servicename") { + $condition .= $key . " LIKE binary ? "; + } else { + $condition .= $key . " = ? "; + } push(@bindvalues, $pair{$key}); } else @@ -621,6 +626,7 @@ } # pass servicename and authority_uri +# TODO added LIKE binary here sub query_service_existence { my ($self, %args) = @_; my $dbh = $self->dbh; @@ -643,7 +649,7 @@ description, signatureURL, lsid - from service_instance where servicename = ? and authority_id = ?"; + from service_instance where servicename LIKE binary ? and authority_id = ?"; my $final = do_query($dbh, $statement, ($servicename, $id)); if (@$final[0]){return 1} else {return 0} From gss at pub.open-bio.org Thu Sep 22 12:57:58 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:49:46 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvwEp017665@pub.open-bio.org> gss Thu Sep 22 12:57:58 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/graph/tools Removed Files: MOBYProviderTraverser.html package-summary.html package-tree.html package-use.html package-frame.html MOBYProviderVisitorAdapter.html MOBYProviderTraversalException.html MOBYProviderVisitor.html MOBYProviderXMLGenerator.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools MOBYProviderTraverser.html,1.1,NONE package-summary.html,1.1,NONE package-tree.html,1.1,NONE package-use.html,1.1,NONE package-frame.html,1.1,NONE MOBYProviderVisitorAdapter.html,1.1,NONE MOBYProviderTraversalException.html,1.1,NONE MOBYProviderVisitor.html,1.1,NONE MOBYProviderXMLGenerator.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/MOBYProviderTraverser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/MOBYProviderVisitorAdapter.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/MOBYProviderTraversalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/MOBYProviderVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/MOBYProviderXMLGenerator.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:57:58 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:49:49 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvwrW017685@pub.open-bio.org> gss Thu Sep 22 12:57:58 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/test Removed Files: package-summary.html package-use.html package-tree.html Test.html package-frame.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test package-summary.html,1.1,NONE package-use.html,1.1,NONE package-tree.html,1.1,NONE Test.html,1.1,NONE package-frame.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/RCS/Test.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/RCS/package-frame.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:57:58 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:49:55 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvw1u017739@pub.open-bio.org> gss Thu Sep 22 12:57:58 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/graph Removed Files: MOBYProviderSet.html MOBYProvider.html MOBYObject.html MOBYSingleElement.html package-tree.html MOBYPropertyValueException.html MOBYDocument.html MOBYCollection.html MOBYPropertyValueConstraint.html MOBYNonNegativeIntegerConstraint.html MOBYGraphNode.html MOBYResource.html package-summary.html MOBYPropertyValue.html MOBYLiteral.html package-frame.html MOBYPropertyValueStatement.html MOBYOrderedCollection.html MOBYGraphVisitor.html MOBYEnumeration.html MOBYNumericConstraint.html MOBYDateConstraint.html MOBYDescriptor.html MOBYOntology.html MOBYUnorderedCollection.html package-use.html MOBYNonPositiveIntegerConstraint.html MOBYResizableCollection.html MOBYSubject.html MOBYMappingElement.html MOBYIntegerConstraint.html MOBYGraph.html MOBYFixedCollection.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph MOBYProviderSet.html,1.1,NONE MOBYProvider.html,1.1,NONE MOBYObject.html,1.1,NONE MOBYSingleElement.html,1.1,NONE package-tree.html,1.1,NONE MOBYPropertyValueException.html,1.1,NONE MOBYDocument.html,1.1,NONE MOBYCollection.html,1.1,NONE MOBYPropertyValueConstraint.html,1.1,NONE MOBYNonNegativeIntegerConstraint.html,1.1,NONE MOBYGraphNode.html,1.1,NONE MOBYResource.html,1.1,NONE package-summary.html,1.1,NONE MOBYPropertyValue.html,1.1,NONE MOBYLiteral.html,1.1,NONE package-frame.html,1.1,NONE MOBYPropertyValueStatement.html,1.1,NONE MOBYOrderedCollection.html,1.1,NONE MOBYGraphVisitor.html,1.1,NONE MOBYEnumeration.html,1.1,NONE MOBYNumericConstraint.html,1.1,NONE MOBYDateConstraint.html,1.1,NONE MOBYDescriptor.html,1.1,NONE MOBYOntology.html,1.1,NONE MOBYUnorderedCollection.html,1.1,NONE package-use.html,1.1,NONE MOBYNonPositiveIntegerConstraint.html,1.1,NONE MOBYResizableCollection.! html,1.1,NONE MOBYSubject.html,1.1,NONE MOBYMappingElement.html,1.1,NONE MOBYIntegerConstraint.html,1.1,NONE MOBYGraph.html,1.1,NONE MOBYFixedCollection.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYProviderSet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYProvider.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYObject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYSingleElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYPropertyValueException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYDocument.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYPropertyValueConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYNonNegativeIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYGraphNode.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYResource.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYPropertyValue.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYLiteral.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYPropertyValueStatement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYOrderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYGraphVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYEnumeration.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYNumericConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYDateConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYDescriptor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYOntology.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYUnorderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYNonPositiveIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYResizableCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYSubject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYMappingElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYGraph.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYFixedCollection.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:57:59 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:49:57 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvxvq017815@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/parser/test Removed Files: package-use.html package-frame.html Test.html ParserTest.html package-tree.html package-summary.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test package-use.html,1.1,NONE package-frame.html,1.1,NONE Test.html,1.1,NONE ParserTest.html,1.1,NONE package-tree.html,1.1,NONE package-summary.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/Test.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/ParserTest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/package-summary.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:57:59 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:49:58 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvxIr017891@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/graph/class-use Removed Files: MOBYCollection.html MOBYResource.html MOBYResizableCollection.html MOBYPropertyValueException.html MOBYLiteral.html MOBYProvider.html MOBYObject.html MOBYGraph.html MOBYDateConstraint.html MOBYNumericConstraint.html MOBYNonPositiveIntegerConstraint.html MOBYNonNegativeIntegerConstraint.html MOBYFixedCollection.html MOBYPropertyValue.html MOBYDocument.html MOBYMappingElement.html MOBYPropertyValueStatement.html MOBYPropertyValueConstraint.html MOBYGraphVisitor.html MOBYProviderSet.html MOBYGraphNode.html MOBYEnumeration.html MOBYOrderedCollection.html MOBYIntegerConstraint.html MOBYSingleElement.html MOBYUnorderedCollection.html MOBYOntology.html MOBYDescriptor.html MOBYSubject.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use MOBYCollection.html,1.1,NONE MOBYResource.html,1.1,NONE MOBYResizableCollection.html,1.1,NONE MOBYPropertyValueException.html,1.1,NONE MOBYLiteral.html,1.1,NONE MOBYProvider.html,1.1,NONE MOBYObject.html,1.1,NONE MOBYGraph.html,1.1,NONE MOBYDateConstraint.html,1.1,NONE MOBYNumericConstraint.html,1.1,NONE MOBYNonPositiveIntegerConstraint.html,1.1,NONE MOBYNonNegativeIntegerConstraint.html,1.1,NONE MOBYFixedCollection.html,1.1,NONE MOBYPropertyValue.html,1.1,NONE MOBYDocument.html,1.1,NONE MOBYMappingElement.html,1.1,NONE MOBYPropertyValueStatement.html,1.1,NONE MOBYPropertyValueConstraint.html,1.1,NONE MOBYGraphVisitor.html,1.1,NONE MOBYProviderSet.html,1.1,NONE MOBYGraphNode.html,1.1,NONE MOBYEnumeration.html,1.1,NONE MOBYOrderedCollection.html,1.1,NONE MOBYIntegerConstraint.html,1.1,NONE MOBYSingleElement.html,1.1,NONE MOBYUnorderedCollection.html,1.1,NONE MOBYOntology.htm! l,1.1,NONE MOBYDescriptor.html,1.1,NONE MOBYSubject.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYResource.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYResizableCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYPropertyValueException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYLiteral.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYProvider.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYObject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYGraph.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYDateConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYNumericConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYNonPositiveIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYNonNegativeIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYFixedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYPropertyValue.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYDocument.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYMappingElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYPropertyValueStatement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYPropertyValueConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYGraphVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYProviderSet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYGraphNode.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYEnumeration.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYOrderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYSingleElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYUnorderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYOntology.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYDescriptor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYSubject.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:57:59 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:50:00 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvxfB017837@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/graph/tools/class-use Removed Files: MOBYProviderTraverser.html MOBYProviderTraversalException.html MOBYProviderVisitorAdapter.html MOBYProviderXMLGenerator.html MOBYProviderVisitor.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use MOBYProviderTraverser.html,1.1,NONE MOBYProviderTraversalException.html,1.1,NONE MOBYProviderVisitorAdapter.html,1.1,NONE MOBYProviderXMLGenerator.html,1.1,NONE MOBYProviderVisitor.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use/RCS/MOBYProviderTraverser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use/RCS/MOBYProviderTraversalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use/RCS/MOBYProviderVisitorAdapter.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use/RCS/MOBYProviderXMLGenerator.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use/RCS/MOBYProviderVisitor.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:57:59 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:50:02 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvxBw017791@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/graph Removed Files: MOBYUnorderedCollection.html MOBYDocument.html MOBYLiteral.html MOBYObject.html MOBYSingleElement.html package-summary.html MOBYDescriptor.html MOBYResizableCollection.html MOBYSubject.html MOBYCollection.html package-frame.html MOBYIntegerConstraint.html MOBYGraphNode.html package-tree.html MOBYFixedCollection.html MOBYProviderSet.html MOBYProvider.html MOBYPropertyValue.html MOBYPropertyValueException.html MOBYPropertyValueStatement.html MOBYNonNegativeIntegerConstraint.html MOBYMappingElement.html MOBYGraphVisitor.html MOBYGraph.html MOBYOntology.html package-use.html MOBYNonPositiveIntegerConstraint.html MOBYResource.html MOBYDateConstraint.html MOBYNumericConstraint.html MOBYEnumeration.html MOBYPropertyValueConstraint.html MOBYOrderedCollection.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph MOBYUnorderedCollection.html,1.2,NONE MOBYDocument.html,1.2,NONE MOBYLiteral.html,1.2,NONE MOBYObject.html,1.2,NONE MOBYSingleElement.html,1.2,NONE package-summary.html,1.2,NONE MOBYDescriptor.html,1.2,NONE MOBYResizableCollection.html,1.2,NONE MOBYSubject.html,1.2,NONE MOBYCollection.html,1.2,NONE package-frame.html,1.2,NONE MOBYIntegerConstraint.html,1.1,NONE MOBYGraphNode.html,1.2,NONE package-tree.html,1.2,NONE MOBYFixedCollection.html,1.2,NONE MOBYProviderSet.html,1.2,NONE MOBYProvider.html,1.2,NONE MOBYPropertyValue.html,1.2,NONE MOBYPropertyValueException.html,1.2,NONE MOBYPropertyValueStatement.html,1.2,NONE MOBYNonNegativeIntegerConstraint.html,1.1,NONE MOBYMappingElement.html,1.2,NONE MOBYGraphVisitor.html,1.1,NONE MOBYGraph.html,1.2,NONE MOBYOntology.html,1.2,NONE package-use.html,1.2,NONE MOBYNonPositiveIntegerConstraint.html,1.1,NONE MOBYResource.html,1.2,NONE MOBYDateConstrain! t.html,1.1,NONE MOBYNumericConstraint.html,1.1,NONE MOBYEnumeration.html,1.2,NONE MOBYPropertyValueConstraint.html,1.2,NONE MOBYOrderedCollection.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYUnorderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYDocument.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYLiteral.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYObject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYSingleElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYDescriptor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYResizableCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYSubject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYGraphNode.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYFixedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYProviderSet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYProvider.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYPropertyValue.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYPropertyValueException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYPropertyValueStatement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYNonNegativeIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYMappingElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYGraphVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYGraph.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYOntology.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYNonPositiveIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYResource.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYDateConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYNumericConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYEnumeration.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYPropertyValueConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYOrderedCollection.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:57:59 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:50:05 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvxaO017911@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/test Removed Files: package-tree.html package-use.html package-summary.html package-frame.html Test.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test package-tree.html,1.1,NONE package-use.html,1.1,NONE package-summary.html,1.1,NONE package-frame.html,1.1,NONE Test.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/RCS/Test.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:50:07 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0pX018075@pub.open-bio.org> gss Thu Sep 22 12:58:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/parser/class-use Removed Files: Parser.html UnparsableGraphException.html NonCanonicalException.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/class-use Parser.html,1.1,NONE UnparsableGraphException.html,1.1,NONE NonCanonicalException.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/class-use/RCS/Parser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/class-use/RCS/UnparsableGraphException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/class-use/RCS/NonCanonicalException.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:50:13 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0gg018056@pub.open-bio.org> gss Thu Sep 22 12:58:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/graph/class-use Removed Files: MOBYNonNegativeIntegerConstraint.html MOBYPropertyValue.html MOBYDocument.html MOBYSubject.html MOBYSingleElement.html MOBYGraphNode.html MOBYObject.html MOBYResizableCollection.html MOBYDateConstraint.html MOBYCollection.html MOBYProvider.html MOBYEnumeration.html MOBYGraphVisitor.html MOBYDescriptor.html MOBYNumericConstraint.html MOBYUnorderedCollection.html MOBYProviderSet.html MOBYPropertyValueStatement.html MOBYFixedCollection.html MOBYOntology.html MOBYLiteral.html MOBYResource.html MOBYIntegerConstraint.html MOBYGraph.html MOBYPropertyValueException.html MOBYOrderedCollection.html MOBYPropertyValueConstraint.html MOBYNonPositiveIntegerConstraint.html MOBYMappingElement.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use MOBYNonNegativeIntegerConstraint.html,1.1,NONE MOBYPropertyValue.html,1.2,NONE MOBYDocument.html,1.2,NONE MOBYSubject.html,1.2,NONE MOBYSingleElement.html,1.2,NONE MOBYGraphNode.html,1.2,NONE MOBYObject.html,1.2,NONE MOBYResizableCollection.html,1.2,NONE MOBYDateConstraint.html,1.1,NONE MOBYCollection.html,1.2,NONE MOBYProvider.html,1.2,NONE MOBYEnumeration.html,1.2,NONE MOBYGraphVisitor.html,1.1,NONE MOBYDescriptor.html,1.2,NONE MOBYNumericConstraint.html,1.1,NONE MOBYUnorderedCollection.html,1.2,NONE MOBYProviderSet.html,1.2,NONE MOBYPropertyValueStatement.html,1.2,NONE MOBYFixedCollection.html,1.2,NONE MOBYOntology.html,1.2,NONE MOBYLiteral.html,1.2,NONE MOBYResource.html,1.2,NONE MOBYIntegerConstraint.html,1.1,NONE MOBYGraph.html,1.2,NONE MOBYPropertyValueException.html,1.2,NONE MOBYOrderedCollection.html,1.2,NONE MOBYPropertyValueConstraint.html,1.2,NONE MOBYNonPositiveIntege! rConstraint.html,1.1,NONE MOBYMappingElement.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYNonNegativeIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYPropertyValue.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYDocument.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYSubject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYSingleElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYGraphNode.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYObject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYResizableCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYDateConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYProvider.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYEnumeration.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYGraphVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYDescriptor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYNumericConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYUnorderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYProviderSet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYPropertyValueStatement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYFixedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYOntology.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYLiteral.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYResource.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYGraph.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYPropertyValueException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYOrderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYPropertyValueConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYNonPositiveIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYMappingElement.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:50:57 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0E8017937@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/parser Removed Files: package-tree.html NonCanonicalException.html package-use.html UnparsableGraphException.html package-frame.html Parser.html package-summary.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser package-tree.html,1.1,NONE NonCanonicalException.html,1.1,NONE package-use.html,1.1,NONE UnparsableGraphException.html,1.1,NONE package-frame.html,1.1,NONE Parser.html,1.1,NONE package-summary.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/NonCanonicalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/UnparsableGraphException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/Parser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/package-summary.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:51:13 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0JD017955@pub.open-bio.org> gss Thu Sep 22 12:58:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/servlet/class-use Removed Files: AbstractMobyServlet.html ParameterException.html ParamReader.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/class-use AbstractMobyServlet.html,1.2,NONE ParameterException.html,1.2,NONE ParamReader.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/class-use/RCS/AbstractMobyServlet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/class-use/RCS/ParameterException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/class-use/RCS/ParamReader.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:51:21 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0hI017981@pub.open-bio.org> gss Thu Sep 22 12:58:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/http Removed Files: HTTPResponse.html package-frame.html HTTPRequest.html package-use.html package-tree.html package-summary.html HTTPException.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http HTTPResponse.html,1.1,NONE package-frame.html,1.1,NONE HTTPRequest.html,1.1,NONE package-use.html,1.1,NONE package-tree.html,1.1,NONE package-summary.html,1.1,NONE HTTPException.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/HTTPResponse.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/HTTPRequest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/HTTPException.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:54:03 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw1p1018096@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/vocabulary Removed Files: package-tree.html MOBY.html package-use.html VocabularyDescription.html package-summary.html package-frame.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary package-tree.html,1.1,NONE MOBY.html,1.1,NONE package-use.html,1.1,NONE VocabularyDescription.html,1.1,NONE package-summary.html,1.1,NONE package-frame.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/MOBY.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/VocabularyDescription.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/package-frame.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:54:11 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0Ui018007@pub.open-bio.org> gss Thu Sep 22 12:58:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/vocabulary Removed Files: MOBY.html VocabularyDescription.html package-use.html package-frame.html package-summary.html package-tree.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary MOBY.html,1.2,NONE VocabularyDescription.html,1.2,NONE package-use.html,1.2,NONE package-frame.html,1.2,NONE package-summary.html,1.2,NONE package-tree.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/MOBY.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/VocabularyDescription.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/package-tree.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:54:13 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw2GN018229@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/parser Removed Files: package-frame.html package-use.html NonCanonicalException.html package-tree.html package-summary.html Parser.html UnparsableGraphException.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser package-frame.html,1.2,NONE package-use.html,1.2,NONE NonCanonicalException.html,1.2,NONE package-tree.html,1.2,NONE package-summary.html,1.2,NONE Parser.html,1.2,NONE UnparsableGraphException.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/NonCanonicalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/Parser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/UnparsableGraphException.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:54:15 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw2Gm018254@pub.open-bio.org> gss Thu Sep 22 12:58:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/servlet Removed Files: ParameterException.html package-summary.html package-frame.html package-tree.html AbstractMobyServlet.html package-use.html ParamReader.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet ParameterException.html,1.2,NONE package-summary.html,1.2,NONE package-frame.html,1.2,NONE package-tree.html,1.2,NONE AbstractMobyServlet.html,1.2,NONE package-use.html,1.2,NONE ParamReader.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/ParameterException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/AbstractMobyServlet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/ParamReader.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:54:20 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5Ll018423@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/parser/class-use Removed Files: NonCanonicalException.html UnparsableGraphException.html Parser.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/class-use NonCanonicalException.html,1.2,NONE UnparsableGraphException.html,1.2,NONE Parser.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/class-use/RCS/NonCanonicalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/class-use/RCS/UnparsableGraphException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/class-use/RCS/Parser.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:54:22 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5Pw018515@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/http/class-use Removed Files: HTTPRequest.html HTTPException.html HTTPResponse.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/class-use HTTPRequest.html,1.1,NONE HTTPException.html,1.1,NONE HTTPResponse.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/class-use/RCS/HTTPRequest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/class-use/RCS/HTTPException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/class-use/RCS/HTTPResponse.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:54:26 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5Fl018401@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/graph/tools Removed Files: MOBYProviderTraverser.html package-frame.html package-use.html MOBYProviderTraversalException.html package-summary.html package-tree.html MOBYProviderVisitor.html MOBYProviderXMLGenerator.html MOBYProviderVisitorAdapter.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools MOBYProviderTraverser.html,1.1,NONE package-frame.html,1.1,NONE package-use.html,1.1,NONE MOBYProviderTraversalException.html,1.1,NONE package-summary.html,1.1,NONE package-tree.html,1.1,NONE MOBYProviderVisitor.html,1.1,NONE MOBYProviderXMLGenerator.html,1.1,NONE MOBYProviderVisitorAdapter.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/MOBYProviderTraverser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/MOBYProviderTraversalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/MOBYProviderVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/MOBYProviderXMLGenerator.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/MOBYProviderVisitorAdapter.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:54:39 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw17l018182@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use Removed Files: MOBYProviderTraverser.html MOBYProviderXMLGenerator.html MOBYProviderVisitorAdapter.html MOBYProviderVisitor.html MOBYProviderTraversalException.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use MOBYProviderTraverser.html,1.1,NONE MOBYProviderXMLGenerator.html,1.1,NONE MOBYProviderVisitorAdapter.html,1.1,NONE MOBYProviderVisitor.html,1.1,NONE MOBYProviderTraversalException.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use/RCS/MOBYProviderTraverser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use/RCS/MOBYProviderXMLGenerator.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use/RCS/MOBYProviderVisitorAdapter.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use/RCS/MOBYProviderVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use/RCS/MOBYProviderTraversalException.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:54:41 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5Et018493@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/test/class-use Removed Files: Test.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/class-use Test.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/class-use/RCS/Test.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:54:43 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw10i018162@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/index-files Removed Files: index-10.html index-5.html index-18.html index-12.html index-16.html index-2.html index-17.html index-6.html index-3.html index-4.html index-15.html index-8.html index-13.html index-14.html index-1.html index-9.html index-11.html index-7.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files index-10.html,1.3,NONE index-5.html,1.3,NONE index-18.html,1.1,NONE index-12.html,1.3,NONE index-16.html,1.3,NONE index-2.html,1.3,NONE index-17.html,1.1,NONE index-6.html,1.3,NONE index-3.html,1.3,NONE index-4.html,1.3,NONE index-15.html,1.3,NONE index-8.html,1.3,NONE index-13.html,1.3,NONE index-14.html,1.3,NONE index-1.html,1.3,NONE index-9.html,1.3,NONE index-11.html,1.3,NONE index-7.html,1.3,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-10.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-5.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-18.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-12.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-16.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-2.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-17.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-6.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-3.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-4.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-15.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-8.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-13.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-14.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-1.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-9.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-11.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-7.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:06 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:55:37 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw6bw018575@pub.open-bio.org> gss Thu Sep 22 12:58:06 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/vocabulary/class-use Removed Files: VocabularyDescription.html MOBY.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/class-use VocabularyDescription.html,1.1,NONE MOBY.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/class-use/RCS/VocabularyDescription.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/class-use/RCS/MOBY.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 13:04:15 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 13:56:50 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221704.j8MH4FaV018766@pub.open-bio.org> gss Thu Sep 22 13:04:15 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF In directory pub.open-bio.org:/tmp/cvs-serv18741/WebRoot/WEB-INF Modified Files: .cvsignore Log Message: Also ignore lib directory; it is created by the war task in the build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF .cvsignore,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore 2005/09/22 17:04:15 1.3 @@ -1,2 +1,3 @@ classes smoby.properties +lib From gss at pub.open-bio.org Thu Sep 22 13:00:08 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:00:13 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221700.j8MH07RB018682@pub.open-bio.org> gss Thu Sep 22 13:00:07 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build In directory pub.open-bio.org:/tmp/cvs-serv18657/build Modified Files: .cvsignore Log Message: Don't put under CVS control the Javadoc that is generated by the core ant build script moby-live/S-MOBY/ref-impl/core/build .cvsignore,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/.cvsignore 2005/03/21 21:31:31 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/.cvsignore 2005/09/22 17:00:07 1.2 @@ -1 +1,2 @@ classes +javadoc From gss at pub.open-bio.org Thu Sep 22 13:01:24 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:00:23 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221701.j8MH1Ogg018725@pub.open-bio.org> gss Thu Sep 22 13:01:24 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build In directory pub.open-bio.org:/tmp/cvs-serv18700/build Modified Files: build.xml Log Message: Added Javadoc target & supporting classpath ref moby-live/S-MOBY/ref-impl/core/build build.xml,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/03/21 21:31:31 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/09/22 17:01:24 1.2 @@ -17,17 +17,22 @@ + + + + + + + + + + - - - - - - + @@ -38,6 +43,15 @@ filesonly="true"/> + + + + + + + + From gss at pub.open-bio.org Thu Sep 22 12:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:00:25 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw1Bf018121@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/http Removed Files: package-tree.html HTTPException.html package-frame.html HTTPResponse.html HTTPRequest.html package-summary.html package-use.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http package-tree.html,1.2,NONE HTTPException.html,1.2,NONE package-frame.html,1.2,NONE HTTPResponse.html,1.2,NONE HTTPRequest.html,1.2,NONE package-summary.html,1.2,NONE package-use.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/HTTPException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/HTTPResponse.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/HTTPRequest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/package-use.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:00:27 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw1uw018205@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/parser/test Removed Files: package-use.html package-frame.html Test.html package-tree.html ParserTest.html package-summary.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test package-use.html,1.2,NONE package-frame.html,1.2,NONE Test.html,1.2,NONE package-tree.html,1.2,NONE ParserTest.html,1.2,NONE package-summary.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/Test.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/ParserTest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/package-summary.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:00:29 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw29e018275@pub.open-bio.org> gss Thu Sep 22 12:58:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use Removed Files: ParamReader.html AbstractMobyServlet.html ParameterException.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use ParamReader.html,1.1,NONE AbstractMobyServlet.html,1.1,NONE ParameterException.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use/RCS/ParamReader.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use/RCS/AbstractMobyServlet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use/RCS/ParameterException.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:00:32 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw4W2018359@pub.open-bio.org> gss Thu Sep 22 12:58:04 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/parser/test/class-use Removed Files: Test.html ParserTest.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/class-use Test.html,1.1,NONE ParserTest.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/class-use/RCS/Test.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/class-use/RCS/ParserTest.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:00:33 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw2oT018300@pub.open-bio.org> gss Thu Sep 22 12:58:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/tools Removed Files: package-use.html Util.html package-summary.html package-frame.html ModelRetriever.html package-tree.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools package-use.html,1.1,NONE Util.html,1.1,NONE package-summary.html,1.1,NONE package-frame.html,1.1,NONE ModelRetriever.html,1.1,NONE package-tree.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/Util.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/ModelRetriever.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/package-tree.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:00:37 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw21O018319@pub.open-bio.org> gss Thu Sep 22 12:58:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/tools/class-use Removed Files: ModelRetriever.html Util.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/class-use ModelRetriever.html,1.1,NONE Util.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/class-use/RCS/ModelRetriever.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/class-use/RCS/Util.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:00:40 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw2rI018342@pub.open-bio.org> gss Thu Sep 22 12:58:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/tools Removed Files: package-use.html package-frame.html ModelRetriever.html Util.html package-summary.html package-tree.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools package-use.html,1.2,NONE package-frame.html,1.2,NONE ModelRetriever.html,1.1,NONE Util.html,1.2,NONE package-summary.html,1.2,NONE package-tree.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/ModelRetriever.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/Util.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/package-tree.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:00:43 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5ab018376@pub.open-bio.org> gss Thu Sep 22 12:58:04 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/parser/test/class-use Removed Files: ParserTest.html Test.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/class-use ParserTest.html,1.2,NONE Test.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/class-use/RCS/ParserTest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/class-use/RCS/Test.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:00:47 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw56g018443@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/http/class-use Removed Files: HTTPResponse.html HTTPException.html HTTPRequest.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/class-use HTTPResponse.html,1.2,NONE HTTPException.html,1.2,NONE HTTPRequest.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/class-use/RCS/HTTPResponse.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/class-use/RCS/HTTPException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/class-use/RCS/HTTPRequest.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:00:49 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5HV018474@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/servlet Removed Files: AbstractMobyServlet.html package-summary.html package-tree.html ParameterException.html ParamReader.html package-frame.html package-use.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet AbstractMobyServlet.html,1.1,NONE package-summary.html,1.1,NONE package-tree.html,1.1,NONE ParameterException.html,1.1,NONE ParamReader.html,1.1,NONE package-frame.html,1.1,NONE package-use.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/AbstractMobyServlet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/ParameterException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/ParamReader.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/package-use.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:06 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:00:54 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw6QF018534@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/vocabulary/class-use Removed Files: VocabularyDescription.html MOBY.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/class-use VocabularyDescription.html,1.2,NONE MOBY.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/class-use/RCS/VocabularyDescription.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/class-use/RCS/MOBY.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:06 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:00:57 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw6Qc018554@pub.open-bio.org> gss Thu Sep 22 12:58:06 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/tools/class-use Removed Files: ModelRetriever.html Util.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/class-use ModelRetriever.html,1.1,NONE Util.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/class-use/RCS/ModelRetriever.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/class-use/RCS/Util.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:06 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:01:03 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw6gV018592@pub.open-bio.org> gss Thu Sep 22 12:58:06 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/test/class-use Removed Files: Test.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/class-use Test.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/class-use/RCS/Test.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:06 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:01:07 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw66B018610@pub.open-bio.org> gss Thu Sep 22 12:58:06 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/resources In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/resources Removed Files: inherit.gif Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/resources inherit.gif,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/resources/RCS/inherit.gif,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 13:36:48 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:28:40 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221736.j8MHamZt018858@pub.open-bio.org> gss Thu Sep 22 13:36:48 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools In directory pub.open-bio.org:/tmp/cvs-serv18834/archive/WebRoot/tools Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools added to the repository moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 13:36:50 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:28:47 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221736.j8MHaoeN018893@pub.open-bio.org> gss Thu Sep 22 13:36:50 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save In directory pub.open-bio.org:/tmp/cvs-serv18871/WebRoot/save Removed Files: index.html Log Message: Moved potentially useful stuff that isn't needed now to the archive directory moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save index.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save/RCS/index.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 13:36:50 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:28:49 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221736.j8MHaoG5018908@pub.open-bio.org> gss Thu Sep 22 13:36:50 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools In directory pub.open-bio.org:/tmp/cvs-serv18871/archive/WebRoot/tools Added Files: client.html index.html Log Message: Moved potentially useful stuff that isn't needed now to the archive directory moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools client.html,NONE,1.1 index.html,NONE,1.1 From gss at pub.open-bio.org Thu Sep 22 13:37:11 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:28:58 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221737.j8MHbBVH018960@pub.open-bio.org> gss Thu Sep 22 13:37:11 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build In directory pub.open-bio.org:/tmp/cvs-serv18935/build Modified Files: build.xml Log Message: Misc fixes moby-live/S-MOBY/ref-impl/semanticmoby.org/build build.xml,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/09/21 23:08:04 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/09/22 17:37:11 1.3 @@ -55,8 +55,23 @@ + + + + + The file smoby.properties is missing from the WebRoot/WEB-INF + directory. The file smoby.example.properties should be copied + to smoby.properties, which should then be modified to include + appropriate values for database connections, etc. + + + - + - + - + + + + + @@ -86,9 +105,10 @@ - + + From gss at pub.open-bio.org Thu Sep 22 13:37:19 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:29:03 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221737.j8MHbJti018990@pub.open-bio.org> gss Thu Sep 22 13:37:19 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build In directory pub.open-bio.org:/tmp/cvs-serv18965/build Modified Files: build.xml Log Message: Misc fixes moby-live/S-MOBY/ref-impl/core/build build.xml,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/09/22 17:01:24 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/09/22 17:37:19 1.3 @@ -54,7 +54,8 @@ - + + From gss at pub.open-bio.org Thu Sep 22 13:36:50 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:29:38 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221736.j8MHaoEr018925@pub.open-bio.org> gss Thu Sep 22 13:36:50 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save/tools In directory pub.open-bio.org:/tmp/cvs-serv18871/WebRoot/save/tools Removed Files: client.html Log Message: Moved potentially useful stuff that isn't needed now to the archive directory moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save/tools client.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save/tools/RCS/client.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 13:44:13 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu Sep 22 14:35:57 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221744.j8MHiDnd019075@pub.open-bio.org> gss Thu Sep 22 13:44:13 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl In directory pub.open-bio.org:/tmp/cvs-serv19048/S-MOBY/ref-impl Removed Files: .cvsignore INSTALL.html build.xml common.example.properties common.xml servlet.xml Log Message: Removed some files that are no longer needed moby-live/S-MOBY/ref-impl .cvsignore,1.1,NONE INSTALL.html,1.2,NONE build.xml,1.2,NONE common.example.properties,1.1,NONE common.xml,1.2,NONE servlet.xml,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/.cvsignore,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/INSTALL.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/build.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/common.example.properties,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/common.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/servlet.xml,v: No such file or directory From senger at pub.open-bio.org Sat Sep 24 13:41:16 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat Sep 24 14:32:47 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241741.j8OHfGD8030416@pub.open-bio.org> senger Sat Sep 24 13:41:16 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv30397 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.6,1.7 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 13:02:35 1.6 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/24 17:41:16 1.7 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Sat Sep 24 13:51:51 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat Sep 24 14:43:25 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpplv030732@pub.open-bio.org> senger Sat Sep 24 13:51:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv30711/docs Modified Files: ChangeLog Log Message: moby-live/Java/docs ChangeLog,1.43,1.44 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/22 16:07:08 1.43 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/24 17:51:51 1.44 @@ -1,3 +1,8 @@ +2005-09-24 Martin Senger + + * Added sorting to the most of the returned results from + CentralImpl. + 2005-09-23 Martin Senger * Add a new method getFullNamespaces() to CentralDigest interface. From senger at pub.open-bio.org Sat Sep 24 13:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat Sep 24 14:43:37 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpqxq030843@pub.open-bio.org> senger Sat Sep 24 13:51:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv30711/src/main/org/biomoby/service/dashboard/images Added Files: resetButton.gif viewerButton.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images resetButton.gif,NONE,1.1 viewerButton.gif,NONE,1.1 From senger at pub.open-bio.org Sat Sep 24 13:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat Sep 24 14:43:51 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpqoF030888@pub.open-bio.org> senger Sat Sep 24 13:51:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv30711/src/main/org/biomoby/shared Modified Files: MobyDataType.java Log Message: moby-live/Java/src/main/org/biomoby/shared MobyDataType.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/09/22 16:07:09 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/09/24 17:51:52 1.9 @@ -24,7 +24,14 @@ * @version $Id$ */ -public class MobyDataType { +public class MobyDataType implements Comparable { + + public int compareTo (Object obj) { + return name.compareToIgnoreCase ( ((MobyDataType)obj).getName() ); + } + public boolean equals (Object obj) { + return name.equals ( ((MobyDataType)obj).getName() ); + } protected String name; protected String authority = ""; From senger at pub.open-bio.org Sat Sep 24 13:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat Sep 24 14:45:24 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpqCb030910@pub.open-bio.org> senger Sat Sep 24 13:51:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/xmls In directory pub.open-bio.org:/tmp/cvs-serv30711/xmls Modified Files: libraries.xml Log Message: moby-live/Java/xmls libraries.xml,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/libraries.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/09/04 13:45:38 1.4 +++ /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/09/24 17:51:52 1.5 @@ -109,7 +109,7 @@ - + From senger at pub.open-bio.org Sat Sep 24 13:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat Sep 24 14:45:40 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpqYB030862@pub.open-bio.org> senger Sat Sep 24 13:51:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator In directory pub.open-bio.org:/tmp/cvs-serv30711/src/main/org/biomoby/service/generator Modified Files: DataTypesGenerator.java Log Message: moby-live/Java/src/main/org/biomoby/service/generator DataTypesGenerator.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/DataTypesGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/DataTypesGenerator.java 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/DataTypesGenerator.java 2005/09/24 17:51:52 1.2 @@ -437,7 +437,7 @@ * primary concern, that's why it does not throw any exception if * it fails). * - * Put an client-side-image map (HTML hyperlinks) into + * Put a client-side-image map (HTML hyperlinks) into * 'spaceForImageMap' (if you decide to create it). * * Return true if an image file was successfull created (so other @@ -496,7 +496,7 @@ /************************************************************************* * Return true if 'dataTypeName' is a Biomoby primitive type. *************************************************************************/ - protected static boolean isPrimitiveType (String dataTypeName) { + public static boolean isPrimitiveType (String dataTypeName) { return (dataTypeName.equals (MobyTags.MOBYSTRING) || dataTypeName.equals (MobyTags.MOBYINTEGER) || dataTypeName.equals (MobyTags.MOBYFLOAT) || From senger at pub.open-bio.org Sat Sep 24 13:54:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat Sep 24 14:46:23 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241754.j8OHsbpP031039@pub.open-bio.org> senger Sat Sep 24 13:54:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/lib In directory pub.open-bio.org:/tmp/cvs-serv31023/lib Removed Files: alltools2.jar Log Message: moby-live/Java/lib alltools2.jar,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Java/lib/RCS/alltools2.jar,v: No such file or directory From senger at pub.open-bio.org Sat Sep 24 13:54:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat Sep 24 14:46:39 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241754.j8OHsb6r031054@pub.open-bio.org> senger Sat Sep 24 13:54:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv31023/src/main/org/biomoby/service/dashboard Added Files: AbstractModel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard AbstractModel.java,NONE,1.1 From senger at pub.open-bio.org Sat Sep 24 13:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat Sep 24 15:00:00 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHppJ8030770@pub.open-bio.org> senger Sat Sep 24 13:51:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv30711/src/main/org/biomoby/client Modified Files: CentralDigestCachedImpl.java CentralImpl.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralDigestCachedImpl.java,1.7,1.8 CentralImpl.java,1.27,1.28 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/22 16:07:08 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/24 17:51:51 1.8 @@ -16,6 +16,8 @@ import java.util.Iterator; import java.util.Map; import java.util.Vector; +import java.util.Arrays; +import java.util.Comparator; import org.biomoby.shared.CentralAll; import org.biomoby.shared.MobyDataType; @@ -413,6 +415,7 @@ File[] list = dataTypesCache.listFiles(); if (list == null) throw new MobyException (MSG_CACHE_NOT_DIR (dataTypesCache)); + Arrays.sort (list, getFileComparator()); for (int i = 0; i < list.length; i++) { try { @@ -463,6 +466,7 @@ File[] list = servicesCache.listFiles(); if (list == null) throw new MobyException (MSG_CACHE_NOT_DIR (servicesCache)); + Arrays.sort (list, getFileComparator()); for (int i = 0; i < list.length; i++) { try { if (ignored (list[i])) continue; @@ -550,6 +554,17 @@ } /************************************************************************** + * Return a comparator for Files that compares in case-insensitive way. + *************************************************************************/ + protected static Comparator getFileComparator() { + return new Comparator() { + public int compare (Object o1, Object o2) { + return o1.toString().compareToIgnoreCase (o2.toString()); + } + }; + } + + /************************************************************************** * Some file (when being read from a cache directory) are ignored. *************************************************************************/ protected static boolean ignored (File file) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/22 16:07:09 1.27 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/24 17:51:51 1.28 @@ -49,6 +49,8 @@ import java.util.Map; import java.util.Properties; import java.util.Vector; +import java.util.TreeMap; +import java.util.Comparator; /** * A default implementation of the @@ -664,7 +666,7 @@ new Object[] {}); // parse returned XML - Map results = new HashMap(); + Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse(new ByteArrayInputStream(result.getBytes())); @@ -710,7 +712,7 @@ throws MobyException { // parse returned XML - Map results = new HashMap(); + Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse (new ByteArrayInputStream (result.getBytes())); @@ -810,7 +812,7 @@ throws MobyException { // parse returned XML - Map results = new HashMap(); + Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse(new ByteArrayInputStream(result.getBytes()));} @@ -862,7 +864,7 @@ throws MobyException { // parse returned XML - Map results = new HashMap(); + Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse(new ByteArrayInputStream(result.getBytes())); @@ -924,7 +926,7 @@ throws MobyException { // parse returned XML - Map results = new HashMap(); + Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse(new ByteArrayInputStream(result.getBytes())); @@ -944,7 +946,6 @@ } } } - return results; } @@ -1711,4 +1712,16 @@ } throw new MobyException ("No resource found for '" + resourceName + "'."); } + + /************************************************************************** + * Return a case-insensitive comparator of Strings. It is used to + * create various TreeMaps where keys are strings. + *************************************************************************/ + protected static Comparator getStringComparator() { + return new Comparator() { + public int compare (Object o1, Object o2) { + return ((String)o1).compareToIgnoreCase ((String)o2); + } + }; + } } From senger at pub.open-bio.org Sat Sep 24 13:57:06 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat Sep 24 15:00:02 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241757.j8OHv6ue031183@pub.open-bio.org> senger Sat Sep 24 13:57:06 EDT 2005 Update of /home/repository/moby/moby-live/Java/xmls In directory pub.open-bio.org:/tmp/cvs-serv31163/xmls Modified Files: libraries.xml Log Message: moby-live/Java/xmls libraries.xml,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/libraries.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/09/24 17:51:52 1.5 +++ /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/09/24 17:57:06 1.6 @@ -109,7 +109,7 @@ - + From senger at pub.open-bio.org Sat Sep 24 13:51:51 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat Sep 24 15:00:05 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHppc6030747@pub.open-bio.org> senger Sat Sep 24 13:51:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/lib In directory pub.open-bio.org:/tmp/cvs-serv30711/lib Added Files: alltools2.jar Log Message: moby-live/Java/lib alltools2.jar,NONE,1.1 From senger at pub.open-bio.org Sun Sep 25 05:07:22 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 25 05:58:57 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509250907.j8P97M6n011318@pub.open-bio.org> senger Sun Sep 25 05:07:22 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv11299 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.37,1.38 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/22 09:47:43 1.37 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/25 09:07:22 1.38 @@ -112,9 +112,11 @@ + @@ -690,6 +692,7 @@ Targets for local deployment are: deploy-services tomcat-populate + -populate deploy-wsdd -find-services create-wsdd @@ -697,7 +700,7 @@ undeploy-services (TBD: does not work) Targets for remote deployment are: - TBD + deploy-remote --> @@ -922,8 +925,8 @@ - + @@ -994,7 +997,7 @@ - + @@ -1293,7 +1296,7 @@ - + @@ -1350,7 +1353,7 @@ - + From senger at pub.open-bio.org Sun Sep 25 05:07:23 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 25 05:59:00 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509250907.j8P97NLY011365@pub.open-bio.org> senger Sun Sep 25 05:07:22 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv11299/src/webapps Modified Files: remote.deploy.build.xml.template Log Message: moby-live/Java/src/webapps remote.deploy.build.xml.template,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/webapps/remote.deploy.build.xml.template,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/webapps/remote.deploy.build.xml.template 2005/09/22 07:55:44 1.1 +++ /home/repository/moby/moby-live/Java/src/webapps/remote.deploy.build.xml.template 2005/09/25 09:07:22 1.2 @@ -23,6 +23,7 @@ + @@ -183,7 +184,7 @@ - + From senger at pub.open-bio.org Sun Sep 25 05:07:22 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun Sep 25 05:59:35 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509250907.j8P97MGQ011345@pub.open-bio.org> senger Sun Sep 25 05:07:22 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv11299/src/main/org/biomoby/service/dashboard Modified Files: NOTES RegistryModel.java RegistryPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard NOTES,1.6,1.7 RegistryModel.java,1.2,1.3 RegistryPanel.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/24 17:51:51 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/25 09:07:22 1.7 @@ -105,6 +105,24 @@ * general Console panel (save button; various renderes?) * graphics to trees +--- +To put this somewhere (a small "Memory panel" that can be add +anywhere in time of debugging...): + +The heap is the area in memory in which objects are created. + + // Get current size of heap in bytes + long heapSize = Runtime.getRuntime().totalMemory(); + + // Get maximum size of heap in bytes. The heap cannot grow beyond this size. + // Any attempt will result in an OutOfMemoryException. + long heapMaxSize = Runtime.getRuntime().maxMemory(); + + // Get amount of free memory within the heap in bytes. This size will increase + // after garbage collection and decrease as new objects are created. + long heapFreeSize = Runtime.getRuntime().freeMemory(); + +--- TODO generally: --------------- =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/09/24 17:51:51 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/09/25 09:07:22 1.3 @@ -19,6 +19,7 @@ import java.util.HashSet; import java.util.Hashtable; +import java.util.Comparator; import java.util.regex.Pattern; /** @@ -61,6 +62,30 @@ initWorker(); MobyDataType[] dataTypes = worker.getDataTypes(); + java.util.Arrays.sort (dataTypes); + return dataTypes; + } + + /********************************************************************* + * + ********************************************************************/ + public MobyDataType[] getDataTypesByAuthority() + throws MobyException { + + if (worker == null) + initWorker(); + + MobyDataType[] dataTypes = worker.getDataTypes(); + java.util.Arrays.sort + (dataTypes, + new Comparator() { + public int compare (Object o1, Object o2) { + String a1 = ((MobyDataType)o1).getAuthority(); + String a2 = ((MobyDataType)o2).getAuthority(); + return (a1).compareToIgnoreCase ((String)a2); + } + }); + return dataTypes; } @@ -102,21 +127,6 @@ return found; } - -// /********************************************************************* -// * -// ********************************************************************/ -// public MobyDataType[] getDataTypesByAuthority() -// throws MobyException { - -// if (worker == null) -// initWorker(); - -// MobyDataType[] dataTypes = worker.getDataTypes(); -// java.util.Arrays.sort (dataTypes); -// return dataTypes; -// } - /********************************************************************* * ********************************************************************/ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/24 17:51:51 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/25 09:07:22 1.8 @@ -301,35 +301,6 @@ /************************************************************************** * **************************************************************************/ -// protected JPanel getConsole() { -// JPanel p = new JPanel (new GridBagLayout()); - -// JTextArea textArea = new JTextArea(); -// textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); -// textArea.setEditable (false); -// JScrollPane scroller = new JScrollPane (textArea); - -// JButton cleanButton = -// createButton (" Clean ", -// "Remove all messages from the console area", -// KeyEvent.VK_C, -// new ActionListener() { -// public void actionPerformed (ActionEvent e) { -// if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) -// textArea.setText (""); -// } -// }); - -// // put it together -// SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); -// // SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); - -// return p; -// } - - /************************************************************************** - * - **************************************************************************/ class ServicesTree extends CommonTree { public ServicesTree() { super ("Services"); @@ -398,7 +369,10 @@ final SwingWorker worker = new SwingWorker() { public Object construct() { try { - dataTypes = registryModel.getDataTypesByNames(); + if (sorted == SORTED_BY_AUTHORITY) + dataTypes = registryModel.getDataTypesByAuthority(); + else + dataTypes = registryModel.getDataTypesByNames(); } catch (MobyException e) { // TBD: what to do here? System.err.println ("ERROR: " + e.getMessage()); From gss at pub.open-bio.org Sun Sep 25 15:17:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun Sep 25 16:08:52 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251917.j8PJH0dx013037@pub.open-bio.org> gss Sun Sep 25 15:17:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build In directory pub.open-bio.org:/tmp/cvs-serv13012/build Modified Files: build.xml Log Message: Make sure WEB-INF/lib/*.jar gets added to war file moby-live/S-MOBY/ref-impl/semanticmoby.org/build build.xml,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/09/22 17:37:11 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/09/25 19:17:00 1.4 @@ -86,6 +86,11 @@ + + + + + From gss at pub.open-bio.org Sun Sep 25 15:17:29 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun Sep 25 16:09:33 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251917.j8PJHTF7013072@pub.open-bio.org> gss Sun Sep 25 15:17:28 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello In directory pub.open-bio.org:/tmp/cvs-serv13043/WebRoot/examples/hello Modified Files: hello-world.rdf hello-world.n3 Log Message: Changed references to MOBYProvider to MOBYService moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello hello-world.rdf,1.3,1.4 hello-world.n3,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.rdf,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.rdf 2004/11/04 22:28:02 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.rdf 2005/09/25 19:17:28 1.4 @@ -6,24 +6,24 @@ xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > + + + + - - http://www.semanticmoby.org/examples/display-hello-world-results + - Simple example of a Semantic MOBY provider - Semantic MOBY Hello World provider + Simple example of a Semantic MOBY provider + http://www.semanticmoby.org/examples/display-hello-world-results + - - - - - + - + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.n3,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.n3 2004/11/04 22:28:02 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.n3 2005/09/25 19:17:28 1.4 @@ -7,7 +7,7 @@ @prefix xsd: . ex:hello-world - a moby:Provider, exterms:GreetingProvider ; + a moby:Service, exterms:GreetingProvider ; moby:name "Semantic MOBY Hello World provider" ; moby:oneLineDescription "Simple example of a Semantic MOBY provider" ; moby:outputURI "http://www.semanticmoby.org/examples/display-hello-world-results" ; From gss at pub.open-bio.org Sun Sep 25 15:17:58 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun Sep 25 16:09:44 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251917.j8PJHwma013162@pub.open-bio.org> gss Sun Sep 25 15:17:58 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies In directory pub.open-bio.org:/tmp/cvs-serv13077/WebRoot/examples/proxies Modified Files: wormbase-query tair-seqviewer flybase-genequery ncbi-megablast.n3 gramene-query.n3 sgd-quicksearch.n3 tair-seqviewer.n3 tair-mapviewer tair-mapviewer.n3 pubmed ncbi-megablast sgd-quicksearch pubmed.n3 gramene-query wormbase-query.n3 flybase-genequery.n3 Log Message: Changed references to MOBYProvider to MOBYService moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies wormbase-query,1.2,1.3 tair-seqviewer,1.3,1.4 flybase-genequery,1.2,1.3 ncbi-megablast.n3,1.2,1.3 gramene-query.n3,1.2,1.3 sgd-quicksearch.n3,1.3,1.4 tair-seqviewer.n3,1.3,1.4 tair-mapviewer,1.2,1.3 tair-mapviewer.n3,1.2,1.3 pubmed,1.2,1.3 ncbi-megablast,1.2,1.3 sgd-quicksearch,1.3,1.4 pubmed.n3,1.2,1.3 gramene-query,1.2,1.3 wormbase-query.n3,1.2,1.3 flybase-genequery.n3,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query 2005/09/25 19:17:58 1.3 @@ -10,20 +10,20 @@ - - - C. elegans database query at wormbase.org - http://www.wormbase.org/ - - - WormBase Query - + + - - + + + + + WormBase Query + C. elegans database query at wormbase.org + http://www.wormbase.org/ + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer 2005/05/05 17:35:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer 2005/09/25 19:17:58 1.4 @@ -9,21 +9,21 @@ + + + + - + + + TAIR Sequence Viewer Arabidopsis Sequence Viewer service provided by TAIR - - - http://www.arabidopsis.org/servlets/sv - - - - + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > - + =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast.n3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast.n3 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast.n3 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ @prefix xsd: . ex:ncbi-megablast - a moby:Provider, exterms:ProxyProvider, exterms:BlastProvider ; + a moby:Service, exterms:ProxyProvider, exterms:BlastProvider ; moby:name "NCBI Mega BLAST" ; moby:oneLineDescription "NCBI MegaBlast service provided by NCBI" ; moby:inputURI "http://www.ncbi.nlm.nih.gov/BLAST/Blast.cgi?CMD=Web&LAYOUT=TwoWindows&AUTO_FORMAT=Semiauto&ALIGNMENTS=50&ALIGNMENT_VIEW=Tabular&CLIENT=web&DATABASE=nr&DESCRIPTIONS=100&ENTREZ_QUERY=%28none%29&EXPECT=10&FILTER=L&FORMAT_OBJECT=Alignment&FORMAT_TYPE=HTML&NCBI_GI=on&PAGE=MegaBlast&SERVICE=plain&SET_DEFAULTS.x=34&SET_DEFAULTS.y=8&SHOW_OVERVIEW=on&END_OF_HTTPGET=Yes&SHOW_LINKOUT=yes&GET_SEQUENCE=yes&PERC_IDENT=None,1,-2" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query.n3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query.n3 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query.n3 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ @prefix xsd: . ex:gramene-query - a moby:Provider, exterms:ProxyProvider, exterms:CerealGrainSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:CerealGrainSearchProvider ; moby:name "Gramene Query" ; moby:oneLineDescription "Cereal grains database query at gramene.org" ; moby:inputURI "http://www.gramene.org/" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch.n3,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch.n3 2005/05/05 17:35:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch.n3 2005/09/25 19:17:58 1.4 @@ -7,7 +7,7 @@ @prefix xsd: . ex:sgd-quicksearch - a moby:Provider, exterms:ProxyProvider, exterms:SacchromycesSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:SacchromycesSearchProvider ; moby:name "SGD Quick Search" ; moby:oneLineDescription "Saccharomyces cerevisiae quick search" ; moby:inputURI "http://db.yeastgenome.org/cgi-bin/search/quickSearch" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer.n3,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer.n3 2005/05/05 17:35:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer.n3 2005/09/25 19:17:58 1.4 @@ -7,7 +7,7 @@ @prefix xsd: . ex:tair-seqviewer - a moby:Provider, exterms:ProxyProvider, exterms:ArabidopsisSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:ArabidopsisSearchProvider ; moby:name "TAIR Sequence Viewer" ; moby:oneLineDescription "Arabidopsis Sequence Viewer service provided by TAIR" ; moby:inputURI "http://www.arabidopsis.org/servlets/sv" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer 2005/09/25 19:17:58 1.3 @@ -7,22 +7,22 @@ xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > - http://www.arabidopsis.org/servlets/mapper - + + + TAIR Map Viewer Arabidopsis Map Viewer service provided by TAIR + http://www.arabidopsis.org/servlets/mapper - - + + + + - - - - =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer.n3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer.n3 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer.n3 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ @prefix xsd: . ex:tair-mapviewer - a moby:Provider, exterms:ProxyProvider, exterms:ArabidopsisSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:ArabidopsisSearchProvider ; moby:name "TAIR Map Viewer" ; moby:oneLineDescription "Arabidopsis Map Viewer service provided by TAIR" ; moby:inputURI "http://www.arabidopsis.org/servlets/mapper" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed 2005/09/25 19:17:58 1.3 @@ -7,23 +7,23 @@ xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > - + - + - http://www.ncbi.nlm.nih.gov/entrez/query.fcgi? - - Entrez PubMed service provided by NCBI - PubMed + PubMed + Entrez PubMed service provided by NCBI + http://www.ncbi.nlm.nih.gov/entrez/query.fcgi? + - + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast 2005/09/25 19:17:58 1.3 @@ -21,7 +21,7 @@ NCBI Mega BLAST http://www.ncbi.nlm.nih.gov/BLAST/Blast.cgi?CMD=Web&LAYOUT=TwoWindows&AUTO_FORMAT=Semiauto&ALIGNMENTS=50&ALIGNMENT_VIEW=Tabular&CLIENT=web&DATABASE=nr&DESCRIPTIONS=100&ENTREZ_QUERY=%28none%29&EXPECT=10&FILTER=L&FORMAT_OBJECT=Alignment&FORMAT_TYPE=HTML&NCBI_GI=on&PAGE=MegaBlast&SERVICE=plain&SET_DEFAULTS.x=34&SET_DEFAULTS.y=8&SHOW_OVERVIEW=on&END_OF_HTTPGET=Yes&SHOW_LINKOUT=yes&GET_SEQUENCE=yes&PERC_IDENT=None,1,-2 - + NCBI MegaBlast service provided by NCBI =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch 2005/05/05 17:35:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch 2005/09/25 19:17:58 1.4 @@ -7,25 +7,25 @@ xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > - + - - SGD Quick Search - - - http://db.yeastgenome.org/cgi-bin/search/quickSearch - Saccharomyces cerevisiae quick search - - + + + - - - + + + + + SGD Quick Search + Saccharomyces cerevisiae quick search + http://db.yeastgenome.org/cgi-bin/search/quickSearch + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed.n3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed.n3 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed.n3 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ @prefix xsd: . ex:pubmed - a moby:Provider, exterms:ProxyProvider, exterms:PubSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:PubSearchProvider ; moby:name "PubMed" ; moby:oneLineDescription "Entrez PubMed service provided by NCBI" ; moby:inputURI "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query 2005/09/25 19:17:58 1.3 @@ -15,7 +15,7 @@ Gramene Query - + http://www.gramene.org/ =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query.n3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query.n3 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query.n3 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ @prefix xsd: . ex:wormbase-query - a moby:Provider, exterms:ProxyProvider, exterms:ElegansSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:ElegansSearchProvider ; moby:name "WormBase Query" ; moby:oneLineDescription "C. elegans database query at wormbase.org" ; moby:inputURI "http://www.wormbase.org/" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery.n3,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery.n3 2005/05/05 17:30:46 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery.n3 2005/09/25 19:17:58 1.4 @@ -7,7 +7,7 @@ @prefix xsd: . ex:flybase-genequery - a moby:Provider, exterms:ProxyProvider, exterms:DrosophilaSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:DrosophilaSearchProvider ; moby:name "FlyBase Gene Query" ; moby:oneLineDescription "FlyBase gene query form at flybase.bio.indiana.edu" ; moby:inputURI "http://flybase.bio.indiana.edu/genes/fbgquery.hform" ; From gss at pub.open-bio.org Sun Sep 25 15:39:51 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun Sep 25 16:31:17 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251939.j8PJdpEe013293@pub.open-bio.org> gss Sun Sep 25 15:39:51 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib In directory pub.open-bio.org:/tmp/cvs-serv13269/lib Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib added to the repository moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Sun Sep 25 15:40:43 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun Sep 25 16:32:08 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251940.j8PJehVx013393@pub.open-bio.org> gss Sun Sep 25 15:40:43 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF In directory pub.open-bio.org:/tmp/cvs-serv13368/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF Modified Files: .cvsignore Log Message: Don't exclude lib moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF .cvsignore,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore 2005/09/22 17:04:15 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore 2005/09/25 19:40:43 1.4 @@ -1,3 +1,2 @@ -classes smoby.properties -lib +classes From gss at pub.open-bio.org Sun Sep 25 15:41:39 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun Sep 25 16:33:03 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251941.j8PJfdWf013422@pub.open-bio.org> gss Sun Sep 25 15:41:39 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib In directory pub.open-bio.org:/tmp/cvs-serv13401/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib Added Files: postgresql-8.0.309.jdbc3.jar Log Message: Added PostgreSQL lib moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib postgresql-8.0.309.jdbc3.jar,NONE,1.1 From senger at pub.open-bio.org Sat Sep 24 13:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon Sep 26 10:49:46 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpqJI030828@pub.open-bio.org> senger Sat Sep 24 13:51:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv30711/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java CommonTree.java ConsolePanel.java Dashboard.java DashboardPanel.java DashboardProperties.java EventGeneratorPanel.java NOTES RegistryModel.java RegistryPanel.java Added Files: CommonConsole.java CommonNode.java PropertyChannel.java SwingWorker.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard CommonConsole.java,NONE,1.1 CommonNode.java,NONE,1.1 PropertyChannel.java,NONE,1.1 SwingWorker.java,NONE,1.1 AbstractPanel.java,1.5,1.6 CommonTree.java,1.1,1.2 ConsolePanel.java,1.3,1.4 Dashboard.java,1.3,1.4 DashboardPanel.java,1.3,1.4 DashboardProperties.java,1.2,1.3 EventGeneratorPanel.java,1.2,1.3 NOTES,1.5,1.6 RegistryModel.java,1.1,1.2 RegistryPanel.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/18 14:09:42 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/24 17:51:51 1.6 @@ -20,6 +20,7 @@ import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JTextField; +import javax.swing.JComboBox; import javax.swing.JFileChooser; import javax.swing.AbstractButton; import javax.swing.BorderFactory; @@ -49,6 +50,7 @@ import java.io.File; import java.util.prefs.Preferences; +import java.util.Map; /** * WORK IN PROGRESS.

    @@ -81,11 +83,13 @@ // something need to be done only once - keep it here protected Icon panelIcon; protected JComponent pComponent; - protected Icon confirmIcon; + protected static Icon confirmIcon; // re-use "style" components protected static final Insets BREATH_TOP = new Insets (10,0,0,0); + // + protected PropertyChannel propertyChannel; /********************************************************************* * Default constructor (just for the sub-classes). @@ -139,6 +143,14 @@ public void propertyChange (PropertyChangeEvent event) { } + /************************************************************************** + * Remember a property channel and register itself to it as a listener. + **************************************************************************/ + protected void setPropertyChannel (PropertyChannel propertyChannel) { + this.propertyChannel = propertyChannel; + propertyChannel.addPropertyChangeListener (this); + } + // // Abstract methods // @@ -146,7 +158,7 @@ /************************************************************************** * **************************************************************************/ - abstract public JComponent getComponent(); + abstract public JComponent getComponent (PropertyChannel propertyChannel); /************************************************************************** * @@ -228,23 +240,16 @@ /********************************************************************* * Create a panel with given text field and with a directory/file * browser button attached. - * - * @param chooserMode should be one of - * JFileChooser.DIRECTORIES_ONLY, JFileChooser.FILES_ONLY, and - * JFileChooser.FILES_AND_DIRECTORIES (but it is not tested) ********************************************************************/ protected JFileChooserWithHistory createFileSelector (String chooserTitle, String approveButtonText, - int chooserMode, String defaultValue, - FileFilter filter) { + String preferenceNode, + String eventName) { JFileChooserWithHistory chooser = - new JFileChooserWithHistory (null, this, "cacheDirectory"); + new JFileChooserWithHistory (null, this, preferenceNode); JFileChooser ch = chooser.getFileChooser(); - ch.setFileSelectionMode (chooserMode); - if (filter != null) - ch.setFileFilter (filter); ch.setApproveButtonText (approveButtonText); ch.setDialogTitle (chooserTitle); @@ -252,10 +257,57 @@ chooser.getSelectedFile() == null) chooser.setSelectedFile (new File (defaultValue)); + if (eventName != null) { + JTextFieldWithHistory textField = chooser.getTextField(); + textField.addActionListener (getTextFieldListener (eventName)); + String text = textField.getText(); + if (UUtils.notEmpty (text)) + propertyChannel.put (eventName, text); + } + return chooser; } /********************************************************************* + * Create a text field (possibly with an 'initValue' with history + * taken from given 'preferenceNode'. If 'evenName' is not null + * (which means that the contens of this text filed may be of + * interest of someone outside), add an action event that will + * update the shared property storage (a global variable + * 'propertyChannel') when the text field changes its value. + ********************************************************************/ + protected JTextFieldWithHistory createText (String initValue, + String preferenceNode, + String eventName) { + JTextFieldWithHistory textField = + new JTextFieldWithHistory (initValue, + this, + preferenceNode); + if (eventName != null) { + textField.addActionListener (getTextFieldListener (eventName)); + String text = textField.getText(); + if (UUtils.notEmpty (text)) + propertyChannel.put (eventName, text); + } + + return textField; + } + + /********************************************************************* + * + ********************************************************************/ + private ActionListener getTextFieldListener (String eventName) { + final String name = eventName; + return new ActionListener() { + public void actionPerformed (ActionEvent e) { + String contents = ((JTextFieldWithHistory)e.getSource()).getText(); + propertyChannel.put (name, contents); + } + }; + } + + + /********************************************************************* * ********************************************************************/ protected boolean getPrefValue (String key, @@ -276,11 +328,11 @@ /********************************************************************* * Return true if confirmation dialog passed. ********************************************************************/ - public boolean confirm (Object msg) { + public static boolean confirm (Object msg) { if (confirmIcon == null) confirmIcon = SwingUtils.createIcon ("images/confirmButton.gif", Dashboard.class); - return SwingUtils.confirm (this, msg, confirmIcon); + return SwingUtils.confirm (null, msg, confirmIcon); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/09/18 08:46:26 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/09/24 17:51:51 1.2 @@ -8,20 +8,35 @@ package org.biomoby.service.dashboard; +import org.tulsoft.shared.UUtils; +import org.tulsoft.tools.gui.SwingUtils; + import javax.swing.JTree; import javax.swing.JLabel; import javax.swing.JScrollPane; import javax.swing.Icon; +import javax.swing.JPopupMenu; +import javax.swing.JOptionPane; +import javax.swing.JMenuItem; +import javax.swing.ToolTipManager; +import javax.swing.AbstractAction; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreeSelectionModel; import javax.swing.tree.TreePath; +import javax.swing.event.TreeSelectionListener; +import javax.swing.event.TreeSelectionEvent; import java.awt.Component; import java.awt.Font; +import java.awt.event.ActionEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; + +import java.util.HashSet; +import java.util.Enumeration; // import java.beans.PropertyChangeListener; // import java.beans.PropertyChangeEvent; @@ -40,6 +55,15 @@ public class CommonTree extends JTree { + // some shared constants + final static protected int SORTED_BY_NAME = 0; + final static protected int SORTED_BY_AUTHORITY = 1; + + // tree components + protected JPopupMenu popup; + protected Icon searchIcon; + protected String lastSearchText = ""; + // protected PropertyChangeSupport support; // protected boolean expanded = true; // the status of the application list @@ -47,34 +71,48 @@ * Constructor ********************************************************************/ public CommonTree (String rootNode) { - super (new DefaultTreeModel (new DefaultMutableTreeNode (rootNode))); + super (new DefaultTreeModel (new DefaultMutableTreeNode (new CommonNode (rootNode)))); // create an almost empty tree, only with a root node that // contains just a String holding the name of the root node; - // the tree will be populated later by calling 'updateTree()' - setFont (new Font ("Dialog", Font.PLAIN, 10)); +// setFont (new Font ("Dialog", Font.PLAIN, 10)); putClientProperty ("JTree.lineStyle", "Angled"); setCellRenderer (new CommonTreeCellRenderer()); getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); - addMouseListener (new MouseAdapter() { - public void mouseClicked (MouseEvent e) { - TreePath selPath = getPathForLocation (e.getX(), e.getY()); - if (e.getClickCount() == 1) - onSelected (selPath); +// addMouseListener (new MouseAdapter() { +// public void mouseClicked (MouseEvent e) { +// TreePath selPath = getPathForLocation (e.getX(), e.getY()); +// if (e.getClickCount() == 1) +// onSelected (selPath); +// } +// }); + + // listen for when the selection changes + addTreeSelectionListener ( new TreeSelectionListener() { + public void valueChanged (TreeSelectionEvent e) { + DefaultMutableTreeNode node = + (DefaultMutableTreeNode)getLastSelectedPathComponent(); + if (node == null) return; + selected (node); } }); + + // enable tool tips + ToolTipManager.sharedInstance().registerComponent (this); } // - // I want to display the empty modules with the same icon as - // 'closed' tree branches - therefore I need my own cell renderer - // (also it is suitable for new leaf icon) - // class CommonTreeCellRenderer extends DefaultTreeCellRenderer { + HashSet toBeHighlighted; + + public void setToBeHighlighted (HashSet toBeHighlighted) { + this.toBeHighlighted = toBeHighlighted; + } + public Component getTreeCellRendererComponent (JTree tree, java.lang.Object value, boolean selected, @@ -88,40 +126,170 @@ // Component c = super.getTreeCellRendererComponent (tree, value, selected, expanded, leaf, row, hasFocus); + // add a tool-tip for the root node + if (row == 0) { + setToolTipText ("Right-click will show other options"); + setFont (new Font ("Dialog", Font.BOLD, 12)); + } else { + setToolTipText (null); + setFont (new Font ("Dialog", Font.PLAIN, 10)); + } + // TBD: whale icon? // if (leaf) // ((JLabel)c).setIcon (icons [COMPUTER]); + + // do highlight + Object userObject = ((DefaultMutableTreeNode)value).getUserObject(); + CommonNode nodeObject = (CommonNode)userObject; + if (toBeHighlighted != null && toBeHighlighted.contains (nodeObject.getValue())) + setText ("" + nodeObject + ""); + return c; } } + /********************************************************************* + * Put this tree in a scrollable pane. + ********************************************************************/ public JScrollPane scrollable() { return new JScrollPane (this); } /********************************************************************* - * onAppSelected() - * When an application name is selected it will fire a - * PropertyChange event with SELECTED_BY_NAME property. The value of - * the property will be an instance of Hashtable carrying: - * - module name as MODULE_NAME, - * - application name as APP_NAME, and - * - an this instance as ALBEAN_LIST - ********************************************************************/ - protected void onSelected (TreePath path) { -// if (path == null) return; -// DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent(); -// if (path.getPathCount() < 3) return; // we need to be on an application name -// String appName = (String)node.getUserObject(); -// DefaultMutableTreeNode parent = (DefaultMutableTreeNode)node.getParent(); -// String module = (String)parent.getUserObject(); -// Hashtable result = new Hashtable(); -// result.put (ALBeanListWithGUI.MODULE_NAME, module); -// result.put (ALBeanListWithGUI.APP_NAME, appName); -// result.put (ALBeanListWithGUI.ALBEAN_LIST, this); -// support.firePropertyChange (ALBeanListWithGUI.SELECTED_BY_NAME, null, result); + * Called when a tree node is selected. Does nothing here + ********************************************************************/ + protected void selected (DefaultMutableTreeNode node) { + } + + /********************************************************************* + * Create a popup object with common items. Subclasses can (and + * usually do) add more items, or re-created the whole popup.

    + * + * @param title is given to the popups + ********************************************************************/ + protected void createPopups (String title) { + popup = new JPopupMenu (title); + popup.add + (new JMenuItem (new AbstractAction ("Search") { + public void actionPerformed (ActionEvent e) { + String searchText = searchDialog(); + if (searchText != null) + search (searchText); + } + })); + popup.add + (new JMenuItem (new AbstractAction ("Expand all nodes") { + public void actionPerformed (ActionEvent e) { + expand(); + } + })); + popup.add + (new JMenuItem (new AbstractAction ("Collaps all nodes") { + public void actionPerformed (ActionEvent e) { + collapse(); + } + })); + + // add listener to this tree to bring up popup menus + MouseListener popupListener = new PopupListener(); + addMouseListener (popupListener); + } + + class PopupListener extends MouseAdapter { + public void mousePressed (MouseEvent e) { + maybeShowPopup (e); + } + public void mouseReleased (MouseEvent e) { + maybeShowPopup (e); + } + private void maybeShowPopup (MouseEvent e) { + if (e.isPopupTrigger() && popup.isEnabled()) { + popup.show (e.getComponent(), + e.getX(), e.getY()); + } + } + } + + /********************************************************************* + * Collapse all nodes, starting from the root.

    + ********************************************************************/ + protected void collapse() { + SwingUtils.collapseTree (this, (DefaultMutableTreeNode)getModel().getRoot()); + } + + /********************************************************************* + * Expand all nodes, starting from the root.

    + ********************************************************************/ + protected void expand() { +// SwingUtils.expandTree (this, (DefaultMutableTreeNode)getModel().getRoot()); + + + final SwingWorker worker = new SwingWorker() { + public Object construct() { + SwingUtils.expandTree (CommonTree.this, (DefaultMutableTreeNode)getModel().getRoot()); + return null; // not used here + } + // runs on the event-dispatching thread. + public void finished() { + repaint(); + } + }; + worker.start(); + + } + + /********************************************************************* + * Search underlying objects and highligh nodes corresponding to + * the found objects. But it does nothing here - it is supposed to + * be overwritten by a concrete tree. + ********************************************************************/ + protected void search (String searchText) { + System.out.println ("Search text: " + searchText); + } + + /********************************************************************* + * Show a dialog asking for a search string, and return it. Or + * return null if user cancel the dialog. + ********************************************************************/ + protected String searchDialog() { + if (searchIcon == null) + searchIcon = + SwingUtils.createIcon ("images/viewerButton.gif", Dashboard.class); + + String result = (String)JOptionPane.showInputDialog + (null, + "The search will highlight nodes in this tree that\n" + + "contain (or are related to) the text you enter here.\n" + + "Text is treated as a regular expression. The case-\n" + + "insensitivity is, however, always added by default.\n \n" + + "For example, try: germplasm or mark|kawas.\n \n", + "Search", + JOptionPane.OK_CANCEL_OPTION, + searchIcon, + null, + lastSearchText); + if (result != null) + lastSearchText = result; + return result; + } + + protected void highlightAndJumpTo (HashSet toBeHighlighted) { + + CommonTreeCellRenderer r = (CommonTreeCellRenderer)getCellRenderer(); + r.setToBeHighlighted (toBeHighlighted); + collapse (); + DefaultTreeModel tModel = (DefaultTreeModel)getModel(); + DefaultMutableTreeNode root = (DefaultMutableTreeNode)tModel.getRoot(); + Enumeration en = root.depthFirstEnumeration(); + while (en.hasMoreElements()) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode)en.nextElement(); + if (toBeHighlighted.contains (node.getUserObject().toString())) { + makeVisible (new TreePath (tModel.getPathToRoot (node))); + } + } } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/18 14:09:42 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/24 17:51:51 1.4 @@ -15,7 +15,7 @@ import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JScrollPane; -import javax.swing.JTextArea; +// import javax.swing.JTextArea; import javax.swing.JPanel; import javax.swing.text.html.HTMLDocument; @@ -28,6 +28,7 @@ import java.beans.PropertyChangeEvent; import java.util.Date; +import java.util.Map; /** * A debugging panel. It tries to listen to as many events it can, and @@ -42,13 +43,13 @@ public class ConsolePanel extends AbstractPanel { - JTextArea textArea = null; + CommonConsole console; /********************************************************************* * propertyChange() ********************************************************************/ public void propertyChange (PropertyChangeEvent e) { - if (textArea == null) return; // I am not yet ready + if (console == null) return; // I am not yet ready String prop = e.getPropertyName(); if (prop == null) return; // no interest in non-specific changes @@ -57,8 +58,7 @@ if (value == null) return; // no interest in non-defined new values if (prop.equalsIgnoreCase (DP_LOG_MSG)) { - textArea.append (value.toString()); - textArea.append ("\n"); + console.setText (value.toString() + "\n"); } else { StringBuffer buf = new StringBuffer(); Object source = e.getSource(); @@ -69,38 +69,43 @@ } buf.append (" at "); buf.append (new Date().toString()); - textArea.append ("PROPERTY: " + prop + buf + "\n"); - textArea.append ("VALUE: " + value.toString() + "\n\n"); + console.setText ("PROPERTY: " + prop + buf + "\n" + + "VALUE: " + value.toString() + "\n\n"); } } /************************************************************************** * **************************************************************************/ - public JComponent getComponent() { - JPanel p = new JPanel (new GridBagLayout(), true); + public JComponent getComponent (PropertyChannel propertyChannel) { + setPropertyChannel (propertyChannel); - textArea = new JTextArea (24, 80); - textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); - textArea.setEditable (false); - JScrollPane scroller = new JScrollPane (textArea); - - JButton cleanButton = - createButton (" Clean ", - "Remove all messages from the console area", - KeyEvent.VK_C, - new ActionListener() { - public void actionPerformed (ActionEvent e) { - if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) - textArea.setText (""); - } - }); - - // put it together - SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); - SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); + console = new CommonConsole(); + return console; - return p; +// JPanel p = new JPanel (new GridBagLayout(), true); + +// textArea = new JTextArea (24, 80); +// textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); +// textArea.setEditable (false); +// JScrollPane scroller = new JScrollPane (textArea); + +// JButton cleanButton = +// createButton (" Clean ", +// "Remove all messages from the console area", +// KeyEvent.VK_C, +// new ActionListener() { +// public void actionPerformed (ActionEvent e) { +// if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) +// textArea.setText (""); +// } +// }); + +// // put it together +// SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); +// SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); + +// return p; } /************************************************************************** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/18 14:09:42 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/24 17:51:51 1.4 @@ -34,6 +34,7 @@ import java.util.Vector; import java.util.Enumeration; import java.util.Properties; +import java.util.Hashtable; import java.util.Date; import java.net.URL; import java.text.DateFormat; @@ -54,6 +55,7 @@ public static boolean useLoadMonitor = true; protected JTabbedPane tabbedPane; protected DashboardPanel[] panels; + protected PropertyChannel propertyChannel; protected static Properties dashboardProperties; static { @@ -84,7 +86,8 @@ **************************************************************************/ public Dashboard() { loadPanels(); - dashboard = getComponent(); + propertyChannel = new PropertyChannel(); + dashboard = getComponent (propertyChannel); connectPanels(); } @@ -103,14 +106,14 @@ /************************************************************************** * Connect all available Dashboard panels: a) together, and b) - * with the status bar. + * with the status bar. TBD: It changed... It uses now a PropertyChannel... **************************************************************************/ public void connectPanels() { for (int i = 0; i < panels.length; i++) { - for (int j = 0; j < i; j++) - panels[i].addPropertyChangeListener (panels[j]); - for (int j = i+1; j < panels.length; j++) - panels[i].addPropertyChangeListener (panels[j]); +// for (int j = 0; j < i; j++) +// panels[i].addPropertyChangeListener (panels[j]); +// for (int j = i+1; j < panels.length; j++) +// panels[i].addPropertyChangeListener (panels[j]); if (statusBar != null) panels[i].addPropertyChangeListener (statusBar); } @@ -120,7 +123,8 @@ * Show the main frame. **************************************************************************/ public void show() { - JFrame frame = SwingUtils.createMainFrame (getComponent(), getName()); + JFrame frame = SwingUtils.createMainFrame (getComponent (propertyChannel), + getName()); SwingUtils.showMainFrame (frame, dashboard.getPreferredSize()); } @@ -182,7 +186,7 @@ /************************************************************************** * **************************************************************************/ - public JComponent getComponent() { + public JComponent getComponent (PropertyChannel propertyChannel) { if (dashboard != null) return dashboard; @@ -202,7 +206,9 @@ String name = panels[i].getName(); if (useLoadMonitor) ProgressView.monitor.setTextAndAdd ("Loading " + name + "..."); - tabbedPane.addTab (name, panels[i].getIcon(), panels[i].getComponent()); + tabbedPane.addTab (name, + panels[i].getIcon(), + panels[i].getComponent (propertyChannel)); } statusBar = getStatusBar(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/18 08:46:26 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/24 17:51:51 1.4 @@ -32,9 +32,12 @@ extends PropertyChangeListener, DashboardProperties { /************************************************************************** - * Return a graphical representation of this panel. + * Return a graphical representation of this panel.

    + * + * @param propertyChannel is a shared storage for properties + * @return a GUI representing this panel **************************************************************************/ - JComponent getComponent(); + JComponent getComponent (PropertyChannel propertyChannel); /************************************************************************** * A name identifies a panel in the dashboard's tabs. It should be =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/09/18 08:46:26 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/09/24 17:51:51 1.3 @@ -27,11 +27,17 @@ public interface DashboardProperties { + // names of properties used in property change events static final String DP_LOG_MSG = "log-msg"; static final String DP_STATUS_MSG = "status-msg"; static final String DP_SERVICE_NAME = "dp-service-name"; static final String DP_DATATYPE_NAME = "dp-datatype-name"; + // names of properties used in property channel storage + static final String DP_REGISTRY_ENDPOINT = "dp-registry-endpoint"; + static final String DP_REGISTRY_NAMESPACE = "dp-registry-namespace"; + static final String DP_CACHE_DIR = "dp-cache-dir"; + /** A filename containing Java properties that configure the dashboard. */ static final String DASHBOARD_PROPERTIES_FILE = "dashboard.properties"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java 2005/09/18 08:46:26 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java 2005/09/24 17:51:51 1.3 @@ -25,6 +25,8 @@ import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; +import java.util.Map; + /** * A debugging panel. It generates some events.

    * @@ -40,7 +42,9 @@ /************************************************************************** * **************************************************************************/ - public JComponent getComponent() { + public JComponent getComponent (PropertyChannel propertyChannel) { + setPropertyChannel (propertyChannel); + JPanel p = new JPanel (new GridBagLayout(), true); JLabel desc = @@ -81,7 +85,8 @@ // private void onFire (String propertyName, String value) { - support.firePropertyChange (propertyName, null, value); + propertyChannel.put (propertyName, value); +// support.firePropertyChange (propertyName, null, value); } /************************************************************************** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/22 16:07:09 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/24 17:51:51 1.6 @@ -1,3 +1,123 @@ +invokeLater() +------------- +/** + * Create the GUI and show it. For thread safety, + * this method should be invoked from the + * event-dispatching thread. + */ +private static void createAndShowGUI() { + //Make sure we have nice window decorations. + JFrame.setDefaultLookAndFeelDecorated(true); + + //Create and set up the window. + frame = new JFrame("FocusConceptsDemo"); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + //Create and set up the content pane. + JComponent newContentPane = new FocusConceptsDemo(); + newContentPane.setOpaque(true); //content panes must be opaque + frame.setContentPane(newContentPane); + + //Display the window. + frame.pack(); + frame.setVisible(true); +} +public static void main(String[] args) { + //Schedule a job for the event-dispatching thread: + //creating and showing this application's GUI. + javax.swing.SwingUtilities.invokeLater(new Runnable() { + public void run() { + createAndShowGUI(); + } + }); + +invokeAndWait(): +---------------- +void printTextField() throws Exception { + final String[] myStrings = new String[2]; + + Runnable getTextFieldText = new Runnable() { + public void run() { + myStrings[0] = textField0.getText(); + myStrings[1] = textField1.getText(); + } + }; + SwingUtilities.invokeAndWait(getTextFieldText); + + System.out.println(myStrings[0] + " " + myStrings[1]); +} + +SwingWorker: +------------ + +//BETTER CODE: +public void actionPerformed(ActionEvent e) { + ... + final SwingWorker worker = new SwingWorker() { + public Object construct() { + //...code that might take a while to execute is here... + return someValue; + } + }; + worker.start(); //required for SwingWorker 3 + ... +} + +using finished: + +public void actionPerformed(ActionEvent e) { + ... + if (icon == null) { //haven't viewed this photo before + loadImage(imagedir + pic.filename, current); + } else { + updatePhotograph(current, pic); + } +} +... +//Load an image in a separate thread. +private void loadImage(final String imagePath, final int index) { + final SwingWorker worker = new SwingWorker() { + ImageIcon icon = null; + + public Object construct() { + icon = new ImageIcon(getURL(imagePath)); + return icon; //return value not used by this program + } + + //Runs on the event-dispatching thread. + public void finished() { + Photo pic = (Photo)pictures.elementAt(index); + pic.setIcon(icon); + if (index == current) + updatePhotograph(index, pic); + } + }; + worker.start(); +} + + +---- + +* error messages (dialog window, or a text-area window/save button, something on sterrr?) +? logging (LogPanel and/or usual logging to a file?) +* communication with StatusBar (incl. progress bar, cancel button) +* disabling things during a long-time operation +* general Console panel (save button; various renderes?) +* graphics to trees + + +TODO generally: +--------------- + +* notice that the dasboard is used the first time and offer ti create +a list of wanted panels (some of them are suggested as default) + +* notice that user does not use cache (and that he did not select "do +not check it at startup") and tell him "do you want a cache?" + +* BUG: not sure why so many (repeated) changes from the actionlistener +in JFieldTextWithHistory + TODO with views: ---------------- * change onMethods() to be protected or even private... =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/09/19 08:09:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/09/24 17:51:51 1.2 @@ -8,8 +8,18 @@ package org.biomoby.service.dashboard; +import org.biomoby.shared.MobyException; +import org.biomoby.shared.MobyDataType; +import org.biomoby.shared.CentralAll; +import org.biomoby.client.CentralDigestCachedImpl; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeSupport; + +import java.util.HashSet; +import java.util.Hashtable; +import java.util.regex.Pattern; /** * A real worker that supplies all data to the {@link @@ -20,17 +30,108 @@ * @version $Id$ */ -public class RegistryModel { +public class RegistryModel + extends AbstractModel { + + CentralAll worker; + Hashtable dataTypesTable; /********************************************************************* * Default constructor. ********************************************************************/ public RegistryModel() { + super(); + } + + /********************************************************************* + * Usual constructor that shares support for property changes with + * its creator. + ********************************************************************/ + public RegistryModel (PropertyChangeSupport support) { + super (support); + } + + /********************************************************************* + * + ********************************************************************/ + public MobyDataType[] getDataTypesByNames() + throws MobyException { + + if (worker == null) + initWorker(); + + MobyDataType[] dataTypes = worker.getDataTypes(); + return dataTypes; } /********************************************************************* * ********************************************************************/ + public MobyDataType getDataType (String dataTypeName) + throws MobyException { + if (dataTypeName == null) + return null; + + MobyDataType[] dataTypes = getDataTypesByNames(); + + if (dataTypesTable == null) { + dataTypesTable = new Hashtable(); + for (int i = 0; i < dataTypes.length; i++) { + dataTypesTable.put (dataTypes[i].getName(), dataTypes[i]); + } + } + return (MobyDataType)dataTypesTable.get (dataTypeName); + } + + /********************************************************************* + * Return a HashSet filled with names of data types that have + * somewhere given 'searchText'. Add case-insensitivity to the + * regular expression in 'searchText'. + ********************************************************************/ + public HashSet find (String searchText) + throws MobyException { + HashSet found = new HashSet(); + MobyDataType[] dataTypes = getDataTypesByNames(); + if (! searchText.startsWith ("(?i)")) + searchText = "(?i)" + searchText; + Pattern pattern = Pattern.compile (searchText); + for (int i = 0; i < dataTypes.length; i++) { + if (pattern.matcher (dataTypes[i].toString()).find()) + found.add (dataTypes[i].getName()); + } + return found; + } + + +// /********************************************************************* +// * +// ********************************************************************/ +// public MobyDataType[] getDataTypesByAuthority() +// throws MobyException { + +// if (worker == null) +// initWorker(); + +// MobyDataType[] dataTypes = worker.getDataTypes(); +// java.util.Arrays.sort (dataTypes); +// return dataTypes; +// } + + /********************************************************************* + * + ********************************************************************/ + protected void initWorker() + throws MobyException { + String registryURL = propertyChannel.getString (DP_REGISTRY_ENDPOINT); + String registryNS = propertyChannel.getString (DP_REGISTRY_NAMESPACE); +// String cacheDir = propertyChannel.getString (DP_CACHE_DIR); + String cacheDir = "/home/senger/jMoby/myCache"; +// cacheDir = null; + + worker = new CentralDigestCachedImpl (registryURL, + registryNS, + cacheDir); + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/19 08:08:32 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/24 17:51:51 1.7 @@ -8,6 +8,13 @@ package org.biomoby.service.dashboard; +import org.biomoby.shared.MobyException; +import org.biomoby.shared.Central; +import org.biomoby.shared.MobyDataType; +import org.biomoby.shared.MobyRelationship; +import org.biomoby.service.generator.DataTypesGenerator; + +import org.tulsoft.shared.UUtils; import org.tulsoft.tools.gui.SwingUtils; import org.tulsoft.tools.gui.JTextFieldWithHistory; import org.tulsoft.tools.gui.JFileChooserWithHistory; @@ -21,19 +28,33 @@ import javax.swing.JSplitPane; import javax.swing.JScrollPane; import javax.swing.JTextArea; +import javax.swing.JPopupMenu; +import javax.swing.JMenuItem; +import javax.swing.JCheckBoxMenuItem; +import javax.swing.AbstractAction; import javax.swing.JComponent; import javax.swing.text.html.HTMLDocument; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; import java.awt.GridBagLayout; import java.awt.Font; - import java.awt.event.KeyEvent; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseAdapter; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; +import java.util.Map; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Enumeration; +import java.util.Vector; /** * A panel displaying contents of a Biomoby registry. It also select @@ -58,6 +79,7 @@ // components that are used from more methods JFileChooserWithHistory cacheDir; JLabel labelCacheDir; + CommonConsole console; /********************************************************************* * propertyChange() @@ -78,14 +100,16 @@ ********************************************************************/ public RegistryPanel() { super(); -// registryModel = new RegistryModel (this); - registryModel = new RegistryModel(); + registryModel = new RegistryModel (support); } /************************************************************************** * **************************************************************************/ - public JComponent getComponent() { + public JComponent getComponent (PropertyChannel propertyChannel) { + setPropertyChannel (propertyChannel); + registryModel.setPropertyChannel (propertyChannel); + if (pComponent != null) return pComponent; @@ -94,6 +118,7 @@ // ontology trees ServicesTree servicesTree = new ServicesTree(); DataTypesTree dataTypesTree = new DataTypesTree(); + dataTypesTree.update (CommonTree.SORTED_BY_NAME); NamespacesTree namespacesTree = new NamespacesTree(); JSplitPane split1 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, @@ -110,7 +135,8 @@ split2.setOneTouchExpandable (true); // console panel - JPanel console = getConsole(); + console = new CommonConsole(); + console.setAppendMode (false); JSplitPane split3 = new JSplitPane (JSplitPane.VERTICAL_SPLIT, split2, @@ -177,10 +203,10 @@ protected JPanel getRegistryLocation() { JLabel labelRegistryURL = new JLabel("Endpoint"); JTextFieldWithHistory registryURL = - new JTextFieldWithHistory ("", this, "registryEndpoint"); + createText ("", "registryEndpoint", DP_REGISTRY_ENDPOINT); JLabel labelRegistryNS = new JLabel("Namespace (URI)"); JTextFieldWithHistory registryNS = - new JTextFieldWithHistory ("", this, "registryNamespace"); + createText ("", "registryNamespace", DP_REGISTRY_NAMESPACE); JButton reloadAllButton = createButton (" Reload all ", "Reload all ontology trees from the Biomoby registry", @@ -226,9 +252,11 @@ labelCacheDir = new JLabel("Cache directory"); cacheDir = createFileSelector ("Select directory for/with local cache", "Select", - JFileChooser.DIRECTORIES_ONLY, System.getProperty ("java.io.tmpdir"), - null); + "cacheDirectory", + DP_CACHE_DIR); + cacheDir.getFileChooser().setFileSelectionMode (JFileChooser.DIRECTORIES_ONLY); + onUseCache (usingCache); JButton infoButton = createButton (" Info ", @@ -273,13 +301,13 @@ /************************************************************************** * **************************************************************************/ - protected JPanel getConsole() { - JPanel p = new JPanel (new GridBagLayout()); +// protected JPanel getConsole() { +// JPanel p = new JPanel (new GridBagLayout()); - JTextArea textArea = new JTextArea(); - textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); - textArea.setEditable (false); - JScrollPane scroller = new JScrollPane (textArea); +// JTextArea textArea = new JTextArea(); +// textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); +// textArea.setEditable (false); +// JScrollPane scroller = new JScrollPane (textArea); // JButton cleanButton = // createButton (" Clean ", @@ -292,12 +320,12 @@ // } // }); - // put it together - SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); -// SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); +// // put it together +// SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); +// // SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); - return p; - } +// return p; +// } /************************************************************************** * @@ -312,11 +340,277 @@ * **************************************************************************/ class DataTypesTree extends CommonTree { + MobyDataType[] dataTypes = null; + int lastSorted = SORTED_BY_NAME; + boolean hideBadGuys = false; + boolean showMembers = false; + JCheckBoxMenuItem hideBox; + public DataTypesTree() { super ("DataTypes"); + createPopups ("Data Types Menu"); + } + + protected void createPopups (String title) { + super.createPopups (title); + popup.addSeparator(); + popup.add + (new JMenuItem (new AbstractAction ("Sort by names") { + public void actionPerformed (ActionEvent e) { + update (lastSorted = SORTED_BY_NAME); + hideBox.setEnabled (true); + } + })); + popup.add + (new JMenuItem (new AbstractAction ("Sort by authorities") { + public void actionPerformed (ActionEvent e) { + update (lastSorted = SORTED_BY_AUTHORITY); + hideBox.setEnabled (false); + } + })); + popup.addSeparator(); + + JCheckBoxMenuItem showBox = new JCheckBoxMenuItem ("Show HAS/HASA members"); + showBox.addItemListener (new ItemListener() { + public void itemStateChanged (ItemEvent e) { + showMembers = (e.getStateChange() == ItemEvent.SELECTED); + update (lastSorted); + } + }); + popup.add (showBox); + + hideBox = new JCheckBoxMenuItem ("Hide deprecated objects"); + hideBox.addItemListener (new ItemListener() { + public void itemStateChanged (ItemEvent e) { + hideBadGuys = (e.getStateChange() == ItemEvent.SELECTED); + if (hideBadGuys) + removeBadGuys(); + else + update (lastSorted); + } + }); + popup.add (hideBox); + } + + void update (int howSorted) { + popup.setEnabled (false); + final int sorted = howSorted; + final SwingWorker worker = new SwingWorker() { + public Object construct() { + try { + dataTypes = registryModel.getDataTypesByNames(); + } catch (MobyException e) { + // TBD: what to do here? + System.err.println ("ERROR: " + e.getMessage()); + } + return dataTypes; // not used here + } + + // runs on the event-dispatching thread. + public void finished() { + if (dataTypes != null) { + if (sorted == SORTED_BY_AUTHORITY) + onUpdateDataTreeByAuth (dataTypes); + else + onUpdateDataTree (dataTypes); + popup.setEnabled (true); + } + } + }; + worker.start(); + } + + void onUpdateDataTree (MobyDataType[] dataTypes) { + DefaultTreeModel tModel = (DefaultTreeModel)getModel(); + DefaultMutableTreeNode root = (DefaultMutableTreeNode)tModel.getRoot(); + root.removeAllChildren(); // does not harm if no children exist + HashMap nodes = new HashMap (dataTypes.length); + for (int i = 0; i < dataTypes.length; i++) { + String thisName = dataTypes[i].getName(); + DefaultMutableTreeNode thisNode = (DefaultMutableTreeNode)nodes.get (thisName); + if (thisNode == null) { + thisNode = new DefaultMutableTreeNode (new CommonNode (thisName)); + nodes.put (thisName, thisNode); + } + String[] parents = dataTypes[i].getParentNames(); + if (parents.length == 0) { // we have a top-level object + root.add (thisNode); + } else { + String parentName = parents[0]; + DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode)nodes.get (parentName); + if (parentNode == null) { + parentNode = new DefaultMutableTreeNode (new CommonNode (parentName)); + nodes.put (parentName, parentNode); + } + if (showMembers) + addMembers (thisNode, dataTypes[i]); + parentNode.add (thisNode); + } + } + if (hideBadGuys) + removeBadGuys(); + else + tModel.reload(); + } + + + void onUpdateDataTreeByAuth (MobyDataType[] dataTypes) { + DefaultTreeModel tModel = (DefaultTreeModel)getModel(); + DefaultMutableTreeNode root = (DefaultMutableTreeNode)tModel.getRoot(); + root.removeAllChildren(); // does not harm if no children exist + HashMap nodes = new HashMap (dataTypes.length); + for (int i = 0; i < dataTypes.length; i++) { + String thisName = dataTypes[i].getName(); + DefaultMutableTreeNode thisNode = (DefaultMutableTreeNode)nodes.get (thisName); + if (thisNode == null) { + thisNode = new DefaultMutableTreeNode (new CommonNode (thisName)); + nodes.put (thisName, thisNode); + } + String authority = dataTypes[i].getAuthority(); + if (UUtils.isEmpty (authority)) + authority = ""; + DefaultMutableTreeNode authNode = (DefaultMutableTreeNode)nodes.get (authority); + if (authNode == null) { + authNode = new DefaultMutableTreeNode (new CommonNode (authority)); + nodes.put (authority, authNode); + root.add (authNode); + } + if (showMembers) + addMembers (thisNode, dataTypes[i]); + authNode.add (thisNode); + } + tModel.reload(); } + + void removeBadGuys() { + DefaultTreeModel tModel = (DefaultTreeModel)getModel(); + DefaultMutableTreeNode root = (DefaultMutableTreeNode)tModel.getRoot(); + + Vector removeFromParent = new Vector(); // nodes that will be removed + Vector removeAllChildren = new Vector(); // nodes whose children will be removed + for (Enumeration en = root.children(); en.hasMoreElements(); ) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode)en.nextElement(); + String value = ((CommonNode)node.getUserObject()).getValue(); + if (value.equals ("Object")) { + // primitive type should not have children + for (Enumeration en2 = node.children(); en2.hasMoreElements(); ) { + DefaultMutableTreeNode node2 = (DefaultMutableTreeNode)en2.nextElement(); + String value2 = ((CommonNode)node2.getUserObject()).getValue(); + if (DataTypesGenerator.isPrimitiveType (value2)) + removeAllChildren.addElement (node2); + } + } else { + // only Object can be a root object + removeFromParent.addElement (node); + } + } + for (Enumeration en = removeFromParent.elements(); en.hasMoreElements(); ) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode)en.nextElement(); + node.removeFromParent(); + } + for (Enumeration en = removeAllChildren.elements(); en.hasMoreElements(); ) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode)en.nextElement(); + node.removeAllChildren(); + } + tModel.reload(); + } + + void addMembers (DefaultMutableTreeNode node, MobyDataType dataType) { + MobyRelationship[] rels = dataType.getChildren(); + for (int i = 0; i < rels.length; i++) { + String memberName = rels[i].getName(); + String memberType = rels[i].getDataTypeName(); + int memberRel = rels[i].getRelationshipType(); + node.add (new DefaultMutableTreeNode (new MemberNode (rels[i]))); + } + } + + /********************************************************************* + * Search underlying objects and highligh nodes corresponding to + * the found objects. + ********************************************************************/ + protected void search (String searchText) { + final String regex = searchText; + final SwingWorker worker = new SwingWorker() { + HashSet found = new HashSet(); + public Object construct() { + try { + if (UUtils.notEmpty (regex)) + found = registryModel.find (regex); + } catch (MobyException e) { + // TBD: what to do here? + System.err.println ("ERROR: " + e.getMessage()); + } + return found; // not used here + } + + // runs on the event-dispatching thread. + public void finished() { + if (found != null) + highlightAndJumpTo (found); + } + }; + worker.start(); + } + + /********************************************************************* + * + ********************************************************************/ + protected void selected (DefaultMutableTreeNode node) { + final CommonNode nodeObject = (CommonNode)node.getUserObject(); + final SwingWorker worker = new SwingWorker() { + MobyDataType dataType; + public Object construct() { + try { + dataType = registryModel.getDataType (nodeObject.getValue()); + } catch (MobyException e) { + // TBD: what to do here? + System.err.println ("ERROR: " + e.getMessage()); + } + return dataType; // not used here + } + + // runs on the event-dispatching thread. + public void finished() { + if (dataType != null) +// System.out.println (dataType); + console.setText (dataType.toString()); + } + }; + worker.start(); + } + + class MemberNode extends CommonNode { + MobyRelationship rel; + public MemberNode (MobyRelationship rel) { + this.rel = rel; + } + public String getValue() { + return rel.getDataTypeName(); + } + public String toString() { + String memberName = rel.getName(); + String memberType = rel.getDataTypeName(); + int memberRel = rel.getRelationshipType(); + StringBuffer buf = new StringBuffer (100); + buf.append (""); + buf.append (memberRel == Central.iHAS ? "HAS" : "HASA"); + buf.append (": "); + buf.append (memberType); + if (UUtils.notEmpty (memberName)) { + buf.append (" ("); + buf.append (memberName); + buf.append (")"); + } + return buf.toString(); + } + } + + } + + /************************************************************************** * **************************************************************************/ @@ -342,35 +636,4 @@ return panelIcon; } - -// public void actionPerformed(ActionEvent e) { -// ... -// if (icon == null) { //haven't viewed this photo before -// loadImage(imagedir + pic.filename, current); -// } else { -// updatePhotograph(current, pic); -// } -// } -// ... -// //Load an image in a separate thread. -// private void loadImage(final String imagePath, final int index) { -// final SwingWorker worker = new SwingWorker() { -// ImageIcon icon = null; - -// public Object construct() { -// icon = new ImageIcon(getURL(imagePath)); -// return icon; //return value not used by this program -// } - -// //Runs on the event-dispatching thread. -// public void finished() { -// Photo pic = (Photo)pictures.elementAt(index); -// pic.setIcon(icon); -// if (index == current) -// updatePhotograph(index, pic); -// } -// }; -// worker.start(); -// } - } From mwilkinson at pub.open-bio.org Mon Sep 26 19:19:33 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Sep 26 20:11:06 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509262319.j8QNJXQ8019359@pub.open-bio.org> mwilkinson Mon Sep 26 19:19:33 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv19340/MOBY/Client Modified Files: OntologyServer.pm Log Message: typo moby-live/Perl/MOBY/Client OntologyServer.pm,1.12,1.13 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm 2005/07/06 15:23:07 1.12 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm 2005/09/26 23:19:33 1.13 @@ -189,7 +189,7 @@ =cut -sub relationshipsExists { +sub relationshipExists { my ( $self, %args ) = @_; my $term = $args{'term'}; $term =~ s/^moby://; # if the term is namespaced, then remove that From mwilkinson at pub.open-bio.org Mon Sep 26 19:26:00 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Sep 26 20:17:20 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509262326.j8QNQ0WZ019519@pub.open-bio.org> mwilkinson Mon Sep 26 19:26:00 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv19500/MOBY Modified Files: Central.pm Log Message: retrieveNamespaces should now retrieve everything about a namespace, no longer a 'sink' as Martin so aptly phrased it moby-live/Perl/MOBY Central.pm,1.216,1.217 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.216 retrieving revision 1.217 diff -u -r1.216 -r1.217 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/20 21:16:11 1.216 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/26 23:26:00 1.217 @@ -2803,8 +2803,8 @@ if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - $ns .= "\n\n\n"; #COMMENT/REMOVE -# $ns .= "\n\n$contact\n$auth\n\n";#UNCOMMENT +# $ns .= "\n\n\n"; #COMMENT/REMOVE + $ns .= "\n\n$contact\n$auth\n\n";#UNCOMMENT } $ns .= ""; return $ns; From mwilkinson at pub.open-bio.org Mon Sep 26 20:01:24 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Sep 26 20:52:43 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509270001.j8R01ONI019712@pub.open-bio.org> mwilkinson Mon Sep 26 20:01:24 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv19693/MOBY/Client Modified Files: OntologyServer.pm Log Message: fixing ontology server relationshipExists call moby-live/Perl/MOBY/Client OntologyServer.pm,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm 2005/09/26 23:19:33 1.13 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm 2005/09/27 00:01:24 1.14 @@ -192,10 +192,11 @@ sub relationshipExists { my ( $self, %args ) = @_; my $term = $args{'term'}; + my $ontology = $args{'ontology'}; $term =~ s/^moby://; # if the term is namespaced, then remove that my $ua = $self->getUserAgent; my $req = HTTP::Request->new( POST => $self->host ); - $req->content( "relationshipExists=$term" ); + $req->content( "relationshipExists=$term&ontology=$ontology" ); my $res = $ua->request( $req ); if ( $res->is_success ) { return split "\n", $res->content; From mwilkinson at pub.open-bio.org Mon Sep 26 20:01:24 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Sep 26 20:52:59 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509270001.j8R01O7a019731@pub.open-bio.org> mwilkinson Mon Sep 26 20:01:24 EDT 2005 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv19693/scripts Modified Files: OntologyServer.cgi Log Message: fixing ontology server relationshipExists call moby-live/Perl/scripts OntologyServer.cgi,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/scripts/OntologyServer.cgi,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Perl/scripts/OntologyServer.cgi 2003/10/09 16:49:22 1.4 +++ /home/repository/moby/moby-live/Perl/scripts/OntologyServer.cgi 2005/09/27 00:01:24 1.5 @@ -7,10 +7,10 @@ my $q = CGI->new(); my @params = $q->param; -my $param = $params[0]; # one call per customer +my $subroutine = $params[0]; # one call per customer no strict "refs"; -&$param($q->param($param)); #call that subroutie with the passed value +&$subroutine($q->param($subroutine), $q); #call that subroutie with the passed value use strict; sub testme { @@ -60,10 +60,11 @@ } sub relationshipExists { + my ($term, $CGI) = @_; my $OS = MOBY::OntologyServer->new(ontology => "relationship"); - my ($success, $description, $id) = $OS->relationshipExists(term => $_[0]); - print header(-type => 'text/plain'), "$success\n$description\n$id"; - + my $ontology = $CGI->param('ontology'); + my ($success, $description, $id) = $OS->relationshipExists(ontology => $ontology, term => $term); + print header(-type => 'text/plain'), "$success\n$description\n$id"; } sub serviceExists { From mwilkinson at pub.open-bio.org Mon Sep 26 20:06:25 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Sep 26 20:57:40 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509270006.j8R06PEZ019801@pub.open-bio.org> mwilkinson Mon Sep 26 20:06:25 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv19782/t Modified Files: Client-OntologyServer.t Log Message: fixing ontology server relationshipExists test moby-live/Perl/t Client-OntologyServer.t,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/16 16:38:15 1.4 +++ /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/27 00:06:24 1.5 @@ -88,13 +88,22 @@ or diag("OntologyServer should be able to tell whether a relationship exists"); my @check_rel = qw/ISA HASA HAS/; # There should only be very few valid relationship types. foreach (@check_rel) { - ($success, $msg, $existingURI) = $os->relationshipExists(term => $_); + ($success, $msg, $existingURI) = $os->relationshipExists(term => $_, ontology => 'object'); + is($success, 1) + or diag("Relationship '$_' reported erroneously as non-existent."); + } + my @check_rel2 = qw/ISA/; # There should only be very few valid relationship types. + foreach (@check_rel2) { + ($success, $msg, $existingURI) = $os->relationshipExists(term => $_, ontology => 'service'); is($success, 1) or diag("Relationship '$_' reported erroneously as non-existent."); } my $invalid_rel = "HA"; - ($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel); + ($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel, ontology => 'service'); + is($success, 0) + or diag("Relationship '$invalid_rel' reported erroneously as existent."); + ($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel, ontology => 'object'); is($success, 0) or diag("Relationship '$invalid_rel' reported erroneously as existent."); } From mwilkinson at pub.open-bio.org Mon Sep 26 19:28:44 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Sep 26 20:59:45 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509262328.j8QNSie2019563@pub.open-bio.org> mwilkinson Mon Sep 26 19:28:44 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv19544/MOBY Modified Files: Central.pm Log Message: retrieveNamespaces pod documentation updated moby-live/Perl/MOBY Central.pm,1.217,1.218 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.217 retrieving revision 1.218 diff -u -r1.217 -r1.218 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/26 23:26:00 1.217 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/26 23:28:44 1.218 @@ -2786,6 +2786,8 @@ + email@address.here + authority.uri.here ... ... From kawas at pub.open-bio.org Mon Sep 26 21:26:47 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon Sep 26 22:18:20 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509270126.j8R1QlAL020096@pub.open-bio.org> kawas Mon Sep 26 21:26:47 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv20067 Modified Files: OntologyServer.pm Central.pm Log Message: committing the actual uncommentted changes made as per Martins' request moby-live/Perl/MOBY OntologyServer.pm,1.84,1.85 Central.pm,1.218,1.219 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.84 retrieving revision 1.85 diff -u -r1.84 -r1.85 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/20 21:16:34 1.84 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/27 01:26:47 1.85 @@ -924,8 +924,8 @@ my %response; foreach (@$types) { - $response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}]; #COMMENT/REMOVE - #$response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}, $_->{contact_email}, $_->{authority}]; #UNCOMMENT + #$response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}]; #COMMENT/REMOVE + $response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}, $_->{contact_email}, $_->{authority}]; #UNCOMMENT } return \%response; } =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.218 retrieving revision 1.219 diff -u -r1.218 -r1.219 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/26 23:28:44 1.218 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/27 01:26:47 1.219 @@ -2617,14 +2617,14 @@ my $OS = MOBY::OntologyServer->new( ontology => 'service' ); my %types = %{ $OS->retrieveAllServiceTypes() }; my $types = "\n"; - while ( my ( $serv, $descr ) = each %types ) { #COMMENT/REMOVE -# while ( my ( $serv, $descr, $contact, $auth ) = each %types ) { #UNCOMMENT +# while ( my ( $serv, $descr ) = each %types ) { #COMMENT/REMOVE + while ( my ( $serv, $descr, $contact, $auth ) = each %types ) { #UNCOMMENT my ($desc, $lsid) = @$descr; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - $types .="\n\n\n"; #COMMENT/REMOVE -# $types .="\n\n$contact\n$auth\n\n"; #UNCOMMENT +# $types .="\n\n\n"; #COMMENT/REMOVE + $types .="\n\n$contact\n$auth\n\n"; #UNCOMMENT } $types .= "\n"; return $types; From mwilkinson at pub.open-bio.org Tue Sep 27 10:44:34 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue Sep 27 11:35:47 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509271444.j8REiYtu023350@pub.open-bio.org> mwilkinson Tue Sep 27 10:44:34 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv23327/MOBY Modified Files: Central.pm OntologyServer.pm Log Message: well, Eddie, that was ALMOST correct :-) moby-live/Perl/MOBY Central.pm,1.219,1.220 OntologyServer.pm,1.85,1.86 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.219 retrieving revision 1.220 diff -u -r1.219 -r1.220 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/27 01:26:47 1.219 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/27 14:44:34 1.220 @@ -2617,13 +2617,11 @@ my $OS = MOBY::OntologyServer->new( ontology => 'service' ); my %types = %{ $OS->retrieveAllServiceTypes() }; my $types = "\n"; -# while ( my ( $serv, $descr ) = each %types ) { #COMMENT/REMOVE - while ( my ( $serv, $descr, $contact, $auth ) = each %types ) { #UNCOMMENT - my ($desc, $lsid) = @$descr; + while ( my ( $serv, $descr ) = each %types ) { #UNCOMMENT + my ($desc, $lsid, $contact, $auth) = @$descr; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } -# $types .="\n\n\n"; #COMMENT/REMOVE $types .="\n\n$contact\n$auth\n\n"; #UNCOMMENT } $types .= "\n"; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.85 retrieving revision 1.86 diff -u -r1.85 -r1.86 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/27 01:26:47 1.85 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/27 14:44:34 1.86 @@ -924,7 +924,6 @@ my %response; foreach (@$types) { - #$response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}]; #COMMENT/REMOVE $response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}, $_->{contact_email}, $_->{authority}]; #UNCOMMENT } return \%response; From mwilkinson at pub.open-bio.org Tue Sep 27 12:19:21 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue Sep 27 13:10:47 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509271619.j8RGJLQ3026218@pub.open-bio.org> mwilkinson Tue Sep 27 12:19:21 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv26197/MOBY Modified Files: Central.pm Log Message: added two new methods to MOBY Client Central to extract the additional details from namespace and service retrieval moby-live/Perl/MOBY Central.pm,1.220,1.221 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.220 retrieving revision 1.221 diff -u -r1.220 -r1.221 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/27 14:44:34 1.220 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/27 16:19:21 1.221 @@ -2605,6 +2605,8 @@ + your@email.here + authority.uri.here ... ... From mwilkinson at pub.open-bio.org Tue Sep 27 12:19:21 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue Sep 27 13:10:52 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509271619.j8RGJLDY026237@pub.open-bio.org> mwilkinson Tue Sep 27 12:19:21 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv26197/MOBY/Client Modified Files: Central.pm Log Message: added two new methods to MOBY Client Central to extract the additional details from namespace and service retrieval moby-live/Perl/MOBY/Client Central.pm,1.124,1.125 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.124 retrieving revision 1.125 diff -u -r1.124 -r1.125 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/09/16 17:01:10 1.124 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/09/27 16:19:21 1.125 @@ -1236,7 +1236,6 @@ " . ( $SI->XML ) . " "; -# my $return = $self->SOAP_connection($reg)->call(retrieveService => ($message))->paramsall; my ($return) = $self->_call( $reg, 'retrieveService', $message ); my $parser = XML::LibXML->new(); my $doc = $parser->parse_string($return); @@ -1292,7 +1291,7 @@ =head2 retrieveServiceNames - Usage : $names = $MOBY->retrieveServiceNames([$reg_name]) + Usage : $names = $MOBY->retrieveServiceNames(%args) Function : get a (redundant) list of all registered service names (N.B. NOT service types!) Returns : hashref to the following hash @@ -1367,7 +1366,7 @@ =head2 retrieveServiceTypes - Usage : $types = $MOBY->retrieveServiceTypes([$reg_name]) + Usage : $types = $MOBY->retrieveServiceTypes(%args) Function : get the list of all registered service types Returns : hashref of $types{$type} = $definition Args : registry => $reg_name: name of registry you wish to retrieve from (optional) @@ -1414,6 +1413,76 @@ return \%servicetypes; } + +=head2 retrieveServiceTypesFull + + Usage : $types = $MOBY->retrieveServiceTypesFull(%args) + Function : get all details of all service types + Returns : hashref of $types{$type} = {definition => "definition", + authURI => "authority.uri.here", + contactEmail => "email@addy.here"} + Args : registry => $reg_name: name of registry you wish to retrieve from (optional) + as_lsid => $boolean: return the $type as its corresponding LSID (defualt off) + +=cut + + +sub retrieveServiceTypesFull { + my ($self, %args) = shift; + my $reg = $args{registry}; + my $as_lsid = $args{as_lsid}; + + $reg = $reg ? $reg : $self->default_MOBY_servername; + return undef unless ( $self->Connection($reg) ); + +# my $return = $self->SOAP_connection($reg)->call('retrieveServiceTypes' => (@_))->paramsall; + my ($return) = $self->_call( $reg, 'retrieveServiceTypes', "" ); + my $parser = XML::LibXML->new(); + my $doc = $parser->parse_string($return); + my $root = $doc->getDocumentElement; + my $types = $root->childNodes; + my %servicetypes; + for ( my $x = 1 ; $x <= $types->size() ; $x++ ) { + next unless $types->get_node($x)->nodeType == ELEMENT_NODE; + my $type = $types->get_node($x)->getAttributeNode('name')->getValue; + my $lsid = $types->get_node($x)->getAttributeNode('lsid'); + if ($lsid){ + $lsid = $lsid->getValue; + } else { + $lsid = $type; + } + my ($desc, $auth, $email); + for + my $elem ( $types->get_node($x)->getElementsByTagName('Description') ) + { + $desc = $elem->firstChild->toString; + if ( $desc =~ /[^\]]+))\]\]>/ ) { + $desc = $1; + } + } + for + my $elem ( $types->get_node($x)->getElementsByTagName('authURI') ) + { + $auth = $elem->firstChild->toString; + if ( $auth =~ /[^\]]+))\]\]>/ ) { + $auth = $1; + } + } + for + my $elem ( $types->get_node($x)->getElementsByTagName('contactEmail') ) + { + $emai = $elem->firstChild->toString; + if ( $email =~ /[^\]]+))\]\]>/ ) { + $email = $1; + } + } + $desc =~ s/[^\]]+))\]\]>/$1/gs; # somehow these CDATA elements are nested sometimes??? + $servicetypes{$as_lsid?$lsid:$type} = {Description => $desc, authURI => $auth, contactEmail => $email}; + } + return \%servicetypes; +} + + =head2 retrieveObjectNames Usage : $names = $MOBY->retrieveObjectNames([$reg_name]) @@ -1463,7 +1532,7 @@ =head2 retrieveNamespaces - Usage : $ns = $MOBY->retrieveNamespaces([$reg_name]) + Usage : $ns = $MOBY->retrieveNamespaces(%args) Function : get the list of all registered Namespace types Returns : hashref of hash: $ns{$namespace} = $definition @@ -1511,6 +1580,78 @@ return \%namespaces; } +=head2 retrieveNamespacesFull + + Usage : $ns = $MOBY->retrieveNamespaces(%args) + Function : get all details about all namespaces + Returns : hashref of hash: + $ns{$namespace} = {Definition => $definition, + authURI => $authority, + contactEmail => $email} + Args : registry => $reg_name: name of registry you wish to retrieve from (optional) + as_lsid => $boolean: retrieve $namespace as its corresponding LSID (default off) + +=cut + +sub retrieveNamespaces { + my ($self, %args) = shift; + my $reg = $args{registry}; + $reg = $reg ? $reg : $self->default_MOBY_servername; + return undef unless ( $self->Connection($reg) ); + my $as_lsid = $args{as_lsid}; + + my ($return) = $self->_call( $reg, 'retrieveNamespaces', "" ); + my $parser = XML::LibXML->new(); + my $doc = $parser->parse_string($return); + my $root = $doc->getDocumentElement; + my $namesp = $root->childNodes; + my %namespaces; + for ( my $x = 1 ; $x <= $namesp->size() ; $x++ ) { + next unless $namesp->get_node($x)->nodeType == ELEMENT_NODE; + my $ns = $namesp->get_node($x)->getAttributeNode('name')->getValue; + my $lsid = $namesp->get_node($x)->getAttributeNode('lsid'); + if ($lsid){ + $lsid = $lsid->getValue; + } else { + $lsid = $ns; + } + my ($desc, $auth, $email); + for my $elem ( + $namesp->get_node($x)->getElementsByTagName('Description') ) + { + $desc = $elem->firstChild; + $desc = $desc ? $desc->toString : ""; + $desc ||=""; + if ( $desc =~ /[^\]]+))\]\]>/ ) { + $desc = $1; + } + } + for my $elem ( + $namesp->get_node($x)->getElementsByTagName('authURI') ) + { + $auth = $elem->firstChild; + $auth = $auth ? $auth->toString : ""; + $auth ||=""; + if ( $auth =~ /[^\]]+))\]\]>/ ) { + $auth = $1; + } + } + for my $elem ( + $namesp->get_node($x)->getElementsByTagName('contactEmail') ) + { + $email = $elem->firstChild; + $email = $email ? $email->toString : ""; + $email ||=""; + if ( $email =~ /[^\]]+))\]\]>/ ) { + $email = $1; + } + } + $namespaces{$as_lsid?$lsid:$ns} = {Description => $desc, authURI => $auth, contactEmail => $email}; + } + return \%namespaces; +} + + =head2 retrieveObject Usage : $objects = $MOBY->retrieveObjectNames(%args) From mwilkinson at pub.open-bio.org Tue Sep 27 12:21:04 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue Sep 27 13:12:16 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509271621.j8RGL4XV026334@pub.open-bio.org> mwilkinson Tue Sep 27 12:21:04 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv26315/MOBY/Client Modified Files: Central.pm Log Message: added two new methods to MOBY Client Central to extract the additional details from namespace and service retrieval moby-live/Perl/MOBY/Client Central.pm,1.125,1.126 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.125 retrieving revision 1.126 diff -u -r1.125 -r1.126 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/09/27 16:19:21 1.125 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/09/27 16:21:04 1.126 @@ -1471,7 +1471,7 @@ for my $elem ( $types->get_node($x)->getElementsByTagName('contactEmail') ) { - $emai = $elem->firstChild->toString; + $email = $elem->firstChild->toString; if ( $email =~ /[^\]]+))\]\]>/ ) { $email = $1; } @@ -1593,7 +1593,7 @@ =cut -sub retrieveNamespaces { +sub retrieveNamespacesFull { my ($self, %args) = shift; my $reg = $args{registry}; $reg = $reg ? $reg : $self->default_MOBY_servername; From fgibbons at pub.open-bio.org Tue Sep 27 20:24:26 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue Sep 27 21:15:39 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509280024.j8S0OQx5027540@pub.open-bio.org> fgibbons Tue Sep 27 20:24:26 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory pub.open-bio.org:/tmp/cvs-serv27515 Modified Files: index_API.html Log Message: - Added a URL. moby-live/Docs/MOBY-S_API index_API.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/index_API.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/index_API.html 2005/08/25 16:03:20 1.2 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/index_API.html 2005/09/28 00:24:26 1.3 @@ -62,8 +62,8 @@ developers' mailing list. Among them are:

    +You can join the MOBY-S community by subscribing to the mailing list. + +You can also report a bug or request a new feature + \ No newline at end of file From fgibbons at pub.open-bio.org Tue Sep 27 20:24:26 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue Sep 27 21:16:07 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509280024.j8S0OQnN027567@pub.open-bio.org> fgibbons Tue Sep 27 20:24:26 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl In directory pub.open-bio.org:/tmp/cvs-serv27515/Perl Modified Files: ConstructingYourService.html RegisterAnObject.html RegisterNamespace.html Log Message: - Added a URL. moby-live/Docs/MOBY-S_API/Perl ConstructingYourService.html,1.2,1.3 RegisterAnObject.html,1.1,1.2 RegisterNamespace.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html 2005/08/25 16:03:20 1.2 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html 2005/09/28 00:24:26 1.3 @@ -12,23 +12,27 @@ MOBY-S Compliant Services First you need to check the following:
      -
    • Do the object type(s) that your service will consume already -exist in the Object Ontology? If not, Do the object type(s) that your service will consume already +exist in the + +Object Ontology? If not, learn how to design your own MOBY objects
    • -
    • Do the object type(s) that your service will produce already -exist in the Object Ontology? If not, then you need to Do the object type(s) that your service will produce already +exist in the +Object Ontology? If not, then you need to register your objects in the MOBY-S object/class ontology
    • Does an appropriate service type term already exist in the -Service Ontology? You need to Service Ontology? You need to register your new service type in the MOBY-S service ontology.
    • -
    • Do the Namespaces that you are going to use in your objects -already exist in the Service Ontology? Do the namespaces that you are going to use in your objects +already exist in the +Namespace Ontology? Register your namespace, if it doesn't already exist.
    • =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterAnObject.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterAnObject.html 2005/08/25 14:02:54 1.1 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterAnObject.html 2005/09/28 00:24:26 1.2 @@ -10,6 +10,8 @@

      Using the Perl API to register an object

      +MOBY already has a +rather extensive ontology of data/object types. Still, if you can't find what you need, you have to create your own. The signature for the registerObject method is as follows:
       my $REG = $MOBY->registerObject(
      
      ===================================================================
      RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterNamespace.html,v
      retrieving revision 1.1
      retrieving revision 1.2
      diff -u -r1.1 -r1.2
      --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterNamespace.html	2005/08/25 14:03:25	1.1
      +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterNamespace.html	2005/09/28 00:24:26	1.2
      @@ -18,7 +18,10 @@
       that the ID referrs to.  For example, gi numbers always
       represent Genbank records, and identifiers in the format GO::0003346
       always represent Gene Ontology Terms.  As such, much of
      -MOBY-S is built to take advantage of this predeictability.  

      +MOBY-S is built to take advantage of this predeictability. (An + +up-to-date list of currently available namespaces, is available here.) +

      In MOBY-S, service providers will often define their interfaces in terms of Namespaces - i.e. they are saying "I know how to do something From mwilkinson at pub.open-bio.org Wed Sep 28 18:05:59 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed Sep 28 18:57:03 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509282205.j8SM5xCD031130@pub.open-bio.org> mwilkinson Wed Sep 28 18:05:58 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory pub.open-bio.org:/tmp/cvs-serv31107 Modified Files: CentralRegistry.html XMLPayloads.html Log Message: updating the docs with new features added yesterday v.v. retreival of namespaces and service types. Also a couple of doc errors fixed. moby-live/Docs/MOBY-S_API CentralRegistry.html,1.2,1.3 XMLPayloads.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html 2005/08/25 16:03:20 1.2 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html 2005/09/28 22:05:58 1.3 @@ -72,13 +72,13 @@ retrieveServiceTypes - Retrieve the service ontology, showing all registered service types. +Retrieve the definitions and registration details of all registered service types. retrieveObjectNames - Retrieve the object ontology, showing all registered object types. +Retrieve the object ontology, showing all registered object types. @@ -98,7 +98,7 @@ retrieveObjectSchema - Retrieve an XML schema representation of a particular object class. + Retrieve an XML schema representation of a particular object class. This is currently not implemented since it appears to be impossible to represent MOBY Objects in XML Schema due to limitations of XML Schema =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2005/08/25 16:03:20 1.2 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2005/09/28 22:05:58 1.3 @@ -221,7 +221,16 @@ <Resource name="Namespace" url="...Y..."/> </resourceURLs>

      +

      Notes

      +
        + +
      • Finds the URL from which the RDF of a MOBY Ontology +can be retrieved by HTTP GET. There are five possible ontology names: +"Service", "Object", "Namespace", "ServiceInstance", or "Full" (Full +retrieves all of the ontologies)
      • + +

      retrieveServiceNames

      Input XML

      @@ -235,16 +244,16 @@ ... </serviceNames> -

      Notes

        - -
      • Finds the URL from which the RDF of a MOBY Ontology -can be retrieved by HTTP GET. There are five possible ontology names: -"Service", "Object", "Namespace", "ServiceInstance", or "Full" (Full -retrieves all of the ontologies)
      • - +
      • Retrieves minimal information about all registered MOBY services
      • +
          +
        • serviceName +
        • authority +
        • service instance LSID
        +
      +

      retrieveServiceTypes

      @@ -256,6 +265,8 @@ <serviceTypes> <serviceType name="serviceName" lsid='urn:lsid:authority.uri:servicetype:id'> <Description><![CDATA[free text description here]]></Description> + <contactEmail>email@address here</contactEmail> + <authURI>authority.uri.here</authURI> </serviceType> ... </serviceTypes> @@ -263,7 +274,7 @@

      Notes

        -
      • Gets a full dump of the Service Type ontology (excluding +
      • Gets a full dump of the Service Type ontology as MOBY XML (excluding relationships)
      • A new API call will be created at a later date to retrieve the @@ -343,6 +354,8 @@ <Namespaces> <Namespace name="namespace" lsid='urn:lsid:authority.uri:namespace:id'> <Description><![CDATA[free text description here]]></Description> + <contactEmail>email@address here</contactEmail> + <authURI>authority.uri.here</authURI> </Namespace> ... </Namespaces> From mwilkinson at pub.open-bio.org Wed Sep 28 18:26:21 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed Sep 28 19:19:07 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509282226.j8SMQLsa031220@pub.open-bio.org> mwilkinson Wed Sep 28 18:26:21 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory pub.open-bio.org:/tmp/cvs-serv31201 Modified Files: CentralRegistry.html Log Message: updating the docs with new features added yesterday v.v. retreival of namespaces and service types. Also a couple of doc errors fixed. moby-live/Docs/MOBY-S_API CentralRegistry.html,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html 2005/09/28 22:05:58 1.3 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html 2005/09/28 22:26:21 1.4 @@ -70,15 +70,15 @@ -retrieveServiceTypes +retrieveServiceTypes Retrieve the definitions and registration details of all registered service types. -retrieveObjectNames +retrieveObjectNames -Retrieve the object ontology, showing all registered object types. +Retrieve the definitions and registration details of all registered object types. From kawas at pub.open-bio.org Thu Sep 29 16:14:12 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Thu Sep 29 17:07:57 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509292014.j8TKECEq002917@pub.open-bio.org> kawas Thu Sep 29 16:14:11 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util In directory pub.open-bio.org:/tmp/cvs-serv2892/org/biomoby/registry/rdfagent/util Modified Files: Report.java Log Message: Handling the error stream, just in case, so that the system call doesnt hang. moby-live/Java/src/main/org/biomoby/registry/rdfagent/util Report.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java 2005/09/12 18:22:10 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java 2005/09/29 20:14:11 1.8 @@ -12,10 +12,13 @@ * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ +import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; import java.util.ArrayList; import org.biomoby.registry.rdfagent.verifier.Communicator; @@ -101,6 +104,13 @@ "chmod +x _script_.sh"); p.waitFor(); p = Runtime.getRuntime().exec("./_script_.sh"); + InputStream stderr = p.getErrorStream(); + InputStreamReader isr = new InputStreamReader(stderr); + BufferedReader br = new BufferedReader(isr); + String line = null; + while ((line = br.readLine()) != null) { + + } p.waitFor(); Log.info("_script_.sh has " + ((file.delete()) ? "" : "not ") + "been deleted" From kawas at pub.open-bio.org Fri Sep 30 10:44:58 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri Sep 30 11:35:56 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509301444.j8UEiwcf006386@pub.open-bio.org> kawas Fri Sep 30 10:44:58 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared In directory pub.open-bio.org:/tmp/cvs-serv6357/org/biomoby/client/ui/graphical/applets/shared Modified Files: Construct.java MobyTree.java Log Message: modified the code so that an arbitrary tree can be created using any rdf document and a property to base the tree on. This was done mainly for a student project that will create web forms that pop up these trees based on rdf. moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared Construct.java,1.2,1.3 MobyTree.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/Construct.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/Construct.java 2005/08/29 22:59:35 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/Construct.java 2005/09/30 14:44:58 1.3 @@ -1,15 +1,11 @@ package org.biomoby.client.ui.graphical.applets.shared; -import java.io.ByteArrayInputStream; -import java.io.FileInputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; -import org.biomoby.client.ui.graphical.servlet.jresources.RESOURCE; - import com.hp.hpl.jena.mem.ModelMem; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.Statement; @@ -120,4 +116,72 @@ return homes; } + + /** + * + * PRE: none.

        + * POST: A Hashmap containing object names as keys and their relationships,

        + * in an array, as the value. + * @param property the property to build the tree from RDF + * @return returns a hashmap containing the object name as the key + * and an arraylist of children as the value. + */ + public HashMap createHomes(String property) { + HashMap homes = new HashMap(); // (key=parent,val=household) + try { + // create an empty model + Model model = new ModelMem(); + + InputStream in = new URL(url).openStream(); + + // read the RDF/XML data + model.read(new InputStreamReader(in), ""); + StmtIterator iter; + Statement stmt; + + iter = model.listStatements(); + while (iter.hasNext()) { + stmt = (Statement) iter.next(); + + String sub = stmt.getSubject().getURI(); + String obj = stmt.getObject().toString(); + if (sub != null) + sub = sub.substring(sub.indexOf("#") + 1, sub.length()); + if (obj!= null) + obj = obj.substring(obj.indexOf("#") + 1, obj.length()); + + if (stmt.getPredicate().getURI().indexOf(property) > 0) { + //System.out.println(obj); + // we have the relationship that we want in the tree + if (homes.containsKey(obj)) { + // hash contains the home -> get the home and add child to household + Household h = (Household)homes.get(obj); + ArrayList ch = h.getChildren(); + ch.add(sub); + h.setChildren(ch); + if (DEBUG) { + System.out.println(h.toString()); + } + homes.put(obj,h); + } else { + // hash doesn't have the parent, so add the parent and child to a new household + ArrayList ch = new ArrayList(); + ch.add(sub); // add the child + Household h = new Household(obj, ch); + if (DEBUG) { + //System.out.println("New Parent: " + obj + " child: " + sub); + System.out.println(h.toString()); + } + homes.put(obj,h); + } + } // hashmap is created + + } + + } catch (Exception e) { + System.err.println("Failed: " + e.getMessage()+"\n" + e.getStackTrace()); + } + + return homes; + } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java 2005/06/02 15:48:54 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java 2005/09/30 14:44:58 1.3 @@ -67,6 +67,29 @@ JScrollPane scrollPane = new JScrollPane(tree); add(scrollPane); } + + /** + * A moby tree is constructed with the root node labeled as 'name'

        + * and the material for the tree taken from the RDF located at

        + * the url rdf. The tree is created by looking for the property property

        + * @param canEdit - if true then nodes in tree can be edited, otherwise they cannot. + * @param rdf - the url of the RDF describing Moby Objects, Services, Service Types, and Namespaces + * @param name - the name of the root node in the tree. + * @param property - the property to parse the rdf document and base a tree on + */ + public MobyTree(boolean canEdit, String rdf, String name, String property) { + + // create the layout + super(new GridLayout(1, 0)); + this.canEdit = canEdit; + this.rdf = rdf; + this.name = name; + reload(canEdit, name, property); + + + JScrollPane scrollPane = new JScrollPane(tree); + add(scrollPane); + } private void reload(boolean canEdit, String name) { // hashmap contains all the children of the root object @@ -82,6 +105,23 @@ tree.setShowsRootHandles(true); } + + /* + * + * create a tree based on property instead of subClassOf + */ + private void reload(boolean canEdit, String name, String property) { + // hashmap contains all the children of the root object + this.hashmap = new Construct(rdf).createHomes(property); + rootNode = new DefaultMutableTreeNode(name); + treeModel = new DefaultTreeModel(rootNode); + treeModel.addTreeModelListener(new MobyTreeModelListener()); + tree = new JTree(treeModel); + tree.setEditable(canEdit); + tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); + tree.setShowsRootHandles(true); + + } /** * PRE: None.

        From kawas at pub.open-bio.org Fri Sep 30 10:45:56 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri Sep 30 11:36:52 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509301445.j8UEjum8006444@pub.open-bio.org> kawas Fri Sep 30 10:45:56 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/objectCreationTool In directory pub.open-bio.org:/tmp/cvs-serv6419/org/biomoby/client/ui/graphical/applets/objectCreationTool Modified Files: retrieveObjectXML.cgi Log Message: corrected the call to mobycentral that was updated recently. moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/objectCreationTool retrieveObjectXML.cgi,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/objectCreationTool/retrieveObjectXML.cgi,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/objectCreationTool/retrieveObjectXML.cgi 2005/07/19 15:36:24 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/objectCreationTool/retrieveObjectXML.cgi 2005/09/30 14:45:56 1.3 @@ -14,7 +14,7 @@ my $name; my $cgi = CGI->new(); $name = $cgi->param( 'name' ) or die; - $DEFS = $Central->retrieveObjectDefinition($name); + $DEFS = $Central->retrieveObjectDefinition(objectType => $name); print "Content-type: text/plain\n\n"; my $output = $DEFS->{'XML'}; $output =~ s/retrieveObjectDefinition/objectDetails/g; From kawas at pub.open-bio.org Fri Sep 30 10:48:22 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri Sep 30 11:39:15 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509301448.j8UEmMfD006514@pub.open-bio.org> kawas Fri Sep 30 10:48:22 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms In directory pub.open-bio.org:/tmp/cvs-serv6485/org/biomoby/client/ui/graphical/servlet/forms Modified Files: GetSignatureRDFResponse.java GetSignatureRDFForm.java Log Message: *modified the domain to be portless since some people dont like 8090 etc moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms GetSignatureRDFResponse.java,1.3,1.4 GetSignatureRDFForm.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFResponse.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFResponse.java 2005/07/19 15:28:28 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFResponse.java 2005/09/30 14:48:22 1.4 @@ -37,18 +37,18 @@ final private String newline = System.getProperty("line.separator"); - final static private String error = "\r\n" - + "\r\n" - + "\r\n" - + "Please Try Again\r\n" - + "\r\n" - + "\r\n" - + "\r\n" - + "

        Unable to update your information

        \r\n" - + "
        \r\n" - + "

        Make sure that you specify a valid signature url! This field looks like the following: http://myAuthority.domain/path/to/rdf/for/service. Also make sure that you have specified the right case-sensitive service name, if applicable.

        \r\n" - + "

        Back

        \r\n" - + "
        \r\n" + "\r\n" + ""; + final static private String error = "" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + "" + + "Please Try Again" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + "" + + "

        Unable to update your information

        " + System.getProperty("line.separator") + "" + + "
        " + System.getProperty("line.separator") + "" + + "

        Make sure that you specify a valid signature url! This field looks like the following: http://myAuthority.domain/path/to/rdf/for/service. Also make sure that you have specified the right case-sensitive service name, if applicable.

        " + System.getProperty("line.separator") + "" + + "

        Back

        " + System.getProperty("line.separator") + "" + + "
        " + System.getProperty("line.separator") + "" + "" + System.getProperty("line.separator") + "" + ""; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFForm.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFForm.java 2005/07/19 15:28:28 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFForm.java 2005/09/30 14:48:22 1.4 @@ -34,7 +34,7 @@ // some useful variables private final String newline = System.getProperty("line.separator"); - private static final String DOMAIN = "mobycentral.icapture.ubc.ca:8090"; + private static final String DOMAIN = "mobycentral.icapture.ubc.ca"; /* (non-Javadoc) * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) @@ -50,6 +50,7 @@ String[] domains = null; // initialize central try { + //TODO - enter the endpoint here central = new CentralImpl(); domains = central.getProviders(); } catch (MobyException e) { From kawas at pub.open-bio.org Fri Sep 30 10:50:40 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri Sep 30 11:41:32 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509301450.j8UEoeNM006580@pub.open-bio.org> kawas Fri Sep 30 10:50:40 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv6551/org/biomoby/client/ui/graphical/servlet/lsid/authority Modified Files: LSIDAuthorityData.java LSIDDataLookup.java Log Message: modified the get data logic. moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority LSIDAuthorityData.java,1.2,1.3 LSIDDataLookup.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDAuthorityData.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDAuthorityData.java 2005/08/30 23:30:58 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDAuthorityData.java 2005/09/30 14:50:40 1.3 @@ -47,19 +47,26 @@ // "No data exists for the given lsid"); LSID lsid = req.getLsid(); if (lookup.isValidDataType(lsid)) { - String datatype = lsid.getObject(); - // build the schema - Builder builder = new Builder(); - Element root = builder.buildSchema(datatype); - // create a jDom document - Document doc = new Document(root); - XMLOutputter fmt = new XMLOutputter(); - Format format = Format.getPrettyFormat(); - fmt.setFormat(format); - // convert document to string - String schema = fmt.outputString(doc); - // return an input stream - return new ByteArrayInputStream(schema.getBytes()); + + int type = lookup.dataLsidType(lsid); + if (type == LSIDDataLookup.OBJECT_CLASS) { + String datatype = lsid.getObject(); + // build the schema + Builder builder = new Builder(); + Element root = builder.buildSchema(datatype); + // create a jDom document + Document doc = new Document(root); + XMLOutputter fmt = new XMLOutputter(); + Format format = Format.getPrettyFormat(); + fmt.setFormat(format); + // convert document to string + String schema = fmt.outputString(doc); + // return an input stream + return new ByteArrayInputStream(schema.getBytes()); + } + if (type == LSIDDataLookup.SERVICE_INSTANCE) { + + } } throw new LSIDServerException(LSIDServerException.NO_DATA_AVAILABLE, "No data exists for the given lsid"); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java 2005/08/30 23:30:58 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java 2005/09/30 14:50:40 1.4 @@ -65,12 +65,34 @@ } + /** + * + * @param lsid an lsid to check whether we have 'data' on it or not + * @return true if getData has actual data under the namespace of the lsid. False otherwise. + */ public boolean isValidDataType (LSID lsid) { String ns = lsid.getNamespace(); - if (ns.equalsIgnoreCase(mobyobject.getProperty("lsid_namespace"))) + if (ns.equalsIgnoreCase(mobyobject.getProperty("lsid_namespace")) || ns.equalsIgnoreCase(mobycentral.getProperty("lsid_namespace"))) return true; return false; } + + + public int dataLsidType(LSID lsid) { + String ns = lsid.getNamespace(); + String id = lsid.getObject(); + String ver = lsid.getRevision(); + if (ver != null || (ver != null && ver.length() != 0)) + return UNKNOWN; + if (ns.equalsIgnoreCase(mobyobject.getProperty("lsid_namespace"))) { + return LSIDDataLookup.OBJECT_CLASS; + } + if (ns.equalsIgnoreCase(mobycentral.getProperty("lsid_namespace"))) { + return LSIDDataLookup.SERVICE_INSTANCE; + } + return UNKNOWN; + } + public int lsidType(LSID lsid) throws LSIDServerException { String ns = lsid.getNamespace(); String id = lsid.getObject(); From kawas at pub.open-bio.org Fri Sep 30 10:52:55 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri Sep 30 11:43:47 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509301452.j8UEqttV006638@pub.open-bio.org> kawas Fri Sep 30 10:52:54 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder In directory pub.open-bio.org:/tmp/cvs-serv6613/org/biomoby/client/rdf/builder Modified Files: ServiceInstanceRDF.java Log Message: modified the lsid authority domain to be hard coded to biomoby.org moby-live/Java/src/main/org/biomoby/client/rdf/builder ServiceInstanceRDF.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2005/08/29 20:22:32 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2005/09/30 14:52:54 1.8 @@ -39,9 +39,14 @@ */ /** - * @author Eddie Kawas

        This class was created to present a way to retrieve a - * service instances' RDF using just a service name and authority.

        For - * questions, comments, or bugs

        email me at edward.kawas@gmail.com + * @author Eddie Kawas + *

        + * This class was created to present a way to retrieve a service + * instances' RDF using just a service name and authority. + *

        + * For questions, comments, or bugs + *

        + * email me at edward.kawas@gmail.com */ public class ServiceInstanceRDF { @@ -79,10 +84,13 @@ /** * - * PRE:name is either a valid name or null

        POST:If - * authorURI is a valid authority, then a RDF containing all of the service - * instances will be returned. If authorURI and name are valid then a single - * RDF containing just the service instance identified by name is returned.

        + * PRE: name is either a valid name or null + *

        + * POST: If authorURI is a valid authority, then a RDF containing all + * of the service instances will be returned. If authorURI and name are + * valid then a single RDF containing just the service instance identified + * by name is returned. + *

        * * @param authorURI - * the authority to query @@ -108,8 +116,11 @@ /** * * method that retrieves the RDF describing a specific service instance - * based on the parameters domain, serviceName, url and uri.

        PRE:None. - *

        POST:The RDF describing the service with parameters domain, + * based on the parameters domain, serviceName, url and uri. + *

        + * PRE: None. + *

        + * POST: The RDF describing the service with parameters domain, * serviceName, url and uri is created. * * @param domain - @@ -282,11 +293,23 @@ .getCategory(), "en")); subject.addProperty(DC.source, model.createTypedLiteral(services[i] .getURL())); - subject.addProperty(DC.identifier, model - .createTypedLiteral("urn:lsid:" - + MobyProperties.SERVICE_INSTANCE_PROPERTIES().getProperty("lsid_authority") +":" - + MobyProperties.SERVICE_INSTANCE_PROPERTIES().getProperty("lsid_namespace") +":"+ services[i].getAuthority() - + "," + services[i].getName())); + subject + .addProperty( + DC.identifier, + model + .createTypedLiteral("urn:lsid:" + + "biomoby.org" + + ":" + + (MobyProperties + .SERVICE_INSTANCE_PROPERTIES() + .getProperty( + "lsid_namespace") == null ? "serviceinstance" + : MobyProperties + .SERVICE_INSTANCE_PROPERTIES() + .getProperty( + "lsid_namespace")) + + ":" + services[i].getAuthority() + + "," + services[i].getName())); subject.addProperty(Predicates.performs_task, model .createResource(SRV + services[i].getType())); subject.addProperty(Predicates.SignatureURL, model @@ -375,8 +398,7 @@ .getDefaultValue())); _li.addProperty(Predicates.datatype, model .createTypedLiteral(data.getDataType())); - _li.addProperty(RDF.type, - Predicates.Secondary); + _li.addProperty(RDF.type, Predicates.Secondary); if (data.getDataType().equals("Integer")) { _li .addProperty(Predicates.min, model @@ -476,7 +498,7 @@ return stream.getOutput(); } - + /* * convenience method that adds a resource to a model */ @@ -519,9 +541,12 @@ /** * - * PRE:None

        POST:If a service instance exists such that - * it has a name of name and an authoring URI of uri true is returned, - * otherwise false is returned.

        + * PRE: None + *

        + * POST: If a service instance exists such that it has a name of name + * and an authoring URI of uri true is returned, otherwise false is + * returned. + *

        * * @param uri - * the authors uri @@ -554,10 +579,13 @@ /** * - * Usage: ServiceInstanceRDF authorityURI [serviceName]

        - * authorityURI: is the authortitys' domain to query

        - * serviceName:optional argument that identifies a specific service - * instance

        + * Usage: ServiceInstanceRDF authorityURI [serviceName] + *

        + * authorityURI: is the authortitys' domain to query + *

        + * serviceName: optional argument that identifies a specific service + * instance + *

        * * @throws LSIDException */ @@ -588,4 +616,4 @@ public String getOutput() { return sb.toString(); } -} +} \ No newline at end of file From mwilkinson at pub.open-bio.org Fri Sep 30 19:08:36 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Fri Sep 30 19:59:36 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509302308.j8UN8apA008098@pub.open-bio.org> mwilkinson Fri Sep 30 19:08:35 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv8079/MOBY Modified Files: OntologyServer.pm Log Message: OntologyServer was returning NCBI_Acc as the namespace if you passed it a null query. Yuck moby-live/Perl/MOBY OntologyServer.pm,1.86,1.87 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.86 retrieving revision 1.87 diff -u -r1.86 -r1.87 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/27 14:44:34 1.86 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/30 23:08:35 1.87 @@ -191,6 +191,7 @@ $term =~ s/^moby://; # if the term is namespaced, then remove that my $sth; return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); + return (0, undef, undef) unless defined $term; my $result; @@ -653,6 +654,8 @@ { return ( 1, "external ontology", $term ); } + return (0, undef, undef) unless defined $term; + my $result; $result = $adaptor->query_service(type => $term); my $row = shift(@$result); @@ -783,6 +786,7 @@ return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'namespace' ); my $term = $args{term}; + return (0, undef, undef) unless defined $term; $term =~ s/^moby://; # if the term is namespaced, then remove that if ( $term =~ /^urn:lsid/ && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) From mwilkinson at pub.open-bio.org Fri Sep 30 19:14:13 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Fri Sep 30 20:05:17 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509302314.j8UNED1p008168@pub.open-bio.org> mwilkinson Fri Sep 30 19:14:12 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv8149/MOBY Modified Files: OntologyServer.pm Log Message: OntologyServer was returning NCBI_Acc as the namespace if you passed it a null query. Yuck moby-live/Perl/MOBY OntologyServer.pm,1.87,1.88 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.87 retrieving revision 1.88 diff -u -r1.87 -r1.88 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/30 23:08:35 1.87 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/30 23:14:12 1.88 @@ -191,7 +191,7 @@ $term =~ s/^moby://; # if the term is namespaced, then remove that my $sth; return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); - return (0, undef, undef) unless defined $term; + return (0, undef, undef) unless $term; my $result; @@ -654,7 +654,7 @@ { return ( 1, "external ontology", $term ); } - return (0, undef, undef) unless defined $term; + return (0, undef, undef) unless $term; my $result; $result = $adaptor->query_service(type => $term); @@ -786,7 +786,7 @@ return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'namespace' ); my $term = $args{term}; - return (0, undef, undef) unless defined $term; + return (0, undef, undef) unless $term; $term =~ s/^moby://; # if the term is namespaced, then remove that if ( $term =~ /^urn:lsid/ && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) From mwilkinson at pub.open-bio.org Fri Sep 30 19:23:13 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Fri Sep 30 20:14:20 2005 Subject: [MOBY-guts] biomoby commit Message-ID: <200509302323.j8UNNDR8008272@pub.open-bio.org> mwilkinson Fri Sep 30 19:23:13 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv8253/MOBY Modified Files: CommonSubs.pm Log Message: the behaviour of getNodeContentsWithArticle were not as advertised in the documentation. They should be now. Text content of the outermost MOBY object node can be extracted if you pass it either the that node, or the Simple article containing that node. moby-live/Perl/MOBY CommonSubs.pm,1.69,1.70 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.69 retrieving revision 1.70 diff -u -r1.69 -r1.70 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/09/21 19:05:14 1.69 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/09/30 23:23:13 1.70 @@ -972,6 +972,13 @@ my @contents; return () unless ( (ref( $node ) =~ /XML\:\:LibXML/) && $element); + + my $nodes = $node->getElementsByTagName( $element ); + unless ( $nodes->get_node( 1 ) ) { + $nodes = $node->getElementsByTagName("moby:$element"); + } + $node = $nodes->get_node(1); # this routine should only ever be called if there is only one possible answer, so this is safe + unless ($articleName){ # the request is for root node if no articleName my $resp; foreach my $child($node->childNodes){ @@ -983,11 +990,6 @@ return @contents; } - my $nodes = $node->getElementsByTagName( $element ); - unless ( $nodes->get_node( 1 ) ) { - $nodes = $node->getElementsByTagName("moby:$element"); - } - # if there is an articleName, then get that specific node for ( 1 .. $nodes->size() ) { my $child = $nodes->get_node( $_ ); From senger at pub.open-bio.org Thu Sep 1 01:51:18 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 1 Sep 2005 01:51:18 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509010551.j815pIJa003222@pub.open-bio.org> senger Thu Sep 1 01:51:18 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv3203 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.25,1.26 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/01 01:30:07 1.25 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/01 05:51:18 1.26 @@ -612,10 +612,21 @@ - - - - + + + + + + + + + From senger at pub.open-bio.org Thu Sep 1 01:51:18 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 1 Sep 2005 01:51:18 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509010551.j815pIw8003237@pub.open-bio.org> senger Thu Sep 1 01:51:18 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv3203/src/Clients Added Files: TestArgs.java Log Message: moby-live/Java/src/Clients TestArgs.java,NONE,1.1 From senger at pub.open-bio.org Thu Sep 1 04:01:16 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 1 Sep 2005 04:01:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509010801.j8181GTC004629@pub.open-bio.org> senger Thu Sep 1 04:01:16 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv4610 Modified Files: build.xml Log Message: windows scripts improved moby-live/Java build.xml,1.26,1.27 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/01 05:51:18 1.26 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/01 08:01:16 1.27 @@ -618,7 +618,7 @@ --> - + From senger at pub.open-bio.org Thu Sep 1 04:01:16 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 1 Sep 2005 04:01:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509010801.j8181Gau004648@pub.open-bio.org> senger Thu Sep 1 04:01:16 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv4610/docs Modified Files: ChangeLog Log Message: windows scripts improved moby-live/Java/docs ChangeLog,1.38,1.39 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/08/31 11:39:06 1.38 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/01 08:01:16 1.39 @@ -1,3 +1,8 @@ +2005-09-01 Martin Senger + + * Fixed the Windows run...bat scripts in order to accept spaces in + the file names (many double quotes added) + 2005-08-31 Martin Senger * Fixed build.xml (javadoc target) to run under Windows (newlines From senger at pub.open-bio.org Thu Sep 1 04:01:16 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 1 Sep 2005 04:01:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509010801.j8181GXN004701@pub.open-bio.org> senger Thu Sep 1 04:01:16 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv4610/src/config Modified Files: run-any-client.bat run-cache-client.bat run-cmdline-client.bat run-digest-client.bat run-generator.bat run-graphs-client.bat run-moby-parser.bat run-service.bat run-testing-central.bat Log Message: windows scripts improved moby-live/Java/src/config run-any-client.bat,1.2,1.3 run-cache-client.bat,1.1,1.2 run-cmdline-client.bat,1.1,1.2 run-digest-client.bat,1.1,1.2 run-generator.bat,1.1,1.2 run-graphs-client.bat,1.1,1.2 run-moby-parser.bat,1.1,1.2 run-service.bat,1.1,1.2 run-testing-central.bat,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-any-client.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/08/26 06:27:03 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/09/01 08:01:16 1.3 @@ -1,12 +1,12 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% -set CP=%PROJECT_HOME%\build\others\datatypes;%CP% -set CP=%PROJECT_HOME%\build\others\skeletons;%CP% -set CP=%PROJECT_HOME%\build\others\samples;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" +set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" +set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" +set "CP=%PROJECT_HOME%\build\others\samples;%CP%" -java -classpath %CP% %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat 2004/11/14 16:12:50 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat 2005/09/01 08:01:16 1.2 @@ -1,9 +1,9 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" -java -classpath %CP% CacheRegistryClient %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" CacheRegistryClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2004/09/23 00:18:01 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2005/09/01 08:01:16 1.2 @@ -1,9 +1,9 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" -java -classpath %CP% MobyCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" MobyCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat 2004/11/14 16:43:49 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat 2005/09/01 08:01:16 1.2 @@ -1,9 +1,9 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" -java -classpath %CP% MobyDigestClient %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" MobyDigestClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-generator.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-generator.bat 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-generator.bat 2005/09/01 08:01:16 1.2 @@ -1,11 +1,11 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% -set CP=%PROJECT_HOME%\build\others\datatypes;%CP% -set CP=%PROJECT_HOME%\build\others\skeletons;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" +set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" +set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" -java -classpath %CP% MosesGenerators %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" MosesGenerators %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat 2004/09/23 00:18:01 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat 2005/09/01 08:01:16 1.2 @@ -1,9 +1,9 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" -java -classpath %CP% MobyGraphs %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" MobyGraphs %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat 2005/09/01 08:01:16 1.2 @@ -1,10 +1,10 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% -set CP=%PROJECT_HOME%\build\others\datatypes;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" +set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" -java -classpath %CP% TestingMobyParser %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" TestingMobyParser %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-service.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-service.bat 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-service.bat 2005/09/01 08:01:16 1.2 @@ -1,12 +1,12 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% -set CP=%PROJECT_HOME%\build\others\datatypes;%CP% -set CP=%PROJECT_HOME%\build\others\skeletons;%CP% -set CP=%PROJECT_HOME%\build\others\samples;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" +set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" +set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" +set "CP=%PROJECT_HOME%\build\others\samples;%CP%" -java -classpath %CP% org.biomoby.client.BaseCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" org.biomoby.client.BaseCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat 2004/09/23 00:18:01 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat 2005/09/01 08:01:16 1.2 @@ -1,9 +1,9 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" -java -classpath %CP% TestingCentral %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" TestingCentral %1 %2 %3 %4 %5 %6 %7 %8 %9 From fgibbons at pub.open-bio.org Thu Sep 1 09:50:46 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Thu, 1 Sep 2005 09:50:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509011350.j81DokKV005950@pub.open-bio.org> fgibbons Thu Sep 1 09:50:46 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv5921/t Modified Files: Client-Central.t Client-Service.t Log Message: - Make distinctions in API moby-live/Perl/t Client-Central.t,1.40,1.41 Client-Service.t,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Central.t,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- /home/repository/moby/moby-live/Perl/t/Client-Central.t 2005/08/31 22:31:55 1.40 +++ /home/repository/moby/moby-live/Perl/t/Client-Central.t 2005/09/01 13:50:46 1.41 @@ -11,7 +11,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; #use SOAP::Lite +trace; -use Test::More 'no_plan'; #tests => 127; # perldoc Test::More for details +use Test::More 'no_plan'; #skip_all => "Turn off for development"; # See perldoc Test::More for details use strict; use Data::Dumper; #Is the client-code even installed? @@ -55,7 +55,31 @@ isa_ok( $C, 'MOBY::Client::Central',"Connected to test MOBY Central") or die("Cannot Connect to MOBY Central... cannot continue?"); +############ ENFORCE REGISTRY API ############### +# First, mandatory methods for all registries. +my @mandatory = qw/findService retrieveService +retrieveResourceURLs retrieveServiceProviders retrieveServiceNames +retrieveServiceTypes retrieveObjectNames retrieveObjectDefinition +retrieveNamespaces retrieveObjectSchema Relationships/; + +my @mandatory_if_write_access = qw/registerObjectClass deregisterObjectClass +registerServiceType deregisterServiceType +registerNamespace deregisterNamespace +registerService deregisterService/; + +my @optional_recommended = qw/DUMP registerServiceWSDL/; + +can_ok($C, @mandatory ) + or diag("Registry failed to supply mandatory methods"); + +# How do we check whether the registry has 'write' access - most will, so take as default. +can_ok($C, @mandatory_if_write_access) + or diag("Registry has 'write' access and failed to supply mandatory methods"); +# Optional, but probably recommended methods +can_ok($C, @optional_recommended) + or diag("Registry does not supply certain optional methods;\n" + . "you should consider adding them"); ################## MOBY Registration Tests ################# ################## OBJECT REGISTRATION ############# =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Service.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/08/30 19:14:29 1.1 +++ /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/01 13:50:46 1.2 @@ -40,8 +40,8 @@ Even if we do that, we should clearly specify which is the preferred name. OPINION -can_ok("MOBY::Client::Service", qw/new execute ServiceName/) - or diag($opinion); +my @API = qw/new execute ServiceName/; +can_ok("MOBY::Client::Service", @API) or diag($opinion); is(MOBY::Client::Service->new(), undef) or diag("Created a new service without supplying any WSDL - it ain't right, I tell you!"); # Can't do nothing without WSDL From fgibbons at pub.open-bio.org Thu Sep 1 10:00:00 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Thu, 1 Sep 2005 10:00:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509011400.j81E00jc006035@pub.open-bio.org> fgibbons Thu Sep 1 10:00:00 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv6010/MOBY Modified Files: CommonSubs.pm Log Message: - Test for namespace agreement in a way that avoids warning messages. Also remove redundant 'name:' lines, which merely duplicate the =head2 lines above them. moby-live/Perl/MOBY CommonSubs.pm,1.67,1.68 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.67 retrieving revision 1.68 diff -u -r1.67 -r1.68 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/08/30 15:31:52 1.67 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/09/01 14:00:00 1.68 @@ -248,7 +248,6 @@ =head2 genericServiceInputParser - name : genericServiceInputParser function : For the MOST SIMPLE SERVICES that take single Simple or Collection inputs and no Secondaries/Parameters this routine takes the MOBY message and breaks the objects out of it in a useful way @@ -329,7 +328,7 @@ =head2 serviceInputParser - name : DO NOT USE!! + DO NOT USE!! function : to take a MOBY message and break the objects out of it. This is identical to the genericServiceInputParser method above, except that it returns the data as Objects rather than XML::LibXML nodes. This is an improvement! @@ -372,7 +371,6 @@ =head2 complexServiceInputParser - name : complexServiceInputParser function : For more complex services that have multiple articles for each input and/or accept parameters, this routine will take a MOBY message and extract the Simple/Collection/Parameter objects out of it in a @@ -534,7 +532,6 @@ =head2 getSimpleArticleIDs - name : getSimpleArticleIDs function : to get the IDs of simple articles that are in the given namespace usage : my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles); my @ids = getSimpleArticleIDs(\@SimpleArticles); @@ -566,15 +563,17 @@ return undef unless scalar @{$input_nodes}; my @input_nodes = @{$input_nodes}; my $OS = MOBY::Client::OntologyServer->new; - my ( $s, $m ); + my ( $s, $m, $namespace_lsid ); if ( $desired_namespace ) { - ( $s, $m, $desired_namespace ) = + ( $s, $m, $namespace_lsid ) = $OS->namespaceExists( term => $desired_namespace ); # returns (success, message, lsid) unless ( $s ) { # bail if not successful - print STDERR - "MOBY::CommonSubs WARNING ** the namespace '$desired_namespace' does not exist in the MOBY ontology, and is not a valid LSID\n"; + # Printing to STDERR is not very helpful - we should probably return something that can be dealt iwth programatically.... + print STDERR "MOBY::CommonSubs WARNING ** the namespace '$desired_namespace' " + . "does not exist in the MOBY ontology, and does not have a valid LSID\n"; return undef; } + $desired_namespace = $namespace_lsid; # Replace namespace with fully-qualified LSID } my @ids; foreach my $in ( @input_nodes ) { @@ -593,13 +592,15 @@ } $ns = $ns->getValue; # if we have a namespace, then get its value ( $s, $m, $ns ) = $OS->namespaceExists( term => $ns ); - unless ( $ns eq $desired_namespace ) + # A bad namespace will return 'undef' which makes for a bad comparison (Perl warning). + # Better to check directly for success ($s), THEN check that namespace is the one we wanted. + unless ( $s && $ns eq $desired_namespace ) { # we are registering as working in a particular namespace, so check this push @ids, undef; # and push undef onto the stack if it isn't next; } } - + # Now do the same thing for ID's my $id = $_->getAttributeNode( 'id' ) || $_->getAttributeNode( 'moby:id' ); unless ( $id ) { @@ -619,7 +620,6 @@ =head2 getSimpleArticleNamespaceURI - name : getSimpleArticleNamespaceURI function : to get the namespace of a simple article usage : my $ns = getSimpleArticleNamespaceURI($SimpleArticle); args : $Simple - (required) a single XML::LibXML node representing a Simple Article @@ -655,7 +655,6 @@ =head2 simpleResponse - name : simpleResponse function : wraps a simple article in the appropriate (mobyData) structure usage : $resp .= &simpleResponse($object, 'MyArticleName', $queryID); args : (in order) @@ -700,7 +699,6 @@ =head2 collectionResponse - name : collectionResponse function : wraps a set of articles in the appropriate mobyData structure usage : return responseHeader . &collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter; args : (in order) @@ -753,7 +751,6 @@ =head2 complexResponse - name : complexResponse function : wraps articles in the appropriate (mobyData) structure usage : $resp .= &complexResponse(\@data, $qID); args : (in order) @@ -809,7 +806,6 @@ =head2 responseHeader - name : responseHeader function : print the XML string of a MOBY response header +/- serviceNotes usage : responseHeader('illuminae.com') responseHeader( @@ -846,7 +842,6 @@ =head2 responseFooter - name : responseFooter function : print the XML string of a MOBY response footer usage : return responseHeader('illuminae.com') . $DATA . responseFooter; notes : returns everything required after the response articles themselves @@ -880,7 +875,6 @@ =head2 getInputs - name : getInputs function : get the mobyData block(s) as XML::LibXML nodes usage : @queryInputs = getInputArticles($XML) args : the raw XML of a query, or an XML::LibXML document @@ -908,7 +902,6 @@ =head2 getInputID - name : getInputID function : get the value of the queryID element usage : @queryInputs = getInputID($XML) args : the raw XML or XML::LibXML of a queryInput or mobyData block (e.g. from getInputs) @@ -931,7 +924,7 @@ =head2 getArticlesAsObjects - name : DO NOT USE!! + DO NOT USE!! function : get the Simple/Collection articles for a single mobyData or queryResponse node, rethrning them as SimpleArticle, SecondaryArticle, or ServiceInstance objects @@ -970,7 +963,6 @@ =head2 getCollectedSimples - name : getCollectedSimples function : get the Simple articles collected in a moby:Collection block usage : @Simples = getCollectedSimples($XML) args : raw XML or XML::LibXML of a moby:Collection block @@ -995,7 +987,6 @@ =head2 getInputArticles - name : getInputArticles function : get the Simple/Collection articles for each input query, in order usage : @queries = getInputArticles($XML) args : the raw XML of a moby:MOBY query @@ -1050,7 +1041,6 @@ =head2 isSimpleArticle - name : isSimpleArticle function : tests XML (text) or an XML DOM node to see if it represents a Simple article usage : if (isSimpleArticle($node)){do something to it} input : an XML::LibXML node, an XML::LibXML::Document or straight XML @@ -1071,7 +1061,6 @@ =head2 isCollectionArticle - name : isCollectionArticle function : tests XML (text) or an XML DOM node to see if it represents a Collection article usage : if (isCollectionArticle($node)){do something to it} input : an XML::LibXML node, an XML::LibXML::Document or straight XML @@ -1090,7 +1079,6 @@ =head2 isSecondaryArticle - name : isSecondaryArticle function : tests XML (text) or an XML DOM node to see if it represents a Secondary article usage : if (isSecondaryArticle($node)){do something to it} input : an XML::LibXML node, an XML::LibXML::Document or straight XML @@ -1111,7 +1099,6 @@ =head2 extractRawContent - name : extractRawContent function : pass me an article (Simple, or Collection) and I'll give you the content AS A STRING - i.e. the raw XML of the contained MOBY Object(s) usage : extractRawContent($simple) @@ -1133,7 +1120,6 @@ =head2 getNodeContentWithArticle - name : getNodeContentWithArticle function : a very flexible way to get the stringified content of a node that has the correct element and article name or get the value of a Parameter element. @@ -1296,7 +1282,6 @@ =head2 validateNamespaces - name : validateNamespaces function : checks the namespace ontology for the namespace lsid usage : @LSIDs = validateNamespaces(@namespaces) args : ordered list of either human-readable or lsid presumptive namespaces @@ -1321,7 +1306,6 @@ =head2 validateThisNamespace - name : validateThisNamespace function : checks a given namespace against a list of valid namespaces usage : $valid = validateThisNamespace($ns, @validNS); args : ordered list of the namespace of interest and the list of valid NS's @@ -1339,7 +1323,6 @@ =head2 getResponseArticles (a.k.a. extractResponseArticles) - name : getResponseArticles function : get the DOM nodes corresponding to individual Simple or Collection outputs from a MOBY Response usage : ($collections, $simples) = getResponseArticles($node) @@ -1411,7 +1394,6 @@ =head2 getServiceNotes - name : getServiceNotes function : to get the content of the Service Notes block of the MOBY message usage : getServiceNotes($message) args : $message is either the XML::LibXML of the MOBY message, or plain XML @@ -1443,7 +1425,6 @@ =head2 getCrossReferences - name : getCrossReferences function : to get the cross-references for a Simple article usage : @xrefs = getCrossReferences($XML) args : $XML is either a SIMPLE article (...) @@ -1501,7 +1482,6 @@ =head2 whichDeepestParentObject - name : whichDeepestParentObject function : select the parent node from nodeList that is closest to the querynode usage : ($term, $lsid) = whichDeepestParentObject($CENTRAL, $queryTerm, \@termList) From fgibbons at pub.open-bio.org Thu Sep 1 12:09:40 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Thu, 1 Sep 2005 12:09:40 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509011609.j81G9e0G006651@pub.open-bio.org> fgibbons Thu Sep 1 12:09:40 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv6626/t Modified Files: Client-OntologyServer.t Log Message: - Test that 'Exists' functions return success/failure when they should. The relationship function seems to fail, perhaps the test is wrong. moby-live/Perl/t Client-OntologyServer.t,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/08/31 14:17:11 1.1 +++ /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/01 16:09:39 1.2 @@ -14,8 +14,6 @@ #use SOAP::Lite +trace; use Test::More 'no_plan'; # perldoc Test::More for details use strict; -use English; -use Data::Dumper; use MOBY::Client::OntologyServer; #Is the client-code even installed? BEGIN { use_ok('MOBY::Client::OntologyServer') }; @@ -33,8 +31,68 @@ my @API = (@autoload, qw/new getUserAgent objectExists serviceExists namespaceExists relationshipExists/); -my $si = MOBY::Client::OntologyServer->new(); -foreach (@autoload) {eval{$si->$_};} # Call all AUTOLOAD methods, to create them. +my $os = MOBY::Client::OntologyServer->new(); +foreach (@autoload) {eval{$os->$_};} # Call all AUTOLOAD methods, to create them. can_ok("MOBY::Client::OntologyServer", @API) or diag("OntologyServer doesn't implement full API"); +################ CHECK THAT VALID STUFF RETURNS CORRECTLY ########## +# +# It would really be better not to have literal lists of valid namespaces here, +# Can we pull the entire list of valid namespaces in programmatically from somewhere, +# and check them all here? Ditto for Objects, Service-types +# +my ($success, $msg, $existingURI); +my @check_ns = qw/SGD NCBI_gi/; +foreach (@check_ns) { + ($success, $msg, $existingURI) = $os->namespaceExists( term => $_); + is($success, 1) + or diag("Namespace '$_' reported erroneously as non-existent."); +} + +my @check_obj = qw/ Object String Integer Float/; +foreach (@check_obj) { + ($success, $msg, $existingURI) = $os->objectExists(term => $_); + is($success, 1) + or diag("Object '$_' reported erroneously as non-existent."); +} + +my @check_servicetype = qw/Retrieval/; +foreach (@check_servicetype) { + ($success, $msg, $existingURI) = $os->serviceExists(term => $_); + is($success, 1) + or diag("Service type '$_' reported erroneously as non-existent."); +} + +my @check_rel = qw/ISA HASA HAS/; +foreach (@check_rel) { + ($success, $msg, $existingURI) = $os->relationshipExists(term => $_); + is($success, 1) + or diag("Relationship '$_' reported erroneously as non-existent."); +} + + +######### CHECK THAT *IN*VALID STUFF FAILS CORRECTLY ############### +# +# Literal invalid names are OK here, since there's no obvious way to generate them +# and guarantee that they'll be invalid. +# +my $invalid_ns = "InvalidNS"; +($success, $msg, $existingURI) = $os->namespaceExists( term => $invalid_ns); +is($success, 0) + or diag("Namespace '$invalid_ns' reported erroneously as existent."); + +my $invalid_obj = "InvalidObject"; +($success, $msg, $existingURI) = $os->objectExists(term => $invalid_obj); +is($success, 0) + or diag("Object '$invalid_obj' reported erroneously as existent."); + +my $invalid_st = "InvalidServiceType"; +($success, $msg, $existingURI) = $os->serviceExists(term => $invalid_st); +is($success, 0) + or diag("Service type '$invalid_st' reported erroneously as existent."); + +my $invalid_rel = "HA"; +($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel); +is($success, 0) + or diag("Relationship '$invalid_rel' reported erroneously as existent."); From mwilkinson at pub.open-bio.org Thu Sep 1 16:04:40 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 1 Sep 2005 16:04:40 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509012004.j81K4eVc007213@pub.open-bio.org> mwilkinson Thu Sep 1 16:04:40 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv7194/MOBY/Client Modified Files: Service.pm Log Message: fixed docs for Client Service, added a version attribute to the MOBY tag. moby-live/Perl/MOBY/Client Service.pm,1.20,1.21 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/06/30 11:47:19 1.20 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/09/01 20:04:40 1.21 @@ -66,8 +66,9 @@ ( service => [ undef, 'read/write' ], uri => [ undef, 'read/write' ], - ServiceName => [ undef, 'read/write' ], + serviceName => [ undef, 'read/write' ], _soapService => [ undef, 'read/write' ], + smessageVersion => ['0.87', 'read' ], ); #_____________________________________________________________ @@ -123,7 +124,7 @@ return undef unless $wsdl; my $soap = SOAP::Lite->service( "data:,$wsdl" ); if ( $self->uri ) { $soap->uri( $self->uri ) } - $self->ServiceName( &getServiceName( $soap ) ); + $self->serviceName( &_getServiceName( $soap ) ); $self->_soapService( $soap ); return $self; } @@ -219,8 +220,9 @@ # this was added on January 19th, 2005 and may not work! ################### ################### + my $version = $self->smessageVersion(); $data = " - + $data @@ -246,11 +248,21 @@ return $@ ? "" : $response; # the service execution failed then pass back "" } -=head2 ServiceName +=head2 serviceName - Title : ServiceName - Usage : $name = $Service->name() - Function : retrieve the name of your service + Title : serviceName + Usage : $name = $Service->serviceName() + Function : get the name of the service + Returns : string + Args : none + +=cut + +=head2 _getServiceName + + Title : getServiceName + Usage : $name = $Service->getServiceName() + Function : Internal method to retrieve the name of the service from the SOAP object Returns : string Args : none From mwilkinson at pub.open-bio.org Thu Sep 1 16:14:17 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 1 Sep 2005 16:14:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509012014.j81KEHXm007298@pub.open-bio.org> mwilkinson Thu Sep 1 16:14:17 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv7279/MOBY/Client Modified Files: Service.pm Log Message: fixed docs for Client Service, added a version attribute to the MOBY tag. moby-live/Perl/MOBY/Client Service.pm,1.21,1.22 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/09/01 20:04:40 1.21 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/09/01 20:14:17 1.22 @@ -241,7 +241,7 @@ # $data # #]]>"; - my $METHOD = $self->ServiceName; + my $METHOD = $self->serviceName; &_LOG( %args, $METHOD ); my $response; eval { ( $response ) = $self->_soapService->$METHOD( $data ) }; @@ -260,8 +260,8 @@ =head2 _getServiceName - Title : getServiceName - Usage : $name = $Service->getServiceName() + Title : _getServiceName + Usage : $name = $Service->_getServiceName() Function : Internal method to retrieve the name of the service from the SOAP object Returns : string Args : none From mwilkinson at pub.open-bio.org Thu Sep 1 16:16:04 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 1 Sep 2005 16:16:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509012016.j81KG4aH007386@pub.open-bio.org> mwilkinson Thu Sep 1 16:16:04 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv7367/MOBY/Client Modified Files: Service.pm Log Message: fixed docs for Client Service, added a version attribute to the MOBY tag. moby-live/Perl/MOBY/Client Service.pm,1.22,1.23 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/09/01 20:14:17 1.22 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/09/01 20:16:04 1.23 @@ -268,7 +268,7 @@ =cut -sub getServiceName { +sub _getServiceName { my ( $service ) = @_; no strict; my ( $method ) = @{ join '::', ref $service, 'EXPORT_OK' }; From mwilkinson at pub.open-bio.org Thu Sep 1 16:20:13 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 1 Sep 2005 16:20:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509012020.j81KKDs7007458@pub.open-bio.org> mwilkinson Thu Sep 1 16:20:13 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv7439/t Modified Files: Client-Service.t Log Message: updating test for ClientService moby-live/Perl/t Client-Service.t,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Service.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/01 13:50:46 1.2 +++ /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/01 20:20:13 1.3 @@ -33,14 +33,9 @@ my $opinion = <new(), undef) From senger at pub.open-bio.org Fri Sep 2 03:31:50 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 2 Sep 2005 03:31:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020731.j827VoHB009022@pub.open-bio.org> senger Fri Sep 2 03:31:50 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv9004/dashboard Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard added to the repository moby-live/Java/src/main/org/biomoby/service/dashboard - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Sep 2 03:37:42 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 2 Sep 2005 03:37:42 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020737.j827bgxr009068@pub.open-bio.org> senger Fri Sep 2 03:37:42 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files In directory pub.open-bio.org:/tmp/cvs-serv9050/doc-files Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files added to the repository moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Sep 2 03:38:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 2 Sep 2005 03:38:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020738.j827calY009132@pub.open-bio.org> senger Fri Sep 2 03:38:35 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv9113 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.27,1.28 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/01 08:01:16 1.27 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/02 07:38:35 1.28 @@ -80,6 +80,9 @@ + + + From senger at pub.open-bio.org Fri Sep 2 03:38:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 2 Sep 2005 03:38:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020738.j827caMg009151@pub.open-bio.org> senger Fri Sep 2 03:38:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv9113/src/config Modified Files: run-any-client Log Message: moby-live/Java/src/config run-any-client,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-any-client,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-any-client 2005/08/26 06:27:03 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-any-client 2005/09/02 07:38:36 1.3 @@ -15,5 +15,6 @@ CLASSPATH=${PROJECT_HOME}/build/others/skeletons:$CLASSPATH CLASSPATH=${PROJECT_HOME}/build/others/samples:$CLASSPATH CLASSPATH=`echo ${PROJECT_HOME}/lib/*.jar | tr ' ' ':'`:$CLASSPATH +###CLASSPATH=`echo ${PROJECT_HOME}/lib/ant_home/lib/*.jar | tr ' ' ':'`:$CLASSPATH exec java -cp $CLASSPATH "$@" From senger at pub.open-bio.org Fri Sep 2 03:38:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 2 Sep 2005 03:38:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020738.j827calM009185@pub.open-bio.org> senger Fri Sep 2 03:38:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files In directory pub.open-bio.org:/tmp/cvs-serv9113/src/main/org/biomoby/service/dashboard/doc-files Added Files: code-generators-panel.jpg dashboard.jpg deployment-panel.jpg registration-panel.jpg registry-panel.jpg testing-panel.jpg Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files code-generators-panel.jpg,NONE,1.1 dashboard.jpg,NONE,1.1 deployment-panel.jpg,NONE,1.1 registration-panel.jpg,NONE,1.1 registry-panel.jpg,NONE,1.1 testing-panel.jpg,NONE,1.1 From senger at pub.open-bio.org Fri Sep 2 03:38:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 2 Sep 2005 03:38:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020738.j827caip009167@pub.open-bio.org> senger Fri Sep 2 03:38:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv9113/src/main/org/biomoby/service/dashboard Added Files: AbstractPanel.java DashboardPanel.java RegistryPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard AbstractPanel.java,NONE,1.1 DashboardPanel.java,NONE,1.1 RegistryPanel.java,NONE,1.1 From fgibbons at pub.open-bio.org Fri Sep 2 10:29:30 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 2 Sep 2005 10:29:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509021429.j82ETU9n010579@pub.open-bio.org> fgibbons Fri Sep 2 10:29:30 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv10554/t Modified Files: Client-Service.t Log Message: - Call autoload methods to generate code. Still fails on serviceName method. moby-live/Perl/t Client-Service.t,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Service.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/01 20:20:13 1.3 +++ /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/02 14:29:30 1.4 @@ -26,28 +26,23 @@ }; -TODO: { - local $TODO = "Test: new, execute, name, and autoload methods."; - -} - -my $opinion = <new(), undef) +my @autoload = qw/serviceName/; +my @API = (@autoload, qw/new execute/); +my $service = MOBY::Client::Service->new(); +is($service, undef) or diag("Created a new service without supplying any WSDL - it ain't right, I tell you!"); # Can't do nothing without WSDL +foreach (@autoload) { eval{$service->$_()}; } # Call all autoloads, to create them. +can_ok("MOBY::Client::Service", @API) + or diag("MOBY::Client::Service doesn't implement full API."); + # Find a service at MOBY Central, try to create a local instance. my $C = MOBY::Client::Central->new(); my ($s, $r) = $C->findService( authURI => 'www.illuminae.com', name => 'getDragonLocusAlleles' ); ok($s) or diag("Couldn't retrieve service details from MOBY Central"); my $wsdl = $C->retrieveService($$s[0]); -my $service = MOBY::Client::Service->new (service => $wsdl); +$service = MOBY::Client::Service->new (service => $wsdl); isa_ok($service, "MOBY::Client::Service") or diag("Expected new to return MOBY::Client::Service"); From fgibbons at pub.open-bio.org Fri Sep 2 10:32:15 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 2 Sep 2005 10:32:15 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509021432.j82EWFBJ010628@pub.open-bio.org> fgibbons Fri Sep 2 10:32:15 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv10603/t Modified Files: Client-SimpleArticle.t Log Message: - Check API for SimpleArticle. Looks like calls to ->XML() don't do what you'd expect: parse the XML, and modify the object. moby-live/Perl/t Client-SimpleArticle.t,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t 2005/08/31 14:17:11 1.1 +++ /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t 2005/09/02 14:32:15 1.2 @@ -31,7 +31,7 @@ my @autoload = qw/articleName objectType objectLSID namespaces id XML XML_DOM isSimple isCollection isSecondary/; -my @API = (@autoload, qw/new createFromXML createFromDOM/); +my @API = (@autoload, qw/new addNamespace value /); # createFrom[XML|DOM] are not meant to be public my $smpl = MOBY::Client::SimpleArticle->new(); foreach (@autoload) {eval{$smpl->$_};} # Call all AUTOLOAD methods, to create them. @@ -43,3 +43,105 @@ is($smpl->isSecondary, 0) or diag("SimpleArticle cannot be Secondary"); is($smpl->isCollection, 0) or diag("SimpleArticle cannot be Collection"); +my $aName = 'my Article'; +is($smpl->articleName($aName), $aName) or diag("Couldn't set articleName"); +is($smpl->articleName(), $aName) or diag("Couldn't get articleName"); + +my $obj_type = 'String'; +is($smpl->objectType($obj_type), $obj_type) or diag("Couldn't set objectType"); +is($smpl->objectType(), $obj_type) or diag("Couldn't get objectType"); + +my $obj_lsid = 'String'; +is($smpl->objectLSID($obj_lsid), $obj_lsid) or diag("Couldn't set objectLSID"); +is($smpl->objectLSID(), $obj_lsid) or diag("Couldn't get objectLSID"); + +my @ns = qw/SGD FB GO/; +eq_array($smpl->namespaces(\@ns), \@ns) or diag("Couldn't set namespaces"); +eq_array($smpl->namespaces(), \@ns) or diag("Couldn't get namespaces"); + +my $new_ns = 'NCBI_gi'; +# Order is critical in this test: FIRST get existing namespaces, THEN add one, and CHECK +eq_array( [@{$smpl->namespaces()}, $new_ns ], $smpl->addNamespace($new_ns)) + or diag("Couldn't add new namespace ('$new_ns')"); + +# Check XML-generation code. +# In reality, (XML, createFromXML) and (XML_DOM, createFromDOM) should behave the same. +# Let's not assume that though. + +my ($artName, $ns, $id, $obj, $lsid) + = ('my Article', 'SGD', 'S0005111', 'Object', 'urn:foo:bar:my_lsid'); +my $xml_smpl = < + + +XML + +$smpl = MOBY::Client::SimpleArticle->new( XML => $xml_smpl); + +is($smpl->objectLSID(), $lsid) + or diag("SimpleArticle not correctly built from XML (LSID wrong)"); + +is($smpl->articleName(), $artName) + or diag("SimpleArticle not correctly built from XML (articleName wrong)"); + +is($smpl->objectType(), $obj) + or diag("SimpleArticle not correctly built from XML (objectType wrong)"); + +eq_array($smpl->namespaces(), [$ns]) + or diag("SimpleArticle not correctly built from XML (namespace wrong)"); + +is($smpl->id(), $id) + or diag("SimpleArticle not correctly built from XML (id wrong)"); + +sub XML_maker { # Turn XML text into DOM. + my $XML = shift; + my $parser = XML::LibXML->new(); + my $doc; + eval { $doc = $parser->parse_string( $XML ); }; + return '' if ( $EVAL_ERROR ); #("Couldn't parse '$XML' because:\n\t$EVAL_ERROR") + return $doc->getDocumentElement(); +} + + +$smpl = MOBY::Client::SimpleArticle->new( XML_DOM => XML_maker($xml_smpl)); + +is($smpl->objectLSID(), $lsid) + or diag("SimpleArticle not correctly built from XML_DOM (LSID wrong)"); + +is($smpl->articleName(), $artName) + or diag("SimpleArticle not correctly built from XML_DOM (articleName wrong)"); + +is($smpl->objectType(), $obj) + or diag("SimpleArticle not correctly built from XML_DOM (objectType wrong)"); + +eq_array($smpl->namespaces(), [$ns]) + or diag("SimpleArticle not correctly built from XML_DOM (namespace wrong)"); + +is($smpl->id(), $id) + or diag("SimpleArticle not correctly built from XML_DOM (id wrong)"); + + +TODO: { + local $TODO = <new()->XML(\$xml), +I expect that the XML will be *parsed*, to modify the object, +not that the attribute 'XML' will be set, and the rest left unchanged." +TODO + + $smpl = MOBY::Client::SimpleArticle->new(); + $smpl->XML($xml_smpl); + is($smpl->objectLSID(), $lsid) + or diag("Couldn't create SimpleArticle from autoloaded method XML(): LSID wrong"); + + is($smpl->articleName, $artName) + or diag("Couldn't create SimpleArticle from autoloaded method XML(): articleName wrong"); + + is($smpl->objectType(), $obj) + or diag("Couldn't create SimpleArticle from autoloaded method XML(): objectType wrong"); + + eq_array($smpl->namespaces(), [$ns]) + or diag("Couldn't create SimpleArticle from autoloaded method XML(): namespaces wrong"); + + is($smpl->id(), $id) + or diag("Couldn't create SimpleArticle from autoloaded method XML(): id wrong"); +} From fgibbons at pub.open-bio.org Fri Sep 2 10:39:21 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 2 Sep 2005 10:39:21 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509021439.j82EdLtE010687@pub.open-bio.org> fgibbons Fri Sep 2 10:39:20 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv10661 Modified Files: SimpleArticle.pm Log Message: - The tests drove out a few bugs: * extraction of lsid from element was incorrect. * call to the XML method does nothing except set the value of the $self->XML component to the string passed in as the argument. This isn't what you'd expect, since everything else is a get/set method, and setting the XML to a string that doesn't reflect the actual object is not likely to be useful in an API. Solution: Either we remove it from the API, i.e., make it a private method; or we make it do the right thing (see above). - Removed redundant 'Title' lines in perldoc. moby-live/Perl/MOBY/Client SimpleArticle.pm,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm 2005/07/29 18:58:44 1.8 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm 2005/09/02 14:39:20 1.9 @@ -53,7 +53,6 @@ =head2 new - Title : new Usage : my $SA = MOBY::Client::SimpleArticle->new(%args) Function : create SimpleArticle object Returns : MOBY::Client::SimpleArticle object @@ -64,81 +63,60 @@ XML_DOM => $XML::DOM::NODE -=cut =head2 articleName - Title : articleName Usage : $name = $SA->articleName($name) Function : get/set articleName Returns : string Arguments : (optional) string representing articleName to set -=cut - =head2 objectType - Title : objectType Usage : $type = $SA->objectType($type) Function : get/set name Returns : string Arguments : (optional) string representing objectType to set -=cut - =head2 objectLSID - Title : objectLSID Usage : $type = $SA->objectLSID($type) Function : get/set LSID Returns : string Arguments : (optional) string representing objectLSID to set -=cut - =head2 namespaces - Title : namespaces Usage : $namespaces = $SA->namespaces(\@namespaces) Function : get/set namespaces for the objectType Returns : arrayref of namespace strings Arguments : (optional) arrayref of namespace strings to set -=cut =head2 XML - Title : XML Usage : $SA = $SA->XML($XML) Function : set/reset all parameters for this object from the XML Returns : MOBY::Client::SimpleArticle Arguments : (optional) XML fragment from and including ... -=cut - =head2 XML_DOM - Title : XML_DOM Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) Function : set/reset all parameters for this object from the XML::DOM node for Returns : MOBY::Client::SimpleArticle Arguments : (optional) an $XML::DOM node from the article of a DOM -=cut =head2 addNamespace - Title : addNamespace Usage : $namespaces = $IN->addNamespace($namespace) Function : add another namespace for the objectType Returns : namespace string -=cut - =head2 isSimple - Title : isSimple Usage : $boolean = $IN->isSimple() Function : is this a SimpleArticle type (yes, I know this is obvious, but since you can @@ -147,11 +125,9 @@ to test what you have in-hand) Returns : 1 (true) -=cut =head2 isCollection - Title : isCollection Usage : $boolean = $IN->isCollection() Function : is this a CollectionArticle type (yes, I know this is obvious, but since you can @@ -160,11 +136,8 @@ to test what you have in-hand) Returns : 0 for false -=cut - =head2 isSecondary - Title : isSecondary Usage : $boolean = $IN->isSecondary() Function : is this a SecondaryArticle type? (yes, I know this is obvious) @@ -220,68 +193,65 @@ } sub new { - my ( $caller, %args ) = @_; - my $caller_is_obj = ref( $caller ); - return $caller if $caller_is_obj; - my $class = $caller_is_obj || $caller; - my $proxy; - my $self = bless {}, $class; - foreach my $attrname ( $self->_standard_keys ) { - if ( exists $args{$attrname} ) { - $self->{$attrname} = $args{$attrname}; - } elsif ( $caller_is_obj ) { - $self->{$attrname} = $caller->{$attrname}; - } else { - $self->{$attrname} = $self->_default_for( $attrname ); - } - } - if ( $self->XML && ref( $self->XML ) ) { - return 0; - } elsif ( $self->XML_DOM && !( ref( $self->XML_DOM ) =~ /libxml/i ) ) { - return 0; - } - $self->createFromXML if ( $self->XML ); - $self->createFromDOM( $self->XML_DOM ) if ( $self->XML_DOM ); - return $self; + my ( $caller, %args ) = @_; + my $caller_is_obj = ref( $caller ); + return $caller if $caller_is_obj; + my $class = $caller_is_obj || $caller; + my $proxy; + my $self = bless {}, $class; + foreach my $attrname ( $self->_standard_keys ) { + if ( exists $args{$attrname} ) { + $self->{$attrname} = $args{$attrname}; + } elsif ( $caller_is_obj ) { + $self->{$attrname} = $caller->{$attrname}; + } else { + $self->{$attrname} = $self->_default_for( $attrname ); + } + } + if ( $self->XML && ref( $self->XML ) ) { + return 0; + } elsif ( $self->XML_DOM && !( ref( $self->XML_DOM ) =~ /XML\:\:LibXML/ ) ) { + return 0; + } + + $self->createFromXML if ( $self->XML ); + $self->createFromDOM( $self->XML_DOM ) if ( $self->XML_DOM ); + return $self; } sub createFromXML { - my ( $self ) = @_; - my $p = XML::LibXML->new; - my $doc = $p->parse_string( $self->XML ); - my $root = $doc->getDocumentElement; - return 0 unless ( $root && ( $root->nodeName eq "Simple" ) ); - return $self->createFromDOM( $root ); + my ( $self ) = @_; + my $p = XML::LibXML->new; + my $doc = $p->parse_string( $self->XML ); + my $root = $doc->getDocumentElement; + return 0 unless ( $root && ( $root->nodeName eq "Simple" ) ); + return $self->createFromDOM( $root ); } sub createFromDOM { - my ( $self, $dom ) = @_; - return 0 unless ( $dom && ( $dom->nodeName eq "Simple" ) ); - $self->XML( $dom->toString ); # set the string version of the DOM - $self->namespaces( [] ); # reset! - $self->articleName( "" ); - $self->objectType( "" ); - my $attr = $dom->getAttributeNode( 'articleName' ); - my $lsid = $dom->getAttributeNode( 'lsid' ); - my $articleName = ""; - $articleName = $attr->getValue if $attr; - $lsid = $attr->getValue if $lsid; - - $self->articleName( $articleName ) - if $articleName - ; # it may have already been set if this Simple is part of a Collection... - $self->objectLSID( $lsid) if $lsid; - -# fork here - it may be an instantiated object (coming from a service invocation/response) -# or it may be a template object as in the SimpleArticle element of a registration call -# if the objectType tag exists, then it is a template object - if ( @{ $dom->getElementsByTagName( "objectType" ) }[0] ) { - return $self->_createTemplateArticle( $dom ); - } else { - return $self->_createInstantiatedArticle( $dom ); - } - - # otherwise it should simpy contain an instantiated MOBY object + my ( $self, $dom ) = @_; + return 0 unless ( $dom && ( $dom->nodeName eq "Simple" ) ); + $self->namespaces( [] ); # reset! + $self->articleName( "" ); + $self->objectType( "" ); + my $attr = $dom->getAttributeNode( 'articleName' ); + my $articleName = $attr ? $attr->getValue : ""; + $attr = $dom->getAttributeNode( 'lsid' ); + my $lsid = $attr ? $attr->getValue : ""; + + $self->articleName( $articleName ) + if $articleName; # it may have already been set if this Simple is part of a Collection... + $self->objectLSID( $lsid) if $lsid; + + # fork here - it may be an instantiated object (coming from a service invocation/response) + # or it may be a template object as in the SimpleArticle element of a registration call + # if the objectType tag exists, then it is a template object + if ( @{ $dom->getElementsByTagName( "objectType" ) }[0] ) { + return $self->_createTemplateArticle( $dom ); + } else { + return $self->_createInstantiatedArticle( $dom ); + } + # otherwise it should simpy contain an instantiated MOBY object } sub _createInstantiatedArticle { @@ -333,29 +303,30 @@ } sub AUTOLOAD { - no strict "refs"; - my ( $self, $newval ) = @_; - $AUTOLOAD =~ /.*::(\w+)/; - my $attr = $1; - if ( $self->_accessible( $attr, 'write' ) ) { - *{$AUTOLOAD} = sub { - if ( defined $_[1] ) { $_[0]->{$attr} = $_[1] } - return $_[0]->{$attr}; - }; ### end of created subroutine -### this is called first time only - if ( defined $newval ) { - $self->{$attr} = $newval; - } - return $self->{$attr}; - } elsif ( $self->_accessible( $attr, 'read' ) ) { - *{$AUTOLOAD} = sub { - return $_[0]->{$attr}; - }; ### end of created subroutine - return $self->{$attr}; - } - - # Must have been a mistake then... - croak "No such method: $AUTOLOAD"; + # It seems desirable that if the XML() method is called, the XML should be parsed, rather than just being + no strict "refs"; + my ( $self, $newval ) = @_; + $AUTOLOAD =~ /.*::(\w+)/; + my $attr = $1; + if ( $self->_accessible( $attr, 'write' ) ) { + *{$AUTOLOAD} = sub { + if ( defined $_[1] ) { $_[0]->{$attr} = $_[1]; } + return $_[0]->{$attr}; + }; ### end of created subroutine + ### this is called first time only + if ( defined $newval ) { + $self->{$attr} = $newval; + } + return $self->{$attr}; + } elsif ( $self->_accessible( $attr, 'read' ) ) { + *{$AUTOLOAD} = sub { + return $_[0]->{$attr}; + }; ### end of created subroutine + return $self->{$attr}; + } + + # Must have been a mistake then... + croak "No such method: $AUTOLOAD"; } sub DESTROY { } 1; From senger at pub.open-bio.org Sun Sep 4 09:15:58 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:15:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041315.j84DFwnF027181@pub.open-bio.org> senger Sun Sep 4 09:15:55 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv27126 Modified Files: activation.jar alltools2.jar axis-ant.jar axis.jar jaxrpc.jar saaj.jar servlet.jar xercesImpl.jar xmlParserAPIs.jar Added Files: commons-discovery-0.2.jar commons-httpclient-3.0-rc2.jar commons-logging-1.0.4.jar log4j-1.2.8.jar mailapi_1_3_1.jar wsdl4j-1.5.1.jar Removed Files: commons-discovery.jar commons-logging.jar log4j-1.2.4.jar wsdl4j.jar Log Message: jars-archive/current commons-discovery-0.2.jar,NONE,1.1 commons-httpclient-3.0-rc2.jar,NONE,1.1 commons-logging-1.0.4.jar,NONE,1.1 log4j-1.2.8.jar,NONE,1.1 mailapi_1_3_1.jar,NONE,1.1 wsdl4j-1.5.1.jar,NONE,1.1 activation.jar,1.1,1.2 alltools2.jar,1.1,1.2 axis-ant.jar,1.1,1.2 axis.jar,1.1,1.2 jaxrpc.jar,1.1,1.2 saaj.jar,1.1,1.2 servlet.jar,1.1,1.2 xercesImpl.jar,1.1,1.2 xmlParserAPIs.jar,1.1,1.2 commons-discovery.jar,1.1,NONE commons-logging.jar,1.1,NONE log4j-1.2.4.jar,1.1,NONE wsdl4j.jar,1.1,NONE =================================================================== RCS file: /home/repository/moby/jars-archive/current/activation.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/activation.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/activation.jar 2005/09/04 13:15:54 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/activation.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/08/24 14:24:18 1.1 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/04 13:15:54 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/axis-ant.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/axis-ant.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/axis-ant.jar 2005/09/04 13:15:54 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/axis-ant.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/axis.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/axis.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/axis.jar 2005/09/04 13:15:54 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/axis.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/jaxrpc.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/jaxrpc.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/jaxrpc.jar 2005/09/04 13:15:55 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/jaxrpc.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/saaj.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/saaj.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/saaj.jar 2005/09/04 13:15:55 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/saaj.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/servlet.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/servlet.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/servlet.jar 2005/09/04 13:15:55 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/servlet.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/xercesImpl.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/xercesImpl.jar 2005/06/10 13:55:36 1.1 and /home/repository/moby/jars-archive/current/xercesImpl.jar 2005/09/04 13:15:55 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/xercesImpl.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/xmlParserAPIs.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/xmlParserAPIs.jar 2005/06/10 13:55:36 1.1 and /home/repository/moby/jars-archive/current/xmlParserAPIs.jar 2005/09/04 13:15:55 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/xmlParserAPIs.jar: diff failed rcsdiff: /home/repository/moby/jars-archive/current/RCS/commons-discovery.jar,v: No such file or directory rcsdiff: /home/repository/moby/jars-archive/current/RCS/commons-logging.jar,v: No such file or directory rcsdiff: /home/repository/moby/jars-archive/current/RCS/log4j-1.2.4.jar,v: No such file or directory rcsdiff: /home/repository/moby/jars-archive/current/RCS/wsdl4j.jar,v: No such file or directory From senger at pub.open-bio.org Sun Sep 4 09:45:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjbGP027859@pub.open-bio.org> senger Sun Sep 4 09:45:36 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv27838 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.28,1.29 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/02 07:38:35 1.28 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/04 13:45:36 1.29 @@ -66,6 +66,21 @@ + + + + + + + + + + + + + + + @@ -148,42 +163,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -214,6 +193,11 @@ + + + + @@ -489,26 +473,9 @@ - - - - - - - - - - - + - - - - @@ -521,6 +488,9 @@ + + + @@ -534,11 +504,66 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -596,114 +621,213 @@ - - - - - - - - - - - - - - + - - - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + <undeployment xmlns="http://xml.apache.org/axis/wsdd/"> + <service name="${service.name}"/> + </undeployment> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - + - - - - + + - + - - - + - - No list of service names found. - =============================== - A list can be defined in one of the following ways: - a) Create a property 'services.list' containing - a comma-delimited list of names of services, or - b) For each service, create a property 'service.<service-name> - (replace <service-name> with a real name of service). + No list of service names found. + =============================== + Each service that you want to deploy should de defined + by a property of the following form (parts in upper-cases should be + replaced by the real values): + service.SERVICE-NAME = IMPLEMENTATION-CLASS-NAME + + Each service that you want to undeploy can be defined in the same + way (implementation class is not needed), or simpler by creating + a property 'services.list' containing a comma-delimited list of + names of services to be undeployed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <undeployment xmlns="http://xml.apache.org/axis/wsdd/"> - <service name="${service.name}"/> - </undeployment> - - - - - - - - - - @@ -976,6 +1052,10 @@ + + + + @@ -991,18 +1071,7 @@ - - - - - - - - - - - - + @@ -1044,7 +1113,7 @@ - + @@ -1070,21 +1139,8 @@ - - - - - - - - - - - - - - - + + @@ -1114,7 +1170,7 @@ - + @@ -1156,6 +1212,16 @@ + + + + + + + + + + From senger at pub.open-bio.org Sun Sep 4 09:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjcVm028109@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser In directory pub.open-bio.org:/tmp/cvs-serv27838/src/main/org/biomoby/shared/parser Modified Files: MobyParser.java Log Message: moby-live/Java/src/main/org/biomoby/shared/parser MobyParser.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/MobyParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/MobyParser.java 2005/08/26 06:27:05 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/MobyParser.java 2005/09/04 13:45:38 1.2 @@ -16,11 +16,12 @@ import org.biomoby.shared.datatypes.MobyXref; import org.biomoby.shared.datatypes.MapDataTypesIfc; -import embl.ebi.tools.ICreator; -import embl.ebi.utils.GException; -import embl.ebi.utils.DGUtils; -import embl.ebi.xml.XMLUtils2; -import embl.ebi.xml.XMLErrorHandler; +import org.tulsoft.tools.loaders.ICreator; +import org.tulsoft.shared.GException; +import org.tulsoft.tools.debug.DGUtils; +import org.tulsoft.tools.xml.XMLUtils2; +import org.tulsoft.tools.xml.XMLErrorHandler; + import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.xml.sax.Locator; From senger at pub.open-bio.org Sun Sep 4 09:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84Djc7t028086@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator In directory pub.open-bio.org:/tmp/cvs-serv27838/src/main/org/biomoby/service/generator Modified Files: Generator.java ServicesGenerator.java Log Message: moby-live/Java/src/main/org/biomoby/service/generator Generator.java,1.1,1.2 ServicesGenerator.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/Generator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/Generator.java 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/Generator.java 2005/09/04 13:45:38 1.2 @@ -8,8 +8,11 @@ package org.biomoby.service.generator; -import embl.ebi.utils.FileUtils; -import embl.ebi.utils.GException; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.shared.GException; +import org.tulsoft.tools.external.Executor; +import org.tulsoft.tools.servlets.Html; +import org.tulsoft.tools.servlets.HtmlConstants; import org.biomoby.shared.MobyException; import org.biomoby.shared.Central; @@ -21,8 +24,6 @@ import org.biomoby.client.CentralDigestCachedImpl; import org.biomoby.client.Graphviz; -import embl.ebi.tools.Executor; -import embl.ebi.utils.GException; import java.util.Properties; import java.util.HashMap; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/ServicesGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/ServicesGenerator.java 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/ServicesGenerator.java 2005/09/04 13:45:38 1.2 @@ -27,7 +27,8 @@ import org.biomoby.client.FilterServices; import org.biomoby.client.Graphviz; -import embl.ebi.servlets.Html; +import org.tulsoft.tools.servlets.Html; +import org.tulsoft.tools.servlets.HtmlConstants; import java.util.Properties; import java.util.Iterator; From senger at pub.open-bio.org Sun Sep 4 09:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84Djcxa028148@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/xmls In directory pub.open-bio.org:/tmp/cvs-serv27838/xmls Modified Files: libraries.xml Log Message: moby-live/Java/xmls libraries.xml,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/libraries.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/08/26 06:27:05 1.3 +++ /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/09/04 13:45:38 1.4 @@ -11,19 +11,19 @@ - - - + + + - + - + @@ -43,12 +43,12 @@ + - @@ -57,6 +57,7 @@ + @@ -82,6 +83,7 @@ + @@ -98,7 +100,15 @@ - + + + + + + + + + @@ -109,6 +119,7 @@ + @@ -136,6 +147,7 @@ + From senger at pub.open-bio.org Sun Sep 4 09:45:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjbEg027932@pub.open-bio.org> senger Sun Sep 4 09:45:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv27838/src/Clients Modified Files: CacheRegistryClient.java MobyCmdLineClient.java MobyDigestClient.java MobyGraphs.java MosesGenerators.java TestArgs.java TestingMobyParser.java UnregisterByAuthority.java Log Message: moby-live/Java/src/Clients CacheRegistryClient.java,1.1,1.2 MobyCmdLineClient.java,1.10,1.11 MobyDigestClient.java,1.1,1.2 MobyGraphs.java,1.8,1.9 MosesGenerators.java,1.1,1.2 TestArgs.java,1.1,1.2 TestingMobyParser.java,1.1,1.2 UnregisterByAuthority.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2004/11/14 16:12:50 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/04 13:45:37 1.2 @@ -8,8 +8,9 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import embl.ebi.tools.*; -import embl.ebi.utils.*; +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.shared.GException; import java.net.*; import java.util.*; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/08/07 06:30:49 1.10 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/09/04 13:45:37 1.11 @@ -8,8 +8,10 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import embl.ebi.tools.*; -import embl.ebi.utils.*; +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.shared.StringUtils; +import org.tulsoft.shared.GException; import java.net.*; import java.util.*; @@ -268,12 +270,12 @@ data.setAuthority (cmd.getParam ("-rd-auth")); data.setEmailContact (cmd.getParam ("-rd-email")); if ((param = cmd.getParam ("-rd-isa")) != null ) { - String[] isas = StringUtils.split (param, ","); + String[] isas = param.split (","); for (int i = 0; i < isas.length; i++) data.addParentName (isas [i]); } if ((param = cmd.getParam ("-rd-hasa")) != null ) { - String[] hasas = StringUtils.split (param, ","); + String[] hasas = param.split (","); for (int i = 0; i < hasas.length; i++) { int pos = hasas[i].indexOf (":"); if (pos == -1) { @@ -286,7 +288,7 @@ } } if ((param = cmd.getParam ("-rd-has")) != null ) { - String[] hasas = StringUtils.split (param, ","); + String[] hasas = param.split (","); for (int i = 0; i < hasas.length; i++) { int pos = hasas[i].indexOf (":"); if (pos == -1) { @@ -310,7 +312,7 @@ stype.setAuthority (cmd.getParam ("-rt-auth")); stype.setEmailContact (cmd.getParam ("-rt-email")); if ((param = cmd.getParam ("-rt-isa")) != null ) { - String[] isas = StringUtils.split (param, ","); + String[] isas = param.split (","); for (int i = 0; i < isas.length; i++) stype.addParentName (isas [i]); } @@ -351,9 +353,9 @@ } if ( (param = cmd.getParam ("-rs-in")) != null ) { - String[] inputs = StringUtils.split (param, ","); + String[] inputs = param.split (","); for (int i = 0; i < inputs.length; i++) { - String[] parts = StringUtils.split (inputs[i], "="); + String[] parts = inputs[i].split ("="); if (parts.length >= 2) { MobyPrimaryDataSimple data = new MobyPrimaryDataSimple ("dummy"); data.setDataType (new MobyDataType (parts[0])); @@ -367,7 +369,7 @@ } } if ((param = cmd.getParam ("-rs-ifile")) != null ) { - String[] files = StringUtils.split (param, ","); + String[] files = param.split (","); for (int i = 0; i < files.length; i++) { Properties props = new Properties(); try { @@ -421,9 +423,9 @@ } } if ((param = cmd.getParam ("-rs-out")) != null ) { - String[] outs = StringUtils.split (param, ","); + String[] outs = param.split (","); for (int i = 0; i < outs.length; i++) { - String[] parts = StringUtils.split (outs[i], "="); + String[] parts = outs[i].split ("="); if (parts.length >= 2) { MobyPrimaryDataSimple data = new MobyPrimaryDataSimple ("dummy"); data.setDataType (new MobyDataType (parts[0])); @@ -437,7 +439,7 @@ } } if ((param = cmd.getParam ("-rs-ofile")) != null ) { - String[] files = StringUtils.split (param, ","); + String[] files = param.split (","); for (int i = 0; i < files.length; i++) { Properties props = new Properties(); try { @@ -535,7 +537,7 @@ if ((param = cmd.getParam ("-f")) != null ) { decorationLn ("Looking for services related to: '" + param + "':"); decorationLn ("--------------------------------"); - printServices (worker.findService (StringUtils.split (param, ",")), + printServices (worker.findService (param.split (",")), cmd.hasOption ("-on")); } @@ -555,9 +557,9 @@ pattern.setType (cmd.getParam ("-fs-type")); pattern.setAuthority (cmd.getParam ("-fs-auth")); if ((param = cmd.getParam ("-fs-in")) != null ) { - String[] inputs = StringUtils.split (param, ","); + String[] inputs = param.split (","); for (int i = 0; i < inputs.length; i++) { - String[] parts = StringUtils.split (inputs[i], "="); + String[] parts = inputs[i].split ("="); MobyPrimaryDataSimple input = new MobyPrimaryDataSimple ("dummy"); input.setDataType (new MobyDataType (parts[0])); if (parts.length >= 2) @@ -566,7 +568,7 @@ } } if ((param = cmd.getParam ("-fs-out")) != null ) { - String[] outs = StringUtils.split (param, ","); + String[] outs = param.split (","); for (int i = 0; i < outs.length; i++) { MobyPrimaryDataSimple output = new MobyPrimaryDataSimple ("dummy"); output.setDataType (new MobyDataType (outs[i])); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2004/11/14 16:43:49 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/09/04 13:45:37 1.2 @@ -7,8 +7,9 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import embl.ebi.tools.*; -import embl.ebi.utils.*; +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.shared.GException; /** * A simple client retrieving and printing cummulative (digestive) =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2005/07/19 12:39:58 1.8 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2005/09/04 13:45:37 1.9 @@ -8,8 +8,11 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import embl.ebi.tools.*; -import embl.ebi.utils.*; +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.tools.Printf; +import org.tulsoft.shared.UUtils; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.shared.GException; import java.net.*; import java.util.*; @@ -146,7 +149,7 @@ while ((line = data.readLine()) != null) { if (line.trim().equals ("")) continue; if (line.trim().startsWith ("#")) continue; - String[] fields = StringUtils.split (line); + String[] fields = line.split ("\\s+"); if (fields.length > 1) { if (fields[0].equalsIgnoreCase ("start")) { DataServiceEdge dse = new DataServiceEdge (new MobyDataType ("start"), @@ -181,9 +184,9 @@ String[] serviceNames = null; int depth = 1; if ((param = cmd.getParam ("-auth")) != null ) - authorities = StringUtils.split (param, ","); + authorities = param.split (","); if ((param = cmd.getParam ("-name")) != null ) - serviceNames = StringUtils.split (param, ","); + serviceNames = param.split (","); param = cmd.getParam ("-depth"); if (param != null) { try { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MosesGenerators.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/MosesGenerators.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/MosesGenerators.java 2005/09/04 13:45:37 1.2 @@ -12,7 +12,7 @@ import org.biomoby.shared.MobyException; import org.biomoby.shared.Utils; -import embl.ebi.tools.BaseCmdLine; +import org.tulsoft.tools.BaseCmdLine; import java.util.Properties; /** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestArgs.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/TestArgs.java 2005/09/01 05:51:18 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/TestArgs.java 2005/09/04 13:45:37 1.2 @@ -6,6 +6,9 @@ // Copyright Martin Senger (martin.senger at gmail.com). // +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.shared.UUtils; + /** * Work in progress... * @@ -16,8 +19,17 @@ public static void main (String[] args) throws Exception { - for (int i = 0; i < args.length; i++) { - System. out.println (i + ": " + args[i]); + String withTools = System.getProperty ("with_tools"); + if (UUtils.is (withTools)) { + System.out.println ("Using BaseCmdLine:\n"); + BaseCmdLine cmd = new BaseCmdLine (args, true); + for (int i = 0; i < cmd.params.length; i++) { + System. out.println (i + ": " + cmd.params[i]); + } + } else { + for (int i = 0; i < args.length; i++) { + System. out.println (i + ": " + args[i]); + } } } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestingMobyParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/TestingMobyParser.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/TestingMobyParser.java 2005/09/04 13:45:37 1.2 @@ -10,7 +10,7 @@ import org.biomoby.shared.MobyException; import org.biomoby.shared.Utils; -import embl.ebi.tools.BaseCmdLine; +import org.tulsoft.tools.BaseCmdLine; import java.io.File; /** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java 2005/09/04 13:45:37 1.2 @@ -11,7 +11,7 @@ import org.biomoby.shared.Central; import org.biomoby.client.CentralImpl; -import embl.ebi.tools.BaseCmdLine; +import org.tulsoft.tools.BaseCmdLine; import java.util.Map; import java.util.Map.Entry; From senger at pub.open-bio.org Sun Sep 4 09:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjcT5028036@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service In directory pub.open-bio.org:/tmp/cvs-serv27838/src/main/org/biomoby/service Modified Files: BaseService.java Log Message: moby-live/Java/src/main/org/biomoby/service BaseService.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/BaseService.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/BaseService.java 2005/08/28 10:19:08 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/BaseService.java 2005/09/04 13:45:37 1.3 @@ -8,9 +8,9 @@ package org.biomoby.service; -import embl.ebi.soap.SOAPToolkit; -import embl.ebi.soap.SoapUtils; -import embl.ebi.utils.GException; +import org.tulsoft.tools.soap.SOAPToolkit; +import org.tulsoft.tools.soap.SoapUtils; +import org.tulsoft.shared.GException; import org.biomoby.shared.MobyException; import org.biomoby.shared.parser.MobyParser; @@ -197,7 +197,7 @@ * useful for session management.

        * * See details what a toolkit can provide in - * embl.ebi.soap.SOAPToolkit. + * org.tulsoft.tools.soap.SOAPToolkit. *************************************************************************/ public SOAPToolkit getToolkit() { return toolkit; From senger at pub.open-bio.org Sun Sep 4 09:45:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84Djb0L028017@pub.open-bio.org> senger Sun Sep 4 09:45:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv27838/src/main/org/biomoby/client Modified Files: BaseClient.java BaseCmdLineClient.java CentralDigestImpl.java CentralImpl.java GraphsServlet.java Log Message: moby-live/Java/src/main/org/biomoby/client BaseClient.java,1.1,1.2 BaseCmdLineClient.java,1.1,1.2 CentralDigestImpl.java,1.3,1.4 CentralImpl.java,1.24,1.25 GraphsServlet.java,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java 2005/09/04 13:45:37 1.2 @@ -15,8 +15,8 @@ import org.biomoby.shared.parser.MobyPackage; import org.biomoby.shared.parser.MobyJob; -import embl.ebi.soap.axis.AxisCall; -import embl.ebi.utils.GException; +import org.tulsoft.tools.soap.axis.AxisCall; +import org.tulsoft.shared.GException; import java.net.URL; import java.net.MalformedURLException; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/09/04 13:45:37 1.2 @@ -17,11 +17,11 @@ import org.biomoby.shared.datatypes.MobyObject; import org.biomoby.shared.datatypes.MapDataTypesIfc; -import embl.ebi.tools.BaseCmdLine; -import embl.ebi.tools.ICreator; -import embl.ebi.utils.GException; -import embl.ebi.utils.FileUtils; -import embl.ebi.utils.DGUtils; +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.tools.loaders.ICreator; +import org.tulsoft.shared.GException; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.tools.debug.DGUtils; import java.util.Vector; import java.util.HashMap; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/04/18 23:57:45 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/09/04 13:45:37 1.4 @@ -6,18 +6,17 @@ package org.biomoby.client; -import java.util.Iterator; -import java.util.Map; -import java.util.Vector; - import org.biomoby.shared.CentralDigest; import org.biomoby.shared.MobyDataType; import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; import org.biomoby.shared.MobyServiceType; -import embl.ebi.utils.DGUtils; -// import java.net.*; +import org.tulsoft.tools.debug.DGUtils; + +import java.util.Iterator; +import java.util.Map; +import java.util.Vector; /** * A default implementation of {@link =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/08/26 06:27:04 1.24 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/04 13:45:37 1.25 @@ -23,7 +23,7 @@ import org.biomoby.shared.Utils; import org.biomoby.shared.MobyResourceRef; -import embl.ebi.soap.axis.AxisUtils; +import org.tulsoft.tools.soap.axis.AxisUtils; import org.w3c.dom.Document; import org.w3c.dom.Element; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/05/19 15:57:25 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/09/04 13:45:37 1.11 @@ -8,6 +8,31 @@ package org.biomoby.client; +import org.biomoby.shared.CentralAll; +import org.biomoby.shared.MobyDataType; +import org.biomoby.shared.MobyException; +import org.biomoby.shared.MobyNamespace; +import org.biomoby.shared.MobyPrimaryDataSimple; +import org.biomoby.shared.MobyService; +import org.biomoby.shared.MobyServiceType; +import org.biomoby.shared.Utils; + +import org.tulsoft.tools.servlets.Html; +import org.tulsoft.tools.servlets.HtmlConstants; +import org.tulsoft.tools.external.CatchOutputDefaultImpl; +import org.tulsoft.tools.external.Executor; +import org.tulsoft.tools.Printf; +import org.tulsoft.tools.Sorter; +import org.tulsoft.shared.GException; +import org.tulsoft.shared.StringUtils; +import org.tulsoft.shared.UUtils; + +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -23,32 +48,6 @@ import java.util.Properties; import java.util.Vector; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.biomoby.shared.CentralAll; -import org.biomoby.shared.MobyDataType; -import org.biomoby.shared.MobyException; -import org.biomoby.shared.MobyNamespace; -import org.biomoby.shared.MobyPrimaryDataSimple; -import org.biomoby.shared.MobyService; -import org.biomoby.shared.MobyServiceType; -import org.biomoby.shared.Utils; - -import embl.ebi.servlets.Html; -import embl.ebi.servlets.HtmlConstants; -import embl.ebi.tools.CatchOutputDefaultImpl; -import embl.ebi.tools.Executor; -import embl.ebi.tools.Printf; -import embl.ebi.tools.Sorter; -import embl.ebi.utils.GException; -import embl.ebi.utils.StringUtils; -import embl.ebi.utils.UUtils; - - /** * A servlet making graphs of Moby service instances, Moby data types, * and Moby service types.

        @@ -1489,7 +1488,7 @@ // where is the 'dot' program String dotProg = "dot"; String dotPath = (String)initParams.get (DOT_PATH); - if (! UUtils.isEmpty (dotPath)) + if ( ! UUtils.isEmpty (dotPath) && ! "\"\"".equals (dotPath) ) dotProg = dotPath + System.getProperty ("file.separator") + dotProg; // depending on the cache implementation we may ask From senger at pub.open-bio.org Sun Sep 4 09:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjcvT028060@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv27838/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java RegistryPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard AbstractPanel.java,1.1,1.2 RegistryPanel.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/02 07:38:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/04 13:45:38 1.2 @@ -9,11 +9,14 @@ package org.biomoby.service.dashboard; import javax.swing.JLabel; +import javax.swing.JPanel; import javax.swing.text.html.HTMLDocument; import javax.swing.Icon; import javax.swing.JComponent; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeSupport; /** * WORK IN PROGRESS.

        @@ -23,6 +26,7 @@ */ public abstract class AbstractPanel + extends JPanel implements DashboardPanel { /************************************************************************** @@ -39,20 +43,23 @@ return null; } - /************************************************************************** - * - **************************************************************************/ - public void addPropertyChangeListener (PropertyChangeListener listener) { + /********************************************************************* + * Property change stuff + ********************************************************************/ + protected PropertyChangeSupport support; + + public void addPropertyChangeListener (PropertyChangeListener l) { + if (support != null) + support.addPropertyChangeListener(l); } - /************************************************************************** - * - **************************************************************************/ - public void removePropertyChangeListener(PropertyChangeListener listener) { + public void removePropertyChangeListener (PropertyChangeListener l) { + if (support != null) + support.removePropertyChangeListener(l); } /************************************************************************** - * + * Here we get notified when a property chnage happen. **************************************************************************/ public void propertyChange (PropertyChangeEvent event) { } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/02 07:38:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/04 13:45:38 1.2 @@ -12,7 +12,9 @@ import javax.swing.text.html.HTMLDocument; import javax.swing.Icon; import javax.swing.JComponent; + import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeEvent; /** * @@ -26,6 +28,20 @@ public class RegistryPanel extends AbstractPanel { + /********************************************************************* + * propertyChange() + ********************************************************************/ + public void propertyChange (PropertyChangeEvent e) { + String prop = e.getPropertyName(); + String newVal = (String)e.getNewValue(); + if (newVal == null) return; // no interest in non-defined new values + if (prop == null) return; // no interest in non-specific changes +// else if (prop.equalsIgnoreCase (PROP_MODE)) setMode (checkAndGetOperMode (newVal)); +// else if (prop.equalsIgnoreCase (PROP_BEAN_VISIBLE)) setBeanVisible (BBConfig.getBoolFromString (newVal)); +// else if (prop.equalsIgnoreCase (PROP_LISTEN_TO)) setListenTo (newVal); +// else if (prop.equalsIgnoreCase (PROP_DATA_IDENTITY)) setDataIdentity (newVal); + } + /************************************************************************** * **************************************************************************/ From senger at pub.open-bio.org Sun Sep 4 09:45:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjbQf027878@pub.open-bio.org> senger Sun Sep 4 09:45:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/images In directory pub.open-bio.org:/tmp/cvs-serv27838/docs/images Modified Files: ant-snapshot.png Log Message: moby-live/Java/docs/images ant-snapshot.png,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/images/ant-snapshot.png,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 Binary files /home/repository/moby/moby-live/Java/docs/images/ant-snapshot.png 2005/08/26 06:27:02 1.2 and /home/repository/moby/moby-live/Java/docs/images/ant-snapshot.png 2005/09/04 13:45:36 1.3 differ rcsdiff: /home/repository/moby/moby-live/Java/docs/images/ant-snapshot.png: diff failed From senger at pub.open-bio.org Sun Sep 4 09:45:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjbNv027977@pub.open-bio.org> senger Sun Sep 4 09:45:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv27838/src/Clients/help Modified Files: BaseCmdLineClient_usage.txt CacheRegistryClient_usage.txt MobyCmdLineClient_usage.txt MobyDigest_usage.txt MobyGraphs_usage.txt MosesGenerators_usage.txt TestingMobyParser_usage.txt Added Files: argsfile.example Log Message: moby-live/Java/src/Clients/help argsfile.example,NONE,1.1 BaseCmdLineClient_usage.txt,1.1,1.2 CacheRegistryClient_usage.txt,1.2,1.3 MobyCmdLineClient_usage.txt,1.9,1.10 MobyDigest_usage.txt,1.2,1.3 MobyGraphs_usage.txt,1.6,1.7 MosesGenerators_usage.txt,1.1,1.2 TestingMobyParser_usage.txt,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/BaseCmdLineClient_usage.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/help/BaseCmdLineClient_usage.txt 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/help/BaseCmdLineClient_usage.txt 2005/09/04 13:45:37 1.2 @@ -52,3 +52,5 @@ -outxml ... show results as XML -o +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt 2005/08/26 06:27:03 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt 2005/09/04 13:45:37 1.3 @@ -38,3 +38,6 @@ other Moby registries stored in the same -cachedir directory) -q ... quiet mode + +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt 2005/08/07 06:31:03 1.9 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt 2005/09/04 13:45:37 1.10 @@ -210,3 +210,6 @@ format of : service-name[,service-authority] + +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/08/26 06:27:03 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/09/04 13:45:37 1.3 @@ -29,3 +29,6 @@ -details ... print the above with all details (by default only names are printed) + +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2005/08/26 06:27:03 1.6 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2005/09/04 13:45:37 1.7 @@ -120,3 +120,5 @@ workflow creation will produce many messages. By default it does not. +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MosesGenerators_usage.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/help/MosesGenerators_usage.txt 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MosesGenerators_usage.txt 2005/09/04 13:45:37 1.2 @@ -62,4 +62,5 @@ using an external program 'dot' (from Graphviz package). If this program is not on your PATH, specify here where it is. - +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/TestingMobyParser_usage.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/help/TestingMobyParser_usage.txt 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/help/TestingMobyParser_usage.txt 2005/09/04 13:45:37 1.2 @@ -25,3 +25,6 @@ (this is not usually needed at all - only when your data type definitions, the generated data types, are not up-to-date) + +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] From senger at pub.open-bio.org Sun Sep 4 09:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84Djcir028126@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv27838/src/webapps Added Files: standard.wsdd.template Log Message: moby-live/Java/src/webapps standard.wsdd.template,NONE,1.1 From fgibbons at pub.open-bio.org Tue Sep 6 16:23:40 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 6 Sep 2005 16:23:40 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062023.j86KNe0m004114@pub.open-bio.org> fgibbons Tue Sep 6 16:23:40 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv4089/MOBY Modified Files: CrossReference.pm Log Message: - Cleaned up docs (removed redundant Title: attributes). - Enforced the fact that type() can take one of only two values: "xref" and "object" - Puzzled about why these methods return the old value of the parameter, when used to set a parameter. Seems like it'd make more sense to either return the new value (to indicate success), or better yet return the object, to allow chaining. moby-live/Perl/MOBY CrossReference.pm,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CrossReference.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/MOBY/CrossReference.pm 2004/12/14 20:47:04 1.6 +++ /home/repository/moby/moby-live/Perl/MOBY/CrossReference.pm 2005/09/06 20:23:40 1.7 @@ -11,31 +11,23 @@ =head1 SYNOPSIS -=cut - =head1 DESCRIPTION -this holds all of the relevant information for a MOBY -cross reference of either the Xref type, or the -Object type. Object cross-references have only -namespace and id attributes, while Xref cross-references -have namespace, id, authURI, serviceName, xref_type, -and evidence_code attributes. To determine which -type of cross-reference you have in-hand, call the -"type" method. +This holds all of the relevant information for a MOBY cross reference +of either the Xref type, or the Object type. Object cross-references +have only namespace and id attributes, while Xref cross-references +have namespace, id, authURI, serviceName, xref_type, and evidence_code +attributes. To determine which type of cross-reference you have +in-hand, call the "type" method. =head1 AUTHORS Mark Wilkinson (markw at illuminae dot com) -=cut - =head1 METHODS - =head2 new - Title : new Usage : my $XR = MOBY::Client::CrossReference->new(%args) Function : create SimpleArticle object Returns : MOBY::Client::CrossReference object @@ -49,82 +41,58 @@ Object => The XML of a base MOBY Object in this ns/id -=cut - =head2 type - Title : type Usage : $type = $XR->type($name) Function : get/set type attribute Returns : string; returns last value if new value set Arguments : (required)one of "xref" or "object", depending on the type of cross-ref you are making (new, or v0.5 API) -=cut - =head2 namespace - Title : namespace Usage : $ns = $XR->namespace($ns) Function : get/set namespace Returns : string; returns last value if new value set Arguments : (optional) string representing namespace to set -=cut - =head2 id - Title : id Usage : $id = $XR->id($id) Function : get/set id for the cross-reference Returns : string; returns last value if new value set Arguments : (optional) the id of the cross-reference -=cut - =head2 authURI - Title : authURI Usage : $auth = $XR->authURI($auth) Function : get/set id for the authority for the xref Returns : string; returns last value if new value set Arguments : (optional) the new authority of the xref type reference -=cut - =head2 serviceName - Title : serviceName Usage : $name = $XR->serviceName($name) Function : get/set serviceName for the cross-reference Returns : string; returns last value if new value set Arguments : (optional) the new serviceName of the cross-reference -=cut - =head2 evidence_code - Title : evidence_code Usage : $code = $XR->evidence_code($code) Function : get/set evidence_code for the cross-reference Returns : string; returns last value if new value set Arguments : (optional) the evidence_code of the cross-reference -=cut - =head2 xref_type - Title : xref_type Usage : $xreftype = $XR->xref_type($xreftype) Function : get/set xref_type for the cross-reference Returns : string; returns last value if new value set Arguments : (optional) the xref_type of the cross-reference -=cut - =head2 Object - Title : Object Usage : $XML = $XR->Object() Function : retrieve a base MOBY Object XML (e.g. to send to a service) Returns : XML or empty string if there is no namespace or id value @@ -133,98 +101,102 @@ { - sub type { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_type}; - $self->{_type} = $type; - return $old; - } - return $self->{_type}; - } - - sub namespace { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_namespace}; - $self->{_namespace} = $type; - return $old; - } - return $self->{_namespace}; - } - - sub id { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_id}; - $self->{_id} = $type; - return $old; - } - return $self->{_id}; - } - - sub authURI { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_authURI}; - $self->{_authURI} = $type; - return $old; - } - return $self->{_authURI}; - } - - sub serviceName { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_serviceName}; - $self->{_serviceName} = $type; - return $old; - } - return $self->{_serviceName}; - } - - sub evidence_code { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_evidenceCode}; - $self->{_evidenceCode} = $type; - return $old; - } - return $self->{_evidenceCode}; - } - - sub xref_type { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_xref_type}; - $self->{_xref_type} = $type; - return $old; - } - return $self->{_xref_type}; - } +# Why do these methods return the PREVIOUS value of their respective variables? +# How would that be useful? +# Seems more intuitive to return new value, or perhaps even the object itself. + sub type { + # only two types are permitted. + my ( $self, $type ) = @_; + if ($type && ($type =~ /^(xref|object)$/)) { + my $old = $self->{_type}; + $self->{_type} = $type; + return $old; + } + return $self->{_type}; + } + + sub namespace { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_namespace}; + $self->{_namespace} = $type; + return $old; + } + return $self->{_namespace}; + } + + sub id { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_id}; + $self->{_id} = $type; + return $old; + } + return $self->{_id}; + } + + sub authURI { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_authURI}; + $self->{_authURI} = $type; + return $old; + } + return $self->{_authURI}; + } + + sub serviceName { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_serviceName}; + $self->{_serviceName} = $type; + return $old; + } + return $self->{_serviceName}; + } + + sub evidence_code { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_evidenceCode}; + $self->{_evidenceCode} = $type; + return $old; + } + return $self->{_evidenceCode}; + } + + sub xref_type { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_xref_type}; + $self->{_xref_type} = $type; + return $old; + } + return $self->{_xref_type}; + } } sub new { - my ( $caller, %args ) = @_; - my $caller_is_obj = ref($caller); - return $caller if $caller_is_obj; - my $class = $caller_is_obj || $caller; - my $proxy; - my $self = bless {}, $class; - while ( my ( $key, $value ) = each %args ) { - $self->$key($value); - } - return undef unless ( $self->type && $self->namespace && $self->id ); - return $self; + my ( $caller, %args ) = @_; + my $caller_is_obj = ref($caller); + return $caller if $caller_is_obj; + my $class = $caller_is_obj || $caller; + my $proxy; + my $self = bless {}, $class; + while ( my ( $key, $value ) = each %args ) { + $self->$key($value); + } + return undef unless ( $self->type && $self->namespace && $self->id ); + return $self; } sub Object { - my ($self) = @_; - return "" unless ( $self->namespace && $self->id ); - return ""; + my ($self) = @_; + return "" unless ( $self->namespace && $self->id ); + return ""; } sub DESTROY { } 1; From fgibbons at pub.open-bio.org Tue Sep 6 16:24:19 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 6 Sep 2005 16:24:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062024.j86KOJfc004155@pub.open-bio.org> fgibbons Tue Sep 6 16:24:19 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4134/t Added Files: CrossReference.t Log Message: - Test MOBY/CrossReference.pm module. moby-live/Perl/t CrossReference.t,NONE,1.1 From fgibbons at pub.open-bio.org Tue Sep 6 16:28:34 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 6 Sep 2005 16:28:34 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062028.j86KSYrh004200@pub.open-bio.org> fgibbons Tue Sep 6 16:28:34 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv4175/MOBY/Client Modified Files: SecondaryArticle.pm Log Message: - Clean up code, replace duplicate blocks of code (default/datatype/max/min) with single generic. moby-live/Perl/MOBY/Client SecondaryArticle.pm,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/SecondaryArticle.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/MOBY/Client/SecondaryArticle.pm 2004/12/14 22:31:30 1.6 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/SecondaryArticle.pm 2005/09/06 20:28:34 1.7 @@ -22,14 +22,11 @@ Mark Wilkinson (markw at illuminae dot com) -=cut - =head1 METHODS =head2 new - Title : new Usage : my $SA = MOBY::Client::SecondaryArticle->new(%args) Function : create SecondaryArticle object Returns : MOBY::Client::SecondaryArticle object @@ -42,90 +39,57 @@ XML_DOM => $XML_DOM node of the Secondary article (optional) XML => $XML XML string representing the Secondary article (optional) -=cut - =head2 articleName - Title : articleName Usage : $name = $SA->articleName($name) Function : get/set articleName Returns : string Arguments : (optional) string representing articleName to set -=cut - =head2 objectType - Title : objectType Usage : $type = $SA->objectType($type) Function : get/set name Returns : string Arguments : (optional) string representing objectType to set -=cut - =head2 namespaces - Title : namespaces Usage : $namespaces = $SA->namespaces(\@namespaces) Function : get/set namespaces for the objectType Returns : arrayref of namespace strings Arguments : (optional) arrayref of namespace strings to set -=cut - =head2 XML - Title : XML Usage : $SA = $SA->XML($XML) Function : set/reset all parameters for this object from the XML Returns : MOBY::Client::SecondaryArticle Arguments : (optional) XML fragment from and including ... -=cut - =head2 XML_DOM - Title : XML_DOM Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) Function : set/reset all parameters for this object from the XML::DOM node for Returns : MOBY::Client::SecondaryArticle Arguments : (optional) an $XML::DOM node from the article of a DOM -=cut - =head2 isSecondary - Title : isSecondary Usage : $boolean = $IN->isSecondary() - Function : is this a SecondaryArticle type? - (yes, I know this is obvious) + Function : is this a SecondaryArticle type? (yes, I know this is obvious) Returns : 1 (true) -=cut - =head2 isSimple - Title : isSimple Usage : $boolean = $IN->isSimple() Function : is this a SimpleArticle type - (yes, I know this is obvious, but since you can - get both Simple and Collection objects in your - Input and output lists, it is good to be able - to test what you have in-hand) Returns : 0 (false) -=cut - =head2 isCollection - Title : isCollection Usage : $boolean = $IN->isCollection() Function : is this a CollectionArticle type - (yes, I know this is obvious, but since you can - get both Simple and Collection objects in your - Input and output lists, it is good to be able - to test what you have in-hand) Returns : 0 for false =cut @@ -136,11 +100,11 @@ # DATA #___________________________________________________________ #ATTRIBUTES - my %_attr_data = # DEFAULT ACCESSIBILITY + my %_attr_data = # DEFAULT ACCESSIBILITY ( - articleName => [ undef, 'read/write' ], - objectType => [ undef, 'read/write' ], - namespaces => [ [], 'read/write' ], + articleName => [ undef, 'read/write' ], + objectType => [ undef, 'read/write' ], + namespaces => [ [], 'read/write' ], XML_DOM => [ undef, 'read/write' ], XML => [ undef, 'read/write' ], isSecondary => [ 1, 'read' ], @@ -174,39 +138,39 @@ } sub addEnum { - my ( $self, $enum ) = @_; - $self->{enum} = [] unless $self->{enum}; - return $self->{enum} unless defined( $enum ); - push @{ $self->{enum} }, $enum; - return $self->{enum}; + # No return value necessary + my ( $self, $enum ) = @_; + $self->{enum} = [] unless $self->{enum}; + return() unless defined ($enum); + push @{ $self->{enum} }, $enum; } } sub new { - my ( $caller, %args ) = @_; - my $caller_is_obj = ref( $caller ); - return $caller if $caller_is_obj; - my $class = $caller_is_obj || $caller; - my $proxy; - my $self = bless {}, $class; - foreach my $attrname ( $self->_standard_keys ) { - if ( exists $args{$attrname} ) { - $self->{$attrname} = $args{$attrname}; - } elsif ( $caller_is_obj ) { - $self->{$attrname} = $caller->{$attrname}; - } else { - $self->{$attrname} = $self->_default_for( $attrname ); - } - } - $self->{enum} = [] unless $self->enum; - if ( $self->XML && ref( $self->XML ) ) { - return 0; - } elsif ( $self->XML_DOM && !( ref( $self->XML_DOM ) =~ /libxml/i ) ) { - return 0; - } - $self->createFromXML if ( $self->XML ); - $self->createFromDOM( $self->XML_DOM ) if ( $self->XML_DOM ); - return $self; + my ( $caller, %args ) = @_; + my $caller_is_obj = ref( $caller ); + return $caller if $caller_is_obj; + my $class = $caller_is_obj || $caller; + my $proxy; + my $self = bless {}, $class; + foreach my $attrname ( $self->_standard_keys ) { + if ( exists $args{$attrname} ) { + $self->{$attrname} = $args{$attrname}; + } elsif ( $caller_is_obj ) { + $self->{$attrname} = $caller->{$attrname}; + } else { + $self->{$attrname} = $self->_default_for( $attrname ); + } + } + $self->{enum} = [] unless $self->enum; + if ( $self->XML && ref( $self->XML ) ) { + return 0; + } elsif ( $self->XML_DOM && !( ref( $self->XML_DOM ) =~ /libxml/i ) ) { + return 0; + } + $self->createFromXML if ( $self->XML ); + $self->createFromDOM( $self->XML_DOM ) if ( $self->XML_DOM ); + return $self; } sub createFromXML { @@ -226,91 +190,66 @@ $self->articleName( "" ); $self->objectType( "" ); my $attr = $dom->getAttributeNode( 'articleName' ); - my $articleName = ""; - $articleName = $attr->getValue if $attr; - $self->articleName( $articleName ); - + $self->articleName( $attr ? $attr->getValue : "" ); if ( @{ $dom->getElementsByTagName( 'Value' ) }[0] ) { - return $self->_createInstantiatedArticle( $dom ); + return $self->_createInstantiatedArticle( $dom ); } else { - return $self->_createTemplateArticle( $dom ); + return $self->_createTemplateArticle( $dom ); } } sub _createTemplateArticle { - my ( $self, $dom ) = @_; + my ( $self, $dom ) = @_; - #datatype => [undef, 'read/write' ], - #default => [undef, 'read/write' ], - #max => [undef, 'read/write' ], - #min => [undef, 'read/write' ], - #enum => [[], 'read/write' ], - my $objects = $dom->getElementsByTagName( "datatype" ); - if ( $objects->get_node( 1 ) ) { - my $data; - foreach my $child ( $objects->get_node( 1 )->childNodes ) { - next unless $child->nodeType == TEXT_NODE; - $data .= $child->toString; - $data =~ s/\s//g; - } - $self->datatype( $data ); - } - $objects = $dom->getElementsByTagName( "default" ); - if ( $objects->get_node( 1 ) ) { - my $def; - foreach my $child ( $objects->get_node( 1 )->childNodes ) { - next unless $child->nodeType == TEXT_NODE; - $def .= $child->toString; - $def =~ s/\s//g; - } - $self->default( $def ); - } - $objects = $dom->getElementsByTagName( "max" ); - if ( $objects->get_node( 1 ) ) { - my $max; - foreach my $child ( $objects->get_node( 1 )->childNodes ) { - next unless $child->nodeType == TEXT_NODE; - $max .= $child->toString; - $max =~ s/\s//g; - } - $self->max( $max ); - } - $objects = $dom->getElementsByTagName( "min" ); - if ( $objects->get_node( 1 ) ) { - my $min; - foreach my $child ( $objects->get_node( 1 )->childNodes ) { - next unless $child->nodeType == TEXT_NODE; - $min .= $child->toString; - $min =~ s/\s//g; - } - $self->min( $min ); - } - $objects = $dom->getElementsByTagName( "enum" ); - if ( $objects->get_node( 1 ) ) { - foreach ( 1 .. $objects->size() ) { - foreach my $child ( $objects->get_node( $_ )->childNodes ) { - my $val; - next unless $child->nodeType == TEXT_NODE; - $val = $child->toString; - next unless defined( $val ); - $val =~ s/^\s//; - $val =~ s/\s$//; - $self->addEnum( $val ); - } - } - } - return $self; + #datatype => [undef, 'read/write' ], + #default => [undef, 'read/write' ], + #max => [undef, 'read/write' ], + #min => [undef, 'read/write' ], + #enum => [[], 'read/write' ], + my @single_valued = qw/datatype default max min/; + my $objects; + foreach my $param (@single_valued) { + $objects = $dom->getElementsByTagName( $param ); + if ( $objects->get_node( 1 ) ) { + my $data; + foreach my $child ( $objects->get_node( 1 )->childNodes ) { + next unless $child->nodeType == TEXT_NODE; + $data .= $child->toString; + $data =~ s/\s//g; # Trim all whitespace + } + $self->$param( $data ); + } + } + # Since it is (array)multi-valued, 'enum' is a little different from the others. + $objects = $dom->getElementsByTagName( "enum" ); + if ( $objects->get_node( 1 ) ) { + foreach ( 1 .. $objects->size() ) { + foreach my $child ( $objects->get_node( $_ )->childNodes ) { + my $val; + next unless $child->nodeType == TEXT_NODE; + $val = $child->toString; + next unless defined( $val ); + # Trim space from front and back, but leave alone in middle....? + $val =~ s/^\s//; + $val =~ s/\s$//; + $self->addEnum( $val ); + } + } + } + return $self; } sub _createInstantiatedArticle { - my ( $self, $dom ) = @_; + my ( $self, $dom ) = @_; - #43764 - my $values = $dom->getElementsByTagName( 'Value' ); - foreach my $child ( $values->get_node( 1 )->childNodes ) { - next unless $child->nodeType == TEXT_NODE; - $self->value( $self->value . $child->toString ); - } + #43764 + my $values = $dom->getElementsByTagName( 'Value' ); + $self->value( "" ); # Initialize to 1) avoid Perl warnings 2) be good. + foreach my $child ( $values->get_node( 1 )->childNodes ) { + next unless $child->nodeType == TEXT_NODE; + # Would we *really* want to catenate values like this? + $self->value( $self->value . $child->toString ); + } } sub AUTOLOAD { From fgibbons at pub.open-bio.org Tue Sep 6 16:30:08 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 6 Sep 2005 16:30:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062030.j86KU80e004246@pub.open-bio.org> fgibbons Tue Sep 6 16:30:08 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4225/t Added Files: Client-SecondaryArticle.t Log Message: - Test MOBY::Client::SecondaryArticle (i.e., ). moby-live/Perl/t Client-SecondaryArticle.t,NONE,1.1 From fgibbons at pub.open-bio.org Tue Sep 6 16:31:06 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 6 Sep 2005 16:31:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062031.j86KV6ZL004279@pub.open-bio.org> fgibbons Tue Sep 6 16:31:06 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4254/t Modified Files: Client-CollectionArticle.t Log Message: - More tests for CollectionArticle. moby-live/Perl/t Client-CollectionArticle.t,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-CollectionArticle.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/t/Client-CollectionArticle.t 2005/08/31 14:17:11 1.1 +++ /home/repository/moby/moby-live/Perl/t/Client-CollectionArticle.t 2005/09/06 20:31:06 1.2 @@ -25,12 +25,7 @@ }; -TODO: { - local $TODO = "Everything."; -} - -my @autoload = qw/articleName Simples isSimple isCollection isSecondary -XML XML_DOM/; +my @autoload = qw/articleName Simples isSimple isCollection isSecondary XML XML_DOM/; my @API = (@autoload, qw/new createFromXML createFromDOM addSimple/); my $coll = MOBY::Client::CollectionArticle->new(); @@ -42,3 +37,64 @@ is($coll->isSecondary, 0) or diag("CollectionArticle cannot be Secondary"); is($coll->isCollection, 1) or diag("CollectionArticle must return isCollection=1"); +my $aName = 'my Article'; +# Check XML-generation code. +# In reality, (XML, createFromXML) and (XML_DOM, createFromDOM) should behave the same. +# Let's not assume that though. + +my ($artName, $ns, $id, $obj, $lsid) + = ('my Simple Article', 'SGD', 'S0005111', 'Object', 'urn:foo:bar:my_lsid'); +my ($collArtName) = "my Collection"; +my $xml_coll = < + + + + + + + +XML + +$coll = MOBY::Client::CollectionArticle->new( XML => $xml_coll); + +is($coll->articleName(), $collArtName) + or diag("CollectionArticle not correctly built from XML (articleName wrong)"); + +is(scalar @{$coll->Simples()}, 2) + or diag("CollectionArticle didn't return correct number of Simples"); + +TODO: { + local $TODO = "We should ideally check the contents of the Simples that are returned...."; +} + +sub XML_maker { # Turn XML text into DOM. + my $XML = shift; + my $parser = XML::LibXML->new(); + my $doc; + eval { $doc = $parser->parse_string( $XML ); }; + return '' if ( $EVAL_ERROR ); #("Couldn't parse '$XML' because:\n\t$EVAL_ERROR") + return $doc->getDocumentElement(); +} + + +$coll = MOBY::Client::CollectionArticle->new( XML_DOM => XML_maker($xml_coll)); + +is($coll->articleName(), $collArtName) + or diag("CollectionArticle not correctly built from XML_DOM (articleName wrong)"); + + + +TODO: { + local $TODO = <new()->XML(\$xml), +I expect that the XML will be *parsed*, to modify the object, +not that the attribute 'XML' will be set, and the rest left unchanged." +TODO + + $coll = MOBY::Client::CollectionArticle->new(); + $coll->XML($xml_coll); + is($coll->articleName, $collArtName) + or diag("Couldn't create CollectionArticle from autoloaded method XML(): articleName wrong"); + +} From fgibbons at pub.open-bio.org Tue Sep 6 16:43:22 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 6 Sep 2005 16:43:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062043.j86KhM6u004331@pub.open-bio.org> fgibbons Tue Sep 6 16:43:22 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4306/t Modified Files: Client-OntologyServer.t Log Message: - Augment a little, and move tests on relationshipExists() to TODO, since it doesn't appear to work. moby-live/Perl/t Client-OntologyServer.t,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/01 16:09:39 1.2 +++ /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/06 20:43:21 1.3 @@ -43,32 +43,40 @@ # and check them all here? Ditto for Objects, Service-types # my ($success, $msg, $existingURI); -my @check_ns = qw/SGD NCBI_gi/; +my @check_ns = qw/SGD NCBI_gi GO FB PMID/; # These seem pretty solid foreach (@check_ns) { ($success, $msg, $existingURI) = $os->namespaceExists( term => $_); is($success, 1) or diag("Namespace '$_' reported erroneously as non-existent."); } -my @check_obj = qw/ Object String Integer Float/; +# Could get these allowed datatypes from MOBY::Config, +# except that module only works when you've got a local registry set up. +my @check_obj = qw/ Object String Integer Float DateTime/; # At least we can be confident that primitive types will always be valid foreach (@check_obj) { ($success, $msg, $existingURI) = $os->objectExists(term => $_); is($success, 1) or diag("Object '$_' reported erroneously as non-existent."); } -my @check_servicetype = qw/Retrieval/; +my @check_servicetype = qw/Alignment Analysis Conversion Edit +NCBI_Blast Parsing SetIntersection SetOperation SetUnion +Retrieval Registration Resolution +StructuralPrediction/; # Service types don't change much, but who knows.... foreach (@check_servicetype) { ($success, $msg, $existingURI) = $os->serviceExists(term => $_); is($success, 1) or diag("Service type '$_' reported erroneously as non-existent."); } -my @check_rel = qw/ISA HASA HAS/; -foreach (@check_rel) { - ($success, $msg, $existingURI) = $os->relationshipExists(term => $_); - is($success, 1) - or diag("Relationship '$_' reported erroneously as non-existent."); +TODO: { + local $TODO = "Fix whatever is broken with these relationship types - or else fix this test."; + my @check_rel = qw/ISA HASA HAS/; # There should only be very few valid relationship types. + foreach (@check_rel) { + ($success, $msg, $existingURI) = $os->relationshipExists(term => $_); + is($success, 1) + or diag("Relationship '$_' reported erroneously as non-existent."); + } } From fgibbons at pub.open-bio.org Tue Sep 6 16:46:18 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 6 Sep 2005 16:46:18 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062046.j86KkIfc004374@pub.open-bio.org> fgibbons Tue Sep 6 16:46:18 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4353/t Added Files: lsid-authority-ClassResolver.t lsid-authority-Error.t lsid-authority-NamespaceResolver.t lsid-authority-PredicateResolver.t lsid-authority-RDFConfigure.t lsid-authority-RelationshipResolver.t lsid-authority-ServiceInstanceResolver.t lsid-authority-ServiceResolver.t lsid-authority-dbConnect.t Log Message: - Add tests for LSID components. moby-live/Perl/t lsid-authority-ClassResolver.t,NONE,1.1 lsid-authority-Error.t,NONE,1.1 lsid-authority-NamespaceResolver.t,NONE,1.1 lsid-authority-PredicateResolver.t,NONE,1.1 lsid-authority-RDFConfigure.t,NONE,1.1 lsid-authority-RelationshipResolver.t,NONE,1.1 lsid-authority-ServiceInstanceResolver.t,NONE,1.1 lsid-authority-ServiceResolver.t,NONE,1.1 lsid-authority-dbConnect.t,NONE,1.1 From fgibbons at pub.open-bio.org Tue Sep 6 16:47:04 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 6 Sep 2005 16:47:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062047.j86Kl4xc004418@pub.open-bio.org> fgibbons Tue Sep 6 16:47:04 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4393/t Added Files: Central.t Config.t dbConnect.t Log Message: - Add tests for various components. moby-live/Perl/t Central.t,1.2,1.3 Config.t,NONE,1.1 dbConnect.t,NONE,1.1 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Central.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/t/Central.t 2003/11/12 17:05:48 1.2 +++ /home/repository/moby/moby-live/Perl/t/Central.t 2005/09/06 20:47:04 1.3 @@ -1,15 +1,76 @@ # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl 1.t' +# !!!!STOP!!!! +# This test file is for the MOBY::Central module. +# As a regular Perl user, you probably intend to use MOBY::Client::Central, +# which is discouragingly similarly named, and has many similarly named methods, +# but quite different functionality. +# This code runs on the server side, responding to incoming requests, +# and constructing XML messages that communicate the results of those requests. + +# Note added by Frank Gibbons. +# Tests should, as far as possible, avoid the use of literals. +# If you register a service with authURI => mysite.com, +# and you want to test a retrieved description of the service, don't test that the service returns authURI eq "mysite.com", +# test so that it returns the same value as you used to register it in the first place. + ######################### # change 'tests => 1' to 'tests => last_test_to_print'; - -use Test::More tests => 1; +#use SOAP::Lite +trace; +use Test::More 'no_plan'; +use strict; +use Data::Dumper; +#Is the client-code even installed? BEGIN { use_ok('MOBY::Central') }; + +END {}; -######################### +############ ENFORCE REGISTRY API ############### -# Insert your test code below, the Test::More module is use()ed here so read -# its man page ( perldoc Test::More ) for help writing this test script. +# First, mandatory methods for all registries. +# Notice: new() is NOT defined here, since it is deprecated. +my @API = qw/Registration +registerObjectClass _registerObjectPayload +deregisterObjectClass _deregisterObjectPayload +_testObjectTypeAgainstPrimitives +registerServiceType _registerServiceTypePayload +deregisterServiceType _deregisterServiceTypePayload +retrieveNamespaces _registerNamespacePayload +deregisterNamespace _deregisterNamespacePayload +registerService _registerServicePayload +_getServiceInstanceRDF _registerArticles +deregisterService _deregisterServicePayload +findService _findServicePayload +_extractObjectTypes registerServiceWSDL +_extract_ids +_searchForServicesWithArticle _searchForSimple _searchForCollection +_extractObjectTypesAndNamespaces +retrieveService _retrieveServicePayload +retrieveResourceURLs retrieveServiceProviders retrieveServiceNames +retrieveServiceTypes retrieveRelationshipTypes retrieveObjectNames +retrieveObjectDefinition retrieveNamespaces +retrieveObject _retrieveObjectPayload +Relationships DUMP_MySQL _ISAPayload/; + +can_ok("MOBY::Central", @API) + or diag("MOBY::Central failed to implement full API"); + +################## MOBY Registration Tests ################# + +################## OBJECT REGISTRATION ############# +# Test 3 inherits from two isas - should fail +my %Obj = ( objectType => "Rubbish", + description => "a human-readable description of the object", + contactEmail => 'your at email.address', + authURI => "test.suite.com", + Relationships => { + ISA => [ + ['Object', 'article1'], + ['Object', 'articleName2']], + HASA => [ + ['Object', 'articleName3']] + } + ); From kawas at pub.open-bio.org Tue Sep 6 17:29:10 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 6 Sep 2005 17:29:10 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062129.j86LTAip004582@pub.open-bio.org> kawas Tue Sep 6 17:29:10 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema In directory pub.open-bio.org:/tmp/cvs-serv4557/org/biomoby/shared/schema Modified Files: RdfParser.java Log Message: Removed some imports statements that werent used. Added a check that basically checks if a certain property exists for a datatype and if not then null is returned. moby-live/Java/src/main/org/biomoby/shared/schema RdfParser.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/RdfParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/RdfParser.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/RdfParser.java 2005/09/06 21:29:10 1.2 @@ -1,269 +1,269 @@ -/* - * Created on Jun 17, 2005 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.biomoby.shared.schema; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.StringReader; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.LinkedList; - -import org.biomoby.client.rdf.vocabulary.Predicates; -import org.biomoby.client.ui.graphical.servlet.jresources.RESOURCE; -import org.biomoby.shared.MobyException; - -import com.hp.hpl.jena.graph.Node; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; -import com.hp.hpl.jena.rdf.model.NodeIterator; -import com.hp.hpl.jena.rdf.model.Property; -import com.hp.hpl.jena.rdf.model.RDFNode; -import com.hp.hpl.jena.rdf.model.RDFReader; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.rdf.model.Statement; -import com.hp.hpl.jena.rdf.model.StmtIterator; -import com.hp.hpl.jena.vocabulary.RDF; -import com.hp.hpl.jena.vocabulary.RDFS; - -/** - * @author Eddie - * - * TODO To change the template for this generated type comment go to Window - - * Preferences - Java - Code Style - Code Templates - */ -public class RdfParser { - - public static String OBJECT_URI = "http://biomoby.org/RESOURCES/MOBY-S/Objects#"; - - public static MElement buildMElement(String name) { - String rdf = null; - try { - rdf = getObjectRdf(); - } catch (MobyException e) { - e.printStackTrace(); - } - // return null if i cant build the element - if (rdf == null) - return null; - - // create the model - Model model = ModelFactory.createDefaultModel(); // the RESOURCE model - RDFReader reader = model.getReader(); - reader.read(model, new StringReader(rdf), null); - - // start querying model for what we need and create the MElement - String rootDescription = getDescription(model, name); - MElement root = new MElement(name, "", rootDescription); - String rootsParent = getParentDataType(model, name); - if (rootsParent == null) - rootsParent = ""; - if (MElement.isPrimitive(rootsParent)) { - root.setType(rootsParent); - } else { - root.setType(null); - } - // go through the isa relationships and extract the has/hasa - processRelationships(root, model, name); - - return root; - } - - /** - * @param root - * @param model - * @param name - */ - private static void processRelationships(MElement root, Model model, String name) { - if (name.indexOf("#") > 0) { - name = name.substring(name.indexOf("#")+1); - } - Resource resource = model.getResource(OBJECT_URI + name); - if (resource.hasProperty(RDFS.subClassOf)) { - String parent = resource.getProperty(RDFS.subClassOf) - .getObject().asNode().getURI(); - processRelationships(root, model, parent); - } - // process the has children - processChildrenTypes(root, model, Predicates.has, name); - // process the hasa children - processChildrenTypes(root, model, Predicates.hasa, name); - } - - /** - * @param root - * @param model - * @param has - * @param name - */ - private static void processChildrenTypes(MElement root, Model model, - Property property, String name) { - Resource resource = model.getResource(OBJECT_URI + name); - StmtIterator iterator = resource.listProperties(property); - if (iterator != null) - while (iterator.hasNext()) { - Statement next = (Statement) iterator.next(); - RDFNode object = next.getObject(); - if (object instanceof Resource) { - Resource child = (Resource) object; - String qualifiedName = null; - String childName = ""; - String childArticleName = ""; - String childDescription = ""; - if (child.hasProperty(RDF.type)) { - qualifiedName = child.getProperty(RDF.type).getObject() - .toString(); - childName = stripOutURI(child.getProperty(RDF.type) - .getObject().toString()); - } - if (child.hasProperty(Predicates.articleName)) { - childArticleName = stripOutLiteral(child.getProperty( - Predicates.articleName).getObject().toString()); - } - childDescription = stripOutLiteral(model.getResource( - qualifiedName).getProperty(RDFS.comment) - .getObject().toString()); - - MElement element = new MElement(childName, - childArticleName, childDescription); - String rootsParent = getParentDataType(model, childName); - if (MElement.isPrimitive(rootsParent)) { - element.setType(rootsParent); - } else { - element.setType(null); - } - processChildrenTypes(element, model, Predicates.has, - childName); - processChildrenTypes(element, model, Predicates.hasa, - childName); - if (property.getLocalName().equalsIgnoreCase("hasa")) { - root.addHasaMElement(element); - } else { - root.addHasMElement(element); - } - } - } - } - - /** - * @param model - * @param name - * @return - */ - private static String getParentDataType(Model model, String name) { - - // the statement should return null iff the object is the Moby root - // object - if (name.equals("Object")) - return null; - LinkedList list = new LinkedList(); - list.addFirst(name); - name = OBJECT_URI + name; - String parent = ""; - String previousParent = ""; - Resource resource = model.getResource(name); - Statement statement = resource.getProperty(RDFS.subClassOf); - do { - parent = statement.getObject().toString(); - if (!((String) list.getFirst()).equals(parent)) { - list.addFirst(parent); - } - resource = model.getResource(parent); - statement = resource.getProperty(RDFS.subClassOf); - - } while (statement != null); - // check to see if we have a primitive - parent = (String) list.removeFirst(); - if (list.size() > 0) { - previousParent = (String) list.removeFirst(); - previousParent = stripOutURI(previousParent); - if (MElement.isPrimitive(previousParent)) { - return previousParent; - } - } - // no primitive parent, so every object inherits from object - parent = stripOutURI(parent); - return parent; - } - - /** - * @param model - * @param name - * @return - */ - private static String getDescription(Model model, String name) { - Resource resource = model.getResource(OBJECT_URI + name); - Statement comment = resource.getProperty(RDFS.comment); - String description = comment.getObject().toString(); - description = stripOutLiteral(description); - return description; - } - - private static String getObjectRdf() throws MobyException { - String s = null; - StringBuffer sb = new StringBuffer(); - URL url = null; - try { - url = new URL(OBJECT_URI); - } catch (MalformedURLException e1) { - e1.printStackTrace(); - return null; - } - try { - BufferedReader in = null; - in = new BufferedReader(new InputStreamReader(url.openStream())); - while ((s = in.readLine()) != null) { - sb.append(s); - } - - } catch (IOException e) { - e.printStackTrace(); - return null; - } - return sb.toString(); - } - - private static String stripOutURI(String object) { - if (object.indexOf("#") > 0) - object = object.substring(object.indexOf("#") + 1); - return object; - } - - private static String stripOutLiteral(String object) { - if (object.indexOf("~") > 0) - object = object.substring(0, object.indexOf("~")); - return object; - } - - public static void main(String[] args) { - System.out.println("Is it me?"); - System.out.println("\nOutput Imag Object\n"); - System.out.println(RdfParser.buildMElement("DNASequence")); -/* System.out.println("###########################################"); - System.out.println("Outputting a String object"); - System.out.println(RdfParser.buildMElement("String")); - - System.out.println("###########################################"); - System.out.println("Outputting the base object"); - System.out.println(RdfParser.buildMElement("Object")); - - System.out.println("###########################################"); - System.out.println("Outputting a DNA sequence object"); - System.out.println(RdfParser.buildMElement("DNASequence")); - - System.out.println("###########################################"); - System.out.println("Outputting a GFF object"); - System.out.println(RdfParser.buildMElement("GFF")); - - System.out.println("###########################################"); - System.out.println("Outputting a BasicGFFSequenceFeature object"); - System.out.println(RdfParser.buildMElement("BasicGFFSequenceFeature")); -*/ - } -} +/* + * Created on Jun 17, 2005 + * + * TODO To change the template for this generated file go to + * Window - Preferences - Java - Code Style - Code Templates + */ +package org.biomoby.shared.schema; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.LinkedList; + +import org.biomoby.client.rdf.vocabulary.Predicates; +import org.biomoby.shared.MobyException; + +import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.ModelFactory; +import com.hp.hpl.jena.rdf.model.Property; +import com.hp.hpl.jena.rdf.model.RDFNode; +import com.hp.hpl.jena.rdf.model.RDFReader; +import com.hp.hpl.jena.rdf.model.Resource; +import com.hp.hpl.jena.rdf.model.Statement; +import com.hp.hpl.jena.rdf.model.StmtIterator; +import com.hp.hpl.jena.vocabulary.RDF; +import com.hp.hpl.jena.vocabulary.RDFS; + +/** + * @author Eddie + * + * TODO To change the template for this generated type comment go to Window - + * Preferences - Java - Code Style - Code Templates + */ +public class RdfParser { + + public static String OBJECT_URI = "http://biomoby.org/RESOURCES/MOBY-S/Objects#"; + + public static MElement buildMElement(String name) { + String rdf = null; + try { + rdf = getObjectRdf(); + } catch (MobyException e) { + e.printStackTrace(); + } + // return null if i cant build the element + if (rdf == null) + return null; + + // create the model + Model model = ModelFactory.createDefaultModel(); // the RESOURCE model + RDFReader reader = model.getReader(); + reader.read(model, new StringReader(rdf), null); + + // check if a certain property exists to ensure that you a valid object + if (model.getResource(OBJECT_URI + name).getProperty(RDFS.comment) == null) { + return null; + } + // start querying model for what we need and create the MElement + String rootDescription = getDescription(model, name); + MElement root = new MElement(name, "", rootDescription); + String rootsParent = getParentDataType(model, name); + if (rootsParent == null) + rootsParent = ""; + if (MElement.isPrimitive(rootsParent)) { + root.setType(rootsParent); + } else { + root.setType(null); + } + // go through the isa relationships and extract the has/hasa + processRelationships(root, model, name); + + return root; + } + + /** + * @param root + * @param model + * @param name + */ + private static void processRelationships(MElement root, Model model, String name) { + if (name.indexOf("#") > 0) { + name = name.substring(name.indexOf("#")+1); + } + Resource resource = model.getResource(OBJECT_URI + name); + if (resource.hasProperty(RDFS.subClassOf)) { + String parent = resource.getProperty(RDFS.subClassOf) + .getObject().asNode().getURI(); + processRelationships(root, model, parent); + } + // process the has children + processChildrenTypes(root, model, Predicates.has, name); + // process the hasa children + processChildrenTypes(root, model, Predicates.hasa, name); + } + + /** + * @param root + * @param model + * @param has + * @param name + */ + private static void processChildrenTypes(MElement root, Model model, + Property property, String name) { + Resource resource = model.getResource(OBJECT_URI + name); + StmtIterator iterator = resource.listProperties(property); + if (iterator != null) + while (iterator.hasNext()) { + Statement next = (Statement) iterator.next(); + RDFNode object = next.getObject(); + if (object instanceof Resource) { + Resource child = (Resource) object; + String qualifiedName = null; + String childName = ""; + String childArticleName = ""; + String childDescription = ""; + if (child.hasProperty(RDF.type)) { + qualifiedName = child.getProperty(RDF.type).getObject() + .toString(); + childName = stripOutURI(child.getProperty(RDF.type) + .getObject().toString()); + } + if (child.hasProperty(Predicates.articleName)) { + childArticleName = stripOutLiteral(child.getProperty( + Predicates.articleName).getObject().toString()); + } + childDescription = stripOutLiteral(model.getResource( + qualifiedName).getProperty(RDFS.comment) + .getObject().toString()); + + MElement element = new MElement(childName, + childArticleName, childDescription); + String rootsParent = getParentDataType(model, childName); + if (MElement.isPrimitive(rootsParent)) { + element.setType(rootsParent); + } else { + element.setType(null); + } + processChildrenTypes(element, model, Predicates.has, + childName); + processChildrenTypes(element, model, Predicates.hasa, + childName); + if (property.getLocalName().equalsIgnoreCase("hasa")) { + root.addHasaMElement(element); + } else { + root.addHasMElement(element); + } + } + } + } + + /** + * @param model + * @param name + * @return + */ + private static String getParentDataType(Model model, String name) { + + // the statement should return null iff the object is the Moby root + // object + if (name.equals("Object")) + return null; + LinkedList list = new LinkedList(); + list.addFirst(name); + name = OBJECT_URI + name; + String parent = ""; + String previousParent = ""; + Resource resource = model.getResource(name); + Statement statement = resource.getProperty(RDFS.subClassOf); + do { + parent = statement.getObject().toString(); + if (!((String) list.getFirst()).equals(parent)) { + list.addFirst(parent); + } + resource = model.getResource(parent); + statement = resource.getProperty(RDFS.subClassOf); + + } while (statement != null); + // check to see if we have a primitive + parent = (String) list.removeFirst(); + if (list.size() > 0) { + previousParent = (String) list.removeFirst(); + previousParent = stripOutURI(previousParent); + if (MElement.isPrimitive(previousParent)) { + return previousParent; + } + } + // no primitive parent, so every object inherits from object + parent = stripOutURI(parent); + return parent; + } + + /** + * @param model + * @param name + * @return + */ + private static String getDescription(Model model, String name) { + Resource resource = model.getResource(OBJECT_URI + name); + Statement comment = resource.getProperty(RDFS.comment); + String description = comment.getObject().toString(); + description = stripOutLiteral(description); + return description; + } + + private static String getObjectRdf() throws MobyException { + String s = null; + StringBuffer sb = new StringBuffer(); + URL url = null; + try { + url = new URL(OBJECT_URI); + } catch (MalformedURLException e1) { + e1.printStackTrace(); + return null; + } + try { + BufferedReader in = null; + in = new BufferedReader(new InputStreamReader(url.openStream())); + while ((s = in.readLine()) != null) { + sb.append(s); + } + + } catch (IOException e) { + e.printStackTrace(); + return null; + } + return sb.toString(); + } + + private static String stripOutURI(String object) { + if (object.indexOf("#") > 0) + object = object.substring(object.indexOf("#") + 1); + return object; + } + + private static String stripOutLiteral(String object) { + if (object.indexOf("~") > 0) + object = object.substring(0, object.indexOf("~")); + return object; + } + + public static void main(String[] args) { + System.out.println("Is it me?"); + System.out.println("\nOutput Imag Object\n"); + System.out.println(RdfParser.buildMElement("DNASequence")); +/* System.out.println("###########################################"); + System.out.println("Outputting a String object"); + System.out.println(RdfParser.buildMElement("String")); + + System.out.println("###########################################"); + System.out.println("Outputting the base object"); + System.out.println(RdfParser.buildMElement("Object")); + + System.out.println("###########################################"); + System.out.println("Outputting a DNA sequence object"); + System.out.println(RdfParser.buildMElement("DNASequence")); + + System.out.println("###########################################"); + System.out.println("Outputting a GFF object"); + System.out.println(RdfParser.buildMElement("GFF")); + + System.out.println("###########################################"); + System.out.println("Outputting a BasicGFFSequenceFeature object"); + System.out.println(RdfParser.buildMElement("BasicGFFSequenceFeature")); +*/ + } +} From kawas at pub.open-bio.org Tue Sep 6 17:29:50 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 6 Sep 2005 17:29:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062129.j86LTopo004632@pub.open-bio.org> kawas Tue Sep 6 17:29:50 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema In directory pub.open-bio.org:/tmp/cvs-serv4603/org/biomoby/shared/schema Modified Files: Frame.java MainGUI.java Log Message: Removed some unused import statements moby-live/Java/src/main/org/biomoby/shared/schema Frame.java,1.1,1.2 MainGUI.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java 2005/09/06 21:29:50 1.2 @@ -5,13 +5,21 @@ * Window - Preferences - Java - Code Style - Code Templates */ package org.biomoby.shared.schema; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.FileWriter; + +import javax.swing.BoxLayout; +import javax.swing.JButton; import javax.swing.JFrame; -import javax.swing.*; -import java.awt.event.*; -import java.awt.*; -import org.jdom.*; -import org.jdom.output.*; -import java.io.*; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextField; + +import org.jdom.Document; +import org.jdom.Element; +import org.jdom.output.Format; +import org.jdom.output.XMLOutputter; /** * @author lixin =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MainGUI.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MainGUI.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MainGUI.java 2005/09/06 21:29:50 1.2 @@ -12,8 +12,6 @@ * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ -import java.awt.event.*; -import java.io.*; public class MainGUI { public static void main(String[] args) throws Exception From gss at pub.open-bio.org Wed Sep 7 12:01:16 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 7 Sep 2005 12:01:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509071601.j87G1GfY007839@pub.open-bio.org> gss Wed Sep 7 12:01:16 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/doc/User In directory pub.open-bio.org:/tmp/cvs-serv7812/S-MOBY/doc/User Modified Files: devguide.doc Log Message: Changed "Service Provider" to Service; spell check. moby-live/S-MOBY/doc/User devguide.doc,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/doc/User/devguide.doc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/S-MOBY/doc/User/devguide.doc 2005/06/27 20:40:27 1.1 and /home/repository/moby/moby-live/S-MOBY/doc/User/devguide.doc 2005/09/07 16:01:16 1.2 differ rcsdiff: /home/repository/moby/moby-live/S-MOBY/doc/User/devguide.doc: diff failed From kawas at pub.open-bio.org Tue Sep 6 17:31:11 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 6 Sep 2005 17:31:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062131.j86LVBnl004678@pub.open-bio.org> kawas Tue Sep 6 17:31:11 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema In directory pub.open-bio.org:/tmp/cvs-serv4653/org/biomoby/shared/schema Modified Files: Builder.java Log Message: Added a method that generates a schema for the complete moby message Modified the main method so that 2 different type of schemas could potentially be retrieved. moby-live/Java/src/main/org/biomoby/shared/schema Builder.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Builder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Builder.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Builder.java 2005/09/06 21:31:11 1.2 @@ -1,1033 +1,1124 @@ -/** - *This class is used to generate a XML schema for a moby objet; To builder a XML schema element, call the method of - *buildSchem of the class; when a name of object is given, we find a MElement for this name; By analysis of the has Vector - *and hasa Vector of the MElement, we get the XML Schema for the object which has the inputed name. - *@author Lixin - *@author Eddie - *@version 1.0 - */ -package org.biomoby.shared.schema; - -import org.jdom.*; -import org.jdom.output.*; -import java.util.*; -import java.io.*; - - - -public class Builder { - - private int typeCount=0; //Everytime we create a type (complexType or simpleType), the variable will increase one. - - private Element root; //The root element of the XML Schema - - private Element firstComplexType; - - public static Namespace namespace; //This namespace is "http://www.3w.org/2001/XMLSchem". - - /** - *Given a string, we will give a element represnting an xml schema which describe the object of the name. - *@param name the name of object - *@return XML Element which represents an XML Schema - */ - public Element buildSchema(String name) - { -/* MElement mElement=new MElement("DNASequence"); - MElement m1=new MElement("string","SequenceString"); - MElement m2=new MElement("Integer","Length"); - mElement.addHasaMElement(m1); - mElement.addHasaMElement(m2);*/ - MElement mElement=new MElement(); - try{ - mElement=RdfParser.buildMElement(name); //find the MElement object representing the moby object - - } - catch(Exception e) - { - e.printStackTrace(); - } - - - - String nameOf=mElement.getName(); - root=getRoot(nameOf); //create a root element for the XML Schema of the moby object - - getElement(mElement); //add the rest part of XML schema to the root element - - return root; - - } - - /** - *the input is a MElement object; we will find all its hasa and has relations with other object; then modify the root - * element of the output xml file; the root element is the root element of a xml schema xml file. - *@param m a MElement - */ - public void getElement(MElement m) - { - Vector hasa=m.getHasaMElements(); - - Vector has=m.getHasMElements(); - - //if this MElement does not have hasa or has relation with other object, only need to return - //the first level. - if((hasa.size()==0)&&(has.size()==0)) - { - getFirstLevel(m, root); - Vector vcc=new Vector(); //create an empty vector as a parameter of function set3Attributes - set3Attributes(m, firstComplexType,vcc); - - - return; - } - else //this MElement have either has or hasa relation with ohter MElment - { - - - getFirstLevel(m,root); - Element sequence=new Element("sequence",namespace); //need a sequence element in XML schema for has - //and hasa object - firstComplexType.addContent(sequence); - - - - //find the primitive element and add them to schema - Vector tempt1; - Vector tempt2; - tempt1=(Vector)has.clone();//do not change tempt1 and tempt2, so clone two vector for them. - tempt2=(Vector)hasa.clone(); - - PrimitiveVector pri=new PrimitiveVector(tempt1, tempt2); - - - - addPrimitiveElement(pri, sequence);//add these primitive elements to the squences - - /*for object other than primitive type*/ - if(has.size()>0) - { - - - for (int i=0; i0)//the following dealing with the object in the hasa vector - { - /*create a MElementHastable for the hasa Vector. The key of the hashtabel is MElement, - and the value of hashtable of a vector containing article names*/ - MElementHashtable hss=new MElementHashtable(hasa); - - Hashtable hs=hss.getHashtable();//get a hashtable - int count=0; - - Enumeration e=hs.keys();//get all keys of the hashtable - - while(e.hasMoreElements())//go through the Enumeration - { - MElement ml=(MElement)e.nextElement(); - - Vector vc=(Vector)hs.get(ml);//get value, a vector of article names, of the hashtable - String namem=ml.getName(); - - - if(!(MElement.isPrimitive(namem))) - { - Element a=new Element("element", namespace);//add the element to the sequence - Attribute at=new Attribute("name",namem); - - String typeNamem=namem+"Typep"+typeCount; - typeCount++; - Attribute at2=new Attribute("type","moby:"+ typeNamem); - - Vector hasaNamesV=getHasaNameVector(ml); - addUniqueElement(a,"unique_1",hasaNamesV);//add an unique element - - - String st=ml.getDescription(); - addDescriptNote(st,sequence); - sequence.addContent(a); - a.setAttribute(at); - a.setAttribute(at2); - - String size=""+vc.size(); - - Attribute o1=new Attribute("minOccurs",size);//add occurence of element - Attribute o2=new Attribute("maxOccurs",size); - a.setAttribute(o1); - a.setAttribute(o2); - - //recursively to find the complex type - Element myCom=getComplexTypeRec(ml,typeNamem,vc); - root.addContent(myCom); - } - } - - - } - Vector vcc2=new Vector();//the empty vector is only used to as a parameter of set3Attributes() - set3Attributes( m,firstComplexType,vcc2); - - - } - - } - - /** - *Given a vector containing possible article names and type name, add an XML Schema element to describe - *the restriction. - *@param roots the root element of the XML Schema - *@param types the name of XML Schema simpleType - *@param articles a vector containing different article names - */ - public void addArticleNameType(Element roots, String types, Vector articles) - { - //create a simpleType XML Schema element - Element simpleType=new Element("simpleType", namespace); - Attribute at=new Attribute("name",types); - simpleType.setAttribute(at); - - //create a XML schema restriction element - Element restriction=new Element("restriction", namespace); - Attribute base=new Attribute("base","xs:string"); - restriction.setAttribute(base); - - simpleType.addContent(restriction); - - //put all article names into the enumeration of the restriction element - for(int i=0;i0) ||(has.size()>0))//if true, we can not use simpleContent XML Schema element - { - flag=0; - } - String articleName=m.getArticleName(); - - Element e1=getNamespaceAttribute(); - Element e2=getIDAttribute(); - Element e3; - - if(ar.size()==0) - { - e3=getArticleName(articleName); - } - else - { - /*if this object can has many article names, we put restriction on the article names*/ - e3=getRestrictionArticleName(ar); - } - - //check whether the type of this element is null or not - String typeName=m.getType(); - - /*check if the name of the element is primitive*/ - String priName=m.getName(); - if(MElement.isPrimitive(priName)) - { - typeName=priName; - } - - if(typeName==null||typeName.length()==0||flag==0) - { - - types.addContent(e1); - types.addContent(e2); - types.addContent(e3); - } - - /*if the type is not empty, and use extensionin schema to describe this relation*/ - else - { - typeName=typeName.toLowerCase(); - - /*create a simpleContent XML Schema element*/ - Element simpleContent=new Element("simpleContent",namespace); - - Element extension=new Element("extension", namespace); - - Attribute base=new Attribute("base","xs:"+typeName); - extension.setAttribute(base); - - extension.addContent(e1); - extension.addContent(e2); - extension.addContent(e3); - - simpleContent.addContent(extension); - - types.addContent(simpleContent); - } - - } - - /** - *create the top level of xml schema element for a moby object. - *@param m a MElement - *@param rt a xML Schema root element - */ - public void getFirstLevel(MElement m, Element rt) - { - String name=m.getName(); - String type=name+"Type"; - - Element tem1=new Element("element",namespace); - Attribute attr1=new Attribute("name",name); - Attribute attr2=new Attribute("type", "moby:"+type); - tem1.setAttribute(attr1); - tem1.setAttribute(attr2); - - /*add unique element for moby objects in the hasa relationship*/ - Vector hasaNames=getHasaNameVector(m); - //add an unique element to the first level - addUniqueElement(tem1,"first", hasaNames); - rt.addContent(tem1); - - String str=m.getDescription(); - addDescriptNote(str,rt); - - /*add the complexType element of XML Schema to the root element*/ - firstComplexType=getComplexType(m, type); - - - rt.addContent(firstComplexType); - } - - /** - *recursively get a complexType XML Shema element for MElement; when this MElement does - *not have has and hasa relation, we use another method called getComplexType; - *@param m a MElement object - *@param typeName the name of complexType - *@param vc1 a vector containing all possible article names for the MElement - *@return the complexType element for this MElement object - */ - public Element getComplexTypeRec(MElement m, String typeName, Vector vc1) - { - - root.addContent(new Comment("This is definition of complexType "+typeName)); - - /*get has and hasa vector for this MElement object*/ - Vector hasa1=m.getHasaMElements(); - - Vector has1=m.getHasMElements(); - - /*create a complexType element*/ - Element complexType=new Element("complexType",namespace); - Attribute at1=new Attribute("name",typeName); - complexType.setAttribute(at1); - - /*if this MElement does not have has or hasa relationship with other object, we have done*/ - if((hasa1.size()==0)&&(has1.size()==0)) - { - - set3Attributes(m,complexType,vc1); - - return complexType; - } - /*if this MElement has has or hasa relationshipe with other object, need puts all object into sequence XML - schema element*/ - else - { - Element sequence1=new Element("sequence",namespace); - complexType.addContent(sequence1); - - //find the primitive elements and add these to schema - PrimitiveVector pri=new PrimitiveVector(hasa1,has1); - addPrimitiveElement(pri, sequence1); - - /*deal with objects in the hasa vector*/ - if(hasa1.size()>0) - { - - MElementHashtable hss=new MElementHashtable(hasa1); - Hashtable hs=hss.getHashtable(); - int count=0; - - Enumeration e=hs.keys(); - - while(e.hasMoreElements()) - { - MElement ml=(MElement)e.nextElement(); - Vector vc=(Vector)hs.get(ml); - String namem=ml.getName(); - - /*we has handled the primitive element before*/ - if(!(MElement.isPrimitive(namem))) - { - Element a=new Element("element",namespace); - Attribute at=new Attribute("name",namem); - - String typeNamem=namem+"Typehasa"+typeCount; - typeCount++; - Attribute at2=new Attribute("type","moby:"+typeNamem); - - Vector hasaNameV=getHasaNameVector(ml); - addUniqueElement(a,"unique_1", hasaNameV); - - a.setAttribute(at); - a.setAttribute(at2); - - String size=""+vc.size(); - Attribute o1=new Attribute("minOccurs",size); - Attribute o2=new Attribute("maxOccurs",size); - a.setAttribute(o1); - a.setAttribute(o2); - sequence1.addContent(a); - - Element myCom=getComplexTypeRec(ml,typeNamem,vc); - root.addContent(myCom); - } - } - - - } - if(has1.size()>0) - { - - - for(int i=0;i + + // this is the line that is modified when handing out the full scale moby schema + + + + */ + + + return moby; + } + + /** + *the input is a MElement object; we will find all its hasa and has relations with other object; then modify the root + * element of the output xml file; the root element is the root element of a xml schema xml file. + *@param m a MElement + */ + public void getElement(MElement m) + { + Vector hasa=m.getHasaMElements(); + + Vector has=m.getHasMElements(); + + //if this MElement does not have hasa or has relation with other object, only need to return + //the first level. + if((hasa.size()==0)&&(has.size()==0)) + { + getFirstLevel(m, root); + Vector vcc=new Vector(); //create an empty vector as a parameter of function set3Attributes + set3Attributes(m, firstComplexType,vcc); + + + return; + } + else //this MElement have has and/or hasa relation with ohter MElment + { + + + getFirstLevel(m,root); + Element sequence=new Element("sequence",namespace); //need a sequence element in XML schema for has + //and hasa object + firstComplexType.addContent(sequence); + + + + //find the primitive element and add them to schema + Vector tempt1; + Vector tempt2; + tempt1=(Vector)has.clone();//do not change tempt1 and tempt2, so clone two vector for them. + tempt2=(Vector)hasa.clone(); + + PrimitiveVector pri=new PrimitiveVector(tempt1, tempt2); + + + + addPrimitiveElement(pri, sequence);//add these primitive elements to the squences + + /*for object other than primitive type*/ + if(has.size()>0) + { + + + for (int i=0; i0)//the following dealing with the object in the hasa vector + { + /*create a MElementHastable for the hasa Vector. The key of the hashtabel is MElement, + and the value of hashtable of a vector containing article names*/ + MElementHashtable hss=new MElementHashtable(hasa); + + Hashtable hs=hss.getHashtable();//get a hashtable + int count=0; + + Enumeration e=hs.keys();//get all keys of the hashtable + + while(e.hasMoreElements())//go through the Enumeration + { + MElement ml=(MElement)e.nextElement(); + + Vector vc=(Vector)hs.get(ml);//get value, a vector of article names, of the hashtable + String namem=ml.getName(); + + + if(!(MElement.isPrimitive(namem))) + { + Element a=new Element("element", namespace);//add the element to the sequence + Attribute at=new Attribute("name",namem); + + String typeNamem=namem+"Typep"+typeCount; + typeCount++; + Attribute at2=new Attribute("type","moby:"+ typeNamem); + + Vector hasaNamesV=getHasaNameVector(ml); + addUniqueElement(a,"unique_1",hasaNamesV);//add an unique element + + + String st=ml.getDescription(); + addDescriptNote(st,sequence); + sequence.addContent(a); + a.setAttribute(at); + a.setAttribute(at2); + + String size=""+vc.size(); + + Attribute o1=new Attribute("minOccurs",size);//add occurence of element + Attribute o2=new Attribute("maxOccurs",size); + a.setAttribute(o1); + a.setAttribute(o2); + + //recursively to find the complex type + Element myCom=getComplexTypeRec(ml,typeNamem,vc); + root.addContent(myCom); + } + } + + + } + Vector vcc2=new Vector();//the empty vector is only used to as a parameter of set3Attributes() + set3Attributes( m,firstComplexType,vcc2); + + + } + + } + + /** + *Given a vector containing possible article names and type name, add an XML Schema element to describe + *the restriction. + *@param roots the root element of the XML Schema + *@param types the name of XML Schema simpleType + *@param articles a vector containing different article names + */ + public void addArticleNameType(Element roots, String types, Vector articles) + { + //create a simpleType XML Schema element + Element simpleType=new Element("simpleType", namespace); + Attribute at=new Attribute("name",types); + simpleType.setAttribute(at); + + //create a XML schema restriction element + Element restriction=new Element("restriction", namespace); + Attribute base=new Attribute("base","xs:string"); + restriction.setAttribute(base); + + simpleType.addContent(restriction); + + //put all article names into the enumeration of the restriction element + for(int i=0;i0) ||(has.size()>0))//if true, we can not use simpleContent XML Schema element + { + flag=0; + } + String articleName=m.getArticleName(); + + Element e1=getNamespaceAttribute(); + Element e2=getIDAttribute(); + Element e3; + + if(ar.size()==0) + { + e3=getArticleName(articleName); + } + else + { + /*if this object can has many article names, we put restriction on the article names*/ + e3=getRestrictionArticleName(ar); + } + + //check whether the type of this element is null or not + String typeName=m.getType(); + + /*check if the name of the element is primitive*/ + String priName=m.getName(); + if(MElement.isPrimitive(priName)) + { + typeName=priName; + } + + if(typeName==null||typeName.length()==0||flag==0) + { + + types.addContent(e1); + types.addContent(e2); + types.addContent(e3); + } + + /*if the type is not empty, and use extensionin schema to describe this relation*/ + else + { + typeName=typeName.toLowerCase(); + + /*create a simpleContent XML Schema element*/ + Element simpleContent=new Element("simpleContent",namespace); + + Element extension=new Element("extension", namespace); + + Attribute base=new Attribute("base","xs:"+typeName); + extension.setAttribute(base); + + extension.addContent(e1); + extension.addContent(e2); + extension.addContent(e3); + + simpleContent.addContent(extension); + + types.addContent(simpleContent); + } + + } + + /** + *create the top level of xml schema element for a moby object. + *@param m a MElement + *@param rt a xML Schema root element + */ + public void getFirstLevel(MElement m, Element rt) + { + String name=m.getName(); + String type=name+"Type"; + + Element tem1=new Element("element",namespace); + Attribute attr1=new Attribute("name",name); + Attribute attr2=new Attribute("type", "moby:"+type); + tem1.setAttribute(attr1); + tem1.setAttribute(attr2); + + /*add unique element for moby objects in the hasa relationship*/ + Vector hasaNames=getHasaNameVector(m); + //add an unique element to the first level + addUniqueElement(tem1,"first", hasaNames); + rt.addContent(tem1); + + String str=m.getDescription(); + addDescriptNote(str,rt); + + /*add the complexType element of XML Schema to the root element*/ + firstComplexType=getComplexType(m, type); + + + rt.addContent(firstComplexType); + } + + /** + *recursively get a complexType XML Shema element for MElement; when this MElement does + *not have has and hasa relation, we use another method called getComplexType; + *@param m a MElement object + *@param typeName the name of complexType + *@param vc1 a vector containing all possible article names for the MElement + *@return the complexType element for this MElement object + */ + public Element getComplexTypeRec(MElement m, String typeName, Vector vc1) + { + + root.addContent(new Comment("This is definition of complexType "+typeName)); + + /*get has and hasa vector for this MElement object*/ + Vector hasa1=m.getHasaMElements(); + + Vector has1=m.getHasMElements(); + + /*create a complexType element*/ + Element complexType=new Element("complexType",namespace); + Attribute at1=new Attribute("name",typeName); + complexType.setAttribute(at1); + + /*if this MElement does not have has or hasa relationship with other object, we have done*/ + if((hasa1.size()==0)&&(has1.size()==0)) + { + + set3Attributes(m,complexType,vc1); + + return complexType; + } + /*if this MElement has has or hasa relationshipe with other object, need puts all object into sequence XML + schema element*/ + else + { + Element sequence1=new Element("sequence",namespace); + complexType.addContent(sequence1); + + //find the primitive elements and add these to schema + PrimitiveVector pri=new PrimitiveVector(hasa1,has1); + addPrimitiveElement(pri, sequence1); + + /*deal with objects in the hasa vector*/ + if(hasa1.size()>0) + { + + MElementHashtable hss=new MElementHashtable(hasa1); + Hashtable hs=hss.getHashtable(); + int count=0; + + Enumeration e=hs.keys(); + + while(e.hasMoreElements()) + { + MElement ml=(MElement)e.nextElement(); + Vector vc=(Vector)hs.get(ml); + String namem=ml.getName(); + + /*we has handled the primitive element before*/ + if(!(MElement.isPrimitive(namem))) + { + Element a=new Element("element",namespace); + Attribute at=new Attribute("name",namem); + + String typeNamem=namem+"Typehasa"+typeCount; + typeCount++; + Attribute at2=new Attribute("type","moby:"+typeNamem); + + Vector hasaNameV=getHasaNameVector(ml); + addUniqueElement(a,"unique_1", hasaNameV); + + a.setAttribute(at); + a.setAttribute(at2); + + String size=""+vc.size(); + Attribute o1=new Attribute("minOccurs",size); + Attribute o2=new Attribute("maxOccurs",size); + a.setAttribute(o1); + a.setAttribute(o2); + sequence1.addContent(a); + + Element myCom=getComplexTypeRec(ml,typeNamem,vc); + root.addContent(myCom); + } + } + + + } + if(has1.size()>0) + { + + + for(int i=0;i moby_data_type"); + System.out.println("where possible options include:"); + System.out.println(" -m generate a schema that describes the complete moby message"); + System.out.println(); + System.exit(1); + } +} + + + + From carrere at pub.open-bio.org Thu Sep 8 09:44:48 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Thu, 8 Sep 2005 09:44:48 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509081344.j88Dimem016358@pub.open-bio.org> carrere Thu Sep 8 09:44:48 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/xsl In directory pub.open-bio.org:/tmp/cvs-serv16334/xsl Log Message: Directory /home/repository/moby/moby-live/Perl/MOBY/xsl added to the repository moby-live/Perl/MOBY/xsl - New directory rcsdiff: /home/repository/moby/moby-live/Perl/MOBY/xsl/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/MOBY/xsl/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/MOBY/xsl/RCS/directory,v: No such file or directory From carrere at pub.open-bio.org Thu Sep 8 09:46:45 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Thu, 8 Sep 2005 09:46:45 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509081346.j88DkjGa016400@pub.open-bio.org> carrere Thu Sep 8 09:46:45 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/xsl In directory pub.open-bio.org:/tmp/cvs-serv16379 Added Files: parseMobyMessage.xsl Log Message: This XSL style-sheet is used by MOBYXSLT.pm module to parse MOBY messages with xsltproc binary. moby-live/Perl/MOBY/xsl parseMobyMessage.xsl,NONE,1.1 From carrere at pub.open-bio.org Thu Sep 8 09:51:06 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Thu, 8 Sep 2005 09:51:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509081351.j88Dp6Kj016446@pub.open-bio.org> carrere Thu Sep 8 09:51:06 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv16419 Added Files: MOBYXSLT.pm Log Message: This module contains many of CommonSubs methods but doesn't use XML::DOM to parse MOBY message. It uses a first pass xsl transformation (with xsltproc and ./xsl/parseMobyMessage.xsl as a style-sheet) and then build Perl structure upon this parsing. This module has been tested on a 10Mb MOBY message and it's OK. 3 Globals Variable have to be edited before use. moby-live/Perl/MOBY MOBYXSLT.pm,NONE,1.1 From gss at pub.open-bio.org Thu Sep 8 15:46:47 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 8 Sep 2005 15:46:47 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509081946.j88JklED017703@pub.open-bio.org> gss Thu Sep 8 15:46:47 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org In directory pub.open-bio.org:/tmp/cvs-serv17681 Removed Files: .classpath Log Message: Not needed moby-live/S-MOBY/ref-impl/semanticmoby.org .classpath,1.4,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/RCS/.classpath,v: No such file or directory From gss at pub.open-bio.org Thu Sep 8 15:47:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 8 Sep 2005 15:47:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509081947.j88Jl2FH017738@pub.open-bio.org> gss Thu Sep 8 15:47:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev In directory pub.open-bio.org:/tmp/cvs-serv17716/src/org/semanticmoby/ref/servlets/dev Removed Files: OWLValidationServlet.java Log Message: No longer needed moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev OWLValidationServlet.java,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/RCS/OWLValidationServlet.java,v: No such file or directory From senger at pub.open-bio.org Sun Sep 11 22:45:47 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 11 Sep 2005 22:45:47 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509120245.j8C2jlsI006937@pub.open-bio.org> senger Sun Sep 11 22:45:46 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv6918 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.29,1.30 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/04 13:45:36 1.29 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/12 02:45:46 1.30 @@ -1316,6 +1316,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + From kawas at pub.open-bio.org Mon Sep 12 14:21:13 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon, 12 Sep 2005 14:21:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509121821.j8CILDLQ009118@pub.open-bio.org> kawas Mon Sep 12 14:21:13 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test In directory pub.open-bio.org:/tmp/cvs-serv9097/org/biomoby/registry/rdfagent/test Added Files: RDFAgentTestSuite.java Log Message: adding a test driver for the agent. I have to still commit the actual test files that this driver utilizes. moby-live/Java/src/main/org/biomoby/registry/rdfagent/test RDFAgentTestSuite.java,NONE,1.1 From kawas at pub.open-bio.org Mon Sep 12 14:22:10 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon, 12 Sep 2005 14:22:10 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509121822.j8CIMAas009153@pub.open-bio.org> kawas Mon Sep 12 14:22:10 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util In directory pub.open-bio.org:/tmp/cvs-serv9124/org/biomoby/registry/rdfagent/util Modified Files: Report.java Constants.java Log Message: made various bug fixes and added a sendmail option for sending out the results to service providers. moby-live/Java/src/main/org/biomoby/registry/rdfagent/util Report.java,1.6,1.7 Constants.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java 2005/08/04 12:58:40 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java 2005/09/12 18:22:10 1.7 @@ -8,7 +8,7 @@ /** * @author Nina Opushneva - * + * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ @@ -22,132 +22,170 @@ import org.biomoby.registry.rdfagent.verifier.DataMngr; public class Report { - - static ArrayList mr = null; + + static ArrayList mr = null; + static ArrayList ds = null; - - public static void add(String line){ - - if(mr == null){ - mr = new ArrayList(); - } - mr.add(line); - - } - - public static void doBuild(String line){ - - if(ds == null){ - ds = new ArrayList(); - } - ds.add(line); - - } - - public static void send(String signURL){ - - String message = ""; - - if(mr != null){ - - StringBuffer mes1 = new StringBuffer(); - - for (int i=0; i < mr.size(); i++){ - mes1.append(mr.get(i).toString()+"\n"); - } - message += mes1; - } - if(ds != null){ - - StringBuffer mes2 = new StringBuffer(); - - for (int i=0; i < ds.size(); i++){ - mes2.append(ds.get(i).toString()+"\n"); - } - message += mes2; - } - - if (Constants.MB_MAIL_SERVER != null || !Constants.MB_MAIL_SERVER.equals("") ){ - - String to = ""; - to = DataMngr.getContactEmail(signURL); - - if (to.equals("")){ - to = "edward.kawas at gmail.com"; - - } - String subject = "The RDFagent Report"; - Log.info("email message is\n" + message); - Communicator.sendMail(to,subject,message.toString(),Constants.MB_FROM); // send message to the service provider - that service was deregistered - ds = null; - mr = null; - } - } - - public static void createFile(String fileName){ - try { - File file = new File(fileName); - - // Create file if it does not exist - boolean success = file.createNewFile(); - if (success) { - // File did not exist and was created - } else { - // File already exists - file.delete(); - file.createNewFile(); - } - } catch (IOException e) { - Log.warning(e.getMessage()); - } - } - - public static void doWrite(String line) { - - try { - String path = Constants.RDFagentHome; - BufferedWriter out = new BufferedWriter(new FileWriter(path+Constants.SV_REPORT_PATH, true)); - out.write(line); - out.newLine(); - out.close(); - } catch (IOException e) { - Log.warning(e.getMessage()); - } - - } - -/* public static void doBuild(String line) { - - try { - String path = Constants.RDFagentHome; - BufferedWriter out = new BufferedWriter(new FileWriter(path+Constants.SV_DELFILE_PATH, true)); - out.write(line); - out.newLine(); - out.close(); - } catch (IOException e) { - Log.warning(e.getMessage()); - } - - } -*/ - - public static void doSave(String file,String line) { - - try { - - BufferedWriter out = new BufferedWriter(new FileWriter(file, true)); - out.write(line); - out.newLine(); - out.close(); - } catch (IOException e) { - Log.warning(e.getMessage()); - } - - } - - - } + public static void add(String line) { + + if (mr == null) { + mr = new ArrayList(); + } + mr.add(line); + + } + + public static void doBuild(String line) { + + if (ds == null) { + ds = new ArrayList(); + } + ds.add(line); + + } + + public static void send(String signURL) { + + String message = ""; + + if (mr != null) { + + StringBuffer mes1 = new StringBuffer(); + + for (int i = 0; i < mr.size(); i++) { + mes1.append(mr.get(i).toString() + "\n"); + } + message += mes1; + } + if (ds != null) { + + StringBuffer mes2 = new StringBuffer(); + + for (int i = 0; i < ds.size(); i++) { + mes2.append(ds.get(i).toString() + "\n"); + } + message += mes2; + } + + if (Constants.MB_MAIL_SERVER != null + || !Constants.MB_MAIL_SERVER.equals("") + || Constants.MB_MAIL_PRGM != null + || !Constants.MB_MAIL_PRGM.equals("")) { + + String to = ""; + to = DataMngr.getContactEmail(signURL); + + if (to.equals("")) { + to = "edward.kawas at gmail.com"; + + } + String subject = "The RDFagent Report"; + Log.info("email message is\n" + message); + if (Constants.MB_MAIL_PRGM != null + || !Constants.MB_MAIL_PRGM.equals("")) + try { + + //String cmd ="echo \"" + message.toString() + "\" | "+ + // Constants.MB_MAIL_PRGM+ " -s 'The RDFagent Report :-(' '" + // + "markw at illuminae.com"+ "'"; + String cmd = "echo \"" + message.toString() + "\" | " + + Constants.MB_MAIL_PRGM + + " -s 'The RDFagent Report :-(' '" + to + "'"; + File file = new File("_script_.sh"); + FileWriter fw = new FileWriter(file); + fw.write(_shellScriptHeader + cmd); + fw.close(); + + Process p = Runtime.getRuntime().exec( + "chmod +x _script_.sh"); + p.waitFor(); + p = Runtime.getRuntime().exec("./_script_.sh"); + p.waitFor(); + Log.info("_script_.sh has " + + ((file.delete()) ? "" : "not ") + "been deleted" + + System.getProperty("line.separator") + + "The exit value of the spawned process was : " + + p.exitValue()); + } catch (IOException e) { + e.printStackTrace(); + Log.severe("Could not send message using cmd line mail to " + + to); + Report + .doWrite("Could not send message using cmd line mail to " + + to); + // use this only as a last resort + if (Constants.MB_MAIL_SERVER != null + || !Constants.MB_MAIL_SERVER.equals("")) + Communicator.sendMail(to, subject, message.toString(), + Constants.MB_FROM); + } catch (InterruptedException e) { + e.printStackTrace(); + } + //Communicator.sendMail(to,subject,message.toString(),Constants.MB_FROM); + ds = null; + mr = null; + } + } + + public static void createFile(String fileName) { + try { + File file = new File(fileName); + + // Create file if it does not exist + boolean success = file.createNewFile(); + if (success) { + // File did not exist and was created + } else { + // File already exists + file.delete(); + file.createNewFile(); + } + } catch (IOException e) { + Log.warning(e.getMessage()); + } + } + + public static void doWrite(String line) { + + try { + String path = Constants.RDFagentHome; + BufferedWriter out = new BufferedWriter(new FileWriter(path + + Constants.SV_REPORT_PATH, true)); + out.write(line); + out.newLine(); + out.close(); + } catch (IOException e) { + Log.warning(e.getMessage()); + } + + } + + /* + * public static void doBuild(String line) { + * + * try { String path = Constants.RDFagentHome; BufferedWriter out = new + * BufferedWriter(new FileWriter(path+Constants.SV_DELFILE_PATH, true)); + * out.write(line); out.newLine(); out.close(); } catch (IOException e) { + * Log.warning(e.getMessage()); } } + */ + + public static void doSave(String file, String line) { + + try { + + BufferedWriter out = new BufferedWriter(new FileWriter(file, true)); + out.write(line); + out.newLine(); + out.close(); + } catch (IOException e) { + Log.warning(e.getMessage()); + } + + } + private final static String _shellScriptHeader = "#!/bin/sh" + + System.getProperty("line.separator"); +} =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Constants.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Constants.java 2005/04/16 14:32:47 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Constants.java 2005/09/12 18:22:10 1.7 @@ -40,6 +40,7 @@ public static String MB_MAIL_USER = null; public static String MB_MAIL_PSWD = null; public static String MB_FROM = null; + public static String MB_MAIL_PRGM = null; public static String SP_SUBJECT = null; public static String SP_ERR_MSG_CON = null; @@ -78,6 +79,7 @@ MB_SUBJECT = moby.getChildTextTrim("subject"); MB_ERR_MSG = moby.getChildTextTrim("errMessage"); MB_MAIL_SERVER = moby.getChildTextTrim("mailServer"); + MB_MAIL_PRGM = moby.getChildTextTrim("cmdLnMailProgram"); MB_MAIL_USER = moby.getChildTextTrim("mailUser"); MB_MAIL_PSWD = moby.getChildTextTrim("mailPswd"); MB_FROM = moby.getChildTextTrim("from"); From kawas at pub.open-bio.org Mon Sep 12 14:21:08 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon, 12 Sep 2005 14:21:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509121821.j8CIL8aV009084@pub.open-bio.org> kawas Mon Sep 12 14:21:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test In directory pub.open-bio.org:/tmp/cvs-serv9060/org/biomoby/registry/rdfagent/test Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test added to the repository moby-live/Java/src/main/org/biomoby/registry/rdfagent/test - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test/RCS/directory,v: No such file or directory From kawas at pub.open-bio.org Mon Sep 12 14:22:11 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon, 12 Sep 2005 14:22:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509121822.j8CIMB84009172@pub.open-bio.org> kawas Mon Sep 12 14:22:10 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier In directory pub.open-bio.org:/tmp/cvs-serv9124/org/biomoby/registry/rdfagent/verifier Modified Files: Communicator.java Log Message: made various bug fixes and added a sendmail option for sending out the results to service providers. moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier Communicator.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/Communicator.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/Communicator.java 2005/08/04 12:58:41 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/Communicator.java 2005/09/12 18:22:10 1.8 @@ -174,7 +174,6 @@ + " > WILL BE DEREGISTERED FROM mobycentral REGISTRY"); Report .doWrite("======================================================================================="); - // TODO send the report here? } } else { From kawas at pub.open-bio.org Mon Sep 12 22:50:56 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon, 12 Sep 2005 22:50:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130250.j8D2ouWj010280@pub.open-bio.org> kawas Mon Sep 12 22:50:56 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test In directory pub.open-bio.org:/tmp/cvs-serv10259/org/biomoby/registry/rdfagent/test Added Files: TestException.java Log Message: silly exception class that isnt really used, but caused compile problems. moby-live/Java/src/main/org/biomoby/registry/rdfagent/test TestException.java,NONE,1.1 From senger at pub.open-bio.org Tue Sep 13 02:42:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 13 Sep 2005 02:42:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130642.j8D6gQeI010723@pub.open-bio.org> senger Tue Sep 13 02:42:26 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv10704 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.2,1.3 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/04 13:15:54 1.2 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/13 06:42:26 1.3 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Tue Sep 13 02:46:35 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 13 Sep 2005 02:46:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130646.j8D6kZPV010887@pub.open-bio.org> senger Tue Sep 13 02:46:33 EDT 2005 Update of /home/repository/moby/moby-live/Java/lib/ant_home/lib In directory pub.open-bio.org:/tmp/cvs-serv10759 Modified Files: ant-antlr.jar ant-apache-bcel.jar ant-apache-bsf.jar ant-apache-log4j.jar ant-apache-oro.jar ant-apache-regexp.jar ant-apache-resolver.jar ant-commons-logging.jar ant-commons-net.jar ant-icontract.jar ant-jai.jar ant-javamail.jar ant-jdepend.jar ant-jmf.jar ant-jsch.jar ant-junit.jar ant-launcher.jar ant-netrexx.jar ant-nodeps.jar ant-starteam.jar ant-stylebook.jar ant-swing.jar ant-trax.jar ant-vaj.jar ant-weblogic.jar ant-xalan1.jar ant-xslp.jar ant.jar Log Message: ant version 1.6.5 moby-live/Java/lib/ant_home/lib ant-antlr.jar,1.1,1.2 ant-apache-bcel.jar,1.1,1.2 ant-apache-bsf.jar,1.1,1.2 ant-apache-log4j.jar,1.1,1.2 ant-apache-oro.jar,1.1,1.2 ant-apache-regexp.jar,1.1,1.2 ant-apache-resolver.jar,1.1,1.2 ant-commons-logging.jar,1.1,1.2 ant-commons-net.jar,1.1,1.2 ant-icontract.jar,1.1,1.2 ant-jai.jar,1.1,1.2 ant-javamail.jar,1.1,1.2 ant-jdepend.jar,1.1,1.2 ant-jmf.jar,1.1,1.2 ant-jsch.jar,1.1,1.2 ant-junit.jar,1.1,1.2 ant-launcher.jar,1.1,1.2 ant-netrexx.jar,1.1,1.2 ant-nodeps.jar,1.1,1.2 ant-starteam.jar,1.1,1.2 ant-stylebook.jar,1.1,1.2 ant-swing.jar,1.1,1.2 ant-trax.jar,1.1,1.2 ant-vaj.jar,1.1,1.2 ant-weblogic.jar,1.1,1.2 ant-xalan1.jar,1.1,1.2 ant-xslp.jar,1.1,1.2 ant.jar,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-antlr.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-antlr.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-antlr.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-antlr.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bcel.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bcel.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bcel.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bcel.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bsf.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bsf.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bsf.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bsf.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-log4j.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-log4j.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-log4j.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-log4j.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-oro.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-oro.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-oro.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-oro.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-regexp.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-regexp.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-regexp.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-regexp.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-resolver.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-resolver.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-resolver.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-resolver.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-logging.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-logging.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-logging.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-logging.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-net.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-net.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-net.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-net.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-icontract.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-icontract.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-icontract.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-icontract.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jai.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jai.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jai.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jai.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-javamail.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-javamail.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-javamail.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-javamail.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jdepend.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jdepend.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jdepend.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jdepend.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jmf.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jmf.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jmf.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jmf.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jsch.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jsch.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jsch.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jsch.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-junit.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-junit.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-junit.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-junit.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-launcher.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-launcher.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-launcher.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-launcher.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-netrexx.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-netrexx.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-netrexx.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-netrexx.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-nodeps.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-nodeps.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-nodeps.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-nodeps.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-starteam.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-starteam.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-starteam.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-starteam.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-stylebook.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-stylebook.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-stylebook.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-stylebook.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-swing.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-swing.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-swing.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-swing.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-trax.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-trax.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-trax.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-trax.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-vaj.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-vaj.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-vaj.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-vaj.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-weblogic.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-weblogic.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-weblogic.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-weblogic.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xalan1.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xalan1.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xalan1.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xalan1.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xslp.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xslp.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xslp.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xslp.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant.jar,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant.jar 2005/05/19 15:57:21 1.3 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant.jar 2005/09/13 06:46:33 1.4 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant.jar: diff failed From senger at pub.open-bio.org Tue Sep 13 02:53:28 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 13 Sep 2005 02:53:28 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130653.j8D6rSLI010936@pub.open-bio.org> senger Tue Sep 13 02:53:28 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv10917 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.30,1.31 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/12 02:45:46 1.30 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/13 06:53:28 1.31 @@ -817,7 +817,7 @@ - + @@ -1347,5 +1347,28 @@ + + + + + + + + + + + + + + + From senger at pub.open-bio.org Tue Sep 13 02:53:28 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 13 Sep 2005 02:53:28 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130653.j8D6rSee010963@pub.open-bio.org> senger Tue Sep 13 02:53:28 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv10917/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java DashboardPanel.java RegistryPanel.java Added Files: NOTES Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard NOTES,NONE,1.1 AbstractPanel.java,1.2,1.3 DashboardPanel.java,1.1,1.2 RegistryPanel.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/04 13:45:38 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/13 06:53:28 1.3 @@ -8,12 +8,17 @@ package org.biomoby.service.dashboard; +import org.tulsoft.tools.gui.SwingUtils; + import javax.swing.JLabel; import javax.swing.JPanel; -import javax.swing.text.html.HTMLDocument; import javax.swing.Icon; import javax.swing.JComponent; +import javax.swing.AbstractButton; +import javax.swing.text.html.HTMLDocument; +import java.awt.GridBagConstraints; +import java.awt.Insets; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeSupport; @@ -29,6 +34,40 @@ extends JPanel implements DashboardPanel { + + // copy here some often used constants + protected static final int RELATIVE = GridBagConstraints.RELATIVE; + protected static final int REMAINDER = GridBagConstraints.REMAINDER; + protected static final int NONE = GridBagConstraints.NONE; + protected static final int BOTH = GridBagConstraints.BOTH; + protected static final int HORIZONTAL = GridBagConstraints.HORIZONTAL; + protected static final int VERTICAL = GridBagConstraints.VERTICAL; + protected static final int CENTER = GridBagConstraints.CENTER; + protected static final int NORTH = GridBagConstraints.NORTH; + protected static final int NORTHEAST = GridBagConstraints.NORTHEAST; + protected static final int EAST = GridBagConstraints.EAST; + protected static final int SOUTHEAST = GridBagConstraints.SOUTHEAST; + protected static final int SOUTH = GridBagConstraints.SOUTH; + protected static final int SOUTHWEST = GridBagConstraints.SOUTHWEST; + protected static final int WEST = GridBagConstraints.WEST; + protected static final int NORTHWEST = GridBagConstraints.NORTHWEST; + protected static final int PAGE_START = GridBagConstraints.PAGE_START; + protected static final int PAGE_END = GridBagConstraints.PAGE_END; + protected static final int LINE_START = GridBagConstraints.LINE_START; + protected static final int LINE_END = GridBagConstraints.LINE_END; + protected static final int FIRST_LINE_START = GridBagConstraints.FIRST_LINE_START; + protected static final int FIRST_LINE_END = GridBagConstraints.FIRST_LINE_END; + protected static final int LAST_LINE_START = GridBagConstraints.LAST_LINE_START; + protected static final int LAST_LINE_END = GridBagConstraints.LAST_LINE_END; + + + /********************************************************************* + * Default constructor (just for the sub-classes). + ********************************************************************/ + protected AbstractPanel() { + support = new PropertyChangeSupport (this); + } + /************************************************************************** * **************************************************************************/ @@ -59,7 +98,7 @@ } /************************************************************************** - * Here we get notified when a property chnage happen. + * Here we get notified when a property change happen. **************************************************************************/ public void propertyChange (PropertyChangeEvent event) { } @@ -83,4 +122,25 @@ **************************************************************************/ abstract public JLabel getTitle(); + // + // Methods to be used by sub-classes + // + + /********************************************************************* + * Set a button to a common look-and-feel. + ********************************************************************/ + protected static void commonButtonLookAndFeel (AbstractButton but) { +// but.setMargin (new Insets (0,0,0,0)); +// but.setBorderPainted (false); + but.setFocusPainted (false); +// but.setContentAreaFilled (false); + } + + /********************************************************************* + * Return true if confirmation dialog passed. + ********************************************************************/ + public boolean confirm (Object msg) { + return SwingUtils.confirm (this, msg, null); + } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/02 07:38:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/13 06:53:28 1.2 @@ -29,7 +29,7 @@ */ public interface DashboardPanel - extends PropertyChangeListener { + extends PropertyChangeListener, DashboardProperties { /************************************************************************** * A name identifies a panel in the dashboard's tabs. It should be =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/04 13:45:38 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/13 06:53:28 1.3 @@ -8,16 +8,22 @@ package org.biomoby.service.dashboard; +import org.tulsoft.tools.gui.SwingUtils; + import javax.swing.JLabel; -import javax.swing.text.html.HTMLDocument; import javax.swing.Icon; import javax.swing.JComponent; +import javax.swing.text.html.HTMLDocument; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; /** - * + * A panel displaying contents of a Biomoby registry. It also select + * what Biomoby registry to work with, and what cache directory to + * use.

        * * WORK IN PROGRESS.

        * @@ -60,7 +66,7 @@ * **************************************************************************/ public JLabel getTitle() { - return null; + return new JLabel (getName()); } } From senger at pub.open-bio.org Tue Sep 13 02:54:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 13 Sep 2005 02:54:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130654.j8D6saEL011005@pub.open-bio.org> senger Tue Sep 13 02:54:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv10990/src/main/org/biomoby/service/dashboard Added Files: ConsolePanel.java Dashboard.java DashboardProperties.java EventGeneratorPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard ConsolePanel.java,NONE,1.1 Dashboard.java,NONE,1.1 DashboardProperties.java,NONE,1.1 EventGeneratorPanel.java,NONE,1.1 From pieter at pub.open-bio.org Mon Sep 12 09:51:03 2005 From: pieter at pub.open-bio.org (Pieter Neerincs) Date: Mon, 12 Sep 2005 09:51:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509121351.j8CDp3Up008568@pub.open-bio.org> pieter Mon Sep 12 09:51:03 EDT 2005 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv8543/Perl/scripts Modified Files: CloneCentralDatabases.pl Log Message: Fixed small SQL GRANT PRIVILEGES bug in Perl/scripts/CloneCentralDatabases.pl moby-live/Perl/scripts CloneCentralDatabases.pl,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/scripts/CloneCentralDatabases.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/scripts/CloneCentralDatabases.pl 2005/07/07 11:39:54 1.1 +++ /home/repository/moby/moby-live/Perl/scripts/CloneCentralDatabases.pl 2005/09/12 13:51:03 1.2 @@ -143,7 +143,7 @@ $data .= "FLUSH PRIVILEGES\;\n"; $data .= "CREATE DATABASE IF NOT EXISTS $dbname\;\n"; $data .= "USE $dbname\;\n"; - $data .= "GRANT ALL PRIVILEGES ON $dbname TO \"$username\"\@\"localhost\" identified by \"$password\"\;\n"; + $data .= "GRANT ALL PRIVILEGES ON $dbname.* TO \"$username\"\@\"localhost\" identified by \"$password\"\;\n"; $data .= "FLUSH PRIVILEGES\;\n"; } From kawas at pub.open-bio.org Tue Sep 13 09:17:58 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 13 Sep 2005 09:17:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509131317.j8DDHwUB012224@pub.open-bio.org> kawas Tue Sep 13 09:17:58 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi In directory pub.open-bio.org:/tmp/cvs-serv12199/Adaptor/moby/queryapi Modified Files: mysql.pm Log Message: commented out an unused line that was causing grief. The variable that has been removed is unused. moby-live/Perl/MOBY/Adaptor/moby/queryapi mysql.pm,1.72,1.73 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/08/29 22:36:32 1.72 +++ /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/09/13 13:17:58 1.73 @@ -1,1430 +1,1430 @@ -package MOBY::Adaptor::moby::queryapi::mysql; - -use strict; -use vars qw($AUTOLOAD @ISA); -use Carp; -use MOBY::Adaptor::moby::queryapi; -use DBI; -use DBD::mysql; - - at ISA = qw{MOBY::Adaptor::moby::queryapi}; # implements the interface - -{ - #Encapsulated class data - - #___________________________________________________________ - #ATTRIBUTES - my %_attr_data = # DEFAULT ACCESSIBILITY - ( - driver => ["DBI:mysql", 'read/write'], - dbh => [undef, 'read/write'], - - ); - - #_____________________________________________________________ - - # METHODS, to operate on encapsulated class data - - # Is a specified object attribute accessible in a given mode - sub _accessible { - my ($self, $attr, $mode) = @_; - $_attr_data{$attr}[1] =~ /$mode/ - } - - # Classwide default value for a specified object attribute - sub _default_for { - my ($self, $attr) = @_; - $_attr_data{$attr}[0]; - } - - # List of names of all specified object attributes - sub _standard_keys { - keys %_attr_data; - } - - sub driver { - my ($self, $arg) = @_; - $self->{driver} = $arg if defined $arg; - return $self->{driver}; - } - sub dbh { - my ($self, $arg) = @_; - $self->{dbh} = $arg if defined $arg; - return $self->{dbh}; - } - -} - -sub _getDBHandle { - my ($ontology) = @_; - my $CONF = MOBY::Config->new; - my $adap = $CONF->getDataAdaptor(source => $ontology); - return $adap->dbh; -} - -sub new { - my ($caller, %args) = @_; - my $self = $caller->SUPER::new(%args); - - my $caller_is_obj = ref($caller); - my $class = $caller_is_obj || $caller; - - foreach my $attrname ( $self->_standard_keys ) { - if (exists $args{$attrname} && defined $args{$attrname}) { - $self->{$attrname} = $args{$attrname} } - elsif ($caller_is_obj) { - $self->{$attrname} = $caller->{$attrname} } - else { - $self->{$attrname} = $self->_default_for($attrname) } - } - - return unless $self->driver; - my $driver = $self->driver; # inherited from the adaptorI (queryapi) - my $username = $self->username; - my $password = $self->password; - my $port = $self->port; - my $url = $self->url; - my $dbname = $self->dbname; - - my ($dsn) = "$driver:$dbname:$url:$port"; - my $dbh = DBI->connect($dsn, $username, $password, {RaiseError => 1}) or die "can't connect to database"; - - - ############################################################## - unless ($dbh) { - print STDERR "Couldn't connect to the datasource \n",($self->_dump()),"\n\n"; - return undef; - } - - $self->dbh($dbh); - ############################################################# - - return undef unless $self->dbh; - return $self; - -} - -sub _add_condition{ - my ($statement, @params) = @_; - my @bindvalues = (); - my $condition = "where "; - - foreach my $param (@params ) - { - if (($param eq 'and') || ($param eq 'or')) - { - $condition .= $param . " "; - } - else - { - my %pair = %$param; - - for my $key (keys %pair) - { - if (defined $pair{$key}) - { - $condition .= $key . " = ? "; - push(@bindvalues, $pair{$key}); - } - else - { - $condition .= $key . " IS NULL " - } - } - } - } - $statement .= $condition; - return ($statement, @bindvalues); - } - -# preforms query but returns a reference to an array containing hash references -sub do_query{ - my ($dbh, $statement, @bindvalues) = @_; - my $sth = $dbh -> prepare($statement); - if (@bindvalues < 1) - { - $sth->execute; - } - else - { - $sth->execute(@bindvalues); - } - # returns an array of hash references - my $arrayHashRef = $sth->fetchall_arrayref({}); - return $arrayHashRef; -} - -sub get_value{ - my ($key, @params) = @_; - - foreach my $param (@params ) - { - my %pair = %$param; - for my $tmp (keys %pair) - { - if ($tmp eq $key){ - return $pair{$key}; - } - } - } -} - -sub _getSIIDFromLSID { - my ($self, $lsid) = @_; - my $dbh = $self->dbh; - my $sth = $dbh->prepare("select service_instance_id from service_instance where lsid = ?"); - $sth->execute($lsid); - my ($siid) = $sth->fetchrow_array(); - return $siid; -} - -# this should NOT retun a collection ID... needs more work... -# args passed in: service_lsid -sub query_collection_input{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $serv_lsid = $args{'service_instance_lsid'}; - - my $statement = "select - collection_input_id, - article_name - from collection_input as c, service_instance as si where si.service_instance_id = c.service_instance_id and si.lsid = ?"; - my $result = do_query($dbh, $statement, ($serv_lsid)); - return $result; -} - -# args passed in: service_instance_lsid, article_name -sub insert_collection_input { - my ($self, %args) = @_; - my $article = $args{article_name}; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - - $self->dbh->do("insert into collection_input (service_instance_id, article_name) values (?,?)", - undef, $siid, $article); - my $id=$self->dbh->{mysql_insertid}; - return $id; -} - -# pass in service_instance_lsid -sub delete_collection_input{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - - my $statement = "delete from collection_input where service_instance_id = ?"; - $self->dbh->do( $statement, undef, $siid); - - if ($self->dbh->err){ - return (1, $self->dbh->errstr); - } - else{ - return 0; - } -} - -# pass service_instance_lsid -sub query_collection_output{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - - my $statement = "select - collection_output_id, - article_name, - service_instance_id - from collection_output where service_instance_id = ? "; - my $result = do_query($dbh, $statement, ($siid)); - return $result; -} - -# pass service_instance_lsid, article_name -sub insert_collection_output { - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - $self->dbh->do("insert into collection_output (service_instance_id, article_name) values (?,?)", - undef, $siid,$args{'article_name'}); - my $id=$self->dbh->{mysql_insertid}; - return $id; -} - -# pass argument service_instance_lsid -sub delete_collection_output{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - my $statement = "delete from collection_output where service_instance_id = ?"; - my @bindvalues = (); - $dbh->do( $statement, undef, ($siid)); - - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -# pass service_instance_lsid -sub query_simple_input{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $collid = $args{collection_input_id}; - my $id_to_use = $siid?$siid:$collid; - - my $dbh = $self->dbh; - - my $statement = "select - simple_input_id, - object_type_uri, - namespace_type_uris, - article_name, - service_instance_id, - collection_input_id - from simple_input where "; - - my $condition; - $siid && ($condition = " service_instance_id = ? and collection_input_id IS NULL"); - $collid && ($condition = " collection_input_id = ?"); - $statement .= $condition; - - my $result = do_query($dbh, $statement, ($id_to_use)); - return $result; -} - -# pass service_instance_lsid, object_type_uri, namespace_type_uris, article_name, collection_input_id -sub insert_simple_input { - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - $dbh->do("insert into simple_input - (object_type_uri, - namespace_type_uris, - article_name, - service_instance_id, - collection_input_id) - values (?,?,?,?,?)", - undef, - $args{'object_type_uri'}, - $args{'namespace_type_uris'}, - $args{'article_name'}, - $siid, - $args{'collection_input_id'}); - my $id=$dbh->{mysql_insertid}; - return $id; -} - -# pass service_instance_lsid -sub delete_simple_input{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my ($collid) = $args{collection_input_id}; - my $statement1; my $statement2; - $siid && ($statement1 = "delete from simple_input where service_instance_id = ?"); - $collid && ($statement2 = "delete from simple_input where collection_input_id = ?"); - - $siid && ($dbh->do( $statement1, undef,($siid))); - $collid && ($dbh->do($statement2, undef,($collid))); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -sub delete_inputs { # this should replace all other delete_*_input - my ($self, %args) = @_; - my $dbh = $self->dbh; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $result_ids = $self->query_collection_input(service_instance_lsid => $self->lsid); - - my $statement = "delete from simple_input where service_instance_id = ?"; - - $dbh->do( $statement, undef,($siid)); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } - -} - -sub delete_output { # this should replace all other delete_*_output - -} - -# UGH this has to know too much bout the underlying database structure e.g. that one is null and other is full -# this problem is in MOBY::Central line 3321 3346 and 3374 -#****** FIX -# send service_instance_lsid, collection_input_id -sub query_simple_output{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $collid = $args{collection_output_id}; - my $dbh = $self->dbh; - my $id_to_use = $siid?$siid:$collid; - - my $statement = "select - simple_output_id, - object_type_uri, - namespace_type_uris, - article_name, - service_instance_id, - collection_output_id - from simple_output where "; - my $condition; - $siid && ($condition = " service_instance_id = ? and collection_output_id IS NULL"); - $collid && ($condition = " collection_output_id = ?"); - $statement .= $condition; - - - my $result = do_query($dbh, $statement, ($id_to_use)); - return $result; -} - -# pass args service_instance_id and collection_output_id -sub insert_simple_output { - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - - $dbh->do("insert into simple_output - (object_type_uri, - namespace_type_uris, - article_name, - service_instance_id, - collection_output_id) - values (?,?,?,?,?)", - undef,( - $args{'object_type_uri'}, - $args{'namespace_type_uris'}, - $args{'article_name'}, - $siid, - $args{'collection_output_id'})); - my $id=$dbh->{mysql_insertid}; - return $id; - -} - -# pass service_instance_id or collection_output_id -sub delete_simple_output{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my ($collid) = $args{collection_output_id}; - my $statement1; my $statement2; - $siid && ($statement1 = "delete from simple_output where service_instance_id = ?"); - $collid && ($statement2 = "delete from simple_output where collection_output_id = ?"); - - $siid && ($dbh->do( $statement1, undef,($siid))); - $collid && ($dbh->do($statement2, undef,($collid))); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -# pass service_instance_lsid -sub query_secondary_input{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - - my $statement = "select - secondary_input_id, - default_value, - maximum_value, - minimum_value, - enum_value, - datatype, - article_name, - service_instance_id - from secondary_input where service_instance_id = ?"; - my $result = do_query($dbh, $statement, ($siid)); - return $result; -} - -# pass default_value, maximum_value minimum_value enum_value datatype article_name service_instance_lsid -sub insert_secondary_input{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - $dbh->do(q{insert into secondary_input (default_value,maximum_value,minimum_value,enum_value,datatype,article_name,service_instance_id) values (?,?,?,?,?,?,?)}, - undef, - ( - $args{'default_value'}, $args{'maximum_value'}, - $args{'minimum_value'}, $args{'enum_value'}, - $args{'datatype'}, $args{'article_name'},$siid) - ); - return $dbh->{mysql_insertid}; -} - -# pass service_instance_lsid -sub delete_secondary_input{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - my $statement = "delete from secondary_input where service_instance_id=?"; - - $dbh->do( $statement, undef, ($siid)); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - - -# receives argument "type", that may be either an LSID or a type term -sub query_object { - my ($self, %args) = @_; - my $type = $args{type}; - my $condition = ""; - if ($type =~ /^urn\:lsid/){ - $condition = "where object_lsid = ?"; - } elsif ($type) { - $condition = "where object_type = ?"; - } - my $statement = "select - object_id, - object_lsid, - object_type, - description, - authority, - contact_email - from object $condition"; - - my $dbh = _getDBHandle("mobyobject"); - my $result; - if ($type){ - $result = do_query($dbh, $statement, ($type)); - } else { - $result = do_query($dbh, $statement); - } - return $result; -} - -# inserts a new tuple into object table -# pass object_type object_lsid description authority contact_email -sub insert_object{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - $dbh->do("insert into object - (object_type, - object_lsid, - description, - authority, - contact_email) - values (?,?,?,?,?)", - undef, - $args{'object_type'}, - $args{'object_lsid'}, - $args{'description'}, - $args{'authority'}, - $args{'contact_email'}); - my $id=$dbh->{mysql_insertid}; - return $id; -} - -# pass 'type' which is either an LSID or a term -sub delete_object{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $term = $args{type}; - return 0 unless $term; - my $result = $self->query_object(type => $term); - my $row = shift(@$result); - my $id = $row->{object_id}; - my $lsid = $row->{object_lsid}; - my $statement = "delete from object where object_lsid = ?"; - $dbh->do( $statement,undef, ($lsid) ); - - $self->_delete_object_term2term(id => $id); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -# pass "type" here, should be an LSID, preferably... -sub query_object_term2term{ - my ($self, %args) = @_; - my $type = $args{type}; - my $result = $self->query_object(type => $type); - my $row = shift(@$result); - my $id = $row->{object_id}; - return [{}] unless $id; - my $dbh = $self->dbh; - - my $statement = "select - assertion_id, - relationship_type, - object1_id, - object2_id, - object2_articlename - from object_term2term where object2_id = ?"; - my $result2 = do_query($dbh, $statement, ($id)); - return $result2; -} - -# pass object1_type, object2_type, object2_articlename, relationship_type -sub insert_object_term2term{ - my ($self, %args) = @_; - my $type1 = $args{object1_type}; - my $result = $self->query_object(type => $type1); - my $row = shift(@$result); - my $id1 = $row->{object_id}; - my $type2 = $args{object2_type}; - $result = $self->query_object(type => $type2); - $row = shift(@$result); - my $id2 = $row->{object_id}; - my $relationship_type = $args{relationship_type}; - my $object2_articlename = $args{object2_articlename}; - - my $dbh = $self->dbh; - $dbh->do( - q{insert into object_term2term (relationship_type, object1_id, object2_id, object2_articlename) values (?,?,?,?)}, - undef, - $relationship_type, - $id1, - $id2, - $object2_articlename - ); - - return $dbh->{mysql_insertid}; -} - -# pass object 'type' as term or lsid -# this should be a private routine, not a public one. -# SHOULD NOT BE DOCUMENTED IN THE API -sub _delete_object_term2term{ - my ($self, %args) = @_; - my $o1id = $args{id}; - return 0 unless defined($o1id); - my $dbh = $self->dbh; - my $statement = "delete from object_term2term where object1_id=?"; - $dbh->do( $statement,undef, ($o1id)); - - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -# pass servicename and authority_uri -sub query_service_existence { - my ($self, %args) = @_; - my $dbh = $self->dbh; - - my $servicename = $args{'servicename'}; - my $authURI = $args{'authority_uri'}; - my $result = $self->_query_authority(authority_uri => $authURI); - return 0 unless @$result[0]; - my $id = @$result[0]->{authority_id}; - return 0 unless $id; - my $statement = "select - service_instance_id, - category, - servicename, - service_type_uri, - authority_id, - url, - contact_email, - authoritative, - description, - signatureURL, - lsid - from service_instance where servicename = ? and authority_id = ?"; - my $final = do_query($dbh, $statement, ($servicename, $id)); - if (@$final[0]){return 1} else {return 0} - -} -# selects all the columns from service_instance table -# PAY ATTENTION to what this returns. Not auth_id but auth_uri!! -# IMPORTANT: must use quotes for the keys of the hash (eg. 'authority.authority_uri' => $value ) -sub query_service_instance { - my ($self, %args) = @_; - my $dbh = $self->dbh; - - my @args; - while (my ($k, $v) = each %args){ - push @args, ({$k => $v}, "and"); # format for the_add_condition subroutine - # but too bad won't be scalable for "or" - } - - if (keys(%args)){ pop @args;} # remove final "and" - - my $statement = "select - service_instance_id, - category, - servicename, - service_type_uri, - authority.authority_uri, - url, - service_instance.contact_email, - authoritative, - description, - signatureURL, - lsid - from service_instance, authority "; - my @bindvalues; - ($statement, @bindvalues) =_add_condition($statement, @args); - if (keys(%args)){ - $statement .= " and authority.authority_id = service_instance.authority_id"; - } else { - $statement .= " where authority.authority_id = service_instance.authority_id"; - } - my $final = do_query($dbh, $statement, @bindvalues); - return $final; -} - -# custom query for Moby::Central.pm->findService() -# hmmmmmmm.... I'm not sure that this routine should exist... -# it is redundant to the routine above, if the routine above were executed -# multiple times. I think that is the more correct (though less efficient) -# way to go, since it is "scalable" to every possible underlying data source -# ********FIX change this later... -sub match_service_type_uri{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $uri_list = $args{'service_type_uri'}; - my $statement = "select service_instance_id,category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid from service_instance where service_type_uri in ($uri_list)"; - my @bindvalues = (); - my $result = do_query($dbh, $statement, @bindvalues); - return $result; -} - -# passs........ blah blah..... -sub insert_service_instance { - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $authority_id; - if ($args{'authority_uri'}){ # need to transform URI to a row ID - my $result = $self->_query_authority(authority_uri => $args{'authority_uri'}); - return undef unless @$result[0]; - $authority_id = @$result[0]->{authority_id}; - return undef unless $authority_id; - } - - $dbh->do(q{insert into service_instance (category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid) values (?,?,?,?,?,?,?,?,?,?)}, - undef,( - $args{'category'}, - $args{'servicename'}, - $args{'service_type_uri'}, - $authority_id, - $args{'url'}, - $args{'contact_email'}, - $args{'authoritative'}, - $args{'description'}, - $args{'signatureURL'}, - $args{'lsid'})); - - my $id = $dbh->{mysql_insertid}; - return $id; -} - -# pass service_instance_lsid -sub delete_service_instance{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $statement = "delete from service_instance where lsid = ?"; - $dbh->do( $statement,undef, ($args{service_instance_lsid}) ); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -# Selects all columns EXCEPT authority_id -# pass authority_uri -sub query_authority { - my ($self, %args) = @_; - my $authURI = $args{authority_uri}; - my $dbh = $self->dbh; - - my $statement = "select - authority_common_name, - authority_uri, - contact_email - from authority where authority_uri = ?"; - my $result = do_query($dbh, $statement, ($authURI)); - return $result; -} - -# Selects all columns including authority_id -# pass authority_uri. NOTE THAT THIS IS A PRIVATE ROUTINE -# SHOULD NOT BE DOCUMENTED IN THE API -sub _query_authority { - my ($self, %args) = @_; - my $authURI = $args{authority_uri}; - my $dbh = $self->dbh; - - my $statement = "select - authority_common_name, - authority_uri, - authority_id, - contact_email - from authority where authority_uri = ?"; - my $result = do_query($dbh, $statement, ($authURI)); - return $result; -} - -# custom query routine used in Moby::Central.pm -> retrieveServiceProviders() -# no args passed -sub get_all_authorities{ - my ($self, @args) = @_; - my $dbh = $self->dbh; - my $statement = "select distinct authority_uri from authority"; - my @bindvalues = (); - my $result = do_query($dbh, $statement, @bindvalues); - return $result; -} - -# pass authority_common_name, authority_uri, contact_email, return ID of some sort -sub insert_authority{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - $dbh->do("insert into authority - (authority_common_name, - authority_uri, - contact_email) - values (?,?,?)", - undef, - ($args{'authority_common_name'}, - $args{'authority_uri'}, - $args{'contact_email'})); - my $id = $dbh->{mysql_insertid}; - return $id; -} - -# pass service_type, as term or LSID -sub query_service{ - my ($self, %args) = @_; - my $type = $args{type}; - my $condition = ""; - if ($type =~ /^urn\:lsid/){ - $condition = "where service_lsid = ?"; - } elsif ($type) { - $condition = "where service_type = ?"; - } else { - $condition = ""; - } - - my $dbh = _getDBHandle("mobyservice"); - - my $statement = "select - service_id, - service_lsid, - service_type, - description, - authority, - contact_email - from service $condition"; - my $result; - if ($type){ - $result = do_query($dbh, $statement, ($type)); - } else { - $result = do_query($dbh, $statement); - } - return $result; -} - -# pass in .... -sub insert_service{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - $dbh->do(q{insert into service (service_type, service_lsid, description, authority, contact_email) values (?,?,?,?,?)}, - undef, - ( - $args{'service_type'}, $args{'service_lsid'}, $args{'description'}, - $args{'authority'}, $args{'contact_email'} - ) - ); - return $dbh->{mysql_insertid}; -} - -# pass in 'type' as a term or lsid -sub delete_service{ - my ($self, %args) = @_; - my $type = $args{type}; - my $result = $self->query_service(type => $type); - my $row = shift(@$result); - my $id = $row->{service_id}; - my $lsid = $row->{service_lsid}; - return 0 unless $lsid; - my $dbh = $self->dbh; - my $statement = "delete from service where service_lsid = ?"; - $dbh->do( $statement, undef, ($lsid)); - $self->_delete_service_term2term(id => $id); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -sub query_service_term2term{ - my ($self, %args) = @_; - my $type = $args{type}; - my $result = $self->query_service(type => $type); - my $row = shift(@$result); - my $id = $row->{service_id}; - return [{}] unless $id; - my $dbh = $self->dbh; - - my $statement = "select - assertion_id, - relationship_type, - service1_id, - service2_id - from service_term2term where service2_id = ?"; - my $result2 = do_query($dbh, $statement, ($id)); - return $result2; -} - -#pass relationshiptype, servce1_type, service2_type -sub insert_service_term2term{ - my ($self, %args) = @_; - my $type1 = $args{service1_type}; - my $result = $self->query_service(type => $type1); - my $row = shift(@$result); - my $id1 = $row->{service_id}; - my $type2 = $args{service2_type}; - $result = $self->query_service(type => $type2); - $row = shift(@$result); - my $id2 = $row->{service_id}; - my $relationship_type = $args{relationship_type}; - - my $dbh = $self->dbh; - $dbh->do(q{insert into service_term2term (relationship_type, service1_id, service2_id) values (?,?,?)}, - undef, - ($relationship_type, - $id1, - $id2) - ); - - return $dbh->{mysql_insertid}; -} - - -# NOTE THAT THIS IS A PRIVATE FUNCTION AND SHOULD -# NOT BE DOCUMENTED IN THE API. -sub _delete_service_term2term{ - my ($self, %args) = @_; - my $id = $args{id}; - return 0 unless (defined($id)); - my $dbh = $self->dbh; - my $statement = "delete from service_term2term where service1_id=?"; - $dbh->do( $statement,undef, ($id)); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - - -sub query_relationship{ - my ($self, %args) = @_; - my $type = $args{type} || ""; -# return [{}] unless $type; - my $condition = ""; - if ($type =~ /^urn\:lsid/){ - $condition = " relationship_lsid = ? and "; - } elsif ($type) { - $condition = " relationship_type = ? and "; - } - my $ont = $args{ontology}; - - my $dbh = $self->dbh; - - my $statement = "select - relationship_id, - relationship_lsid, - relationship_type, - container, - description, - authority, - contact_email, - ontology - from relationship where $condition ontology = ?"; - - if ($type){ - return do_query($dbh, $statement, ($type, $ont)); - } else { - return do_query($dbh, $statement, ($ont)); - } -} - -sub query_namespace{ - my ($self, %args) = @_; - my $type = $args{type}; - my $condition = ""; - if ($type =~ /^urn\:lsid/){ - $condition = " where namespace_lsid = ?"; - } elsif ($type) { - $condition = " where namespace_type = ?"; - } else { - $condition = ""; - } - - my $dbh = _getDBHandle("mobynamespace"); - - my $statement = "select - namespace_id, - namespace_lsid, - namespace_type, - description, - authority, - contact_email - from namespace $condition"; - my $result; - if ($type){ - $result = do_query($dbh, $statement, ($type)); - } else { - $result = do_query($dbh, $statement); - } - return $result; -} - - -sub insert_namespace{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - $dbh->do(q{insert into namespace (namespace_type, namespace_lsid, description, authority,contact_email) values (?,?,?,?,?)}, - undef, - ( - $args{'namespace_type'}, $args{'namespace_lsid'},$args{'description'},$args{'authority'},$args{'contact_email'} - ) - ); - return $dbh->{mysql_insertid}; -} - -# pass namesapce_lsid -sub delete_namespace{ - my ($self, %args) = @_; - my $type = $args{type}; - my $result = $self->query_namespace(type => $type); - my $row = shift(@$result); - my $id = $row->{namespace_id}; - my $lsid = $row->{namespace_lsid}; - return 0 unless $lsid; - my $dbh = $self->dbh; - my $statement = "delete from namespace where namespace_lsid = ?"; - $dbh->do( $statement, undef, ($lsid)); - $self->_delete_namespace_term2term(id => $id); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -sub query_namespace_term2term{ - my ($self, %args) = @_; - my $type = $args{type}; - my $result = $self->query_namespace(type => $type); - my $row = shift(@$result); - my $id = $row->{namespace_id}; - return [{}] unless $id; - my $dbh = $self->dbh; - - my $statement = "select - assertion_id, - relationship_type, - namespace1_id, - namespace2_id - from namespace_term2term where namespace2_id = ?"; - my $result2 = do_query($dbh, $statement, ($id)); - return $result2; -} - -# PRIVATE, NOT PART OF API! -sub _delete_namespace_term2term{ - my ($self, %args) = @_; - my $id = $args{id}; - return 0 unless defined($id); - my $dbh = $self->dbh; - my $statement = "delete from namespace_term2term where namespace1_id=?"; - $dbh->do( $statement,undef, ($id)); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} -# pass type as LSID or term -sub check_object_usage{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $errorMsg = 1; - my $type = $args{type}; - return 0 unless $type; - my $result = $self->query_object(type => $type); - my $row = shift @$result; - my $lsid = $row->{object_lsid}; - - my ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join simple_input where object_type_uri = ?}, - undef, $lsid - ); - return $errorMsg - if ($id); - - ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join simple_output where object_type_uri = ?}, - undef, $lsid - ); - return $errorMsg - if ($id); - - ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join collection_input natural join simple_input where object_type_uri = ?}, - undef, $lsid - ); - return $errorMsg - if ($id); - - ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join collection_output natural join simple_output where object_type_uri = ?}, - undef, $lsid - ); - return $errorMsg - if ($id); - - return 0; -} - -# custom query routine for Moby::Central.pm -> deregisterNamespace() -sub check_namespace_usage{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $errorMsg = 1; - my $type = $args{type}; - return 0 unless $type; - my $result = $self->query_namespace(type => $type); - my $row = shift @$result; - my $lsid = $row->{namespace_lsid}; - - my $sth = $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join simple_input where INSTR(namespace_type_uris,'$lsid')" - ); - $sth->execute; - - while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { - my @nss = split ",", $ns; - foreach (@nss) { - $_ =~ s/\s//g; - my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; - return (1, $errstr) - if ( $_ eq $lsid ); - } - } - $sth = $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join simple_output where INSTR(namespace_type_uris,'$lsid')" - ); - $sth->execute; - while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { - my @nss = split ",", $ns; - foreach (@nss) { - $_ =~ s/\s//g; - my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; - return (1, $errstr) - if ( $_ eq $lsid ); - } - } - $sth = - $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join collection_input natural join simple_input where INSTR(namespace_type_uris, '$lsid')" - ); - $sth->execute; - while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { - my @nss = split ",", $ns; - foreach (@nss) { - $_ =~ s/\s//g; - my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; - return (1, $errstr) - if ( $_ eq $lsid ); - } - } - $sth = - $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join collection_output natural join simple_output where INSTR(namespace_type_uris, '$lsid')" - ); - $sth->execute; - while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { - my @nss = split ",", $ns; - foreach (@nss) { - $_ =~ s/\s//g; - my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; - return (1, $errstr) - if ( $_ eq $lsid ); - } - } - return (0, ""); -} - -# custom query routine for Moby::Central.pm -> findService() -sub check_keywords{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $param = $args{keywords}; - return ([{}]) unless (ref($param) =~ /ARRAY/); - my @keywords = @$param; - my %findme = %$param; - my $searchstring; - foreach my $kw ( @keywords ) { - $kw =~ s/\*//g; - $kw = $dbh->quote("%$kw%"); - $searchstring .= " OR description like $kw "; - } - $searchstring =~ s/OR//; # remove just the first OR in the longer statement - - my $statement = "select service_instance_id,category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid from service_instance where $searchstring"; - my @bindvalues = (); - - my $ids = do_query($dbh, $statement, @bindvalues); - return ($ids); -} - -# custom query subroutine for Moby::Central.pm->_searchForSimple() -sub find_by_simple{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $inout = $args{'inout'}; - my $ancestor_string = $args{'ancestor_string'}; - my $namespaceURIs = $args{'namespaceURIs'}; - - my $query ="select service_instance_id, namespace_type_uris from simple_$inout where object_type_uri in ($ancestor_string) and service_instance_id IS NOT NULL " - ; # if service_instance_id is null then it must be a collection input. - my $nsquery; - foreach my $ns ( @{$namespaceURIs} ) { # namespaces are already URI's - $nsquery .= " OR INSTR(namespace_type_uris, '$ns') "; - } - if ($nsquery) { - $nsquery =~ s/OR//; # just the first - $nsquery .= " OR namespace_type_uris IS NULL"; - $query .= " AND ($nsquery) "; - } - - my $result = do_query($dbh, $query, ()); - return $result; -} - -# custom query subroutine for Moby::Central.pm->_searchForCollection() -sub find_by_collection{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $inout = $args{'inout'}; - my $objectURI = $args{'objectURI'}; - my $namespaceURIs = $args{'namespaceURIs'}; - - my $query = "select - c.service_instance_id, - s.namespace_type_uris - from - simple_$inout as s, - collection_$inout as c - where - s.collection_${inout}_id IS NOT NULL - AND s.collection_${inout}_id = c.collection_${inout}_id - AND object_type_uri = '$objectURI' "; - my $nsquery; - foreach my $ns ( @{$namespaceURIs} ) { # namespaces are already URI's - $nsquery .= " OR INSTR(namespace_type_uris, '$ns') "; - } - if ($nsquery) { - $nsquery =~ s/^\sOR//; # just the first - $nsquery .= " OR namespace_type_uris IS NULL"; - $query .= " AND ($nsquery) "; # add the AND clause - } - - my $result = do_query($dbh, $query, ()); - return $result; -} - -# custom query subroutine for Moby::Central.pm->RetrieveServiceNames -sub get_service_names{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $statement = "select authority_uri, servicename from authority as a, service_instance as s where s.authority_id = a.authority_id"; - my @bindvalues = (); - - my $result = do_query($dbh, $statement, @bindvalues); - return $result; -} - -# custom query for Moby::Central.pm->_flatten -sub get_parent_terms{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - - my $type_id = $args{'relationship_type_id'}; - my $statement = " - select - OE1.term - from - OntologyEntry as OE1, - OntologyEntry as OE2, - Term2Term as TT - where - ontologyentry2_id = OE2.id - and ontologyentry1_id = OE1.id - and relationship_type_id = $type_id - and OE2.term = ?"; - - my @bindvalues = (); - push(@bindvalues, $args{'term'}); - - my $result = do_query($dbh, $statement, @bindvalues); - return $result; -} - -# custom query subroutine for selecting from object_term2term and object tables -# used in Moby::OntologyServer.pm->retrieveObject() -sub get_object_relationships{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $type = $args{type}; - return 0 unless $type; - my $result = $self->query_object(type => $type); - my $row = shift @$result; - my $id = $row->{object_id}; - - my $statement = "select - relationship_type, - object_type, - object_lsid, - description, - authority, - contact_email, - object2_articlename - from object_term2term, object - where object1_id = ? and object2_id = object_id"; - - my $result2 = do_query($dbh, $statement, ($id)); - return $result2; -} - -# relationship query for any table used in Moby::OntologyServer->_doRelationshipQuery() -# note: returns a reference to an array containing ARRAY references -sub get_relationship{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $direction = $args{'direction'}; - my $ontology = $args{'ontology'}; - my $relationship = $args{'relationship'}; # this is assumed to be an LSID - - my $type = $args{'term'}; - return 0 unless $type; - my $lsid; - if ($ontology eq "service"){ - my $result = $self->query_service(type => $type); - my $row = shift @$result; - $lsid = $row->{service_lsid}; - } else { - my $result = $self->query_object(type => $type); - my $row = shift @$result; - $lsid = $row->{object_lsid}; - } - my $defs; - my $extra_columns; - $extra_columns = ", relationship_type "; - if ($ontology eq "object"){$extra_columns .=", object2_articlename ";} - if ( $direction eq 'root' ) { - unless ( defined $relationship ) { - $defs = $self->dbh->selectall_arrayref( " - select distinct s2.${ontology}_lsid $extra_columns from - ${ontology}_term2term as t2t, - $ontology as s1, - $ontology as s2 - where - s1.${ontology}_id = t2t.${ontology}1_id and - s2.${ontology}_id = t2t.${ontology}2_id and - s1.${ontology}_lsid = ?", undef, $lsid ); # ") - } else { - $defs = $self->dbh->selectall_arrayref( " - select distinct s2.${ontology}_lsid $extra_columns from - ${ontology}_term2term as t2t, - $ontology as s1, - $ontology as s2 - where - relationship_type = ? and - s1.${ontology}_id = t2t.${ontology}1_id and - s2.${ontology}_id = t2t.${ontology}2_id and - s1.${ontology}_lsid = ?", undef, $relationship, $lsid ); # ") - } - } else { - unless ( defined $relationship ) { - $defs = $self->dbh->selectall_arrayref( " - select distinct s2.${ontology}_lsid $extra_columns from - ${ontology}_term2term as t2t, - $ontology as s1, - $ontology as s2 - where - s1.${ontology}_id = t2t.${ontology}1_id and - s2.${ontology}_id = t2t.${ontology}2_id and - s2.${ontology}_lsid = ?", undef, $lsid); # ") - } else { - $defs = $self->dbh->selectall_arrayref( " - select distinct s2.${ontology}_lsid $extra_columns from - ${ontology}_term2term as t2t, - $ontology as s1, - $ontology as s2 - where - relationship_type = ? and - s1.${ontology}_id = t2t.${ontology}1_id and - s2.${ontology}_id = t2t.${ontology}2_id and - s2.${ontology}_lsid = ?", undef, $relationship, $lsid ); # ") - } - } - return $defs; -} - -sub _checkURI { - -# my $uri = "http://www.ics.uci.edu/pub/ietf/uri/#Related"; -#print "$1, $2, $3, $4, $5, $6, $7, $8, $9" if -# $uri =~ m{^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?}; -# -#The license for this recipe is available here. -# -#Discussion: -# -#If the match is successful, a URL such as -# -#http://www.ics.uci.edu/pub/ietf/uri/#Related -# -#will be broken down into the following group match variables: -# -#$1 = http: -#$2 = http -#$3 = //www.ics.uci.edu -#$4 = www.ics.uci.edu -#$5 = /pub/ietf/uri/ -#$6 = -#$7 = -#$8 = #Related -#$9 = Related -# -#In general, this regular expression breaks a URI down into the following parts, -#as defined in the RFC: -# -#scheme = $2 -#authority = $4 -#path = $5 -#query = $7 -#fragment = $9 - -} - -sub DESTROY {} - -1; +package MOBY::Adaptor::moby::queryapi::mysql; + +use strict; +use vars qw($AUTOLOAD @ISA); +use Carp; +use MOBY::Adaptor::moby::queryapi; +use DBI; +use DBD::mysql; + + at ISA = qw{MOBY::Adaptor::moby::queryapi}; # implements the interface + +{ + #Encapsulated class data + + #___________________________________________________________ + #ATTRIBUTES + my %_attr_data = # DEFAULT ACCESSIBILITY + ( + driver => ["DBI:mysql", 'read/write'], + dbh => [undef, 'read/write'], + + ); + + #_____________________________________________________________ + + # METHODS, to operate on encapsulated class data + + # Is a specified object attribute accessible in a given mode + sub _accessible { + my ($self, $attr, $mode) = @_; + $_attr_data{$attr}[1] =~ /$mode/ + } + + # Classwide default value for a specified object attribute + sub _default_for { + my ($self, $attr) = @_; + $_attr_data{$attr}[0]; + } + + # List of names of all specified object attributes + sub _standard_keys { + keys %_attr_data; + } + + sub driver { + my ($self, $arg) = @_; + $self->{driver} = $arg if defined $arg; + return $self->{driver}; + } + sub dbh { + my ($self, $arg) = @_; + $self->{dbh} = $arg if defined $arg; + return $self->{dbh}; + } + +} + +sub _getDBHandle { + my ($ontology) = @_; + my $CONF = MOBY::Config->new; + my $adap = $CONF->getDataAdaptor(source => $ontology); + return $adap->dbh; +} + +sub new { + my ($caller, %args) = @_; + my $self = $caller->SUPER::new(%args); + + my $caller_is_obj = ref($caller); + my $class = $caller_is_obj || $caller; + + foreach my $attrname ( $self->_standard_keys ) { + if (exists $args{$attrname} && defined $args{$attrname}) { + $self->{$attrname} = $args{$attrname} } + elsif ($caller_is_obj) { + $self->{$attrname} = $caller->{$attrname} } + else { + $self->{$attrname} = $self->_default_for($attrname) } + } + + return unless $self->driver; + my $driver = $self->driver; # inherited from the adaptorI (queryapi) + my $username = $self->username; + my $password = $self->password; + my $port = $self->port; + my $url = $self->url; + my $dbname = $self->dbname; + + my ($dsn) = "$driver:$dbname:$url:$port"; + my $dbh = DBI->connect($dsn, $username, $password, {RaiseError => 1}) or die "can't connect to database"; + + + ############################################################## + unless ($dbh) { + print STDERR "Couldn't connect to the datasource \n",($self->_dump()),"\n\n"; + return undef; + } + + $self->dbh($dbh); + ############################################################# + + return undef unless $self->dbh; + return $self; + +} + +sub _add_condition{ + my ($statement, @params) = @_; + my @bindvalues = (); + my $condition = "where "; + + foreach my $param (@params ) + { + if (($param eq 'and') || ($param eq 'or')) + { + $condition .= $param . " "; + } + else + { + my %pair = %$param; + + for my $key (keys %pair) + { + if (defined $pair{$key}) + { + $condition .= $key . " = ? "; + push(@bindvalues, $pair{$key}); + } + else + { + $condition .= $key . " IS NULL " + } + } + } + } + $statement .= $condition; + return ($statement, @bindvalues); + } + +# preforms query but returns a reference to an array containing hash references +sub do_query{ + my ($dbh, $statement, @bindvalues) = @_; + my $sth = $dbh -> prepare($statement); + if (@bindvalues < 1) + { + $sth->execute; + } + else + { + $sth->execute(@bindvalues); + } + # returns an array of hash references + my $arrayHashRef = $sth->fetchall_arrayref({}); + return $arrayHashRef; +} + +sub get_value{ + my ($key, @params) = @_; + + foreach my $param (@params ) + { + my %pair = %$param; + for my $tmp (keys %pair) + { + if ($tmp eq $key){ + return $pair{$key}; + } + } + } +} + +sub _getSIIDFromLSID { + my ($self, $lsid) = @_; + my $dbh = $self->dbh; + my $sth = $dbh->prepare("select service_instance_id from service_instance where lsid = ?"); + $sth->execute($lsid); + my ($siid) = $sth->fetchrow_array(); + return $siid; +} + +# this should NOT retun a collection ID... needs more work... +# args passed in: service_lsid +sub query_collection_input{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $serv_lsid = $args{'service_instance_lsid'}; + + my $statement = "select + collection_input_id, + article_name + from collection_input as c, service_instance as si where si.service_instance_id = c.service_instance_id and si.lsid = ?"; + my $result = do_query($dbh, $statement, ($serv_lsid)); + return $result; +} + +# args passed in: service_instance_lsid, article_name +sub insert_collection_input { + my ($self, %args) = @_; + my $article = $args{article_name}; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + + $self->dbh->do("insert into collection_input (service_instance_id, article_name) values (?,?)", + undef, $siid, $article); + my $id=$self->dbh->{mysql_insertid}; + return $id; +} + +# pass in service_instance_lsid +sub delete_collection_input{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + + my $statement = "delete from collection_input where service_instance_id = ?"; + $self->dbh->do( $statement, undef, $siid); + + if ($self->dbh->err){ + return (1, $self->dbh->errstr); + } + else{ + return 0; + } +} + +# pass service_instance_lsid +sub query_collection_output{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + + my $statement = "select + collection_output_id, + article_name, + service_instance_id + from collection_output where service_instance_id = ? "; + my $result = do_query($dbh, $statement, ($siid)); + return $result; +} + +# pass service_instance_lsid, article_name +sub insert_collection_output { + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + $self->dbh->do("insert into collection_output (service_instance_id, article_name) values (?,?)", + undef, $siid,$args{'article_name'}); + my $id=$self->dbh->{mysql_insertid}; + return $id; +} + +# pass argument service_instance_lsid +sub delete_collection_output{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + my $statement = "delete from collection_output where service_instance_id = ?"; + my @bindvalues = (); + $dbh->do( $statement, undef, ($siid)); + + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +# pass service_instance_lsid +sub query_simple_input{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $collid = $args{collection_input_id}; + my $id_to_use = $siid?$siid:$collid; + + my $dbh = $self->dbh; + + my $statement = "select + simple_input_id, + object_type_uri, + namespace_type_uris, + article_name, + service_instance_id, + collection_input_id + from simple_input where "; + + my $condition; + $siid && ($condition = " service_instance_id = ? and collection_input_id IS NULL"); + $collid && ($condition = " collection_input_id = ?"); + $statement .= $condition; + + my $result = do_query($dbh, $statement, ($id_to_use)); + return $result; +} + +# pass service_instance_lsid, object_type_uri, namespace_type_uris, article_name, collection_input_id +sub insert_simple_input { + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + $dbh->do("insert into simple_input + (object_type_uri, + namespace_type_uris, + article_name, + service_instance_id, + collection_input_id) + values (?,?,?,?,?)", + undef, + $args{'object_type_uri'}, + $args{'namespace_type_uris'}, + $args{'article_name'}, + $siid, + $args{'collection_input_id'}); + my $id=$dbh->{mysql_insertid}; + return $id; +} + +# pass service_instance_lsid +sub delete_simple_input{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my ($collid) = $args{collection_input_id}; + my $statement1; my $statement2; + $siid && ($statement1 = "delete from simple_input where service_instance_id = ?"); + $collid && ($statement2 = "delete from simple_input where collection_input_id = ?"); + + $siid && ($dbh->do( $statement1, undef,($siid))); + $collid && ($dbh->do($statement2, undef,($collid))); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +sub delete_inputs { # this should replace all other delete_*_input + my ($self, %args) = @_; + my $dbh = $self->dbh; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $result_ids = $self->query_collection_input(service_instance_lsid => $self->lsid); + + my $statement = "delete from simple_input where service_instance_id = ?"; + + $dbh->do( $statement, undef,($siid)); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } + +} + +sub delete_output { # this should replace all other delete_*_output + +} + +# UGH this has to know too much bout the underlying database structure e.g. that one is null and other is full +# this problem is in MOBY::Central line 3321 3346 and 3374 +#****** FIX +# send service_instance_lsid, collection_input_id +sub query_simple_output{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $collid = $args{collection_output_id}; + my $dbh = $self->dbh; + my $id_to_use = $siid?$siid:$collid; + + my $statement = "select + simple_output_id, + object_type_uri, + namespace_type_uris, + article_name, + service_instance_id, + collection_output_id + from simple_output where "; + my $condition; + $siid && ($condition = " service_instance_id = ? and collection_output_id IS NULL"); + $collid && ($condition = " collection_output_id = ?"); + $statement .= $condition; + + + my $result = do_query($dbh, $statement, ($id_to_use)); + return $result; +} + +# pass args service_instance_id and collection_output_id +sub insert_simple_output { + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + + $dbh->do("insert into simple_output + (object_type_uri, + namespace_type_uris, + article_name, + service_instance_id, + collection_output_id) + values (?,?,?,?,?)", + undef,( + $args{'object_type_uri'}, + $args{'namespace_type_uris'}, + $args{'article_name'}, + $siid, + $args{'collection_output_id'})); + my $id=$dbh->{mysql_insertid}; + return $id; + +} + +# pass service_instance_id or collection_output_id +sub delete_simple_output{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my ($collid) = $args{collection_output_id}; + my $statement1; my $statement2; + $siid && ($statement1 = "delete from simple_output where service_instance_id = ?"); + $collid && ($statement2 = "delete from simple_output where collection_output_id = ?"); + + $siid && ($dbh->do( $statement1, undef,($siid))); + $collid && ($dbh->do($statement2, undef,($collid))); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +# pass service_instance_lsid +sub query_secondary_input{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + + my $statement = "select + secondary_input_id, + default_value, + maximum_value, + minimum_value, + enum_value, + datatype, + article_name, + service_instance_id + from secondary_input where service_instance_id = ?"; + my $result = do_query($dbh, $statement, ($siid)); + return $result; +} + +# pass default_value, maximum_value minimum_value enum_value datatype article_name service_instance_lsid +sub insert_secondary_input{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + $dbh->do(q{insert into secondary_input (default_value,maximum_value,minimum_value,enum_value,datatype,article_name,service_instance_id) values (?,?,?,?,?,?,?)}, + undef, + ( + $args{'default_value'}, $args{'maximum_value'}, + $args{'minimum_value'}, $args{'enum_value'}, + $args{'datatype'}, $args{'article_name'},$siid) + ); + return $dbh->{mysql_insertid}; +} + +# pass service_instance_lsid +sub delete_secondary_input{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + my $statement = "delete from secondary_input where service_instance_id=?"; + + $dbh->do( $statement, undef, ($siid)); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + + +# receives argument "type", that may be either an LSID or a type term +sub query_object { + my ($self, %args) = @_; + my $type = $args{type}; + my $condition = ""; + if ($type =~ /^urn\:lsid/){ + $condition = "where object_lsid = ?"; + } elsif ($type) { + $condition = "where object_type = ?"; + } + my $statement = "select + object_id, + object_lsid, + object_type, + description, + authority, + contact_email + from object $condition"; + + my $dbh = _getDBHandle("mobyobject"); + my $result; + if ($type){ + $result = do_query($dbh, $statement, ($type)); + } else { + $result = do_query($dbh, $statement); + } + return $result; +} + +# inserts a new tuple into object table +# pass object_type object_lsid description authority contact_email +sub insert_object{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + $dbh->do("insert into object + (object_type, + object_lsid, + description, + authority, + contact_email) + values (?,?,?,?,?)", + undef, + $args{'object_type'}, + $args{'object_lsid'}, + $args{'description'}, + $args{'authority'}, + $args{'contact_email'}); + my $id=$dbh->{mysql_insertid}; + return $id; +} + +# pass 'type' which is either an LSID or a term +sub delete_object{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $term = $args{type}; + return 0 unless $term; + my $result = $self->query_object(type => $term); + my $row = shift(@$result); + my $id = $row->{object_id}; + my $lsid = $row->{object_lsid}; + my $statement = "delete from object where object_lsid = ?"; + $dbh->do( $statement,undef, ($lsid) ); + + $self->_delete_object_term2term(id => $id); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +# pass "type" here, should be an LSID, preferably... +sub query_object_term2term{ + my ($self, %args) = @_; + my $type = $args{type}; + my $result = $self->query_object(type => $type); + my $row = shift(@$result); + my $id = $row->{object_id}; + return [{}] unless $id; + my $dbh = $self->dbh; + + my $statement = "select + assertion_id, + relationship_type, + object1_id, + object2_id, + object2_articlename + from object_term2term where object2_id = ?"; + my $result2 = do_query($dbh, $statement, ($id)); + return $result2; +} + +# pass object1_type, object2_type, object2_articlename, relationship_type +sub insert_object_term2term{ + my ($self, %args) = @_; + my $type1 = $args{object1_type}; + my $result = $self->query_object(type => $type1); + my $row = shift(@$result); + my $id1 = $row->{object_id}; + my $type2 = $args{object2_type}; + $result = $self->query_object(type => $type2); + $row = shift(@$result); + my $id2 = $row->{object_id}; + my $relationship_type = $args{relationship_type}; + my $object2_articlename = $args{object2_articlename}; + + my $dbh = $self->dbh; + $dbh->do( + q{insert into object_term2term (relationship_type, object1_id, object2_id, object2_articlename) values (?,?,?,?)}, + undef, + $relationship_type, + $id1, + $id2, + $object2_articlename + ); + + return $dbh->{mysql_insertid}; +} + +# pass object 'type' as term or lsid +# this should be a private routine, not a public one. +# SHOULD NOT BE DOCUMENTED IN THE API +sub _delete_object_term2term{ + my ($self, %args) = @_; + my $o1id = $args{id}; + return 0 unless defined($o1id); + my $dbh = $self->dbh; + my $statement = "delete from object_term2term where object1_id=?"; + $dbh->do( $statement,undef, ($o1id)); + + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +# pass servicename and authority_uri +sub query_service_existence { + my ($self, %args) = @_; + my $dbh = $self->dbh; + + my $servicename = $args{'servicename'}; + my $authURI = $args{'authority_uri'}; + my $result = $self->_query_authority(authority_uri => $authURI); + return 0 unless @$result[0]; + my $id = @$result[0]->{authority_id}; + return 0 unless $id; + my $statement = "select + service_instance_id, + category, + servicename, + service_type_uri, + authority_id, + url, + contact_email, + authoritative, + description, + signatureURL, + lsid + from service_instance where servicename = ? and authority_id = ?"; + my $final = do_query($dbh, $statement, ($servicename, $id)); + if (@$final[0]){return 1} else {return 0} + +} +# selects all the columns from service_instance table +# PAY ATTENTION to what this returns. Not auth_id but auth_uri!! +# IMPORTANT: must use quotes for the keys of the hash (eg. 'authority.authority_uri' => $value ) +sub query_service_instance { + my ($self, %args) = @_; + my $dbh = $self->dbh; + + my @args; + while (my ($k, $v) = each %args){ + push @args, ({$k => $v}, "and"); # format for the_add_condition subroutine + # but too bad won't be scalable for "or" + } + + if (keys(%args)){ pop @args;} # remove final "and" + + my $statement = "select + service_instance_id, + category, + servicename, + service_type_uri, + authority.authority_uri, + url, + service_instance.contact_email, + authoritative, + description, + signatureURL, + lsid + from service_instance, authority "; + my @bindvalues; + ($statement, @bindvalues) =_add_condition($statement, @args); + if (keys(%args)){ + $statement .= " and authority.authority_id = service_instance.authority_id"; + } else { + $statement .= " where authority.authority_id = service_instance.authority_id"; + } + my $final = do_query($dbh, $statement, @bindvalues); + return $final; +} + +# custom query for Moby::Central.pm->findService() +# hmmmmmmm.... I'm not sure that this routine should exist... +# it is redundant to the routine above, if the routine above were executed +# multiple times. I think that is the more correct (though less efficient) +# way to go, since it is "scalable" to every possible underlying data source +# ********FIX change this later... +sub match_service_type_uri{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $uri_list = $args{'service_type_uri'}; + my $statement = "select service_instance_id,category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid from service_instance where service_type_uri in ($uri_list)"; + my @bindvalues = (); + my $result = do_query($dbh, $statement, @bindvalues); + return $result; +} + +# passs........ blah blah..... +sub insert_service_instance { + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $authority_id; + if ($args{'authority_uri'}){ # need to transform URI to a row ID + my $result = $self->_query_authority(authority_uri => $args{'authority_uri'}); + return undef unless @$result[0]; + $authority_id = @$result[0]->{authority_id}; + return undef unless $authority_id; + } + + $dbh->do(q{insert into service_instance (category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid) values (?,?,?,?,?,?,?,?,?,?)}, + undef,( + $args{'category'}, + $args{'servicename'}, + $args{'service_type_uri'}, + $authority_id, + $args{'url'}, + $args{'contact_email'}, + $args{'authoritative'}, + $args{'description'}, + $args{'signatureURL'}, + $args{'lsid'})); + + my $id = $dbh->{mysql_insertid}; + return $id; +} + +# pass service_instance_lsid +sub delete_service_instance{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $statement = "delete from service_instance where lsid = ?"; + $dbh->do( $statement,undef, ($args{service_instance_lsid}) ); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +# Selects all columns EXCEPT authority_id +# pass authority_uri +sub query_authority { + my ($self, %args) = @_; + my $authURI = $args{authority_uri}; + my $dbh = $self->dbh; + + my $statement = "select + authority_common_name, + authority_uri, + contact_email + from authority where authority_uri = ?"; + my $result = do_query($dbh, $statement, ($authURI)); + return $result; +} + +# Selects all columns including authority_id +# pass authority_uri. NOTE THAT THIS IS A PRIVATE ROUTINE +# SHOULD NOT BE DOCUMENTED IN THE API +sub _query_authority { + my ($self, %args) = @_; + my $authURI = $args{authority_uri}; + my $dbh = $self->dbh; + + my $statement = "select + authority_common_name, + authority_uri, + authority_id, + contact_email + from authority where authority_uri = ?"; + my $result = do_query($dbh, $statement, ($authURI)); + return $result; +} + +# custom query routine used in Moby::Central.pm -> retrieveServiceProviders() +# no args passed +sub get_all_authorities{ + my ($self, @args) = @_; + my $dbh = $self->dbh; + my $statement = "select distinct authority_uri from authority"; + my @bindvalues = (); + my $result = do_query($dbh, $statement, @bindvalues); + return $result; +} + +# pass authority_common_name, authority_uri, contact_email, return ID of some sort +sub insert_authority{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + $dbh->do("insert into authority + (authority_common_name, + authority_uri, + contact_email) + values (?,?,?)", + undef, + ($args{'authority_common_name'}, + $args{'authority_uri'}, + $args{'contact_email'})); + my $id = $dbh->{mysql_insertid}; + return $id; +} + +# pass service_type, as term or LSID +sub query_service{ + my ($self, %args) = @_; + my $type = $args{type}; + my $condition = ""; + if ($type =~ /^urn\:lsid/){ + $condition = "where service_lsid = ?"; + } elsif ($type) { + $condition = "where service_type = ?"; + } else { + $condition = ""; + } + + my $dbh = _getDBHandle("mobyservice"); + + my $statement = "select + service_id, + service_lsid, + service_type, + description, + authority, + contact_email + from service $condition"; + my $result; + if ($type){ + $result = do_query($dbh, $statement, ($type)); + } else { + $result = do_query($dbh, $statement); + } + return $result; +} + +# pass in .... +sub insert_service{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + $dbh->do(q{insert into service (service_type, service_lsid, description, authority, contact_email) values (?,?,?,?,?)}, + undef, + ( + $args{'service_type'}, $args{'service_lsid'}, $args{'description'}, + $args{'authority'}, $args{'contact_email'} + ) + ); + return $dbh->{mysql_insertid}; +} + +# pass in 'type' as a term or lsid +sub delete_service{ + my ($self, %args) = @_; + my $type = $args{type}; + my $result = $self->query_service(type => $type); + my $row = shift(@$result); + my $id = $row->{service_id}; + my $lsid = $row->{service_lsid}; + return 0 unless $lsid; + my $dbh = $self->dbh; + my $statement = "delete from service where service_lsid = ?"; + $dbh->do( $statement, undef, ($lsid)); + $self->_delete_service_term2term(id => $id); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +sub query_service_term2term{ + my ($self, %args) = @_; + my $type = $args{type}; + my $result = $self->query_service(type => $type); + my $row = shift(@$result); + my $id = $row->{service_id}; + return [{}] unless $id; + my $dbh = $self->dbh; + + my $statement = "select + assertion_id, + relationship_type, + service1_id, + service2_id + from service_term2term where service2_id = ?"; + my $result2 = do_query($dbh, $statement, ($id)); + return $result2; +} + +#pass relationshiptype, servce1_type, service2_type +sub insert_service_term2term{ + my ($self, %args) = @_; + my $type1 = $args{service1_type}; + my $result = $self->query_service(type => $type1); + my $row = shift(@$result); + my $id1 = $row->{service_id}; + my $type2 = $args{service2_type}; + $result = $self->query_service(type => $type2); + $row = shift(@$result); + my $id2 = $row->{service_id}; + my $relationship_type = $args{relationship_type}; + + my $dbh = $self->dbh; + $dbh->do(q{insert into service_term2term (relationship_type, service1_id, service2_id) values (?,?,?)}, + undef, + ($relationship_type, + $id1, + $id2) + ); + + return $dbh->{mysql_insertid}; +} + + +# NOTE THAT THIS IS A PRIVATE FUNCTION AND SHOULD +# NOT BE DOCUMENTED IN THE API. +sub _delete_service_term2term{ + my ($self, %args) = @_; + my $id = $args{id}; + return 0 unless (defined($id)); + my $dbh = $self->dbh; + my $statement = "delete from service_term2term where service1_id=?"; + $dbh->do( $statement,undef, ($id)); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + + +sub query_relationship{ + my ($self, %args) = @_; + my $type = $args{type} || ""; +# return [{}] unless $type; + my $condition = ""; + if ($type =~ /^urn\:lsid/){ + $condition = " relationship_lsid = ? and "; + } elsif ($type) { + $condition = " relationship_type = ? and "; + } + my $ont = $args{ontology}; + + my $dbh = $self->dbh; + + my $statement = "select + relationship_id, + relationship_lsid, + relationship_type, + container, + description, + authority, + contact_email, + ontology + from relationship where $condition ontology = ?"; + + if ($type){ + return do_query($dbh, $statement, ($type, $ont)); + } else { + return do_query($dbh, $statement, ($ont)); + } +} + +sub query_namespace{ + my ($self, %args) = @_; + my $type = $args{type}; + my $condition = ""; + if ($type =~ /^urn\:lsid/){ + $condition = " where namespace_lsid = ?"; + } elsif ($type) { + $condition = " where namespace_type = ?"; + } else { + $condition = ""; + } + + my $dbh = _getDBHandle("mobynamespace"); + + my $statement = "select + namespace_id, + namespace_lsid, + namespace_type, + description, + authority, + contact_email + from namespace $condition"; + my $result; + if ($type){ + $result = do_query($dbh, $statement, ($type)); + } else { + $result = do_query($dbh, $statement); + } + return $result; +} + + +sub insert_namespace{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + $dbh->do(q{insert into namespace (namespace_type, namespace_lsid, description, authority,contact_email) values (?,?,?,?,?)}, + undef, + ( + $args{'namespace_type'}, $args{'namespace_lsid'},$args{'description'},$args{'authority'},$args{'contact_email'} + ) + ); + return $dbh->{mysql_insertid}; +} + +# pass namesapce_lsid +sub delete_namespace{ + my ($self, %args) = @_; + my $type = $args{type}; + my $result = $self->query_namespace(type => $type); + my $row = shift(@$result); + my $id = $row->{namespace_id}; + my $lsid = $row->{namespace_lsid}; + return 0 unless $lsid; + my $dbh = $self->dbh; + my $statement = "delete from namespace where namespace_lsid = ?"; + $dbh->do( $statement, undef, ($lsid)); + $self->_delete_namespace_term2term(id => $id); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +sub query_namespace_term2term{ + my ($self, %args) = @_; + my $type = $args{type}; + my $result = $self->query_namespace(type => $type); + my $row = shift(@$result); + my $id = $row->{namespace_id}; + return [{}] unless $id; + my $dbh = $self->dbh; + + my $statement = "select + assertion_id, + relationship_type, + namespace1_id, + namespace2_id + from namespace_term2term where namespace2_id = ?"; + my $result2 = do_query($dbh, $statement, ($id)); + return $result2; +} + +# PRIVATE, NOT PART OF API! +sub _delete_namespace_term2term{ + my ($self, %args) = @_; + my $id = $args{id}; + return 0 unless defined($id); + my $dbh = $self->dbh; + my $statement = "delete from namespace_term2term where namespace1_id=?"; + $dbh->do( $statement,undef, ($id)); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} +# pass type as LSID or term +sub check_object_usage{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $errorMsg = 1; + my $type = $args{type}; + return 0 unless $type; + my $result = $self->query_object(type => $type); + my $row = shift @$result; + my $lsid = $row->{object_lsid}; + + my ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join simple_input where object_type_uri = ?}, + undef, $lsid + ); + return $errorMsg + if ($id); + + ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join simple_output where object_type_uri = ?}, + undef, $lsid + ); + return $errorMsg + if ($id); + + ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join collection_input natural join simple_input where object_type_uri = ?}, + undef, $lsid + ); + return $errorMsg + if ($id); + + ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join collection_output natural join simple_output where object_type_uri = ?}, + undef, $lsid + ); + return $errorMsg + if ($id); + + return 0; +} + +# custom query routine for Moby::Central.pm -> deregisterNamespace() +sub check_namespace_usage{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $errorMsg = 1; + my $type = $args{type}; + return 0 unless $type; + my $result = $self->query_namespace(type => $type); + my $row = shift @$result; + my $lsid = $row->{namespace_lsid}; + + my $sth = $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join simple_input where INSTR(namespace_type_uris,'$lsid')" + ); + $sth->execute; + + while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { + my @nss = split ",", $ns; + foreach (@nss) { + $_ =~ s/\s//g; + my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; + return (1, $errstr) + if ( $_ eq $lsid ); + } + } + $sth = $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join simple_output where INSTR(namespace_type_uris,'$lsid')" + ); + $sth->execute; + while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { + my @nss = split ",", $ns; + foreach (@nss) { + $_ =~ s/\s//g; + my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; + return (1, $errstr) + if ( $_ eq $lsid ); + } + } + $sth = + $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join collection_input natural join simple_input where INSTR(namespace_type_uris, '$lsid')" + ); + $sth->execute; + while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { + my @nss = split ",", $ns; + foreach (@nss) { + $_ =~ s/\s//g; + my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; + return (1, $errstr) + if ( $_ eq $lsid ); + } + } + $sth = + $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join collection_output natural join simple_output where INSTR(namespace_type_uris, '$lsid')" + ); + $sth->execute; + while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { + my @nss = split ",", $ns; + foreach (@nss) { + $_ =~ s/\s//g; + my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; + return (1, $errstr) + if ( $_ eq $lsid ); + } + } + return (0, ""); +} + +# custom query routine for Moby::Central.pm -> findService() +sub check_keywords{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $param = $args{keywords}; + return ([{}]) unless (ref($param) =~ /ARRAY/); + my @keywords = @$param; + #my %findme = %$param; + my $searchstring; + foreach my $kw ( @keywords ) { + $kw =~ s/\*//g; + $kw = $dbh->quote("%$kw%"); + $searchstring .= " OR description like $kw "; + } + $searchstring =~ s/OR//; # remove just the first OR in the longer statement + + my $statement = "select service_instance_id,category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid from service_instance where $searchstring"; + my @bindvalues = (); + + my $ids = do_query($dbh, $statement, @bindvalues); + return ($ids); +} + +# custom query subroutine for Moby::Central.pm->_searchForSimple() +sub find_by_simple{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $inout = $args{'inout'}; + my $ancestor_string = $args{'ancestor_string'}; + my $namespaceURIs = $args{'namespaceURIs'}; + + my $query ="select service_instance_id, namespace_type_uris from simple_$inout where object_type_uri in ($ancestor_string) and service_instance_id IS NOT NULL " + ; # if service_instance_id is null then it must be a collection input. + my $nsquery; + foreach my $ns ( @{$namespaceURIs} ) { # namespaces are already URI's + $nsquery .= " OR INSTR(namespace_type_uris, '$ns') "; + } + if ($nsquery) { + $nsquery =~ s/OR//; # just the first + $nsquery .= " OR namespace_type_uris IS NULL"; + $query .= " AND ($nsquery) "; + } + + my $result = do_query($dbh, $query, ()); + return $result; +} + +# custom query subroutine for Moby::Central.pm->_searchForCollection() +sub find_by_collection{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $inout = $args{'inout'}; + my $objectURI = $args{'objectURI'}; + my $namespaceURIs = $args{'namespaceURIs'}; + + my $query = "select + c.service_instance_id, + s.namespace_type_uris + from + simple_$inout as s, + collection_$inout as c + where + s.collection_${inout}_id IS NOT NULL + AND s.collection_${inout}_id = c.collection_${inout}_id + AND object_type_uri = '$objectURI' "; + my $nsquery; + foreach my $ns ( @{$namespaceURIs} ) { # namespaces are already URI's + $nsquery .= " OR INSTR(namespace_type_uris, '$ns') "; + } + if ($nsquery) { + $nsquery =~ s/^\sOR//; # just the first + $nsquery .= " OR namespace_type_uris IS NULL"; + $query .= " AND ($nsquery) "; # add the AND clause + } + + my $result = do_query($dbh, $query, ()); + return $result; +} + +# custom query subroutine for Moby::Central.pm->RetrieveServiceNames +sub get_service_names{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $statement = "select authority_uri, servicename from authority as a, service_instance as s where s.authority_id = a.authority_id"; + my @bindvalues = (); + + my $result = do_query($dbh, $statement, @bindvalues); + return $result; +} + +# custom query for Moby::Central.pm->_flatten +sub get_parent_terms{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + + my $type_id = $args{'relationship_type_id'}; + my $statement = " + select + OE1.term + from + OntologyEntry as OE1, + OntologyEntry as OE2, + Term2Term as TT + where + ontologyentry2_id = OE2.id + and ontologyentry1_id = OE1.id + and relationship_type_id = $type_id + and OE2.term = ?"; + + my @bindvalues = (); + push(@bindvalues, $args{'term'}); + + my $result = do_query($dbh, $statement, @bindvalues); + return $result; +} + +# custom query subroutine for selecting from object_term2term and object tables +# used in Moby::OntologyServer.pm->retrieveObject() +sub get_object_relationships{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $type = $args{type}; + return 0 unless $type; + my $result = $self->query_object(type => $type); + my $row = shift @$result; + my $id = $row->{object_id}; + + my $statement = "select + relationship_type, + object_type, + object_lsid, + description, + authority, + contact_email, + object2_articlename + from object_term2term, object + where object1_id = ? and object2_id = object_id"; + + my $result2 = do_query($dbh, $statement, ($id)); + return $result2; +} + +# relationship query for any table used in Moby::OntologyServer->_doRelationshipQuery() +# note: returns a reference to an array containing ARRAY references +sub get_relationship{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $direction = $args{'direction'}; + my $ontology = $args{'ontology'}; + my $relationship = $args{'relationship'}; # this is assumed to be an LSID + + my $type = $args{'term'}; + return 0 unless $type; + my $lsid; + if ($ontology eq "service"){ + my $result = $self->query_service(type => $type); + my $row = shift @$result; + $lsid = $row->{service_lsid}; + } else { + my $result = $self->query_object(type => $type); + my $row = shift @$result; + $lsid = $row->{object_lsid}; + } + my $defs; + my $extra_columns; + $extra_columns = ", relationship_type "; + if ($ontology eq "object"){$extra_columns .=", object2_articlename ";} + if ( $direction eq 'root' ) { + unless ( defined $relationship ) { + $defs = $self->dbh->selectall_arrayref( " + select distinct s2.${ontology}_lsid $extra_columns from + ${ontology}_term2term as t2t, + $ontology as s1, + $ontology as s2 + where + s1.${ontology}_id = t2t.${ontology}1_id and + s2.${ontology}_id = t2t.${ontology}2_id and + s1.${ontology}_lsid = ?", undef, $lsid ); # ") + } else { + $defs = $self->dbh->selectall_arrayref( " + select distinct s2.${ontology}_lsid $extra_columns from + ${ontology}_term2term as t2t, + $ontology as s1, + $ontology as s2 + where + relationship_type = ? and + s1.${ontology}_id = t2t.${ontology}1_id and + s2.${ontology}_id = t2t.${ontology}2_id and + s1.${ontology}_lsid = ?", undef, $relationship, $lsid ); # ") + } + } else { + unless ( defined $relationship ) { + $defs = $self->dbh->selectall_arrayref( " + select distinct s2.${ontology}_lsid $extra_columns from + ${ontology}_term2term as t2t, + $ontology as s1, + $ontology as s2 + where + s1.${ontology}_id = t2t.${ontology}1_id and + s2.${ontology}_id = t2t.${ontology}2_id and + s2.${ontology}_lsid = ?", undef, $lsid); # ") + } else { + $defs = $self->dbh->selectall_arrayref( " + select distinct s2.${ontology}_lsid $extra_columns from + ${ontology}_term2term as t2t, + $ontology as s1, + $ontology as s2 + where + relationship_type = ? and + s1.${ontology}_id = t2t.${ontology}1_id and + s2.${ontology}_id = t2t.${ontology}2_id and + s2.${ontology}_lsid = ?", undef, $relationship, $lsid ); # ") + } + } + return $defs; +} + +sub _checkURI { + +# my $uri = "http://www.ics.uci.edu/pub/ietf/uri/#Related"; +#print "$1, $2, $3, $4, $5, $6, $7, $8, $9" if +# $uri =~ m{^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?}; +# +#The license for this recipe is available here. +# +#Discussion: +# +#If the match is successful, a URL such as +# +#http://www.ics.uci.edu/pub/ietf/uri/#Related +# +#will be broken down into the following group match variables: +# +#$1 = http: +#$2 = http +#$3 = //www.ics.uci.edu +#$4 = www.ics.uci.edu +#$5 = /pub/ietf/uri/ +#$6 = +#$7 = +#$8 = #Related +#$9 = Related +# +#In general, this regular expression breaks a URI down into the following parts, +#as defined in the RFC: +# +#scheme = $2 +#authority = $4 +#path = $5 +#query = $7 +#fragment = $9 + +} + +sub DESTROY {} + +1; From fgibbons at pub.open-bio.org Thu Sep 15 10:09:44 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Thu, 15 Sep 2005 10:09:44 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509151409.j8FE9iGI019624@pub.open-bio.org> fgibbons Thu Sep 15 10:09:44 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory pub.open-bio.org:/tmp/cvs-serv19603 Added Files: RFC.html Log Message: - How to we handle changes to the API (RFCs) moby-live/Docs/MOBY-S_API RFC.html,NONE,1.1 From gss at pub.open-bio.org Wed Sep 14 18:05:49 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:05:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142205.j8EM5nii016998@pub.open-bio.org> gss Wed Sep 14 18:05:48 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core In directory pub.open-bio.org:/tmp/cvs-serv16973 Modified Files: .cvsignore Log Message: More to ignore moby-live/S-MOBY/ref-impl/core .cvsignore,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.cvsignore,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.cvsignore 2005/03/21 21:32:01 1.7 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.cvsignore 2005/09/14 22:05:48 1.8 @@ -1,3 +1,4 @@ classes .classpath .project +.settings From gss at pub.open-bio.org Wed Sep 14 18:06:10 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:10 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6ADW017093@pub.open-bio.org> gss Wed Sep 14 18:06:10 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph In directory pub.open-bio.org:/tmp/cvs-serv17011/src/org/semanticmoby/graph Modified Files: MOBYCollection.java MOBYSubject.java MOBYGraphNode.java MOBYOrderedCollection.java MOBYResizableCollection.java MOBYEnumeration.java MOBYFixedCollection.java MOBYObject.java MOBYGraph.java MOBYMappingElement.java MOBYUnorderedCollection.java Added Files: MOBYServiceSet.java MOBYPropValStmt.java CollectionWrapper.java ContainerWrapper.java MOBYService.java ListWrapper.java Removed Files: MOBYPropertyValueConstraint.java MOBYProviderSet.java MOBYDescriptor.java MOBYDocument.java MOBYOntology.java MOBYNonPositiveIntegerConstraint.java MOBYPropertyValue.java MOBYDateConstraint.java MOBYSingleElement.java MOBYIntegerConstraint.java MOBYNonNegativeIntegerConstraint.java MOBYProvider.java MOBYPropertyValueStatement.java MOBYNumericConstraint.java MOBYLiteral.java MOBYPropertyValueException.java MOBYResource.java Log Message: Major API overhaul moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph MOBYServiceSet.java,NONE,1.1 MOBYPropValStmt.java,NONE,1.1 CollectionWrapper.java,NONE,1.1 ContainerWrapper.java,NONE,1.1 MOBYService.java,NONE,1.1 ListWrapper.java,NONE,1.1 MOBYCollection.java,1.2,1.3 MOBYSubject.java,1.2,1.3 MOBYGraphNode.java,1.2,1.3 MOBYOrderedCollection.java,1.2,1.3 MOBYResizableCollection.java,1.2,1.3 MOBYEnumeration.java,1.2,1.3 MOBYFixedCollection.java,1.2,1.3 MOBYObject.java,1.2,1.3 MOBYGraph.java,1.1,1.2 MOBYMappingElement.java,1.2,1.3 MOBYUnorderedCollection.java,1.2,1.3 MOBYPropertyValueConstraint.java,1.1,NONE MOBYProviderSet.java,1.2,NONE MOBYDescriptor.java,1.2,NONE MOBYDocument.java,1.2,NONE MOBYOntology.java,1.2,NONE MOBYNonPositiveIntegerConstraint.java,1.1,NONE MOBYPropertyValue.java,1.1,NONE MOBYDateConstraint.java,1.1,NONE MOBYSingleElement.java,1.2,NONE MOBYIntegerConstraint.java,1.1,NONE MOBYNonNegativeIntegerConstraint.java,1.1,NONE MOBYProvider.java,1.2,NONE MOBYPropertyValueS! tatement.java,1.1,NONE MOBYNumericConstraint.java,1.1,NONE MOBYLiteral.java,1.1,NONE MOBYPropertyValueException.java,1.1,NONE MOBYResource.java,1.1,NONE =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYCollection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYCollection.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYCollection.java 2005/09/14 22:06:10 1.3 @@ -3,6 +3,7 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.util.iterator.ExtendedIterator; /** * A common abstract class for collections, both fixed sized and @@ -10,54 +11,61 @@ */ public abstract class MOBYCollection extends MOBYGraphNode { - /** - * A list to hold the elements of the collection - */ - protected List elements = new ArrayList(); + protected CollectionWrapper wrapper; /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements + * Creates an instance for the given model and defining statement */ - public MOBYCollection(List initialElements, Resource resource, - Model model) - { - super(resource, model); + public MOBYCollection(Model jenaModel, Statement definingStmt, + CollectionWrapper wrapper, List items) { + super(jenaModel, definingStmt); + this.wrapper = wrapper; - if (initialElements != null) { - elements.addAll(initialElements); + for (Iterator it = items.iterator(); it.hasNext();) + { + MOBYGraphNode node = (MOBYGraphNode) it.next(); + wrapper.add(node); } } /** - * Return the size of the collection. + * Returns the size of the collection. */ public int size() { - return elements.size(); + return wrapper.size(); } - + /** - * Return an iterator for traversing the elements + * Returns an iterator for traversing the elements */ - public Iterator iterator() + public ExtendedIterator iterator() { - return elements.iterator(); + return wrapper.iterator(); } - /** - * Return whether or not this object is a collection. - */ - public boolean isCollection() + public void add(MOBYGraphNode node) { - return true; + wrapper.add(node); } + /** - * Return whether or not this object is a singular element. + * Remove from the model all statements that make up this API object. + * This includes the defining statement (bnode rdf:type rdf:List), the + * statements that make up each of the nested API objects, and the + * statements that make this an RDF List, which are encapsulated in + * the Jena RDFList object. */ - public boolean isSingular() + public void removeStatements() { - return false; + ExtendedIterator it = wrapper.iterator(); + while (it.hasNext()) + { + MOBYGraphNode node = (MOBYGraphNode) it.next(); + node.removeStatements(); + } + it.close(); + wrapper.removeStatements(); } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYSubject.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYSubject.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYSubject.java 2005/09/14 22:06:10 1.3 @@ -1,12 +1,19 @@ package org.semanticmoby.graph; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + import org.semanticmoby.graph.*; +import org.semanticmoby.vocabulary.MOBY; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.Resource; +import com.hp.hpl.jena.rdf.model.Statement; +import com.hp.hpl.jena.vocabulary.RDF; /** - * An object that represents the subject of one or more mappings. In + * A class that represents the subject of one or more mappings. In * RDF graph terms, this represents a node (either blank or a resource) * that is a moby:Subject, an RDF data structure (List, Bag, Seq, Alt), * or both. @@ -23,24 +30,87 @@ { /** * The collection of direct mappings, i.e. moby:mapsTo statements - * whose subject is this. + * whose subject is this; keyed by the mapsTo statement. */ - private MOBYUnorderedCollection directMappings; + private Map directMappingStmts; - public MOBYSubject(Resource resource, MOBYFixedCollection statements, - MOBYUnorderedCollection directMappings, - MOBYCollection nestedMappings, Model underlying) + /** + * Creates an instance with the given parameters; should be called from + * parsing code. + */ + public MOBYSubject(Model jenaModel, Statement definingStmt, List propValStmts, + Map directMappingStmts, MOBYCollection nestedMappings) { - super(resource, statements, nestedMappings, underlying); - this.directMappings = directMappings; + super(jenaModel, definingStmt, propValStmts, nestedMappings); + this.directMappingStmts = directMappingStmts; } - + + /** + * Creates an instance with the given parameters; should be called + * when creating an instance from scratch (i.e. not from parsing). + */ + public MOBYSubject(Model jenaModel, Resource head, List propValStmts, + List directMappings, MOBYCollection nestedMappings) + { + super(jenaModel, + jenaModel.createStatement(head, RDF.type, MOBY.Subject), + propValStmts, nestedMappings); + + for (Iterator it = directMappings.iterator(); it.hasNext();) + { + MOBYGraphNode node = (MOBYGraphNode) it.next(); + addDirectMapping(node); + } + } + + /** + * Add the given node to the direct mappings, and add a mapsTo + * statement to the underlying model + */ + public void addDirectMapping(MOBYGraphNode node) + { + this.directMappingStmts.put( + node, + jenaModel.createStatement( + getResource(), MOBY.mapsTo, node.getResource())); + } + + /** + * Remove the given node from the direct mappings and remove the + * underlying RDF statements from the Jena model + */ + public void removeDirectMapping(MOBYGraphNode node) + { + Statement stmt = (Statement) directMappingStmts.get(node); + if (stmt != null) { + jenaModel.remove(stmt); + } + node.removeStatements(); + } + /** - * Return the collection of direct mappings, i.e. moby:mapsTo statements - * whose subject is this. + * Return an iterator over the direct mappings + */ + public Iterator getDirectMappings() + { + return directMappingStmts.keySet().iterator(); + } + + /* + * (non-Javadoc) + * @see org.semanticmoby.graph.MOBYGraphNode#removeStatements() */ - public MOBYUnorderedCollection getDirectMappings() + public void removeStatements() { - return directMappings; + super.removeStatements(); + if (directMappingStmts != null) + { + for (Iterator it = directMappingStmts.keySet().iterator(); it.hasNext();) + { + MOBYGraphNode node = (MOBYGraphNode) it.next(); + removeDirectMapping(node); + } + directMappingStmts = null; + } } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraphNode.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraphNode.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraphNode.java 2005/09/14 22:06:10 1.3 @@ -3,31 +3,88 @@ import com.hp.hpl.jena.rdf.model.*; /** - * An abstract class for nodes in an RDF graph; these nodes are either - * collections or singular elements. + * An abstract class for representing parts of a MOBY graph structure. */ -public abstract class MOBYGraphNode extends MOBYDescriptor +public abstract class MOBYGraphNode { - public MOBYGraphNode(Resource resource, Model model) + /** + * The underlying Jena model that holds the statements for this + * graph component + */ + protected Model jenaModel; + + /** + * Graph nodes all have an rdf:type statement that makes them what they + * are, with the exception of MOBYMappingElement instances, which can at + * times have no defining statement (see the discussion in the class + * documentation for MOBYMappingElement). + */ + protected Statement definingStmt; + + /** + * Creates an instance for the given model and defining statement + */ + protected MOBYGraphNode(Model jenaModel, Statement definingStmt) { - super(resource, model); + this.jenaModel = jenaModel; + this.definingStmt = definingStmt; + + if (definingStmt != null) { + jenaModel.add(definingStmt); + } } - + /** - * Return whether or not this node represents a blank node + * Returns the model that holds statements describing this component */ - public boolean isBlank() + public Model getJenaModel() { - return (resource == null) || (resource.getURI() == null); + return jenaModel; } /** - * Return whether or not this object is a collection. + * Returns the defining statement for this component */ - public abstract boolean isCollection(); + public Statement getDefiningStmt() + { + return definingStmt; + } /** - * Return whether or not this object is a singular element. + * Returns the resource that is the subject of the defining statement + * if it has one, else returns null; */ - public abstract boolean isSingular(); + public Resource getResource() + { + return (definingStmt == null) ? null : definingStmt.getSubject(); + } + + /** + * Removes the statements representing this component; subclasses should + * also call removeDefiningStatement() and call removeStatements() on all + * MOBYGraphNode instances nested within them. + */ + public abstract void removeStatements(); + + /** + * Removes and nulls out the defining statement if it has not already + * been removed and nulled out. + */ + protected void removeDefiningStatement() + { + if (definingStmt != null) + { + jenaModel.remove(definingStmt); + definingStmt = null; + } + } + + /** + * Returns the URI of the underlying resource if there is a defining + * statement, else returns null. + */ + public String getURI() + { + return (getResource() == null) ? null : getResource().getURI(); + } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYOrderedCollection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYOrderedCollection.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYOrderedCollection.java 2005/09/14 22:06:10 1.3 @@ -3,6 +3,7 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.vocabulary.RDF; /** * A class representing collections that can be resized (i.e. @@ -12,47 +13,24 @@ public class MOBYOrderedCollection extends MOBYResizableCollection { /** - * Create an instance with no elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Constructor for creating a fixed collection API object from scratch. */ - public MOBYOrderedCollection(Resource resource, - Model underlyingJenaModel) + public MOBYOrderedCollection(Model jenaModel, Resource head, List items) { - super(null, resource, underlyingJenaModel); + super(jenaModel, + jenaModel.createStatement(head, RDF.type, RDF.Seq), + new ContainerWrapper((Seq) head.as(Seq.class)), items); } /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Create an instance with the list of items */ - public MOBYOrderedCollection(List initialElements, Resource resource, - Model underlyingJenaModel) + public MOBYOrderedCollection(Model jenaModel, Statement definingStmt, + List items) { - super(initialElements, resource, underlyingJenaModel); - } - - /** - * Return the element at the given index - * @param index the zero-based index of the element to retrieve - * @return the element - */ - public Object get(int index) - { - return elements.get(index); - } - - /** - * Add the given element to the collection so that its new - * zero-based index is given index - * @param index the zero-based index at which the new element - * should be added - * @param elementToAdd the element to add - */ - public void add(int index, Object elementToAdd) - { - elements.add(index, elementToAdd); + super(jenaModel, + definingStmt, + new ContainerWrapper((Seq) definingStmt.getSubject().as(Seq.class)), + items); } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYResizableCollection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYResizableCollection.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYResizableCollection.java 2005/09/14 22:06:10 1.3 @@ -3,59 +3,23 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.util.iterator.ExtendedIterator; +import com.hp.hpl.jena.vocabulary.RDF; /** * A class representing collections that can be resized (i.e. * elements added to or removed from); such collections can be - * either ordered or unordered. + * either ordered or unordered. This corresponds to the three + * RDF container classes, namely Bag, Seq, and Alt. */ public abstract class MOBYResizableCollection extends MOBYCollection { /** - * Create an instance with no elements - * @param resource the resource node that represents this collection - * @param model the Jena model from which this is derived + * Constructor for creating a resizable collection API object from scratch. */ - public MOBYResizableCollection(Resource resource, Model model) + public MOBYResizableCollection(Model jenaModel, Statement definingStmt, + CollectionWrapper wrapper, List items) { - super(null, resource, model); - } - - /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored - */ - public MOBYResizableCollection(List initialElements, Resource resource, - Model underlyingJenaModel) - { - super(initialElements, resource, underlyingJenaModel); - } - - /** - * Add an element to the collection - * @param elementToAdd the element to add to the collection - */ - public void add(Object elementToAdd) - { - elements.add(elementToAdd); - } - - /** - * Remove an element from the collection - * @param elementToRemove the element to remove - */ - public void remove(Object elementToRemove) - { - elements.remove(elementToRemove); - } - - /** - * Remove all the elements from the collection - */ - public void clear() - { - elements.clear(); + super(jenaModel, definingStmt, wrapper, items); } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYEnumeration.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYEnumeration.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYEnumeration.java 2005/09/14 22:06:10 1.3 @@ -3,6 +3,7 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.vocabulary.RDF; /** * A class representing collections that can be resized (i.e. @@ -14,25 +15,24 @@ public class MOBYEnumeration extends MOBYUnorderedCollection { /** - * Create an instance with no elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Constructor for creating a fixed collection API object from scratch. */ - public MOBYEnumeration(Resource resource, - Model underlyingJenaModel) + public MOBYEnumeration(Model jenaModel, Resource head, List items) { - super(null, resource, underlyingJenaModel); + super(jenaModel, + jenaModel.createStatement(head, RDF.type, RDF.Alt), + new ContainerWrapper((Alt) head.as(Alt.class)), items); } /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Create an instance with the list of items */ - public MOBYEnumeration(List initialElements, Resource resource, - Model underlyingJenaModel) + public MOBYEnumeration(Model jenaModel, Statement definingStmt, + List items) { - super(initialElements, resource, underlyingJenaModel); + super(jenaModel, + definingStmt, + new ContainerWrapper((Alt) definingStmt.getSubject().as(Alt.class)), + items); } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYFixedCollection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYFixedCollection.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYFixedCollection.java 2005/09/14 22:06:10 1.3 @@ -3,32 +3,34 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.util.iterator.ExtendedIterator; +import com.hp.hpl.jena.vocabulary.RDF; /** - * A class for holding an ordered, fixed sized collection - * of objects; corresponds to an RDF List. + * A class for holding an ordered, fixed sized collection of API objects + * (subclasses of MOBYGraphNode); corresponds to an RDF List. */ public class MOBYFixedCollection extends MOBYCollection { /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements - * @param resource the resource node that represents this collection - * @param model the Jena model from which this is derived + * Constructor for creating a fixed collection API object from scratch. */ - public MOBYFixedCollection(List initialElements, Resource resource, - Model model) + public MOBYFixedCollection(Model jenaModel, Resource head, List items) { - super(initialElements, resource, model); + super(jenaModel, + jenaModel.createStatement(head, RDF.type, RDF.List), + new ListWrapper((RDFList) head.as(RDFList.class)), items); } /** - * Return the element at the given index - * @param index the zero-based index of the element to retrieve - * @return the element + * Create an instance with the list of items */ - public Object get(int index) + public MOBYFixedCollection(Model jenaModel, Statement definingStmt, + List items) { - return elements.get(index); + super(jenaModel, + definingStmt, + new ListWrapper((RDFList) definingStmt.getSubject().as(RDFList.class)), + items); } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYObject.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYObject.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYObject.java 2005/09/14 22:06:10 1.3 @@ -1,16 +1,44 @@ package org.semanticmoby.graph; +import java.util.List; + +import org.semanticmoby.vocabulary.MOBY; + import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.vocabulary.RDF; /** - * An object that represents the object of a mapping. + * A class that represents the object of one or more mappings. In + * RDF graph terms, this represents a node (either blank or a resource) + * that is a moby:Subject, an RDF data structure (List, Bag, Seq, Alt), + * or both. + *

        + * As an RDF data structure, it can have one or more elements, each + * of which can itself be either a moby:Object, an RDF data structure, + * or both. This collection of elements is returned by getNestedMappings(). */ public class MOBYObject extends MOBYMappingElement { - public MOBYObject(Resource resource, MOBYFixedCollection statements, - MOBYCollection nestedElements, Model underlying) + /** + * Creates an instance with the given parameters; should be called from + * parsing code. + */ + public MOBYObject(Model jenaModel, Statement definingStmt, + List propValStmts, MOBYCollection nestedMappings) + { + super(jenaModel, definingStmt, propValStmts, nestedMappings); + } + + /** + * Creates an instance with the given parameters; should be called + * when creating an instance from scratch (i.e. not from parsing). + */ + public MOBYObject(Model jenaModel, Resource head, List propValStmts, + MOBYCollection nestedMappings) { - super(resource, statements, nestedElements, underlying); + super(jenaModel, + jenaModel.createStatement(head, RDF.type, MOBY.Object), + propValStmts, nestedMappings); } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraph.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraph.java 2004/11/23 00:18:46 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraph.java 2005/09/14 22:06:10 1.2 @@ -1,26 +1,105 @@ package org.semanticmoby.graph; +import org.semanticmoby.vocabulary.MOBY; + import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.vocabulary.RDF; /** - * This class represents singular (i.e. not collection) subgraphs - * that have a single mapping. + * This class represents a singular (i.e. not collection) subgraph + * that has a single mapping. */ -public class MOBYGraph extends MOBYSingleElement +public class MOBYGraph extends MOBYGraphNode { + /** + * Wrapper object for the underlying subgraph pointed to by a + * hasMapping property + */ private MOBYGraphNode hasMapping; - public MOBYGraph(Resource resource, MOBYGraphNode hasMapping, Model underlying) + /** + * The statement that asserts that this graph has the mapping wrapped + * by the hasMapping instance variable + */ + private Statement hasMappingStmt; + + /** + * Creates an instance for the given model, defining statement, + * hasMapping statement, and MOBYGraphNode that was parsed from + * the value of the hasMapping statement + */ + public MOBYGraph(Model jenaModel, Statement definingStmt, + Statement hasMappingStmt, MOBYGraphNode hasMapping) { - super(resource, underlying); + super(jenaModel, definingStmt); + this.hasMappingStmt = hasMappingStmt; this.hasMapping = hasMapping; } + + /** + * Creates an instance from scratch + */ + public MOBYGraph(Model jenaModel) + { + super(jenaModel, + jenaModel.createStatement( + jenaModel.createResource(), RDF.type, MOBY.Graph)); + } + + /** + * Creates an instance from scratch, and includes an initial mapping + */ + public MOBYGraph(Model jenaModel, MOBYGraphNode hasMapping) + { + this(jenaModel); + setHasMapping(hasMapping); + } + + /** + * Sets the value of a hasMapping instance variable, and adds a hasMapping + * statement to the underlying model. + */ + public void setHasMapping(MOBYGraphNode hasMapping) + { + removeHasMapping(); + this.hasMapping = hasMapping; + hasMappingStmt = jenaModel.createStatement( + getResource(), MOBY.hasMapping, hasMapping.getResource()); + jenaModel.add(hasMappingStmt); + } + + /** + * Removes the hasMapping statement from the underlying model and nulls + * the hasMapping instance variable + */ + public void removeHasMapping() + { + if (hasMapping != null) + { + jenaModel.remove(hasMappingStmt); + hasMappingStmt = null; + hasMapping.removeStatements(); + hasMapping = null; + } + } /** - * Return the object of this graph's hasMapping property. + * Returns the object of this graph's hasMapping property. */ public MOBYGraphNode getHasMapping() { return hasMapping; } + + /* + * (non-Javadoc) + * @see org.semanticmoby.graph.MOBYGraphNode#removeStatements() + */ + public void removeStatements() + { + removeDefiningStatement(); + if (hasMapping != null) { + hasMapping.removeStatements(); + } + } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYMappingElement.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYMappingElement.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYMappingElement.java 2005/09/14 22:06:10 1.3 @@ -1,37 +1,91 @@ package org.semanticmoby.graph; - +import java.util.Iterator; +import java.util.List; import com.hp.hpl.jena.rdf.model.*; - -public class MOBYMappingElement extends MOBYSingleElement +/** + * This class represents graph nodes that are within a containing subgraph, + * which is pointed to by a hasMapping or mapsTo property. Such nodes can have + * property value setting statements (instances of MOBYPropertyValueStatement) + * associated with them. If the containing subgraph is pointed to by a + * hasMapping property, the node can optionally be an instance of moby:Subject, + * in which case its defining statement is the rdf:type statement making that + * assertion; if it is not a moby:Subject, then the defining statement is null. + * Similarly, if the containing subgraph is pointed to by a mapsTo property, + * the node can optionally be an instance of moby:Object, in which case its + * defining statement is the rdf:type statement making that assertion; if it + * is not a moby:Object, then the defining statement is null. + *

        + * Nodes represented by this class can also optionally be instances of + * collections (subclasses of MOBYCollection), in which case their collective + * nature is expressed through the nestedMappings instance variable. + */ +public abstract class MOBYMappingElement extends MOBYGraphNode { - private MOBYFixedCollection statements; - private MOBYCollection nestedElements; + /** + * Property value statements whose subjects are this node's resource + */ + private List propValStmts; - public MOBYMappingElement(Resource resource, MOBYFixedCollection statements, - MOBYCollection nestedElements, Model underlying) + /** + * A view of this node as a collection + */ + private MOBYCollection nestedMappings; + + /** + * Creates an instance with the given parameters. + */ + protected MOBYMappingElement(Model jenaModel, Statement definingStmt, + List propValStmts, MOBYCollection nestedMappings) { - super(resource, underlying); - this.statements = statements; - this.nestedElements = nestedElements; + super(jenaModel, definingStmt); + this.propValStmts = propValStmts; + this.nestedMappings = nestedMappings; } - + /** - * Return the collection of property-setting statements associated + * Returns the collection of property-setting statements associated * with this mapping element. */ - public MOBYFixedCollection getPropertyValueStatements() + public List getPropValStmts() { - return statements; + return propValStmts; } /** - * Return the collection of mappings that are nested within this + * Returns the collection of mappings that are nested within this * mapping element through its role as a data structure. */ - public MOBYCollection getNestedElements() { - return nestedElements; + public MOBYCollection getNestedMappings() + { + return nestedMappings; } - -} + + /** + * Removes the statements associated with this objects nested within + * this object. + */ + public void removeStatements() + { + removeDefiningStatement(); + if (propValStmts != null) + { + for (Iterator it = propValStmts.iterator(); it.hasNext();) + { + MOBYPropValStmt stmt = (MOBYPropValStmt) it.next(); + stmt.removeStatements(); + } + propValStmts = null; + } + if (nestedMappings != null) + { + for (Iterator it = nestedMappings.iterator(); it.hasNext();) + { + MOBYGraphNode node = (MOBYGraphNode) it.next(); + node.removeStatements(); + } + nestedMappings = null; + } + } +} \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYUnorderedCollection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYUnorderedCollection.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYUnorderedCollection.java 2005/09/14 22:06:10 1.3 @@ -3,6 +3,8 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.util.iterator.ExtendedIterator; +import com.hp.hpl.jena.vocabulary.RDF; /** * A class representing collections that can be resized (i.e. @@ -12,25 +14,33 @@ public class MOBYUnorderedCollection extends MOBYResizableCollection { /** - * Create an instance with no elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Constructor for creating a fixed collection API object from scratch. */ - public MOBYUnorderedCollection(Resource resource, - Model underlyingJenaModel) + public MOBYUnorderedCollection(Model jenaModel, Resource head, List items) { - super(null, resource, underlyingJenaModel); + super(jenaModel, + jenaModel.createStatement(head, RDF.type, RDF.Bag), + new ContainerWrapper((Bag) head.as(Bag.class)), items); } /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Create an instance with the list of items */ - public MOBYUnorderedCollection(List initialElements, Resource resource, - Model underlyingJenaModel) + public MOBYUnorderedCollection(Model jenaModel, Statement definingStmt, + List items) { - super(initialElements, resource, underlyingJenaModel); + super(jenaModel, + definingStmt, + new ContainerWrapper((Bag) definingStmt.getSubject().as(Bag.class)), + items); + } + + /** + * Constructor for creating an unordered collection API object from scratch. + */ + public MOBYUnorderedCollection(Model jenaModel, Statement definingStmt, + CollectionWrapper wrapper, List items) + { + super(jenaModel, definingStmt, wrapper, items); } } \ No newline at end of file rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYPropertyValueConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYProviderSet.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYDescriptor.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYDocument.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYOntology.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYNonPositiveIntegerConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYPropertyValue.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYDateConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYSingleElement.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYIntegerConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYNonNegativeIntegerConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYProvider.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYPropertyValueStatement.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYNumericConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYLiteral.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYPropertyValueException.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYResource.java,v: No such file or directory From gss at pub.open-bio.org Wed Sep 14 18:06:11 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6BPu017112@pub.open-bio.org> gss Wed Sep 14 18:06:10 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser In directory pub.open-bio.org:/tmp/cvs-serv17011/src/org/semanticmoby/parser Modified Files: Parser.java Added Files: NamespaceBasedPropertyDetector.java MOBYPropertyDetector.java Log Message: Major API overhaul moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser NamespaceBasedPropertyDetector.java,NONE,1.1 MOBYPropertyDetector.java,NONE,1.1 Parser.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser/Parser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser/Parser.java 2005/03/21 21:32:38 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser/Parser.java 2005/09/14 22:06:10 1.3 @@ -12,9 +12,9 @@ import com.hp.hpl.jena.vocabulary.*; /** - * This class is used to parse RDF models, stored as Jena2 models, into - * objects that implement interfaces from the org.semanticmoby.graph - * package. + * This class is used to parse RDF models, stored as Jena2 Model objects, + * into API wrapper objects that insulate the programmer from the details + * of RDF. */ public class Parser { @@ -28,6 +28,9 @@ */ public final static String LANGUAGE_N3 = "N3"; + private MOBYPropertyDetector propDetector = + new NamespaceBasedPropertyDetector(); + /** * Since models are stored in a single Jena model, we * segregate the single model into multiple sub-models, @@ -35,12 +38,6 @@ * plus all statements that are reachable from it. */ private List subModels = new ArrayList(); - - /** - * A map relating a property's URI to an Inference model derived from - * its base model - */ - private Map cachedPropertyModels = new HashMap(); /** * Create and return a parser for parsing an N3 file @@ -130,7 +127,7 @@ */ public Parser(Model model) { - StmtIterator it = model.listStatements(null, RDF.type, MOBY.Provider); + StmtIterator it = model.listStatements(null, RDF.type, MOBY.Service); while (it.hasNext()) { Statement stmt = it.nextStatement(); @@ -143,84 +140,86 @@ } /** - * Parse a provider from the model. If the model contains - * multiple providers, only one will be returned (at random). If - * the model is expected to contain multiple providers, then call - * parseProviders() instead to get all the providers in a + * Parse a MOBYService from the model. If the model contains multiple + * services, only one will be returned (at random), so if the model is + * expected to contain multiple services, then call parseServices() instead to get all the providers in a * MOBYCollection. */ - public MOBYProvider parseProvider() + public MOBYService parseService() + throws NonCanonicalException { - MOBYUnorderedCollection providers = parseProviders(); + List services = parseServices(); - if (providers.size() == 0) { + if (services.size() == 0) { return null; } else { - return (MOBYProvider) providers.iterator().next(); + return (MOBYService) services.iterator().next(); } } /** - * Parse and return an unordered collection of providers + * Parse and return an list of MOBYService objects */ - public MOBYUnorderedCollection parseProviders() + public List parseServices() + throws NonCanonicalException { - ArrayList providers = new ArrayList(); + ArrayList services = new ArrayList(); - // Parse each provider - // Iterator it = subModels.iterator(); while (it.hasNext()) { Model model = (Model) it.next(); - StmtIterator it2 = model.listStatements(null, RDF.type, MOBY.Provider); + StmtIterator it2 = model.listStatements(null, RDF.type, MOBY.Service); if (it2 != null) { Statement stmt = it2.nextStatement(); - Resource provider = stmt.getSubject(); - providers.add(parseProvider(provider)); + services.add(parseService(stmt)); } } - - // Create and return an unordered collection of the parsed providers - // - return new MOBYUnorderedCollection(providers, null, null); + return services; } /** - * Parse a provider starting from the given resource (i.e. a resource that - * is the subject of an rdf:type statement with object of moby:Provider) + * Parse a service starting from the given resource (i.e. a resource that + * is the subject of an rdf:type statement with object of moby:Service) */ - public MOBYProvider parseProvider(Resource provider) + public MOBYService parseService(Statement typeStmt) + throws NonCanonicalException { - Model model = provider.getModel(); + Resource headResource = typeStmt.getSubject(); + + Model model = headResource.getModel(); - // First parse the scalar properties name, oneLineDescription, and aboutURI - // - Statement nameStmt = model.getProperty(provider, MOBY.name); - Statement oneLineDescriptionStmt = model.getProperty(provider, MOBY.oneLineDescription); - Statement aboutURIStmt = model.getProperty(provider, MOBY.aboutURI); + // First parse the scalar properties + + Statement nameStmt = + model.getProperty(headResource, MOBY.name); - // A provider can have multiple operatesOn properties, each of + Statement oneLineDescriptionStmt = + model.getProperty(headResource, MOBY.oneLineDescription); + + Statement aboutURIStmt = + model.getProperty(headResource, MOBY.aboutURI); + + // A service can have multiple operatesOn properties, each of // which leads to a subgraph. Parse each of these subgraphs. - // - List operatesOn = new ArrayList(); - StmtIterator it = model.listStatements(provider, MOBY.operatesOn, (RDFNode) null); + Map operatesOn = new HashMap(); + StmtIterator it = + model.listStatements(headResource, MOBY.operatesOn, (RDFNode) null); while (it.hasNext()) { - Statement stmt = it.nextStatement(); - Resource r = (Resource) stmt.getObject(); - operatesOn.add(parseOperatesOn(r)); + Statement operatesOnStmt = it.nextStatement(); + Resource r = (Resource) operatesOnStmt.getObject(); + operatesOn.put(operatesOnStmt, parseOperatesOn(r)); } - // Create and return a new Provider object using the provider URI, name, + // Create and return a new Service object using the service URI, name, // oneLineDescription, aboutURI, and collection of operatesOn subgraphs // - return new MOBYProvider( - provider, nameStmt, oneLineDescriptionStmt, aboutURIStmt, - new MOBYUnorderedCollection(operatesOn, provider, model), - model); + return new MOBYService(model, typeStmt, nameStmt, + oneLineDescriptionStmt, + aboutURIStmt, operatesOn); } /** @@ -231,25 +230,48 @@ * each element of the data structure should be a mapping subgraph. */ private MOBYGraphNode parseOperatesOn(Resource res) + throws NonCanonicalException { Model model = res.getModel(); if (isGraph(res)) { - // The resource is a MOBY Graph, so should have exactly one + // Throw an exception if it is also a data structure + if (isDataStructure(res)) + { + throw new NonCanonicalException( + "A resource was found to be both a Graph " + + "and Data Structure", model); + } + + // The defining statement for the MOBYGraph instance + Statement typeStmt = model.listStatements( + res, RDF.type, MOBY.Graph).nextStatement(); + + // The statement that asserts the hasMapping property + Statement hasMappingStmt = model.listStatements( + res, MOBY.hasMapping, (RDFNode) null).nextStatement(); + + // Since the resource is a MOBY Graph, it should have exactly one // hasMapping property that leads to its mapping subgraph. - // Resource hasMapping = getResourcePropertyValue(res, MOBY.hasMapping); - return new MOBYGraph(res, parseHasMapping(hasMapping), model); + return new MOBYGraph(model, typeStmt, hasMappingStmt, + parseHasMapping(hasMapping)); } else { + // Throw an exception if it is also a graph + if (isGraph(res)) + { + throw new NonCanonicalException( + "A resource was found to be both a Graph " + + "and Data Structure", model); + } // The resource is a data structure, so has multiple mapping // subgraphs, each of which is headed by an element in the // data structure. Iterate through the data structure elements, // parsing a mapping subgraph from each by recursively calling // this method. - // Iterator it = iteratorFor(res); List subgraphs = new ArrayList(); while (it.hasNext()) @@ -260,7 +282,6 @@ // Create and return a collection of the subgraphs; the type // of the collection depends on the type of the passed resource - // return collectionFor(res, subgraphs); } } @@ -273,37 +294,52 @@ * each element of the data structure should be a mapped subgraph. */ private MOBYSubject parseHasMapping(Resource res) + throws NonCanonicalException { - Model model = res.getModel(); - - // Collect the properties of this subject resource that are - // subproperties of moby:Property, and create MOBY statements - // for each. - // - List statements = mobyPropertyStatementsOf(res); + Model model = res.getModel(); + + // It is *not* legal for the object of a hasMapping to be *neither* + // a Subject nor a data structure, so throw an exception if this is + // the case. + if ((! isSubject(res)) && (! isDataStructure(res))) + { + throw new NonCanonicalException( + "A hasMapping property was found to have a value that " + + "is neither a Subject nor a data structure", model); + } + + // Collect the properties of this subject that are + // meant to be filled in by the client + List propValStmts = mobyPropertyStatementsOf(res); // List of direct mappings, i.e. those related through hasMapping // properties. - // - List directMappings = new ArrayList(); + Map directMappings = new HashMap(); // List of nested hasMapping subgraphs - // List nestedMappings = new ArrayList(); + // The statement that asserts this to be of rdf:type moby:Subject. + // Since it is legal for this to not be a Subject, then the statement + // can be null + Statement typeStmt = null; + if (isSubject(res)) { + typeStmt = model.listStatements( + res, RDF.type, MOBY.Subject).nextStatement(); + // The resource is a MOBY Subject, so should have one or more // mapsTo properties that lead to its mapped subgraphs. - // List mapsTo = new ArrayList(); - StmtIterator it = model.listStatements(res, MOBY.mapsTo, (RDFNode) null); + StmtIterator it = + model.listStatements(res, MOBY.mapsTo, (RDFNode) null); while (it.hasNext()) { - Statement stmt = it.nextStatement(); - Resource mapsToSubject = stmt.getResource(); + Statement mapsToStmt = it.nextStatement(); + Resource mapsToSubject = mapsToStmt.getResource(); MOBYGraphNode object = parseMapsTo(mapsToSubject); - directMappings.add(object); + directMappings.put(object, mapsToStmt); } } @@ -313,7 +349,6 @@ // nested in each element. For each element in the data structure, // recursively call this method to create a mapping subgraph, an // save the parsed object in the nestedMappings list. - // Iterator it = iteratorFor(res); while (it.hasNext()) { @@ -322,13 +357,66 @@ } } - // Create and return a Subject to describe this hasMapping subgraph - // - return new MOBYSubject(res, - new MOBYFixedCollection(statements, res, model), - new MOBYUnorderedCollection(directMappings, res, model), - collectionFor(res, nestedMappings), - model); + return new MOBYSubject(model, typeStmt, propValStmts, directMappings, + collectionFor(res, nestedMappings)); + } + + /** + * Parse the object of an mapsTo statement, which should be a + * Subject, a data structure, or both. If the object is a Subject, + * then it should be connected to one or more mapped subgraphs through + * mapsTo properties. If the object is a data structure, then + * each element of the data structure should be a mapped subgraph. + */ + private MOBYObject parseMapsTo(Resource res) + throws NonCanonicalException + { + Model model = res.getModel(); + + // It is *not* legal for the object of a mapsTo to be *neither* + // an Object nor a data structure, so throw an exception if this is + // the case. + if ((! isObject(res)) && (! isDataStructure(res))) + { + throw new NonCanonicalException( + "A mapsTo property was found to have a value " + + "is neither an Object nor a data structure", model); + } + + // Collect the properties of this subject that are + // meant to be filled in by the client + List propValStmts = mobyPropertyStatementsOf(res); + + // List of nested Object subgraphs + List nestedObjects = new ArrayList(); + + // The statement that asserts this to be of rdf:type moby:Object. + // Since it is legal for this to not be an Object, then the statement + // can be null + Statement typeStmt = null; + + if (isObject(res)) + { + typeStmt = model.listStatements( + res, RDF.type, MOBY.Object).nextStatement(); + } + + if (isDataStructure(res)) + { + // The resource is a data structure, so has a mapping subgraph + // nested in each element. For each element in the data structure, + // recursively call this method to create a mapping subgraph, an + // save the parsed object in the nestedMappings list. + Iterator it = iteratorFor(res); + while (it.hasNext()) + { + Resource r = (Resource) it.next(); + nestedObjects.add(parseMapsTo(r)); + } + } + + return new MOBYObject(model, typeStmt, propValStmts, + collectionFor(res, nestedObjects)); } @@ -336,14 +424,15 @@ * Parse the object of a mapsTo statement, which should be an * Object, a data structure, or both. If the object is a data * structure, then each element of the data structure should - * be a mapped subgraph. + * in turn be an Object, a data structure, or both. */ + /* private MOBYObject parseMapsTo(Resource res) { - // Collect the properties of this subject resource that are - // subproperties of moby:Property, and create MOBY statements - // for each. - // + Model model = res.getModel(); + + // Collect the properties of this object that are + // meant to be filled in by the service List statements = mobyPropertyStatementsOf(res); // List of nested mapsTo statements @@ -364,14 +453,11 @@ nested.add(parseMapsTo(r)); } } - - // Create and return a new MOBYObject - // - Model model = res.getModel(); return new MOBYObject(res, new MOBYFixedCollection(statements, res, model), collectionFor(res, nested), model); } + */ /** * Return a list of statements for whom the subject is a given resource, @@ -381,86 +467,22 @@ private List mobyPropertyStatementsOf(Resource res) { // The statements to return - // List stmts = new ArrayList(); // Iterate over the statements whose subjects are the resource - // StmtIterator it = res.listProperties(); while (it.hasNext()) { Statement stmt = it.nextStatement(); - Property p = stmt.getPredicate(); - RDFNode pval = stmt.getObject(); - - // Try to retrieve a description of the property at - // its URI. - // - InfModel model = getPropertyModel(p); - - if (isMobyProperty(p, model)) + if (stmt.getObject().isAnon() && + !propDetector.isMOBYProperty(stmt.getPredicate())) { - MOBYPropertyValueStatement pvalStmt = - new MOBYPropertyValueStatement(stmt, model); - - Statement s = p.getProperty(RDFS.range); - - if ((s != null) && (s.getObject().canAs(Resource.class))) - { - Resource range = (Resource) s.getObject(); - if (range.equals(XSD.date)) { - pvalStmt.setConstraint(new MOBYDateConstraint()); - } else if (range.equals(XSD.integer)) { - pvalStmt.setConstraint(new MOBYIntegerConstraint()); - } else if (range.equals(XSD.nonNegativeInteger)) { - pvalStmt.setConstraint( - new MOBYNonNegativeIntegerConstraint()); - } else if (range.equals(XSD.nonPositiveInteger)) { - pvalStmt.setConstraint( - new MOBYNonPositiveIntegerConstraint()); - } - } - - stmts.add(pvalStmt); + stmts.add(stmt); } } return stmts; } - /** - * Get the model describing a given property by doing a GET - * on its URI, and creating an inference model from it. - */ - private InfModel getPropertyModel(Property p) - { - InfModel cachedModel = (InfModel) - cachedPropertyModels.get(p.getURI()); - - if (cachedModel == null) - { - Model model = ModelRetriever.retrieveModel(p.getURI()); - - if (model != null) - { - cachedModel = ModelFactory.createRDFSModel(model); - cachedPropertyModels.put(p.getURI(), cachedModel); - } - } - return cachedModel; - } - - /** - * Return whether or not the given property is a MOBY property. - * This will be true if there is a statement in the model saying - * that the property is an rdfs:subPropertyOf moby:Property. - */ - private boolean isMobyProperty(Property p, InfModel model) - { - return - model != null && - model.contains(p, RDFS.subPropertyOf, MOBY.Property); - } - private Resource getResourcePropertyValue(Resource subject, Property property) { Statement s = subject.getModel().getProperty(subject, property); @@ -490,21 +512,31 @@ * an RDF:Seq yields a MOBYOrderedCollection; an RDF Alt yields a * MOBYEnumeration. */ - private MOBYCollection collectionFor(Resource res, List elements) + private MOBYCollection collectionFor(Resource res, List items) { + Model model = res.getModel(); if (isList(res)) { - return new MOBYFixedCollection(elements, res, res.getModel()); + return new MOBYFixedCollection( + model, typeStatement(res, RDF.List), items); } else if (isBag(res)) { - return new MOBYUnorderedCollection(elements, res, res.getModel()); + return new MOBYUnorderedCollection( + model, typeStatement(res, RDF.Bag), items); } else if (isSeq(res)) { - return new MOBYOrderedCollection(elements, res, res.getModel()); + return new MOBYOrderedCollection( + model, typeStatement(res, RDF.Seq), items); } else if (isAlt(res)) { - return new MOBYEnumeration(elements, res, res.getModel()); + return new MOBYEnumeration( + model, typeStatement(res, RDF.Alt), items); } else { return null; } } + private Statement typeStatement(Resource subject, Resource objectType) { + return subject.getModel().listStatements( + subject, RDF.type, objectType).nextStatement(); + } + /** * Return whether or not the given resource is an RDF List */ From gss at pub.open-bio.org Wed Sep 14 18:06:11 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6B0i017132@pub.open-bio.org> gss Wed Sep 14 18:06:11 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv17011/src/org/semanticmoby/vocabulary Modified Files: MOBY.java Log Message: Major API overhaul moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/vocabulary MOBY.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java 2004/11/23 00:18:46 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java 2005/09/14 22:06:10 1.2 @@ -31,7 +31,7 @@ model.setNsPrefix(getNsPrefix(), getURI()); } - public static final Resource Provider = resource(getURI(), "Provider"); + public static final Resource Service = resource(getURI(), "Service"); public static final Resource Graph = resource(getURI(), "Graph"); public static final Resource Subject = resource(getURI(), "Subject"); public static final Resource Object = resource(getURI(), "Object"); From gss at pub.open-bio.org Wed Sep 14 18:06:11 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6BH0017151@pub.open-bio.org> gss Wed Sep 14 18:06:11 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/servlet In directory pub.open-bio.org:/tmp/cvs-serv17011/src/org/semanticmoby/servlet Modified Files: AbstractMobyServlet.java Log Message: Major API overhaul moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/servlet AbstractMobyServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java 2004/11/23 00:18:46 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java 2005/09/14 22:06:11 1.2 @@ -58,7 +58,7 @@ * in, that serves as "input" to the provider. * @return a graph containing the work product of the provider. */ - protected abstract void handleRequest(MOBYProvider requestGraph); + protected abstract void handleRequest(MOBYService requestGraph); /** * A utility method for getting a buffered reader (as returned by @@ -108,16 +108,16 @@ MOBY.GRAPH_PARAMETER_NAME, request); Parser parser = Parser.forString( graphString, Parser.LANGUAGE_RDF_XML); - MOBYProvider provider = parser.parseProvider(); + MOBYService service = parser.parseService(); // Invoke the abstract handleRequest() method in order for the // provider servlet to do whatever it does to the graph. // - handleRequest(provider); + handleRequest(service); // Send the graph back in response // - provider.serialize(out); + service.serialize(out); } catch (Throwable t) { From gss at pub.open-bio.org Wed Sep 14 18:06:55 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:55 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6tJN017217@pub.open-bio.org> gss Wed Sep 14 18:06:55 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools In directory pub.open-bio.org:/tmp/cvs-serv17172/src/org/semanticmoby/ref/tools Modified Files: InvocationBroker.java KeywordFinder.java KeywordList.java URIInvestigator.java KeywordQuery.java DiscoveryQuery.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools InvocationBroker.java,1.2,1.3 KeywordFinder.java,1.2,1.3 KeywordList.java,1.1,1.2 URIInvestigator.java,1.2,1.3 KeywordQuery.java,1.2,1.3 DiscoveryQuery.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/InvocationBroker.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/InvocationBroker.java 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/InvocationBroker.java 2005/09/14 22:06:55 1.3 @@ -16,7 +16,7 @@ /** * This class is used to invoke and display the results of Semantic - * MOBY providers. + * MOBY services. */ public class InvocationBroker { @@ -55,64 +55,64 @@ this.out = out; } - private String rdfxmlString(MOBYProvider provider) + private String rdfxmlString(MOBYService service) { StringWriter writer = new StringWriter(); - provider.getModel().write(writer); + service.getJenaModel().write(writer); return writer.toString(); } - private String n3String(MOBYProvider provider) + private String n3String(MOBYService service) { StringWriter writer = new StringWriter(); - provider.getModel().write(writer, "N3"); + service.getJenaModel().write(writer, "N3"); return writer.toString(); } /** - * Handle a request to invoke a provider at a given URI. - * If the provider requires inputs, and the provider has + * Handle a request to invoke a service at a given URI. + * If the service requires inputs, and the service has * a valid inputURI property, redirect to the URI that is - * the value of the property. If the provider requires input + * the value of the property. If the service requires input * and has no inputURI property, then build a simple input * GUI from scratch. *

        - * If the provider doesn't require any inputs, then do an HTTP - * POST to the provider URI, passing the graph as a parameter. + * If the service doesn't require any inputs, then do an HTTP + * POST to the service URI, passing the graph as a parameter. */ - public void invokeURI(String providerURI) + public void invokeURI(String serviceURI) { - // Try to retrieve and parse a provider graph from the URI; + // Try to retrieve and parse a service graph from the URI; // on failure, print a message and return. // - MOBYProvider canonicalProvider = null; + MOBYService service = null; try { Model model = ModelFactory.createDefaultModel(); - model.read(providerURI); + model.read(serviceURI); Parser parser = new Parser(model); - canonicalProvider = parser.parseProvider(); + service = parser.parseService(); } catch (Throwable t) { - out.println("No valid provider could be found at"); - out.print(""); - out.print(" "); out.println(providerURI); out.println(""); + out.println("No valid service could be found at"); + out.print(""); + out.print(" "); out.println(serviceURI); out.println(""); return; } - if (requiresInputs(canonicalProvider)) + if (requiresInputs(service)) { - // Since the provider requires input, either redirect to its + // Since the service requires input, either redirect to its // inputURI (if it has one) or build a simple GUI for it. // try { - String inputURI = getInputURI(canonicalProvider); + String inputURI = getInputURI(service); if (inputURI == null) { - buildInputGUI(canonicalProvider); + buildInputGUI(service); } else { @@ -128,23 +128,23 @@ if (status == HttpStatus.SC_OK) { response.sendRedirect(inputURI); } else { - buildInputGUI(canonicalProvider); + buildInputGUI(service); } } } catch (Throwable t) { - buildInputGUI(canonicalProvider); + buildInputGUI(service); } } else // No input required { try { - // Invoke the provider + // Invoke the service // HTTPRequest rqst = - HTTPRequest.newPostRequest(canonicalProvider.getURI()); + HTTPRequest.newPostRequest(service.getURI()); rqst.addParameter(MOBY.GRAPH_PARAMETER_NAME, - rdfxmlString(canonicalProvider)); + rdfxmlString(service)); HTTPResponse resp = rqst.send(); // Check the status @@ -158,16 +158,16 @@ Model model = ModelFactory.createDefaultModel(); model.read(resp.getBodyAsStream(), ""); Parser parser = new Parser(model); - MOBYProvider resultsProvider = parser.parseProvider(); + MOBYService resultsService = parser.parseService(); - String outputURI = getOutputURI(resultsProvider); + String outputURI = getOutputURI(resultsService); if (outputURI == null) { // No output URI was specified, so build a generic // display of the results // - buildOutputGUI(resultsProvider); + buildOutputGUI(resultsService); } else { @@ -186,7 +186,7 @@ // by trying to invoke it. // rqst = HTTPRequest.newPostRequest(outputURI); - String graphString = rdfxmlString(resultsProvider); + String graphString = rdfxmlString(resultsService); rqst.addParameter( MOBY.GRAPH_PARAMETER_NAME, graphString); resp = rqst.send(); @@ -204,22 +204,22 @@ // The output URI returned a status other than // 200 OK, so fall back to a default output GUI // - buildOutputGUI(resultsProvider); + buildOutputGUI(resultsService); } } catch (Throwable t) { - buildOutputGUI(resultsProvider); + buildOutputGUI(resultsService); } } } else { - out.println("Sorry - an error occurred invoking the provider"); + out.println("Sorry - an error occurred invoking the service"); } } catch (Throwable t) { - out.println("Sorry - an error occurred invoking the provider"); + out.println("Sorry - an error occurred invoking the service"); return; } } @@ -243,57 +243,55 @@ dispatcher.forward(request, response); } - private String getInputURI(MOBYProvider provider) + private String getInputURI(MOBYService service) { try { - Model model = provider.getModel(); - Statement stmt = model.listStatements( - provider.getResource(), MOBY.inputURI, - (String) null).nextStatement(); + Model model = service.getJenaModel(); + Statement stmt = + model.getProperty(service.getResource(), MOBY.inputURI); return stmt.getString(); } catch (Throwable t) { return null; } } - private String getOutputURI(MOBYProvider provider) + private String getOutputURI(MOBYService service) { try { - Model model = provider.getModel(); - Statement stmt = model.listStatements( - provider.getResource(), MOBY.outputURI, - (String) null).nextStatement(); + Model model = service.getJenaModel(); + Statement stmt = + model.getProperty(service.getResource(), MOBY.outputURI); return stmt.getString(); } catch (Throwable t) { return null; } } - public void buildInputGUI(MOBYProvider provider) + public void buildInputGUI(MOBYService service) { - out.println("This provider has not provided a valid URL for"); + out.println("This service has not provided a valid URL for"); out.println("gathering its required inputs."); } - public void buildOutputGUI(MOBYProvider provider) + public void buildOutputGUI(MOBYService service) throws IOException, ServletException { HttpSession session = request.getSession(true); session.setAttribute("n3Graph", - n3String(provider) + n3String(service) .replaceAll("<", "<") .replaceAll(">", ">") .replaceAll("\"", """)); session.setAttribute("rdfxmlGraph", - rdfxmlString(provider) + rdfxmlString(service) .replaceAll("<", "<") .replaceAll(">", ">") .replaceAll("\"", """)); redirectToPage("/jsp/display.jsp"); } - private boolean requiresInputs(MOBYProvider provider) + private boolean requiresInputs(MOBYService service) { - return getInputURI(provider) != null; + return getInputURI(service) != null; } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordFinder.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordFinder.java 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordFinder.java 2005/09/14 22:06:55 1.3 @@ -12,15 +12,15 @@ public class KeywordFinder { /** - * The MOBY provider for which to find keywords + * The MOBY service for which to find keywords */ - private MOBYProvider provider; + private MOBYService service; /** - * The underlying Jena model on which the MOBY provider + * The underlying Jena model on which the MOBY service * is based */ - private Model providerModel; + private Model serviceModel; /** * A keyword list object to hold the keywords that are @@ -29,17 +29,17 @@ private KeywordList keywords = null; /** - * Construct an instance for the given provider and model + * Construct an instance for the given service and model */ - public KeywordFinder(MOBYProvider provider, Model providerModel) + public KeywordFinder(MOBYService service) { - this.provider = provider; - this.providerModel = providerModel; + this.service = service; + this.serviceModel = service.getJenaModel(); } /** * Retrieve, if necessary, and return the keywords associated - * with the provider. + * with the service. */ public KeywordList getKeywords() throws Exception @@ -53,21 +53,20 @@ } /** - * Collect keywords for the provider + * Collect keywords for the service */ private void collectKeywords() { - // Add keywords from classes that the provider is asserted to - // be an instance of (i.e. provider rdf:type ) + // Add keywords from classes that the service is asserted to + // be an instance of (i.e. service rdf:type ) // - Resource res = provider.getResource(); - keywords.addProviderKeywords(getKeywordsFor(res)); + Resource res = service.getResource(); + keywords.addServiceKeywords(getKeywordsFor(res)); // Add keywords from subjects and objects of each // operatesOn subgraph // - MOBYCollection coll = provider.getOperatesOn(); - for (Iterator it = coll.iterator(); it.hasNext();) + for (Iterator it = service.getOperatesOn(); it.hasNext();) { MOBYGraphNode node = (MOBYGraphNode) it.next(); addGraphKeywordsFor(node); @@ -104,10 +103,11 @@ MOBYSubject subject = (MOBYSubject) node; keywords.addSubjectKeywords( getKeywordsFor(subject.getResource())); - Iterator it = subject.getDirectMappings().iterator(); + Iterator it = subject.getDirectMappings(); while (it.hasNext()) { - MOBYGraphNode node2 = (MOBYGraphNode) it.next(); + Object obj = it.next(); + MOBYGraphNode node2 = (MOBYGraphNode) obj; addObjectKeywordsFor(node2); } } @@ -123,6 +123,11 @@ } } + // TODO: Note that in some cases, this doesn't work, + // when node is a MOBYObject that has no defining + // statement (see the discussion in the class doc for + // its parent class MappingObject). So, this as well + // as addSubjectKeywordsFor() needs to be fixed private void addObjectKeywordsFor(MOBYGraphNode node) { if (node instanceof MOBYObject) @@ -153,9 +158,9 @@ // Iterate over the resource's rdf:type properties // - StmtIterator it = providerModel.listStatements( - res, RDF.type, (RDFNode) null); - + StmtIterator it = + serviceModel.listStatements(res, RDF.type, (RDFNode) null); + while (it.hasNext()) { Statement s1 = it.nextStatement(); @@ -163,7 +168,7 @@ // If the value of the rdf:type property is a resource // - if (node.canAs(Resource.class)) + if ((res != null) && (node.canAs(Resource.class))) { Resource classNode = (Resource) node.as(Resource.class); @@ -188,7 +193,7 @@ } } - if (res.canAs(Bag.class)) + if ((res != null) && (res.canAs(Bag.class))) { Bag bag = (Bag) res.as(Bag.class); for (Iterator it2 = bag.iterator(); it2.hasNext();) @@ -236,40 +241,4 @@ return list; } - - public static void main(String[] args) - throws Exception - { - Model model = ModelFactory.createDefaultModel(); -// model.read("http://brebiou.cshl.org:8080/get-individuals"); - model.read("http://www.semanticmoby.org/examples/hello-world"); - Parser parser = new Parser(model); - MOBYProvider provider = parser.parseProvider(); - KeywordFinder kf = new KeywordFinder(provider, model); - KeywordList list = kf.getKeywords(); - - System.out.print("Provider keywords: "); - for (Iterator it = list.getProviderKeywords(); it.hasNext();) { - System.out.print("\""); - System.out.print(it.next().toString()); - System.out.print("\" "); - } - System.out.println(); - - System.out.print("Subject keywords: "); - for (Iterator it = list.getSubjectKeywords(); it.hasNext();) { - System.out.print("\""); - System.out.print(it.next().toString()); - System.out.print("\" "); - } - System.out.println(); - - System.out.print("Object keywords: "); - for (Iterator it = list.getObjectKeywords(); it.hasNext();) { - System.out.print("\""); - System.out.print(it.next().toString()); - System.out.print("\" "); - } - System.out.println(); - } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordList.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordList.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordList.java 2005/09/14 22:06:55 1.2 @@ -6,20 +6,20 @@ public class KeywordList { - private Set providerKeywords = new HashSet(); + private Set serviceKeywords = new HashSet(); private Set subjectKeywords = new HashSet(); private Set objectKeywords = new HashSet(); - public void addProviderKeyword(String keyword) { - providerKeywords.add(keyword); + public void addServiceKeyword(String keyword) { + serviceKeywords.add(keyword); } - public void addProviderKeywords(List keywords) { - providerKeywords.addAll(keywords); + public void addServiceKeywords(List keywords) { + serviceKeywords.addAll(keywords); } - public Iterator getProviderKeywords() { - return providerKeywords.iterator(); + public Iterator getServiceKeywords() { + return serviceKeywords.iterator(); } public void addSubjectKeyword(String keyword) { =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/URIInvestigator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/URIInvestigator.java 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/URIInvestigator.java 2005/09/14 22:06:55 1.3 @@ -16,7 +16,7 @@ import com.hp.hpl.jena.rdf.model.Model; /** - * This class is used to investigate URIs that potentially contain MOBY graphs. + * This class is used to investigate URLs that potentially contain MOBY graphs. * Multiple instances can exist, each investigating a different URL. Keeping a * map of URL->instance mappings in the instances class variable is a simple * way to prevent multiple instances from investigating the same URL at any one @@ -36,7 +36,7 @@ * The URL that is to be investigated for possible inclusion in the * metadata repository. */ - private String providerURI; + private String serviceURL; private final static Log syncLog = LogFactory.getLog("SYNC"); @@ -47,17 +47,17 @@ * investigated, then this call is a NO-OP. * @param providerURL the URL to investigate */ - public synchronized static void investigate(String providerURL) + public synchronized static void investigate(String serviceURL) { synchronized (instances) { - if (instances.get(providerURL) != null) { - syncLog.warn("Already investigating " + providerURL); + if (instances.get(serviceURL) != null) { + syncLog.warn("Already investigating " + serviceURL); return; } - URIInvestigator investigator = new URIInvestigator(providerURL); - instances.put(providerURL, investigator); + URIInvestigator investigator = new URIInvestigator(serviceURL); + instances.put(serviceURL, investigator); investigator.start(); } } @@ -66,9 +66,9 @@ * Create an instance for investingating the given provider URL * @param providerURL the URL to investigate */ - private URIInvestigator(String providerURL) + private URIInvestigator(String serviceURL) { - this.providerURI = providerURL; + this.serviceURL = serviceURL; } /** @@ -108,7 +108,7 @@ // synchronized (instances) { - instances.remove(providerURI); + instances.remove(serviceURL); } } } @@ -137,18 +137,20 @@ boolean alreadyRegistered = false; try { - lastModifiedDate = manager.getLastModifiedDate(providerURI); + lastModifiedDate = manager.getLastModifiedDate(serviceURL); alreadyRegistered = (lastModifiedDate != null); } catch (StorageException e) { - syncLog.error("Couldn't check for last modified date of provider URL " + providerURI, e); + syncLog.error( + "Couldn't check for last modified date of provider URL " + + serviceURL, e); return; } // Helper class for making the HTTP GET call // - HTTPRequest request = HTTPRequest.newGetRequest(providerURI); + HTTPRequest request = HTTPRequest.newGetRequest(serviceURL); // If there was a last modified date, then request that the graph only // be sent if it has been modified since that date @@ -170,7 +172,7 @@ } catch (HTTPException e) { - syncLog.warn("Couldn't reach suggested provider " + providerURI); + syncLog.warn("Couldn't reach suggested provider " + serviceURL); return; } @@ -181,7 +183,7 @@ // The resource has not been modified since it was // registered, so there is nothing to do but log a message. // - syncLog.info("IN-SYNC : " + providerURI); + syncLog.info("IN-SYNC : " + serviceURL); break; case HttpServletResponse.SC_NOT_FOUND: @@ -190,9 +192,9 @@ // from the database. // if (alreadyRegistered) { - deregisterProvider(manager, true); + deregisterService(manager, true); } else { - syncLog.info("IGNORED : " + providerURI + " doesn't exist"); + syncLog.info("IGNORED : " + serviceURL + " doesn't exist"); } break; @@ -203,11 +205,12 @@ // lastModifiedDate = null; - // Try to parse the Last-Modified header to store in the database + // Try to parse the Last-Modified header to store in the DB // String dateString = ""; try { - dateString = response.getHeaderValue(MOBY.LAST_MODIFIED_HEADER); + dateString = + response.getHeaderValue(MOBY.LAST_MODIFIED_HEADER); lastModifiedDate = DateParser.parseDate(dateString); } catch (HTTPException e) @@ -216,7 +219,7 @@ // retrievable, but register the graph anyway // syncLog.warn("Unable to get Last-Modified date for " - + providerURI + "; using current date"); + + serviceURL + "; using current date"); lastModifiedDate = new Date(); } catch (Throwable t) @@ -224,8 +227,9 @@ // Log a message about the last modified date not being // parsable, but register the graph anyway // - syncLog.warn("Unparsable Last-Modified date " + "(\"" + dateString + - "\") for " + providerURI + "; ignoring"); + syncLog.warn( + "Unparsable Last-Modified date " + "(\"" + dateString + + "\") for " + serviceURL + "; ignoring"); } // The client sent back a graph; so try to parse it. If the @@ -238,38 +242,41 @@ } catch (HTTPException e) { - syncLog.error("Couldn't retrieve graph from " + providerURI); + syncLog.error("Couldn't retrieve graph from " + serviceURL); return; } - MOBYProvider provider = null; + MOBYService service = null; try { Parser parser = Parser.forInputStream(in, Parser.LANGUAGE_RDF_XML); - provider = parser.parseProvider(); + service = parser.parseService(); } catch (Throwable t) { System.err.println("Parse error: " + t); } // De-register the provider, printing a removal message if - // a provider couldn't be parsed + // a service couldn't be parsed // - deregisterProvider(manager, provider==null); + deregisterService(manager, service==null); - // If a provider was parsed, then register it + // If a service was parsed, then register it // - if (provider != null) + if (service != null) { try { - manager.registerProvider(provider, lastModifiedDate); + manager.registerProvider(service, lastModifiedDate); // Log a message about successfully registering the graph: // - syncLog.info((alreadyRegistered ? "UPDATED : " : "ADDED : ") + providerURI); + syncLog.info( + (alreadyRegistered ? "UPDATED : " : "ADDED : ") + + serviceURL); } catch (StorageException e) { - syncLog.error("Error storing graph for " + providerURI, e); + syncLog.error( + "Error storing graph for " + serviceURL, e); } } @@ -280,21 +287,21 @@ // Log a message about the failed attempt to contact the URL // syncLog.error("Status " + status + " received while trying " + - "to contact provider " + providerURI); + "to contact provider " + serviceURL); break; } } - private void deregisterProvider(StorageManager manager, boolean removing) + private void deregisterService(StorageManager manager, boolean removing) { try { - manager.deregisterProvider(providerURI); + manager.deregisterProvider(serviceURL); if (removing) { - syncLog.info("REMOVED : " + providerURI); + syncLog.info("REMOVED : " + serviceURL); } } catch (StorageException e) { - syncLog.error("Unable to de-register provider " + providerURI, e); + syncLog.error("Unable to de-register provider " + serviceURL, e); } } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordQuery.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordQuery.java 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordQuery.java 2005/09/14 22:06:55 1.3 @@ -44,7 +44,7 @@ while (rs.next()) { String uri = rs.getString("provider_uri"); - MOBYProvider provider = providerAt(uri, model); + MOBYService provider = serviceAt(uri, model); if (provider != null) { matching.add(provider); } @@ -65,7 +65,7 @@ return matching; } - private MOBYProvider providerAt(String uri, Model model) + private MOBYService serviceAt(String uri, Model model) { Model providerModel = ModelFactory.createDefaultModel(); Resource provider = providerModel.createResource(uri); @@ -74,7 +74,7 @@ try { Parser parser = new Parser(providerModel); - return parser.parseProvider(); + return parser.parseService(); } catch (Throwable t) { return null; } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/DiscoveryQuery.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/DiscoveryQuery.java 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/DiscoveryQuery.java 2005/09/14 22:06:55 1.3 @@ -46,7 +46,7 @@ /** * The graph that serves as a template for providers that match. */ - private MOBYProvider queryProvider; + private MOBYService queryProvider; /** * Flag indicating which statements should be returned: URI_ONLY, @@ -65,17 +65,17 @@ */ private int lastBnodeNumber; - public static DiscoveryQuery newMinimalStmtsQuery(MOBYProvider provider) + public static DiscoveryQuery newMinimalStmtsQuery(MOBYService provider) { return new DiscoveryQuery(provider, MINIMAL_STMTS); } - public static DiscoveryQuery newQueryStmtsQuery(MOBYProvider provider) + public static DiscoveryQuery newQueryStmtsQuery(MOBYService provider) { return new DiscoveryQuery(provider, QUERY_STMTS); } - public static DiscoveryQuery newReachableStmtsQuery(MOBYProvider provider) + public static DiscoveryQuery newReachableStmtsQuery(MOBYService provider) { return new DiscoveryQuery(provider, REACHABLE_STMTS); } @@ -87,7 +87,7 @@ * @param statementsToReturn which statements should be returned: URI_ONLY, * QUERY_STMTS_ONLY, or ALL_STMTS (use the static constants on this class). */ - private DiscoveryQuery(MOBYProvider queryProvider, int statementsToReturn) + private DiscoveryQuery(MOBYService queryProvider, int statementsToReturn) { this.queryProvider = queryProvider; this.statementsToReturn = statementsToReturn; @@ -103,14 +103,14 @@ lastBnodeNumber = 0; } - public MOBYProviderSet findMatchingGraphs() + public MOBYServiceSet findMatchingGraphs() { init(); Model dbModel = null; try { - Model queryModel = ((MOBYProvider) queryProvider).getModel(); + Model queryModel = ((MOBYService) queryProvider).getJenaModel(); String queryString = buildQueryString(queryModel); StorageManager manager = new StorageManager(); dbModel = manager.openDBModel(); @@ -128,14 +128,14 @@ } results.close(); - MOBYProviderSet returnSet = new MOBYProviderSet(); + MOBYServiceSet returnSet = new MOBYServiceSet(); for (Iterator it = matching.iterator(); it.hasNext();) { Object next = it.next(); - MOBYProvider mp = buildGraphModel(dbModel, + MOBYService mp = buildGraphModel(dbModel, queryModel, (ResultBinding) next); - returnSet.addProvider(mp); + returnSet.addService(mp); } return returnSet; @@ -244,8 +244,9 @@ * @param binding bindings for variables * @return */ - private MOBYProvider buildGraphModel( + private MOBYService buildGraphModel( Model dbModel, Model queryModel, ResultBinding binding) + throws NonCanonicalException { // Create a default model to return // @@ -279,7 +280,7 @@ // Parse and return a MOBY provider using the adjusted model // Parser parser = new Parser(adjusted); - return parser.parseProvider(); + return parser.parseService(); } /** @@ -319,7 +320,7 @@ // try { Statement providerTypeStmt = original.listStatements( - null, RDF.type, MOBY.Provider).nextStatement(); + null, RDF.type, MOBY.Service).nextStatement(); minimal.add(providerTypeStmt); Resource subject = providerTypeStmt.getSubject(); @@ -370,7 +371,7 @@ // try { Statement providerTypeStmt = original.listStatements( - null, RDF.type, MOBY.Provider).nextStatement(); + null, RDF.type, MOBY.Service).nextStatement(); Resource subject = providerTypeStmt.getSubject(); Util.addReachableStmts(dbModel, reachable, subject, subject.getURI()); } From gss at pub.open-bio.org Wed Sep 14 18:06:55 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:55 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6tpn017240@pub.open-bio.org> gss Wed Sep 14 18:06:55 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev In directory pub.open-bio.org:/tmp/cvs-serv17172/src/org/semanticmoby/ref/servlets/dev Modified Files: MOBYGraphValidationServlet.java ProviderListServlet.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev MOBYGraphValidationServlet.java,1.1,1.2 ProviderListServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/MOBYGraphValidationServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/MOBYGraphValidationServlet.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/MOBYGraphValidationServlet.java 2005/09/14 22:06:55 1.2 @@ -1,6 +1,7 @@ package org.semanticmoby.ref.servlets.dev; import org.semanticmoby.graph.*; +import org.semanticmoby.parser.NonCanonicalException; import org.semanticmoby.parser.Parser; import org.semanticmoby.ref.servlets.BaseServlet; import org.semanticmoby.servlet.*; @@ -28,18 +29,18 @@ StringReader reader = new StringReader(graphString); baseModel.read(reader, null); Parser parser = new Parser(baseModel); - parser.parseProvider(); + parser.parseService(); out.println("Model is canonical"); } catch (ParameterException e) { response.sendError(HttpServletResponse.SC_NOT_ACCEPTABLE, e.getMessage()); } -// catch (NonCanonicalException e) -// { -// out.println("Model failed canonicality test:"); -// out.println(e); -// } + catch (NonCanonicalException e) + { + out.println("Model failed canonicality test:"); + out.println(e); + } catch (IllegalArgumentException e) {} } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/ProviderListServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/ProviderListServlet.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/ProviderListServlet.java 2005/09/14 22:06:55 1.2 @@ -23,7 +23,7 @@ Model dbModel = manager.openDBModel(); int count = 0; StmtIterator it = dbModel.listStatements( - null, RDF.type, MOBY.Provider); + null, RDF.type, MOBY.Service); while (it.hasNext()) { Statement stmt = it.nextStatement(); From gss at pub.open-bio.org Wed Sep 14 18:06:56 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6uZY017260@pub.open-bio.org> gss Wed Sep 14 18:06:55 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/db In directory pub.open-bio.org:/tmp/cvs-serv17172/src/org/semanticmoby/ref/tools/db Modified Files: StorageManager.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/db StorageManager.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/db/StorageManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/db/StorageManager.java 2005/03/21 21:42:02 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/db/StorageManager.java 2005/09/14 22:06:55 1.3 @@ -52,16 +52,16 @@ * are in the provider graph's namespace will be stored in the global repository, * and all statements from the provider graph are stored in a separate model * that has as its name the fully expanded URI of the provider. - * @param provider the Provider to store + * @param service the Provider to store * @param lastModifiedDate when the graph was last modified * @throws StorageException if unable to access the database */ - public void registerProvider(MOBYProvider provider, Date lastModifiedDate) + public void registerProvider(MOBYService service, Date lastModifiedDate) throws StorageException { - Model model = ((MOBYProvider) provider).getModel(); + Model model = service.getJenaModel(); Model dbModel = null; - String uriString = provider.getResource().getURI(); + String uriString = service.getResource().getURI(); Resource uri = model.createResource(uriString); try @@ -103,8 +103,8 @@ // Add keywords associated with the provider // - KeywordFinder finder = new KeywordFinder(provider, model); - addKeywords(provider.getResource().getURI(), + KeywordFinder finder = new KeywordFinder(service); + addKeywords(service.getResource().getURI(), finder.getKeywords(), dbModel); // Commit the transaction on the database model @@ -134,7 +134,7 @@ java.sql.Statement sql = conn.createStatement(); - doAddKeywords(providerURI, list.getProviderKeywords(), "P", sql); + doAddKeywords(providerURI, list.getServiceKeywords(), "P", sql); doAddKeywords(providerURI, list.getSubjectKeywords(), "S", sql); doAddKeywords(providerURI, list.getObjectKeywords(), "O", sql); From gss at pub.open-bio.org Wed Sep 14 18:06:56 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6uRt017287@pub.open-bio.org> gss Wed Sep 14 18:06:55 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets In directory pub.open-bio.org:/tmp/cvs-serv17172/src/org/semanticmoby/ref/servlets Modified Files: DiscoveryServlet.java KeywordSearchServlet.java ResultsDisplayServlet.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets DiscoveryServlet.java,1.1,1.2 KeywordSearchServlet.java,1.2,1.3 ResultsDisplayServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/DiscoveryServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/DiscoveryServlet.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/DiscoveryServlet.java 2005/09/14 22:06:55 1.2 @@ -44,7 +44,7 @@ // Parse the query graph into a MOBYGraph object // Parser parser = Parser.forString(graphString, Parser.LANGUAGE_RDF_XML); - MOBYProvider provider = parser.parseProvider(); + MOBYService service = parser.parseService(); // Find which statements the user wishes to have returned // @@ -59,14 +59,14 @@ DiscoveryQuery q = null; if (statements.equalsIgnoreCase("minimal")) { - q = DiscoveryQuery.newMinimalStmtsQuery(provider); + q = DiscoveryQuery.newMinimalStmtsQuery(service); } else if (statements.equalsIgnoreCase("query")) { - q = DiscoveryQuery.newQueryStmtsQuery(provider); + q = DiscoveryQuery.newQueryStmtsQuery(service); } else { - q = DiscoveryQuery.newReachableStmtsQuery(provider); + q = DiscoveryQuery.newReachableStmtsQuery(service); } - MOBYProviderSet matching = q.findMatchingGraphs(); + MOBYServiceSet matching = q.findMatchingGraphs(); if ((matching == null) || (matching.size() == 0)) { =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java 2005/03/21 21:42:02 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java 2005/09/14 22:06:55 1.3 @@ -60,7 +60,7 @@ { for (Iterator it = matching.iterator(); it.hasNext();) { - MOBYProvider p = (MOBYProvider) it.next(); + MOBYService p = (MOBYService) it.next(); showProvider(p, out); } } @@ -171,7 +171,7 @@ /** * Show a provider that matches the keyword search criteria. */ - private void showProvider(MOBYProvider provider, PrintStream out) + private void showProvider(MOBYService provider, PrintStream out) { String uri = provider.getResource().getURI(); String name = provider.getName(); =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/ResultsDisplayServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/ResultsDisplayServlet.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/ResultsDisplayServlet.java 2005/09/14 22:06:55 1.2 @@ -5,7 +5,7 @@ import javax.servlet.*; import javax.servlet.http.*; -import org.semanticmoby.graph.MOBYProvider; +import org.semanticmoby.graph.MOBYService; import org.semanticmoby.parser.Parser; import org.semanticmoby.ref.tools.*; import org.semanticmoby.servlet.*; @@ -27,14 +27,14 @@ MOBY.GRAPH_PARAMETER_NAME, request); Parser parser = Parser.forString( graphString, Parser.LANGUAGE_RDF_XML); - MOBYProvider provider = parser.parseProvider(); + MOBYService service = parser.parseService(); response.setContentType("text/html"); startHTML(response, "Semantic MOBY results display", out); InvocationBroker broker = new InvocationBroker(this, request, response, out); - broker.buildOutputGUI(provider); + broker.buildOutputGUI(service); finishHTML(out); } catch (Throwable t) From gss at pub.open-bio.org Wed Sep 14 18:06:56 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6uXH017310@pub.open-bio.org> gss Wed Sep 14 18:06:56 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/example In directory pub.open-bio.org:/tmp/cvs-serv17172/src/org/semanticmoby/ref/servlets/example Modified Files: HelloWorldServlet.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/example HelloWorldServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/example/HelloWorldServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/example/HelloWorldServlet.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/example/HelloWorldServlet.java 2005/09/14 22:06:56 1.2 @@ -26,24 +26,21 @@ return getFileReader(DESCRIPTION_GRAPH_FILE); } - protected void handleRequest(MOBYProvider provider) + protected void handleRequest(MOBYService service) { try { - MOBYGraph graph = (MOBYGraph) - provider.getOperatesOn().iterator().next(); + MOBYGraph graph = (MOBYGraph) service.getOperatesOn().next(); MOBYSubject subject = (MOBYSubject) graph.getHasMapping(); MOBYObject object = (MOBYObject) - subject.getDirectMappings().iterator().next(); + subject.getDirectMappings().next(); - MOBYPropertyValueStatement stmt = (MOBYPropertyValueStatement) - object.getPropertyValueStatements().iterator().next(); + MOBYPropValStmt stmt = (MOBYPropValStmt) + object.getPropValStmts().iterator().next(); - stmt.setPropertyValue( - new MOBYLiteral("Hello, world!")); - + stmt.getDefiningStmt().changeObject("Hello, world!"); } // Silently ignore graphs without the required form catch (Throwable t) {} From gss at pub.open-bio.org Wed Sep 14 18:06:56 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6uk3017329@pub.open-bio.org> gss Wed Sep 14 18:06:56 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org In directory pub.open-bio.org:/tmp/cvs-serv17172 Modified Files: .mymetadata Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org .mymetadata,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/.mymetadata,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/.mymetadata 2005/03/21 21:40:30 1.4 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/.mymetadata 2005/09/14 22:06:56 1.5 @@ -1,13 +1,13 @@ - + - - - - - + type="WEB" + name="semanticmoby.org" + id="myeclipse.1109704976982" + context-root="/semanticmoby.org" + j2ee-spec="1.4" + archive="semanticmoby.org.war"> + + + + + From gss at pub.open-bio.org Wed Sep 14 18:06:57 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6v6q017373@pub.open-bio.org> gss Wed Sep 14 18:06:57 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org In directory pub.open-bio.org:/tmp/cvs-serv17344 Modified Files: .mymetadata .classpath Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org .mymetadata,1.1,1.2 .classpath,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.mymetadata,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.mymetadata 2005/01/26 18:51:47 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.mymetadata 2005/09/14 22:06:57 1.2 @@ -1,13 +1,13 @@ - + - - - - - + type="WEB" + name="brebiou.cshl.org" + id="myeclipse.1089924010313" + context-root="/brebiou.cshl.org" + j2ee-spec="1.3" + archive="brebiou.cshl.org.war"> + + + + + =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.classpath,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.classpath 2005/01/26 18:51:47 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.classpath 2005/09/14 22:06:57 1.2 @@ -4,21 +4,16 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + From gss at pub.open-bio.org Wed Sep 14 18:06:57 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6vPP017396@pub.open-bio.org> gss Wed Sep 14 18:06:57 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv17344/WebRoot Modified Files: get-individuals.rdf get-individuals.n3 Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot get-individuals.rdf,1.1,1.2 get-individuals.n3,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.rdf,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.rdf 2005/01/26 18:51:48 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.rdf 2005/09/14 22:06:57 1.2 @@ -6,29 +6,30 @@ xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > + + + + + + http://brebiou.cshl.org:8080/get-individuals.html - Retrieve all individuals for a panel - + get-individuals - - - + + + - - + + - - + + - - - - \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.n3,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.n3 2005/01/26 18:51:48 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.n3 2005/09/14 22:06:57 1.2 @@ -7,7 +7,7 @@ @prefix cshlterms: . cshl:get-individuals - a moby:Provider ; + a moby:Service ; moby:name "get-individuals" ; moby:oneLineDescription "Retrieve all individuals for a panel" ; moby:inputURI "http://brebiou.cshl.org:8080/get-individuals.html" ; @@ -19,7 +19,7 @@ moby:mapsTo [ a rdf:Bag ; rdf:_1 [ - a cshlterms:Individual ; + a moby:Object, cshlterms:Individual ; cshlterms:individualName [] ] ] From gss at pub.open-bio.org Wed Sep 14 18:06:57 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6vt1017416@pub.open-bio.org> gss Wed Sep 14 18:06:57 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/src/org/cshl/servlets In directory pub.open-bio.org:/tmp/cvs-serv17344/src/org/cshl/servlets Modified Files: GetIndividualsServlet.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/src/org/cshl/servlets GetIndividualsServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/src/org/cshl/servlets/GetIndividualsServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/src/org/cshl/servlets/GetIndividualsServlet.java 2005/01/26 18:51:48 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/src/org/cshl/servlets/GetIndividualsServlet.java 2005/09/14 22:06:57 1.2 @@ -40,14 +40,13 @@ /** * Fill a rdf:Bag with Individual instances, given a panel name */ - protected void handleRequest(MOBYProvider provider) + protected void handleRequest(MOBYService provider) { try { // The provider operates on a single moby:Graph; retrieve it // - MOBYGraph graph = (MOBYGraph) - provider.getOperatesOn().iterator().next(); + MOBYGraph graph = (MOBYGraph) provider.getOperatesOn().next(); // The subject of the graph should be a moby:Subject; retrieve it // @@ -55,13 +54,13 @@ // Retrieve the statement that sets a value for the panelName property // - MOBYPropertyValueStatement stmt = (MOBYPropertyValueStatement) - subject.getPropertyValueStatements().iterator().next(); + MOBYPropValStmt pvStmt = (MOBYPropValStmt) + subject.getPropValStmts().iterator().next(); + Statement stmt = pvStmt.getDefiningStmt(); // Retrieve the panel name from the statement - // - MOBYLiteral literal = (MOBYLiteral) stmt.getValue(); - String panelName = literal.getStringValue(); + Literal lit = (Literal) stmt.getObject(); + String panelName = lit.getString(); // Get an iterator over the individual names for the panel // in order to populate the Bag of results @@ -77,8 +76,7 @@ // Empty the Bag that contains the example Individual // - MOBYObject object = (MOBYObject) subject.getDirectMappings() - .iterator().next(); + MOBYObject object = (MOBYObject) subject.getDirectMappings().next(); Resource res = object.getResource(); Model model = res.getModel(); Bag bag = (Bag) res.as(Bag.class); From gordonp at pub.open-bio.org Wed Sep 14 16:06:49 2005 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Wed, 14 Sep 2005 16:06:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142006.j8EK6n89016329@pub.open-bio.org> gordonp Wed Sep 14 16:06:49 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory pub.open-bio.org:/tmp/cvs-serv16304 Modified Files: MobyDataComposite.java Log Message: Fixed typo moby-live/Java/src/main/org/biomoby/shared/data MobyDataComposite.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java 2005/08/15 17:41:41 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java 2005/09/14 20:06:49 1.5 @@ -115,7 +115,7 @@ StringBuffer instanceXML = new StringBuffer(); // Open tag - instanceXML.append("<"+getDataType().getName()+ + instanceXML.append("<"+getDataType().getName()+" "+ getAttrXML() + ">\n"); //getAttrXML defined in super // Add the info blocks if available From fgibbons at pub.open-bio.org Fri Sep 16 12:36:39 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 16 Sep 2005 12:36:39 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161636.j8GGadFC023705@pub.open-bio.org> fgibbons Fri Sep 16 12:36:39 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv23680/t Modified Files: Client-Central.t Log Message: - Relationships property works now, remove from TODO. retrieveObjectSchema not implemented, put on TODO list. moby-live/Perl/t Client-Central.t,1.41,1.42 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Central.t,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- /home/repository/moby/moby-live/Perl/t/Client-Central.t 2005/09/01 13:50:46 1.41 +++ /home/repository/moby/moby-live/Perl/t/Client-Central.t 2005/09/16 16:36:39 1.42 @@ -61,7 +61,7 @@ my @mandatory = qw/findService retrieveService retrieveResourceURLs retrieveServiceProviders retrieveServiceNames retrieveServiceTypes retrieveObjectNames retrieveObjectDefinition -retrieveNamespaces retrieveObjectSchema Relationships/; +retrieveNamespaces Relationships/; my @mandatory_if_write_access = qw/registerObjectClass deregisterObjectClass registerServiceType deregisterServiceType @@ -80,6 +80,12 @@ can_ok($C, @optional_recommended) or diag("Registry does not supply certain optional methods;\n" . "you should consider adding them"); + +TODO: { + local $TODO = "Method 'retrieveObjectSchema yet to be implemented"; + can_ok($C, "retrieveObjectSchema") + or diag("Registry should be able to return Object Schema"); +} ################## MOBY Registration Tests ################# ################## OBJECT REGISTRATION ############# @@ -154,11 +160,8 @@ or diag("Relationships didn't return a hashref for object types") ; isa_ok( $r->{'isa'}, 'ARRAY') or diag("Relationships didn't return a hash of arrayrefs"); -TODO: { - local $TODO = "Objects don't correctly prepend LSID"; - is(shift @{$r->{'isa'}}, "Object") - or diag("Relationships(objectType) doesn't have the right parentage."); -} +is(shift @{$r->{'isa'}}, "Object") + or diag("Relationships(objectType) doesn't have the right parentage."); $r = $C->Relationships(serviceType => $ServiceType{serviceType}); isa_ok($r, "HASH", "Relationship types hash") @@ -166,12 +169,9 @@ #print STDERR "\n\n\nkeys ",(keys %rel), "\n\n\n"; isa_ok($r->{'isa'}, 'ARRAY') or diag("Relationships didn't return a hash of arrayrefs for services"); -TODO: { - local $TODO = "Objects don't correctly prepend LSID"; - is(shift @{$r->{'isa'}}, - $ServiceType{Relationships}->{ISA}->[0]) - or diag("Relationships (serviceType) doesn't have the right parentage."); -} +is(shift @{$r->{'isa'}}, + $ServiceType{Relationships}->{ISA}->[0]) + or diag("Relationships (serviceType) doesn't have the right parentage."); ############# SERVICE INSTANCE REGISTRATION ########### # Set up a service registration hash. We'll mess with it piece by piece in the next several tests, @@ -498,11 +498,8 @@ $r = $C->retrieveObjectDefinition(objectType => $Obj{objectType}); isa_ok($r , "HASH", "Object definition returns hashref") or diag("Object definition did not return as a hashref") ; -TODO: { - local $TODO = "Objects don't correctly prepend LSID"; - is($r->{objectType}, $Obj{objectType}, "Object reporting correct type") - or diag("Object definition did not report correct type"); -} +is($r->{objectType}, $Obj{objectType}, "Object reporting correct type") + or diag("Object definition did not report correct type"); is($r->{description}, $Obj{description}, "Object reporting correct desccription") or diag("Object definition did not report correct desc"); @@ -529,15 +526,12 @@ or diag("Object didn't return an array of arrays for its ISA relationships"); isa_ok($hasa, 'ARRAY', "") or diag("Object didn't return an array of arrays for its HASA relationships"); -TODO: { - local $TODO = "Objects don't correctly prepend LSID prefix"; - is(${$isa}[0], $Obj{Relationships}->{ISA}->[0]->[0]) or diag("ISA reporting wrong object type"); - is(${$isa}[1], $Obj{Relationships}->{ISA}->[0]->[1]) or diag("ISA reporting wrong object name"); - is(${$hasa}[0], $Obj{Relationships}->{HASA}->[0]->[0]) or diag("HASA reporting wrong object type"); - is(${$hasa}[1], $Obj{Relationships}->{HASA}->[0]->[1]) or diag("HASA reporting wrong object name"); - is($r->{objectLSID}, "urn:lsid:biomoby.org:objectclass:" . $Obj{objectType}) - or diag("Object class LSID reported incorrectly"); -} +is(${$isa}[0], $Obj{Relationships}->{ISA}->[0]->[0]) or diag("ISA reporting wrong object type"); +is(${$isa}[1], $Obj{Relationships}->{ISA}->[0]->[1]) or diag("ISA reporting wrong object name"); +is(${$hasa}[0], $Obj{Relationships}->{HASA}->[0]->[0]) or diag("HASA reporting wrong object type"); +is(${$hasa}[1], $Obj{Relationships}->{HASA}->[0]->[1]) or diag("HASA reporting wrong object name"); +is($r->{objectLSID}, "urn:lsid:biomoby.org:objectclass:" . $Obj{objectType}) + or diag("Object class LSID reported incorrectly"); $r = $C->retrieveNamespaces(); From fgibbons at pub.open-bio.org Fri Sep 16 12:38:15 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 16 Sep 2005 12:38:15 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161638.j8GGcFTB023739@pub.open-bio.org> fgibbons Fri Sep 16 12:38:15 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv23713/t Modified Files: Client-OntologyServer.t Log Message: - TODO list updated: * "Everything" removed (I'm an optimist). * Can't set proxy to default value 'undef', once changed. * relationshipExists is not implemented, so it's SKIPped. (Leaving it on the TODO list creates error messages on 'make test') moby-live/Perl/t Client-OntologyServer.t,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/06 20:43:21 1.3 +++ /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/16 16:38:15 1.4 @@ -12,7 +12,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; #use SOAP::Lite +trace; -use Test::More 'no_plan'; # perldoc Test::More for details +use Test::More 'no_plan'; #skip_all => "Skipped for development"; #'no_plan'; # perldoc Test::More for details use strict; use MOBY::Client::OntologyServer; #Is the client-code even installed? @@ -23,19 +23,30 @@ }; -TODO: { - local $TODO = "Everything."; -} - my @autoload = qw/host proxy/; my @API = (@autoload, qw/new getUserAgent -objectExists serviceExists namespaceExists relationshipExists/); +objectExists serviceExists namespaceExists /); my $os = MOBY::Client::OntologyServer->new(); foreach (@autoload) {eval{$os->$_};} # Call all AUTOLOAD methods, to create them. can_ok("MOBY::Client::OntologyServer", @API) or diag("OntologyServer doesn't implement full API"); +# Check that accessor methods work correctly; +my ($old_host, $old_proxy) = ($os->host(), $os->proxy()); +my ($new_host, $new_proxy) = ("foo.cgi", "bar"); +is($os->host($new_host), $new_host) or diag("Couldn't set new host"); +is($os->host(), $new_host) or diag("Couldn't get host"); +is($os->host($old_host), $old_host) or diag("Couldn't return host to previous value"); + is($os->proxy($new_proxy), $new_proxy) or diag("Couldn't set proxy to new value"); + is($os->proxy(), $new_proxy) or diag("Couldn't get proxy"); +TODO: { + local $TODO = "How come I cant' set proxy back to its original value?"; + is($os->proxy($old_proxy), $old_proxy) or diag("Couldn't return proxy to previous value"); +} + +# Start fresh.... +$os = MOBY::Client::OntologyServer->new(); ################ CHECK THAT VALID STUFF RETURNS CORRECTLY ########## # # It would really be better not to have literal lists of valid namespaces here, @@ -69,14 +80,23 @@ or diag("Service type '$_' reported erroneously as non-existent."); } -TODO: { - local $TODO = "Fix whatever is broken with these relationship types - or else fix this test."; +SKIP: { + skip "relationshipExists not implemented", 5 + unless MOBY::Client::OntologyServer->can("relationshipExists"); + + can_ok("MOBY::Client::OntologyServer", "relationshipExists") + or diag("OntologyServer should be able to tell whether a relationship exists"); my @check_rel = qw/ISA HASA HAS/; # There should only be very few valid relationship types. foreach (@check_rel) { ($success, $msg, $existingURI) = $os->relationshipExists(term => $_); is($success, 1) or diag("Relationship '$_' reported erroneously as non-existent."); } + + my $invalid_rel = "HA"; + ($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel); + is($success, 0) + or diag("Relationship '$invalid_rel' reported erroneously as existent."); } @@ -100,7 +120,3 @@ is($success, 0) or diag("Service type '$invalid_st' reported erroneously as existent."); -my $invalid_rel = "HA"; -($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel); -is($success, 0) - or diag("Relationship '$invalid_rel' reported erroneously as existent."); From fgibbons at pub.open-bio.org Fri Sep 16 12:38:47 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 16 Sep 2005 12:38:47 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161638.j8GGclPb023772@pub.open-bio.org> fgibbons Fri Sep 16 12:38:47 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv23747/t Modified Files: Client-Service.t Log Message: - Update to reflect new API. moby-live/Perl/t Client-Service.t,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Service.t,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/02 14:29:30 1.4 +++ /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/16 16:38:47 1.5 @@ -26,16 +26,12 @@ }; -my @autoload = qw/serviceName/; +my @autoload = qw/serviceName service uri smessageVersion _soapService/; my @API = (@autoload, qw/new execute/); my $service = MOBY::Client::Service->new(); is($service, undef) or diag("Created a new service without supplying any WSDL - it ain't right, I tell you!"); # Can't do nothing without WSDL -foreach (@autoload) { eval{$service->$_()}; } # Call all autoloads, to create them. -can_ok("MOBY::Client::Service", @API) - or diag("MOBY::Client::Service doesn't implement full API."); - # Find a service at MOBY Central, try to create a local instance. my $C = MOBY::Client::Central->new(); my ($s, $r) = $C->findService( authURI => 'www.illuminae.com', @@ -46,6 +42,10 @@ isa_ok($service, "MOBY::Client::Service") or diag("Expected new to return MOBY::Client::Service"); +foreach (@autoload) { eval{$service->$_()}; } # Call all autoloads, to create them. +can_ok("MOBY::Client::Service", @API) + or diag("MOBY::Client::Service doesn't implement full API."); + # Empty WSDL should cause 'undef' to be returned, rather than empty Service object. my $emptyWSDL = ""; is(MOBY::Client::Service->new ( service => $emptyWSDL), undef) From fgibbons at pub.open-bio.org Fri Sep 16 12:39:17 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 16 Sep 2005 12:39:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161639.j8GGdHiP023805@pub.open-bio.org> fgibbons Fri Sep 16 12:39:17 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv23780/t Modified Files: Client-SimpleArticle.t Log Message: - TODO list no longer contains 'Everything' moby-live/Perl/t Client-SimpleArticle.t,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t 2005/09/02 14:32:15 1.2 +++ /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t 2005/09/16 16:39:17 1.3 @@ -24,11 +24,6 @@ # Clean up after yourself, in case tests fail, or the interpreter is interrupted partway though... }; - -TODO: { - local $TODO = "Everything."; -} - my @autoload = qw/articleName objectType objectLSID namespaces id XML XML_DOM isSimple isCollection isSecondary/; my @API = (@autoload, qw/new addNamespace value /); # createFrom[XML|DOM] are not meant to be public From fgibbons at pub.open-bio.org Fri Sep 16 12:53:35 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 16 Sep 2005 12:53:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161653.j8GGrZtQ023874@pub.open-bio.org> fgibbons Fri Sep 16 12:53:35 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv23849/MOBY Modified Files: Config.pm Log Message: - Replace '||' with 'or' for correct behavior when file cannot be opened. moby-live/Perl/MOBY Config.pm,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Config.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Perl/MOBY/Config.pm 2005/08/02 15:18:00 1.8 +++ /home/repository/moby/moby-live/Perl/MOBY/Config.pm 2005/09/16 16:53:35 1.9 @@ -1,7 +1,6 @@ package MOBY::Config; -BEGIN { -} +BEGIN {} use strict; use Carp; use MOBY::dbConfig; @@ -15,7 +14,7 @@ #Encapsulated class data #___________________________________________________________ #ATTRIBUTES - my %_attr_data = # DEFAULT ACCESSIBILITY + my %_attr_data = # DEFAULT ACCESSIBILITY ( mobycentral => [ undef, 'read/write' ], mobyobject => [ undef, 'read/write' ], @@ -47,7 +46,7 @@ } } -# the expected sectionons (listed above) will have their dbCOnfig objects available +# the expected sections (listed above) will have their dbConfig objects available # as methods. The unexpected sections will have their dbConfig objects available # by $dbConfig = $CONFIG->{section_title} sub new { @@ -70,10 +69,9 @@ ( -e $file ) || die "MOBY Configuration file $file doesn't exist $!\n"; chomp $file; if ( ( -e $file ) && ( !( -d $file ) ) ) { - open IN, - $file - || die - "can't open MOBY Configuration file $file for unknown reasons$!\n"; + open IN, $file + or die + "can't open MOBY Configuration file $file for unknown reasons: $!\n"; } my @sections = split /(\[\s*\S+\s*\][^\[]*)/s, join "", ; @@ -97,14 +95,10 @@ sub getDataAdaptor { my ( $self, %args ) = @_; - my $source = $args{datasource}; - $source ||= $args{source}; - $source ||= "mobycentral"; + my $source = $args{datasource} || $args{source} || "mobycentral"; if ( $self->{"${source}Adaptor"} ) { return $self->{"${source}Adaptor"} } ; # read from cache - my $username = - $self->$source - ->{username}; # $self->$source returns a MOBY::dbConfig object + my $username = $self->$source->{username};# $self->$source returns a MOBY::dbConfig object my $password = $self->$source->{password}; my $port = $self->$source->{port}; my $dbname = $self->$source->{dbname}; From fgibbons at pub.open-bio.org Fri Sep 16 13:01:11 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 16 Sep 2005 13:01:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161701.j8GH1Bmq023927@pub.open-bio.org> fgibbons Fri Sep 16 13:01:11 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv23895/MOBY/Client Modified Files: Central.pm Log Message: - Clean up some regular expressions, make easier to read. - ref operator returns scalar (string), so we should use string comparison. - Remove redundant "Title" in docs. That's what =head2 is for. - Clean up setting default values using short-circuiting || operator. moby-live/Perl/MOBY/Client Central.pm,1.123,1.124 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.123 retrieving revision 1.124 diff -u -r1.123 -r1.124 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/08/31 22:32:27 1.123 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/09/16 17:01:10 1.124 @@ -55,6 +55,9 @@ be sufficient for most or all MOBY Client activities written in Perl. +=cut + + =head1 AUTHORS Mark Wilkinson (markw at illuminae.com) @@ -70,7 +73,6 @@ =head2 new - Title : new Usage : my $MOBY = MOBY::Client::Central->new(Registries => \%regrefs) Function : connect to one or more MOBY-Central registries for searching @@ -140,8 +142,7 @@ ( Connections => [ undef, 'read/write' ], default_MOBY_servername => [ 'mobycentral', 'read/write' ], - default_MOBY_server => [ - + default_MOBY_server => [ 'http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl', 'read/write' ], @@ -239,119 +240,119 @@ } sub new { - my ( $caller, %args ) = @_; - my $caller_is_obj = ref($caller); - return $caller if $caller_is_obj; - my $class = $caller_is_obj || $caller; - my $proxy; - my $self = bless {}, $class; - foreach my $attrname ( $self->_standard_keys ) { - if ( exists $args{$attrname} ) { - $self->{$attrname} = $args{$attrname}; - } - elsif ($caller_is_obj) { - $self->{$attrname} = $caller->{$attrname}; - } - else { - $self->{$attrname} = $self->_default_for($attrname); - } - } - $self->Connections( [] ); # initialize; - - # if user has set up preferred servers, then use those by default - $self->default_MOBY_server( $ENV{MOBY_SERVER} ) if $ENV{MOBY_SERVER}; - $self->default_MOBY_uri( $ENV{MOBY_URI} ) if $ENV{MOBY_URI}; - $self->default_MOBY_type( $ENV{MOBY_TYPE} ) if $ENV{MOBY_TYPE}; - $self->default_MOBY_proxy( $ENV{MOBY_PROXY} ) if $ENV{MOBY_PROXY}; - if ( $self->Registries ) { - my $regno = 0; - my %reg = %{ $self->Registries }; - while ( my ( $name, $acc ) = each %reg ) { - $regno++; # count how many registries we have in total - my $url = $acc->{URL} ? $acc->{URL} : $self->default_MOBY_server; - my $uri = $acc->{URI} ? $acc->{URI} : $self->default_MOBY_uri; - my $type = $acc->{TYPE} ? $acc->{TYPE} : $self->default_MOBY_type; - my $proxy = - $acc->{PROXY} ? $acc->{PROXY} : $self->default_MOBY_proxy; - $type ||= 'soap'; - if ( lc($type) eq "get" ) { - push @{ $self->Connections }, [ $name, $type, $url ]; - } - else { - my @soapargs; - if ($proxy) { - @soapargs = ( $url, proxy => [ 'http' => $proxy ] ); - } - else { - @soapargs = ($url); - } - push @{ $self->Connections }, [ - $name, $type, - SOAP::Lite->proxy(@soapargs)->uri($uri)->on_fault( - sub { - my ( $soap, $res ) = @_; - die ref $res - ? $res->faultstring - : $soap->transport->status, - "\n ERROR ERROR ERROR\n"; - } - ) - ]; - } - } - $self->multiple_registries( $regno - 1 ) - ; # one is not "multiple", it is just a change in default -> set to "false" if only one + my ( $caller, %args ) = @_; + my $caller_is_obj = ref($caller); + return $caller if $caller_is_obj; + my $class = $caller_is_obj || $caller; + my $proxy; + my $self = bless {}, $class; + foreach my $attrname ( $self->_standard_keys ) { + if ( exists $args{$attrname} ) { + $self->{$attrname} = $args{$attrname}; + } + elsif ($caller_is_obj) { + $self->{$attrname} = $caller->{$attrname}; + } + else { + $self->{$attrname} = $self->_default_for($attrname); + } + } + $self->Connections( [] ); # initialize; + + # if user has set up preferred servers, then use those by default + $self->default_MOBY_server( $ENV{MOBY_SERVER} ) if $ENV{MOBY_SERVER}; + $self->default_MOBY_uri( $ENV{MOBY_URI} ) if $ENV{MOBY_URI}; + $self->default_MOBY_type( $ENV{MOBY_TYPE} ) if $ENV{MOBY_TYPE}; + $self->default_MOBY_proxy( $ENV{MOBY_PROXY} ) if $ENV{MOBY_PROXY}; + if ( $self->Registries ) { + my $regno = 0; + my %reg = %{ $self->Registries }; + while ( my ( $name, $acc ) = each %reg ) { + $regno++; # count how many registries we have in total + my $url = $acc->{URL} ? $acc->{URL} : $self->default_MOBY_server; + my $uri = $acc->{URI} ? $acc->{URI} : $self->default_MOBY_uri; + my $type = $acc->{TYPE} ? $acc->{TYPE} : $self->default_MOBY_type; + my $proxy = $acc->{PROXY} ? $acc->{PROXY} : $self->default_MOBY_proxy; + $type ||= 'soap'; + if ( lc($type) eq "get" ) { + push @{ $self->Connections }, [ $name, $type, $url ]; + } + else { + my @soapargs; + if ($proxy) { + @soapargs = ( $url, proxy => [ 'http' => $proxy ] ); } else { - $self->multiple_registries(0); - if ( lc( $self->default_MOBY_type ) eq "get" ) { - push @{ $self->Connections }, - [ - $self->default_MOBY_servername, $self->default_MOBY_type, - $self->default_MOBY_server - ]; - } - else { - $self->Registries( - { - $self->default_MOBY_servername => { - URL => $self->default_MOBY_server, - URI => $self->default_MOBY_uri - } - } - ); - my @soapargs; - if ( $self->default_MOBY_proxy ) { - @soapargs = ( - $self->default_MOBY_server, - proxy => [ 'http' => $self->default_MOBY_proxy ] - ); - } - else { - @soapargs = ( $self->default_MOBY_server ); - } - push @{ $self->Connections }, [ - $self->default_MOBY_servername, - $self->default_MOBY_type, - SOAP::Lite->proxy(@soapargs)->uri( $self->default_MOBY_uri ) - ->on_fault( - sub { - my ( $soap, $res ) = @_; - die ref $res - ? $res->faultstring - : $soap->transport->status, "\n ERROR ERROR ERROR\n"; - } - ) - ]; - } + @soapargs = ($url); } - return undef unless $self->Connection(); # gotta have at least one... - return $self; + push @{ $self->Connections }, + [ + $name, $type, + SOAP::Lite->proxy(@soapargs)->uri($uri)->on_fault( + sub { + my ( $soap, $res ) = @_; + die ref $res + ? $res->faultstring + : $soap->transport->status, + "\n ERROR ERROR ERROR\n"; + } + ) + ]; + } + } + $self->multiple_registries( $regno - 1 ) + ; # one is not "multiple", it is just a change in default -> set to "false" if only one + } + else { + $self->multiple_registries(0); + if ( lc( $self->default_MOBY_type ) eq "get" ) { + push @{ $self->Connections }, + [ + $self->default_MOBY_servername, $self->default_MOBY_type, + $self->default_MOBY_server + ]; + } + else { + $self->Registries( + { + $self->default_MOBY_servername => { + URL => $self->default_MOBY_server, + URI => $self->default_MOBY_uri + } + } + ); + my @soapargs; + if ( $self->default_MOBY_proxy ) { + @soapargs = ( + $self->default_MOBY_server, + proxy => [ 'http' => $self->default_MOBY_proxy ] + ); + } + else { + @soapargs = ( $self->default_MOBY_server ); + } + push @{ $self->Connections }, + [ + $self->default_MOBY_servername, + $self->default_MOBY_type, + SOAP::Lite->proxy(@soapargs)->uri( $self->default_MOBY_uri ) + ->on_fault( + sub { + my ( $soap, $res ) = @_; + die ref $res + ? $res->faultstring + : $soap->transport->status, "\n ERROR ERROR ERROR\n"; + } + ) + ]; + } + } + return undef unless $self->Connection(); # gotta have at least one... + return $self; } =head2 registerObject a.k.a registerObjectClass - Title : registerObject ; registerObjectClass Usage : $REG = $MOBY->registerObject(%args) Usage : $REG = $MOBY->registerObjectClass(%args) Function : register a new type of MOBY Object @@ -383,18 +384,13 @@ "Contact email address (contactEmail parameter) is required for object registration" ) if ( !$a{contactEmail} ); - my $term = $a{'objectType'}; - $term ||= ""; - my $desc = $a{'description'}; - $desc ||= ""; + my $term = $a{'objectType'} || ""; + my $desc = $a{'description'} || ""; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - my $contactEmail = $a{'contactEmail'}; - $contactEmail ||= ""; - my $authURI = $a{'authURI'}; - $authURI ||= ""; - $authURI ||= ""; + my $contactEmail = $a{'contactEmail'} || ""; + my $authURI = $a{'authURI'} || ""; my %Relationships = %{ $a{'Relationships'} }; my $clobber = $a{'Clobber'} ? $a{'Clobber'} : 0; my $message = " @@ -427,7 +423,6 @@ =head2 deregisterObject a.k.a. deregisterObjectClass - Title : deregisterObject ; deregisterObjectClass Usage : $REG = $MOBY->deregisterObject(%args) Usage : $REG = $MOBY->deregisterObjectClass(%args) Function : deregister a MOBY Object @@ -447,8 +442,7 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $id = $a{'objectType'}; - $id ||= ""; + my $id = $a{'objectType'} || ""; my $message = " $id @@ -461,7 +455,6 @@ =head2 retrieveObjectDefinition - Title : retrieveObjectDefinition Usage : $DEF = $MOBY->retrieveObjectDefinition($objectType[,$registry]) Function : retrieve the $XML that was used to register an object and its relationships Returns : hashref, identical to the hash sent during Object registration, plus @@ -567,7 +560,6 @@ =head2 registerServiceType - Title : registerServiceType Usage : $REG = $MOBY->registerServiceType(%args) Function : register a new MOBY Service type Returns : MOBY::Registration object @@ -585,17 +577,14 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $type = $a{'serviceType'}; - $type ||= ""; + my $type = $a{'serviceType'} || ""; my $desc = $a{'description'}; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } $desc ||= ""; - my $email = $a{'contactEmail'}; - $email ||= ""; - my $auth = $a{'authURI'}; - $auth ||= ""; + my $email = $a{'contactEmail'} || ""; + my $auth = $a{'authURI'} || ""; my %Relationships = %{ $a{'Relationships'} }; my $message = " @@ -620,7 +609,6 @@ =head2 deregisterServiceType - Title : deregisterServiceType Usage : $REG = $MOBY->deregisterServiceType(%args) Function : deregister a deprecated MOBY Service Type Returns : MOBY::Registration object @@ -634,8 +622,7 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $id = $a{'serviceType'}; - $id ||= ""; + my $id = $a{'serviceType'} || ""; my $message = " $id @@ -648,7 +635,6 @@ =head2 registerNamespace - Title : registerNamespace Usage : $REG = $MOBY->registerNamespace(%args) Function : register a new Namespace Returns : MOBY::Registration object @@ -665,17 +651,14 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $type = $a{'namespaceType'}; - $type ||= ""; - my $authURI = $a{'authURI'}; - $authURI ||= ""; + my $type = $a{'namespaceType'} || ""; + my $authURI = $a{'authURI'} || ""; my $desc = $a{'description'}; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } $desc ||= ""; - my $contact = $a{'contactEmail'}; - $contact ||= ""; + my $contact = $a{'contactEmail'} || ""; my $message = " $type @@ -691,7 +674,6 @@ =head2 deregisterNamespace - Title : deregisterNamespace Usage : $REG = $MOBY->deregisterNamespace(%args) Function : deregister a deprecated MOBY Namespace Returns : MOBY::Registration object @@ -705,8 +687,7 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $id = $a{'namespaceType'}; - $id ||= ""; + my $id = $a{'namespaceType'} || ""; my $message = " $id @@ -719,7 +700,6 @@ =head2 registerService - Title : registerService Usage : $REG = $MOBY->registerService(%args) Function : register a new MOBY Service instance Returns : MOBY::Registration object @@ -774,24 +754,17 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $name = $a{serviceName}; - $name ||= ""; - my $type = $a{serviceType}; - $type ||= ""; - my $authURI = $a{authURI}; - $authURI ||= ""; - my $email = $a{contactEmail}; - $email ||= ""; - my $URL = $a{URL}; - $URL ||= ""; - my $desc = $a{description}; - $desc ||= ""; + my $name = $a{serviceName} || ""; + my $type = $a{serviceType} || ""; + my $authURI = $a{authURI} || ""; + my $email = $a{contactEmail} || ""; + my $URL = $a{URL} || ""; + my $desc = $a{description} || ""; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - my $signatureURL = $a{signatureURL}; - $signatureURL ||= ""; + my $signatureURL = $a{signatureURL} || ""; my $Category = lc( $a{category} ); chomp $Category; $Category ||= ""; @@ -856,10 +829,10 @@ if ( $Category eq "moby" || $Category eq 'soap' ) { my %SEC; - if ( $a{'secondary'} && ( ref( $a{'secondary'} ) =~ /hash/i ) ) { + if ( $a{'secondary'} && ( ref( $a{'secondary'} ) eq 'HASH' ) ) { %SEC = %{ $a{secondary} }; } - elsif ( $a{'secondary'} && !( ref( $a{'secondary'} ) =~ /hash/i ) ) { + elsif ( $a{'secondary'} && ( ref( $a{'secondary'} ) ne 'HASH' ) ) { return $self->errorRegXML( "invalid structure of secondary parameters. Expected hashref." ); @@ -880,11 +853,11 @@ my ( $articleName, $def ) = @{$article}; $articleName ||= ""; my @Objects; # - unless ( (ref($def) =~ /array/i)) { # $def = [objType => \@ns] or $def=[[objType => \@ns]] + unless ( ref($def) eq 'ARRAY') { # $def = [objType => \@ns] or $def=[[objType => \@ns]] return $self->errorRegXML("invalid structure of $inout objects, expected SINGLE arrayref for article $articleName as required by the 0.86 API"); } my @objectdefs; - if ( ( ref $def->[0] ) =~ /array/i ) { # collection $def->[0] = [objType => \@ns] + if ( ( ref $def->[0] ) eq 'ARRAY' ) { # collection $def->[0] = [objType => \@ns] # def= [[objType2 => [ns3, ns4...]], ...] $message .= "\n"; if (scalar(@{$def->[0]} > 2)){ @@ -899,7 +872,7 @@ @objectdefs = ($def); } foreach my $objectdef (@objectdefs) { - if ( ( ref( $def->[0] ) ) =~ /array/i ) { + if ( ref( $def->[0] ) eq 'ARRAY' ) { $message .= "\n"; } else { @@ -908,7 +881,7 @@ my ( $type, $Namespaces ) = @{$objectdef}; $type ||= ""; $message .= "$type\n"; - unless ( ref($Namespaces) =~ /array/i ) { + unless ( ref($Namespaces) eq 'ARRAY' ) { return $self->errorRegXML( "invalid structure of $inout namespaces for object $type in article $articleName; expected arrayref" ); @@ -918,7 +891,7 @@ } $message .= "\n"; } - if ( ( ref( $def->[0] ) ) =~ /array/i ) { + if ( ref( $def->[0] ) eq 'ARRAY' ) { $message .= "\n"; } } @@ -939,7 +912,7 @@ # $message .= "\n"; while ( my ( $param, $desc ) = each %SEC ) { - unless ( ( ref($desc) ) =~ /hash/i ) { + unless ( ref($desc) eq 'HASH' ) { return $self->errorRegXML( "invalid structure of secondary article $param; expected hashref of limitations" ); } @@ -953,15 +926,12 @@ return $self->errorRegXML("a secondaryArticle must contain at least a datatype value in secondary article $param" ); } - unless ( ( $datatype =~ /Integer/ ) - || ( $datatype =~ /Float/ ) - || ( $datatype =~ /String/ ) - || ( $datatype =~ /DateTime/ ) ) + unless ( $datatype =~ /Integer|Float|String|DateTime/ ) { return $self->errorRegXML("a secondaryArticle must have a datatype of Integer, Float, String, or DateTime" ); } - unless ( ( ref($enums) ) =~ /array/i ) { + unless ( ref($enums) eq 'ARRAY' ) { return $self->errorRegXML("invalid structure of enum limits in secondary article $param; expected arrayref" ); } @@ -1029,9 +999,7 @@ =head2 registerServiceWSDL - Title : registerServiceWSDL - Usage : not yet implemented - + Usage : Needs documentation =cut @@ -1050,7 +1018,6 @@ =head2 deregisterService - Title : deregisterService Usage : $REG = $MOBY->deregisterService(%args) Function : deregister a registered MOBY Service Returns : MOBY::Registration object @@ -1087,7 +1054,6 @@ =head2 findService - Title : findService Usage : ($ServiceInstances, $RegObject) = $MOBY->findService(%args) Function : Find services that match certain search criterion Returns : ON SUCCESS: arrayref of MOBY::Client::ServiceInstance objects, and undef @@ -1123,23 +1089,15 @@ my ( $self, %a ) = @_; my $reg = ( $a{Registry} ) ? $a{Registry} : $self->default_MOBY_servername; my $id = $a{'serviceID'}; - my $servicename = $a{'serviceName'}; - $servicename ||= ""; - my $authoritative = $a{'authoritative'}; - $authoritative ||= 0; - my $serviceType = $a{'serviceType'}; - $serviceType ||= ""; - my $authURI = $a{'authURI'}; - $authURI ||= ""; - my $category = $a{'category'}; - $category ||= "moby"; - my $exObj = $a{'expandObjects'}; - $exObj ||= 0; - my $exServ = $a{'expandServices'}; - $exServ ||= 0; - my $kw = $a{'keywords'}; - $kw ||= []; - ref($kw) =~ /array/i || return ( + my $servicename = $a{'serviceName'} || ""; + my $authoritative = $a{'authoritative'} || 0; + my $serviceType = $a{'serviceType'} || ""; + my $authURI = $a{'authURI'} || ""; + my $category = $a{'category'} || "moby"; + my $exObj = $a{'expandObjects'} || 0; + my $exServ = $a{'expandServices'} || 0; + my $kw = $a{'keywords'} || []; + ref($kw) eq 'ARRAY' || return ( undef, $self->errorRegXML( "invalid structure of keywords. Expected arrayref" @@ -1168,7 +1126,7 @@ #$a{input} = [[]] unless (defined $a{input}); #$a{output} = [[]] unless (defined $a{output}); - if ( defined $a{input} && !( ref( $a{input} ) =~ /array/i ) ) { + if ( defined $a{input} && ( ref( $a{input} ) ne 'ARRAY' ) ) { return ( undef, $self->errorRegXML( @@ -1176,7 +1134,7 @@ ) ); } - if ( defined $a{output} && !( ref( $a{output} ) =~ /array/i ) ) { + if ( defined $a{output} && ( ref( $a{output} ) ne 'ARRAY' ) ) { return ( undef, $self->errorRegXML( @@ -1198,12 +1156,12 @@ die "no inout parameter from teh funkyhash" unless defined $inout; die "no param parameter from teh funkyhash" unless defined $param; die "param parameter should be a listref" - unless ( ref($param) =~ /ARRAY/ ); + unless ( ref($param) eq 'ARRAY' ); my $inout_lc = lc($inout); my @PARAM = @{$param}; $message .= "<${inout_lc}Objects><${inout}>\n"; foreach my $param (@PARAM) { - unless ( ref($param) =~ /array/i ) { + unless ( ref($param) eq 'ARRAY' ) { return ( undef, $self->errorRegXML( @@ -1216,7 +1174,7 @@ #warn "no namespace part of the param" unless defined $namespaces; my @objectdefs; - if ( ( ref $class ) =~ /array/i ) { # collection + if ( ref $class eq 'ARRAY' ) { # collection $message .= "\n"; @objectdefs = $class; } @@ -1229,7 +1187,7 @@ die "type is missing from objectdef " unless $type; $message .= "$type\n"; if ( defined($Namespaces) - && !( ref($Namespaces) =~ /array/i ) ) + && ( ref($Namespaces) ne 'ARRAY' ) ) { return ( undef, @@ -1244,7 +1202,7 @@ } $message .= "\n"; } - if ( ( ref($class) ) =~ /array/i ) { + if ( ref($class) eq 'ARRAY' ) { $message .= "\n"; } } @@ -1259,7 +1217,6 @@ =head2 retrieveService - Title : retrieveService Usage : $WSDL = $MOBY->retrieveService($ServiceInstance) Function : get the WSDL definition of the service with this name/authority URI Returns : a WSDL string @@ -1304,7 +1261,6 @@ =head2 retrieveResourceURLs - Title : retrieveResourceURLs() Usage : $names = $MOBY->retrieveResourceURLs() Function : get a hash of the URL's for each of the MOBY ontologies Returns : hashref to the following hash @@ -1336,7 +1292,6 @@ =head2 retrieveServiceNames - Title : retrieveServiceNames(%args) Usage : $names = $MOBY->retrieveServiceNames([$reg_name]) Function : get a (redundant) list of all registered service names (N.B. NOT service types!) @@ -1382,7 +1337,6 @@ =head2 retrieveServiceProviders - Title : retrieveServiceProviders Usage : @URIs = $MOBY->retrieveServiceProviders([$reg_name]) Function : get the list of all provider's AuthURI's Returns : list of service provider URI strings @@ -1413,7 +1367,6 @@ =head2 retrieveServiceTypes - Title : retrieveServiceTypes(%args) Usage : $types = $MOBY->retrieveServiceTypes([$reg_name]) Function : get the list of all registered service types Returns : hashref of $types{$type} = $definition @@ -1463,7 +1416,6 @@ =head2 retrieveObjectNames - Title : retrieveObjectNames(%args) Usage : $names = $MOBY->retrieveObjectNames([$reg_name]) Function : get the list of all registered Object types Returns : hashref of hash: @@ -1511,7 +1463,6 @@ =head2 retrieveNamespaces - Title : retrieveNamespaces(%args) Usage : $ns = $MOBY->retrieveNamespaces([$reg_name]) Function : get the list of all registered Namespace types Returns : hashref of hash: @@ -1562,7 +1513,6 @@ =head2 retrieveObject - Title : retrieveObject Usage : $objects = $MOBY->retrieveObjectNames(%args) Function : get the object xsd Returns : hashref of hash: @@ -1616,7 +1566,6 @@ =head2 Relationships - Title : Relationships Usage : $def = $MOBY->Relationships(%args) Function : traverse and return the relationships in the ontology Returns : hashref of $hash{relationship_type}=\@lsids @@ -1639,7 +1588,7 @@ my @relationships; @relationships = @{ $args{'Relationships'} } if ( $args{'Relationships'} - && ( ref( $args{'Relationships'} ) =~ /array/i ) ); + && ( ref( $args{'Relationships'} ) eq 'ARRAY' ) ); push @relationships, 'isa' unless $relationships[0]; # need to have at least one relationship my $reg = $args{'Registry'}; my $m; @@ -1714,7 +1663,6 @@ =head2 ISA - Title : ISA Usage : $def = $MOBY->ISA($class1, $class2) Function : a pre-canned use of the Relationships function to quickly get an answer to whether class1 ISA class2 @@ -1760,8 +1708,6 @@ =head2 DUMP - - Title : DUMP Usage : ($mobycentral, $mobyobject, $mobyservice, $mobynamespace, $mobyrelationship) = $MOBY->DUMP(['registry']) Function : DUMP the mysql for the current MOBY Central database Returns : text @@ -1919,7 +1865,6 @@ =head2 LSID_CACHE - Title : LSID_CACHE Usage : $lsid = $MOBY->LSID_CACHE($term, $lsid) Function : get/set LSID from the cache Returns : lsid as a scalar @@ -1944,7 +1889,6 @@ =head2 ISA_CACHE - Title : ISA_CACHE Usage : @lsids = $MOBY->ISA_CACHE($lsid, \@isas) Function : get/set the ISA relationships in the cache Returns : list of ISA relationships. The ISA list @@ -1959,7 +1903,7 @@ sub ISA_CACHE { my ( $self, $desiredterm, $isas ) = @_; my $term = $desiredterm; - return (undef) if $isas && !( ref($isas) =~ /ARRAY/ ); + return (undef) if $isas && ( ref($isas) ne 'ARRAY'); if ( $term && $isas ) { my @isalsids; foreach (@$isas){ From fgibbons at pub.open-bio.org Fri Sep 16 13:02:01 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 16 Sep 2005 13:02:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161702.j8GH21nX023960@pub.open-bio.org> fgibbons Fri Sep 16 13:02:01 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv23935/MOBY/Client Modified Files: CollectionArticle.pm Log Message: - No "title" in pod. moby-live/Perl/MOBY/Client CollectionArticle.pm,1.11,1.12 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm 2004/12/14 22:31:30 1.11 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm 2005/09/16 17:02:01 1.12 @@ -8,7 +8,10 @@ =head1 NAME -MOBY::Client::CollectionArticle - a small object describing the Collection articles from the findService Response message of MOBY Central or representing the collection part of a MOBY invocation or response block +MOBY::Client::CollectionArticle - a small object describing the +Collection articles from the findService Response message of MOBY +Central or representing the collection part of a MOBY invocation or +response block =head1 SYNOPSIS @@ -39,10 +42,6 @@ } - - -=cut - =head1 DESCRIPTION This describes the Collection articles from either the findService Response of MOBY Central @@ -86,14 +85,11 @@ Mark Wilkinson (markw at illuminae dot com) -=cut - =head1 METHODS =head2 new - Title : new Usage : my $IN = MOBY::Client::CollectionArticle->new(%args) Function : create CollectionArticle object Returns : MOBY::Client::SimpleArticle object @@ -103,62 +99,44 @@ XML => $XML XML_DOM => $XML::DOM::NODE -=cut - =head2 articleName - Title : articleName Usage : $name = $IN->articleName($name) Function : get/set articleName Returns : string Arguments : (optional) string to set articleName -=cut - =head2 Simples - Title : Simples Usage : $type = $IN->Simples(\@SimpleArticles) Function : get/set name Returns : arrayRef of MOBY::Client::SimpleArticle's in this collection Arguments : (optional) arrayRef of MOBY::Client::SimpleArticle's in this collection -=cut - =head2 addSimple - Title : addSimple Usage : $namespaces = $IN->addNamespace($SimpleArticle) Function : add another SimpleArticle Returns : arrayref of MOBY::Client::SimpleArticle's or 0 if argument was not a MOBY::Client::SimpleArticle (or other failure) Arguments : a new MOBY::Client::SimpleArticle to add to collection -=cut - =head2 XML - Title : XML Usage : $SA = $SA->XML($XML) Function : set/reset all parameters for this object from the XML Returns : MOBY::Client::SimpleArticle Arguments : (optional) XML fragment from and including ... -=cut - =head2 XML_DOM - Title : XML_DOM Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) Function : set/reset all parameters for this object from the XML::DOM node for Returns : MOBY::Client::SimpleArticle Arguments : (optional) an $XML::DOM node from the article of a DOM -=cut - =head2 isSimple - Title : isSimple Usage : $boolean = $IN->isSimple() Function : is this a SimpleArticle type (yes, I know this is obvious, but since you can @@ -167,11 +145,8 @@ to test what you have in-hand) Returns : 0 (false) -=cut - =head2 isCollection - Title : isCollection Usage : $boolean = $IN->isCollection() Function : is this a CollectionArticle type (yes, I know this is obvious, but since you can @@ -180,11 +155,8 @@ to test what you have in-hand) Returns : 1 (true) -=cut - =head2 isSecondary - Title : isSecondary Usage : $boolean = $IN->isSecondary() Function : is this a SecondaryArticle type? (yes, I know this is obvious) @@ -198,10 +170,10 @@ # DATA #___________________________________________________________ #ATTRIBUTES - my %_attr_data = # DEFAULT ACCESSIBILITY + my %_attr_data = # DEFAULT ACCESSIBILITY ( - articleName => [ undef, 'read/write' ], - Simples => [ [], 'read/write' ], + articleName => [ undef, 'read/write' ], + Simples => [ [], 'read/write' ], isSimple => [ 0, 'read' ], isSecondary => [ 0, 'read' ], isCollection => [ 1, 'read' ], From senger at pub.open-bio.org Sun Sep 18 03:26:07 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 03:26:07 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180726.j8I7Q7X5010118@pub.open-bio.org> senger Sun Sep 18 03:26:07 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv10099 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.3,1.4 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/13 06:42:26 1.3 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 07:26:06 1.4 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Sun Sep 18 04:35:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:35:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180835.j8I8ZWHV022465@pub.open-bio.org> senger Sun Sep 18 04:35:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard In directory pub.open-bio.org:/tmp/cvs-serv22447/src/config/dashboard Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard added to the repository moby-live/Java/src/config/dashboard - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:35:44 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:35:44 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180835.j8I8Zi3c022515@pub.open-bio.org> senger Sun Sep 18 04:35:44 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF In directory pub.open-bio.org:/tmp/cvs-serv22497/src/config/dashboard/META-INF Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF added to the repository moby-live/Java/src/config/dashboard/META-INF - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:35:56 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:35:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180835.j8I8ZuJr022567@pub.open-bio.org> senger Sun Sep 18 04:35:56 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv22547/src/config/dashboard/META-INF/services Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services added to the repository moby-live/Java/src/config/dashboard/META-INF/services - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:36:21 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:36:21 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180836.j8I8aLPH022625@pub.open-bio.org> senger Sun Sep 18 04:36:20 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org In directory pub.open-bio.org:/tmp/cvs-serv22607/src/config/dashboard/org Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/org added to the repository moby-live/Java/src/config/dashboard/org - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:36:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:36:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180836.j8I8aWrj022675@pub.open-bio.org> senger Sun Sep 18 04:36:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby In directory pub.open-bio.org:/tmp/cvs-serv22657/src/config/dashboard/org/biomoby Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby added to the repository moby-live/Java/src/config/dashboard/org/biomoby - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:36:43 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:36:43 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180836.j8I8ahIv022725@pub.open-bio.org> senger Sun Sep 18 04:36:43 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service In directory pub.open-bio.org:/tmp/cvs-serv22707/src/config/dashboard/org/biomoby/service Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service added to the repository moby-live/Java/src/config/dashboard/org/biomoby/service - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:36:53 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:36:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180836.j8I8ar6Y022774@pub.open-bio.org> senger Sun Sep 18 04:36:53 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv22755/src/config/dashboard/org/biomoby/service/dashboard Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard added to the repository moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:37:04 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:37:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180837.j8I8b4dT022823@pub.open-bio.org> senger Sun Sep 18 04:37:04 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv22805/src/config/dashboard/org/biomoby/service/dashboard/images Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images added to the repository moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:43:50 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:43:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180843.j8I8hoVG023191@pub.open-bio.org> senger Sun Sep 18 04:43:50 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv23173/src/main/org/biomoby/service/dashboard/images Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images added to the repository moby-live/Java/src/main/org/biomoby/service/dashboard/images - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 04:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:46:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQPh023399@pub.open-bio.org> senger Sun Sep 18 04:46:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv23355/src/config Modified Files: run-any-client run-any-client.bat Log Message: moby-live/Java/src/config run-any-client,1.3,1.4 run-any-client.bat,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-any-client,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/config/run-any-client 2005/09/02 07:38:36 1.3 +++ /home/repository/moby/moby-live/Java/src/config/run-any-client 2005/09/18 08:46:25 1.4 @@ -15,6 +15,5 @@ CLASSPATH=${PROJECT_HOME}/build/others/skeletons:$CLASSPATH CLASSPATH=${PROJECT_HOME}/build/others/samples:$CLASSPATH CLASSPATH=`echo ${PROJECT_HOME}/lib/*.jar | tr ' ' ':'`:$CLASSPATH -###CLASSPATH=`echo ${PROJECT_HOME}/lib/ant_home/lib/*.jar | tr ' ' ':'`:$CLASSPATH exec java -cp $CLASSPATH "$@" =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-any-client.bat,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/09/01 08:01:16 1.3 +++ /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/09/18 08:46:25 1.4 @@ -1,12 +1,13 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd %PROJECT_HOME% set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" -set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" -set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" -set "CP=%PROJECT_HOME%\build\others\samples;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% +set CP=build\others\datatypes;%CP% +set CP=build\others\skeletons;%CP% +set CP=build\others\samples;%CP% java -classpath "%CP%" %1 %2 %3 %4 %5 %6 %7 %8 %9 From senger at pub.open-bio.org Sun Sep 18 04:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:46:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQ2g023503@pub.open-bio.org> senger Sun Sep 18 04:46:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv23355/src/main/org/biomoby/service/dashboard/images Added Files: registry.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images registry.gif,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 04:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:46:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQLn023376@pub.open-bio.org> senger Sun Sep 18 04:46:25 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv23355 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.31,1.32 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/13 06:53:28 1.31 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/18 08:46:25 1.32 @@ -211,6 +211,9 @@ + + + @@ -1325,48 +1328,28 @@ + + - + - - - - - - - - + - - - - - - - - + - + From senger at pub.open-bio.org Sun Sep 18 04:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:46:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQLt023415@pub.open-bio.org> senger Sun Sep 18 04:46:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv23355/src/config/dashboard/META-INF/services Added Files: org.biomoby.service.dashboard.DashboardPanel Log Message: moby-live/Java/src/config/dashboard/META-INF/services org.biomoby.service.dashboard.DashboardPanel,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 04:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:46:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQxl023431@pub.open-bio.org> senger Sun Sep 18 04:46:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv23355/src/config/dashboard/org/biomoby/service/dashboard/images Added Files: moby-small.gif whale-tail-small.jpg Log Message: moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images moby-small.gif,NONE,1.1 whale-tail-small.jpg,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 04:48:17 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:48:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180848.j8I8mHFF023621@pub.open-bio.org> senger Sun Sep 18 04:48:17 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard In directory pub.open-bio.org:/tmp/cvs-serv23606/src/config/dashboard Added Files: dashboard.properties Log Message: moby-live/Java/src/config/dashboard dashboard.properties,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 04:48:51 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:48:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180848.j8I8mpPc023684@pub.open-bio.org> senger Sun Sep 18 04:48:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard In directory pub.open-bio.org:/tmp/cvs-serv23669/src/config/dashboard Added Files: README Log Message: moby-live/Java/src/config/dashboard README,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 08:50:17 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 08:50:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181250.j8ICoHLr025902@pub.open-bio.org> senger Sun Sep 18 08:50:17 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv25883 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.4,1.5 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 07:26:06 1.4 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 12:50:17 1.5 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Sun Sep 18 09:02:35 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 09:02:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181302.j8ID2ZVd025966@pub.open-bio.org> senger Sun Sep 18 09:02:35 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv25947 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.5,1.6 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 12:50:17 1.5 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 13:02:35 1.6 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Sun Sep 18 10:05:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:05:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181405.j8IE5WYj026144@pub.open-bio.org> senger Sun Sep 18 10:05:32 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv26125 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.32,1.33 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/18 08:46:25 1.32 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/18 14:05:32 1.33 @@ -1338,9 +1338,12 @@ + + + From senger at pub.open-bio.org Sun Sep 18 10:05:33 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:05:33 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181405.j8IE5Xn1026159@pub.open-bio.org> senger Sun Sep 18 10:05:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv26125/src/config Added Files: run-dashboard run-dashboard.bat Log Message: moby-live/Java/src/config run-dashboard,NONE,1.1 run-dashboard.bat,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 10:09:42 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:09:42 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181409.j8IE9g67026288@pub.open-bio.org> senger Sun Sep 18 10:09:42 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/images In directory pub.open-bio.org:/tmp/cvs-serv26273/docs/images Added Files: whale-tail.jpg Log Message: moby-live/Java/docs/images whale-tail.jpg,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 10:09:42 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:09:42 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181409.j8IE9gr2026324@pub.open-bio.org> senger Sun Sep 18 10:09:42 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv26273/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java ConsolePanel.java Dashboard.java NOTES RegistryPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard AbstractPanel.java,1.4,1.5 ConsolePanel.java,1.2,1.3 Dashboard.java,1.2,1.3 NOTES,1.2,1.3 RegistryPanel.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/18 08:46:26 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/18 14:09:42 1.5 @@ -81,6 +81,7 @@ // something need to be done only once - keep it here protected Icon panelIcon; protected JComponent pComponent; + protected Icon confirmIcon; // re-use "style" components protected static final Insets BREATH_TOP = new Insets (10,0,0,0); @@ -276,7 +277,10 @@ * Return true if confirmation dialog passed. ********************************************************************/ public boolean confirm (Object msg) { - return SwingUtils.confirm (this, msg, null); + if (confirmIcon == null) + confirmIcon = + SwingUtils.createIcon ("images/confirmButton.gif", Dashboard.class); + return SwingUtils.confirm (this, msg, confirmIcon); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/18 08:46:26 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/18 14:09:42 1.3 @@ -15,7 +15,6 @@ import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JScrollPane; -import javax.swing.JViewport; import javax.swing.JTextArea; import javax.swing.JPanel; import javax.swing.text.html.HTMLDocument; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/18 08:46:26 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/18 14:09:42 1.3 @@ -10,6 +10,7 @@ import org.tulsoft.tools.gui.SwingUtils; import org.tulsoft.tools.gui.AwtUtils; +import org.tulsoft.tools.gui.ProgressView; import org.apache.commons.discovery.tools.Service; @@ -50,6 +51,7 @@ private JComponent dashboard; private StatusBar statusBar; private DashboardHeader header; + public static boolean useLoadMonitor = true; protected JTabbedPane tabbedPane; protected DashboardPanel[] panels; protected static Properties dashboardProperties; @@ -185,6 +187,11 @@ if (dashboard != null) return dashboard; + if (useLoadMonitor) { + ProgressView.monitor = new ProgressView (panels.length); + ProgressView.monitor.show ("Welcome to Biomoby Dashboard"); + } + // create itself JPanel p = new JPanel (new GridBagLayout(), true); @@ -192,10 +199,16 @@ tabbedPane = new JTabbedPane(); tabbedPane.addChangeListener (this); for (int i = 0; i < panels.length; i++) { - tabbedPane.addTab (panels[i].getName(), panels[i].getIcon(), panels[i].getComponent()); + String name = panels[i].getName(); + if (useLoadMonitor) + ProgressView.monitor.setTextAndAdd ("Loading " + name + "..."); + tabbedPane.addTab (name, panels[i].getIcon(), panels[i].getComponent()); } statusBar = getStatusBar(); + if (useLoadMonitor) + ProgressView.monitor.destroy(); + // put it all together SwingUtils.addComponent (p, header, 0, 0, 1, 1, AbstractPanel.HORI, AbstractPanel.NWEST, 1.0, 0.0); SwingUtils.addComponent (p, tabbedPane, 0, 1, 1, 1, AbstractPanel.BOTH, AbstractPanel.NWEST, 1.0, 1.0); @@ -295,6 +308,8 @@ * **************************************************************************/ public static void main (String[] args) { + if (args.length > 0 && args[0].equals ("-nop")) + Dashboard.useLoadMonitor = false; new Dashboard().show(); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/18 08:46:26 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/18 14:09:42 1.3 @@ -9,9 +9,7 @@ * configure dashbard (add/remove dynamically panels) * configure user preferences -* Registry panel: - - trees should be in panned blocks (user-resizable) - +* running from run-dashboard does not work Registry panel -------------- =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/18 08:46:26 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/18 14:09:42 1.5 @@ -18,10 +18,14 @@ import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JFileChooser; +import javax.swing.JSplitPane; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; import javax.swing.JComponent; import javax.swing.text.html.HTMLDocument; import java.awt.GridBagLayout; +import java.awt.Font; import java.awt.event.KeyEvent; import java.awt.event.ActionEvent; @@ -80,16 +84,38 @@ DataTypesTree dataTypesTree = new DataTypesTree(); NamespacesTree namespacesTree = new NamespacesTree(); + JSplitPane split1 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, + servicesTree.scrollable(), + dataTypesTree.scrollable()); + split1.setResizeWeight (0.5); + split1.setContinuousLayout (true); + split1.setOneTouchExpandable (true); + JSplitPane split2 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, + split1, + namespacesTree.scrollable()); + split2.setResizeWeight (0.7); + split2.setContinuousLayout (true); + split2.setOneTouchExpandable (true); + + // console panel + JPanel console = getConsole(); + + JSplitPane split3 = new JSplitPane (JSplitPane.VERTICAL_SPLIT, + split2, + console); + split3.setResizeWeight (0.75); + split3.setContinuousLayout (true); + split3.setOneTouchExpandable (true); + + // registry and cache locations JPanel regLocation = getRegistryLocation(); JPanel cacheLocation = getCacheLocation(); // put all together - SwingUtils.addComponent (pComponent, servicesTree.scrollable(), 0, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); - SwingUtils.addComponent (pComponent, dataTypesTree.scrollable(), 1, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); - SwingUtils.addComponent (pComponent, namespacesTree.scrollable(), 2, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); - SwingUtils.addComponent (pComponent, regLocation, 3, 0, 1, 1, HORI, NWEST, 0.1, 0.0); - SwingUtils.addComponent (pComponent, cacheLocation, 3, 1, 1, 1, HORI, NWEST, 0.1, 0.0); + SwingUtils.addComponent (pComponent, split3, 0, 0, 1, 2, BOTH, NWEST, 1.0, 1.0); + SwingUtils.addComponent (pComponent, regLocation, 1, 0, 1, 1, HORI, NWEST, 0.0, 0.0); + SwingUtils.addComponent (pComponent, cacheLocation, 1, 1, 1, 1, HORI, NWEST, 0.0, 0.0); return pComponent; } @@ -235,6 +261,35 @@ /************************************************************************** * **************************************************************************/ + protected JPanel getConsole() { + JPanel p = new JPanel (new GridBagLayout()); + + JTextArea textArea = new JTextArea(); + textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); + textArea.setEditable (false); + JScrollPane scroller = new JScrollPane (textArea); + +// JButton cleanButton = +// createButton (" Clean ", +// "Remove all messages from the console area", +// KeyEvent.VK_C, +// new ActionListener() { +// public void actionPerformed (ActionEvent e) { +// if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) +// textArea.setText (""); +// } +// }); + + // put it together + SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); +// SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); + + return p; + } + + /************************************************************************** + * + **************************************************************************/ class ServicesTree extends CommonTree { public ServicesTree() { super ("Services"); From senger at pub.open-bio.org Sun Sep 18 10:12:01 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:12:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181412.j8IEC117026412@pub.open-bio.org> senger Sun Sep 18 10:12:01 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv26397/src/main/org/biomoby/service/dashboard/images Added Files: confirmButton.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images confirmButton.gif,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 10:36:13 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:36:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181436.j8IEaDWV026495@pub.open-bio.org> senger Sun Sep 18 10:36:13 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard In directory pub.open-bio.org:/tmp/cvs-serv26477/src/samples-resources/GCP-dashboard Log Message: Directory /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard added to the repository moby-live/Java/src/samples-resources/GCP-dashboard - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 10:36:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:36:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181436.j8IEaqUc026537@pub.open-bio.org> senger Sun Sep 18 10:36:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv26519/images Log Message: Directory /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images added to the repository moby-live/Java/src/samples-resources/GCP-dashboard/images - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 10:36:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:36:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181436.j8IEaqV3026555@pub.open-bio.org> senger Sun Sep 18 10:36:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF In directory pub.open-bio.org:/tmp/cvs-serv26519/META-INF Log Message: Directory /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF added to the repository moby-live/Java/src/samples-resources/GCP-dashboard/META-INF - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 10:36:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:36:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181436.j8IEaq05026573@pub.open-bio.org> senger Sun Sep 18 10:36:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv26519/META-INF/services Log Message: Directory /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services added to the repository moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 10:38:27 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:38:27 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181438.j8IEcRaA026639@pub.open-bio.org> senger Sun Sep 18 10:38:27 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard In directory pub.open-bio.org:/tmp/cvs-serv26624/src/samples-resources/GCP-dashboard Added Files: README dashboard.properties Log Message: moby-live/Java/src/samples-resources/GCP-dashboard README,NONE,1.1 dashboard.properties,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 10:38:27 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:38:27 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181438.j8IEcRBb026654@pub.open-bio.org> senger Sun Sep 18 10:38:27 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv26624/src/samples-resources/GCP-dashboard/META-INF/services Added Files: org.biomoby.service.dashboard.DashboardPanel Log Message: moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services org.biomoby.service.dashboard.DashboardPanel,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 10:38:27 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:38:27 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181438.j8IEcR7Y026670@pub.open-bio.org> senger Sun Sep 18 10:38:27 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv26624/src/samples-resources/GCP-dashboard/images Added Files: dashboard.jpg dashboard2.jpg dashboard3.jpg gcp.png Log Message: moby-live/Java/src/samples-resources/GCP-dashboard/images dashboard.jpg,NONE,1.1 dashboard2.jpg,NONE,1.1 dashboard3.jpg,NONE,1.1 gcp.png,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 22:24:51 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 22:24:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190224.j8J2OphA028109@pub.open-bio.org> senger Sun Sep 18 22:24:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv28089/src/Clients Modified Files: CacheRegistryClient.java Log Message: remove Eclipse warnings moby-live/Java/src/Clients CacheRegistryClient.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/04 13:45:37 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/19 02:24:51 1.3 @@ -12,9 +12,7 @@ import org.tulsoft.shared.FileUtils; import org.tulsoft.shared.GException; -import java.net.*; import java.util.*; -import java.io.*; /** * This is a command-line client creating (and removing) a cache of a @@ -108,9 +106,9 @@ if (cmd.hasOption ("-fill")) { castWorker.removeFromCache (null); decorationLn ("Retrieving data types..."); - MobyDataType[] dataTypes = worker.getDataTypes(); + worker.getDataTypes(); decorationLn ("Retrieving services..."); - MobyService[] services = worker.getServices(); + worker.getServices(); } // From senger at pub.open-bio.org Mon Sep 19 04:08:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 04:08:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88WHH029116@pub.open-bio.org> senger Mon Sep 19 04:08:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv29075/docs Modified Files: ChangeLog Log Message: caching also namespaces moby-live/Java/docs ChangeLog,1.39,1.40 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/01 08:01:16 1.39 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/19 08:08:32 1.40 @@ -1,3 +1,7 @@ +2005-09-19 Martin Senger + + * Added caching for namespaces to CentralDigestCachedImpl + 2005-09-01 Martin Senger * Fixed the Windows run...bat scripts in order to accept spaces in From senger at pub.open-bio.org Mon Sep 19 04:08:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 04:08:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88WgU029097@pub.open-bio.org> senger Mon Sep 19 04:08:31 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv29075 Modified Files: build.xml Log Message: caching also namespaces moby-live/Java build.xml,1.33,1.34 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/18 14:05:32 1.33 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/19 08:08:31 1.34 @@ -545,7 +545,15 @@ ---> + --> + + + From senger at pub.open-bio.org Mon Sep 19 04:08:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 04:08:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88WBr029240@pub.open-bio.org> senger Mon Sep 19 04:08:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv29075/src/main/org/biomoby/client Modified Files: CentralDigestCachedImpl.java CentralImpl.java Log Message: caching also namespaces moby-live/Java/src/main/org/biomoby/client CentralDigestCachedImpl.java,1.5,1.6 CentralImpl.java,1.25,1.26 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/08/26 06:27:04 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/19 08:08:32 1.6 @@ -50,6 +50,7 @@ private String cacheDir; // as defined in the constructor protected File dataTypesCache; protected File servicesCache; + protected File namespacesCache; // cache age private long cacheAge = -1; @@ -95,11 +96,15 @@ long dataTypesCacheAge = (isCacheEmpty (dataTypesCache) ? -1 : dataTypesCache.lastModified()); servicesCache = createSubCacheDir (cache, "services"); long servicesCacheAge = (isCacheEmpty (servicesCache) ? -1 : servicesCache.lastModified()); + namespacesCache = createSubCacheDir (cache, "namespaces"); + long namespacesCacheAge = (isCacheEmpty (namespacesCache) ? -1 : namespacesCache.lastModified()); - if (dataTypesCacheAge > -1 && servicesCacheAge > -1) - cacheAge = Math.min (dataTypesCacheAge, servicesCacheAge); + if (dataTypesCacheAge > -1 && servicesCacheAge > -1 && namespacesCacheAge > -1) + cacheAge = Math.min (Math.min (dataTypesCacheAge, servicesCacheAge), + namespacesCacheAge); else - cacheAge = Math.max (dataTypesCacheAge, servicesCacheAge); + cacheAge = Math.max (Math.max (dataTypesCacheAge, servicesCacheAge), + namespacesCacheAge); } } @@ -318,6 +323,20 @@ } } + // + protected void fillNamespacesCache() + throws MobyException { + try { + String xml = getNamespacesAsXML(); + store (namespacesCache, "all_namespaces_in_one_go", xml); + if (cacheAge <= 0) + cacheAge = namespacesCache.lastModified(); + + } catch (Exception e) { + throw new MobyException (formatException (e)); + } + } + // read all data types public MobyDataType[] getDataTypes() throws MobyException { @@ -375,6 +394,35 @@ } } +// public MobyNamespace[] getNamespaces() + public Map getNamespaces() + throws MobyException { + if (namespacesCache == null) + return super.getNamespaces(); + synchronized (namespacesCache) { + if (isCacheEmpty (namespacesCache)) { + initCache(); + fillNamespacesCache(); + } + File[] list = namespacesCache.listFiles(); + if (list == null) + throw new MobyException + ("Surprisingly, '" + namespacesCache.getAbsolutePath() + "' is not a directory. Strange..."); + for (int i = 0; i < list.length; i++) { + try { + if (list[i].getPath().endsWith ("~")) + continue; // ignore some files + return createNamespacesFromXML (load (list[i])); + } catch (MobyException e) { + System.err.println ("Ignoring '" + list[i].getPath() + + "'. It should not be in the cache directory:" + + e.getMessage()); + } + } + } + return null; + } + /************************************************************************** * It always (if it functions as a cache which is when 'cacheDir' * was given) disables caching in the parent (so no memory caching =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/04 13:45:37 1.25 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/19 08:08:32 1.26 @@ -848,14 +848,26 @@ public Map getNamespaces() throws MobyException { + String result = getNamespacesAsXML(); + return createNamespacesFromXML (result); + } + + // + protected String getNamespacesAsXML() + throws MobyException { + return (String)doCall ("retrieveNamespaces", + new Object[] {}); + } + + // + protected Map createNamespacesFromXML (String result) + throws MobyException { + String cacheId = "retrieveNamespaces"; Map cachedResults = (Map)getContents (cacheId); if (cachedResults != null) return cachedResults; - String result = (String)doCall ("retrieveNamespaces", - new Object[] {}); - // parse returned XML Map results = new HashMap(); Document document = null; From senger at pub.open-bio.org Mon Sep 19 04:08:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 04:08:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88WMT029153@pub.open-bio.org> senger Mon Sep 19 04:08:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv29075/src/Clients Modified Files: MobyCmdLineClient.java MobyDigestClient.java MobyGraphs.java PopulateLocalCentralForTesting.java TestingCentral.java Log Message: caching also namespaces moby-live/Java/src/Clients MobyCmdLineClient.java,1.11,1.12 MobyDigestClient.java,1.2,1.3 MobyGraphs.java,1.9,1.10 PopulateLocalCentralForTesting.java,1.4,1.5 TestingCentral.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/09/04 13:45:37 1.11 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/09/19 08:08:32 1.12 @@ -13,7 +13,6 @@ import org.tulsoft.shared.StringUtils; import org.tulsoft.shared.GException; -import java.net.*; import java.util.*; import java.io.*; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/09/04 13:45:37 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/09/19 08:08:32 1.3 @@ -1,7 +1,9 @@ // MobyDigestClient.java // -// senger at ebi.ac.uk -// September 2004 +// Created: September 2004 +// +// This file is a component of the BioMoby project. +// Copyright Martin Senger (martin.senger at gmail.com). // import org.biomoby.shared.*; @@ -11,12 +13,15 @@ import org.tulsoft.shared.FileUtils; import org.tulsoft.shared.GException; +import java.util.Map; +import java.util.Iterator; + /** * A simple client retrieving and printing cummulative (digestive) * registry entries. It can collaborate with the locally cached * registry entries.

        * - * @author Martin Senger + * @author Martin Senger * @version $Id$ */ @@ -101,6 +106,17 @@ } } + // read all namespaces + if (cmd.hasOption ("-n")) { + Map namespaces = worker.getNamespaces(); + for (Iterator it = namespaces.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + System.out.println (entry.getKey()); + if (details) + System.out.println ("\t" + entry.getValue()); + } + } + } catch (Exception e) { System.err.println ("===ERROR==="); e.printStackTrace(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2005/09/04 13:45:37 1.9 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2005/09/19 08:08:32 1.10 @@ -14,7 +14,6 @@ import org.tulsoft.shared.FileUtils; import org.tulsoft.shared.GException; -import java.net.*; import java.util.*; import java.io.*; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/PopulateLocalCentralForTesting.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/Clients/PopulateLocalCentralForTesting.java 2005/05/19 15:57:24 1.4 +++ /home/repository/moby/moby-live/Java/src/Clients/PopulateLocalCentralForTesting.java 2005/09/19 08:08:32 1.5 @@ -7,9 +7,6 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import java.net.*; -import java.util.*; - /** * This is a very specialized client, meant solely for testing * purposes, and to be used on a local installation of a Moby Central =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/08/31 00:48:39 1.5 +++ /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/09/19 08:08:32 1.6 @@ -8,7 +8,6 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import java.net.*; import java.util.*; /** From senger at pub.open-bio.org Mon Sep 19 04:08:33 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 04:08:33 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88WK6029270@pub.open-bio.org> senger Mon Sep 19 04:08:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv29075/src/main/org/biomoby/service/dashboard Modified Files: NOTES RegistryPanel.java Log Message: caching also namespaces moby-live/Java/src/main/org/biomoby/service/dashboard NOTES,1.3,1.4 RegistryPanel.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/18 14:09:42 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/19 08:08:32 1.4 @@ -1,9 +1,16 @@ TODO with views: ---------------- +* change onMethods() to be protected or even private... + +* add a progress bar to the status bar (on the right) + - add also a cancel buton there + - do not allow more than one progressbar-aware action in the same time + file:///c/Development/java-tutorial/uiswing/components/progress.html + ? small icons to buttons ? use FileSystemView in file choosers -* alltools2: - PrefsUtils may become just a common parent for both *WithHistory classes - - combo box history is not updated if exit happened while focus is till in the text field +? alltools2: + - combo box history is not updated if exit happened while focus is till in the text field ? configure dashboard from menu: * configure dashbard (add/remove dynamically panels) @@ -11,6 +18,20 @@ * running from run-dashboard does not work +TODO for cache: +--------------- +* add namespaces and service types +* store services under names: authority-service_name +* emit log events +* poor-man update: keep what's there but add what is not there + (and perhaps delete what should not be thre) - but do not + check any age of existing +* getInfo() method +* corresponding changes with command-line clients for cache + implementations + +? start to work on/think of the RDF-based cache + Registry panel -------------- =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/18 14:09:42 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/19 08:08:32 1.6 @@ -52,6 +52,9 @@ // names of user preferences keys static final String USE_CACHE = "use-cache"; + // associated model working behind the scenes + RegistryModel registryModel; + // components that are used from more methods JFileChooserWithHistory cacheDir; JLabel labelCacheDir; @@ -70,6 +73,15 @@ // else if (prop.equalsIgnoreCase (PROP_DATA_IDENTITY)) setDataIdentity (newVal); } + /********************************************************************* + * Default constructor + ********************************************************************/ + public RegistryPanel() { + super(); +// registryModel = new RegistryModel (this); + registryModel = new RegistryModel(); + } + /************************************************************************** * **************************************************************************/ @@ -153,7 +165,7 @@ /************************************************************************** * **************************************************************************/ - public void onUseCache (boolean enabled) { + protected void onUseCache (boolean enabled) { cacheDir.setEnabled (enabled); labelCacheDir.setEnabled (enabled); setPrefValue (USE_CACHE, enabled); @@ -331,4 +343,34 @@ } +// public void actionPerformed(ActionEvent e) { +// ... +// if (icon == null) { //haven't viewed this photo before +// loadImage(imagedir + pic.filename, current); +// } else { +// updatePhotograph(current, pic); +// } +// } +// ... +// //Load an image in a separate thread. +// private void loadImage(final String imagePath, final int index) { +// final SwingWorker worker = new SwingWorker() { +// ImageIcon icon = null; + +// public Object construct() { +// icon = new ImageIcon(getURL(imagePath)); +// return icon; //return value not used by this program +// } + +// //Runs on the event-dispatching thread. +// public void finished() { +// Photo pic = (Photo)pictures.elementAt(index); +// pic.setIcon(icon); +// if (index == current) +// updatePhotograph(index, pic); +// } +// }; +// worker.start(); +// } + } From senger at pub.open-bio.org Mon Sep 19 04:08:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 04:08:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88Wj6029217@pub.open-bio.org> senger Mon Sep 19 04:08:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/templates In directory pub.open-bio.org:/tmp/cvs-serv29075/src/config/templates Modified Files: DataTypeTemplate.java MembersHASTemplate.java MethodsHASTemplate.java MethodsHAS_string_Template.java ServicePISetTemplate.java ServicePISimpleTemplate.java ServicePOSetTemplate.java ServicePOSimpleTemplate.java ServiceParameterTemplate.java ServiceSkeletonTemplate.java ToStringHASTemplate.java ToXMLHASTemplate.java Log Message: caching also namespaces moby-live/Java/src/config/templates DataTypeTemplate.java,1.1,1.2 MembersHASTemplate.java,1.1,1.2 MethodsHASTemplate.java,1.1,1.2 MethodsHAS_string_Template.java,1.1,1.2 ServicePISetTemplate.java,1.1,1.2 ServicePISimpleTemplate.java,1.1,1.2 ServicePOSetTemplate.java,1.1,1.2 ServicePOSimpleTemplate.java,1.1,1.2 ServiceParameterTemplate.java,1.1,1.2 ServiceSkeletonTemplate.java,1.1,1.2 ToStringHASTemplate.java,1.1,1.2 ToXMLHASTemplate.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/DataTypeTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/DataTypeTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/DataTypeTemplate.java 2005/09/19 08:08:32 1.2 @@ -6,11 +6,6 @@ package org.biomoby.shared.datatypes; -import org.biomoby.shared.MobyException; -import org.jdom.Element; -import java.util.Vector; -import java.util.Enumeration; - /** * Data type name: @DATATYPE at .
        * Authority: @AUTHORITY@
        @@ -57,8 +52,8 @@ /************************************************************************** * *************************************************************************/ - public Element toXML() { - Element elem_I_am_sorry_that_this_produces_a_warning = super.toXML(); + public org.jdom.Element toXML() { + org.jdom.Element elem_I_am_sorry_that_this_produces_a_warning = super.toXML(); elem_I_am_sorry_that_this_produces_a_warning.setName (DATA_TYPE_NAME); @TO_XML@ return elem_I_am_sorry_that_this_produces_a_warning; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/MembersHASTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/MembersHASTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/MembersHASTemplate.java 2005/09/19 08:08:32 1.2 @@ -1,5 +1,5 @@ /** An article name for a member of this object. */ public static final String ARTICLE_NAME_ at ESC_UPPER_ARTICLE_NAME@ = "@ARTICLE_NAME@"; // elements are of type @CHILDTYPE_NAME@ - protected Vector @ESC_ARTICLE_NAME@ = new Vector(); + protected java.util.Vector @ESC_ARTICLE_NAME@ = new java.util.Vector(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/MethodsHASTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/MethodsHASTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/MethodsHASTemplate.java 2005/09/19 08:08:32 1.2 @@ -19,7 +19,7 @@ * only one value *************************************************************************/ public void set_ at ESC_ARTICLE_NAME@ (@CHILDTYPE_NAME@[] value) { - this. at ESC_ARTICLE_NAME@ = new Vector(); + this. at ESC_ARTICLE_NAME@ = new java.util.Vector(); for (int i = 0; i < value.length; i++) set_ at ESC_ARTICLE_NAME@ (value[i]); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/MethodsHAS_string_Template.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/MethodsHAS_string_Template.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/MethodsHAS_string_Template.java 2005/09/19 08:08:32 1.2 @@ -21,7 +21,7 @@ * only one value *************************************************************************/ public void set_ at ESC_ARTICLE_NAME@ (String[] value) { - this. at ESC_ARTICLE_NAME@ = new Vector(); + this. at ESC_ARTICLE_NAME@ = new java.util.Vector(); for (int i = 0; i < value.length; i++) set_ at ESC_ARTICLE_NAME@ (value[i]); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServicePISetTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServicePISetTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServicePISetTemplate.java 2005/09/19 08:08:32 1.2 @@ -3,10 +3,10 @@ * * @param request represents input data coming from a client * @return a type specific object (that is known to this service) - * @throws MobyException if something goes wrong + * @throws org.biomoby.shared.MobyException if something goes wrong *************************************************************************/ public @DATATYPE@[] get_ at ESC_ARTICLE_NAME@Set (MobyJob request) - throws MobyException { + throws org.biomoby.shared.MobyException { return (@DATATYPE@[])request.getDataSet ("@ARTICLE_NAME@", "@DATATYPE@"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServicePISimpleTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServicePISimpleTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServicePISimpleTemplate.java 2005/09/19 08:08:32 1.2 @@ -3,9 +3,9 @@ * * @param request represents input data coming from a client * @return a type specific object (that is known to this service) - * @throws MobyException if something goes wrong + * @throws org.biomoby.shared.MobyException if something goes wrong *************************************************************************/ public @DATATYPE@ get_ at ESC_ARTICLE_NAME@ (MobyJob request) - throws MobyException { + throws org.biomoby.shared.MobyException { return (@DATATYPE@)request.getData ("@ARTICLE_NAME@", "@DATATYPE@"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSetTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSetTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSetTemplate.java 2005/09/19 08:08:32 1.2 @@ -3,10 +3,10 @@ * * @param response represents output data that will go to a client * @param values is to be stored in the 'response' - * @throws MobyException if something goes wrong + * @throws org.biomoby.shared.MobyException if something goes wrong *************************************************************************/ public void set_ at ESC_ARTICLE_NAME@Set (MobyJob response, @DATATYPE@[] values) - throws MobyException { + throws org.biomoby.shared.MobyException { response.setDataSet (values, "@ARTICLE_NAME@"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSimpleTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSimpleTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSimpleTemplate.java 2005/09/19 08:08:32 1.2 @@ -3,10 +3,10 @@ * * @param response represents output data that will go to a client * @param value is to be stored in the 'response' - * @throws MobyException if something goes wrong + * @throws org.biomoby.shared.MobyException if something goes wrong *************************************************************************/ public void set_ at ESC_ARTICLE_NAME@ (MobyJob response, @DATATYPE@ value) - throws MobyException { + throws org.biomoby.shared.MobyException { response.setData (value, "@ARTICLE_NAME@"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServiceParameterTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServiceParameterTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServiceParameterTemplate.java 2005/09/19 08:08:32 1.2 @@ -4,10 +4,10 @@ * * @param request represents input data coming from a client * @return value of a "secondary" parameter - * @throws MobyException if something goes wrong + * @throws org.biomoby.shared.MobyException if something goes wrong *************************************************************************/ public String getParameter_ at ESC_ARTICLE_NAME@ (MobyJob request) - throws MobyException { + throws org.biomoby.shared.MobyException { return request.getParameter ("@ARTICLE_NAME@"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServiceSkeletonTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServiceSkeletonTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServiceSkeletonTemplate.java 2005/09/19 08:08:32 1.2 @@ -4,8 +4,6 @@ package @PACKAGE_NAME@; import org.biomoby.service.BaseService; -import org.biomoby.shared.MobyException; -import org.biomoby.shared.parser.MobyParameter; import org.biomoby.shared.parser.MobyJob; import org.biomoby.shared.parser.MobyPackage; import org.biomoby.shared.datatypes.*; @@ -61,7 +59,7 @@ // and return an XML back return mobyOutput.toXML(); - } catch (MobyException e) { + } catch (org.biomoby.shared.MobyException e) { return error (e.getMessage(), mobyOutput); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ToStringHASTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ToStringHASTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ToStringHASTemplate.java 2005/09/19 08:08:32 1.2 @@ -1,2 +1,2 @@ - for (Enumeration en = @ESC_ARTICLE_NAME at .elements(); en.hasMoreElements(); ) + for (java.util.Enumeration en = @ESC_ARTICLE_NAME at .elements(); en.hasMoreElements(); ) buf_I_am_sorry_that_this_produces_a_warning.append ( ((@CHILDTYPE_NAME@)en.nextElement()).format (1) ); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ToXMLHASTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ToXMLHASTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ToXMLHASTemplate.java 2005/09/19 08:08:32 1.2 @@ -1,2 +1,2 @@ - for (Enumeration en = @ESC_ARTICLE_NAME at .elements(); en.hasMoreElements(); ) + for (java.util.Enumeration en = @ESC_ARTICLE_NAME at .elements(); en.hasMoreElements(); ) elem_I_am_sorry_that_this_produces_a_warning.addContent ( ((@CHILDTYPE_NAME@)en.nextElement()).toXML() ); From senger at pub.open-bio.org Mon Sep 19 04:09:22 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 04:09:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190809.j8J89Mqj029314@pub.open-bio.org> senger Mon Sep 19 04:09:22 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv29299/src/main/org/biomoby/service/dashboard Added Files: RegistryModel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard RegistryModel.java,NONE,1.1 From senger at pub.open-bio.org Mon Sep 19 04:11:53 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 04:11:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190811.j8J8Briq029359@pub.open-bio.org> senger Mon Sep 19 04:11:53 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv29344/src/Clients Added Files: TestAnt.java Log Message: moby-live/Java/src/Clients TestAnt.java,NONE,1.1 From senger at pub.open-bio.org Mon Sep 19 12:19:27 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 12:19:27 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509191619.j8JGJRgQ030536@pub.open-bio.org> senger Mon Sep 19 12:19:27 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv30520/Java/src/Clients Removed Files: TestAnt.java Log Message: moby-live/Java/src/Clients TestAnt.java,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/Clients/RCS/TestAnt.java,v: No such file or directory From senger at pub.open-bio.org Tue Sep 20 03:30:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 20 Sep 2005 03:30:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509200730.j8K7U9YS003941@pub.open-bio.org> senger Tue Sep 20 03:30:09 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/images In directory pub.open-bio.org:/tmp/cvs-serv3903/images Modified Files: stylesheet.css Added Files: smile.gif smile_sad.gif Log Message: moby-live/Java/docs/images smile.gif,NONE,1.1 smile_sad.gif,NONE,1.1 stylesheet.css,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/images/stylesheet.css,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/docs/images/stylesheet.css 2005/08/29 13:21:59 1.4 +++ /home/repository/moby/moby-live/Java/docs/images/stylesheet.css 2005/09/20 07:30:09 1.5 @@ -93,3 +93,8 @@ color: navy; } +b.step { + background-color: white; + color: navy; + font-size: 8pt; + } From senger at pub.open-bio.org Tue Sep 20 03:30:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 20 Sep 2005 03:30:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509200730.j8K7U9nq003922@pub.open-bio.org> senger Tue Sep 20 03:30:09 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv3903 Modified Files: index.html Added Files: EclipseAndJMoby.html Log Message: moby-live/Java/docs EclipseAndJMoby.html,NONE,1.1 index.html,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/index.html,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Java/docs/index.html 2005/08/28 10:43:27 1.13 +++ /home/repository/moby/moby-live/Java/docs/index.html 2005/09/20 07:30:09 1.14 @@ -44,6 +44,7 @@

      • How to use jMoby @@ -89,7 +90,7 @@
        Martin Senger
        -Last modified: Sun Aug 28 19:37:25 2005 +Last modified: Tue Sep 20 12:21:24 2005
        From senger at pub.open-bio.org Tue Sep 20 03:43:25 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 20 Sep 2005 03:43:25 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509200743.j8K7hP2j004055@pub.open-bio.org> senger Tue Sep 20 03:43:25 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv4036 Modified Files: ToDo.html Log Message: moby-live/Java/docs ToDo.html,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ToDo.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/docs/ToDo.html 2005/05/19 11:00:41 1.3 +++ /home/repository/moby/moby-live/Java/docs/ToDo.html 2005/09/20 07:43:25 1.4 @@ -40,24 +40,10 @@
        MS - Generate a complete XML Schema for registered services. This -will allow to have complete WSDLs for BioMoby services, which will -further allow to use all existing tools using such WSDLs for -generating code and documentation. + Biomoby Dashboard - an ultimate GUI for maintaining and browsing Biomoby.

        -

        MS - Support for auto-generated clients (using the outcome of the -previous issue). -

        - -

        MS - Similar support for BioMoby service providers - a library -helping to hide SOAP and BioMoby envelope layers so service providers -can concentrate only on the business logic. -

        - -

        MS +
        ED More support for BioMoby complex data type in Taverna.

        @@ -84,9 +70,6 @@ reading directly RDF files with BioMoby entities.

        -

        - Consolidate all SOAP calls using (already in jMoby existing) -libraries SoapUtils and AxisUtils.

        @@ -94,7 +77,7 @@

        -

        Known bugs

        +

        Known bugs (see also Open-bio Bugzilla)

        @@ -119,7 +102,7 @@
        Martin Senger
        -Last modified: Thu May 19 11:20:08 2005 +Last modified: Tue Sep 20 16:34:17 2005
        From senger at pub.open-bio.org Tue Sep 20 03:48:14 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 20 Sep 2005 03:48:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509200748.j8K7mEK3004147@pub.open-bio.org> senger Tue Sep 20 03:48:14 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv4128 Modified Files: EclipseAndJMoby.html Log Message: moby-live/Java/docs EclipseAndJMoby.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/20 07:30:09 1.1 +++ /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/20 07:48:14 1.2 @@ -319,6 +319,10 @@ outside Eclipse you need refresh Eclipse: F5 or (jMoby) -> Refresh.

        +And, of course, for us, dinosaurs, change Windows +-> Preferences -> General -> Keys -> Modify -> +Schema to Emacs.

        + Good luck.

        @@ -326,7 +330,7 @@

        Martin Senger
        -Last modified: Tue Sep 20 16:21:13 2005 +Last modified: Tue Sep 20 16:39:39 2005
        From senger at pub.open-bio.org Tue Sep 20 11:17:55 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 20 Sep 2005 11:17:55 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509201517.j8KFHt51005654@pub.open-bio.org> senger Tue Sep 20 11:17:55 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv5631 Modified Files: ChangeLog EclipseAndJMoby.html Log Message: moby-live/Java/docs ChangeLog,1.40,1.41 EclipseAndJMoby.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/19 08:08:32 1.40 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/20 15:17:55 1.41 @@ -1,3 +1,8 @@ +2005-09-20 Martin Senger + + * Fixed CentralDigestImpl - it shows now correct service type + description. + 2005-09-19 Martin Senger * Added caching for namespaces to CentralDigestCachedImpl =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/20 07:48:14 1.2 +++ /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/20 15:17:55 1.3 @@ -32,7 +32,7 @@ ways to do" things in Eclipse (but not as many as in Perl ) so the steps described below may not represent the only way, and I do not claim that are the most -efficient - but TGB (The Good Thing) is that they work.

        +efficient - but TGT (The Good Thing) is that they work.

        jMoby is just like any other Ant-based Java project. It has its own build.xml and it has many @@ -330,7 +330,7 @@

        Martin Senger
        -Last modified: Tue Sep 20 16:39:39 2005 +Last modified: Wed Sep 21 00:09:16 2005
        From kawas at pub.open-bio.org Tue Sep 20 17:16:11 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 20 Sep 2005 17:16:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202116.j8KLGBJP006460@pub.open-bio.org> kawas Tue Sep 20 17:16:11 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv6435 Modified Files: Central.pm Log Message: added the suggestions asked for by martin. Code that has been added is commented out until a decision is made on whether to support the changes. Code marked by: #UNCOMMENT denotes code that should be uncommented to add functionality #COMMENT/REMOVE denotes code that should be removed in conjunction with the additions. Lines subject to removal: 2620, 2626, 2806 Lines subject to addition: 2621, 2627, 2807 moby-live/Perl/MOBY Central.pm,1.215,1.216 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.215 retrieving revision 1.216 diff -u -r1.215 -r1.216 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/08/31 22:44:29 1.215 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/20 21:16:11 1.216 @@ -2617,12 +2617,14 @@ my $OS = MOBY::OntologyServer->new( ontology => 'service' ); my %types = %{ $OS->retrieveAllServiceTypes() }; my $types = "\n"; - while ( my ( $serv, $descr ) = each %types ) { + while ( my ( $serv, $descr ) = each %types ) { #COMMENT/REMOVE +# while ( my ( $serv, $descr, $contact, $auth ) = each %types ) { #UNCOMMENT my ($desc, $lsid) = @$descr; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - $types .="\n\n\n"; + $types .="\n\n\n"; #COMMENT/REMOVE +# $types .="\n\n$contact\n$auth\n\n"; #UNCOMMENT } $types .= "\n"; return $types; @@ -2801,7 +2803,8 @@ if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - $ns .= "\n\n\n"; + $ns .= "\n\n\n"; #COMMENT/REMOVE +# $ns .= "\n\n$contact\n$auth\n\n";#UNCOMMENT } $ns .= ""; return $ns; From gss at pub.open-bio.org Tue Sep 20 18:37:03 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Tue, 20 Sep 2005 18:37:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202237.j8KMb33n006752@pub.open-bio.org> gss Tue Sep 20 18:37:03 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org In directory pub.open-bio.org:/tmp/cvs-serv6729 Removed Files: .mymetadata .project Log Message: Removed unused files moby-live/S-MOBY/ref-impl/semanticmoby.org .mymetadata,1.5,NONE .project,1.4,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/RCS/.mymetadata,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/RCS/.project,v: No such file or directory From gss at pub.open-bio.org Tue Sep 20 18:39:03 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Tue, 20 Sep 2005 18:39:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202239.j8KMd3jC006793@pub.open-bio.org> gss Tue Sep 20 18:39:03 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/.settings In directory pub.open-bio.org:/tmp/cvs-serv6771/S-MOBY/ref-impl/semanticmoby.org/.settings Removed Files: org.eclipse.core.resources.prefs Log Message: Removed unused files moby-live/S-MOBY/ref-impl/semanticmoby.org/.settings org.eclipse.core.resources.prefs,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/.settings/RCS/org.eclipse.core.resources.prefs,v: No such file or directory From gss at pub.open-bio.org Tue Sep 20 18:42:18 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Tue, 20 Sep 2005 18:42:18 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202242.j8KMgIsD006852@pub.open-bio.org> gss Tue Sep 20 18:42:18 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv6829/S-MOBY/ref-impl/semanticmoby.org/WebRoot Removed Files: log4j.properties smoby.example.properties Log Message: Removed unused files moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot log4j.properties,1.1,NONE smoby.example.properties,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/RCS/log4j.properties,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/RCS/smoby.example.properties,v: No such file or directory From gss at pub.open-bio.org Tue Sep 20 18:43:04 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Tue, 20 Sep 2005 18:43:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202243.j8KMh499006893@pub.open-bio.org> gss Tue Sep 20 18:43:04 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv6871/S-MOBY/ref-impl/semanticmoby.org/WebRoot Removed Files: .cvsignore Log Message: Removed unused files moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot .cvsignore,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/RCS/.cvsignore,v: No such file or directory From senger at pub.open-bio.org Tue Sep 20 21:12:21 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 20 Sep 2005 21:12:21 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210112.j8L1CLfm007280@pub.open-bio.org> senger Tue Sep 20 21:12:20 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv7261 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.34,1.35 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/19 08:08:31 1.34 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/21 01:12:20 1.35 @@ -100,6 +100,21 @@ + + + + + + + + + + @@ -276,7 +291,7 @@ packagenames="*.*" excludepackagenames="notyet" destdir="${javadoc.dir}" - classpathref="build.classpath" + classpathref="build.classpath.for.javadoc" defaultexcludes="yes" breakiterator="yes" windowtitle="jMoby" From senger at pub.open-bio.org Tue Sep 20 21:20:01 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 20 Sep 2005 21:20:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210120.j8L1K1Xe007374@pub.open-bio.org> senger Tue Sep 20 21:20:01 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv7350 Modified Files: EclipseAndJMoby.html Log Message: moby-live/Java/docs EclipseAndJMoby.html,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/20 15:17:55 1.3 +++ /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/21 01:20:01 1.4 @@ -310,6 +310,25 @@ class="step">Window -> Preferences -> Java -> Compiler -> Errors/Warnings not to see them.

        +

        Fix javadoc location

        + +Ant's targets using javadoc (such as docs or +moses-docs) may fail reporting an error +CreateProcess...javadoc.exe.... This is because the +executable javadoc.exe was not found. Eclipse has not +impressed me here: it can find java but but javadoc (even though I am +aware that javadoc in this case is considered as an external tool). So +you need to tell where is your javadoc.

        + +Either outside of Eclipse: add it to the environment variable PATH (a +usual way). Or inside Eclipse (but here I know only how to set it for +an individual project, not generally): Run -> +External Tools -> External Tool -> Ant Build -> jMoby +build.xml, select tab Environment -> New, +and create a new environment variable PATH and +give it directory where is javadoc, e.g. c:\Program +Files\Java\jdk1.5.0_05\bin.

        +

        Misc

        The project name now should have attached the CVS location. If not you @@ -330,7 +349,7 @@
        Martin Senger
        -Last modified: Wed Sep 21 00:09:16 2005 +Last modified: Wed Sep 21 10:11:37 2005
        From senger at pub.open-bio.org Wed Sep 21 00:02:15 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 21 Sep 2005 00:02:15 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210402.j8L42F87007753@pub.open-bio.org> senger Wed Sep 21 00:02:15 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv7734 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.35,1.36 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/21 01:12:20 1.35 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/21 04:02:15 1.36 @@ -72,8 +72,8 @@ - - + + @@ -1205,11 +1205,11 @@ - + - + - Property 'moses.service' is not set. + Neither property 'moses.service' or 'moses.authority is set. This means that skeletons for ALL services will be generated. If this is what you want, press 'y'. Continue? @@ -1248,6 +1248,13 @@ + + + + + + + From senger at pub.open-bio.org Wed Sep 21 01:26:18 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 21 Sep 2005 01:26:18 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210526.j8L5QIT7008156@pub.open-bio.org> senger Wed Sep 21 01:26:18 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv8101/src/config Modified Files: run-any-client.bat run-cache-client.bat run-cmdline-client.bat run-dashboard.bat run-digest-client.bat run-generator.bat run-graphs-client.bat run-moby-parser.bat run-service.bat run-testing-central.bat Log Message: making windows scripts better \(but not much\) moby-live/Java/src/config run-any-client.bat,1.4,1.5 run-cache-client.bat,1.2,1.3 run-cmdline-client.bat,1.3,1.4 run-dashboard.bat,1.1,1.2 run-digest-client.bat,1.2,1.3 run-generator.bat,1.2,1.3 run-graphs-client.bat,1.2,1.3 run-moby-parser.bat,1.2,1.3 run-service.bat,1.2,1.3 run-testing-central.bat,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-any-client.bat,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/09/18 08:46:25 1.4 +++ /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/09/21 05:26:18 1.5 @@ -1,7 +1,7 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" -cd %PROJECT_HOME% +cd "%PROJECT_HOME%" set CP= for %%i in (lib\*.jar) do call cp.bat %%i set CP=build\classes;%CP% =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat 2005/09/21 05:26:18 1.3 @@ -1,9 +1,10 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% java -classpath "%CP%" CacheRegistryClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2005/09/21 05:17:32 1.3 +++ /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2005/09/21 05:26:18 1.4 @@ -1,7 +1,7 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" -cd %PROJECT_HOME% +cd "%PROJECT_HOME%" set CP= for %%i in (lib\*.jar) do call cp.bat %%i set CP=build\classes;%CP% =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat 2005/09/18 14:05:32 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat 2005/09/21 05:26:18 1.2 @@ -1,12 +1,13 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" -set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" -set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" -set "CP=%PROJECT_HOME%\build\others\samples;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% +set CP=build\others\datatypes;%CP% +set CP=build\others\skeletons;%CP% +set CP=build\others\samples;%CP% java -classpath "%CP%" org.biomoby.service.dashboard.Dashboard %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat 2005/09/21 05:26:18 1.3 @@ -1,9 +1,10 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% java -classpath "%CP%" MobyDigestClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-generator.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-generator.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-generator.bat 2005/09/21 05:26:18 1.3 @@ -1,11 +1,12 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" -set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" -set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% +set CP=build\others\datatypes;%CP% +set CP=build\others\skeletons;%CP% java -classpath "%CP%" MosesGenerators %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat 2005/09/21 05:26:18 1.3 @@ -1,9 +1,10 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% java -classpath "%CP%" MobyGraphs %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat 2005/09/21 05:26:18 1.3 @@ -1,10 +1,11 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" -set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% +set CP=build\others\datatypes;%CP% java -classpath "%CP%" TestingMobyParser %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-service.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-service.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-service.bat 2005/09/21 05:26:18 1.3 @@ -1,12 +1,13 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" -set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" -set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" -set "CP=%PROJECT_HOME%\build\others\samples;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% +set CP=build\others\datatypes;%CP% +set CP=build\others\skeletons;%CP% +set CP=build\others\samples;%CP% java -classpath "%CP%" org.biomoby.client.BaseCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat 2005/09/21 05:26:18 1.3 @@ -1,9 +1,10 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% java -classpath "%CP%" TestingCentral %1 %2 %3 %4 %5 %6 %7 %8 %9 From senger at pub.open-bio.org Wed Sep 21 02:03:49 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 21 Sep 2005 02:03:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210603.j8L63nsa008383@pub.open-bio.org> senger Wed Sep 21 02:03:49 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv8360 Modified Files: ChangeLog EclipseAndJMoby.html Log Message: moby-live/Java/docs ChangeLog,1.41,1.42 EclipseAndJMoby.html,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/20 15:17:55 1.41 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/21 06:03:49 1.42 @@ -1,3 +1,8 @@ +2005-09-21 Martin Senger + + * Fixed build.xml not to produce javadoc warnings with Java 1.5 in + Eclipse. + 2005-09-20 Martin Senger * Fixed CentralDigestImpl - it shows now correct service type =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/21 01:20:01 1.4 +++ /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/21 06:03:49 1.5 @@ -329,6 +329,34 @@ give it directory where is javadoc, e.g. c:\Program Files\Java\jdk1.5.0_05\bin.

        +

        Running jMoby command-line scripts

        + +jMoby has a few scripts that can be invoked from a command-line with +number of arguments. From the Eclipse point of view, they are the same +as any other external tools. Perhaps the only difference is that they +must be first copied from their source directory (src/config) +to their destination place (build/run). The copying is not +used because it matters where they are invoked from, but because they +are not only copied but also updated. That's why - before you use them +- you need (at least once) to run a jMoby Ant's task compile or config. Eclipse own +compilation (called building) is not enough, it does not copy +the scripts.

        + +Once you have them in build/run you can run them from Eclipse +(as always with external scripts, you type more the first time you use +a script, but Eclipse remembers it and the next time you will see +already your script name in a menu): Run -> +External Tools -> External Tools -> Program -> New. Name +it (e.g. run-cmdline-client), and Location +-> Browse Workspace to select it (in our example find and +select build/run/run-cmdline-client.bat). Most of these +scripts have an option -help - so put it in Arguments - and change it each time you wish to +invoke them with different arguments.

        + + +

        Misc

        The project name now should have attached the CVS location. If not you @@ -349,7 +377,7 @@
        Martin Senger
        -Last modified: Wed Sep 21 10:11:37 2005 +Last modified: Wed Sep 21 14:55:00 2005
        From senger at pub.open-bio.org Wed Sep 21 01:17:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 21 Sep 2005 01:17:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210517.j8L5HWaS008047@pub.open-bio.org> senger Wed Sep 21 01:17:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv8028/src/config Modified Files: run-cmdline-client.bat Log Message: make it better for windows moby-live/Java/src/config run-cmdline-client.bat,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2005/09/21 05:17:32 1.3 @@ -1,9 +1,10 @@ - at echo off - -set "PROJECT_HOME=@PROJECT_HOME@" -set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" - -java -classpath "%CP%" MobyCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 + at echo off + +set "PROJECT_HOME=@PROJECT_HOME@" +cd %PROJECT_HOME% +set CP= +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% + +java -classpath "%CP%" MobyCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 From senger at pub.open-bio.org Wed Sep 21 02:13:28 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 21 Sep 2005 02:13:28 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210613.j8L6DSAa008441@pub.open-bio.org> senger Wed Sep 21 02:13:28 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv8418 Modified Files: run-dashboard run-dashboard.bat Log Message: moby-live/Java/src/config run-dashboard,1.1,1.2 run-dashboard.bat,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-dashboard,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-dashboard 2005/09/18 14:05:32 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-dashboard 2005/09/21 06:13:28 1.2 @@ -12,6 +12,7 @@ CLASSPATH=${PROJECT_HOME}/build/others/datatypes:$CLASSPATH CLASSPATH=${PROJECT_HOME}/build/others/skeletons:$CLASSPATH CLASSPATH=${PROJECT_HOME}/build/others/samples:$CLASSPATH +CLASSPATH=${PROJECT_HOME}/build/lib/dashboard-config.jar:$CLASSPATH CLASSPATH=`echo ${PROJECT_HOME}/lib/*.jar | tr ' ' ':'`:$CLASSPATH exec java -cp $CLASSPATH org.biomoby.service.dashboard.Dashboard "$@" =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat 2005/09/21 05:26:18 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat 2005/09/21 06:13:28 1.3 @@ -9,5 +9,6 @@ set CP=build\others\datatypes;%CP% set CP=build\others\skeletons;%CP% set CP=build\others\samples;%CP% +set CP=build\lib\dashboard-config.jar;%CP% java -classpath "%CP%" org.biomoby.service.dashboard.Dashboard %1 %2 %3 %4 %5 %6 %7 %8 %9 From senger at pub.open-bio.org Wed Sep 21 03:56:55 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 21 Sep 2005 03:56:55 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210756.j8L7ut1R008830@pub.open-bio.org> senger Wed Sep 21 03:56:55 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv8807 Modified Files: EclipseAndJMoby.html index.html Added Files: WindowsAndJMoby.html Log Message: moby-live/Java/docs WindowsAndJMoby.html,NONE,1.1 EclipseAndJMoby.html,1.5,1.6 index.html,1.14,1.15 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/21 06:03:49 1.5 +++ /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/21 07:56:55 1.6 @@ -331,17 +331,17 @@

        Running jMoby command-line scripts

        -jMoby has a few scripts that can be invoked from a command-line with -number of arguments. From the Eclipse point of view, they are the same -as any other external tools. Perhaps the only difference is that they -must be first copied from their source directory (src/config) -to their destination place (build/run). The copying is not -used because it matters where they are invoked from, but because they -are not only copied but also updated. That's why - before you use them -- you need (at least once) to run a jMoby Ant's task compile or config. Eclipse own -compilation (called building) is not enough, it does not copy -the scripts.

        +jMoby has a few scripts that can be +invoked from a command-line with number of arguments. From the Eclipse +point of view, they are the same as any other external tools. Perhaps +the only difference is that they must be first copied from their +source directory (src/config) to their destination place +(build/run). The copying is not used because it matters where +they are invoked from, but because they are not only copied but also +updated. That's why - before you use them - you need (at least once) +to run a jMoby Ant's task compile or config. Eclipse own compilation (called +building) is not enough, it does not copy the scripts.

        Once you have them in build/run you can run them from Eclipse (as always with external scripts, you type more the first time you use @@ -377,7 +377,7 @@

        Martin Senger
        -Last modified: Wed Sep 21 14:55:00 2005 +Last modified: Wed Sep 21 15:07:18 2005
        =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/index.html,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- /home/repository/moby/moby-live/Java/docs/index.html 2005/09/20 07:30:09 1.14 +++ /home/repository/moby/moby-live/Java/docs/index.html 2005/09/21 07:56:55 1.15 @@ -45,6 +45,7 @@ @@ -90,7 +91,7 @@
        Martin Senger
        -Last modified: Tue Sep 20 12:21:24 2005 +Last modified: Wed Sep 21 15:27:30 2005
        From kawas at pub.open-bio.org Wed Sep 21 13:11:39 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 21 Sep 2005 13:11:39 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509211711.j8LHBd6h012052@pub.open-bio.org> kawas Wed Sep 21 13:11:39 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/errorpages In directory pub.open-bio.org:/tmp/cvs-serv12027/org/biomoby/client/ui/graphical/servlet/errorpages Modified Files: Error404.java Log Message: removed carriage returns moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/errorpages Error404.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/errorpages/Error404.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/errorpages/Error404.java 2005/04/07 21:02:01 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/errorpages/Error404.java 2005/09/21 17:11:39 1.3 @@ -86,7 +86,7 @@ + " contents='';" + " row=Math.max(0,index-7);" + " while(row kawas Wed Sep 21 13:13:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources In directory pub.open-bio.org:/tmp/cvs-serv12084/org/biomoby/client/ui/graphical/servlet/jresources Modified Files: RESOURCE.java Log Message: removed carriage returns and replaced \n with more portable java system calls. moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources RESOURCE.java,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java 2005/08/29 23:11:08 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java 2005/09/21 17:13:51 1.11 @@ -130,7 +130,7 @@ + " contents='';" + " row=Math.max(0,index-7);" + " while(row\r\n"); + "" + System.getProperty("line.separator") + ""); // add the predicates here buffer.append(createOntologyBlock("http://biomoby.org/RESOURCES/MOBY-S/Predicates#", "The BioMoby Predicates Vocabulary (moby)", @@ -1163,7 +1163,7 @@ // end the addition of predicates here buffer.append( - "\r\n" + + "" + System.getProperty("line.separator") + "" + ""); return buffer.toString(); } @@ -1171,56 +1171,56 @@ private String createPropertyBlock(String about, String definedBy, String label, String comment, String domain, String range) { String s = - "\r\n\r\n" + - " \r\n" + - " " + label + "\r\n" + - " " + comment + "\r\n" + - " \r\n" + - " \r\n" + - "\r\n"; + "" + System.getProperty("line.separator") + "" + System.getProperty("line.separator") + "" + + " " + System.getProperty("line.separator") + "" + + " " + label + "" + System.getProperty("line.separator") + "" + + " " + comment + "" + System.getProperty("line.separator") + "" + + " " + System.getProperty("line.separator") + "" + + " " + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + ""; return s; } private String createClassBlock(String about, String definedBy, String label, String comment, String subClassOf) { String s = - "\r\n\r\n" + - " \r\n" + - " "+ label +"\r\n" + - " "+ comment +"\r\n" + - " \r\n" + - "\r\n"; + "" + System.getProperty("line.separator") + "" + System.getProperty("line.separator") + "" + + " " + System.getProperty("line.separator") + "" + + " "+ label +"" + System.getProperty("line.separator") + "" + + " "+ comment +"" + System.getProperty("line.separator") + "" + + " " + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + ""; return s; } private String createDescriptionBlock(String about, String[] seeAlsos) { if (seeAlsos == null) - return "\r\n"; + return "" + System.getProperty("line.separator") + ""; StringBuffer sb = new StringBuffer(); - sb.append(" \r\n"); + sb.append(" " + System.getProperty("line.separator") + ""); for (int x = 0; x < seeAlsos.length; x++) { - sb.append(" \r\n"); + sb.append(" " + System.getProperty("line.separator") + ""); } - sb.append("\r\n"); + sb.append("" + System.getProperty("line.separator") + ""); return sb.toString(); } private String createOntologyBlock(String about, String title, String description) { - String s ="\r\n\r\n" + " " + title + "\r\n" - + " " + description + "\r\n" - + "\r\n"; + String s ="" + System.getProperty("line.separator") + "" + System.getProperty("line.separator") + "" + " " + title + "" + System.getProperty("line.separator") + "" + + " " + description + "" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + ""; return s; } private String createEscapedComment(String comment) { - String s = "\r\n\r\n"; + String s = "" + System.getProperty("line.separator") + "" + System.getProperty("line.separator") + ""; return s; } public static void main(String[] args) throws Exception { - System.out.println(new RESOURCE().getRESOURCES("Namespaces")); + System.out.println(new RESOURCE().getRESOURCES("Predicates")); } } \ No newline at end of file From fgibbons at pub.open-bio.org Wed Sep 21 15:08:28 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Wed, 21 Sep 2005 15:08:28 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509211908.j8LJ8Sc0012462@pub.open-bio.org> fgibbons Wed Sep 21 15:08:28 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv12437/t Modified Files: CommonSubs.t Log Message: - Added new test of collectionResponse, including tests for correct failure. - Still needs tests for complexResponse, whatever that is .... - Fixed earlier test that tried to create article from empty string. moby-live/Perl/t CommonSubs.t,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/CommonSubs.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/t/CommonSubs.t 2005/08/30 15:19:05 1.2 +++ /home/repository/moby/moby-live/Perl/t/CommonSubs.t 2005/09/21 19:08:28 1.3 @@ -11,13 +11,13 @@ # change 'tests => 1' to 'tests => last_test_to_print'; #use SOAP::Lite +trace; -use Test::More 'no_plan'; #tests => 127; # perldoc Test::More for details +use Test::More 'no_plan'; #skip_all => "Turned off for development"; #'no_plan'; use strict; use English; use Data::Dumper; #Is the client-code even installed? BEGIN { use_ok('MOBY::CommonSubs') }; -use MOBY::CommonSubs qw /:all/; +use MOBY::CommonSubs qw/:all/; use XML::LibXML; use MOBY::MobyXMLConstants; @@ -26,33 +26,34 @@ }; my @must_implement = qw/ - genericServiceInputParser - genericServiceInputParserAsObject + collectionResponse + complexResponse complexServiceInputParser extractRawContent - validateNamespaces - validateThisNamespace + extractResponseArticles + genericServiceInputParser + genericServiceInputParserAsObject + getArticles + getCollectedSimples + getCrossReferences getInputArticles - getInputs getInputID - getArticles + getInputs + getNodeContentWithArticle + getResponseArticles + getServiceNotes getSimpleArticleIDs getSimpleArticleNamespaceURI - getCollectedSimples - getNodeContentWithArticle - isSimpleArticle isCollectionArticle isSecondaryArticle - extractResponseArticles - getResponseArticles - getCrossReferences - simpleResponse - collectionResponse - complexResponse - responseHeader + isSimpleArticle responseFooter + responseHeader + simpleResponse + validateNamespaces + validateThisNamespace whichDeepestParentObject - getServiceNotes/; +/; can_ok('MOBY::CommonSubs', @must_implement) or diag("CommonSubs doesn't implement all the methods that it should"); @@ -65,21 +66,21 @@ # complexServiceInputParser ######## EXTRACT CONTENTS ######### +my @query_ids = (1, 'a', 23, 24); my $msg = < - - -foo + + + +foo EOF my @inputs = getInputs(responseHeader() . $msg . responseFooter()); -is(scalar @inputs, 4) +is(scalar @inputs, scalar @query_ids) or diag("Wrong number of inputs returned from getInputs"); -is(getInputID($inputs[0]), 1) or diag("Wrong input ID returned for $inputs[0]"); -is(getInputID($inputs[1]), 'a') or diag("Wrong input ID returned for $inputs[1]"); -is(getInputID($inputs[2]), 23) or diag("Wrong input ID returned for $inputs[2]"); -is(getInputID($inputs[3]), 24) or diag("Wrong input ID returned for $inputs[3]"); - +for (my $i = 0; $i < @query_ids; $i++) { + is(getInputID($inputs[$i]), $query_ids[$i]) + or diag("Wrong input ID returned for queryID $i: $inputs[$i]"); +} # This message contains two articles: Collection, and Parameter # The Collection, of course, contains some Simple Articles, but they are not top-level articles. my $article_msg = < - + " @@ -252,7 +258,11 @@ my $parser = XML::LibXML->new(); my $doc; eval { $doc = $parser->parse_string( $XML ); }; - return '' if ( $EVAL_ERROR ); #("Couldn't parse '$XML' because:\n\t$EVAL_ERROR") + if ($EVAL_ERROR) { + my ($package, $filename, $line) = caller; + die "XML_maker called from line $line:Couldn't parse '$XML' because:\n\t" + . "$EVAL_ERROR"; + } return $doc->getDocumentElement(); } @@ -280,7 +290,7 @@ # and for completely fictitious parameters. # Examples here should be syntactically correct (namespace should be correct) # just wrong article-types. -my @not_articles = ("", "", "foo", +my @not_articles = ("", "foo", "", "", ""); for my $a (@not_articles) { for my $test (\&isSimpleArticle, \&isCollectionArticle, \&isSecondaryArticle) { @@ -322,18 +332,19 @@ my $sresp = XML_maker(responseHeader() # Need header for namespace def . simpleResponse($data, $articleName, $qID) . responseFooter()); -$sresp = $sresp->getElementsByTagName('moby:mobyData') - || $sresp->getElementsByTagName('mobyData'); +$sresp = $sresp->getElementsByTagName('moby:mobyData'); +# || $sresp->getElementsByTagName('mobyData'); is($sresp->size(), 1) or diag("SimpleResponse should contain only a single mobyData element."); my $mobyData = $sresp->get_node(1); -is($mobyData->getAttribute('queryID') || $mobyData->getAttribute('moby:queryID'), $qID) +is($mobyData->getAttribute('moby:queryID') || $mobyData->getAttribute('queryID'), + $qID) or diag("SimpleResponse didn't contain right queryID"); -my $children = $mobyData->childNodes; + my $simple; my $count_elements = 0; -foreach ($children->get_nodelist) { - if ($_->nodeType == ELEMENT_NODE) { $simple = $_; $count_elements++;} +foreach ($mobyData->childNodes->get_nodelist) { + if ($_->nodeType == ELEMENT_NODE) { $count_elements++ } } is($count_elements, 1) or diag("SimpleResponse's mobyData should have only a single child element:"); @@ -347,10 +358,80 @@ TODO: { local $TODO = "Need tests for collectionResponse and complexResponse"; - # collectionResponse - # complexResponse +# complexResponse takes two arguments: $data, $qID +# $data is arrayref, elements can also be arrayref, or string. +#my $data = ''; + +} +{ + # collectionResponse takes 3 args: $data, $articlename, $qID + # $data is a arrayref of MOBY OBjects as raw XML. + my ($qID, $aname, $ns, $id, $string) = ("23", "my_artIcLe", "taxon", "foo", "some_text"); + my $simple = "$string"; + my $data = [$simple, $simple, $simple]; + my $coll_resp = collectionResponse($data, $aname, $qID); + + # Regular expressions are not the best way (!) to validate XML, but it's worth a quick check. + ok($coll_resp =~ /^\s* \ # Top-level tag should be mobyData +\s* \ +.* # Don't worry too much about the innermost details - we'll get them with DOM. +\s* \<\/moby\:Collection\> +\s* \<\/moby\:mobyData\> \s* $/sx) + # In above regexpt, 's' allows matching in multiline strings; + # 'x' ignores comments and literal whitespace in regexp + # Because we attempt to return 'pretty' XML, we need to allow for whitespace between all tags, + # which explains why the regexp is peppered with '\s*' + or diag("collectionResponse should have mobyData as outermost tag: got '$coll_resp'"); + # Now parse the XML, and make sure it checks out according to DOM + my $coll_resp_dom = XML_maker(responseHeader() . $coll_resp . responseFooter()); + my $mData = $coll_resp_dom->getElementsByTagName('moby:mobyData'); + is($mData->size(), 1) + or diag("CollectionResponse should contain only a single mobyData element."); + $mData = $mData->get_node(1); + is($mData->getAttribute('moby:queryID') || $mData->getAttribute('queryID'), + $qID) + or diag("CollectionResponse's mobyData element didn't contain correct queryID"); + my $colls = $mData->getElementsByTagName("moby:Collection"); + is ($colls->size(), 1) + or diag("CollectionResponse should have only a single child: Collection."); + my $Coll = $colls->get_node(1); + is($Coll->getAttribute('moby:articleName') || $Coll->getAttribute('articleName'), + $aname) + or diag("CollectionResponse didn't contain correct articleName"); + my $simples = $Coll->getElementsByTagName("moby:Simple") + || $Coll->getElementsByTagName("Simple"); + is(scalar @{$simples}, scalar @{$data}) + or diag("CollectionResponse contains wrong number of Simples"); + + # # Finally, parse the sucker with the tools in CommonSubs: it should be able to understand its own creations! + my @inputs = getInputs(responseHeader() . $coll_resp . responseFooter() ); + is(scalar @inputs, 1) + or diag("CollectionResponse should contain only one mobyData block"); + is(getInputID($inputs[0]), $qID) + or diag("CollectionResponse returned mobyData block with incorrect queryID attribute"); + my @articles = getArticles($inputs[0]); + is(scalar @articles, 1) + or diag("CollectionResponse should contain only one Collection"); + is($articles[0]->[0], $aname) + or diag("CollectionResponse had incorrect articleName"); + my @collected_simples = getCollectedSimples($articles[0]->[1]); + is(scalar @collected_simples , scalar @{$data}) + or diag("CollectionResponse contained incorrect number of Simples"); + +# Test response when one or more simples are empty/undef. +# They should result in empty Simple tags, but the total response should NOT be empty. + $coll_resp = collectionResponse([], $aname, $qID); + ok($coll_resp =~ /^\s*\$/) + or diag("CollectionResponse should be empty mobyData tag when empty data supplied"); + $data = [undef, $simple, $simple]; + $coll_resp = collectionResponse($data, $aname, $qID); + ok( !($coll_resp =~ /^\s*\$/sx)) + or diag("CollectionResponse should not be empty " + . "just because first element evaluates to false"); } +#------------------ # Check header/footer # How can we parse incomplete XML for correctness....? my ($authURI, $service_notes) = ("your.site.here", From senger at pub.open-bio.org Sun Sep 18 04:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:46:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQgF023487@pub.open-bio.org> senger Sun Sep 18 04:46:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv23355/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java ConsolePanel.java Dashboard.java DashboardPanel.java DashboardProperties.java EventGeneratorPanel.java NOTES RegistryPanel.java Added Files: CommonTree.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard CommonTree.java,NONE,1.1 AbstractPanel.java,1.3,1.4 ConsolePanel.java,1.1,1.2 Dashboard.java,1.1,1.2 DashboardPanel.java,1.2,1.3 DashboardProperties.java,1.1,1.2 EventGeneratorPanel.java,1.1,1.2 NOTES,1.1,1.2 RegistryPanel.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/13 06:53:28 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/18 08:46:26 1.4 @@ -8,21 +8,48 @@ package org.biomoby.service.dashboard; +import org.tulsoft.shared.UUtils; +import org.tulsoft.shared.PrefsUtils; import org.tulsoft.tools.gui.SwingUtils; +import org.tulsoft.tools.gui.JTextFieldWithHistory; +import org.tulsoft.tools.gui.JFileChooserWithHistory; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.Icon; -import javax.swing.JComponent; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JTextField; +import javax.swing.JFileChooser; import javax.swing.AbstractButton; +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.border.Border; +import javax.swing.border.TitledBorder; +import javax.swing.border.CompoundBorder; +import javax.swing.border.EmptyBorder; +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.filechooser.FileFilter; import javax.swing.text.html.HTMLDocument; +import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import java.awt.Insets; +import java.awt.Font; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import java.awt.event.ItemListener; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeSupport; +import java.io.File; +import java.util.prefs.Preferences; + /** * WORK IN PROGRESS.

        * @@ -34,31 +61,29 @@ extends JPanel implements DashboardPanel { - // copy here some often used constants protected static final int RELATIVE = GridBagConstraints.RELATIVE; protected static final int REMAINDER = GridBagConstraints.REMAINDER; protected static final int NONE = GridBagConstraints.NONE; protected static final int BOTH = GridBagConstraints.BOTH; - protected static final int HORIZONTAL = GridBagConstraints.HORIZONTAL; - protected static final int VERTICAL = GridBagConstraints.VERTICAL; + protected static final int HORI = GridBagConstraints.HORIZONTAL; + protected static final int VERT = GridBagConstraints.VERTICAL; protected static final int CENTER = GridBagConstraints.CENTER; protected static final int NORTH = GridBagConstraints.NORTH; - protected static final int NORTHEAST = GridBagConstraints.NORTHEAST; + protected static final int NEAST = GridBagConstraints.NORTHEAST; protected static final int EAST = GridBagConstraints.EAST; - protected static final int SOUTHEAST = GridBagConstraints.SOUTHEAST; + protected static final int SEAST = GridBagConstraints.SOUTHEAST; protected static final int SOUTH = GridBagConstraints.SOUTH; - protected static final int SOUTHWEST = GridBagConstraints.SOUTHWEST; + protected static final int SWEST = GridBagConstraints.SOUTHWEST; protected static final int WEST = GridBagConstraints.WEST; - protected static final int NORTHWEST = GridBagConstraints.NORTHWEST; - protected static final int PAGE_START = GridBagConstraints.PAGE_START; - protected static final int PAGE_END = GridBagConstraints.PAGE_END; - protected static final int LINE_START = GridBagConstraints.LINE_START; - protected static final int LINE_END = GridBagConstraints.LINE_END; - protected static final int FIRST_LINE_START = GridBagConstraints.FIRST_LINE_START; - protected static final int FIRST_LINE_END = GridBagConstraints.FIRST_LINE_END; - protected static final int LAST_LINE_START = GridBagConstraints.LAST_LINE_START; - protected static final int LAST_LINE_END = GridBagConstraints.LAST_LINE_END; + protected static final int NWEST = GridBagConstraints.NORTHWEST; + + // something need to be done only once - keep it here + protected Icon panelIcon; + protected JComponent pComponent; + + // re-use "style" components + protected static final Insets BREATH_TOP = new Insets (10,0,0,0); /********************************************************************* @@ -82,6 +107,16 @@ return null; } + /************************************************************************** + * + **************************************************************************/ + public JLabel getTitle() { + JLabel title = new JLabel (getName(), getIcon(), JLabel.CENTER); + title.setFont (new Font ("Serif", Font.BOLD, 20)); + title.setForeground (new Color (12, 55, 241)); + return title; + } + /********************************************************************* * Property change stuff ********************************************************************/ @@ -117,11 +152,6 @@ **************************************************************************/ abstract public String getName(); - /************************************************************************** - * - **************************************************************************/ - abstract public JLabel getTitle(); - // // Methods to be used by sub-classes // @@ -137,6 +167,112 @@ } /********************************************************************* + * Create a button (with a unified style). + ********************************************************************/ + protected static JButton createButton (String name, + String toolTipText, + int mnemonic, + ActionListener listener) { + JButton button = new JButton (name); + commonButtonLookAndFeel (button); + button.setToolTipText (toolTipText); + if (mnemonic > 0) + button.setMnemonic (mnemonic); + button.addActionListener (listener); + return button; + } + + /********************************************************************* + * Create a check-box (with a unified style). + ********************************************************************/ + protected static JCheckBox createCheckBox (String label, + boolean isSelected, + int mnemonic, + ItemListener listener) { + JCheckBox box = new JCheckBox (label, isSelected); + if (mnemonic > 0) + box.setMnemonic (mnemonic); + box.addItemListener (listener); + box.setFocusPainted (false); + return box; + } + + /********************************************************************* + * Create a horizontal panel with given buttons. + ********************************************************************/ + protected static JPanel createButtonPanel (JButton[] buttons) { + + JPanel buttonPanel = new JPanel(); + buttonPanel.setLayout (new BoxLayout (buttonPanel, BoxLayout.LINE_AXIS)); + buttonPanel.setBorder (BorderFactory.createEmptyBorder (10, 0, 0, 10)); + buttonPanel.add (Box.createHorizontalGlue()); + for (int i = 0; i < buttons.length; i++) + buttonPanel.add (buttons[i]); + return buttonPanel; + } + + /********************************************************************* + * Create a titled panel using the given title and GridBagLayout. + ********************************************************************/ + protected static JPanel createTitledPanel (String title) { + JPanel titledPanel = new JPanel (new GridBagLayout()); + Border blackline = BorderFactory.createLineBorder (Color.black); + CompoundBorder compoundBorder = + BorderFactory.createCompoundBorder (BorderFactory.createTitledBorder (blackline, title), + BorderFactory.createEmptyBorder (5, 5, 5, 5)); + titledPanel.setBorder (compoundBorder); + return titledPanel; + } + + /********************************************************************* + * Create a panel with given text field and with a directory/file + * browser button attached. + * + * @param chooserMode should be one of + * JFileChooser.DIRECTORIES_ONLY, JFileChooser.FILES_ONLY, and + * JFileChooser.FILES_AND_DIRECTORIES (but it is not tested) + ********************************************************************/ + protected JFileChooserWithHistory createFileSelector (String chooserTitle, + String approveButtonText, + int chooserMode, + String defaultValue, + FileFilter filter) { + JFileChooserWithHistory chooser = + new JFileChooserWithHistory (null, this, "cacheDirectory"); + + JFileChooser ch = chooser.getFileChooser(); + ch.setFileSelectionMode (chooserMode); + if (filter != null) + ch.setFileFilter (filter); + ch.setApproveButtonText (approveButtonText); + ch.setDialogTitle (chooserTitle); + + if (UUtils.notEmpty (defaultValue) && + chooser.getSelectedFile() == null) + chooser.setSelectedFile (new File (defaultValue)); + + return chooser; + } + + /********************************************************************* + * + ********************************************************************/ + protected boolean getPrefValue (String key, + boolean defaultValue) { + Preferences node = PrefsUtils.getNode (this.getClass()); + return node.getBoolean (key, defaultValue); + } + + /********************************************************************* + * + ********************************************************************/ + protected void setPrefValue (String key, + boolean value) { + Preferences node = PrefsUtils.getNode (this.getClass()); + node.putBoolean (key, value); + } + + /********************************************************************* * Return true if confirmation dialog passed. ********************************************************************/ public boolean confirm (Object msg) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/13 06:54:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/18 08:46:26 1.2 @@ -22,6 +22,7 @@ import java.awt.Font; import java.awt.GridBagLayout; +import java.awt.event.KeyEvent; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.beans.PropertyChangeListener; @@ -85,19 +86,20 @@ textArea.setEditable (false); JScrollPane scroller = new JScrollPane (textArea); - JButton cleanButton = new JButton (" Clean "); - commonButtonLookAndFeel (cleanButton); - cleanButton.setToolTipText ("Remove all messages from the console area"); - cleanButton.addActionListener (new ActionListener() { - public void actionPerformed (ActionEvent e) { - if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) - textArea.setText (""); - } - }); + JButton cleanButton = + createButton (" Clean ", + "Remove all messages from the console area", + KeyEvent.VK_C, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) + textArea.setText (""); + } + }); // put it together - SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, FIRST_LINE_START, 1.0, 1.0); - SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, FIRST_LINE_START, 0.0, 0.0); + SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); + SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); return p; } @@ -109,11 +111,4 @@ return "Debugging Console"; } - /************************************************************************** - * - **************************************************************************/ - public JLabel getTitle() { - return new JLabel (getName()); - } - } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/13 06:54:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/18 08:46:26 1.2 @@ -20,7 +20,11 @@ import javax.swing.JLabel; import javax.swing.Icon; import javax.swing.text.html.HTMLDocument; +import javax.swing.event.ChangeListener; +import javax.swing.event.ChangeEvent; + import java.awt.GridBagLayout; +import java.awt.Font; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; @@ -29,7 +33,9 @@ import java.util.Vector; import java.util.Enumeration; import java.util.Properties; +import java.util.Date; import java.net.URL; +import java.text.DateFormat; /** * WORK IN PROGRESS.

        @@ -39,13 +45,16 @@ */ public class Dashboard - implements DashboardPanel { + implements DashboardPanel, ChangeListener { + private JComponent dashboard; + private StatusBar statusBar; + private DashboardHeader header; + protected JTabbedPane tabbedPane; protected DashboardPanel[] panels; protected static Properties dashboardProperties; static { - final String DASHBOARD_PROPERTIES_FILE = "dashboard.properties"; try { // get the classloader for this class ClassLoader loader = Dashboard.class.getClassLoader(); @@ -53,11 +62,8 @@ loader = Thread.currentThread().getContextClassLoader(); } -// unknownProcessorIcon = -// new ImageIcon(loader.getResource("org/embl/ebi/escience/scuflui/icons/explorer/unknownprocessor.png")); - - // load values from any dashboard.properties file located - // by the class resource loader + // load dashboard properties from a file located by the + // class resource loader Enumeration en = loader.getResources (DASHBOARD_PROPERTIES_FILE); dashboardProperties = new Properties(); while (en.hasMoreElements()) { @@ -71,6 +77,16 @@ } /************************************************************************** + * Default constructor. It loads all panels, connect them and + * creates the GUI - but does not show it yet. + **************************************************************************/ + public Dashboard() { + loadPanels(); + dashboard = getComponent(); + connectPanels(); + } + + /************************************************************************** * Load all available Dashboard panels... **************************************************************************/ public void loadPanels() { @@ -84,31 +100,26 @@ } /************************************************************************** - * Connect all available Dashboard panels... + * Connect all available Dashboard panels: a) together, and b) + * with the status bar. **************************************************************************/ public void connectPanels() { for (int i = 0; i < panels.length; i++) { for (int j = 0; j < i; j++) - connect (panels[i], panels[j]); + panels[i].addPropertyChangeListener (panels[j]); for (int j = i+1; j < panels.length; j++) - connect (panels[i], panels[j]); + panels[i].addPropertyChangeListener (panels[j]); + if (statusBar != null) + panels[i].addPropertyChangeListener (statusBar); } } - // - void connect (DashboardPanel one, DashboardPanel two) { - one.addPropertyChangeListener (two); - } - /************************************************************************** * Show the main frame. **************************************************************************/ public void show() { - JComponent dashboard = getComponent(); - - JFrame frame = SwingUtils.createMainFrame (dashboard, getName()); + JFrame frame = SwingUtils.createMainFrame (getComponent(), getName()); SwingUtils.showMainFrame (frame, dashboard.getPreferredSize()); -// SwingUtils.showMainFrame (frame, dashboard.getPreferredFrameSize()); } /************************************************************************** @@ -125,20 +136,6 @@ return new String (buf); } - /************************************************************************** - * - **************************************************************************/ - public static void main (String[] args) { - SwingUtils.checkJavaVersion(); - - Dashboard dashboard = new Dashboard(); - dashboard.loadPanels(); - dashboard.connectPanels(); -// System.out.println ("DASHBOARD:\n" + dashboard.toString()); - dashboard.show(); - - } - // // Implement DashboardPanel interface // @@ -154,7 +151,15 @@ * **************************************************************************/ public JLabel getTitle() { - return new JLabel (getName()); + Icon titleIcon = + SwingUtils.createIcon (dashboardProperties.getProperty (DP_TITLE_ICON), + this); + String titleStr = dashboardProperties.getProperty (DP_TITLE); + if (titleStr == null && titleIcon == null) + titleStr = getName(); + JLabel title = new JLabel (titleStr, titleIcon, JLabel.CENTER); + title.setFont (new Font ("Serif", Font.BOLD, 30)); + return title; } /************************************************************************** @@ -168,7 +173,8 @@ * **************************************************************************/ public Icon getIcon() { - return null; + return SwingUtils.createIcon (dashboardProperties.getProperty (DP_TITLE_ICON), + this); } /************************************************************************** @@ -176,24 +182,93 @@ **************************************************************************/ public JComponent getComponent() { + if (dashboard != null) + return dashboard; + + // create itself JPanel p = new JPanel (new GridBagLayout(), true); - JComponent header = createHeader(); - JTabbedPane tabbedPane = new JTabbedPane(); + header = getHeader(); + tabbedPane = new JTabbedPane(); + tabbedPane.addChangeListener (this); for (int i = 0; i < panels.length; i++) { tabbedPane.addTab (panels[i].getName(), panels[i].getIcon(), panels[i].getComponent()); } + statusBar = getStatusBar(); // put it all together - SwingUtils.addComponent (p, header, 0, 0, 1, 1, AbstractPanel.HORIZONTAL, AbstractPanel.FIRST_LINE_START, 1.0, 0.0); - SwingUtils.addComponent (p, tabbedPane, 0, 1, 1, 1, AbstractPanel.BOTH, AbstractPanel.FIRST_LINE_START, 1.0, 1.0); + SwingUtils.addComponent (p, header, 0, 0, 1, 1, AbstractPanel.HORI, AbstractPanel.NWEST, 1.0, 0.0); + SwingUtils.addComponent (p, tabbedPane, 0, 1, 1, 1, AbstractPanel.BOTH, AbstractPanel.NWEST, 1.0, 1.0); + SwingUtils.addComponent (p, statusBar, 0, 2, 1, 1, AbstractPanel.HORI, AbstractPanel.WEST, 1.0, 0.0); return p; } - // - JComponent createHeader() { - return getTitle(); + /************************************************************************** + * + **************************************************************************/ + DashboardHeader getHeader() { + DashboardHeader h = new DashboardHeader (dashboardProperties); + if (panels.length > 0) + h.setPanelTitle (panels[0].getTitle()); + return h; + } + + class DashboardHeader extends JPanel { + public DashboardHeader (Properties props) { + super (new GridBagLayout()); + JLabel mainTitle = getTitle(); + JLabel mainIcon = + new JLabel ("", + SwingUtils.createIcon (props.getProperty (DP_ICON), this), + JLabel.CENTER); + JLabel panelTitle = new JLabel(); + + // put it all together (keep 'panelTitle' always as the 3rd component) + SwingUtils.addComponent (this, mainIcon, 0, 0, 1, 2, AbstractPanel.NONE, AbstractPanel.NWEST, 0.0, 0.0); + SwingUtils.addComponent (this, mainTitle, 1, 0, 1, 1, AbstractPanel.NONE, AbstractPanel.NORTH, 1.0, 0.0); + SwingUtils.addComponent (this, panelTitle, 1, 1, 1, 1, AbstractPanel.NONE, AbstractPanel.SOUTH, 0.0, 0.0); + } + public void setPanelTitle (JLabel newTitle) { + remove (2); + SwingUtils.addComponent (this, newTitle, 1, 1, 1, 1, AbstractPanel.NONE, AbstractPanel.SOUTH, 0.0, 0.0); + AwtUtils.redisplay (this); + } + } + + /************************************************************************** + * Return a component representing status bar (usually placed at + * the bottom of a dashboard). + **************************************************************************/ + StatusBar getStatusBar() { + return new StatusBar ("Status: Work in progress"); + } + + class StatusBar extends JLabel implements PropertyChangeListener { + DateFormat df = DateFormat.getTimeInstance(); + public StatusBar (String text) { + super (text); + } + public void propertyChange (PropertyChangeEvent e) { + String prop = e.getPropertyName(); + if (prop == null) return; // no interest in non-specific changes + Object value = e.getNewValue(); + if (value == null) return; // no interest in non-defined new values + if (prop.equalsIgnoreCase (DP_STATUS_MSG)) + setText ("[" + df.format (new Date()) + "] " + value.toString()); + } + } + + /************************************************************************** + * Dashboard is listening to the changes of panels in order to + * repaint the header with a label of a currently selected panel. + **************************************************************************/ + public void stateChanged (ChangeEvent e) { + int panelIndex = tabbedPane.getSelectedIndex(); + if (panelIndex < 0 || panelIndex >= panels.length) + header.setPanelTitle (null); + else + header.setPanelTitle (panels[panelIndex].getTitle()); } /************************************************************************** @@ -214,9 +289,13 @@ public void propertyChange (PropertyChangeEvent event) { } -// Preferences prefs = Preferences.userNodeForPackage (DataThingViewer.class); -// String curDir = prefs.get ("currentDir", System.getProperty("user.home")); -// ... -// prefs.put ("currentDir", fc.getCurrentDirectory().toString()); + /************************************************************************** + * + * An entry point... + * + **************************************************************************/ + public static void main (String[] args) { + new Dashboard().show(); + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/13 06:53:28 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/18 08:46:26 1.3 @@ -16,7 +16,7 @@ /** * An interface that must be implemented by each panel that wants to - * sit on the dashboard.

        + * sit on a dashboard.

        * * WORK IN PROGRESS

        * @@ -32,6 +32,11 @@ extends PropertyChangeListener, DashboardProperties { /************************************************************************** + * Return a graphical representation of this panel. + **************************************************************************/ + JComponent getComponent(); + + /************************************************************************** * A name identifies a panel in the dashboard's tabs. It should be * relatively short, without newlines, or any other special * characters.

        @@ -63,11 +68,6 @@ Icon getIcon(); /************************************************************************** - * The main contents. Here is everything... - **************************************************************************/ - JComponent getComponent(); - - /************************************************************************** * Add a PropertyChangeListener to the listener list of a * panel. All listeners will be notified if this panel changes * some property.

        =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/09/13 06:54:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/09/18 08:46:26 1.2 @@ -18,7 +18,8 @@ /** * A list of names of most/all recognized properties that can be fired - * by dashboard panels.

        + * by dashboard panels, and a list of names of Java properties that + * can be used to configure the dashboard.

        * * @author Martin Senger * @version $Id$ @@ -27,7 +28,34 @@ public interface DashboardProperties { static final String DP_LOG_MSG = "log-msg"; + static final String DP_STATUS_MSG = "status-msg"; static final String DP_SERVICE_NAME = "dp-service-name"; static final String DP_DATATYPE_NAME = "dp-datatype-name"; + /** A filename containing Java properties that configure the + dashboard. */ + static final String DASHBOARD_PROPERTIES_FILE = "dashboard.properties"; + + /** A property name. Its value contains a title that will appear + * in big fonts on top of the dashboard. It may be empty if + * property {@link #DP_TITLE_ICON} is defined; otherwise a default + * value will be used. + */ + static final String DP_TITLE = "dashboard.title"; + + /** A property name. Its value contains a filename with an icon + * accompanying a dashboard title (defined by property {@link + * #DP_TITLE}. No default value used. Specify here either an + * absolute path (not recommended) or a relative path whose + * beginning can be found somewhere on the CLASSPATH. + */ + static final String DP_TITLE_ICON = "dashboard.title.icon"; + + /** A property name. Its value contains a filename with the main + * dashboard icon. Specify here either an absolute path (not + * recommended) or a relative path whose beginning can be found + * somewhere on the CLASSPATH. + */ + static final String DP_ICON = "dashboard.icon"; + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java 2005/09/13 06:54:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java 2005/09/18 08:46:26 1.2 @@ -48,13 +48,14 @@ "Some buttons may use a text put in the adjacent form field.
        " + "For some events, the form field accepts a comma-separated list."); - SwingUtils.addComponent (p, desc, 0, 0, REMAINDER, 1, HORIZONTAL, FIRST_LINE_START, 0.0, 0.0); + SwingUtils.addComponent (p, desc, 0, 0, REMAINDER, 1, HORI, NWEST, 0.0, 0.0); addStringEvent (p, "Service name", DP_SERVICE_NAME); addStringEvent (p, "Data type name", DP_DATATYPE_NAME); + addStringEvent (p, "Status bar message", DP_STATUS_MSG); JLabel empty = new JLabel(); - SwingUtils.addComponent (p, empty, 0, RELATIVE, 2, 1, HORIZONTAL, FIRST_LINE_START, 0.0, 0.1); + SwingUtils.addComponent (p, empty, 0, RELATIVE, 2, 1, HORI, NWEST, 0.0, 0.1); return p; } @@ -74,8 +75,8 @@ }); // add it to the common panel - SwingUtils.addComponent (p, button, 0, RELATIVE, 1, 1, HORIZONTAL, FIRST_LINE_START, 0.0, 0.0); - SwingUtils.addComponent (p, text, 1, RELATIVE, 1, 1, HORIZONTAL, LINE_START, 1.0, 0.0); + SwingUtils.addComponent (p, button, 0, RELATIVE, 1, 1, HORI, NWEST, 0.0, 0.0); + SwingUtils.addComponent (p, text, 1, RELATIVE, 1, 1, HORI, WEST, 1.0, 0.0); } // @@ -90,11 +91,5 @@ return "Debugging Event Generator"; } - /************************************************************************** - * - **************************************************************************/ - public JLabel getTitle() { - return new JLabel (getName()); - } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/13 06:53:28 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/18 08:46:26 1.2 @@ -1,18 +1,17 @@ +TODO with views: +---------------- +? small icons to buttons +? use FileSystemView in file choosers +* alltools2: - PrefsUtils may become just a common parent for both *WithHistory classes + - combo box history is not updated if exit happened while focus is till in the text field + +? configure dashboard from menu: + * configure dashbard (add/remove dynamically panels) + * configure user preferences -src/main/org/biomoby/service/dashboard/Dashboard.java - -Dashboard configuration - by getResource() ------------------------ - -* SPI for panel interfaces (Apache - commons - Discovery) - -* persistence of the last used properties (at least those easily -serializable) - -* own properties, such as: - - title, icon, sub-title (will be replaced by a panel title) +* Registry panel: + - trees should be in panned blocks (user-resizable) -* java.beans (property chnages) Registry panel -------------- @@ -42,3 +41,10 @@ * model (worker: antWorker) +Other (future, possible) panels: +-------------------------------- +- verify registry +- browsing in graphs +- RDF resources +- Log panel +- Configure a new Dashboard =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/13 06:53:28 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/18 08:46:26 1.4 @@ -9,14 +9,25 @@ package org.biomoby.service.dashboard; import org.tulsoft.tools.gui.SwingUtils; +import org.tulsoft.tools.gui.JTextFieldWithHistory; +import org.tulsoft.tools.gui.JFileChooserWithHistory; +import javax.swing.JPanel; import javax.swing.JLabel; import javax.swing.Icon; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JFileChooser; import javax.swing.JComponent; import javax.swing.text.html.HTMLDocument; +import java.awt.GridBagLayout; + +import java.awt.event.KeyEvent; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; @@ -34,6 +45,13 @@ public class RegistryPanel extends AbstractPanel { + // names of user preferences keys + static final String USE_CACHE = "use-cache"; + + // components that are used from more methods + JFileChooserWithHistory cacheDir; + JLabel labelCacheDir; + /********************************************************************* * propertyChange() ********************************************************************/ @@ -52,21 +70,210 @@ * **************************************************************************/ public JComponent getComponent() { - return null; + if (pComponent != null) + return pComponent; + + pComponent = new JPanel (new GridBagLayout(), true); + + // ontology trees + ServicesTree servicesTree = new ServicesTree(); + DataTypesTree dataTypesTree = new DataTypesTree(); + NamespacesTree namespacesTree = new NamespacesTree(); + + // registry and cache locations + JPanel regLocation = getRegistryLocation(); + JPanel cacheLocation = getCacheLocation(); + + // put all together + SwingUtils.addComponent (pComponent, servicesTree.scrollable(), 0, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); + SwingUtils.addComponent (pComponent, dataTypesTree.scrollable(), 1, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); + SwingUtils.addComponent (pComponent, namespacesTree.scrollable(), 2, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); + SwingUtils.addComponent (pComponent, regLocation, 3, 0, 1, 1, HORI, NWEST, 0.1, 0.0); + SwingUtils.addComponent (pComponent, cacheLocation, 3, 1, 1, 1, HORI, NWEST, 0.1, 0.0); + + return pComponent; + } + + /************************************************************************** + * + **************************************************************************/ + public void onReloadAll() { + } + + /************************************************************************** + * + **************************************************************************/ + public void onDefaults() { + } + + /************************************************************************** + * + **************************************************************************/ + public void onCacheInfo() { + } + + /************************************************************************** + * + **************************************************************************/ + public void onCacheErase() { + } + + /************************************************************************** + * + **************************************************************************/ + public void onCacheUpdate() { + } + + /************************************************************************** + * + **************************************************************************/ + public void onUseCache (boolean enabled) { + cacheDir.setEnabled (enabled); + labelCacheDir.setEnabled (enabled); + setPrefValue (USE_CACHE, enabled); + } + + /************************************************************************** + * Panel for registry. + **************************************************************************/ + protected JPanel getRegistryLocation() { + JLabel labelRegistryURL = new JLabel("Endpoint"); + JTextFieldWithHistory registryURL = + new JTextFieldWithHistory ("", this, "registryEndpoint"); + JLabel labelRegistryNS = new JLabel("Namespace (URI)"); + JTextFieldWithHistory registryNS = + new JTextFieldWithHistory ("", this, "registryNamespace"); + JButton reloadAllButton = + createButton (" Reload all ", + "Reload all ontology trees from the Biomoby registry", + KeyEvent.VK_R, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + onReloadAll(); + } + }); + JButton defaultsButton = + createButton (" Restore defaults ", + "Fill the text fields above with the default values", + KeyEvent.VK_D, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + onDefaults(); + } + }); + JPanel buttonPanel = createButtonPanel (new JButton[] { reloadAllButton, + defaultsButton }); + JPanel rLocation = createTitledPanel ("Biomoby registry location"); + SwingUtils.addComponent (rLocation, labelRegistryURL, 0, 0, 1, 1, NONE, NWEST, 0.0, 0.0); + SwingUtils.addComponent (rLocation, registryURL, 0, 1, 1, 1, HORI, NWEST, 1.0, 0.0); + SwingUtils.addComponent (rLocation, labelRegistryNS, 0, 2, 1, 1, NONE, NWEST, 0.0, 0.0, BREATH_TOP); + SwingUtils.addComponent (rLocation, registryNS, 0, 3, 1, 1, HORI, NWEST, 1.0, 0.0); + SwingUtils.addComponent (rLocation, buttonPanel, 0, 4, 1, 1, NONE, SWEST, 0.0, 0.0); + + return rLocation; + } + + /************************************************************************** + * Panel for local cache. + **************************************************************************/ + protected JPanel getCacheLocation() { + boolean usingCache = getPrefValue (USE_CACHE, true); + JCheckBox useCache = + createCheckBox ("Use local cache", usingCache, KeyEvent.VK_C, + new ItemListener() { + public void itemStateChanged (ItemEvent e) { + onUseCache (e.getStateChange() == ItemEvent.SELECTED); + } + }); + labelCacheDir = new JLabel("Cache directory"); + cacheDir = createFileSelector ("Select directory for/with local cache", + "Select", + JFileChooser.DIRECTORIES_ONLY, + System.getProperty ("java.io.tmpdir"), + null); + onUseCache (usingCache); + JButton infoButton = + createButton (" Info ", + "Show current information about the local cache", + KeyEvent.VK_I, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + onCacheInfo(); + } + }); + JButton updateButton = + createButton (" Update ", + "Update local cache from Biomoby registry", + KeyEvent.VK_U, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + onCacheUpdate(); + } + }); + JButton eraseButton = + createButton (" Erase ", + "Remove everything from the local cache", + KeyEvent.VK_E, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + onCacheErase(); + } + }); + JPanel buttonPanel = createButtonPanel (new JButton[] { infoButton, + updateButton, + eraseButton }); + + JPanel cLocation = createTitledPanel ("Local cache"); + SwingUtils.addComponent (cLocation, useCache, 0, 0, 1, 1, NONE, NWEST, 0.0, 0.0); + SwingUtils.addComponent (cLocation, labelCacheDir, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0, BREATH_TOP); + SwingUtils.addComponent (cLocation, cacheDir, 0, 2, 1, 1, HORI, NWEST, 1.0, 0.0); + SwingUtils.addComponent (cLocation, buttonPanel, 0, 3, 1, 1, NONE, SWEST, 0.0, 0.0); + + return cLocation; + } + + /************************************************************************** + * + **************************************************************************/ + class ServicesTree extends CommonTree { + public ServicesTree() { + super ("Services"); + } + } + + /************************************************************************** + * + **************************************************************************/ + class DataTypesTree extends CommonTree { + public DataTypesTree() { + super ("DataTypes"); + } + } + + /************************************************************************** + * + **************************************************************************/ + class NamespacesTree extends CommonTree { + public NamespacesTree() { + super ("Namespaces"); + } } /************************************************************************** * **************************************************************************/ public String getName() { - return "Biomoby Registry"; + return "Registry Browser"; } /************************************************************************** * **************************************************************************/ - public JLabel getTitle() { - return new JLabel (getName()); + public Icon getIcon() { + if (panelIcon == null) + panelIcon = SwingUtils.createIcon ("images/registry.gif", this); + return panelIcon; } + } From kawas at pub.open-bio.org Tue Sep 20 17:16:34 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 20 Sep 2005 17:16:34 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202116.j8KLGYkp006490@pub.open-bio.org> kawas Tue Sep 20 17:16:34 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv6465 Modified Files: OntologyServer.pm Log Message: added the suggestions asked for by martin. Code that has been added is commented out until a decision is made on whether to support the changes. Code marked by: #UNCOMMENT denotes code that should be uncommented to add functionality #COMMENT/REMOVE denotes code that should be removed in conjunction with the additions. Lines subject to removal: 927 Lines subject to addition: 928 moby-live/Perl/MOBY OntologyServer.pm,1.83,1.84 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.83 retrieving revision 1.84 diff -u -r1.83 -r1.84 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/08/30 14:52:15 1.83 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/20 21:16:34 1.84 @@ -1,1315 +1,1316 @@ -#$Id$ -# this module needs to talk to the 'real' ontology -# server as well as the MOBY Central database -# in order to ensure that they are both in sync - -=head1 NAME - -MOBY::OntologyServer - A way for MOBY Central to query the -object, service, namespace, and relationship ontologies - -=cut - -=head1 SYNOPSIS - - use MOBY::OntologyServer; - my $OS = MOBY::OntologyServer->new(ontology => "object"); - - my ($success, $message, $existingURI) = $OS->objectExists(term => "Object"); - - if ($success){ - print "object exists and it has the LSID $existingURI\n"; - } else { - print "object does not exist; additional message from server: $message\n"; - } - - -=cut - -=head1 DESCRIPTION - -Swappable interface to ontologies. It should deal with LSID's 100% -of the time, and also deal with MOBY-specific common names for objects, -services, namespaces, and relationship types. - - - -=head1 AUTHORS - -Mark Wilkinson (markw at illuminae.com) - -BioMOBY Project: http://www.biomoby.org - - -=cut - -=head1 METHODS - - -=head2 new - - Title : new - Usage : my $OS = MOBY::OntologyServer->new(%args) - Function : - Returns : MOBY::OntologyServer object - Args : ontology => [object || service || namespace || relationship] - database => mysql databasename that holds the ontologies - host => mysql hostname - username => mysql username - password => mysql password - port => mysql port - dbh => pre-existing database handle to a mysql database - -=cut - -package MOBY::OntologyServer; -use strict; -use Carp; -use vars qw($AUTOLOAD); -use DBI; -use DBD::mysql; -use MOBY::Config; -my $debug = 0; -{ - - #Encapsulated class data - #___________________________________________________________ - #ATTRIBUTES - my %_attr_data = # DEFAULT ACCESSIBILITY - ( - ontology => [ undef, 'read/write' ], - database => [ undef, 'read/write' ], - host => [ undef, 'read/write' ], - username => [ undef, 'read/write' ], - password => [ undef, 'read/write' ], - port => [ undef, 'read/write' ], - dbh => [ undef, 'read/write' ], - ); - - #_____________________________________________________________ - # METHODS, to operate on encapsulated class data - # Is a specified object attribute accessible in a given mode - sub _accessible { - my ( $self, $attr, $mode ) = @_; - $_attr_data{$attr}[1] =~ /$mode/; - } - - # Classwide default value for a specified object attribute - sub _default_for { - my ( $self, $attr ) = @_; - $_attr_data{$attr}[0]; - } - - # List of names of all specified object attributes - sub _standard_keys { - keys %_attr_data; - } -} - -sub new { - my ( $caller, %args ) = @_; - my $caller_is_obj = ref($caller); - my $class = $caller_is_obj || $caller; - my $self = bless {}, $class; - foreach my $attrname ( $self->_standard_keys ) { - if ( exists $args{$attrname} && defined $args{$attrname} ) { - $self->{$attrname} = $args{$attrname}; - } elsif ($caller_is_obj) { - $self->{$attrname} = $caller->{$attrname}; - } else { - $self->{$attrname} = $self->_default_for($attrname); - } - } - $self->ontology eq 'object' && $self->database('mobyobject'); - $self->ontology eq 'namespace' && $self->database('mobynamespace'); - $self->ontology eq 'service' && $self->database('mobyservice'); - $self->ontology eq 'relationship' && $self->database('mobyrelationship'); - - #print STDERR "\n\nCONFIG object is $CONFIG\n\n"; - $CONFIG ||= MOBY::Config->new; - -#print STDERR "got username ",($CONFIG->{mobycentral}->{username})," for mobycentral\n"; - $self->username( $CONFIG->{ $self->database }->{username} ) - unless $self->username; - $self->password( $CONFIG->{ $self->database }->{password} ) - unless $self->password; - $self->port( $CONFIG->{ $self->database }->{port} ) unless $self->port; - $self->host( $CONFIG->{ $self->database }->{url} ) unless $self->host; - my $host = $self->host ? $self->host : $ENV{MOBY_CENTRAL_URL}; - chomp $host; - my $username = - $self->username ? $self->username : $ENV{MOBY_CENTRAL_DBUSER}; - chomp $username; - my $password = - $self->password ? $self->password : $ENV{MOBY_CENTRAL_DBPASS}; - chomp $password if $password; - $password =~ s/\s//g if $password; - my $port = $self->port ? $self->port : $ENV{MOBY_CENTRAL_DBPORT}; - chomp $port; - my ($dsn) = - "DBI:mysql:" - . ( $CONFIG->{ $self->database }->{dbname} ) . ":" - . ($host) . ":" - . ($port); - - #print STDERR "\n\nDSN was $dsn\n\n"; - my $dbh; - -# $debug && &_LOG("connecting to db with params ",$self->database, $self->username, $self->password,"\n"); - if ( defined $password ) { - $dbh = DBI->connect( $dsn, $username, $password, { RaiseError => 1 } ) - or die "can't connect to database"; - } else { - $dbh = DBI->connect( $dsn, $username, undef, { RaiseError => 1 } ) - or die "can't connect to database"; - } - - # $debug && &_LOG("CONNECTED!\n"); - if ($dbh) { - $self->dbh($dbh); - return $self; - } else { - return undef; - } -} - -=head2 objectExists - - moby:newterm will return (0, $message, $MOBYLSID) - newterm will return (0, $message, $MOBYLSID - oldterm will return (1, $message, undef) - newLSID will return (0, $desc, $lsid) -=cut - -sub objectExists { - my ( $self, %args ) = @_; - - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - - my $term = $args{term}; - $term =~ s/^moby://; # if the term is namespaced, then remove that - my $sth; - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); - - my $result; - - $result = $adaptor->query_object(type => $term); - - my $row = shift(@$result); - my $lsid = $row->{object_lsid}; - my $type = $row->{object_type}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $email = $row->{contact_email}; - - if ($lsid) - { # if it is in there, then it has been discovered regardless of being foreign or not - return ( 1, $desc, $lsid ); - } elsif ( _isForeignLSID($term) ) - { # if not in our ontology, but is a foreign LSID, then pass it back verbatim - return ( - 0, -"LSID $term does not exist in the biomoby.org Object Class system\n", - $term - ); - } else { # under all other circumstances (i.e. not a term, or a non-existent biomoby LSID) then fail - return ( - 0, -"Object type $term does not exist in the biomoby.org Object Class system\n", - '' - ); - } -} - -sub _isMOBYLSID { - my ($lsid) = @_; - return 1 if $lsid =~ /^urn\:lsid\:biomoby.org/; - return 0; -} - -sub _isForeignLSID { - my ($lsid) = @_; - return 0 if $lsid =~ /^urn\:lsid\:biomoby.org/; - return 1; -} - -=head2 createObject - -=cut - -sub createObject { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); - return ( 0, "requires a object type node", '' ) unless ( $args{node} ); - return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); - return ( 0, "requires a contact email address", '' ) - unless ( $args{contact_email} ); - return ( 0, "requires a object description", '' ) - unless ( $args{description} ); - my $term = $args{node}; - - my $LSID = - ( $args{'node'} =~ /urn\:lsid/ ) - ? $args{'node'} - : $self->setURI( $args{'node'} ); - unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } - my $result; - $result = $adaptor->query_object(type => $term); - my $row = shift(@$result); - my $lsid = $row->{object_lsid}; - my $type = $row->{object_type}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $email = $row->{contact_email}; - - if ($lsid) { # if it is in there, then the object exists - return ( 0, "This term already exists: $lsid", $lsid ); - } - $args{description} =~ s/^\s+(.*?)\s+$/$1/s; - $args{node} =~ s/^\s+(.*?)\s+$/$1/s; - $args{contact_email} =~ s/^\s+(.*?)\s+$/$1/s; - $args{authority} =~ s/^\s+(.*?)\s+$/$1/s; - - my $insertid = $adaptor->insert_object(object_type => $args{'node'}, - object_lsid => $LSID, - description => $args{'description'}, - authority => $args{'authority'}, - contact_email => $args{'contact_email'}); - unless ( $insertid ) { - return ( 0, "Object creation failed for unknown reasons", '' ); - } - return ( 1, "Object creation succeeded", $LSID ); -} - -=head2 retrieveObject - -=cut - -sub retrieveObject { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - my $term = $args{'type'}; - $term ||=$args{'node'}; - - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); - return ( 0, "requires a object type node as an argument", '' ) - unless ( $term ); - my $LSID = - ( $term =~ /urn\:lsid/ ) - ? $term - : $self->getObjectURI($term); - unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } - my $result = $adaptor->query_object(type => $LSID); - my $row = shift(@$result); -# my $id = $row->{object_id}; - my $type = $row->{object_type}; - my $lsid = $row->{object_lsid}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $contact = $row->{contact_email}; - - unless ($lsid) { return ( 0, "Object doesn't exist in ontology", "" ) } - - # my $OS = MOBY::OntologyServer->new(ontology => "relationship"); - - $result = $adaptor->get_object_relationships(type => $lsid); - my %rel; - foreach my $row (@$result) - { - my $relationship_type = $row->{relationship_type}; - my $objectlsid = $row->{object_lsid}; - my $article = $row->{object2_articlename}; - my $contact = $row->{contact_email}; - my $def = $row->{definition}; - my $auth = $row->{authority}; - my $type = $row->{object_type}; - - push @{ $rel{$relationship_type} }, [ $objectlsid, $article, $type, $def, $auth, $contact ]; - } - return { - objectType => $type, - objectLSID => $lsid, - description => $desc, - contactEmail => $contact, - authURI => $auth, - Relationships => \%rel - }; -} - -=head2 deprecateObject - -=cut - -sub deprecateObject { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - - return ( 0, "WRONG ONTOLOGY", '' ) unless ( $self->ontology eq 'object' ); - my $term = $args{term}; - -# if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ -# return (0, "can't delete from external ontology", $term); -# } - my $LSID; - unless ( $term =~ /urn\:lsid/ ) { $LSID = $self->getObjectURI($term) } else { $LSID = $term } - return ( 0, q{Object type $term cannot be resolved to an LSID}, "" ) - unless $LSID; - - my $result = $adaptor->query_object(type => $LSID); - my $row = shift(@$result); - my $id = $row->{object_id}; - my $lsid = $row->{object_lsid}; - - # object1_id ISA object2_id? - my $isa = $adaptor->query_object_term2term(type => $lsid); - my $isas = shift @$isa; - if ( $isas->{object1_id}) { - return ( 0, - qq{Object type $term has object dependencies in the ontology}, - $lsid ); - } - - my ($err, $errstr) = $adaptor->delete_object(type => $lsid); - if ( $err ) { - return ( 0, "Delete from Object Class table failed: $errstr", - $lsid ); - } - return ( 1, "Object $term Deleted", $lsid ); -} - -=head2 deleteObject - -=cut - -sub deleteObject { - my $self = shift; - $self->deprecateObject(@_); -} - -=head2 relationshipExists - -=cut - -sub relationshipExists { - - # term => $term - # ontology => $ontology - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); - return ( 0, "WRONG ONTOLOGY!", '' ) - unless ( $self->ontology eq 'relationship' ); - my $term = lc( $args{term} ); - $term =~ s/^moby://; # if the term is namespaced, then remove that - my $ont = $args{ontology}; - return ( 0, "requires both term and ontology arguments\n", '' ) - unless ( defined($term) && defined($ont) ); - my $result; - if ( $term =~ /^urn\:lsid/ ) { - - $result = $adaptor->query_relationship( - type => $term, - ontology => $ont); - - } else { - - $result = $adaptor->query_relationship(type => $term, ontology => $ont); - - } - my $row = shift(@$result); - my $lsid = $row->{relationship_lsid}; - my $type = $row->{relationship_type}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $email = $row->{contact_email}; - if ($lsid) { - return ( 1, $desc, $lsid, $type, $auth, $email ); - } else { - return ( - 0,"Relationship Type $term does not exist in the biomoby.org Relationship Type system\n", - '', '', '', '' - ); - } -} - -=head2 addObjectRelationship - -=cut - -sub addObjectRelationship { - - # adds a relationship - #subject_node => $term, - #relationship => $reltype, - #object_node => $objectType, - #articleName => $articleName, - #authority => $auth, - #contact_email => $email - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); - - my $result = $adaptor->query_object(type => $args{subject_node}); - my $row = shift(@$result); - my $subj_lsid = $row->{object_lsid}; - return ( 0, qq{Object type $args{subject_node} does not exist in the ontology}, '' ) - unless defined $subj_lsid; - - $result = $adaptor->query_object(type => $args{object_node}); - $row = shift(@$result); - my $obj_lsid = $row->{object_lsid}; - return ( 0,qq{Object type $args{object_node} does not exist in the ontology},'' ) - unless defined $obj_lsid; - my $isa = $adaptor->query_object_term2term(type => $subj_lsid); - my $isarow = shift @$isa; - if ( $isarow->{object_lsid} ) { - return ( - 0, - qq{Object type $args{subject_node} has existing object dependencies in the ontology. It cannot be changed.}, - $subj_lsid - ); - } - my $OE = MOBY::OntologyServer->new( ontology => 'relationship' ); - my ( $success, $desc, $rel_lsid ) = $OE->relationshipExists( - term => $args{relationship}, - ontology => 'object' ); - ($success) || return ( 0, - qq{Relationship $args{relationship} does not exist in the ontology}, - '' ); - - # need to ensure that identical article names dont' end up at the same level - my $articleNameInvalid = &_testIdenticalArticleName(term => $subj_lsid, articleName => $args{articleName}); - return (0, "Object will have conflicting articleName ".($args{articleName}), '') if $articleNameInvalid; - - my $insertid = $adaptor->insert_object_term2term(relationship_type => $rel_lsid, - object1_type => $subj_lsid, - object2_type => $obj_lsid, - object2_articlename => $args{articleName}); - - - if ($insertid ) { - return ( 1, "Object relationsihp created successfully", '' ); - } else { - return ( 0, "Object relationship creation failed for unknown reasons", - '' ); - } -} - -sub _testIdenticalArticleName { - my (%args)= @_; - my $term = $args{term}; - my $articleName = $args{articleName}; - my $foundCommonArticleNameFlag = 0; - # need to first traverse down the ISA pathway to root - # then for each ISA test the hAS and HASA's for their articlenames and see if they are the same - # case insensitive? - my $OS = MOBY::OntologyServer->new(ontology => 'object'); - my $OSrel = MOBY::OntologyServer->new(ontology => 'relationship'); - my ($exists1, $desc, $isalsid) = $OSrel->relationshipExists(term => 'isa', ontology => 'object'); - my ($exists2, $desc2, $hasalsid) = $OSrel->relationshipExists(term => 'hasa', ontology => 'object'); - my ($exists3, $desc3, $haslsid) = $OSrel->relationshipExists(term => 'has', ontology => 'object'); - - return 1 unless ($exists1 && $exists2 && $exists3); # this is bad, since it returns boolean suggesting that it found a common articlename rather than finding that a given relationship doesn't exist, but... hey.... - # check the hasa relationships for common articleName - $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $args{term}, relationship => $hasalsid, targetArticleName => $articleName); - # check the has relationships for common articleName - $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $args{term}, relationship => $haslsid, targetArticleName => $articleName); - - # now get all of its inherited parents - my $relationships = $OS->Relationships( - ontology => 'object', - term => $args{term}, - relationship => $isalsid, - direction => 'root', - expand => 1); - #relationships{relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] - my ($isa) = keys(%$relationships); # can only be one key returned, and must be isa in this case - my @ISAlist; - (@ISAlist = @{$relationships->{$isa}}) if ($relationships->{$isa}) ; - # for each of the inherited parents, check their articleNames - foreach my $ISA(@ISAlist){ # $ISA = [lsid, articleName] (but articleName shuld be null anyway in this case) - my $what_it_is = shift @$ISA; - # check the hasa relationships for common articleName - $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $what_it_is, relationship => $hasalsid, targetArticleName => $articleName); - # check the has relationships for common articleName - $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $what_it_is, relationship => $haslsid, targetArticleName => $articleName); - } - return $foundCommonArticleNameFlag; -} - -sub _compareArticleNames { - my (%args) = @_; - my $OS = $args{OS}; - my $what_it_is = $args{type}; - my $lsid = $args{relationship}; - my $targetArticleName = $args{targetArticleName}; - my $foundCommonArticleNameFlag = 0; - my $contents = $OS->Relationships( - ontology => 'object', - term => $what_it_is, - relationship => $lsid, - direction => 'root', - ); - if ($contents){ - #$hasarelationships{relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] - my ($content) = keys(%$contents); - if ($contents->{$content}){ - my @CONTENTlist = @{$contents->{$content}}; - foreach my $CONTAINED(@CONTENTlist){ - $foundCommonArticleNameFlag = 1 if ($CONTAINED->[1] eq $targetArticleName); #->[1] is the articleName field - } - } - } - return $foundCommonArticleNameFlag; -} - -=head2 addServiceRelationship - -=cut - -sub addServiceRelationship { - - # adds an ISA relationship - # fail if another object is in relation to this objevt - #subject_node => $term, - #relationship => $relationship, - #predicate_node => $pred - #authority => $auth, - #contact_email => $email); - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); - - my $result = $adaptor->query_service(type => $args{subject_node}); - my $row = shift(@$result); - my $sbj_lsid = $row->{service_lsid}; - - return (0, - qq{Service type $args{subject_node} has object dependencies in the ontology. It can not be changed}, - $sbj_lsid - ) unless defined $sbj_lsid; - - my $isa = $adaptor->query_service_term2term(service2_id => $sbj_lsid); - my $isarow = shift @$isa; - if ( $isarow->{service_lsid} ) { - return ( - 0, - qq{Service type $args{subject_node} has object dependencies in the ontology. It can not be changed}, - $sbj_lsid - ); - } - $result = $adaptor->query_service(type => $args{object_node}); - $row = shift(@$result); - my $obj_lsid = $row->{service_lsid}; - # get ID of the related service - - defined $obj_lsid - || return ( 0, - qq{Service $args{object_node} does not exist in the service ontology}, - '' ); - my $OE = MOBY::OntologyServer->new( ontology => 'relationship' ); - my ( $success, $desc, $rel_lsid ) = $OE->relationshipExists( - term => $args{relationship}, - ontology => 'service' ); - ($success) - || return ( 0, - qq{Relationship $args{relationship} does not exist in the ontology}, - '' ); - - my $insertid = $adaptor->insert_service_term2term(relationship_type => $rel_lsid, - service1_type => $sbj_lsid, - service2_type => $obj_lsid); - if ( defined($insertid)) { - return ( 1, "Service relationship created successfully", '' ); - } else { - return ( 0, "Service relationship creation failed for unknown reasons", - '' ); - } -} - -=head2 serviceExists - -=cut - -sub serviceExists { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); - my $term = $args{term}; - $term =~ s/^moby://; # if the term is namespaced, then remove that - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) - { - return ( 1, "external ontology", $term ); - } - my $result; - $result = $adaptor->query_service(type => $term); - my $row = shift(@$result); - my $id = $row->{service_id}; - my $type = $row->{service_type}; - my $lsid = $row->{service_lsid}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $email = $row->{contact_email}; - - if ($id) { - return ( 1, $desc, $lsid ); - } else { - return ( - 0, -"Service Type $term does not exist in the biomoby.org Service Type ontology\n", - '' - ); - } -} - -=head2 createServiceType - -=cut - -sub createServiceType { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - - #node => $term, - #descrioption => $desc, - #authority => $auth, - #contact_email => $email); - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); - return ( 0, "requires a object type node", '' ) unless ( $args{node} ); - return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); - return ( 0, "requires a contact email address", '' ) - unless ( $args{contact_email} ); - return ( 0, "requires a object description", '' ) - unless ( $args{description} ); - my $term = $args{node}; - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) - { # if it is an LSID, but not a MOBY LSID, than barf - return ( 0, "can't create a term in a non-MOBY ontology!", $term ); - } - my $LSID = - ( $args{'node'} =~ /urn\:lsid/ ) - ? $args{'node'} - : $self->setURI( $args{'node'} ); - unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } - - my $insertid = $adaptor->insert_service(service_type => $args{'node'}, - service_lsid => $LSID, - description => $args{'description'}, - authority => $args{'authority'}, - contact_email => $args{'contact_email'}); - - unless ( $insertid ) { - return ( 0, "Service creation failed for unknown reasons", '' ); - } - return ( 1, "Service creation succeeded", $LSID ); -} - -=head2 deleteServiceType - -=cut - -sub deleteServiceType { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); - my $term = $args{term}; - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) - { - return ( 0, "can't delete from external ontology", $term ); - } - my $LSID; - unless ( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) { - $LSID = $self->getServiceURI($term); - } else { - $LSID = $term; - } - return ( - 0, q{Service type $term cannot be resolved to an LSID in the MOBY ontologies},"" - ) unless $LSID; - - my $result = $adaptor->query_service(type => $LSID); - my $row = shift(@$result); - my $lsid = $row->{service_lsid}; - - if ( !defined $lsid ) { - return ( 0, q{Service type $term does not exist in the ontology}, - $lsid ); - } - - # service1_id ISA service2_id? - my $isa = $adaptor->query_service_term2term(type => $lsid); - my $isas = shift(@$isa); - - if ( $isas->{service1_id} ) { - return ( 0, qq{Service type $term has dependencies in the ontology}, - $lsid ); - } - my ($err, $errstr) = $adaptor->delete_service(type => $lsid); - - if ( $err ) { - return ( 0, "Delete from Service Type table failed: $errstr", - $lsid ); - } - - return ( 1, "Service Type $term Deleted", $lsid ); -} - -=head2 namespaceExists - -=cut - -sub namespaceExists { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - - return ( 0, "WRONG ONTOLOGY!", '' ) - unless ( $self->ontology eq 'namespace' ); - my $term = $args{term}; - $term =~ s/^moby://; # if the term is namespaced, then remove that - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) - { - return ( 1, "external ontology", $term ); - } - my $result; - $result = $adaptor->query_namespace(type => $term); - my $row = shift(@$result); - my $id = $row->{namespace_id}; - my $type = $row->{namespace_type}; - my $lsid = $row->{namespace_lsid}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $email = $row->{contact_email}; - - if ($id) { - return ( 1, $desc, $lsid ); - } else { - return ( - 0, -"Namespace Type $term does not exist in the biomoby.org Namespace Type ontology\n", - '' - ); - } -} - -=head2 createNamespace - -=cut - -sub createNamespace { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - #node => $term, - #descrioption => $desc, - #authority => $auth, - #contact_email => $email); - return ( 0, "WRONG ONTOLOGY!", '' ) - unless ( $self->ontology eq 'namespace' ); - return ( 0, "requires a namespace type node", '' ) unless ( $args{node} ); - return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); - return ( 0, "requires a contact email address", '' ) - unless ( $args{contact_email} ); - return ( 0, "requires a object description", '' ) - unless ( $args{description} ); - my $term = $args{node}; - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) - { # if it is an LSID, but not a MOBY LSID, than barf - return ( 0, "can't create a term in a non-MOBY ontology!", $term ); - } - my $LSID = - ( $args{'node'} =~ /urn\:lsid/ ) - ? $args{'node'} - : $self->setURI( $args{'node'} ); - unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } - - my $insertid = $adaptor->insert_namespace(namespace_type => $args{'node'}, - namespace_lsid => $LSID, - description => $args{'description'}, - authority => $args{'authority'}, - contact_email => $args{'contact_email'}); - - unless ( $insertid ) { - return ( 0, "Namespace creation failed for unknown reasons", '' ); - } - return ( 1, "Namespace creation succeeded", $LSID ); -} - -=head2 deleteNamespace - -=cut - -sub deleteNamespace { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - return ( 0, "WRONG ONTOLOGY!", '' ) - unless ( $self->ontology eq 'namespace' ); - my $term = $args{term}; - my $LSID; - unless ( $term =~ /urn\:lsid/ ) { $LSID = $self->getNamespaceURI($term) } else { $LSID = $term } - return ( 0, q{Namespace type $term cannot be resolved to an LSID}, "" ) - unless $LSID; - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) - { - return ( 0, "cannot delete a term from an external ontology", $term ); - } - - my $result = $adaptor->query_namespace(type => $LSID); - my $row = shift(@$result); - my $lsid = $row->{namespace_lsid}; - - unless ($lsid) { - return ( 0, q{Namespace type $term does not exist in the ontology}, - $lsid ); - } - - # service1_id ISA service2_id? - my $isa = $adaptor->query_namespace_term2term(type => $lsid); - my $isas = shift @$isa; - - if ($isas->{namespace1_id} ) { - return ( 0, qq{Namespace type $term has dependencies in the ontology}, - $lsid ); - } - - my ($err, $errstr) = $adaptor->delete_namespace(type => $lsid); - - if ( $err ) { - return ( 0, "Delete from namespace table failed: $errstr", - $lsid ); - } - - #($err, $errstr) = $adaptor->delete_namespace_term2term(namespace1_id => $lsid); - # - #if ( $err ) { - # return ( - # 0, - # "Delete from namespace term2term table failed: $errstr", - # $lsid - # ); - #} - return ( 1, "Namespace Type $term Deleted", $lsid ); -} - -=head2 retrieveAllServiceTypes - -=cut - -sub retrieveAllServiceTypes { - my ($self) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - my $types = $adaptor->query_service(); - - my %response; - foreach (@$types) { - $response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}]; - } - return \%response; -} - -=head2 retrieveAllNamespaceTypes - -=cut - -sub retrieveAllNamespaceTypes { - my ($self) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - my $types = $adaptor->query_namespace(); - - my %response; - foreach (@$types) { - $response{ $_->{namespace_type} } = [$_->{description}, $_->{namespace_lsid}, $_->{authority}, $_->{contact_email}]; - } - return \%response; -} - -=head2 retrieveAllObjectClasses - -=cut - -sub retrieveAllObjectClasses { - my ($self) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - my $types = $adaptor->query_object(); - - my %response; - foreach (@$types) { - $response{ $_->{object_type} } = [$_->{description}, $_->{object_lsid}]; - } - return \%response; -} -*retrieveAllObjectTypes = \&retrieveAllObjectClasses; -*retrieveAllObjectTypes = \&retrieveAllObjectClasses; - -=head2 getObjectCommonName - -=cut - -sub getObjectCommonName { - my ( $self, $URI ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - return undef unless $URI =~ /urn\:lsid/; - my $result = $adaptor->query_object(type => $URI); - my $row = shift(@$result); - my $name = $row->{object_type}; - - return $name ? $name : $URI; -} - -=head2 getNamespaceCommonName - -=cut - -sub getNamespaceCommonName { - my ( $self, $URI ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - return undef unless $URI =~ /urn\:lsid/; - my $result = $adaptor->query_namespace(type => $URI); - my $row = shift(@$result); - my $name = $row->{namespace_type}; - - return $name ? $name : $URI; -} - -=head2 getServiceCommonName - -=cut - -sub getServiceCommonName { - my ( $self, $URI ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - return undef unless $URI =~ /urn\:lsid/; - my $result = $adaptor->query_service(type => $URI); - my $row = shift(@$result); - my $name = $row->{service_type}; - - return $name ? $name : $URI; -} - -=head2 getServiceURI - -=cut - -sub getServiceURI { - my ( $self, $term ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - return $term if $term =~ /urn\:lsid/; - - my $result = $adaptor->query_service(type => $term); - my $row = shift(@$result); - my $id = $row->{service_lsid}; - - return $id; -} - -=head2 getObjectURI - -=cut - -sub getObjectURI { - my ( $self, $term ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - return $term if $term =~ /urn\:lsid/; - - my $result = $adaptor->query_object(type => $term); - my $row = shift(@$result); - my $id = $row->{object_lsid}; - - return $id; -} - -=head2 getNamespaceURI - -=cut - -sub getNamespaceURI { - my ( $self, $term ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - - return $term if $term =~ /urn\:lsid/; - - my $result = $adaptor->query_namespace(type => $term); - my $row = shift(@$result); - my $id = $row->{namespace_lsid}; - - return $id; -} - -=head2 getRelationshipURI - -consumes ontology (object/service) -consumes relationship term as term or LSID - -=cut - -sub getRelationshipURI { - my ( $self, $ontology, $term ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); - - return $term if $term =~ /urn\:lsid/; - - my $result = $adaptor->query_relationship(type => $term, ontology => $ontology); - my $row = shift(@$result); - my $id = $row->{relationship_lsid}; - - return $id; -} - -=head2 getRelationshipTypes - -=cut - -sub getRelationshipTypes { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); - - my $ontology = $args{'ontology'}; - my $OS = MOBY::OntologyServer->new( ontology => "relationship" ); - - my $defs = $adaptor->query_relationship(ontology => $ontology); - - my %result; - foreach ( @$defs ) { - $result{ $_->{relationship_lsid} } = [ $_->{relationship_type}, $_->{authority}, $_->{description} ]; - } - return \%result; -} - -=head2 Relationships - -=cut - -sub Relationships { - - # this entire subroutine assumes that there is NOT multiple parenting!! - my ( $self, %args ) = @_; - my $ontology = $args{ontology} ? $args{ontology} : $self->ontology; - my $term = $args{term}; - my $relationship = $args{relationship}; - my $direction = $args{direction} ? $args{direction} : 'root'; - my $expand = $args{expand} ? 1 : 0; - return - unless ( $ontology - && $term - && ( ( $ontology eq 'service' ) || ( $ontology eq 'object' ) ) ); - - # convert $term into an LSID if it isn't already - if ( $ontology eq 'service' ) { - $term = $self->getServiceURI($term); - $relationship ||="isa"; - my $OS = MOBY::OntologyServer->new(ontology => 'relationship'); - $relationship = $OS->getRelationshipURI("service", $relationship); - } elsif ( $ontology eq 'object' ) { - $term = $self->getObjectURI($term); - $relationship ||="isa"; - my $OS = MOBY::OntologyServer->new(ontology => 'relationship'); - $relationship = $OS->getRelationshipURI("object", $relationship); - } - my %results; - while ( ( $term ne 'urn:lsid:biomoby.org:objectclass:Object' ) - && ( $term ne 'urn:lsid:biomoby.org:servicetype:Service' ) ) - { - my $defs = $self->_doRelationshipsQuery( $ontology, $term, - $relationship, $direction ); - return {[]} unless $defs; # somethig has gone terribly wrong! - my $lsid; - my $rel; - my $articleName; - foreach ( @{$defs} ) { - $lsid = $_->[0]; - $rel = $_->[1]; - $articleName = $_->[2]; - $articleName ||=""; - $debug - && _LOG("\t\tADDING RELATIONSHIP $_ : $lsid to $rel\n"); - push @{ $results{$rel} }, [$lsid, $articleName]; - } - last unless ($expand); - last unless ( $direction eq "root" ); # if we aren't going to root, then be careful or we'll loop infnitely - $term = $lsid; # this entire subroutine assumes that there is NOT multiple parenting... - } - return \%results; #results(relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] -} - -sub _doRelationshipsQuery { - my ( $self, $ontology, $term, $relationship, $direction ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $datasource = "moby$ontology"; # like mobyobject, or mobyservice - my $adaptor = $CONFIG->getDataAdaptor( datasource => $datasource ); - my $defs; - # query returns a reference to an array containing array references - $defs = $adaptor->get_relationship(direction => $direction, - ontology => $ontology, - term => $term, - relationship => $relationship); - # a very long piece of SQL statements have been refactored into Moby::Adaptor::moby::queryapi::mysql.pm - return $defs; -} - -=head2 setURI - -=cut - -sub setURI { - my ( $self, $id ) = @_; - my $URI; - - # $id = lc($id); - if ( $self->ontology eq 'object' ) { - $URI = "urn:lsid:biomoby.org:objectclass:$id"; - } elsif ( $self->ontology eq 'namespace' ) { - $URI = "urn:lsid:biomoby.org:namespacetype:$id"; - } elsif ( $self->ontology eq 'service' ) { - $URI = "urn:lsid:biomoby.org:servicetype:$id"; - } elsif ( $self->ontology eq 'relationship' ) { - $URI = "urn:lsid:biomoby.org:relationshiptype:$id"; - } else { - $URI = 0; - } - return $URI; -} - -=head2 traverseDAG - -=cut - -sub traverseDAG { - my ( $self, $term, $direction ) = @_; - my $ontology = $self->ontology; - return {} unless $ontology; - return {} unless $term; - $direction = "root" unless ($direction); - return {} unless ( ( $direction eq 'root' ) || ( $direction eq 'leaves' ) ); - if ( $ontology eq 'service' ) { - $term = $self->getServiceURI($term); - } elsif ( $ontology eq 'object' ) { - $term = $self->getObjectURI($term); - } - return {} unless $term =~ /^urn\:lsid/; # now its a URI - my $relhash = $self->getRelationshipTypes( ontology => $ontology ); # get teh types of relationships for the object/service ontology - return {} unless $relhash; - my @rels = keys %{$relhash}; #@rels is the list of relationship types for that ontology - my %relationships; - foreach my $relationship (@rels) { - my %IDS; - my $OS = MOBY::OntologyServer->new( ontology => 'relationship' ); - my $reluri = - $OS->getRelationshipURI( $ontology, $relationship ) - ; # get the URI for that relationship type if it ins't already a URI - $IDS{$term} = "untestedroot"; # mark the one in-hand as being untested - while ( grep /untested/, ( values %IDS ) ) - { # now, while there are untested services in our list... - foreach my $termthingy ( keys %IDS ) - { # start parsing through the current list (hash keys) - $debug && _LOG("testing $relationship of $termthingy\n"); - next - if ( $IDS{$termthingy} eq "tested" ) - ; # if it has been tested already then move on - my $lsids = $self->Relationships( - term => $termthingy, - relationship => $relationship, - direction => $direction - ) - ; # get the related terms for this type; this should return a single hash value - if ( $IDS{$termthingy} =~ /root/ ) - { # here is where we remove self - delete $IDS{$termthingy}; - $debug && _LOG("deleting $termthingy\n"); - } else { - $debug && _LOG("marking $termthingy as TESTED\n"); - $IDS{$termthingy} = - "tested"; # mark the current one as now being "done" - } - - #${$lsids}{relationshiptype}=[lsid, lsid, lsid]; - foreach my $lsid_article ( @{ $lsids->{$relationship} } ) - { # go through the related terms - my ($lsid, $article) = @{$lsid_article}; - $debug && _LOG("found $lsid as relationship"); - next - if ( defined $IDS{$lsid} ) - ; # if we have already seen that term, skip it - $debug && _LOG("setting $lsid as untested\n"); - $IDS{$lsid} = - "untested" # otherwise add it to the list and loop again. - } - } - } - my @IDS = keys %IDS; - $relationships{$relationship} = - \@IDS; # and associate them all with the current relationship type - } - return \%relationships; -} - -sub _LOG { - return unless $debug; - - #print join "\n", @_; - #print "\n---\n"; - #return; - open LOG, ">>/tmp/OntologyServer.txt" or die "can't open logfile $!\n"; - print LOG join "\n", @_; - print LOG "\n---\n"; - close LOG; -} -sub DESTROY { } - -sub AUTOLOAD { - no strict "refs"; - my ( $self, $newval ) = @_; - $AUTOLOAD =~ /.*::(\w+)/; - my $attr = $1; - if ( $self->_accessible( $attr, 'write' ) ) { - *{$AUTOLOAD} = sub { - if ( defined $_[1] ) { $_[0]->{$attr} = $_[1] } - return $_[0]->{$attr}; - }; ### end of created subroutine -### this is called first time only - if ( defined $newval ) { - $self->{$attr} = $newval; - } - return $self->{$attr}; - } elsif ( $self->_accessible( $attr, 'read' ) ) { - *{$AUTOLOAD} = sub { - return $_[0]->{$attr}; - }; ### end of created subroutine - return $self->{$attr}; - } - - # Must have been a mistake then... - croak "No such method: $AUTOLOAD"; -} -1; +#$Id$ +# this module needs to talk to the 'real' ontology +# server as well as the MOBY Central database +# in order to ensure that they are both in sync + +=head1 NAME + +MOBY::OntologyServer - A way for MOBY Central to query the +object, service, namespace, and relationship ontologies + +=cut + +=head1 SYNOPSIS + + use MOBY::OntologyServer; + my $OS = MOBY::OntologyServer->new(ontology => "object"); + + my ($success, $message, $existingURI) = $OS->objectExists(term => "Object"); + + if ($success){ + print "object exists and it has the LSID $existingURI\n"; + } else { + print "object does not exist; additional message from server: $message\n"; + } + + +=cut + +=head1 DESCRIPTION + +Swappable interface to ontologies. It should deal with LSID's 100% +of the time, and also deal with MOBY-specific common names for objects, +services, namespaces, and relationship types. + + + +=head1 AUTHORS + +Mark Wilkinson (markw at illuminae.com) + +BioMOBY Project: http://www.biomoby.org + + +=cut + +=head1 METHODS + + +=head2 new + + Title : new + Usage : my $OS = MOBY::OntologyServer->new(%args) + Function : + Returns : MOBY::OntologyServer object + Args : ontology => [object || service || namespace || relationship] + database => mysql databasename that holds the ontologies + host => mysql hostname + username => mysql username + password => mysql password + port => mysql port + dbh => pre-existing database handle to a mysql database + +=cut + +package MOBY::OntologyServer; +use strict; +use Carp; +use vars qw($AUTOLOAD); +use DBI; +use DBD::mysql; +use MOBY::Config; +my $debug = 0; +{ + + #Encapsulated class data + #___________________________________________________________ + #ATTRIBUTES + my %_attr_data = # DEFAULT ACCESSIBILITY + ( + ontology => [ undef, 'read/write' ], + database => [ undef, 'read/write' ], + host => [ undef, 'read/write' ], + username => [ undef, 'read/write' ], + password => [ undef, 'read/write' ], + port => [ undef, 'read/write' ], + dbh => [ undef, 'read/write' ], + ); + + #_____________________________________________________________ + # METHODS, to operate on encapsulated class data + # Is a specified object attribute accessible in a given mode + sub _accessible { + my ( $self, $attr, $mode ) = @_; + $_attr_data{$attr}[1] =~ /$mode/; + } + + # Classwide default value for a specified object attribute + sub _default_for { + my ( $self, $attr ) = @_; + $_attr_data{$attr}[0]; + } + + # List of names of all specified object attributes + sub _standard_keys { + keys %_attr_data; + } +} + +sub new { + my ( $caller, %args ) = @_; + my $caller_is_obj = ref($caller); + my $class = $caller_is_obj || $caller; + my $self = bless {}, $class; + foreach my $attrname ( $self->_standard_keys ) { + if ( exists $args{$attrname} && defined $args{$attrname} ) { + $self->{$attrname} = $args{$attrname}; + } elsif ($caller_is_obj) { + $self->{$attrname} = $caller->{$attrname}; + } else { + $self->{$attrname} = $self->_default_for($attrname); + } + } + $self->ontology eq 'object' && $self->database('mobyobject'); + $self->ontology eq 'namespace' && $self->database('mobynamespace'); + $self->ontology eq 'service' && $self->database('mobyservice'); + $self->ontology eq 'relationship' && $self->database('mobyrelationship'); + + #print STDERR "\n\nCONFIG object is $CONFIG\n\n"; + $CONFIG ||= MOBY::Config->new; + +#print STDERR "got username ",($CONFIG->{mobycentral}->{username})," for mobycentral\n"; + $self->username( $CONFIG->{ $self->database }->{username} ) + unless $self->username; + $self->password( $CONFIG->{ $self->database }->{password} ) + unless $self->password; + $self->port( $CONFIG->{ $self->database }->{port} ) unless $self->port; + $self->host( $CONFIG->{ $self->database }->{url} ) unless $self->host; + my $host = $self->host ? $self->host : $ENV{MOBY_CENTRAL_URL}; + chomp $host; + my $username = + $self->username ? $self->username : $ENV{MOBY_CENTRAL_DBUSER}; + chomp $username; + my $password = + $self->password ? $self->password : $ENV{MOBY_CENTRAL_DBPASS}; + chomp $password if $password; + $password =~ s/\s//g if $password; + my $port = $self->port ? $self->port : $ENV{MOBY_CENTRAL_DBPORT}; + chomp $port; + my ($dsn) = + "DBI:mysql:" + . ( $CONFIG->{ $self->database }->{dbname} ) . ":" + . ($host) . ":" + . ($port); + + #print STDERR "\n\nDSN was $dsn\n\n"; + my $dbh; + +# $debug && &_LOG("connecting to db with params ",$self->database, $self->username, $self->password,"\n"); + if ( defined $password ) { + $dbh = DBI->connect( $dsn, $username, $password, { RaiseError => 1 } ) + or die "can't connect to database"; + } else { + $dbh = DBI->connect( $dsn, $username, undef, { RaiseError => 1 } ) + or die "can't connect to database"; + } + + # $debug && &_LOG("CONNECTED!\n"); + if ($dbh) { + $self->dbh($dbh); + return $self; + } else { + return undef; + } +} + +=head2 objectExists + + moby:newterm will return (0, $message, $MOBYLSID) + newterm will return (0, $message, $MOBYLSID + oldterm will return (1, $message, undef) + newLSID will return (0, $desc, $lsid) +=cut + +sub objectExists { + my ( $self, %args ) = @_; + + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + + my $term = $args{term}; + $term =~ s/^moby://; # if the term is namespaced, then remove that + my $sth; + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); + + my $result; + + $result = $adaptor->query_object(type => $term); + + my $row = shift(@$result); + my $lsid = $row->{object_lsid}; + my $type = $row->{object_type}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $email = $row->{contact_email}; + + if ($lsid) + { # if it is in there, then it has been discovered regardless of being foreign or not + return ( 1, $desc, $lsid ); + } elsif ( _isForeignLSID($term) ) + { # if not in our ontology, but is a foreign LSID, then pass it back verbatim + return ( + 0, +"LSID $term does not exist in the biomoby.org Object Class system\n", + $term + ); + } else { # under all other circumstances (i.e. not a term, or a non-existent biomoby LSID) then fail + return ( + 0, +"Object type $term does not exist in the biomoby.org Object Class system\n", + '' + ); + } +} + +sub _isMOBYLSID { + my ($lsid) = @_; + return 1 if $lsid =~ /^urn\:lsid\:biomoby.org/; + return 0; +} + +sub _isForeignLSID { + my ($lsid) = @_; + return 0 if $lsid =~ /^urn\:lsid\:biomoby.org/; + return 1; +} + +=head2 createObject + +=cut + +sub createObject { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); + return ( 0, "requires a object type node", '' ) unless ( $args{node} ); + return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); + return ( 0, "requires a contact email address", '' ) + unless ( $args{contact_email} ); + return ( 0, "requires a object description", '' ) + unless ( $args{description} ); + my $term = $args{node}; + + my $LSID = + ( $args{'node'} =~ /urn\:lsid/ ) + ? $args{'node'} + : $self->setURI( $args{'node'} ); + unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } + my $result; + $result = $adaptor->query_object(type => $term); + my $row = shift(@$result); + my $lsid = $row->{object_lsid}; + my $type = $row->{object_type}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $email = $row->{contact_email}; + + if ($lsid) { # if it is in there, then the object exists + return ( 0, "This term already exists: $lsid", $lsid ); + } + $args{description} =~ s/^\s+(.*?)\s+$/$1/s; + $args{node} =~ s/^\s+(.*?)\s+$/$1/s; + $args{contact_email} =~ s/^\s+(.*?)\s+$/$1/s; + $args{authority} =~ s/^\s+(.*?)\s+$/$1/s; + + my $insertid = $adaptor->insert_object(object_type => $args{'node'}, + object_lsid => $LSID, + description => $args{'description'}, + authority => $args{'authority'}, + contact_email => $args{'contact_email'}); + unless ( $insertid ) { + return ( 0, "Object creation failed for unknown reasons", '' ); + } + return ( 1, "Object creation succeeded", $LSID ); +} + +=head2 retrieveObject + +=cut + +sub retrieveObject { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + my $term = $args{'type'}; + $term ||=$args{'node'}; + + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); + return ( 0, "requires a object type node as an argument", '' ) + unless ( $term ); + my $LSID = + ( $term =~ /urn\:lsid/ ) + ? $term + : $self->getObjectURI($term); + unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } + my $result = $adaptor->query_object(type => $LSID); + my $row = shift(@$result); +# my $id = $row->{object_id}; + my $type = $row->{object_type}; + my $lsid = $row->{object_lsid}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $contact = $row->{contact_email}; + + unless ($lsid) { return ( 0, "Object doesn't exist in ontology", "" ) } + + # my $OS = MOBY::OntologyServer->new(ontology => "relationship"); + + $result = $adaptor->get_object_relationships(type => $lsid); + my %rel; + foreach my $row (@$result) + { + my $relationship_type = $row->{relationship_type}; + my $objectlsid = $row->{object_lsid}; + my $article = $row->{object2_articlename}; + my $contact = $row->{contact_email}; + my $def = $row->{definition}; + my $auth = $row->{authority}; + my $type = $row->{object_type}; + + push @{ $rel{$relationship_type} }, [ $objectlsid, $article, $type, $def, $auth, $contact ]; + } + return { + objectType => $type, + objectLSID => $lsid, + description => $desc, + contactEmail => $contact, + authURI => $auth, + Relationships => \%rel + }; +} + +=head2 deprecateObject + +=cut + +sub deprecateObject { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + + return ( 0, "WRONG ONTOLOGY", '' ) unless ( $self->ontology eq 'object' ); + my $term = $args{term}; + +# if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ +# return (0, "can't delete from external ontology", $term); +# } + my $LSID; + unless ( $term =~ /urn\:lsid/ ) { $LSID = $self->getObjectURI($term) } else { $LSID = $term } + return ( 0, q{Object type $term cannot be resolved to an LSID}, "" ) + unless $LSID; + + my $result = $adaptor->query_object(type => $LSID); + my $row = shift(@$result); + my $id = $row->{object_id}; + my $lsid = $row->{object_lsid}; + + # object1_id ISA object2_id? + my $isa = $adaptor->query_object_term2term(type => $lsid); + my $isas = shift @$isa; + if ( $isas->{object1_id}) { + return ( 0, + qq{Object type $term has object dependencies in the ontology}, + $lsid ); + } + + my ($err, $errstr) = $adaptor->delete_object(type => $lsid); + if ( $err ) { + return ( 0, "Delete from Object Class table failed: $errstr", + $lsid ); + } + return ( 1, "Object $term Deleted", $lsid ); +} + +=head2 deleteObject + +=cut + +sub deleteObject { + my $self = shift; + $self->deprecateObject(@_); +} + +=head2 relationshipExists + +=cut + +sub relationshipExists { + + # term => $term + # ontology => $ontology + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); + return ( 0, "WRONG ONTOLOGY!", '' ) + unless ( $self->ontology eq 'relationship' ); + my $term = lc( $args{term} ); + $term =~ s/^moby://; # if the term is namespaced, then remove that + my $ont = $args{ontology}; + return ( 0, "requires both term and ontology arguments\n", '' ) + unless ( defined($term) && defined($ont) ); + my $result; + if ( $term =~ /^urn\:lsid/ ) { + + $result = $adaptor->query_relationship( + type => $term, + ontology => $ont); + + } else { + + $result = $adaptor->query_relationship(type => $term, ontology => $ont); + + } + my $row = shift(@$result); + my $lsid = $row->{relationship_lsid}; + my $type = $row->{relationship_type}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $email = $row->{contact_email}; + if ($lsid) { + return ( 1, $desc, $lsid, $type, $auth, $email ); + } else { + return ( + 0,"Relationship Type $term does not exist in the biomoby.org Relationship Type system\n", + '', '', '', '' + ); + } +} + +=head2 addObjectRelationship + +=cut + +sub addObjectRelationship { + + # adds a relationship + #subject_node => $term, + #relationship => $reltype, + #object_node => $objectType, + #articleName => $articleName, + #authority => $auth, + #contact_email => $email + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); + + my $result = $adaptor->query_object(type => $args{subject_node}); + my $row = shift(@$result); + my $subj_lsid = $row->{object_lsid}; + return ( 0, qq{Object type $args{subject_node} does not exist in the ontology}, '' ) + unless defined $subj_lsid; + + $result = $adaptor->query_object(type => $args{object_node}); + $row = shift(@$result); + my $obj_lsid = $row->{object_lsid}; + return ( 0,qq{Object type $args{object_node} does not exist in the ontology},'' ) + unless defined $obj_lsid; + my $isa = $adaptor->query_object_term2term(type => $subj_lsid); + my $isarow = shift @$isa; + if ( $isarow->{object_lsid} ) { + return ( + 0, + qq{Object type $args{subject_node} has existing object dependencies in the ontology. It cannot be changed.}, + $subj_lsid + ); + } + my $OE = MOBY::OntologyServer->new( ontology => 'relationship' ); + my ( $success, $desc, $rel_lsid ) = $OE->relationshipExists( + term => $args{relationship}, + ontology => 'object' ); + ($success) || return ( 0, + qq{Relationship $args{relationship} does not exist in the ontology}, + '' ); + + # need to ensure that identical article names dont' end up at the same level + my $articleNameInvalid = &_testIdenticalArticleName(term => $subj_lsid, articleName => $args{articleName}); + return (0, "Object will have conflicting articleName ".($args{articleName}), '') if $articleNameInvalid; + + my $insertid = $adaptor->insert_object_term2term(relationship_type => $rel_lsid, + object1_type => $subj_lsid, + object2_type => $obj_lsid, + object2_articlename => $args{articleName}); + + + if ($insertid ) { + return ( 1, "Object relationsihp created successfully", '' ); + } else { + return ( 0, "Object relationship creation failed for unknown reasons", + '' ); + } +} + +sub _testIdenticalArticleName { + my (%args)= @_; + my $term = $args{term}; + my $articleName = $args{articleName}; + my $foundCommonArticleNameFlag = 0; + # need to first traverse down the ISA pathway to root + # then for each ISA test the hAS and HASA's for their articlenames and see if they are the same + # case insensitive? + my $OS = MOBY::OntologyServer->new(ontology => 'object'); + my $OSrel = MOBY::OntologyServer->new(ontology => 'relationship'); + my ($exists1, $desc, $isalsid) = $OSrel->relationshipExists(term => 'isa', ontology => 'object'); + my ($exists2, $desc2, $hasalsid) = $OSrel->relationshipExists(term => 'hasa', ontology => 'object'); + my ($exists3, $desc3, $haslsid) = $OSrel->relationshipExists(term => 'has', ontology => 'object'); + + return 1 unless ($exists1 && $exists2 && $exists3); # this is bad, since it returns boolean suggesting that it found a common articlename rather than finding that a given relationship doesn't exist, but... hey.... + # check the hasa relationships for common articleName + $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $args{term}, relationship => $hasalsid, targetArticleName => $articleName); + # check the has relationships for common articleName + $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $args{term}, relationship => $haslsid, targetArticleName => $articleName); + + # now get all of its inherited parents + my $relationships = $OS->Relationships( + ontology => 'object', + term => $args{term}, + relationship => $isalsid, + direction => 'root', + expand => 1); + #relationships{relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] + my ($isa) = keys(%$relationships); # can only be one key returned, and must be isa in this case + my @ISAlist; + (@ISAlist = @{$relationships->{$isa}}) if ($relationships->{$isa}) ; + # for each of the inherited parents, check their articleNames + foreach my $ISA(@ISAlist){ # $ISA = [lsid, articleName] (but articleName shuld be null anyway in this case) + my $what_it_is = shift @$ISA; + # check the hasa relationships for common articleName + $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $what_it_is, relationship => $hasalsid, targetArticleName => $articleName); + # check the has relationships for common articleName + $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $what_it_is, relationship => $haslsid, targetArticleName => $articleName); + } + return $foundCommonArticleNameFlag; +} + +sub _compareArticleNames { + my (%args) = @_; + my $OS = $args{OS}; + my $what_it_is = $args{type}; + my $lsid = $args{relationship}; + my $targetArticleName = $args{targetArticleName}; + my $foundCommonArticleNameFlag = 0; + my $contents = $OS->Relationships( + ontology => 'object', + term => $what_it_is, + relationship => $lsid, + direction => 'root', + ); + if ($contents){ + #$hasarelationships{relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] + my ($content) = keys(%$contents); + if ($contents->{$content}){ + my @CONTENTlist = @{$contents->{$content}}; + foreach my $CONTAINED(@CONTENTlist){ + $foundCommonArticleNameFlag = 1 if ($CONTAINED->[1] eq $targetArticleName); #->[1] is the articleName field + } + } + } + return $foundCommonArticleNameFlag; +} + +=head2 addServiceRelationship + +=cut + +sub addServiceRelationship { + + # adds an ISA relationship + # fail if another object is in relation to this objevt + #subject_node => $term, + #relationship => $relationship, + #predicate_node => $pred + #authority => $auth, + #contact_email => $email); + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); + + my $result = $adaptor->query_service(type => $args{subject_node}); + my $row = shift(@$result); + my $sbj_lsid = $row->{service_lsid}; + + return (0, + qq{Service type $args{subject_node} has object dependencies in the ontology. It can not be changed}, + $sbj_lsid + ) unless defined $sbj_lsid; + + my $isa = $adaptor->query_service_term2term(service2_id => $sbj_lsid); + my $isarow = shift @$isa; + if ( $isarow->{service_lsid} ) { + return ( + 0, + qq{Service type $args{subject_node} has object dependencies in the ontology. It can not be changed}, + $sbj_lsid + ); + } + $result = $adaptor->query_service(type => $args{object_node}); + $row = shift(@$result); + my $obj_lsid = $row->{service_lsid}; + # get ID of the related service + + defined $obj_lsid + || return ( 0, + qq{Service $args{object_node} does not exist in the service ontology}, + '' ); + my $OE = MOBY::OntologyServer->new( ontology => 'relationship' ); + my ( $success, $desc, $rel_lsid ) = $OE->relationshipExists( + term => $args{relationship}, + ontology => 'service' ); + ($success) + || return ( 0, + qq{Relationship $args{relationship} does not exist in the ontology}, + '' ); + + my $insertid = $adaptor->insert_service_term2term(relationship_type => $rel_lsid, + service1_type => $sbj_lsid, + service2_type => $obj_lsid); + if ( defined($insertid)) { + return ( 1, "Service relationship created successfully", '' ); + } else { + return ( 0, "Service relationship creation failed for unknown reasons", + '' ); + } +} + +=head2 serviceExists + +=cut + +sub serviceExists { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); + my $term = $args{term}; + $term =~ s/^moby://; # if the term is namespaced, then remove that + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) + { + return ( 1, "external ontology", $term ); + } + my $result; + $result = $adaptor->query_service(type => $term); + my $row = shift(@$result); + my $id = $row->{service_id}; + my $type = $row->{service_type}; + my $lsid = $row->{service_lsid}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $email = $row->{contact_email}; + + if ($id) { + return ( 1, $desc, $lsid ); + } else { + return ( + 0, +"Service Type $term does not exist in the biomoby.org Service Type ontology\n", + '' + ); + } +} + +=head2 createServiceType + +=cut + +sub createServiceType { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + + #node => $term, + #descrioption => $desc, + #authority => $auth, + #contact_email => $email); + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); + return ( 0, "requires a object type node", '' ) unless ( $args{node} ); + return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); + return ( 0, "requires a contact email address", '' ) + unless ( $args{contact_email} ); + return ( 0, "requires a object description", '' ) + unless ( $args{description} ); + my $term = $args{node}; + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) + { # if it is an LSID, but not a MOBY LSID, than barf + return ( 0, "can't create a term in a non-MOBY ontology!", $term ); + } + my $LSID = + ( $args{'node'} =~ /urn\:lsid/ ) + ? $args{'node'} + : $self->setURI( $args{'node'} ); + unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } + + my $insertid = $adaptor->insert_service(service_type => $args{'node'}, + service_lsid => $LSID, + description => $args{'description'}, + authority => $args{'authority'}, + contact_email => $args{'contact_email'}); + + unless ( $insertid ) { + return ( 0, "Service creation failed for unknown reasons", '' ); + } + return ( 1, "Service creation succeeded", $LSID ); +} + +=head2 deleteServiceType + +=cut + +sub deleteServiceType { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); + my $term = $args{term}; + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) + { + return ( 0, "can't delete from external ontology", $term ); + } + my $LSID; + unless ( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) { + $LSID = $self->getServiceURI($term); + } else { + $LSID = $term; + } + return ( + 0, q{Service type $term cannot be resolved to an LSID in the MOBY ontologies},"" + ) unless $LSID; + + my $result = $adaptor->query_service(type => $LSID); + my $row = shift(@$result); + my $lsid = $row->{service_lsid}; + + if ( !defined $lsid ) { + return ( 0, q{Service type $term does not exist in the ontology}, + $lsid ); + } + + # service1_id ISA service2_id? + my $isa = $adaptor->query_service_term2term(type => $lsid); + my $isas = shift(@$isa); + + if ( $isas->{service1_id} ) { + return ( 0, qq{Service type $term has dependencies in the ontology}, + $lsid ); + } + my ($err, $errstr) = $adaptor->delete_service(type => $lsid); + + if ( $err ) { + return ( 0, "Delete from Service Type table failed: $errstr", + $lsid ); + } + + return ( 1, "Service Type $term Deleted", $lsid ); +} + +=head2 namespaceExists + +=cut + +sub namespaceExists { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + + return ( 0, "WRONG ONTOLOGY!", '' ) + unless ( $self->ontology eq 'namespace' ); + my $term = $args{term}; + $term =~ s/^moby://; # if the term is namespaced, then remove that + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) + { + return ( 1, "external ontology", $term ); + } + my $result; + $result = $adaptor->query_namespace(type => $term); + my $row = shift(@$result); + my $id = $row->{namespace_id}; + my $type = $row->{namespace_type}; + my $lsid = $row->{namespace_lsid}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $email = $row->{contact_email}; + + if ($id) { + return ( 1, $desc, $lsid ); + } else { + return ( + 0, +"Namespace Type $term does not exist in the biomoby.org Namespace Type ontology\n", + '' + ); + } +} + +=head2 createNamespace + +=cut + +sub createNamespace { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + #node => $term, + #descrioption => $desc, + #authority => $auth, + #contact_email => $email); + return ( 0, "WRONG ONTOLOGY!", '' ) + unless ( $self->ontology eq 'namespace' ); + return ( 0, "requires a namespace type node", '' ) unless ( $args{node} ); + return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); + return ( 0, "requires a contact email address", '' ) + unless ( $args{contact_email} ); + return ( 0, "requires a object description", '' ) + unless ( $args{description} ); + my $term = $args{node}; + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) + { # if it is an LSID, but not a MOBY LSID, than barf + return ( 0, "can't create a term in a non-MOBY ontology!", $term ); + } + my $LSID = + ( $args{'node'} =~ /urn\:lsid/ ) + ? $args{'node'} + : $self->setURI( $args{'node'} ); + unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } + + my $insertid = $adaptor->insert_namespace(namespace_type => $args{'node'}, + namespace_lsid => $LSID, + description => $args{'description'}, + authority => $args{'authority'}, + contact_email => $args{'contact_email'}); + + unless ( $insertid ) { + return ( 0, "Namespace creation failed for unknown reasons", '' ); + } + return ( 1, "Namespace creation succeeded", $LSID ); +} + +=head2 deleteNamespace + +=cut + +sub deleteNamespace { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + return ( 0, "WRONG ONTOLOGY!", '' ) + unless ( $self->ontology eq 'namespace' ); + my $term = $args{term}; + my $LSID; + unless ( $term =~ /urn\:lsid/ ) { $LSID = $self->getNamespaceURI($term) } else { $LSID = $term } + return ( 0, q{Namespace type $term cannot be resolved to an LSID}, "" ) + unless $LSID; + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) + { + return ( 0, "cannot delete a term from an external ontology", $term ); + } + + my $result = $adaptor->query_namespace(type => $LSID); + my $row = shift(@$result); + my $lsid = $row->{namespace_lsid}; + + unless ($lsid) { + return ( 0, q{Namespace type $term does not exist in the ontology}, + $lsid ); + } + + # service1_id ISA service2_id? + my $isa = $adaptor->query_namespace_term2term(type => $lsid); + my $isas = shift @$isa; + + if ($isas->{namespace1_id} ) { + return ( 0, qq{Namespace type $term has dependencies in the ontology}, + $lsid ); + } + + my ($err, $errstr) = $adaptor->delete_namespace(type => $lsid); + + if ( $err ) { + return ( 0, "Delete from namespace table failed: $errstr", + $lsid ); + } + + #($err, $errstr) = $adaptor->delete_namespace_term2term(namespace1_id => $lsid); + # + #if ( $err ) { + # return ( + # 0, + # "Delete from namespace term2term table failed: $errstr", + # $lsid + # ); + #} + return ( 1, "Namespace Type $term Deleted", $lsid ); +} + +=head2 retrieveAllServiceTypes + +=cut + +sub retrieveAllServiceTypes { + my ($self) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + my $types = $adaptor->query_service(); + + my %response; + foreach (@$types) { + $response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}]; #COMMENT/REMOVE + #$response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}, $_->{contact_email}, $_->{authority}]; #UNCOMMENT + } + return \%response; +} + +=head2 retrieveAllNamespaceTypes + +=cut + +sub retrieveAllNamespaceTypes { + my ($self) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + my $types = $adaptor->query_namespace(); + + my %response; + foreach (@$types) { + $response{ $_->{namespace_type} } = [$_->{description}, $_->{namespace_lsid}, $_->{authority}, $_->{contact_email}]; + } + return \%response; +} + +=head2 retrieveAllObjectClasses + +=cut + +sub retrieveAllObjectClasses { + my ($self) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + my $types = $adaptor->query_object(); + + my %response; + foreach (@$types) { + $response{ $_->{object_type} } = [$_->{description}, $_->{object_lsid}]; + } + return \%response; +} +*retrieveAllObjectTypes = \&retrieveAllObjectClasses; +*retrieveAllObjectTypes = \&retrieveAllObjectClasses; + +=head2 getObjectCommonName + +=cut + +sub getObjectCommonName { + my ( $self, $URI ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + return undef unless $URI =~ /urn\:lsid/; + my $result = $adaptor->query_object(type => $URI); + my $row = shift(@$result); + my $name = $row->{object_type}; + + return $name ? $name : $URI; +} + +=head2 getNamespaceCommonName + +=cut + +sub getNamespaceCommonName { + my ( $self, $URI ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + return undef unless $URI =~ /urn\:lsid/; + my $result = $adaptor->query_namespace(type => $URI); + my $row = shift(@$result); + my $name = $row->{namespace_type}; + + return $name ? $name : $URI; +} + +=head2 getServiceCommonName + +=cut + +sub getServiceCommonName { + my ( $self, $URI ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + return undef unless $URI =~ /urn\:lsid/; + my $result = $adaptor->query_service(type => $URI); + my $row = shift(@$result); + my $name = $row->{service_type}; + + return $name ? $name : $URI; +} + +=head2 getServiceURI + +=cut + +sub getServiceURI { + my ( $self, $term ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + return $term if $term =~ /urn\:lsid/; + + my $result = $adaptor->query_service(type => $term); + my $row = shift(@$result); + my $id = $row->{service_lsid}; + + return $id; +} + +=head2 getObjectURI + +=cut + +sub getObjectURI { + my ( $self, $term ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + return $term if $term =~ /urn\:lsid/; + + my $result = $adaptor->query_object(type => $term); + my $row = shift(@$result); + my $id = $row->{object_lsid}; + + return $id; +} + +=head2 getNamespaceURI + +=cut + +sub getNamespaceURI { + my ( $self, $term ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + + return $term if $term =~ /urn\:lsid/; + + my $result = $adaptor->query_namespace(type => $term); + my $row = shift(@$result); + my $id = $row->{namespace_lsid}; + + return $id; +} + +=head2 getRelationshipURI + +consumes ontology (object/service) +consumes relationship term as term or LSID + +=cut + +sub getRelationshipURI { + my ( $self, $ontology, $term ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); + + return $term if $term =~ /urn\:lsid/; + + my $result = $adaptor->query_relationship(type => $term, ontology => $ontology); + my $row = shift(@$result); + my $id = $row->{relationship_lsid}; + + return $id; +} + +=head2 getRelationshipTypes + +=cut + +sub getRelationshipTypes { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); + + my $ontology = $args{'ontology'}; + my $OS = MOBY::OntologyServer->new( ontology => "relationship" ); + + my $defs = $adaptor->query_relationship(ontology => $ontology); + + my %result; + foreach ( @$defs ) { + $result{ $_->{relationship_lsid} } = [ $_->{relationship_type}, $_->{authority}, $_->{description} ]; + } + return \%result; +} + +=head2 Relationships + +=cut + +sub Relationships { + + # this entire subroutine assumes that there is NOT multiple parenting!! + my ( $self, %args ) = @_; + my $ontology = $args{ontology} ? $args{ontology} : $self->ontology; + my $term = $args{term}; + my $relationship = $args{relationship}; + my $direction = $args{direction} ? $args{direction} : 'root'; + my $expand = $args{expand} ? 1 : 0; + return + unless ( $ontology + && $term + && ( ( $ontology eq 'service' ) || ( $ontology eq 'object' ) ) ); + + # convert $term into an LSID if it isn't already + if ( $ontology eq 'service' ) { + $term = $self->getServiceURI($term); + $relationship ||="isa"; + my $OS = MOBY::OntologyServer->new(ontology => 'relationship'); + $relationship = $OS->getRelationshipURI("service", $relationship); + } elsif ( $ontology eq 'object' ) { + $term = $self->getObjectURI($term); + $relationship ||="isa"; + my $OS = MOBY::OntologyServer->new(ontology => 'relationship'); + $relationship = $OS->getRelationshipURI("object", $relationship); + } + my %results; + while ( ( $term ne 'urn:lsid:biomoby.org:objectclass:Object' ) + && ( $term ne 'urn:lsid:biomoby.org:servicetype:Service' ) ) + { + my $defs = $self->_doRelationshipsQuery( $ontology, $term, + $relationship, $direction ); + return {[]} unless $defs; # somethig has gone terribly wrong! + my $lsid; + my $rel; + my $articleName; + foreach ( @{$defs} ) { + $lsid = $_->[0]; + $rel = $_->[1]; + $articleName = $_->[2]; + $articleName ||=""; + $debug + && _LOG("\t\tADDING RELATIONSHIP $_ : $lsid to $rel\n"); + push @{ $results{$rel} }, [$lsid, $articleName]; + } + last unless ($expand); + last unless ( $direction eq "root" ); # if we aren't going to root, then be careful or we'll loop infnitely + $term = $lsid; # this entire subroutine assumes that there is NOT multiple parenting... + } + return \%results; #results(relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] +} + +sub _doRelationshipsQuery { + my ( $self, $ontology, $term, $relationship, $direction ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $datasource = "moby$ontology"; # like mobyobject, or mobyservice + my $adaptor = $CONFIG->getDataAdaptor( datasource => $datasource ); + my $defs; + # query returns a reference to an array containing array references + $defs = $adaptor->get_relationship(direction => $direction, + ontology => $ontology, + term => $term, + relationship => $relationship); + # a very long piece of SQL statements have been refactored into Moby::Adaptor::moby::queryapi::mysql.pm + return $defs; +} + +=head2 setURI + +=cut + +sub setURI { + my ( $self, $id ) = @_; + my $URI; + + # $id = lc($id); + if ( $self->ontology eq 'object' ) { + $URI = "urn:lsid:biomoby.org:objectclass:$id"; + } elsif ( $self->ontology eq 'namespace' ) { + $URI = "urn:lsid:biomoby.org:namespacetype:$id"; + } elsif ( $self->ontology eq 'service' ) { + $URI = "urn:lsid:biomoby.org:servicetype:$id"; + } elsif ( $self->ontology eq 'relationship' ) { + $URI = "urn:lsid:biomoby.org:relationshiptype:$id"; + } else { + $URI = 0; + } + return $URI; +} + +=head2 traverseDAG + +=cut + +sub traverseDAG { + my ( $self, $term, $direction ) = @_; + my $ontology = $self->ontology; + return {} unless $ontology; + return {} unless $term; + $direction = "root" unless ($direction); + return {} unless ( ( $direction eq 'root' ) || ( $direction eq 'leaves' ) ); + if ( $ontology eq 'service' ) { + $term = $self->getServiceURI($term); + } elsif ( $ontology eq 'object' ) { + $term = $self->getObjectURI($term); + } + return {} unless $term =~ /^urn\:lsid/; # now its a URI + my $relhash = $self->getRelationshipTypes( ontology => $ontology ); # get teh types of relationships for the object/service ontology + return {} unless $relhash; + my @rels = keys %{$relhash}; #@rels is the list of relationship types for that ontology + my %relationships; + foreach my $relationship (@rels) { + my %IDS; + my $OS = MOBY::OntologyServer->new( ontology => 'relationship' ); + my $reluri = + $OS->getRelationshipURI( $ontology, $relationship ) + ; # get the URI for that relationship type if it ins't already a URI + $IDS{$term} = "untestedroot"; # mark the one in-hand as being untested + while ( grep /untested/, ( values %IDS ) ) + { # now, while there are untested services in our list... + foreach my $termthingy ( keys %IDS ) + { # start parsing through the current list (hash keys) + $debug && _LOG("testing $relationship of $termthingy\n"); + next + if ( $IDS{$termthingy} eq "tested" ) + ; # if it has been tested already then move on + my $lsids = $self->Relationships( + term => $termthingy, + relationship => $relationship, + direction => $direction + ) + ; # get the related terms for this type; this should return a single hash value + if ( $IDS{$termthingy} =~ /root/ ) + { # here is where we remove self + delete $IDS{$termthingy}; + $debug && _LOG("deleting $termthingy\n"); + } else { + $debug && _LOG("marking $termthingy as TESTED\n"); + $IDS{$termthingy} = + "tested"; # mark the current one as now being "done" + } + + #${$lsids}{relationshiptype}=[lsid, lsid, lsid]; + foreach my $lsid_article ( @{ $lsids->{$relationship} } ) + { # go through the related terms + my ($lsid, $article) = @{$lsid_article}; + $debug && _LOG("found $lsid as relationship"); + next + if ( defined $IDS{$lsid} ) + ; # if we have already seen that term, skip it + $debug && _LOG("setting $lsid as untested\n"); + $IDS{$lsid} = + "untested" # otherwise add it to the list and loop again. + } + } + } + my @IDS = keys %IDS; + $relationships{$relationship} = + \@IDS; # and associate them all with the current relationship type + } + return \%relationships; +} + +sub _LOG { + return unless $debug; + + #print join "\n", @_; + #print "\n---\n"; + #return; + open LOG, ">>/tmp/OntologyServer.txt" or die "can't open logfile $!\n"; + print LOG join "\n", @_; + print LOG "\n---\n"; + close LOG; +} +sub DESTROY { } + +sub AUTOLOAD { + no strict "refs"; + my ( $self, $newval ) = @_; + $AUTOLOAD =~ /.*::(\w+)/; + my $attr = $1; + if ( $self->_accessible( $attr, 'write' ) ) { + *{$AUTOLOAD} = sub { + if ( defined $_[1] ) { $_[0]->{$attr} = $_[1] } + return $_[0]->{$attr}; + }; ### end of created subroutine +### this is called first time only + if ( defined $newval ) { + $self->{$attr} = $newval; + } + return $self->{$attr}; + } elsif ( $self->_accessible( $attr, 'read' ) ) { + *{$AUTOLOAD} = sub { + return $_[0]->{$attr}; + }; ### end of created subroutine + return $self->{$attr}; + } + + # Must have been a mistake then... + croak "No such method: $AUTOLOAD"; +} +1; From fgibbons at pub.open-bio.org Wed Sep 21 15:05:14 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Wed, 21 Sep 2005 15:05:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509211905.j8LJ5EKD012429@pub.open-bio.org> fgibbons Wed Sep 21 15:05:14 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv12383/MOBY Modified Files: CommonSubs.pm Log Message: - Major re-arrangement of code, with a few small additions, which I try to describe below: - Code re-arranged into blocks, according to broad functional category. This module is one of the most confusing to newbies, since there's all this stuff just thrown in, with no apparent order to it. - POD adjusted to take more advantage of HTML output. Previously, it was just all one big dump of text - it's a lot easier to read when there's bolding and different sized fonts. Also those annoying "Title" headings are gone. - Because we're so lax about namespaces, any time we try to getAttribute() on a DOM node, we have to check for two things. Now there are two new routines that take care of that: _moby_getAttribute and _moby_getAttributeNode They're not exported, since they're intended for internal use only. - In generating a collectionResponse, we want to return an empty message if the $data passed in is empty. There's a bug fix that tests for an entirely empty $data arrayref. Previously, it just tested the first element. - Most tags are tightened up, and regexps are contracted. moby-live/Perl/MOBY CommonSubs.pm,1.68,1.69 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.68 retrieving revision 1.69 diff -u -r1.68 -r1.69 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/09/01 14:00:00 1.68 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/09/21 19:05:14 1.69 @@ -6,14 +6,21 @@ useful in clients and services to deal with the input/output from MOBY Services -=cut +=head1 DESCRIPTION + +CommonSubs are used to do various manipulations of MOBY Messages. It is useful +both Client and Service side to construct and parse MOBY Messages, and ensure +that the message structure is valid as per the API. + +It DOES NOT connect to MOBY Central for any of its functions, though it does +contact the ontology server, so it will require a network connection. + +=head1 SYNTAX =head2 Client Side Paradigm not written yet -=cut - =head2 Service-Side Paradigm The following is a generalized architecture for *all* @@ -23,7 +30,7 @@ sub myServiceName { my ($caller, $data) = @_; my $MOBY_RESPONSE; # holds the response raw XML - + # genericServiceInputParser # unpacks incoming message into an array of arrarefs. # Each element of the array is a queryInput block, or a mobyData block @@ -31,11 +38,11 @@ # [SIMPLE, $queryID, $simple] # the first element is an exported constant SIMPLE, COLLECTION, SECONDARY # the second element is the queryID (required for enumerating the responses) - # the third element is the XML::LibXML for the Simple, Collection, or Parameter block - my (@inputs)= genericServiceInputParser($data); + # the third element is the XML::LibXML for the Simple, Collection, or Parameter block + my (@inputs)= genericServiceInputParser($data); # or fail properly with an empty response return SOAP::Data->type('base64' => responseHeader("my.authURI.com") . responseFooter()) unless (scalar(@inputs)); - + # you only need to do this if you are intending to be namespace aware # some services might not care what namespace the data is in, so long # as there is data... @@ -53,16 +60,15 @@ # (see pod docs for other possibilities) my $namespace = getSimpleArticleNamespaceURI($input); # get namespace my ($identifier) = getSimpleArticleIDs($input); # get ID (note array output! see pod) - + # here is where you do whatever manipulation you need to do # for your particular service. - # you will be building an XML document into $MOBY_RESPONSE + # you will be building an XML document into $MOBY_RESPONSE } } - return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter)); + return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter)); } -=cut =head1 EXAMPLE @@ -113,7 +119,7 @@ unless ($accession =~/^GO:/){ $accession = "GO:$accession"; # we still haven't decided on whether id's should include the prefix... } - $sth->execute($accession); + $sth->execute($accession); my ($term, $def) = $sth->fetchrow_array; if ($term){ $MOBY_RESPONSE .= simpleResponse(" @@ -126,19 +132,9 @@ } } } - - return SOAP::Data->type('base64' => (responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter)); - } - - -=head1 DESCRIPTION - -CommonSubs are used to do various manipulations of MOBY Messages. It is useful -both Client and Service side to construct and parse MOBY Messages, and ensure -that the message structure is valid as per the API. -It DOES NOT connect to MOBY Central for any of its functions, though it does -contact the ontology server, so it will require a network connection. + return SOAP::Data->type('base64' => (responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter)); + } =head1 AUTHORS @@ -147,9 +143,7 @@ BioMOBY Project: http://www.biomoby.org -=cut - -=head1 METHODS +=head1 PARSING INPUT =cut @@ -172,41 +166,6 @@ use constant BE_STRICT => 0; our @ISA = qw(Exporter); our @EXPORT = qw(COLLECTION SIMPLE SECONDARY PARAMETER BE_NICE BE_STRICT); -our @EXPORT_OK = qw( - getSimpleArticleIDs - getSimpleArticleNamespaceURI - simpleResponse - collectionResponse - complexResponse - responseHeader - responseFooter - getInputArticles - getInputs - getInputID - getArticles - getCollectedSimples - getNodeContentWithArticle - extractRawContent - validateNamespaces - validateThisNamespace - isSimpleArticle - isCollectionArticle - isSecondaryArticle - extractResponseArticles - getResponseArticles - getCrossReferences - genericServiceInputParser - genericServiceInputParserAsObject - complexServiceInputParser - whichDeepestParentObject - getServiceNotes - COLLECTION - SIMPLE - SECONDARY - PARAMETER - BE_NICE - BE_STRICT -); our %EXPORT_TAGS = ( all => [ qw( @@ -244,98 +203,127 @@ BE_STRICT ) ] -); +);# complexResponse is *not* here, but is in @EXPORT_OK + + +our @EXPORT_OK = ("collectionResponse", @{$EXPORT_TAGS{'all'}}); =head2 genericServiceInputParser - function : For the MOST SIMPLE SERVICES that take single Simple or Collection inputs - and no Secondaries/Parameters this routine takes the MOBY message and - breaks the objects out of it in a useful way - usage : my @inputs = genericServiceInputParser($MOBY_mssage)); - args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message - returns : @inputs - the structure of @inputs is a list of listrefs. - Each listref has three components: - 1. COLLECTION|SIMPLE (i.e. constants 1, 2) - 2. queryID - 3. $data - the data takes several forms - a. $article XML::LibXML node for Simples - ... - b. \@article XML:LibXML nodes for Collections - - for example, the input message: - - - - - - - - - - - +B For the MOST SIMPLE SERVICES that take single Simple or +Collection inputs and no Secondaries/Parameters this routine takes the +MOBY message and breaks the objects out of it in a useful way + +B + my @inputs = genericServiceInputParser($MOBY_mssage)); + +B C<$message> - this is the SOAP payload; i.e. the XML document containing the MOBY message + +B C<@inputs> - the structure of @inputs is a list of listrefs. + +Each listref has three components: + +=over 4 + +=item * +COLLECTION|SIMPLE (i.e. constants 1, 2) + +=item * +queryID + +=item * +$data - the data takes several forms + +=over 4 + +=item * +$article XML::LibXML node for Simples ... + +=item * +\@article XML:LibXML nodes for Collections - will become: +=back + +=back + +For example, the input message: + + + + + + + + + + + +will become: (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module) @inputs = ([SIMPLE, 1, $DOM], [SIMPLE, 2, $DOM]) # the block - for example, the input message: - - - - - - - - - - - +For example, the input message: - will become: + + + + + + + + + + - @inputs = ( [COLLECTION, 1, [$DOM, $DOM]] ) # the block +will become: + + @inputs = ( [COLLECTION, 1, [$DOM, $DOM]] ) # the block =cut sub genericServiceInputParser { - my ( $message ) = @_; # get the incoming MOBY query XML - my @inputs; # set empty response - my @queries = - getInputs( $message ); # returns XML::LibXML nodes ... - foreach my $query ( @queries ) { - my $queryID = - getInputID( $query ); # get the queryID attribute of the mobyData - my @input_articles = - getArticles( $query ) - ; # get the Simple/Collection/Secondary articles making up this query ... or ... or ... - foreach my $input ( @input_articles ) { # input is a listref - my ( $articleName, $article ) = @{$input}; # get the named article - if ( isCollectionArticle( $article ) ) { - my @simples = getCollectedSimples( $article ); - push @inputs, [ COLLECTION, $queryID, \@simples ]; - } elsif ( isSimpleArticle( $article ) ) { - push @inputs, [ SIMPLE, $queryID, $article ]; - } elsif ( isSecondaryArticle( $article ) ) - { # should never happen in a generic service parser! - push @inputs, [ SECONDARY, $queryID, $article ]; - } - } + my ( $message ) = @_; # get the incoming MOBY query XML + my @inputs; # set empty response + my @queries = getInputs( $message ); # returns XML::LibXML nodes ... + foreach my $query ( @queries ) { + my $queryID = getInputID( $query ); # get the queryID attribute of the mobyData + my @input_articles = + getArticles( $query ) + ; # get the Simple/Collection/Secondary articles making up this query ... or ... or ... + foreach my $input ( @input_articles ) { # input is a listref + my ( $articleName, $article ) = @{$input}; # get the named article + if ( isCollectionArticle( $article ) ) { + my @simples = getCollectedSimples( $article ); + push @inputs, [ COLLECTION, $queryID, \@simples ]; + } elsif ( isSimpleArticle( $article ) ) { + push @inputs, [ SIMPLE, $queryID, $article ]; + } elsif ( isSecondaryArticle( $article ) ) + { # should never happen in a generic service parser! + push @inputs, [ SECONDARY, $queryID, $article ]; } - return @inputs; + } + } + return @inputs; } =head2 serviceInputParser - DO NOT USE!! - function : to take a MOBY message and break the objects out of it. This is identical - to the genericServiceInputParser method above, except that it returns the data as - Objects rather than XML::LibXML nodes. This is an improvement! - usage : my @inputs = serviceInputParser($MOBY_mssage)); - args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message - returns : @inputs - the structure of @inputs is a list of listrefs. - Each listref has three components: +DO NOT USE!! + +B to take a MOBY message and break the objects out of it. +This is identical to the genericServiceInputParser method above, +except that it returns the data as Objects rather than XML::LibXML +nodes. This is an improvement! + +B C + +B C<$message> - this is the SOAP payload; i.e. the XML document containing the MOBY message + +B C<@inputs> - the structure of @inputs is a list of listrefs. + +Each listref has three components: + 1. COLLECTION|SIMPLE|SECONDARY (i.e. constants 1, 2, 3) 2. queryID (undef for Secondary parameters) 3. $data - either MOBY::Client::SimpleArticle, CollectionArticle, or SecondaryArticle @@ -343,108 +331,103 @@ =cut sub serviceInputParser { - my ( $message ) = @_; # get the incoming MOBY query XML - my @inputs; # set empty response - my @queries = - getInputs( $message ); # returns XML::LibXML nodes ... - -# mark, this doesn't work for complex services. We need to allow more than one input per invocation - foreach my $query ( @queries ) { - my $queryID = - getInputID( $query ); # get the queryID attribute of the mobyData - my @input_articles = - getArticlesAsObjects( $query ) - ; # get the Simple/Collection articles making up this query ... or ... or ...isCollection ) { - my @simples = getCollectedSimples( $article->XML ); - push @inputs, [ COLLECTION, $queryID, \@simples ]; - } elsif ( $article->isSimple ) { - push @inputs, [ SIMPLE, $queryID, $article ]; - } elsif ( $article->isSecondary ) { - push @inputs, [ SECONDARY, $queryID, $article ]; - } - } - } - return @inputs; + my ( $message ) = @_; # get the incoming MOBY query XML + my @inputs; # set empty response + my @queries = getInputs( $message ); # returns XML::LibXML nodes ... + + # mark, this doesn't work for complex services. We need to allow more than one input per invocation + foreach my $query ( @queries ) { + my $queryID = getInputID( $query ); # get the queryID attribute of the mobyData + # get the Simple/Collection articles making up this query + # ... or ... + # or ...isCollection ) { + my @simples = getCollectedSimples( $article->XML ); + push @inputs, [ COLLECTION, $queryID, \@simples ]; + } elsif ( $article->isSimple ) { + push @inputs, [ SIMPLE, $queryID, $article ]; + } elsif ( $article->isSecondary ) { + push @inputs, [ SECONDARY, $queryID, $article ]; + } + } + } + return @inputs; } =head2 complexServiceInputParser - function : For more complex services that have multiple articles for each input - and/or accept parameters, this routine will take a MOBY message and - extract the Simple/Collection/Parameter objects out of it in a - useful way. - usage : my $inputs = complexServiceInputParser($MOBY_mssage)); - args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message - returns : $inputs is a hashref with the following structure: - +B For more complex services that have multiple articles for +each input and/or accept parameters, this routine will take a MOBY +message and extract the Simple/Collection/Parameter objects out of it +in a useful way. + +B C + +B C<$message> - this is the SOAP payload; i.e. the XML document containing the MOBY message + +B C<$inputs> is a hashref with the following structure: + $inputs->{$queryID} = [ [TYPE, $DOM], [TYPE, $DOM], [TYPE, $DOM] ] - - Simples ------------------------ - - for example, the input message: - - - - - - - 10 - - - will become: - (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module) - +=head3 Simples + +For example, the input message: + + + + + + + 10 + + + +will become: (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module) + $inputs->{1} = [ [SIMPLE, $DOM_name1], # the block [SECONDARY, $DOM_cutoff] # $DOM_cutoff= block ] - Please see the XML::LibXML pod documentation for information about how - to parse XML DOM objects. +Please see the XML::LibXML pod documentation for information about how to parse XML DOM objects. +=head3 Collections - Collections -------------------- - - With inputs that have collections these are presented as a - listref of Simple article DOM's. So for the following message: - - - - - - - - - - - - 10 - - +With inputs that have collections these are presented as a listref of +Simple article DOM's. So for the following message: + + + + + + + + + + + + 10 + + + +will become - will become - $inputs->{1} = [ [COLLECTION, [$DOM, $DOM] ], # $DOM is the Block! [SECONDARY, $DOM_cutoff] # $DOM_cutoff = Block ] - Please see the XML::LibXML pod documentation for information about how - to parse XML DOM objects. - +Please see the XML::LibXML pod documentation for information about how to parse XML DOM objects. =cut sub complexServiceInputParser { my ( $message ) = @_; # get the incoming MOBY query XML my @inputs; # set empty response - my @queries = - getInputs( $message ); # returns XML::LibXML nodes ... + my @queries = getInputs( $message ); # returns XML::LibXML nodes ... my %input_parameters; # $input_parameters{$queryID} = [ foreach my $query ( @queries ) { - my $queryID = - getInputID( $query ); # get the queryID attribute of the mobyData + my $queryID = getInputID( $query ); # get the queryID attribute of the mobyData my @input_articles = getArticles( $query ) ; # get the Simple/Collection/Secondary articles making up this query ... or ... or ... @@ -466,14 +449,17 @@ =head2 getArticles - function : get the Simple/Collection/Parameter articles for a single mobyData - usage : @articles = getArticles($XML) - args : raw XML or XML::LibXML of a queryInput, mobyData, or queryResponse block (e.g. from getInputs) - returns : a list of listrefs; each listref is one component of the queryInput or mobyData block - a single block may consist of one or more named or unnamed - simple, collection, or parameter articles. - The listref structure is thus [name, $ARTICLE_DOM]: - +B get the Simple/Collection/Parameter articles for a single mobyData + +B C<@articles = getArticles($XML)> + +B raw XML or XML::LibXML of a queryInput, mobyData, or queryResponse block (e.g. from getInputs) + +B a list of listrefs; each listref is one component of the +queryInput or mobyData block a single block may consist of one or more +named or unnamed simple, collection, or parameter articles. The +listref structure is thus C<[name, $ARTICLE_DOM]>: + e.g.: @articles = ['name1', $SIMPLE_DOM] generated from the following sample XML: @@ -483,24 +469,24 @@ - + or : @articles = ['name1', $COLL_DOM], ['paramname1', $PARAM_DOM] generated from the following sample XML: - - - - - - - - - - - 10 - - + + + + + + + + + + + 10 + + =cut @@ -509,16 +495,15 @@ $moby = _string_to_DOM($moby); return undef unless ( ($moby->nodeType == ELEMENT_NODE) - && ( $moby->nodeName =~ /queryInput|queryResponse|mobyData/ ) ); + && ( $moby->nodeName =~ /^(moby:|)(queryInput|queryResponse|mobyData)$/ ) ); my @articles; foreach my $child ( $moby->childNodes ) { # there may be more than one Simple/Collection per input; iterate over them next unless ( ($child->nodeType == ELEMENT_NODE) # ignore whitespace - && ( $child->nodeName =~ /Simple|Collection|Parameter/ ) ); - my $articleName = $child->getAttribute( 'articleName' ) - || $child->getAttribute( 'moby:articleName' ); + && ( $child->nodeName =~ /^(moby:|)(Simple|Collection|Parameter)$/ ) ); + my $articleName = _moby_getAttribute($child, 'articleName' ); # push the named child DOM elements (which are or , ) - push @articles, [ $articleName, $child ]; + push @articles, [ $articleName, $child ]; } return @articles; # return them. } @@ -532,25 +517,34 @@ =head2 getSimpleArticleIDs - function : to get the IDs of simple articles that are in the given namespace - usage : my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles); - my @ids = getSimpleArticleIDs(\@SimpleArticles); - args : $Namespace - (optional) a namespace stringfrom the MOBY namespace ontology, or undef if you don't care - \@Simples - (required) a listref of Simple XML::LibXML nodes - i.e. the XML::LibXML representing an XML structure like this: - - - - note : If you provide a namespace, it will return *only* the ids that are in the given namespace, - but will return 'undef' for any articles in the WRONG namespace so that you get an - equivalent number of outputs to inputs. - - Note that if you call this with a single argument, this is assumed to - be \@Articles, so you will get ALL id's regardless of namespace! +B to get the IDs of simple articles that are in the given namespace + +B + + my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles); + my @ids = getSimpleArticleIDs(\@SimpleArticles); + +B + +C<$Namespace> - (optional) a namespace stringfrom the MOBY namespace ontology, or undef if you don't care + +C<\@Simples> - (required) a listref of Simple XML::LibXML nodes i.e. the XML::LibXML representing an XML structure like this: + + + + + +Note : If you provide a namespace, it will return *only* the ids that +are in the given namespace, but will return 'undef' for any articles +in the WRONG namespace so that you get an equivalent number of outputs +to inputs. + +Note that if you call this with a single argument, this is assumed to +be C<\@Articles>, so you will get ALL id's regardless of namespace! =cut -#Eddie - converted + sub getSimpleArticleIDs { my ( $desired_namespace, $input_nodes ) = @_; if ( $desired_namespace && !$input_nodes ) @@ -569,9 +563,10 @@ $OS->namespaceExists( term => $desired_namespace ); # returns (success, message, lsid) unless ( $s ) { # bail if not successful # Printing to STDERR is not very helpful - we should probably return something that can be dealt iwth programatically.... - print STDERR "MOBY::CommonSubs WARNING ** the namespace '$desired_namespace' " - . "does not exist in the MOBY ontology, and does not have a valid LSID\n"; - return undef; + die("MOBY::CommonSubs: the namespace '$desired_namespace' " + . "does not exist in the MOBY ontology, " + . "and does not have a valid LSID"); +# return undef; } $desired_namespace = $namespace_lsid; # Replace namespace with fully-qualified LSID } @@ -579,13 +574,12 @@ foreach my $in ( @input_nodes ) { next unless $in; #$in = "" - next unless $in->nodeName =~ /Simple/; # only allow simples + next unless $in->nodeName =~ /^(moby:|)Simple$/; # only allow simples my @simples = $in->childNodes; foreach ( @simples ) { # $_ = next unless $_->nodeType == ELEMENT_NODE; if ( $desired_namespace ) { - my $ns = $_->getAttributeNode( 'namespace' ) # get the namespace DOM node - || $_->getAttributeNode( 'moby:namespace' ); + my $ns = _moby_getAttributeNode($_, 'namespace' ); # get the namespace DOM node unless ( $ns ) { # if we don't get it at all, then move on to the next input push @ids, undef; # but push an undef onto teh stack in order next; @@ -594,7 +588,7 @@ ( $s, $m, $ns ) = $OS->namespaceExists( term => $ns ); # A bad namespace will return 'undef' which makes for a bad comparison (Perl warning). # Better to check directly for success ($s), THEN check that namespace is the one we wanted. - unless ( $s && $ns eq $desired_namespace ) + unless ( $s && $ns eq $desired_namespace ) { # we are registering as working in a particular namespace, so check this push @ids, undef; # and push undef onto the stack if it isn't next; @@ -602,7 +596,7 @@ } # Now do the same thing for ID's - my $id = $_->getAttributeNode( 'id' ) || $_->getAttributeNode( 'moby:id' ); + my $id = _moby_getAttributeNode($_, 'id' ); unless ( $id ) { push @ids, undef; next; @@ -620,31 +614,34 @@ =head2 getSimpleArticleNamespaceURI - function : to get the namespace of a simple article - usage : my $ns = getSimpleArticleNamespaceURI($SimpleArticle); - args : $Simple - (required) a single XML::LibXML node representing a Simple Article - i.e. the XML::LibXML representing an XML structure like this: - - - +B to get the namespace of a simple article + +B C + +B C<$Simple> - (required) a single XML::LibXML node +representing a Simple Article i.e. the XML::LibXML representing an XML +structure like this: + + + + =cut -#Eddie - converted + sub getSimpleArticleNamespaceURI { # pass me a input node and I will give you the lsid of the namespace of that input object my ( $input_node ) = @_; return undef unless $input_node; my $OS = MOBY::Client::OntologyServer->new; - + #$input_node = "" my @simples = $input_node->childNodes; foreach ( @simples ) { # $_ = # should be just one, so I will return at will from this routine next unless $_->nodeType == ELEMENT_NODE; - my $ns = $_->getAttributeNode( 'namespace' ) # get the namespace DOM node - || $_->getAttributeNode( 'moby:namespace' ); + my $ns = _moby_getAttributeNode($_, 'namespace' ); # get the namespace DOM node return undef unless ( $ns ); # if we don't get it at all, then move on to the next input my ( $s, $m, $lsid ) = $OS->namespaceExists( term => $ns->getValue ); # if we have a namespace, then get its value @@ -653,306 +650,111 @@ } } -=head2 simpleResponse +sub _string_to_DOM { +# Convert string to DOM. +# If DOM passed in, just return it (i.e., this should be idempotent) +# By Frank Gibbons, Aug. 2005 +# Utility subroutine, not for external use (no export), widely used in this package. + my $XML = shift; + my $moby; + return $XML if ( ref($XML) =~ /^XML\:\:LibXML/ ); - function : wraps a simple article in the appropriate (mobyData) structure - usage : $resp .= &simpleResponse($object, 'MyArticleName', $queryID); - args : (in order) - $object - (optional) a MOBY Object as raw XML - $article - (optional) an articeName for this article - $query - (optional, but strongly recommended) the queryID value for the - mobyData block to which you are responding - notes : as required by the API you must return a response for every input. - If one of the inputs was invalid, you return a valid (empty) MOBY - response by calling &simpleResponse(undef, undef, $queryID) with no arguments. + my $parser = XML::LibXML->new(); + my $doc; + eval { $doc = $parser->parse_string( $XML ) }; + die("CommonSubs couldn't parse XML '$XML' because\n\t$@") if $@; + return $doc->getDocumentElement(); +} -=cut +=head2 getInputs -sub simpleResponse { - my ( $data, $articleName, $qID ) = @_; # articleName optional - $qID = &_getQueryID( $qID ) - if ref( $qID ) =~ /XML\:\:LibXML/; # in case they send the DOM instead of the ID - $data ||= ''; # initialize to avoid uninit value errors - $articleName ||= ""; - $qID ||= ""; - if ( $articleName || $data) { # Linebreaks in XML make it easier for human debuggers to read! - return " - - $data - - "; - } else { - return " - - "; - } -} +B get the mobyData block(s) as XML::LibXML nodes -#Eddie - converted -sub _getQueryID { - my ( $query ) = @_; - $query = _string_to_XML($query); - return '' unless ( $query->nodeName =~ /queryInput|mobyData/ ); #Eddie - unsure - return ($query->getAttribute( 'queryID' ) - || $query->getAttribute( 'moby:queryID' )); -} +B C<@queryInputs = getInputArticles($XML)> -=head2 collectionResponse +B the raw XML of a query, or an XML::LibXML document - function : wraps a set of articles in the appropriate mobyData structure - usage : return responseHeader . &collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter; - args : (in order) - \@objects - (optional) a listref of MOBY Objects as raw XML - $article - (optional) an articeName for this article - $queryID - (optional, but strongly recommended) the mobyData ID - to which you are responding - notes : as required by the API you must return a response for every input. - If one of the inputs was invalid, you return a valid (empty) MOBY - response by calling &collectionResponse(undef, undef, $queryID). +B a list of XML::LibXML::Node's, each is a queryInput or mobyData block. + +B< Note:> Remember that these blocks are enumerated! This is what you +pass as the third argument to the simpleResponse or collectionResponse +subroutine to associate the numbered input to the numbered response =cut -sub collectionResponse { - my ( $data, $articleName, $qID ) = @_; # articleName optional - my $content = ""; - $data ||= []; - $qID ||= ''; - unless ( ( ref($data) eq 'ARRAY' ) && $data->[0] ) - { # we're expecting an arrayref as input data,and it must not be empty - return ""; - } - foreach ( @{$data} ) { - if ( $_ ) { - $content .= " - $_ - "; - } else { - $content .= " - - "; +sub getInputs { + my ( $XML ) = @_; + my $moby = _string_to_DOM($XML); + my @queries; + foreach my $querytag qw( queryInput moby:queryInput mobyData moby:mobyData ) + { + my $x = $moby->getElementsByTagName( $querytag ); # get the mobyData block + for ( 1 .. $x->size() ) { # there may be more than one mobyData per message + push @queries, $x->get_node( $_ ); + } } - } - if ( $articleName ) { - return " - - - $content - - - "; - } else { - return " - - $content - - "; - } + return @queries; # return them in the order that they were discovered. } -=head2 complexResponse +=head2 getInputID - function : wraps articles in the appropriate (mobyData) structure - usage : $resp .= &complexResponse(\@data, $qID); - args : (in order) - \@data - (optional) a listref of arrays. - each element of @data is itself a listref of [$articleName, $XML] - $qID - (optional, but strongly recommended) the queryID value for the - mobyData block to which you are responding - notes : as required by the API you must return a response for every input. - If one of the inputs was invalid, you return a valid (empty) MOBY - response by calling &complexResponse(undef, $queryID) with no arguments. +B get the value of the queryID element -=cut +B C<@queryInputs = getInputID($XML)> -sub complexResponse { - my ( $data, $qID ) = @_; - #return 'ERROR: expected listref [element1, element2, ...] for data' unless ( ref( $data ) =~ /array/i ); - return "\n" - unless ( ref( $data ) eq 'ARRAY' ); - $qID = &_getQueryID( $qID ) - if ref( $qID ) =~ /XML\:\:LibXML/; # in case they send the DOM instead of the ID - my @inputs = @{$data}; - my $output = ""; - foreach ( @inputs ) { - #return 'ERROR: expected listref [articleName, XML] for data element' unless ( ref( $_ ) =~ /array/i ); - return "\n" unless ( ref($_) eq 'ARRAY' ); - while ( my ( $articleName, $XML ) = splice( @{$_}, 0, 2 ) ) { - if ( ref($XML) ne 'ARRAY' ) { - $articleName ||= ""; - $XML ||= ""; - if ( ( $XML =~ /\/ ) || ( $XML =~ /\/ ) ) - { - $output .= - "$XML"; - } else { - $output .= - "\n$XML\n\n"; - } - - # need to do this for collections also!!!!!! - } elsif ( ref($XML) eq 'ARRAY' ) { - my @objs = @{$XML}; - $output .= "\n"; - foreach ( @objs ) { - $output .= "$_\n"; - } - $output .= "\n"; - } - } - } - $output .= "\n"; - return $output; -} +B the raw XML or XML::LibXML of a queryInput or mobyData block (e.g. from getInputs) -=head2 responseHeader +B integer, or '' - function : print the XML string of a MOBY response header +/- serviceNotes - usage : responseHeader('illuminae.com') - responseHeader( - -authority => 'illuminae.com', - -note => 'here is some data from the service provider') - args : a string representing the service providers authority URI, - OR a set of named arguments with the authority and the - service provision notes. - caveat : - notes : returns everything required up to the response articles themselves. - i.e. something like: - - - - - -=cut - -sub responseHeader { - use HTML::Entities (); - my ( $auth, $notes ) = &_rearrange( [qw[AUTHORITY NOTE]], @_ ); - $auth ||= "not_provided"; - $notes ||= ""; - my $xml = - "" - . "" - . ""; - if ( $notes ) { - my $encodednotes = HTML::Entities::encode( $notes ); - $xml .= "$encodednotes"; - } - return $xml; -} - -=head2 responseFooter - - function : print the XML string of a MOBY response footer - usage : return responseHeader('illuminae.com') . $DATA . responseFooter; - notes : returns everything required after the response articles themselves - i.e. something like: - - - - -=cut - -sub responseFooter { - return ""; -} - - -sub _string_to_DOM { -# Convert string to DOM. -# If DOM passed in, just return it (i.e., this should be idempotent) -# By Frank Gibbons, Aug. 2005 -# Utility subroutine, not for external use (no export), widely used in this package. - my $XML = shift; - my $moby; - return $XML if ( ref($XML) =~ /^XML\:\:LibXML/ ); - - my $parser = XML::LibXML->new(); - my $doc; - eval { $doc = $parser->parse_string( $XML ) }; - die("CommonSubs couldn't parse XML '$XML' because\n\t$@") if $@; - return $doc->getDocumentElement(); -} - -=head2 getInputs - - function : get the mobyData block(s) as XML::LibXML nodes - usage : @queryInputs = getInputArticles($XML) - args : the raw XML of a query, or an XML::LibXML document - returns : a list of XML::LibXML::Node's, each is a queryInput or mobyData block. - Note : Remember that these blocks are enumerated! This is what you - pass as the third argument to the simpleResponse or collectionResponse - subroutine to associate the numbered input to the numbered response - -=cut - -#Eddie - converted -sub getInputs { - my ( $XML ) = @_; - my $moby = _string_to_DOM($XML); - my @queries; - foreach my $querytag qw( queryInput moby:queryInput mobyData moby:mobyData ) - { - my $x = $moby->getElementsByTagName( $querytag ); # get the mobyData block - for ( 1 .. $x->size() ) { # there may be more than one mobyData per message - push @queries, $x->get_node( $_ ); - } - } - return @queries; # return them in the order that they were discovered. -} - -=head2 getInputID - - function : get the value of the queryID element - usage : @queryInputs = getInputID($XML) - args : the raw XML or XML::LibXML of a queryInput or mobyData block (e.g. from getInputs) - returns : integer, or '' - Note : Inputs and Responses are coordinately enumerated! - The integer you get here is what you - pass as the third argument to the simpleResponse or collectionResponse - subroutine to associate the numbered input to the numbered response +B< Note:> Inputs and Responses are coordinately enumerated! The +integer you get here is what you pass as the third argument to the +simpleResponse or collectionResponse subroutine to associate the +numbered input to the numbered response =cut sub getInputID { my ( $XML ) = @_; my $moby = _string_to_DOM($XML); - return '' unless ( $moby->nodeName =~ /queryInput|mobyData/ ); - my $qid = $moby->getAttribute( 'queryID' ) - || $moby->getAttribute( 'moby:queryID' ); + return '' unless ( $moby->nodeName =~ /^(moby:|)queryInput|mobyData$/ ); + my $qid = _moby_getAttribute($moby, 'queryID' ); return defined( $qid ) ? $qid : ''; } =head2 getArticlesAsObjects DO NOT USE!! - function : get the Simple/Collection articles for a single mobyData - or queryResponse node, rethrning them as SimpleArticle, - SecondaryArticle, or ServiceInstance objects - usage : @articles = getArticles($XML) - args : raw XML or XML::LibXML of a moby:mobyData block - returns : + +B get the Simple/Collection articles for a single mobyData +or queryResponse node, rethrning them as SimpleArticle, +SecondaryArticle, or ServiceInstance objects + +B C<@articles = getArticles($XML)> + +B raw XML or XML::LibXML of a moby:mobyData block + +B =cut -#Eddie - converted sub getArticlesAsObjects { my ( $moby ) = @_; $moby = _string_to_DOM($moby); return undef unless $moby->nodeType == ELEMENT_NODE; return undef - unless ($moby->nodeName =~ /queryInput|queryResponse|mobyData/); + unless ($moby->nodeName =~ /^(moby:|)(queryInput|queryResponse|mobyData)$/); my @articles; foreach my $child ( $moby->childNodes ) { # there may be more than one Simple/Collection per input; iterate over them next unless $child->nodeType == ELEMENT_NODE; # ignore whitespace next - unless ( $child->nodeName =~ /Simple|Collection|Parameter/ ); + unless ( $child->nodeName =~ /^(moby:|)(Simple|Collection|Parameter)$/ ); my $object; - if ( $child->nodeName =~ /Simple/ ) { + if ( $child->nodeName =~ /^(moby:|)Simple$/ ) { $object = MOBY::Client::SimpleArticle->new( XML_DOM => $child ); - } elsif ( $child->nodeName =~ /Collection/ ) { + } elsif ( $child->nodeName =~ /^(moby:|)Collection$/ ) { $object = MOBY::Client::CollectionArticle->new( XML_DOM => $child ); - } elsif ( $child->nodeName =~ /Parameter/ ) { + } elsif ( $child->nodeName =~ /^(moby:|)Parameter$/ ) { $object = MOBY::Client::SecondaryArticle->new( XML_DOM => $child ); } next unless $object; @@ -963,10 +765,13 @@ =head2 getCollectedSimples - function : get the Simple articles collected in a moby:Collection block - usage : @Simples = getCollectedSimples($XML) - args : raw XML or XML::LibXML of a moby:Collection block - returns : a list of XML::LibXML nodes, each of which is a moby:Simple block +B get the Simple articles collected in a moby:Collection block + +B C<@Simples = getCollectedSimples($XML)> + +B raw XML or XML::LibXML of a moby:Collection block + +B a list of XML::LibXML nodes, each of which is a moby:Simple block =cut @@ -974,31 +779,36 @@ my ( $moby ) = @_; $moby = _string_to_DOM($moby); return undef unless $moby->nodeType == ELEMENT_NODE; - return undef unless ( $moby->nodeName =~ /Collection$/ ); + return undef unless ( $moby->nodeName =~ /^(moby\:|)Collection$/ ); my @articles; foreach my $child ( $moby->childNodes ) { # there may be more than one Simple/Collection per input; iterate over them next unless $child->nodeType == ELEMENT_NODE; # ignore whitespace - next unless ( $child->nodeName =~ /Simple$/ ); + next unless ( $child->nodeName =~ /^(moby\:|)Simple$/ ); push @articles, $child; # take the child elements, which are or } - return ( @articles ); # return them. + return @articles; # return them. } =head2 getInputArticles - function : get the Simple/Collection articles for each input query, in order - usage : @queries = getInputArticles($XML) - args : the raw XML of a moby:MOBY query - returns : a list of listrefs, each listref is the input to a single query. - Remember that the input to a single query may be one or more Simple - and/or Collection articles. These are provided as XML::LibXML nodes. - + +B get the Simple/Collection articles for each input query, in order + +B C<@queries = getInputArticles($XML)> + +B the raw XML of a moby:MOBY query + +B a list of listrefs, each listref is the input to a single +query. Remember that the input to a single query may be one or more +Simple and/or Collection articles. These are provided as XML::LibXML +nodes. + i.e.: @queries = ([$SIMPLE_DOM_NODE], [$SIMPLE_DOM_NODE2]) or : @queries = ([$COLLECTION_DOM_NODE], [$COLLECTION_DOM_NODE2]) - + The former is generated from the following XML: - + ... @@ -1016,7 +826,6 @@ =cut -#Eddie - converted sub getInputArticles { my ( $moby ) = @_; $moby = _string_to_DOM($moby); @@ -1039,71 +848,17 @@ return @queries; # return them in the order that they were discovered. } -=head2 isSimpleArticle - - function : tests XML (text) or an XML DOM node to see if it represents a Simple article - usage : if (isSimpleArticle($node)){do something to it} - input : an XML::LibXML node, an XML::LibXML::Document or straight XML - returns : boolean - -=cut - -#Eddie - converted -sub isSimpleArticle { - my ( $DOM ) = @_; - eval { $DOM = _string_to_DOM($DOM) }; - if ($@) { - return 0; - } - $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); - return ($DOM->nodeName =~ /^(moby:|)Simple$/) ? 1 : 0; #Optional 'moby:' namespace prefix -} - -=head2 isCollectionArticle - - function : tests XML (text) or an XML DOM node to see if it represents a Collection article - usage : if (isCollectionArticle($node)){do something to it} - input : an XML::LibXML node, an XML::LibXML::Document or straight XML - returns : boolean - -=cut - -#Eddie - converted -sub isCollectionArticle { - my ( $DOM ) = @_; - eval {$DOM = _string_to_DOM($DOM) }; - return 0 if $@; - $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); - return ( $DOM->nodeName =~ /^(moby\:|)Collection$/ ) ? 1 : 0; #Optional 'moby:' prefix -} - -=head2 isSecondaryArticle - - function : tests XML (text) or an XML DOM node to see if it represents a Secondary article - usage : if (isSecondaryArticle($node)){do something to it} - input : an XML::LibXML node, an XML::LibXML::Document or straight XML - returns : boolean - -=cut +=head2 extractRawContent -#Eddie - converted -sub isSecondaryArticle { - my ( $XML ) = @_; - my $DOM; - eval {$DOM = _string_to_DOM($XML)} ; - return 0 if $@; - $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); - return ($DOM->nodeName =~ /^(moby\:|)Parameter$/) ? 1 : 0; #Optional 'moby:' prefix -} +B pass me an article (Simple, or Collection) and I'll give +you the content AS A STRING - i.e. the raw XML of the contained MOBY +Object(s) +B C -=head2 extractRawContent +B the one element of the output from getArticles - function : pass me an article (Simple, or Collection) and I'll give you the - content AS A STRING - i.e. the raw XML of the contained MOBY Object(s) - usage : extractRawContent($simple) - input : the one element of the output from getArticles - returns : string +B string =cut @@ -1114,37 +869,36 @@ foreach ( $article->childNodes ) { $response .= $_->toString; } - print STDERR "RESPONSE = $response\n"; +# print STDERR "RESPONSE = $response\n"; return $response; } =head2 getNodeContentWithArticle - function : a very flexible way to get the stringified content of a node - that has the correct element and article name - or get the value of a Parameter element. - usage : @strings = getNodeContentWithArticle($node, $tagname, $articleName) - args : (in order) - $node - an XML::LibXML node, or straight XML. It may even - be the entire mobyData block. - $tagname - the tagname (effectively from the Object type ontology), - or "Parameter" if you are trying to get secondaries - $articleName - the articleName that we are searching for. - to get the content of the primary object, leave - this field blank! - - returns : an ARRAY of the stringified text content for each - node that matched the tagname/articleName specified; one - array element for each matching node. Newlines are NOT considered - new nodes (as they are in normal XML). - - notes : This was written for the purpose of getting the values of - String, Integer, Float, Date_Time, and other such primitives. +B a very flexible way to get the stringified content of a +node that has the correct element and article name or get the value of +a Parameter element. + +B C<@strings = getNodeContentWithArticle($node, $tagname, $articleName)> + +B (in order) + +C<$node> - an XML::LibXML node, or straight XML. It may even be the entire mobyData block. +C<$tagname> - the tagname (effectively from the Object type ontology), or "Parameter" if you are trying to get secondaries +C<$articleName> - the articleName that we are searching for. to get the content of the primary object, leave this field blank! + + +B an ARRAY of the stringified text content for each +node that matched the tagname/articleName specified; one +array element for each matching node. Newlines are NOT considered +new nodes (as they are in normal XML). + +B This was written for the purpose of getting the values of +String, Integer, Float, Date_Time, and other such primitives. For example, in the following XML: ... - ... @@ -1156,8 +910,7 @@ ... - ... - + would be analysed as follows: # get $input - e.g. from genericServiceInputParser or complexServiceInputParser @@ -1166,7 +919,6 @@ For Parameters, such as the following ... - ... @@ -1181,7 +933,6 @@ ... - ... You would parse it as follows: @@ -1208,7 +959,6 @@ =cut -#Eddie - converted sub getNodeContentWithArticle { # give me a DOM, a TagName, an articleName and I will return you the content # of that node **as a string** (beware if there are additional XML tags in there!) @@ -1241,13 +991,8 @@ # if there is an articleName, then get that specific node for ( 1 .. $nodes->size() ) { my $child = $nodes->get_node( $_ ); - if ( - ( $child->getAttribute("articleName") - && ( $child->getAttribute("articleName") eq $articleName ) - ) - || ( $child->getAttribute("moby:articleName") - && ( $child->getAttribute("moby:articleName") eq $articleName ) - ) + if ( _moby_getAttribute($child, "articleName") + && ( $child->getAttribute("articleName") eq $articleName ) ) { # now we have a valid child, get the content... stringified... regardless of what it is @@ -1280,62 +1025,21 @@ return @contents; } -=head2 validateNamespaces - - function : checks the namespace ontology for the namespace lsid - usage : @LSIDs = validateNamespaces(@namespaces) - args : ordered list of either human-readable or lsid presumptive namespaces - returns : ordered list of the LSID's corresponding to those - presumptive namespaces; undef for each namespace that was invalid - - -=cut - -sub validateNamespaces { - # give me a list of namespaces and I will return the LSID's in order - # I return undef in that list position if the namespace is invalid - my ( @namespaces ) = @_; - my $OS = MOBY::Client::OntologyServer->new; - my @lsids; - foreach ( @namespaces ) { - my ( $s, $m, $LSID ) = $OS->namespaceExists( term => $_ ); - push @lsids, $s ? $LSID : undef; - } - return @lsids; -} - -=head2 validateThisNamespace +*getResponseArticles = \&extractResponseArticles; +*getResponseArticles = \&extractResponseArticles; - function : checks a given namespace against a list of valid namespaces - usage : $valid = validateThisNamespace($ns, @validNS); - args : ordered list of the namespace of interest and the list of valid NS's - returns : boolean +=head2 getResponseArticles (a.k.a. extractResponseArticles) -=cut +B get the DOM nodes corresponding to individual Simple or Collection outputs from a MOBY Response -sub validateThisNamespace { - my ( $ns, @namespaces ) = @_; - return 1 unless scalar @namespaces; # if you don't give me a list, I assume everything is valid... - @namespaces = @{$namespaces[0]} # if you send me an arrayref I should be kind... DWIM! - if ( ref $namespaces[0] eq 'ARRAY' ); - return grep /$ns/, @namespaces; -} +B C<($collections, $simples) = getResponseArticles($node)> -=head2 getResponseArticles (a.k.a. extractResponseArticles) +B C<$node> - either raw XML or an XML::LibXML::Document to be searched - function : get the DOM nodes corresponding to individual - Simple or Collection outputs from a MOBY Response - usage : ($collections, $simples) = getResponseArticles($node) - args : $node - either raw XML or an XML::LibXML::Document to be searched - returns : an array-ref of Collection article XML::LibXML::Node's - an array-ref of Simple article XML::LibXML::Node's +B an array-ref of Collection article XML::LibXML::Node's or an array-ref of Simple article XML::LibXML::Node's =cut -*getResponseArticles = \&extractResponseArticles; -*getResponseArticles = \&extractResponseArticles; - -#Eddie - converted sub extractResponseArticles { my ( $result ) = @_; return ( [], [] ) unless $result; @@ -1351,8 +1055,8 @@ my @collections; my @Xrefs; my $success = 0; - foreach my $which ( 'moby:queryResponse', 'queryResponse', 'mobyData', - 'moby:mobyData' ) + foreach my $which ( 'moby:queryResponse', 'queryResponse', + 'mobyData', 'moby:mobyData' ) { my $responses = $moby->getElementsByTagName( $which ); next unless $responses; @@ -1360,23 +1064,19 @@ my $resp = $responses->get_node( $n ); foreach my $response_component ( $resp->childNodes ) { next unless $response_component->nodeType == ELEMENT_NODE; - if ( ( $response_component->nodeName eq "Simple" ) - || ( $response_component->nodeName eq "moby:Simple" ) ) - { + if ( $response_component->nodeName =~ /^(moby:|)Simple$/ ) + { foreach my $Object ( $response_component->childNodes ) { next unless $Object->nodeType == ELEMENT_NODE; $success = 1; push @objects, $Object; } - } elsif ( ( $response_component->nodeName eq "Collection" ) - || ( $response_component->nodeName eq "moby:Collection" ) ) + } elsif ( $response_component->nodeName =~ /^(moby:|)Collection$/ ) { my @objects; foreach my $simple ( $response_component->childNodes ) { next unless $simple->nodeType == ELEMENT_NODE; - next - unless ( ( $simple->nodeName eq "Simple" ) - || ( $simple->nodeName eq "moby:Simple" ) ); + next unless ( $simple->nodeName =~ /^(moby:|)Simple$/ ); foreach my $Object ( $simple->childNodes ) { next unless $Object->nodeType == ELEMENT_NODE; $success = 1; @@ -1392,16 +1092,125 @@ return ( \@collections, \@objects ); } + + +=head1 IDENTITY AND VALIDATION + +This section describes functionality associated with identifying parts of a message, +and checking that it is valid. + +=head2 isSimpleArticle, isCollectionArticle, isSecondaryArticle + +B tests XML (text) or an XML DOM node to see if it represents a Simple, Collection, or Secondary article + +B + + if (isSimpleArticle($node)){do something to it} + +or + + if (isCollectionArticle($node)){do something to it} + +or + + if (isSecondaryArticle($node)){do something to it} + +B< input :> an XML::LibXML node, an XML::LibXML::Document or straight XML + +B boolean + +=cut + +sub isSimpleArticle { + my ( $DOM ) = @_; + eval { $DOM = _string_to_DOM($DOM) }; + return 0 if $@; + $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); + return ($DOM->nodeName =~ /^(moby:|)Simple$/) ? 1 : 0; #Optional 'moby:' namespace prefix +} + +sub isCollectionArticle { + my ( $DOM ) = @_; + eval {$DOM = _string_to_DOM($DOM) }; + return 0 if $@; + $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); + return ( $DOM->nodeName =~ /^(moby\:|)Collection$/ ) ? 1 : 0; #Optional 'moby:' prefix +} + +sub isSecondaryArticle { + my ( $XML ) = @_; + my $DOM; + eval {$DOM = _string_to_DOM($XML)} ; + return 0 if $@; + $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); + return ($DOM->nodeName =~ /^(moby\:|)Parameter$/) ? 1 : 0; #Optional 'moby:' prefix +} + + +=head2 validateNamespaces + +B checks the namespace ontology for the namespace lsid + +B C<@LSIDs = validateNamespaces(@namespaces)> + +B ordered list of either human-readable or lsid presumptive namespaces + +B ordered list of the LSID's corresponding to those +presumptive namespaces; undef for each namespace that was invalid + +=cut + +sub validateNamespaces { + # give me a list of namespaces and I will return the LSID's in order + # I return undef in that list position if the namespace is invalid + my ( @namespaces ) = @_; + my $OS = MOBY::Client::OntologyServer->new; + my @lsids; + foreach ( @namespaces ) { + my ( $s, $m, $LSID ) = $OS->namespaceExists( term => $_ ); + push @lsids, $s ? $LSID : undef; + } + return @lsids; +} + +=head2 validateThisNamespace + +B checks a given namespace against a list of valid namespaces + +B C<$valid = validateThisNamespace($ns, @validNS);> + +B ordered list of the namespace of interest and the list of valid NS's + +B boolean + +=cut + +sub validateThisNamespace { + my ( $ns, @namespaces ) = @_; + return 1 unless scalar @namespaces; # if you don't give me a list, I assume everything is valid... + @namespaces = @{$namespaces[0]} # if you send me an arrayref I should be kind... DWIM! + if ( ref $namespaces[0] eq 'ARRAY' ); + return grep /$ns/, @namespaces; +} + + +=head1 ANCILIARY ELEMENTS + +This section contains subroutines that handle processing of optional message elements containing +meta-data. Examples are the ServiceNotes, and CrossReference blocks. + =head2 getServiceNotes - function : to get the content of the Service Notes block of the MOBY message - usage : getServiceNotes($message) - args : $message is either the XML::LibXML of the MOBY message, or plain XML - returns : String content of the ServiceNotes block of the MOBY Message +B to get the content of the Service Notes block of the MOBY message + +B C + +B C<$message> is either the XML::LibXML of the MOBY message, or plain XML + +B String content of the ServiceNotes block of the MOBY Message =cut -#Eddie - converted sub getServiceNotes { my ( $result ) = @_; return ( "" ) unless $result; @@ -1425,13 +1234,17 @@ =head2 getCrossReferences - function : to get the cross-references for a Simple article - usage : @xrefs = getCrossReferences($XML) - args : $XML is either a SIMPLE article (...) - or an object (the payload of a Simple article), and - may be either raw XML or an XML::LibXML node. - returns : an array of MOBY::CrossReference objects - example : +B to get the cross-references for a Simple article + +B C<@xrefs = getCrossReferences($XML)> + +B C<$XML> is either a SIMPLE article (...) or an +object (the payload of a Simple article), and may be either raw XML or +an XML::LibXML node. + +B an array of MOBY::CrossReference objects + +B my (($colls, $simps) = getResponseArticles($query); # returns DOM nodes foreach (@{$simps}){ @@ -1448,14 +1261,13 @@ =cut -#Eddie - converted sub getCrossReferences { my ( $XML ) = @_; $XML = _string_to_DOM($XML); my @xrefs; my @XREFS; - return () if ( $XML->nodeName =~ /Collection/ ); - if ( $XML->nodeName =~ /Simple/ ) { + return () if ( $XML->nodeName =~ /^(moby:|)Collection$/ ); + if ( $XML->nodeName =~ /^(moby:|)Simple$/ ) { foreach my $child ( $XML->childNodes ) { next unless $child->nodeType == ELEMENT_NODE; $XML = $child; @@ -1464,54 +1276,352 @@ } foreach ( $XML->childNodes ) { next unless (($_->nodeType == ELEMENT_NODE) - || ($_->nodeName =~ /CrossReference/) ); + || ($_->nodeName =~ /^(moby:|)CrossReference$/) ); foreach my $xref ( $_->childNodes ) { next unless ( ($xref->nodeType == ELEMENT_NODE) - || ($xref->nodeName =~ /Xref|Object/) ); + || ($xref->nodeName =~ /^(moby:|)(Xref|Object)$/) ); push @xrefs, $xref; } } foreach ( @xrefs ) { my $x; - if ($_->nodeName =~ /Xref/) { $x = &_makeXrefType( $_ ) } - elsif ($_->nodeName =~ /Object/) { $x = &_makeObjectType( $_ ) } + if ($_->nodeName =~ /^(moby:|)Xref$/) { $x = _makeXrefType( $_ ) } + elsif ($_->nodeName =~ /^(moby:|)Object$/) { $x = _makeObjectType( $_ ) } push @XREFS, $x if $x; } return @XREFS; } + +=head1 CONSTRUCTING OUTPUT + +This section describes how to construct output, in response to an +incoming message. Responses come in three varieties: 'Simple', 'Collection', and +'Complex' (Collections and Simples together). + +=head2 simpleResponse + +B wraps a simple article in the appropriate (mobyData) structure + +B + + $resp .= simpleResponse($object, 'MyArticleName', $queryID); + +B (in order) +C<$object> - (optional) a MOBY Object as raw XML +C<$article> - (optional) an articeName for this article +C<$query> - (optional, but strongly recommended) the queryID value for the mobyData block to which you are responding + +B As required by the API you must return a response for every +input. If one of the inputs was invalid, you return a valid (empty) +MOBY response by calling simpleResponse(undef, undef, $queryID) with +no arguments. + +=cut + +sub simpleResponse { + my ( $data, $articleName, $qID ) = @_; # articleName optional + $qID = _getQueryID( $qID ) + if ref( $qID ) =~ /XML\:\:LibXML/; # in case they send the DOM instead of the ID + $data ||= ''; # initialize to avoid uninit value errors + $articleName ||= ""; + $qID ||= ""; + if ( $articleName || $data) { # Linebreaks in XML make it easier for human debuggers to read! + return " + + $data + + "; + } else { + return " + + "; + } +} + + +=head2 collectionResponse + +B wraps a set of articles in the appropriate mobyData structure + +B + + return responseHeader . collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter; + +B (in order) +C<\@objects> - (optional) a listref of MOBY Objects as raw XML +C<$article> - (optional) an articeName for this article +C<$queryID> - (optional, but strongly recommended) the mobyData ID to which you are responding + +B as required by the API you must return a response for every +input. If one of the inputs was invalid, you return a valid (empty) +MOBY response by calling collectionResponse(undef, undef, $queryID). + +=cut + +sub collectionResponse { + my ( $data, $articleName, $qID ) = @_; # articleName optional + my $content = ""; + $data ||= []; + $qID ||= ''; + # The response should only be completely empty when the input $data is completely empty. + # Testing just the first element is incorrect. + my $not_completely_empty = 0; + foreach (@{$data}) { $not_completely_empty += defined $_ } + unless ( ( ref($data) eq 'ARRAY' ) && $not_completely_empty ) + { # we're expecting an arrayref as input data, and it must not be empty + return ""; + } + foreach ( @{$data} ) { # Newlines are for ease of human reading (pretty-printing). + # It's really hard to keep this kind of thing in sync with itself, but for what it's worth, let's leave it in. + if ( $_ ) { + $content .= "$_\n"; + } else { + $content .= "\n"; + } + } + if ( $articleName ) { + return " + + + $content + + + "; + } else { + return " + + $content + + "; + } +} + +=head2 complexResponse + +B wraps articles in the appropriate (mobyData) structure + +B $resp .= complexResponse(\@data, $qID); + +B (in order) + +C<\@data> - (optional) a listref of arrays. each element of @data is +itself a listref of [$articleName, $XML] + +C<$qID> - (optional, but strongly recommended) the queryID value for +the mobyData block to which you are responding + +B as required by the API you must return a response for every +input. If one of the inputs was invalid, you return a valid (empty) +MOBY response by calling complexResponse(undef, $queryID) with no +arguments. + +=cut + +sub complexResponse { + my ( $data, $qID ) = @_; + #return 'ERROR: expected listref [element1, element2, ...] for data' unless ( ref( $data ) =~ /array/i ); + return "\n" + unless ( ref( $data ) eq 'ARRAY' ); + $qID = _getQueryID( $qID ) + if ref( $qID ) =~ /XML\:\:LibXML/; # in case they send the DOM instead of the ID + my @inputs = @{$data}; + my $output = ""; + foreach ( @inputs ) { + #return 'ERROR: expected listref [articleName, XML] for data element' unless ( ref( $_ ) =~ /array/i ); + return "\n" + unless ( ref($_) eq 'ARRAY' ); + while ( my ( $articleName, $XML ) = splice( @{$_}, 0, 2 ) ) { + if ( ref($XML) ne 'ARRAY' ) { + $articleName ||= ""; + $XML ||= ""; + if ( $XML =~ /\<(moby:|)Value\>/ ) + { + $output .= + "$XML\n"; + } else { + $output .= + "\n$XML\n\n"; + } + + # need to do this for collections also!!!!!! + } else { + my @objs = @{$XML}; + $output .= "\n"; + foreach ( @objs ) { + $output .= "$_\n"; + } + $output .= "\n"; + } + } + } + $output .= "\n"; + return $output; +} + +=head2 responseHeader + +B print the XML string of a MOBY response header +/- serviceNotes + +B + + responseHeader('illuminae.com') + + responseHeader( + -authority => 'illuminae.com', + -note => 'here is some data from the service provider') + +B a string representing the service providers authority URI, OR +a set of named arguments with the authority and the service provision +notes. + +B< caveat :> + +B returns everything required up to the response articles themselves. i.e. something like: + + + + + +=cut + +sub responseHeader { + use HTML::Entities (); + my ( $auth, $notes ) = _rearrange( [qw[AUTHORITY NOTE]], @_ ); + $auth ||= "not_provided"; + $notes ||= ""; + my $xml = + "" + . "" + . ""; + if ( $notes ) { + my $encodednotes = HTML::Entities::encode( $notes ); + $xml .= "$encodednotes"; + } + return $xml; +} + +=head2 responseFooter + +B print the XML string of a MOBY response footer + +B + + return responseHeader('illuminae.com') . $DATA . responseFooter; + +B returns everything required after the response articles themselves i.e. something like: + + + + +=cut + +sub responseFooter { + return ""; +} + + + +=head1 MISCELLANEOUS + +This section contains routines that didn't quite seem to fit anywhere else. + +=cut + +=head2 _moby_getAttributeNode, _moby_getAttribute + +B Perform the same task as the DOM routine +getAttribute(Node), but check for both the prefixed and un-prefixed +attribute name (the prefix in question being, of course, +"moby:"). + +B + + $id = _moby_getAttribute($xml_libxml, "id"); + +where C is an attribute in the XML block given as C<$xml_libxml> + +B This function is intended for use internal to this package +only. It's not exported. + +=cut + +sub _moby_getAttributeNode { + # Mimics behavior of XML::LibXML method getAttributeNode, but if the unqualified attribute cannot be found, + # we qualify it with "moby:" and try again. + # We do this so often this module, it's worth having a separate subroutine to do this. + my ($xref, $attr) = @_; + my ($package, $filename, $line) = caller; + if ( !(ref($xref) =~ "^XML\:\:LibXML") ) { + warn "_moby_getAttributeNode: Looking for attribute '$attr'" + . "Can't parse non-XML argument '$xref',\n" + . " called from line $line"; + return ''; + } + if (!defined $attr) { + warn "_moby_getAttributeNode: Non-empty attribute is required" + . "\n called from line $line"; + return ''; + } + return ( $xref->getAttributeNode($attr) || $xref->getAttributeNode( "moby:$attr" ) ); +} + +sub _moby_getAttribute { + # Mimics behavior of XML::LibXML method getAttribute, but if the unqualified attribute cannot be found, + # we qualify it with "moby:" and try again. + # We do this so often this module, it's worth having a separate subroutine to do this. + my ($xref, $attr) = @_; + my ($package, $filename, $line) = caller; + if ( !(ref($xref) =~ "^XML\:\:LibXML")) { + warn "_moby_getAttribute: Looking for attribute '$attr', " + ."can't parse non-XML argument '$xref'\n" + . "_moby_getAttribute called from line $line"; + return ''; + } + if (!defined $attr) { + warn "_moby_getAttribute: Non-empty attribute is required" + . "\n called from line $line"; + return ''; + } + return ( $xref->getAttribute($attr) || $xref->getAttribute("moby:$attr") ); +} + =head2 whichDeepestParentObject - function : select the parent node from nodeList that is - closest to the querynode - usage : ($term, $lsid) = whichDeepestParentObject($CENTRAL, $queryTerm, \@termList) - args : $CENTRAL - your MOBY::Client::Central object - $queryTerm - the object type I am interested in - \@termlist - the list of object types that I know about - returns : an ontology term and LSID as a scalar, or undef if there - is no parent of this node in the nodelist. - (note that it will only return the term if you give it - term names in the @termList. If you give it - LSID's in the termList, then both the parameters - returned will be LSID's - it doesn't back-translate...) +B select the parent node from nodeList that is closest to the querynode + +B + + ($term, $lsid) = whichDeepestParentObject($CENTRAL, $queryTerm, \@termList) + +B + +C<$CENTRAL> - your MOBY::Client::Central object + +C<$queryTerm> - the object type I am interested in + +C<\@termlist> - the list of object types that I know about + +B an ontology term and LSID as a scalar, or undef if there is +no parent of this node in the nodelist. note that it will only return +the term if you give it term names in the @termList. If you give it +LSID's in the termList, then both the parameters returned will be +LSID's - it doesn't back-translate...) =cut sub whichDeepestParentObject { my ( $CENTRAL, $queryTerm, $termlist ) = @_; return ( undef, undef ) - unless ( $CENTRAL - && $queryTerm - && $termlist - && ( ref( $termlist ) =~ /ARRAY/ ) ); + unless ( $CENTRAL && $queryTerm + && $termlist && ( ref( $termlist ) eq 'ARRAY' ) ); my %nodeLSIDs; my $queryLSID = $CENTRAL->ObjLSID( $queryTerm ); foreach ( @$termlist ) { # get list of known LSIDs - my $lsid = $CENTRAL->ObjLSID( $_ ); - return ( $_, $lsid ) - if ( $lsid eq $queryLSID ) - ; # of course, if we find it in the list, then return it right away! - $nodeLSIDs{$lsid} = $_; + my $lsid = $CENTRAL->ObjLSID( $_ ); + return ( $_, $lsid ) + if ( $lsid eq $queryLSID ); # of course, if we find it in the list, then return it right away! + $nodeLSIDs{$lsid} = $_; } return ( undef, undef ) unless keys( %nodeLSIDs ); my $isa = @@ -1528,26 +1638,20 @@ return ( undef, undef ); } -#Eddie - converted + sub _makeXrefType { my ( $xref ) = @_; - my $ns = $xref->getAttributeNode( 'namespace' ) - || $xref->getAttributeNode( 'moby:namespace' ); + my $ns = _moby_getAttributeNode($xref, 'namespace' ); return undef unless $ns; - my $id = $xref->getAttributeNode( 'id' ) - || $xref->getAttributeNode( 'moby:id' ); + my $id = _moby_getAttributeNode($xref, 'id' ); return undef unless $id; - my $xr = $xref->getAttributeNode( 'xref_type' ) - || $xref->getAttributeNode( 'moby:xref_type' ); + my $xr = _moby_getAttributeNode($xref, 'xref_type' ); return undef unless $xr; - my $ec = $xref->getAttributeNode( 'evidence_code' ) - || $xref->getAttributeNode( 'moby:evidence_code' ); + my $ec = _moby_getAttributeNode($xref, 'evidence_code' ); return undef unless $ec; - my $au = $xref->getAttributeNode( 'authURI' ) - || $xref->getAttributeNode( 'moby:authURI' ); + my $au = _moby_getAttributeNode($xref, 'authURI' ); return undef unless $au; - my $sn = $xref->getAttributeNode( 'serviceName' ) - || $xref->getAttributeNode( 'moby:serviceName' ); + my $sn = _moby_getAttributeNode($xref, 'serviceName' ); return undef unless $sn; my $XREF = MOBY::CrossReference->new( type => "xref", @@ -1561,14 +1665,12 @@ return $XREF; } -#Eddie - converted + sub _makeObjectType { my ( $xref ) = @_; - my $ns = $xref->getAttributeNode( 'namespace' ) - || $xref->getAttributeNode( 'moby:namespace' ); + my $ns = _moby_getAttributeNode($xref, 'namespace' ); return undef unless $ns; - my $id = $xref->getAttributeNode( 'id' ) - || $xref->getAttributeNode( 'moby:id' ); + my $id = _moby_getAttributeNode($xref, 'id'); return undef unless $id; my $XREF = MOBY::CrossReference->new( type => "object", @@ -1577,76 +1679,72 @@ ); } -# _rearrange stolen from BioPerl's Bio::RootI.pm -# because it is just so useful! - =head2 _rearrange (stolen from BioPerl ;-) ) - Usage : $object->_rearrange( array_ref, list_of_arguments) - Purpose : Rearranges named parameters to requested order. - Example : $self->_rearrange([qw(SEQUENCE ID DESC)], at param); - : Where @param = (-sequence => $s, - : -desc => $d, - : -id => $i); - Returns : @params - an array of parameters in the requested order. - : The above example would return ($s, $i, $d). - : Unspecified parameters will return undef. For example, if - : @param = (-sequence => $s); - : the above _rearrange call would return ($s, undef, undef) - Argument : $order : a reference to an array which describes the desired - : order of the named parameters. - : @param : an array of parameters, either as a list (in - : which case the function simply returns the list), - : or as an associative array with hyphenated tags - : (in which case the function sorts the values - : according to @{$order} and returns that new array.) - : The tags can be upper, lower, or mixed case - : but they must start with a hyphen (at least the - : first one should be hyphenated.) - Source : This function was taken from CGI.pm, written by Dr. Lincoln - : Stein, and adapted for use in Bio::Seq by Richard Resnick and - : then adapted for use in Bio::Root::Object.pm by Steve Chervitz, - : then migrated into Bio::Root::RootI.pm by Ewan Birney. - Comments : - : Uppercase tags are the norm, - : (SAC) - : This method may not be appropriate for method calls that are - : within in an inner loop if efficiency is a concern. - : - : Parameters can be specified using any of these formats: - : @param = (-name=>'me', -color=>'blue'); - : @param = (-NAME=>'me', -COLOR=>'blue'); - : @param = (-Name=>'me', -Color=>'blue'); - : @param = ('me', 'blue'); - : A leading hyphenated argument is used by this function to - : indicate that named parameters are being used. - : Therefore, the ('me', 'blue') list will be returned as-is. - : - : Note that Perl will confuse unquoted, hyphenated tags as - : function calls if there is a function of the same name - : in the current namespace: - : -name => 'foo' is interpreted as -&name => 'foo' - : - : For ultimate safety, put single quotes around the tag: - : ('-name'=>'me', '-color' =>'blue'); - : This can be a bit cumbersome and I find not as readable - : as using all uppercase, which is also fairly safe: - : (-NAME=>'me', -COLOR =>'blue'); - : - : Personal note (SAC): I have found all uppercase tags to - : be more managable: it involves less single-quoting, - : the key names stand out better, and there are no method naming - : conflicts. - : The drawbacks are that it's not as easy to type as lowercase, - : and lots of uppercase can be hard to read. - : - : Regardless of the style, it greatly helps to line - : the parameters up vertically for long/complex lists. +B + $object->_rearrange( array_ref, list_of_arguments) + +B Rearranges named parameters to requested order. + +B + $self->_rearrange([qw(SEQUENCE ID DESC)], at param); +Where C<@param = (-sequence => $s, -desc => $d, -id => $i);> + +B C<@params> - an array of parameters in the requested order. + +The above example would return ($s, $i, $d). +Unspecified parameters will return undef. For example, if + C<@param = (-sequence => $s);> +the above _rearrange call would return ($s, undef, undef) + +B C<$order> : a reference to an array which describes the desired order of the named parameters. + +C<@param :> an array of parameters, either as a list (in which case the function +simply returns the list), or as an associative array with hyphenated +tags (in which case the function sorts the values according to +@{$order} and returns that new array.) The tags can be upper, lower, +or mixed case but they must start with a hyphen (at least the first +one should be hyphenated.) + +B< Source:> This function was taken from CGI.pm, written by +Dr. Lincoln Stein, and adapted for use in Bio::Seq by Richard Resnick +and then adapted for use in Bio::Root::Object.pm by Steve Chervitz, +then migrated into Bio::Root::RootI.pm by Ewan Birney. + +B +Uppercase tags are the norm, (SAC) This method may not be appropriate +for method calls that are within in an inner loop if efficiency is a +concern. + +Parameters can be specified using any of these formats: + @param = (-name=>'me', -color=>'blue'); + @param = (-NAME=>'me', -COLOR=>'blue'); + @param = (-Name=>'me', -Color=>'blue'); + @param = ('me', 'blue'); + +A leading hyphenated argument is used by this function to indicate +that named parameters are being used. Therefore, the ('me', 'blue') +list will be returned as-is. + +Note that Perl will confuse unquoted, hyphenated tags as function +calls if there is a function of the same name in the current +namespace: C<-name => 'foo'> is interpreted as C<-&name => 'foo'> + +For ultimate safety, put single quotes around the tag: C<('-name'=>'me', '-color' =>'blue');> + +This can be a bit cumbersome and I find not as readable as using all +uppercase, which is also fairly safe:C<(-NAME=>'me', -COLOR =>'blue');> + +Personal note (SAC): I have found all uppercase tags to be more +managable: it involves less single-quoting, the key names stand out +better, and there are no method naming conflicts. The drawbacks are +that it's not as easy to type as lowercase, and lots of uppercase can +be hard to read. Regardless of the style, it greatly helps to line the parameters up +vertically for long/complex lists. =cut sub _rearrange { - # my $dummy = shift; my $order = shift; return @_ unless ( substr( $_[0] || '', 0, 1 ) eq '-' ); @@ -1659,3 +1757,11 @@ map { $_ = uc( $_ ) } @$order; # for bug #1343, but is there perf hit here? return @param{@$order}; } + +sub _getQueryID { + my ( $query ) = @_; + $query = _string_to_XML($query); + return '' unless ( $query->nodeName =~ /^(moby:|)(queryInput|mobyData)$/ ); #Eddie - unsure + return _moby_getAttribute($query, 'queryID' ); +} + From gss at pub.open-bio.org Wed Sep 21 17:54:20 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 21 Sep 2005 17:54:20 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212154.j8LLsKgf012809@pub.open-bio.org> gss Wed Sep 21 17:54:20 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api In directory pub.open-bio.org:/tmp/cvs-serv12775 Removed Files: allclasses-frame.html allclasses-noframe.html constant-values.html deprecated-list.html help-doc.html index.html overview-frame.html overview-summary.html overview-tree.html package-list packages.html serialized-form.html stylesheet.css Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api allclasses-frame.html,1.2,NONE allclasses-noframe.html,1.2,NONE constant-values.html,1.2,NONE deprecated-list.html,1.2,NONE help-doc.html,1.2,NONE index.html,1.2,NONE overview-frame.html,1.2,NONE overview-summary.html,1.2,NONE overview-tree.html,1.2,NONE package-list,1.2,NONE packages.html,1.2,NONE serialized-form.html,1.2,NONE stylesheet.css,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/allclasses-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/allclasses-noframe.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/constant-values.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/deprecated-list.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/help-doc.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/index.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/overview-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/overview-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/overview-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/package-list,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/packages.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/serialized-form.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/stylesheet.css,v: No such file or directory From gss at pub.open-bio.org Wed Sep 21 18:17:41 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 21 Sep 2005 18:17:41 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212217.j8LMHfX7012905@pub.open-bio.org> gss Wed Sep 21 18:17:41 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer In directory pub.open-bio.org:/tmp/cvs-serv12884/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer Added Files: .cvsignore Log Message: Don't keep javadoc under CVS control moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer .cvsignore,NONE,1.1 From gss at pub.open-bio.org Wed Sep 21 18:40:31 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 21 Sep 2005 18:40:31 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212240.j8LMeVhB012972@pub.open-bio.org> gss Wed Sep 21 18:40:31 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv12947/S-MOBY/ref-impl/semanticmoby.org/WebRoot Modified Files: index.html Log Message: Changed to reference new location of API docs moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot index.html,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/index.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/index.html 2005/03/21 21:42:01 1.6 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/index.html 2005/09/21 22:40:31 1.7 @@ -42,7 +42,7 @@ About Semantic MOBY   Help on Searching
        - + Developers: see the JavaDoc for the Semantic MOBY API!

        From gss at pub.open-bio.org Wed Sep 21 18:56:37 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 21 Sep 2005 18:56:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212256.j8LMubU8013026@pub.open-bio.org> gss Wed Sep 21 18:56:37 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/lib In directory pub.open-bio.org:/tmp/cvs-serv13002/lib Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/lib added to the repository moby-live/S-MOBY/ref-impl/lib - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/lib/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/lib/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/lib/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Wed Sep 21 19:01:52 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 21 Sep 2005 19:01:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212301.j8LN1qAd013126@pub.open-bio.org> gss Wed Sep 21 19:01:52 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/lib In directory pub.open-bio.org:/tmp/cvs-serv13105 Added Files: .cvsignore README.txt antlr-2.7.5.jar antlr.jar commons-codec-1.3.jar commons-httpclient-3.0-rc3.jar commons-logging.jar concurrent.jar icu4j.jar jakarta-oro-2.0.8.jar jena.jar log4j-1.2.12.jar servlet-api.jar xercesImpl.jar xml-apis.jar Log Message: Initial jar files needed to build core and semanticmoby.org moby-live/S-MOBY/ref-impl/lib .cvsignore,NONE,1.1 README.txt,NONE,1.1 antlr-2.7.5.jar,NONE,1.1 antlr.jar,NONE,1.1 commons-codec-1.3.jar,NONE,1.1 commons-httpclient-3.0-rc3.jar,NONE,1.1 commons-logging.jar,NONE,1.1 concurrent.jar,NONE,1.1 icu4j.jar,NONE,1.1 jakarta-oro-2.0.8.jar,NONE,1.1 jena.jar,NONE,1.1 log4j-1.2.12.jar,NONE,1.1 servlet-api.jar,NONE,1.1 xercesImpl.jar,NONE,1.1 xml-apis.jar,NONE,1.1 From gss at pub.open-bio.org Wed Sep 21 19:07:16 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 21 Sep 2005 19:07:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212307.j8LN7GYS013162@pub.open-bio.org> gss Wed Sep 21 19:07:16 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build In directory pub.open-bio.org:/tmp/cvs-serv13137 Modified Files: .cvsignore Log Message: Ignore the war file; built it each time it's needed moby-live/S-MOBY/ref-impl/semanticmoby.org/build .cvsignore,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/.cvsignore 2005/03/21 21:40:00 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/.cvsignore 2005/09/21 23:07:16 1.2 @@ -1,2 +1,2 @@ -classes semanticmoby.org.war +javadoc From gss at pub.open-bio.org Wed Sep 21 19:08:04 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 21 Sep 2005 19:08:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212308.j8LN84r5013195@pub.open-bio.org> gss Wed Sep 21 19:08:04 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build In directory pub.open-bio.org:/tmp/cvs-serv13170 Modified Files: build.xml Log Message: Build standalone instead of being invoked from ../../build.xml moby-live/S-MOBY/ref-impl/semanticmoby.org/build build.xml,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/03/21 21:40:00 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/09/21 23:08:04 1.2 @@ -5,9 +5,6 @@ - - - @@ -20,36 +17,78 @@ - - - + + + + + + + + + - + + + + + + + + + + + + + + + + - - - - - + + + + + + - - + + + + + + + + + + + + + + + From senger at pub.open-bio.org Thu Sep 22 03:55:44 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 03:55:44 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509220755.j8M7tiRa014444@pub.open-bio.org> senger Thu Sep 22 03:55:44 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv14429 Added Files: cp.bat deploy deploy.bat remote.deploy.build.xml.template Log Message: moby-live/Java/src/webapps cp.bat,NONE,1.1 deploy,NONE,1.1 deploy.bat,NONE,1.1 remote.deploy.build.xml.template,NONE,1.1 From senger at pub.open-bio.org Thu Sep 22 04:54:40 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 04:54:40 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509220854.j8M8se9w015241@pub.open-bio.org> senger Thu Sep 22 04:54:40 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv15222 Modified Files: Moses.html Added Files: Moses-deploy.html Log Message: moby-live/Java/docs Moses-deploy.html,NONE,1.1 Moses.html,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/Moses.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/docs/Moses.html 2005/08/29 13:21:59 1.5 +++ /home/repository/moby/moby-live/Java/docs/Moses.html 2005/09/22 08:54:40 1.6 @@ -52,7 +52,7 @@

        -

      • Support for service deployment (not yet fully implemented) +
      • Support for service deployment

        @@ -302,21 +302,10 @@


        -

        - -Documentation in progress... (as long as I can keep my eyes open):

        - -

        - -Will be (almost) finished before the end of August 2005...

        - -

        - -


        Martin Senger
        -Last modified: Mon Aug 29 16:07:55 2005 +Last modified: Thu Sep 22 08:42:37 2005
        From senger at pub.open-bio.org Thu Sep 22 05:47:43 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 05:47:43 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509220947.j8M9lhdQ015744@pub.open-bio.org> senger Thu Sep 22 05:47:43 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv15725 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.36,1.37 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/21 04:02:15 1.36 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/22 09:47:43 1.37 @@ -95,9 +95,11 @@ + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + @@ -799,6 +784,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -897,8 +917,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +=========================================================== +File ${build.dir}/${result.file}.tar.gz +for a remote deployment was created. Copy it to the machine +where you wish the services to be deployed. Untar it, +change to the created directory, and invoke: + sh deploy (or deploy.bat on Windows) +=========================================================== + + + + + + + + + + + + + + + + +<undeployment xmlns="http://xml.apache.org/axis/wsdd/"> + <service name="${service.name}"/> +</undeployment> + + + + + + From senger at pub.open-bio.org Thu Sep 22 12:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 12:07:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG78vX017258@pub.open-bio.org> senger Thu Sep 22 12:07:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv17235/docs Modified Files: ChangeLog Moses-deploy.html Log Message: moby-live/Java/docs ChangeLog,1.42,1.43 Moses-deploy.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/21 06:03:49 1.42 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/22 16:07:08 1.43 @@ -1,3 +1,11 @@ +2005-09-23 Martin Senger + + * Add a new method getFullNamespaces() to CentralDigest interface. + + * Changed some outputs of the command-line clients. + + * Significantly improved local caching. + 2005-09-21 Martin Senger * Fixed build.xml not to produce javadoc warnings with Java 1.5 in =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/Moses-deploy.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/Moses-deploy.html 2005/09/22 08:54:40 1.1 +++ /home/repository/moby/moby-live/Java/docs/Moses-deploy.html 2005/09/22 16:07:08 1.2 @@ -52,7 +52,7 @@ times.

        - +

        Deployment properties

        The deployment is an Ant target (task) - so everything is driven by @@ -419,7 +419,7 @@
        Martin Senger
        -Last modified: Thu Sep 22 17:42:41 2005 +Last modified: Thu Sep 22 18:24:09 2005
        From senger at pub.open-bio.org Thu Sep 22 12:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 12:07:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG79j4017284@pub.open-bio.org> senger Thu Sep 22 12:07:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv17235/src/Clients Modified Files: CacheRegistryClient.java MobyDigestClient.java TestingCentral.java Log Message: moby-live/Java/src/Clients CacheRegistryClient.java,1.3,1.4 MobyDigestClient.java,1.3,1.4 TestingCentral.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/19 02:24:51 1.3 +++ /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/22 16:07:08 1.4 @@ -17,14 +17,14 @@ /** * This is a command-line client creating (and removing) a cache of a * Moby registry. It allows to store locally (in a file system) - * objects representing data types and service instances (the service - * types are ignored, at least for now).

        + * objects representing data types, service instances, namespaces, and + * service types.

        * * The client is quite simple and its basic functionality is included * also in other clients (such as {@link MobyGraphs}. The reason for * having this client separately is also to show how to use {@link * org.biomoby.client.CentralDigestCachedImpl CentralDigestCachedImpl} - * - a real caching worker.

        + * - which is a real caching worker.

        * * @author Martin Senger * @version $Id$ @@ -86,40 +86,65 @@ // // how old is the current cache? // - if (cmd.hasOption ("-age") || cmd.hasOption ("-rawage")) { + if (cmd.hasOption ("-age") || cmd.hasOption ("-rawage") || cmd.hasOption ("-agediff")) { decorationLn ("Cache age for " + worker.getRegistryEndpoint() + ":"); long age = castWorker.getCacheAge(); if (age < 0) - decoration ("(cache is empty)"); + decorationLn ("(cache is empty)"); else { if (cmd.hasOption ("-age")) - System.out.print (new Date (castWorker.getCacheAge()).toString()); - else - System.out.print (castWorker.getCacheAge()); + System.out.println (new Date (age).toString()); + if (cmd.hasOption ("-agediff")) + System.out.println (ms2Human (new Date().getTime() - age)); + if (cmd.hasOption ("-ageraw")) + System.out.println (age); } - decorationLn (""); } // // [re-]fill the cache // - if (cmd.hasOption ("-fill")) { - castWorker.removeFromCache (null); + if (cmd.hasOption ("-fill") || cmd.hasOption ("-fill-d")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_DATATYPES); decorationLn ("Retrieving data types..."); worker.getDataTypes(); + } + if (cmd.hasOption ("-fill") || cmd.hasOption ("-fill-s")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_SERVICES); decorationLn ("Retrieving services..."); worker.getServices(); } + if (cmd.hasOption ("-fill") || cmd.hasOption ("-fill-t")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_SERVICETYPES); + decorationLn ("Retrieving service types..."); + worker.getFullServiceTypes(); + } + if (cmd.hasOption ("-fill") || cmd.hasOption ("-fill-n")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_NAMESPACES); + decorationLn ("Retrieving namespaces..."); + worker.getNamespaces(); + } // // remove the cache // - if (cmd.hasOption ("-remove")) { - castWorker.removeFromCache (null); - decorationLn ("Cache removed."); + if (cmd.hasOption ("-remove") || cmd.hasOption ("-remove-d")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_DATATYPES); + decorationLn ("Cache for data types removed."); + } + if (cmd.hasOption ("-remove") || cmd.hasOption ("-remove-s")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_SERVICES); + decorationLn ("Cache for services removed."); + } + if (cmd.hasOption ("-remove") || cmd.hasOption ("-remove-t")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_SERVICETYPES); + decorationLn ("Cache for service types removed."); + } + if (cmd.hasOption ("-remove") || cmd.hasOption ("-remove-n")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_NAMESPACES); + decorationLn ("Cache for namespaces removed."); } - } catch (Exception e) { System.err.println ("===ERROR==="); e.printStackTrace(); @@ -128,6 +153,21 @@ } /************************************************************************* + * Give me an elapsed time (given in milllis) in a human readable form. + *************************************************************************/ + public static String ms2Human (long millis) { + StringBuffer buf = new StringBuffer (100); + long seconds = millis / 1000; + long minutes = seconds / 60; + long hours = minutes / 60; + long days = hours / 24; + if (days > 0) + buf.append (days + " days and "); + buf.append ((hours % 24) + ":" + (minutes % 60) + ":" + (seconds % 60) + "." + (millis % 1000)); + return new String (buf); + } + + /************************************************************************* * Print 'msg' but only if in verbose mode *************************************************************************/ static void decoration (String msg) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/09/19 08:08:32 1.3 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/09/22 16:07:08 1.4 @@ -67,15 +67,19 @@ if (cmd.hasOption ("-verbose")) worker.setDebug (true); - // read all data types and their relationships + // read (sometimes all) data types and their relationships if (cmd.hasOption ("-d")) { - MobyDataType[] dataTypes = worker.getDataTypes(); - for (int i = 0; i < dataTypes.length; i++) { - if (details) { + if (details) { + MobyDataType[] dataTypes = worker.getDataTypes(); + for (int i = 0; i < dataTypes.length; i++) { System.out.println (dataTypes[i].toString()); System.out.println ("---"); - } else { - System.out.println (dataTypes[i].getName()); + } + } else { + Map dataTypeNames = worker.getDataTypeNames(); + for (Iterator it = dataTypeNames.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + System.out.println (entry.getKey()); } } } @@ -95,13 +99,21 @@ // read all services if (cmd.hasOption ("-s")) { - MobyService[] services = worker.getServices(); - for (int i = 0; i < services.length; i++) { - if (details) { + if (details) { + MobyService[] services = worker.getServices(); + for (int i = 0; i < services.length; i++) { System.out.println (services[i].toString()); System.out.println ("---"); - } else { - System.out.println (services[i].getName()); + } + } else { + Map authorities = worker.getServiceNamesByAuthority(); + for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String authority = (String)entry.getKey(); + String[] names = (String[])entry.getValue(); + for (int i = 0; i < names.length; i++) { + System.out.println (names[i] + " (" + authority + ")"); + } } } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/09/19 08:08:32 1.6 +++ /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/09/22 16:07:08 1.7 @@ -162,37 +162,35 @@ worker.setDebug (debug); // ...and call other methods: - String result; - - + // retrieve things try { start ("retrieveServiceNames"); - Map serviceNames = worker.getServiceNames(); + worker.getServiceNamesByAuthority(); ok(); } catch (MobyException e) { error (e); } try { start ("retrieveServiceProviders"); - String[] providers = worker.getProviders(); + worker.getProviders(); ok(); } catch (MobyException e) { error (e); } try { start ("retrieveServiceTypes"); - Map serviceTypes = worker.getServiceNames(); + worker.getServiceTypes(); ok(); } catch (MobyException e) { error (e); } try { start ("retrieveNamespaces"); - Map namespaces = worker.getNamespaces(); + worker.getNamespaces(); ok(); } catch (MobyException e) { error (e); } try { start ("retrieveObjectNames"); - Map typeNames = worker.getDataTypeNames(); + worker.getDataTypeNames(); ok(); } catch (MobyException e) { error (e); } From senger at pub.open-bio.org Thu Sep 22 12:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 12:07:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG79RK017308@pub.open-bio.org> senger Thu Sep 22 12:07:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv17235/src/Clients/help Modified Files: CacheRegistryClient_usage.txt MobyDigest_usage.txt Log Message: moby-live/Java/src/Clients/help CacheRegistryClient_usage.txt,1.3,1.4 MobyDigest_usage.txt,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt 2005/09/04 13:45:37 1.3 +++ /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt 2005/09/22 16:07:08 1.4 @@ -23,20 +23,34 @@ (or print nothing if the cache is empty; - in verbose mode print 'cache is empty'); format: dow mon dd hh:mm:ss zzz yyyy + -agediff ... print how old is cache + (or print nothing if the cache is empty; + - in verbose mode print 'cache is empty') -rawage ... print date when the cache was created (or print nothing if the cache is empty; - in verbose mode print 'cache is empty'); format: number of milliseconds since the standard base time known as "the epoch" (January 1, 1970, 00:00:00 GMT) + -fill ... remove the current cache and reread all data from the given Moby registry and cache them (note that this does not influence data from other Moby registries stored in the same -cachedir directory) + -fill-d ... ditto as -fill but only for data types + -fill-s ... ditto as -fill but only for services + -fill-t ... ditto as -fill but only for service types + -fill-n ... ditto as -fill but only for namespaces + -remove ... remove the current cache of the given Moby registry (again it does not influence data from other Moby registries stored in the same -cachedir directory) + -remove-d ...ditto as -remove but only for data types + -remove-s ...ditto as -remove but only for services + -remove-t ...ditto as -remove but only for service types + -remove-n ...ditto as -remove but only for namespaces + -q ... quiet mode [Note: You can also use -argsfile to read arguments from a =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/09/04 13:45:37 1.3 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/09/22 16:07:08 1.4 @@ -26,6 +26,7 @@ -t ... print all service types -s ... print all service instances -d ... print all data types + -n ... print all namespaces -details ... print the above with all details (by default only names are printed) From senger at pub.open-bio.org Thu Sep 22 12:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 12:07:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG79Jn017371@pub.open-bio.org> senger Thu Sep 22 12:07:09 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv17235/src/main/org/biomoby/service/dashboard Modified Files: NOTES Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard NOTES,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/19 08:08:32 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/22 16:07:09 1.5 @@ -10,26 +10,25 @@ ? small icons to buttons ? use FileSystemView in file choosers ? alltools2: - - combo box history is not updated if exit happened while focus is till in the text field + - combo box history is not updated if exit happened while focus is still in the text field ? configure dashboard from menu: * configure dashbard (add/remove dynamically panels) * configure user preferences -* running from run-dashboard does not work - TODO for cache: --------------- -* add namespaces and service types -* store services under names: authority-service_name -* emit log events +* emit log events; use them also in cmdline clients * poor-man update: keep what's there but add what is not there - (and perhaps delete what should not be thre) - but do not + (and perhaps delete what should not be there) - but do not check any age of existing * getInfo() method * corresponding changes with command-line clients for cache implementations +* remove memory-caching from CentralImpl +* graphics by default: yes for datatyeps and no for services +? improve API javadoc of all these Central*Impl ? start to work on/think of the RDF-based cache Registry panel From senger at pub.open-bio.org Thu Sep 22 12:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 12:07:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG794k017420@pub.open-bio.org> senger Thu Sep 22 12:07:09 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv17235/src/main/org/biomoby/shared Modified Files: CentralDigest.java MobyDataType.java MobyNamespace.java MobyPrimaryDataSet.java MobyPrimaryDataSimple.java MobySecondaryData.java MobyService.java Log Message: moby-live/Java/src/main/org/biomoby/shared CentralDigest.java,1.1,1.2 MobyDataType.java,1.7,1.8 MobyNamespace.java,1.1,1.2 MobyPrimaryDataSet.java,1.2,1.3 MobyPrimaryDataSimple.java,1.4,1.5 MobySecondaryData.java,1.3,1.4 MobyService.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java 2004/10/18 14:49:30 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java 2005/09/22 16:07:09 1.2 @@ -1,14 +1,16 @@ // CentralDigest.java // -// senger at ebi.ac.uk -// September 2004 +// Created: September 2004 +// +// This file is a component of the BioMoby project. +// Copyright Martin Senger (martin.senger at gmail.com). // package org.biomoby.shared; /** - * An interface to the cumulated (digested) contents of the Moby Registry. - *

        + * An interface to the cumulated (digested) contents of the Moby + * Registry.

        * * The main purpose of this interface is for those clients that are * accessing the whole, or a substantial part of, Moby registry. The @@ -16,7 +18,7 @@ * registry API that allow to get more information in one go - saving * significantly network and time.

        * - * @author Martin Senger + * @author Martin Senger * @version $Id$ */ @@ -44,6 +46,17 @@ throws MobyException; /************************************************************************* + * Get definition of all known namespaces. It differs from the + * {@link Central#getNamespaces} because it returns an array of + * full definitions of namespaces, and not just their names and + * descriptions.

        + * + * @throws MobyException if communication with the Moby Registry fails + *************************************************************************/ + MobyNamespace[] getFullNamespaces() + throws MobyException; + + /************************************************************************* * Get definition of all registered service instances. It is a * cumulation of many individual calls to {@link * Central#findService(MobyService) findService by name} for all =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/08/26 06:27:04 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/09/22 16:07:09 1.8 @@ -7,6 +7,7 @@ package org.biomoby.shared; +import org.tulsoft.shared.UUtils; /** @@ -246,20 +247,27 @@ public String toString() { StringBuffer buf = new StringBuffer(); buf.append ("Name: " + name + "\n"); - buf.append ("Auth: " + authority + "\n"); - buf.append ("Desc: " + description + "\n"); - buf.append ("Contact: " + emailContact + "\n"); + if (UUtils.notEmpty (authority)) buf.append ("Auth: " + authority + "\n"); + if (UUtils.notEmpty (description)) buf.append ("Desc: " + description + "\n"); + if (UUtils.notEmpty (emailContact)) buf.append ("Contact: " + emailContact + "\n"); if (id != null) buf.append ("ID: " + id + "\n"); - buf.append ("Parents:\n"); - for (int i = 0 ; i < parentNames.length; i++) { - buf.append (Utils.format (null, 1)); - buf.append (parentNames [i]); + if (parentNames.length > 0) { + buf.append ("Parents: "); + for (int i = 0 ; i < parentNames.length; i++) { + if (i > 0) buf.append (", "); + buf.append (parentNames [i]); + } buf.append ("\n"); } - buf.append ("Children (only those registered here):\n"); - for (int i = 0 ; i < children.length; i++) { - buf.append (Utils.format (null, 1)); - buf.append (children[i].toString()); + int chLen = children.length; + if (chLen > 0) { + buf.append ("Children (only those registered here): "); + if (chLen > 1) + buf.append ("\n"); + for (int i = 0 ; i < chLen; i++) { + if (i > 0) buf.append ("\n\t"); + buf.append (children[i].toString()); + } buf.append ("\n"); } return new String (buf); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java 2003/09/24 14:33:37 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java 2005/09/22 16:07:09 1.2 @@ -6,6 +6,7 @@ // package org.biomoby.shared; +import org.tulsoft.shared.UUtils; /** * A container representing a namespace used in the Moby registry. @@ -69,10 +70,12 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name + "\n"); - buf.append ("Auth: " + authority + "\n"); - buf.append ("Desc: " + description + "\n"); - buf.append ("ID: " + id + "\n"); + buf.append ("Name: " + name); + if (UUtils.notEmpty (authority)) + buf.append (", Auth: " + authority); + if (id != null) buf.append (", ID: " + id); + if (UUtils.notEmpty (description)) + buf.append ("\n\t" + description); return new String (buf); } public String format (int indent) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSet.java 2005/04/07 16:37:02 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSet.java 2005/09/22 16:07:09 1.3 @@ -6,6 +6,8 @@ package org.biomoby.shared; +import org.tulsoft.shared.UUtils; + import java.util.Enumeration; import java.util.Vector; @@ -106,8 +108,9 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name + "\n"); - buf.append ("ID: " + id + "\n"); + if (UUtils.notEmpty (name)) + buf.append ("Name: " + name + "\n"); + if (id != null) buf.append ("ID: " + id + "\n"); buf.append ("Elements in collection:\n"); for (Enumeration en = elements.elements(); en.hasMoreElements(); ) { buf.append (((MobyPrimaryDataSimple)en.nextElement()).format (1)); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSimple.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSimple.java 2005/04/07 16:37:02 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSimple.java 2005/09/22 16:07:09 1.5 @@ -6,6 +6,8 @@ package org.biomoby.shared; +import org.tulsoft.shared.UUtils; + import java.util.Enumeration; import java.util.Vector; @@ -130,15 +132,18 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name + "\n"); + if (UUtils.notEmpty (name)) + buf.append ("Name: " + name + "\n"); if (id != null) buf.append ("ID: " + id + "\n"); if (dataType != null) buf.append ("Data Type:\n" + dataType.format (1)); - buf.append ("Namespaces:\n"); - for (Enumeration en = namespaces.elements(); en.hasMoreElements(); ) { - buf.append (((MobyNamespace)en.nextElement()).format (1)); + if (namespaces.size() > 0) { + buf.append ("Namespaces:\n"); + for (Enumeration en = namespaces.elements(); en.hasMoreElements(); ) { + buf.append (((MobyNamespace)en.nextElement()).format (1)); + buf.append ("\n"); + } } - buf.append ("\n"); return new String (buf); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobySecondaryData.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobySecondaryData.java 2005/04/19 17:58:49 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobySecondaryData.java 2005/09/22 16:07:09 1.4 @@ -6,6 +6,8 @@ package org.biomoby.shared; +import org.tulsoft.shared.UUtils; + import java.util.Enumeration; import java.util.Vector; @@ -178,19 +180,23 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name + "\n"); - buf.append ("ID: " + id + "\n"); + if (UUtils.notEmpty (name)) + buf.append ("Name: " + name + "\n"); + if (id != null) buf.append ("ID: " + id + "\n"); buf.append ("Data Type: " + dataType + "\n"); - buf.append ("Default: " + defaultValue + "\n"); + if (UUtils.notEmpty (defaultValue)) + buf.append ("Default: " + defaultValue + "\n"); if (minimumValue != Integer.MIN_VALUE) buf.append ("Min: " + minimumValue + "\n"); if (maximumValue != Integer.MAX_VALUE) buf.append ("Max: " + maximumValue + "\n"); - buf.append ("Allowed values: "); - for (Enumeration en = allowedValues.elements(); en.hasMoreElements(); ) { - buf.append (en.nextElement() + " "); + if (allowedValues.size() > 0) { + buf.append ("Allowed values: "); + for (Enumeration en = allowedValues.elements(); en.hasMoreElements(); ) { + buf.append (en.nextElement() + " "); + } + buf.append ("\n"); } - buf.append ("\n"); return new String (buf); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2005/08/26 06:27:04 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2005/09/22 16:07:09 1.7 @@ -7,6 +7,8 @@ package org.biomoby.shared; +import org.tulsoft.shared.UUtils; + import java.util.Enumeration; import java.util.Vector; @@ -70,6 +72,15 @@ setName (name); } + /************************************************************************** + * Even more normal constructor - because a service is fully + * qualified only by its name and its authority.

        + *************************************************************************/ + public MobyService (String name, String authority) { + setName (name); + setAuthority (authority); + } + public String getUniqueName() { return name + "/" + authority; } @@ -302,24 +313,25 @@ buf.append ("Desc: " + description + "\n"); buf.append ("URL: " + url + "\n"); buf.append ("Contact: " + emailContact + "\n"); - buf.append ("Signature URL: " + signatureURL + "\n"); - buf.append ("Path to RDF: " + pathToRDF + "\n"); + if (UUtils.notEmpty (signatureURL)) + buf.append ("Signature URL: " + signatureURL + "\n"); + if (UUtils.notEmpty (pathToRDF)) + buf.append ("Path to RDF: " + pathToRDF + "\n"); if (id != null) buf.append ("ID: " + id + "\n"); - buf.append ("\nPrimary inputs:\n"); + buf.append ("Primary inputs:\n"); for (Enumeration en = primaryInputs.elements(); en.hasMoreElements(); ) buf.append (((MobyData)en.nextElement()).format (1)); - buf.append ("\n"); - buf.append ("\nSecondary inputs:\n"); - for (Enumeration en = secondaryInputs.elements(); en.hasMoreElements(); ) - buf.append (en.nextElement().toString()); - buf.append ("\n"); + if (secondaryInputs.size() > 0) { + buf.append ("Secondary inputs:\n"); + for (Enumeration en = secondaryInputs.elements(); en.hasMoreElements(); ) + buf.append (((MobyData)en.nextElement()).format (1)); + } - buf.append ("\nOutputs:\n"); + buf.append ("Outputs:\n"); for (Enumeration en = primaryOutputs.elements(); en.hasMoreElements(); ) - buf.append (en.nextElement().toString()); - buf.append ("\n"); + buf.append (((MobyData)en.nextElement()).format (1)); return new String (buf); } From senger at pub.open-bio.org Thu Sep 22 12:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 12:07:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG79XJ017350@pub.open-bio.org> senger Thu Sep 22 12:07:09 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv17235/src/main/org/biomoby/client Modified Files: BaseCmdLineClient.java CentralDigestCachedImpl.java CentralDigestImpl.java CentralImpl.java GraphsServlet.java ServiceConnections.java Log Message: moby-live/Java/src/main/org/biomoby/client BaseCmdLineClient.java,1.2,1.3 CentralDigestCachedImpl.java,1.6,1.7 CentralDigestImpl.java,1.4,1.5 CentralImpl.java,1.26,1.27 GraphsServlet.java,1.11,1.12 ServiceConnections.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/09/04 13:45:37 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/09/22 16:07:08 1.3 @@ -288,8 +288,7 @@ *************************************************************************/ protected MobyObject createInstance (String className) throws MobyException { - MobyObject data = null; - try { + try { Class theClass = mapDataTypes.getClass (className); if (theClass == null) throw new MobyException ("Cannot instantiate data type '" + className + "'. Does it exist?"); @@ -533,7 +532,6 @@ throw new MobyException ("Service name was not given. Try to add parameter: -service "); - String xmlResponse = null; String methodName = serviceName; Method method = null; Object service = null; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/19 08:08:32 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/22 16:07:08 1.7 @@ -21,6 +21,7 @@ import org.biomoby.shared.MobyDataType; import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; +import org.biomoby.shared.MobyServiceType; import org.biomoby.shared.NoSuccessException; /** @@ -29,7 +30,7 @@ * does not need to access Moby registry all the time. The other * methods of the Central interface do not use the results of the * cached cumulative results (their implementation is just passed to - * the parent class). It does not cache service types.

        + * the parent class).

        * * The caching is done in the file system, not in memory, so the * results are permanent (until someone removes the caching @@ -46,14 +47,27 @@ extends CentralDigestImpl implements CentralAll { + // filename for a list of cached entities + protected static final String LIST_FILE = "__L__I__S__T__"; + + /** An ID used in {@link #removeFromCache} indicating data types part. */ + public static final String CACHE_PART_DATATYPES = "c1"; + + /** An ID used in {@link #removeFromCache} indicating services part. */ + public static final String CACHE_PART_SERVICES = "c2"; + + /** An ID used in {@link #removeFromCache} indicating service types part. */ + public static final String CACHE_PART_SERVICETYPES = "c3"; + + /** An ID used in {@link #removeFromCache} indicating namespaces part. */ + public static final String CACHE_PART_NAMESPACES = "c4"; + // cache location private String cacheDir; // as defined in the constructor protected File dataTypesCache; protected File servicesCache; protected File namespacesCache; - - // cache age - private long cacheAge = -1; + protected File serviceTypesCache; // for optimalization private String fileSeparator; @@ -93,31 +107,40 @@ File cache = createCacheDir (cacheDir, getRegistryEndpoint()); messageLn ("Using cache directory: " + cache); dataTypesCache = createSubCacheDir (cache, "dataTypes"); - long dataTypesCacheAge = (isCacheEmpty (dataTypesCache) ? -1 : dataTypesCache.lastModified()); servicesCache = createSubCacheDir (cache, "services"); - long servicesCacheAge = (isCacheEmpty (servicesCache) ? -1 : servicesCache.lastModified()); namespacesCache = createSubCacheDir (cache, "namespaces"); - long namespacesCacheAge = (isCacheEmpty (namespacesCache) ? -1 : namespacesCache.lastModified()); - - if (dataTypesCacheAge > -1 && servicesCacheAge > -1 && namespacesCacheAge > -1) - cacheAge = Math.min (Math.min (dataTypesCacheAge, servicesCacheAge), - namespacesCacheAge); - else - cacheAge = Math.max (Math.max (dataTypesCacheAge, servicesCacheAge), - namespacesCacheAge); + serviceTypesCache = createSubCacheDir (cache, "serviceTypes"); } } /************************************************************************** - * It removes the whole cache (for the Moby registry this instance - * as initiated for), regardless of the 'id' passed. + * Removes object groups from the cache. If 'id' is null it + * removes the whole cache (for the Moby registry this instance as + * initiated for). Otherwise 'id' indicates what part of the cache + * that will be removed.

        + * + * @param id should be either null, or one of the fillowing: + * {@link #CACHE_PART_DATATYPES}, {@link #CACHE_PART_SERVICES}, + * {@link #CACHE_PART_SERVICETYPES}, and {@link + * #CACHE_PART_NAMESPACES}. **************************************************************************/ public void removeFromCache (String id) { try { if (cacheDir != null) { - removeCacheDir (cacheDir, getRegistryEndpoint(), - new String[] { "dataTypes", "services" }); - cacheAge= -1; + String[] parts = null; + if (id == null) + parts = new String[] { "dataTypes", "services", "serviceTypes", "namespaces" }; + else if (id.equals (CACHE_PART_SERVICES)) + parts = new String[] { "services" }; + else if (id.equals (CACHE_PART_DATATYPES)) + parts = new String[] { "dataTypes" }; + else if (id.equals (CACHE_PART_SERVICETYPES)) + parts = new String[] { "serviceTypes" }; + else if (id.equals (CACHE_PART_NAMESPACES)) + parts = new String[] { "namespaces" }; + if (parts != null) { + removeCacheDir (cacheDir, getRegistryEndpoint(), parts); + } } } catch (MobyException e) { // TBD: keep this here at least for some time (until we @@ -255,8 +278,10 @@ } } - // read a cached file - protected String load (File file) + /************************************************************************** + * Read a cached file + *************************************************************************/ + protected static String load (File file) throws MobyException { try { StringBuffer buf = new StringBuffer(); @@ -280,6 +305,7 @@ // protected boolean isCacheEmpty (File cache) throws MobyException { + if (cache == null) return true; String[] list = cache.list(); return ( list == null || list.length == 0 ); } @@ -287,7 +313,9 @@ protected void fillDataTypesCache() throws MobyException { try { - Map types = getDataTypeNames(); + String typesAsXML = getDataTypeNamesAsXML(); + store (dataTypesCache, LIST_FILE, typesAsXML); + Map types = createDataTypeNamesFromXML (typesAsXML); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); @@ -295,9 +323,6 @@ String xml = getDataTypeAsXML (name); store (dataTypesCache, name, xml); } - if (cacheAge <= 0) - cacheAge = dataTypesCache.lastModified(); - } catch (Exception e) { throw new MobyException (formatException (e)); } @@ -307,17 +332,36 @@ throws MobyException { try { messageLn ("(CDCI) Asking for all service names..."); - Map names = getServiceNames(); - for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { + String byAuthorityAsXML = getServiceNamesByAuthorityAsXML(); + store (servicesCache, LIST_FILE, byAuthorityAsXML); + Map authorities = createServiceNamesByAuthorityFromXML (byAuthorityAsXML); + for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); - String name = (String)entry.getKey(); - messageLn ("(CDCI) Processing service " + name + "..."); - String xml = getServicesAsXML (new MobyService (name), null, true, true); - store (servicesCache, name, xml); + String authority = (String)entry.getKey(); + messageLn ("(CDCI) Processing authority " + authority + "..."); + String xml = getServicesAsXML (new MobyService (MobyService.DUMMY_NAME, authority), null, true, true); + store (servicesCache, authority, xml); } - if (cacheAge <= 0) - cacheAge = servicesCache.lastModified(); + } catch (Exception e) { + throw new MobyException (formatException (e)); + } + } + // + protected void fillServiceTypesCache() + throws MobyException { + try { + messageLn ("(CDCI) Asking for all service type names..."); + String typesAsXML = getServiceTypesAsXML(); + store (serviceTypesCache, LIST_FILE, typesAsXML); + Map types = createServiceTypesFromXML (typesAsXML); + for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String name = (String)entry.getKey(); + messageLn ("(CDCI) Processing service type " + name + "..."); + String xml = getServiceTypeRelationshipsAsXML (name, false); + store (serviceTypesCache, name, xml); + } } catch (Exception e) { throw new MobyException (formatException (e)); } @@ -328,16 +372,34 @@ throws MobyException { try { String xml = getNamespacesAsXML(); - store (namespacesCache, "all_namespaces_in_one_go", xml); - if (cacheAge <= 0) - cacheAge = namespacesCache.lastModified(); - + store (namespacesCache, LIST_FILE, xml); } catch (Exception e) { throw new MobyException (formatException (e)); } } - // read all data types + /************************************************************************* + * + *************************************************************************/ + public Map getDataTypeNames() + throws MobyException { + if (dataTypesCache == null) + return super.getDataTypeNames(); + synchronized (dataTypesCache) { + if (isCacheEmpty (dataTypesCache)) { + initCache(); + fillDataTypesCache(); + } + + // get a list file (with all data type names) + String xmlList = getListFile (dataTypesCache); + return createDataTypeNamesFromXML (xmlList); + } + } + + /************************************************************************* + * + *************************************************************************/ public MobyDataType[] getDataTypes() throws MobyException { if (dataTypesCache == null) @@ -350,15 +412,14 @@ } File[] list = dataTypesCache.listFiles(); if (list == null) - throw new MobyException ("Surprisingly, '" + dataTypesCache.getAbsolutePath() + "' is not a directory. Strange..."); + throw new MobyException (MSG_CACHE_NOT_DIR (dataTypesCache)); + for (int i = 0; i < list.length; i++) { try { - if (list[i].getPath().endsWith ("~")) - continue; // ignore some files + if (ignored (list[i])) continue; v.addElement (createDataTypeFromXML (load (list[i]), "-dummy-")); } catch (NoSuccessException e) { - System.err.println ("Ignoring '" + list[i].getPath() + "'. It should not be in the cache directory."); -// throw new MobyException (e.getMessage() + " (" + e.getCulprit() + ")"); + System.err.println (MSG_CACHE_BAD_FILE (list[i], e)); } } MobyDataType[] result = new MobyDataType [v.size()]; @@ -367,7 +428,28 @@ } } - // read all services + /************************************************************************* + * + *************************************************************************/ + public Map getServiceNamesByAuthority() + throws MobyException { + if (servicesCache == null) + return super.getServiceNamesByAuthority(); + synchronized (servicesCache) { + if (isCacheEmpty (servicesCache)) { + initCache(); + fillServicesCache(); + } + + // get a list file (with all service names) + String xmlList = getListFile (servicesCache); + return createServiceNamesByAuthorityFromXML (xmlList); + } + } + + /************************************************************************* + * + *************************************************************************/ public MobyService[] getServices() throws MobyException { if (servicesCache == null) @@ -380,13 +462,17 @@ } File[] list = servicesCache.listFiles(); if (list == null) - throw new MobyException ("Surprisingly, '" + servicesCache.getAbsolutePath() + "' is not a directory. Strange..."); + throw new MobyException (MSG_CACHE_NOT_DIR (servicesCache)); for (int i = 0; i < list.length; i++) { - if (list[i].getPath().endsWith ("~")) - continue; // ignore some files - MobyService[] servs = extractServices (load (list[i])); - for (int j = 0; j < servs.length; j++) - v.addElement (servs[j]); + try { + if (ignored (list[i])) continue; + MobyService[] servs = extractServices (load (list[i])); + for (int j = 0; j < servs.length; j++) { + v.addElement (servs[j]); + } + } catch (MobyException e) { + System.err.println (MSG_CACHE_BAD_FILE (list[i], e)); + } } MobyService[] result = new MobyService [v.size()]; v.copyInto (result); @@ -394,7 +480,10 @@ } } -// public MobyNamespace[] getNamespaces() + /************************************************************************* + * + *************************************************************************/ +// public MobyNamespace[] getNamespaces() //TBD: later, when API allows it public Map getNamespaces() throws MobyException { if (namespacesCache == null) @@ -404,23 +493,89 @@ initCache(); fillNamespacesCache(); } - File[] list = namespacesCache.listFiles(); - if (list == null) - throw new MobyException - ("Surprisingly, '" + namespacesCache.getAbsolutePath() + "' is not a directory. Strange..."); - for (int i = 0; i < list.length; i++) { + + // get a list file (with all namespaces) + String xmlList = getListFile (namespacesCache); + return createNamespacesFromXML (xmlList); + } + } + + /************************************************************************* + * + *************************************************************************/ + protected MobyServiceType[] readServiceTypes() + throws MobyException { + if (serviceTypesCache == null) + return super.readServiceTypes(); + synchronized (serviceTypesCache) { + if (isCacheEmpty (serviceTypesCache)) { + initCache(); + fillServiceTypesCache(); + } + + // get a list file (with all service type names) + String xmlList = getListFile (serviceTypesCache); + Map types = createServiceTypesFromXML (xmlList); + + // get individual (almost) full service types + Vector v = new Vector(); + for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String name = (String)entry.getKey(); + File file = new File (serviceTypesCache, name); try { - if (list[i].getPath().endsWith ("~")) - continue; // ignore some files - return createNamespacesFromXML (load (list[i])); + MobyServiceType serviceType = new MobyServiceType (name); + serviceType.setParentNames (createServiceTypeRelationshipsFromXML (load (file))); + serviceType.setDescription ((String)entry.getValue()); + v.addElement (serviceType); } catch (MobyException e) { - System.err.println ("Ignoring '" + list[i].getPath() + - "'. It should not be in the cache directory:" + - e.getMessage()); + System.err.println (MSG_CACHE_BAD_FILE (file, e)); } } + MobyServiceType[] result = new MobyServiceType [v.size()]; + v.copyInto (result); + return result; } - return null; + } + + /************************************************************************** + * + *************************************************************************/ + protected static String getListFile (File cache) + throws MobyException { + File listFile = new File (cache, LIST_FILE); + if (! listFile.exists()) + throw new MobyException ("Corrupted cache '" + cache + "': Missing a LIST file."); + return load (listFile); + } + + /************************************************************************** + * Some file (when being read from a cache directory) are ignored. + *************************************************************************/ + protected static boolean ignored (File file) { + String path = file.getPath(); + return + path.endsWith ("~") || + path.endsWith (LIST_FILE); + } + + /************************************************************************** + * + *************************************************************************/ + protected static String MSG_CACHE_NOT_DIR (File cache) { + return + "Surprisingly, '" + cache.getAbsolutePath() + + "' is not a directory. Strange..."; + } + + /************************************************************************** + * + *************************************************************************/ + protected static String MSG_CACHE_BAD_FILE (File file, Exception e) { + return + "Ignoring '" + file.getPath() + + "'. It should not be in the cache directory:" + + e.getMessage(); } /************************************************************************** @@ -434,7 +589,7 @@ /************************************************************************** * It always (again, if it functions as a cache which is when - * 'cacheDir' was given) reports that caching is disabled (even + * 'cacheDir' is given) reports that caching is disabled (even * though for the cumulative results is actually always enabled - * but that is obvious from the name of this class, isn't it?). **************************************************************************/ @@ -445,12 +600,28 @@ /************************************************************************** * Return age of the current (whole) cache in millis from the * beginning of the Epoch; or -1 if cache is empty, or the age is - * unknown. + * unknown.

        * - * The cache age is taken as the oldest (but filled) cache part. + * @return the cache age which is taken as the oldest (but filled) + * cache part (part is considered e.g. 'services', or 'data + * types', not their individual entities) **************************************************************************/ public long getCacheAge() { - return cacheAge; + try { + long dataTypesCacheAge = + (isCacheEmpty (dataTypesCache) ? Long.MAX_VALUE : dataTypesCache.lastModified()); + long servicesCacheAge = + (isCacheEmpty (servicesCache) ? Long.MAX_VALUE : servicesCache.lastModified()); + long namespacesCacheAge = + (isCacheEmpty (namespacesCache) ? Long.MAX_VALUE : namespacesCache.lastModified()); + long serviceTypesCacheAge = + (isCacheEmpty (serviceTypesCache) ? Long.MAX_VALUE : serviceTypesCache.lastModified()); + long age = Math.min (Math.min (dataTypesCacheAge, servicesCacheAge), + Math.min (namespacesCacheAge, serviceTypesCacheAge)); + return (age == Long.MAX_VALUE ? -1 : age); + } catch (MobyException e) { + return -1; + } } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/09/04 13:45:37 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/09/22 16:07:09 1.5 @@ -11,6 +11,7 @@ import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; import org.biomoby.shared.MobyServiceType; +import org.biomoby.shared.MobyNamespace; import org.tulsoft.tools.debug.DGUtils; @@ -35,6 +36,7 @@ protected MobyDataType[] dataTypes = new MobyDataType[] {}; protected MobyServiceType[] serviceTypes = new MobyServiceType[] {}; protected MobyService[] services = new MobyService[] {}; + protected MobyNamespace[] namespaces = new MobyNamespace[] {}; /************************************************************************* @@ -101,7 +103,7 @@ String typeName = (String)entry.getKey(); messageLn ("(CDI) Processing service type " + typeName + "..."); MobyServiceType serviceType = new MobyServiceType (typeName); - serviceType.setDescription ((String)entry.getKey()); + serviceType.setDescription ((String)entry.getValue()); serviceType.setParentNames (getServiceTypeRelationships (typeName, false)); v.addElement (serviceType); } @@ -115,6 +117,36 @@ } /************************************************************************* + * Physically gather together all namespaces. It is not that hard + * (comparing to other Biomoby entities) because all namespaces + * are delivered by a single call to Biomoby. This method differs + * form the Central.getNamespaces() in the type of returned + * result, and - hopefully in the future - also in the amount of + * information stored in the returned value (but at the monent, + * because of a limitation of the Biomoby API, both result types + * contain the same information). + *************************************************************************/ + protected MobyNamespace[] readNamespaces() + throws MobyException { + try { + Map names = getNamespaces(); + MobyNamespace[] result = new MobyNamespace [ names.size() ]; + int i = 0; + for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String name = (String)entry.getKey(); + MobyNamespace ns = new MobyNamespace (name); + ns.setDescription ((String)entry.getValue()); + result[i++] = ns; + } + return result; + + } catch (Exception e) { + throw new MobyException (formatException (e)); + } + } + + /************************************************************************* * Physically gather together all service instances. *************************************************************************/ protected MobyService[] readServices() @@ -122,14 +154,17 @@ try { Vector v = new Vector(); messageLn ("(CDI) Asking for all service names..."); - Map names = getServiceNames(); - for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { + Map authorities = getServiceNamesByAuthority(); + for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); - String name = (String)entry.getKey(); - messageLn ("(CDI) Processing service " + name + "..."); - MobyService[] servs = findService (new MobyService (name)); - for (int i = 0; i < servs.length; i++) - v.addElement (servs[i]); + String authority = (String)entry.getKey(); + String[] names = (String[])entry.getValue(); + for (int i = 0; i < names.length; i++) { + messageLn ("(CDI) Processing service " + names[i] + "..."); + MobyService[] servs = findService (new MobyService (names[i], authority)); + for (int j = 0; j < servs.length; j++) + v.addElement (servs[j]); + } } MobyService[] result = new MobyService [v.size()]; v.copyInto (result); @@ -227,6 +262,22 @@ /************************************************************************* * *************************************************************************/ + public MobyNamespace[] getFullNamespaces() + throws MobyException { + synchronized (namespaces) { + if (getCacheMode()) { + if (namespaces.length == 0) + namespaces = readNamespaces(); + return namespaces; + } else { + return readNamespaces(); + } + } + } + + /************************************************************************* + * + *************************************************************************/ public MobyService[] getServices() throws MobyException { synchronized (services) { @@ -240,7 +291,6 @@ } } - // Work in progress - implement the methods above by getting RDF // graphs in-one-go and parsing them. Actually ability to get such // graphs was the main motivation for this implementation, and for =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/19 08:08:32 1.26 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/22 16:07:09 1.27 @@ -23,6 +23,7 @@ import org.biomoby.shared.Utils; import org.biomoby.shared.MobyResourceRef; +import org.tulsoft.shared.UUtils; import org.tulsoft.tools.soap.axis.AxisUtils; import org.w3c.dom.Document; @@ -401,7 +402,7 @@ buf.append ("" + service.getType() + "\n"); String name = service.getName(); - if (!name.equals ("") && !name.equals ("dummy")) + if (!name.equals ("") && !name.equals ("dummy") && !name.equals (MobyService.DUMMY_NAME)) buf.append ("" + service.getName() + "\n"); buf.append ("" + service.getCategory() + "\n"); @@ -622,7 +623,7 @@ * further calls unless it is set to true again.

        * * @param shouldCache whether retrieveXXX call results should be - * cached in case they are called again (i.e. don't requery + * cached in case they are called again (i.e. don't request * MobyCentral every time) **************************************************************************/ public void setCacheMode (boolean shouldCache) { @@ -659,11 +660,6 @@ public Map getServiceNames() throws MobyException { - String cacheId = "retrieveServiceNames"; - Map cachedResults = (Map)getContents (cacheId); - if (cachedResults != null) - return cachedResults; - String result = (String)doCall ("retrieveServiceNames", new Object[] {}); @@ -683,9 +679,6 @@ elem.getAttribute ("authURI")); } - // Add this data to the cache in case we get called again - setContents (cacheId, results); - return results; } @@ -701,14 +694,20 @@ *************************************************************************/ public Map getServiceNamesByAuthority() throws MobyException { + String result = getServiceNamesByAuthorityAsXML(); + return createServiceNamesByAuthorityFromXML (result); + } - String cacheId = "retrieveServiceNamesByAuthority"; - Map cachedResults = (Map)getContents (cacheId); - if (cachedResults != null) - return cachedResults; + // + protected String getServiceNamesByAuthorityAsXML() + throws MobyException { + return (String)doCall ("retrieveServiceNames", + new Object[] {}); + } - String result = (String)doCall ("retrieveServiceNames", - new Object[] {}); + // + protected Map createServiceNamesByAuthorityFromXML (String result) + throws MobyException { // parse returned XML Map results = new HashMap(); @@ -738,9 +737,6 @@ entry.setValue (servNames); } - // Add this data to the cache in case we get called again - setContents (cacheId, results); - return results; } @@ -798,14 +794,20 @@ *************************************************************************/ public Map getServiceTypes() throws MobyException { + String result = getServiceTypesAsXML(); + return createServiceTypesFromXML (result); + } - String cacheId = "retrieveServiceTypes"; - Map cachedResults = (Map)getContents (cacheId); - if (cachedResults != null) - return cachedResults; + // + protected String getServiceTypesAsXML() + throws MobyException { + return (String)doCall ("retrieveServiceTypes", + new Object[] {}); + } - String result = (String)doCall ("retrieveServiceTypes", - new Object[] {}); + // + protected Map createServiceTypesFromXML (String result) + throws MobyException { // parse returned XML Map results = new HashMap(); @@ -826,10 +828,6 @@ } } } - - // Add this data to the cache in case we get called again - setContents (cacheId, results); - return results; } @@ -863,11 +861,6 @@ protected Map createNamespacesFromXML (String result) throws MobyException { - String cacheId = "retrieveNamespaces"; - Map cachedResults = (Map)getContents (cacheId); - if (cachedResults != null) - return cachedResults; - // parse returned XML Map results = new HashMap(); Document document = null; @@ -898,9 +891,6 @@ } } - // Add this data to the cache in case we get called again - setContents (cacheId, results); - return results; } @@ -918,14 +908,20 @@ *************************************************************************/ public Map getDataTypeNames() throws MobyException { + String result = getDataTypeNamesAsXML(); + return createDataTypeNamesFromXML (result); + } - String cacheId = "retrieveObjectNames"; - Map cachedResults = (Map)getContents (cacheId); - if (cachedResults != null) - return cachedResults; + // + protected String getDataTypeNamesAsXML() + throws MobyException { + return (String)doCall ("retrieveObjectNames", + new Object[] {}); + } - String result = (String)doCall ("retrieveObjectNames", - new Object[] {}); + // + protected Map createDataTypeNamesFromXML (String result) + throws MobyException { // parse returned XML Map results = new HashMap(); @@ -949,7 +945,6 @@ } } - setContents (cacheId, results); return results; } @@ -986,20 +981,12 @@ protected String getDataTypeAsXML (String dataTypeName) throws MobyException, NoSuccessException { - String cacheId = "retrieveObjectDefinition_" + dataTypeName; - String cachedResults = (String)getContents (cacheId); - if (cachedResults != null) - return cachedResults; - - String results = - (String)doCall ("retrieveObjectDefinition", - new Object[] { - "" + - "" + dataTypeName + "" + - "" - }); - setContents (cacheId, results); - return results; + return (String)doCall ("retrieveObjectDefinition", + new Object[] { + "" + + "" + dataTypeName + "" + + "" + }); } protected MobyDataType createDataTypeFromXML (String xmlSource, String dataTypeName) @@ -1475,13 +1462,15 @@ public String[] getServiceTypeRelationships (String serviceTypeName, boolean expand) throws MobyException { + String result = getServiceTypeRelationshipsAsXML (serviceTypeName, expand); + return createServiceTypeRelationshipsFromXML (result); + } - String cacheId = "Relationships_" + serviceTypeName + ":" + expand; - String[] cachedResults = (String[])getContents (cacheId); - if (cachedResults != null) - return cachedResults; - - String result = + // + protected String getServiceTypeRelationshipsAsXML (String serviceTypeName, + boolean expand) + throws MobyException { + return (String)doCall ("Relationships", new Object[] { "" + @@ -1490,6 +1479,11 @@ "" + (expand ? "1" : "0") + "" + "" }); + } + + // + protected String[] createServiceTypeRelationshipsFromXML (String result) + throws MobyException { // parse returned XML Vector v = new Vector(); @@ -1509,8 +1503,6 @@ } String[] results = new String [v.size()]; v.copyInto (results); - - setContents (cacheId, results); return results; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/09/04 13:45:37 1.11 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/09/22 16:07:09 1.12 @@ -275,10 +275,10 @@ // read some suggested defaults from the init parameters defaultEndpoint = (String)initParams.get (DEFAULT_ENDPOINT); - if (UUtils.isEmpty (defaultEndpoint)) + if ( UUtils.isEmpty (defaultEndpoint) || defaultEndpoint.equals ("\"\"") ) defaultEndpoint = CentralImpl.DEFAULT_ENDPOINT; defaultNamespace = (String)initParams.get (DEFAULT_NAMESPACE); - if (UUtils.isEmpty (defaultNamespace)) + if ( UUtils.isEmpty (defaultNamespace) || defaultNamespace.equals ("\"\"") ) defaultNamespace = CentralImpl.DEFAULT_NAMESPACE; registryCacheDir = (String)initParams.get (REGISTRY_CACHE_DIR); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java 2005/08/26 06:27:04 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java 2005/09/22 16:07:09 1.7 @@ -244,7 +244,6 @@ // we need to remember all connections (edges) created for this output // because only after we finish with it we will find if the connections // are 'weak' or not (as described in ServicesEdge.isWeakConnection) - int startingFrom = v.size(); boolean headCollection = false; MobyPrimaryDataSimple output; From kawas at pub.open-bio.org Thu Sep 22 12:23:13 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Thu, 22 Sep 2005 12:23:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221623.j8MGNDlp017500@pub.open-bio.org> kawas Thu Sep 22 12:23:13 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi In directory pub.open-bio.org:/tmp/cvs-serv17475/Adaptor/moby/queryapi Modified Files: mysql.pm Log Message: added case sensitive servicename queries moby-live/Perl/MOBY/Adaptor/moby/queryapi mysql.pm,1.73,1.74 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/09/13 13:17:58 1.73 +++ /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/09/22 16:23:13 1.74 @@ -123,7 +123,12 @@ { if (defined $pair{$key}) { - $condition .= $key . " = ? "; + #added a check for servicename to support case sensitivity + if ($key eq "servicename") { + $condition .= $key . " LIKE binary ? "; + } else { + $condition .= $key . " = ? "; + } push(@bindvalues, $pair{$key}); } else @@ -621,6 +626,7 @@ } # pass servicename and authority_uri +# TODO added LIKE binary here sub query_service_existence { my ($self, %args) = @_; my $dbh = $self->dbh; @@ -643,7 +649,7 @@ description, signatureURL, lsid - from service_instance where servicename = ? and authority_id = ?"; + from service_instance where servicename LIKE binary ? and authority_id = ?"; my $final = do_query($dbh, $statement, ($servicename, $id)); if (@$final[0]){return 1} else {return 0} From gss at pub.open-bio.org Thu Sep 22 12:57:58 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:57:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvwEp017665@pub.open-bio.org> gss Thu Sep 22 12:57:58 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/graph/tools Removed Files: MOBYProviderTraverser.html package-summary.html package-tree.html package-use.html package-frame.html MOBYProviderVisitorAdapter.html MOBYProviderTraversalException.html MOBYProviderVisitor.html MOBYProviderXMLGenerator.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools MOBYProviderTraverser.html,1.1,NONE package-summary.html,1.1,NONE package-tree.html,1.1,NONE package-use.html,1.1,NONE package-frame.html,1.1,NONE MOBYProviderVisitorAdapter.html,1.1,NONE MOBYProviderTraversalException.html,1.1,NONE MOBYProviderVisitor.html,1.1,NONE MOBYProviderXMLGenerator.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/MOBYProviderTraverser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/MOBYProviderVisitorAdapter.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/MOBYProviderTraversalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/MOBYProviderVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/MOBYProviderXMLGenerator.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:57:58 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:57:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvwrW017685@pub.open-bio.org> gss Thu Sep 22 12:57:58 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/test Removed Files: package-summary.html package-use.html package-tree.html Test.html package-frame.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test package-summary.html,1.1,NONE package-use.html,1.1,NONE package-tree.html,1.1,NONE Test.html,1.1,NONE package-frame.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/RCS/Test.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/RCS/package-frame.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:57:58 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:57:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvw1u017739@pub.open-bio.org> gss Thu Sep 22 12:57:58 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/graph Removed Files: MOBYProviderSet.html MOBYProvider.html MOBYObject.html MOBYSingleElement.html package-tree.html MOBYPropertyValueException.html MOBYDocument.html MOBYCollection.html MOBYPropertyValueConstraint.html MOBYNonNegativeIntegerConstraint.html MOBYGraphNode.html MOBYResource.html package-summary.html MOBYPropertyValue.html MOBYLiteral.html package-frame.html MOBYPropertyValueStatement.html MOBYOrderedCollection.html MOBYGraphVisitor.html MOBYEnumeration.html MOBYNumericConstraint.html MOBYDateConstraint.html MOBYDescriptor.html MOBYOntology.html MOBYUnorderedCollection.html package-use.html MOBYNonPositiveIntegerConstraint.html MOBYResizableCollection.html MOBYSubject.html MOBYMappingElement.html MOBYIntegerConstraint.html MOBYGraph.html MOBYFixedCollection.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph MOBYProviderSet.html,1.1,NONE MOBYProvider.html,1.1,NONE MOBYObject.html,1.1,NONE MOBYSingleElement.html,1.1,NONE package-tree.html,1.1,NONE MOBYPropertyValueException.html,1.1,NONE MOBYDocument.html,1.1,NONE MOBYCollection.html,1.1,NONE MOBYPropertyValueConstraint.html,1.1,NONE MOBYNonNegativeIntegerConstraint.html,1.1,NONE MOBYGraphNode.html,1.1,NONE MOBYResource.html,1.1,NONE package-summary.html,1.1,NONE MOBYPropertyValue.html,1.1,NONE MOBYLiteral.html,1.1,NONE package-frame.html,1.1,NONE MOBYPropertyValueStatement.html,1.1,NONE MOBYOrderedCollection.html,1.1,NONE MOBYGraphVisitor.html,1.1,NONE MOBYEnumeration.html,1.1,NONE MOBYNumericConstraint.html,1.1,NONE MOBYDateConstraint.html,1.1,NONE MOBYDescriptor.html,1.1,NONE MOBYOntology.html,1.1,NONE MOBYUnorderedCollection.html,1.1,NONE package-use.html,1.1,NONE MOBYNonPositiveIntegerConstraint.html,1.1,NONE MOBYResizableCollection.! html,1.1,NONE MOBYSubject.html,1.1,NONE MOBYMappingElement.html,1.1,NONE MOBYIntegerConstraint.html,1.1,NONE MOBYGraph.html,1.1,NONE MOBYFixedCollection.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYProviderSet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYProvider.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYObject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYSingleElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYPropertyValueException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYDocument.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYPropertyValueConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYNonNegativeIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYGraphNode.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYResource.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYPropertyValue.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYLiteral.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYPropertyValueStatement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYOrderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYGraphVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYEnumeration.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYNumericConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYDateConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYDescriptor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYOntology.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYUnorderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYNonPositiveIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYResizableCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYSubject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYMappingElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYGraph.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYFixedCollection.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:57:59 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:57:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvxvq017815@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/parser/test Removed Files: package-use.html package-frame.html Test.html ParserTest.html package-tree.html package-summary.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test package-use.html,1.1,NONE package-frame.html,1.1,NONE Test.html,1.1,NONE ParserTest.html,1.1,NONE package-tree.html,1.1,NONE package-summary.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/Test.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/ParserTest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/package-summary.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:57:59 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:57:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvxIr017891@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/graph/class-use Removed Files: MOBYCollection.html MOBYResource.html MOBYResizableCollection.html MOBYPropertyValueException.html MOBYLiteral.html MOBYProvider.html MOBYObject.html MOBYGraph.html MOBYDateConstraint.html MOBYNumericConstraint.html MOBYNonPositiveIntegerConstraint.html MOBYNonNegativeIntegerConstraint.html MOBYFixedCollection.html MOBYPropertyValue.html MOBYDocument.html MOBYMappingElement.html MOBYPropertyValueStatement.html MOBYPropertyValueConstraint.html MOBYGraphVisitor.html MOBYProviderSet.html MOBYGraphNode.html MOBYEnumeration.html MOBYOrderedCollection.html MOBYIntegerConstraint.html MOBYSingleElement.html MOBYUnorderedCollection.html MOBYOntology.html MOBYDescriptor.html MOBYSubject.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use MOBYCollection.html,1.1,NONE MOBYResource.html,1.1,NONE MOBYResizableCollection.html,1.1,NONE MOBYPropertyValueException.html,1.1,NONE MOBYLiteral.html,1.1,NONE MOBYProvider.html,1.1,NONE MOBYObject.html,1.1,NONE MOBYGraph.html,1.1,NONE MOBYDateConstraint.html,1.1,NONE MOBYNumericConstraint.html,1.1,NONE MOBYNonPositiveIntegerConstraint.html,1.1,NONE MOBYNonNegativeIntegerConstraint.html,1.1,NONE MOBYFixedCollection.html,1.1,NONE MOBYPropertyValue.html,1.1,NONE MOBYDocument.html,1.1,NONE MOBYMappingElement.html,1.1,NONE MOBYPropertyValueStatement.html,1.1,NONE MOBYPropertyValueConstraint.html,1.1,NONE MOBYGraphVisitor.html,1.1,NONE MOBYProviderSet.html,1.1,NONE MOBYGraphNode.html,1.1,NONE MOBYEnumeration.html,1.1,NONE MOBYOrderedCollection.html,1.1,NONE MOBYIntegerConstraint.html,1.1,NONE MOBYSingleElement.html,1.1,NONE MOBYUnorderedCollection.html,1.1,NONE MOBYOntology.htm! l,1.1,NONE MOBYDescriptor.html,1.1,NONE MOBYSubject.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYResource.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYResizableCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYPropertyValueException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYLiteral.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYProvider.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYObject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYGraph.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYDateConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYNumericConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYNonPositiveIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYNonNegativeIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYFixedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYPropertyValue.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYDocument.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYMappingElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYPropertyValueStatement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYPropertyValueConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYGraphVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYProviderSet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYGraphNode.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYEnumeration.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYOrderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYSingleElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYUnorderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYOntology.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYDescriptor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYSubject.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:57:59 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:57:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvxfB017837@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/graph/tools/class-use Removed Files: MOBYProviderTraverser.html MOBYProviderTraversalException.html MOBYProviderVisitorAdapter.html MOBYProviderXMLGenerator.html MOBYProviderVisitor.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use MOBYProviderTraverser.html,1.1,NONE MOBYProviderTraversalException.html,1.1,NONE MOBYProviderVisitorAdapter.html,1.1,NONE MOBYProviderXMLGenerator.html,1.1,NONE MOBYProviderVisitor.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use/RCS/MOBYProviderTraverser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use/RCS/MOBYProviderTraversalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use/RCS/MOBYProviderVisitorAdapter.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use/RCS/MOBYProviderXMLGenerator.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use/RCS/MOBYProviderVisitor.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:57:59 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:57:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvxBw017791@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/graph Removed Files: MOBYUnorderedCollection.html MOBYDocument.html MOBYLiteral.html MOBYObject.html MOBYSingleElement.html package-summary.html MOBYDescriptor.html MOBYResizableCollection.html MOBYSubject.html MOBYCollection.html package-frame.html MOBYIntegerConstraint.html MOBYGraphNode.html package-tree.html MOBYFixedCollection.html MOBYProviderSet.html MOBYProvider.html MOBYPropertyValue.html MOBYPropertyValueException.html MOBYPropertyValueStatement.html MOBYNonNegativeIntegerConstraint.html MOBYMappingElement.html MOBYGraphVisitor.html MOBYGraph.html MOBYOntology.html package-use.html MOBYNonPositiveIntegerConstraint.html MOBYResource.html MOBYDateConstraint.html MOBYNumericConstraint.html MOBYEnumeration.html MOBYPropertyValueConstraint.html MOBYOrderedCollection.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph MOBYUnorderedCollection.html,1.2,NONE MOBYDocument.html,1.2,NONE MOBYLiteral.html,1.2,NONE MOBYObject.html,1.2,NONE MOBYSingleElement.html,1.2,NONE package-summary.html,1.2,NONE MOBYDescriptor.html,1.2,NONE MOBYResizableCollection.html,1.2,NONE MOBYSubject.html,1.2,NONE MOBYCollection.html,1.2,NONE package-frame.html,1.2,NONE MOBYIntegerConstraint.html,1.1,NONE MOBYGraphNode.html,1.2,NONE package-tree.html,1.2,NONE MOBYFixedCollection.html,1.2,NONE MOBYProviderSet.html,1.2,NONE MOBYProvider.html,1.2,NONE MOBYPropertyValue.html,1.2,NONE MOBYPropertyValueException.html,1.2,NONE MOBYPropertyValueStatement.html,1.2,NONE MOBYNonNegativeIntegerConstraint.html,1.1,NONE MOBYMappingElement.html,1.2,NONE MOBYGraphVisitor.html,1.1,NONE MOBYGraph.html,1.2,NONE MOBYOntology.html,1.2,NONE package-use.html,1.2,NONE MOBYNonPositiveIntegerConstraint.html,1.1,NONE MOBYResource.html,1.2,NONE MOBYDateConstrain! t.html,1.1,NONE MOBYNumericConstraint.html,1.1,NONE MOBYEnumeration.html,1.2,NONE MOBYPropertyValueConstraint.html,1.2,NONE MOBYOrderedCollection.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYUnorderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYDocument.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYLiteral.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYObject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYSingleElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYDescriptor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYResizableCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYSubject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYGraphNode.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYFixedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYProviderSet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYProvider.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYPropertyValue.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYPropertyValueException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYPropertyValueStatement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYNonNegativeIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYMappingElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYGraphVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYGraph.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYOntology.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYNonPositiveIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYResource.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYDateConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYNumericConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYEnumeration.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYPropertyValueConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYOrderedCollection.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:57:59 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:57:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvxaO017911@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/test Removed Files: package-tree.html package-use.html package-summary.html package-frame.html Test.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test package-tree.html,1.1,NONE package-use.html,1.1,NONE package-summary.html,1.1,NONE package-frame.html,1.1,NONE Test.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/RCS/Test.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0pX018075@pub.open-bio.org> gss Thu Sep 22 12:58:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/parser/class-use Removed Files: Parser.html UnparsableGraphException.html NonCanonicalException.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/class-use Parser.html,1.1,NONE UnparsableGraphException.html,1.1,NONE NonCanonicalException.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/class-use/RCS/Parser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/class-use/RCS/UnparsableGraphException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/class-use/RCS/NonCanonicalException.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0gg018056@pub.open-bio.org> gss Thu Sep 22 12:58:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/graph/class-use Removed Files: MOBYNonNegativeIntegerConstraint.html MOBYPropertyValue.html MOBYDocument.html MOBYSubject.html MOBYSingleElement.html MOBYGraphNode.html MOBYObject.html MOBYResizableCollection.html MOBYDateConstraint.html MOBYCollection.html MOBYProvider.html MOBYEnumeration.html MOBYGraphVisitor.html MOBYDescriptor.html MOBYNumericConstraint.html MOBYUnorderedCollection.html MOBYProviderSet.html MOBYPropertyValueStatement.html MOBYFixedCollection.html MOBYOntology.html MOBYLiteral.html MOBYResource.html MOBYIntegerConstraint.html MOBYGraph.html MOBYPropertyValueException.html MOBYOrderedCollection.html MOBYPropertyValueConstraint.html MOBYNonPositiveIntegerConstraint.html MOBYMappingElement.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use MOBYNonNegativeIntegerConstraint.html,1.1,NONE MOBYPropertyValue.html,1.2,NONE MOBYDocument.html,1.2,NONE MOBYSubject.html,1.2,NONE MOBYSingleElement.html,1.2,NONE MOBYGraphNode.html,1.2,NONE MOBYObject.html,1.2,NONE MOBYResizableCollection.html,1.2,NONE MOBYDateConstraint.html,1.1,NONE MOBYCollection.html,1.2,NONE MOBYProvider.html,1.2,NONE MOBYEnumeration.html,1.2,NONE MOBYGraphVisitor.html,1.1,NONE MOBYDescriptor.html,1.2,NONE MOBYNumericConstraint.html,1.1,NONE MOBYUnorderedCollection.html,1.2,NONE MOBYProviderSet.html,1.2,NONE MOBYPropertyValueStatement.html,1.2,NONE MOBYFixedCollection.html,1.2,NONE MOBYOntology.html,1.2,NONE MOBYLiteral.html,1.2,NONE MOBYResource.html,1.2,NONE MOBYIntegerConstraint.html,1.1,NONE MOBYGraph.html,1.2,NONE MOBYPropertyValueException.html,1.2,NONE MOBYOrderedCollection.html,1.2,NONE MOBYPropertyValueConstraint.html,1.2,NONE MOBYNonPositiveIntege! rConstraint.html,1.1,NONE MOBYMappingElement.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYNonNegativeIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYPropertyValue.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYDocument.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYSubject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYSingleElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYGraphNode.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYObject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYResizableCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYDateConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYProvider.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYEnumeration.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYGraphVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYDescriptor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYNumericConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYUnorderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYProviderSet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYPropertyValueStatement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYFixedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYOntology.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYLiteral.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYResource.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYGraph.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYPropertyValueException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYOrderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYPropertyValueConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYNonPositiveIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYMappingElement.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0E8017937@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/parser Removed Files: package-tree.html NonCanonicalException.html package-use.html UnparsableGraphException.html package-frame.html Parser.html package-summary.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser package-tree.html,1.1,NONE NonCanonicalException.html,1.1,NONE package-use.html,1.1,NONE UnparsableGraphException.html,1.1,NONE package-frame.html,1.1,NONE Parser.html,1.1,NONE package-summary.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/NonCanonicalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/UnparsableGraphException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/Parser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/package-summary.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0JD017955@pub.open-bio.org> gss Thu Sep 22 12:58:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/servlet/class-use Removed Files: AbstractMobyServlet.html ParameterException.html ParamReader.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/class-use AbstractMobyServlet.html,1.2,NONE ParameterException.html,1.2,NONE ParamReader.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/class-use/RCS/AbstractMobyServlet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/class-use/RCS/ParameterException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/class-use/RCS/ParamReader.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0hI017981@pub.open-bio.org> gss Thu Sep 22 12:58:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/http Removed Files: HTTPResponse.html package-frame.html HTTPRequest.html package-use.html package-tree.html package-summary.html HTTPException.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http HTTPResponse.html,1.1,NONE package-frame.html,1.1,NONE HTTPRequest.html,1.1,NONE package-use.html,1.1,NONE package-tree.html,1.1,NONE package-summary.html,1.1,NONE HTTPException.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/HTTPResponse.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/HTTPRequest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/HTTPException.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw1p1018096@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/vocabulary Removed Files: package-tree.html MOBY.html package-use.html VocabularyDescription.html package-summary.html package-frame.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary package-tree.html,1.1,NONE MOBY.html,1.1,NONE package-use.html,1.1,NONE VocabularyDescription.html,1.1,NONE package-summary.html,1.1,NONE package-frame.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/MOBY.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/VocabularyDescription.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/package-frame.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0Ui018007@pub.open-bio.org> gss Thu Sep 22 12:58:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/vocabulary Removed Files: MOBY.html VocabularyDescription.html package-use.html package-frame.html package-summary.html package-tree.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary MOBY.html,1.2,NONE VocabularyDescription.html,1.2,NONE package-use.html,1.2,NONE package-frame.html,1.2,NONE package-summary.html,1.2,NONE package-tree.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/MOBY.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/VocabularyDescription.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/package-tree.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw2GN018229@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/parser Removed Files: package-frame.html package-use.html NonCanonicalException.html package-tree.html package-summary.html Parser.html UnparsableGraphException.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser package-frame.html,1.2,NONE package-use.html,1.2,NONE NonCanonicalException.html,1.2,NONE package-tree.html,1.2,NONE package-summary.html,1.2,NONE Parser.html,1.2,NONE UnparsableGraphException.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/NonCanonicalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/Parser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/UnparsableGraphException.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw2Gm018254@pub.open-bio.org> gss Thu Sep 22 12:58:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/servlet Removed Files: ParameterException.html package-summary.html package-frame.html package-tree.html AbstractMobyServlet.html package-use.html ParamReader.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet ParameterException.html,1.2,NONE package-summary.html,1.2,NONE package-frame.html,1.2,NONE package-tree.html,1.2,NONE AbstractMobyServlet.html,1.2,NONE package-use.html,1.2,NONE ParamReader.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/ParameterException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/AbstractMobyServlet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/ParamReader.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5Ll018423@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/parser/class-use Removed Files: NonCanonicalException.html UnparsableGraphException.html Parser.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/class-use NonCanonicalException.html,1.2,NONE UnparsableGraphException.html,1.2,NONE Parser.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/class-use/RCS/NonCanonicalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/class-use/RCS/UnparsableGraphException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/class-use/RCS/Parser.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5Pw018515@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/http/class-use Removed Files: HTTPRequest.html HTTPException.html HTTPResponse.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/class-use HTTPRequest.html,1.1,NONE HTTPException.html,1.1,NONE HTTPResponse.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/class-use/RCS/HTTPRequest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/class-use/RCS/HTTPException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/class-use/RCS/HTTPResponse.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5Fl018401@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/graph/tools Removed Files: MOBYProviderTraverser.html package-frame.html package-use.html MOBYProviderTraversalException.html package-summary.html package-tree.html MOBYProviderVisitor.html MOBYProviderXMLGenerator.html MOBYProviderVisitorAdapter.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools MOBYProviderTraverser.html,1.1,NONE package-frame.html,1.1,NONE package-use.html,1.1,NONE MOBYProviderTraversalException.html,1.1,NONE package-summary.html,1.1,NONE package-tree.html,1.1,NONE MOBYProviderVisitor.html,1.1,NONE MOBYProviderXMLGenerator.html,1.1,NONE MOBYProviderVisitorAdapter.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/MOBYProviderTraverser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/MOBYProviderTraversalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/MOBYProviderVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/MOBYProviderXMLGenerator.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/MOBYProviderVisitorAdapter.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw17l018182@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use Removed Files: MOBYProviderTraverser.html MOBYProviderXMLGenerator.html MOBYProviderVisitorAdapter.html MOBYProviderVisitor.html MOBYProviderTraversalException.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use MOBYProviderTraverser.html,1.1,NONE MOBYProviderXMLGenerator.html,1.1,NONE MOBYProviderVisitorAdapter.html,1.1,NONE MOBYProviderVisitor.html,1.1,NONE MOBYProviderTraversalException.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use/RCS/MOBYProviderTraverser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use/RCS/MOBYProviderXMLGenerator.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use/RCS/MOBYProviderVisitorAdapter.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use/RCS/MOBYProviderVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use/RCS/MOBYProviderTraversalException.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5Et018493@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/test/class-use Removed Files: Test.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/class-use Test.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/class-use/RCS/Test.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw10i018162@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/index-files Removed Files: index-10.html index-5.html index-18.html index-12.html index-16.html index-2.html index-17.html index-6.html index-3.html index-4.html index-15.html index-8.html index-13.html index-14.html index-1.html index-9.html index-11.html index-7.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files index-10.html,1.3,NONE index-5.html,1.3,NONE index-18.html,1.1,NONE index-12.html,1.3,NONE index-16.html,1.3,NONE index-2.html,1.3,NONE index-17.html,1.1,NONE index-6.html,1.3,NONE index-3.html,1.3,NONE index-4.html,1.3,NONE index-15.html,1.3,NONE index-8.html,1.3,NONE index-13.html,1.3,NONE index-14.html,1.3,NONE index-1.html,1.3,NONE index-9.html,1.3,NONE index-11.html,1.3,NONE index-7.html,1.3,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-10.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-5.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-18.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-12.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-16.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-2.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-17.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-6.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-3.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-4.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-15.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-8.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-13.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-14.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-1.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-9.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-11.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-7.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:06 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw6bw018575@pub.open-bio.org> gss Thu Sep 22 12:58:06 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/vocabulary/class-use Removed Files: VocabularyDescription.html MOBY.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/class-use VocabularyDescription.html,1.1,NONE MOBY.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/class-use/RCS/VocabularyDescription.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/class-use/RCS/MOBY.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 13:04:15 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:04:15 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221704.j8MH4FaV018766@pub.open-bio.org> gss Thu Sep 22 13:04:15 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF In directory pub.open-bio.org:/tmp/cvs-serv18741/WebRoot/WEB-INF Modified Files: .cvsignore Log Message: Also ignore lib directory; it is created by the war task in the build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF .cvsignore,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore 2005/09/22 17:04:15 1.3 @@ -1,2 +1,3 @@ classes smoby.properties +lib From gss at pub.open-bio.org Thu Sep 22 13:00:08 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:00:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221700.j8MH07RB018682@pub.open-bio.org> gss Thu Sep 22 13:00:07 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build In directory pub.open-bio.org:/tmp/cvs-serv18657/build Modified Files: .cvsignore Log Message: Don't put under CVS control the Javadoc that is generated by the core ant build script moby-live/S-MOBY/ref-impl/core/build .cvsignore,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/.cvsignore 2005/03/21 21:31:31 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/.cvsignore 2005/09/22 17:00:07 1.2 @@ -1 +1,2 @@ classes +javadoc From gss at pub.open-bio.org Thu Sep 22 13:01:24 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:01:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221701.j8MH1Ogg018725@pub.open-bio.org> gss Thu Sep 22 13:01:24 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build In directory pub.open-bio.org:/tmp/cvs-serv18700/build Modified Files: build.xml Log Message: Added Javadoc target & supporting classpath ref moby-live/S-MOBY/ref-impl/core/build build.xml,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/03/21 21:31:31 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/09/22 17:01:24 1.2 @@ -17,17 +17,22 @@ + + + + + + + + + + - - - - - - + @@ -38,6 +43,15 @@ filesonly="true"/> + + + + + + + + From gss at pub.open-bio.org Thu Sep 22 12:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw1Bf018121@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/http Removed Files: package-tree.html HTTPException.html package-frame.html HTTPResponse.html HTTPRequest.html package-summary.html package-use.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http package-tree.html,1.2,NONE HTTPException.html,1.2,NONE package-frame.html,1.2,NONE HTTPResponse.html,1.2,NONE HTTPRequest.html,1.2,NONE package-summary.html,1.2,NONE package-use.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/HTTPException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/HTTPResponse.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/HTTPRequest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/package-use.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw1uw018205@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/parser/test Removed Files: package-use.html package-frame.html Test.html package-tree.html ParserTest.html package-summary.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test package-use.html,1.2,NONE package-frame.html,1.2,NONE Test.html,1.2,NONE package-tree.html,1.2,NONE ParserTest.html,1.2,NONE package-summary.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/Test.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/ParserTest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/package-summary.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw29e018275@pub.open-bio.org> gss Thu Sep 22 12:58:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use Removed Files: ParamReader.html AbstractMobyServlet.html ParameterException.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use ParamReader.html,1.1,NONE AbstractMobyServlet.html,1.1,NONE ParameterException.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use/RCS/ParamReader.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use/RCS/AbstractMobyServlet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use/RCS/ParameterException.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw4W2018359@pub.open-bio.org> gss Thu Sep 22 12:58:04 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/parser/test/class-use Removed Files: Test.html ParserTest.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/class-use Test.html,1.1,NONE ParserTest.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/class-use/RCS/Test.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/class-use/RCS/ParserTest.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw2oT018300@pub.open-bio.org> gss Thu Sep 22 12:58:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/tools Removed Files: package-use.html Util.html package-summary.html package-frame.html ModelRetriever.html package-tree.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools package-use.html,1.1,NONE Util.html,1.1,NONE package-summary.html,1.1,NONE package-frame.html,1.1,NONE ModelRetriever.html,1.1,NONE package-tree.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/Util.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/ModelRetriever.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/package-tree.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw21O018319@pub.open-bio.org> gss Thu Sep 22 12:58:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/tools/class-use Removed Files: ModelRetriever.html Util.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/class-use ModelRetriever.html,1.1,NONE Util.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/class-use/RCS/ModelRetriever.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/class-use/RCS/Util.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw2rI018342@pub.open-bio.org> gss Thu Sep 22 12:58:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/tools Removed Files: package-use.html package-frame.html ModelRetriever.html Util.html package-summary.html package-tree.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools package-use.html,1.2,NONE package-frame.html,1.2,NONE ModelRetriever.html,1.1,NONE Util.html,1.2,NONE package-summary.html,1.2,NONE package-tree.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/ModelRetriever.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/Util.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/package-tree.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5ab018376@pub.open-bio.org> gss Thu Sep 22 12:58:04 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/parser/test/class-use Removed Files: ParserTest.html Test.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/class-use ParserTest.html,1.2,NONE Test.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/class-use/RCS/ParserTest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/class-use/RCS/Test.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw56g018443@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/http/class-use Removed Files: HTTPResponse.html HTTPException.html HTTPRequest.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/class-use HTTPResponse.html,1.2,NONE HTTPException.html,1.2,NONE HTTPRequest.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/class-use/RCS/HTTPResponse.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/class-use/RCS/HTTPException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/class-use/RCS/HTTPRequest.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5HV018474@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/servlet Removed Files: AbstractMobyServlet.html package-summary.html package-tree.html ParameterException.html ParamReader.html package-frame.html package-use.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet AbstractMobyServlet.html,1.1,NONE package-summary.html,1.1,NONE package-tree.html,1.1,NONE ParameterException.html,1.1,NONE ParamReader.html,1.1,NONE package-frame.html,1.1,NONE package-use.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/AbstractMobyServlet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/ParameterException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/ParamReader.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/package-use.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:06 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw6QF018534@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/vocabulary/class-use Removed Files: VocabularyDescription.html MOBY.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/class-use VocabularyDescription.html,1.2,NONE MOBY.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/class-use/RCS/VocabularyDescription.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/class-use/RCS/MOBY.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:06 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw6Qc018554@pub.open-bio.org> gss Thu Sep 22 12:58:06 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/tools/class-use Removed Files: ModelRetriever.html Util.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/class-use ModelRetriever.html,1.1,NONE Util.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/class-use/RCS/ModelRetriever.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/class-use/RCS/Util.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:06 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw6gV018592@pub.open-bio.org> gss Thu Sep 22 12:58:06 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/test/class-use Removed Files: Test.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/class-use Test.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/class-use/RCS/Test.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 12:58:06 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw66B018610@pub.open-bio.org> gss Thu Sep 22 12:58:06 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/resources In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/resources Removed Files: inherit.gif Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/resources inherit.gif,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/resources/RCS/inherit.gif,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 13:36:48 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:36:48 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221736.j8MHamZt018858@pub.open-bio.org> gss Thu Sep 22 13:36:48 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools In directory pub.open-bio.org:/tmp/cvs-serv18834/archive/WebRoot/tools Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools added to the repository moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 13:36:50 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:36:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221736.j8MHaoeN018893@pub.open-bio.org> gss Thu Sep 22 13:36:50 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save In directory pub.open-bio.org:/tmp/cvs-serv18871/WebRoot/save Removed Files: index.html Log Message: Moved potentially useful stuff that isn't needed now to the archive directory moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save index.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save/RCS/index.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 13:36:50 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:36:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221736.j8MHaoG5018908@pub.open-bio.org> gss Thu Sep 22 13:36:50 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools In directory pub.open-bio.org:/tmp/cvs-serv18871/archive/WebRoot/tools Added Files: client.html index.html Log Message: Moved potentially useful stuff that isn't needed now to the archive directory moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools client.html,NONE,1.1 index.html,NONE,1.1 From gss at pub.open-bio.org Thu Sep 22 13:37:11 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:37:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221737.j8MHbBVH018960@pub.open-bio.org> gss Thu Sep 22 13:37:11 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build In directory pub.open-bio.org:/tmp/cvs-serv18935/build Modified Files: build.xml Log Message: Misc fixes moby-live/S-MOBY/ref-impl/semanticmoby.org/build build.xml,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/09/21 23:08:04 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/09/22 17:37:11 1.3 @@ -55,8 +55,23 @@ + + + + + The file smoby.properties is missing from the WebRoot/WEB-INF + directory. The file smoby.example.properties should be copied + to smoby.properties, which should then be modified to include + appropriate values for database connections, etc. + + + - + - + - + + + + + @@ -86,9 +105,10 @@ - + + From gss at pub.open-bio.org Thu Sep 22 13:37:19 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:37:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221737.j8MHbJti018990@pub.open-bio.org> gss Thu Sep 22 13:37:19 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build In directory pub.open-bio.org:/tmp/cvs-serv18965/build Modified Files: build.xml Log Message: Misc fixes moby-live/S-MOBY/ref-impl/core/build build.xml,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/09/22 17:01:24 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/09/22 17:37:19 1.3 @@ -54,7 +54,8 @@ - + + From gss at pub.open-bio.org Thu Sep 22 13:36:50 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:36:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221736.j8MHaoEr018925@pub.open-bio.org> gss Thu Sep 22 13:36:50 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save/tools In directory pub.open-bio.org:/tmp/cvs-serv18871/WebRoot/save/tools Removed Files: client.html Log Message: Moved potentially useful stuff that isn't needed now to the archive directory moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save/tools client.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save/tools/RCS/client.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 13:44:13 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:44:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221744.j8MHiDnd019075@pub.open-bio.org> gss Thu Sep 22 13:44:13 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl In directory pub.open-bio.org:/tmp/cvs-serv19048/S-MOBY/ref-impl Removed Files: .cvsignore INSTALL.html build.xml common.example.properties common.xml servlet.xml Log Message: Removed some files that are no longer needed moby-live/S-MOBY/ref-impl .cvsignore,1.1,NONE INSTALL.html,1.2,NONE build.xml,1.2,NONE common.example.properties,1.1,NONE common.xml,1.2,NONE servlet.xml,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/.cvsignore,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/INSTALL.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/build.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/common.example.properties,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/common.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/servlet.xml,v: No such file or directory From senger at pub.open-bio.org Sat Sep 24 13:41:16 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:41:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241741.j8OHfGD8030416@pub.open-bio.org> senger Sat Sep 24 13:41:16 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv30397 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.6,1.7 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 13:02:35 1.6 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/24 17:41:16 1.7 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Sat Sep 24 13:51:51 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:51:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpplv030732@pub.open-bio.org> senger Sat Sep 24 13:51:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv30711/docs Modified Files: ChangeLog Log Message: moby-live/Java/docs ChangeLog,1.43,1.44 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/22 16:07:08 1.43 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/24 17:51:51 1.44 @@ -1,3 +1,8 @@ +2005-09-24 Martin Senger + + * Added sorting to the most of the returned results from + CentralImpl. + 2005-09-23 Martin Senger * Add a new method getFullNamespaces() to CentralDigest interface. From senger at pub.open-bio.org Sat Sep 24 13:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:51:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpqxq030843@pub.open-bio.org> senger Sat Sep 24 13:51:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv30711/src/main/org/biomoby/service/dashboard/images Added Files: resetButton.gif viewerButton.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images resetButton.gif,NONE,1.1 viewerButton.gif,NONE,1.1 From senger at pub.open-bio.org Sat Sep 24 13:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:51:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpqoF030888@pub.open-bio.org> senger Sat Sep 24 13:51:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv30711/src/main/org/biomoby/shared Modified Files: MobyDataType.java Log Message: moby-live/Java/src/main/org/biomoby/shared MobyDataType.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/09/22 16:07:09 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/09/24 17:51:52 1.9 @@ -24,7 +24,14 @@ * @version $Id$ */ -public class MobyDataType { +public class MobyDataType implements Comparable { + + public int compareTo (Object obj) { + return name.compareToIgnoreCase ( ((MobyDataType)obj).getName() ); + } + public boolean equals (Object obj) { + return name.equals ( ((MobyDataType)obj).getName() ); + } protected String name; protected String authority = ""; From senger at pub.open-bio.org Sat Sep 24 13:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:51:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpqCb030910@pub.open-bio.org> senger Sat Sep 24 13:51:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/xmls In directory pub.open-bio.org:/tmp/cvs-serv30711/xmls Modified Files: libraries.xml Log Message: moby-live/Java/xmls libraries.xml,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/libraries.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/09/04 13:45:38 1.4 +++ /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/09/24 17:51:52 1.5 @@ -109,7 +109,7 @@ - + From senger at pub.open-bio.org Sat Sep 24 13:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:51:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpqYB030862@pub.open-bio.org> senger Sat Sep 24 13:51:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator In directory pub.open-bio.org:/tmp/cvs-serv30711/src/main/org/biomoby/service/generator Modified Files: DataTypesGenerator.java Log Message: moby-live/Java/src/main/org/biomoby/service/generator DataTypesGenerator.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/DataTypesGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/DataTypesGenerator.java 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/DataTypesGenerator.java 2005/09/24 17:51:52 1.2 @@ -437,7 +437,7 @@ * primary concern, that's why it does not throw any exception if * it fails). * - * Put an client-side-image map (HTML hyperlinks) into + * Put a client-side-image map (HTML hyperlinks) into * 'spaceForImageMap' (if you decide to create it). * * Return true if an image file was successfull created (so other @@ -496,7 +496,7 @@ /************************************************************************* * Return true if 'dataTypeName' is a Biomoby primitive type. *************************************************************************/ - protected static boolean isPrimitiveType (String dataTypeName) { + public static boolean isPrimitiveType (String dataTypeName) { return (dataTypeName.equals (MobyTags.MOBYSTRING) || dataTypeName.equals (MobyTags.MOBYINTEGER) || dataTypeName.equals (MobyTags.MOBYFLOAT) || From senger at pub.open-bio.org Sat Sep 24 13:54:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:54:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241754.j8OHsbpP031039@pub.open-bio.org> senger Sat Sep 24 13:54:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/lib In directory pub.open-bio.org:/tmp/cvs-serv31023/lib Removed Files: alltools2.jar Log Message: moby-live/Java/lib alltools2.jar,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Java/lib/RCS/alltools2.jar,v: No such file or directory From senger at pub.open-bio.org Sat Sep 24 13:54:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:54:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241754.j8OHsb6r031054@pub.open-bio.org> senger Sat Sep 24 13:54:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv31023/src/main/org/biomoby/service/dashboard Added Files: AbstractModel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard AbstractModel.java,NONE,1.1 From senger at pub.open-bio.org Sat Sep 24 13:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:51:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHppJ8030770@pub.open-bio.org> senger Sat Sep 24 13:51:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv30711/src/main/org/biomoby/client Modified Files: CentralDigestCachedImpl.java CentralImpl.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralDigestCachedImpl.java,1.7,1.8 CentralImpl.java,1.27,1.28 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/22 16:07:08 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/24 17:51:51 1.8 @@ -16,6 +16,8 @@ import java.util.Iterator; import java.util.Map; import java.util.Vector; +import java.util.Arrays; +import java.util.Comparator; import org.biomoby.shared.CentralAll; import org.biomoby.shared.MobyDataType; @@ -413,6 +415,7 @@ File[] list = dataTypesCache.listFiles(); if (list == null) throw new MobyException (MSG_CACHE_NOT_DIR (dataTypesCache)); + Arrays.sort (list, getFileComparator()); for (int i = 0; i < list.length; i++) { try { @@ -463,6 +466,7 @@ File[] list = servicesCache.listFiles(); if (list == null) throw new MobyException (MSG_CACHE_NOT_DIR (servicesCache)); + Arrays.sort (list, getFileComparator()); for (int i = 0; i < list.length; i++) { try { if (ignored (list[i])) continue; @@ -550,6 +554,17 @@ } /************************************************************************** + * Return a comparator for Files that compares in case-insensitive way. + *************************************************************************/ + protected static Comparator getFileComparator() { + return new Comparator() { + public int compare (Object o1, Object o2) { + return o1.toString().compareToIgnoreCase (o2.toString()); + } + }; + } + + /************************************************************************** * Some file (when being read from a cache directory) are ignored. *************************************************************************/ protected static boolean ignored (File file) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/22 16:07:09 1.27 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/24 17:51:51 1.28 @@ -49,6 +49,8 @@ import java.util.Map; import java.util.Properties; import java.util.Vector; +import java.util.TreeMap; +import java.util.Comparator; /** * A default implementation of the @@ -664,7 +666,7 @@ new Object[] {}); // parse returned XML - Map results = new HashMap(); + Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse(new ByteArrayInputStream(result.getBytes())); @@ -710,7 +712,7 @@ throws MobyException { // parse returned XML - Map results = new HashMap(); + Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse (new ByteArrayInputStream (result.getBytes())); @@ -810,7 +812,7 @@ throws MobyException { // parse returned XML - Map results = new HashMap(); + Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse(new ByteArrayInputStream(result.getBytes()));} @@ -862,7 +864,7 @@ throws MobyException { // parse returned XML - Map results = new HashMap(); + Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse(new ByteArrayInputStream(result.getBytes())); @@ -924,7 +926,7 @@ throws MobyException { // parse returned XML - Map results = new HashMap(); + Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse(new ByteArrayInputStream(result.getBytes())); @@ -944,7 +946,6 @@ } } } - return results; } @@ -1711,4 +1712,16 @@ } throw new MobyException ("No resource found for '" + resourceName + "'."); } + + /************************************************************************** + * Return a case-insensitive comparator of Strings. It is used to + * create various TreeMaps where keys are strings. + *************************************************************************/ + protected static Comparator getStringComparator() { + return new Comparator() { + public int compare (Object o1, Object o2) { + return ((String)o1).compareToIgnoreCase ((String)o2); + } + }; + } } From senger at pub.open-bio.org Sat Sep 24 13:57:06 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:57:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241757.j8OHv6ue031183@pub.open-bio.org> senger Sat Sep 24 13:57:06 EDT 2005 Update of /home/repository/moby/moby-live/Java/xmls In directory pub.open-bio.org:/tmp/cvs-serv31163/xmls Modified Files: libraries.xml Log Message: moby-live/Java/xmls libraries.xml,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/libraries.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/09/24 17:51:52 1.5 +++ /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/09/24 17:57:06 1.6 @@ -109,7 +109,7 @@ - + From senger at pub.open-bio.org Sat Sep 24 13:51:51 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:51:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHppc6030747@pub.open-bio.org> senger Sat Sep 24 13:51:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/lib In directory pub.open-bio.org:/tmp/cvs-serv30711/lib Added Files: alltools2.jar Log Message: moby-live/Java/lib alltools2.jar,NONE,1.1 From senger at pub.open-bio.org Sun Sep 25 05:07:22 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 25 Sep 2005 05:07:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509250907.j8P97M6n011318@pub.open-bio.org> senger Sun Sep 25 05:07:22 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv11299 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.37,1.38 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/22 09:47:43 1.37 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/25 09:07:22 1.38 @@ -112,9 +112,11 @@ + @@ -690,6 +692,7 @@ Targets for local deployment are: deploy-services tomcat-populate + -populate deploy-wsdd -find-services create-wsdd @@ -697,7 +700,7 @@ undeploy-services (TBD: does not work) Targets for remote deployment are: - TBD + deploy-remote --> @@ -922,8 +925,8 @@ - + @@ -994,7 +997,7 @@ - + @@ -1293,7 +1296,7 @@ - + @@ -1350,7 +1353,7 @@ - + From senger at pub.open-bio.org Sun Sep 25 05:07:23 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 25 Sep 2005 05:07:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509250907.j8P97NLY011365@pub.open-bio.org> senger Sun Sep 25 05:07:22 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv11299/src/webapps Modified Files: remote.deploy.build.xml.template Log Message: moby-live/Java/src/webapps remote.deploy.build.xml.template,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/webapps/remote.deploy.build.xml.template,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/webapps/remote.deploy.build.xml.template 2005/09/22 07:55:44 1.1 +++ /home/repository/moby/moby-live/Java/src/webapps/remote.deploy.build.xml.template 2005/09/25 09:07:22 1.2 @@ -23,6 +23,7 @@ + @@ -183,7 +184,7 @@ - + From senger at pub.open-bio.org Sun Sep 25 05:07:22 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 25 Sep 2005 05:07:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509250907.j8P97MGQ011345@pub.open-bio.org> senger Sun Sep 25 05:07:22 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv11299/src/main/org/biomoby/service/dashboard Modified Files: NOTES RegistryModel.java RegistryPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard NOTES,1.6,1.7 RegistryModel.java,1.2,1.3 RegistryPanel.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/24 17:51:51 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/25 09:07:22 1.7 @@ -105,6 +105,24 @@ * general Console panel (save button; various renderes?) * graphics to trees +--- +To put this somewhere (a small "Memory panel" that can be add +anywhere in time of debugging...): + +The heap is the area in memory in which objects are created. + + // Get current size of heap in bytes + long heapSize = Runtime.getRuntime().totalMemory(); + + // Get maximum size of heap in bytes. The heap cannot grow beyond this size. + // Any attempt will result in an OutOfMemoryException. + long heapMaxSize = Runtime.getRuntime().maxMemory(); + + // Get amount of free memory within the heap in bytes. This size will increase + // after garbage collection and decrease as new objects are created. + long heapFreeSize = Runtime.getRuntime().freeMemory(); + +--- TODO generally: --------------- =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/09/24 17:51:51 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/09/25 09:07:22 1.3 @@ -19,6 +19,7 @@ import java.util.HashSet; import java.util.Hashtable; +import java.util.Comparator; import java.util.regex.Pattern; /** @@ -61,6 +62,30 @@ initWorker(); MobyDataType[] dataTypes = worker.getDataTypes(); + java.util.Arrays.sort (dataTypes); + return dataTypes; + } + + /********************************************************************* + * + ********************************************************************/ + public MobyDataType[] getDataTypesByAuthority() + throws MobyException { + + if (worker == null) + initWorker(); + + MobyDataType[] dataTypes = worker.getDataTypes(); + java.util.Arrays.sort + (dataTypes, + new Comparator() { + public int compare (Object o1, Object o2) { + String a1 = ((MobyDataType)o1).getAuthority(); + String a2 = ((MobyDataType)o2).getAuthority(); + return (a1).compareToIgnoreCase ((String)a2); + } + }); + return dataTypes; } @@ -102,21 +127,6 @@ return found; } - -// /********************************************************************* -// * -// ********************************************************************/ -// public MobyDataType[] getDataTypesByAuthority() -// throws MobyException { - -// if (worker == null) -// initWorker(); - -// MobyDataType[] dataTypes = worker.getDataTypes(); -// java.util.Arrays.sort (dataTypes); -// return dataTypes; -// } - /********************************************************************* * ********************************************************************/ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/24 17:51:51 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/25 09:07:22 1.8 @@ -301,35 +301,6 @@ /************************************************************************** * **************************************************************************/ -// protected JPanel getConsole() { -// JPanel p = new JPanel (new GridBagLayout()); - -// JTextArea textArea = new JTextArea(); -// textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); -// textArea.setEditable (false); -// JScrollPane scroller = new JScrollPane (textArea); - -// JButton cleanButton = -// createButton (" Clean ", -// "Remove all messages from the console area", -// KeyEvent.VK_C, -// new ActionListener() { -// public void actionPerformed (ActionEvent e) { -// if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) -// textArea.setText (""); -// } -// }); - -// // put it together -// SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); -// // SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); - -// return p; -// } - - /************************************************************************** - * - **************************************************************************/ class ServicesTree extends CommonTree { public ServicesTree() { super ("Services"); @@ -398,7 +369,10 @@ final SwingWorker worker = new SwingWorker() { public Object construct() { try { - dataTypes = registryModel.getDataTypesByNames(); + if (sorted == SORTED_BY_AUTHORITY) + dataTypes = registryModel.getDataTypesByAuthority(); + else + dataTypes = registryModel.getDataTypesByNames(); } catch (MobyException e) { // TBD: what to do here? System.err.println ("ERROR: " + e.getMessage()); From gss at pub.open-bio.org Sun Sep 25 15:17:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun, 25 Sep 2005 15:17:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251917.j8PJH0dx013037@pub.open-bio.org> gss Sun Sep 25 15:17:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build In directory pub.open-bio.org:/tmp/cvs-serv13012/build Modified Files: build.xml Log Message: Make sure WEB-INF/lib/*.jar gets added to war file moby-live/S-MOBY/ref-impl/semanticmoby.org/build build.xml,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/09/22 17:37:11 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/09/25 19:17:00 1.4 @@ -86,6 +86,11 @@ + + + + + From gss at pub.open-bio.org Sun Sep 25 15:17:29 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun, 25 Sep 2005 15:17:29 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251917.j8PJHTF7013072@pub.open-bio.org> gss Sun Sep 25 15:17:28 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello In directory pub.open-bio.org:/tmp/cvs-serv13043/WebRoot/examples/hello Modified Files: hello-world.rdf hello-world.n3 Log Message: Changed references to MOBYProvider to MOBYService moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello hello-world.rdf,1.3,1.4 hello-world.n3,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.rdf,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.rdf 2004/11/04 22:28:02 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.rdf 2005/09/25 19:17:28 1.4 @@ -6,24 +6,24 @@ xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > + + + + - - http://www.semanticmoby.org/examples/display-hello-world-results + - Simple example of a Semantic MOBY provider - Semantic MOBY Hello World provider + Simple example of a Semantic MOBY provider + http://www.semanticmoby.org/examples/display-hello-world-results + - - - - - + - + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.n3,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.n3 2004/11/04 22:28:02 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.n3 2005/09/25 19:17:28 1.4 @@ -7,7 +7,7 @@ @prefix xsd: . ex:hello-world - a moby:Provider, exterms:GreetingProvider ; + a moby:Service, exterms:GreetingProvider ; moby:name "Semantic MOBY Hello World provider" ; moby:oneLineDescription "Simple example of a Semantic MOBY provider" ; moby:outputURI "http://www.semanticmoby.org/examples/display-hello-world-results" ; From gss at pub.open-bio.org Sun Sep 25 15:17:58 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun, 25 Sep 2005 15:17:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251917.j8PJHwma013162@pub.open-bio.org> gss Sun Sep 25 15:17:58 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies In directory pub.open-bio.org:/tmp/cvs-serv13077/WebRoot/examples/proxies Modified Files: wormbase-query tair-seqviewer flybase-genequery ncbi-megablast.n3 gramene-query.n3 sgd-quicksearch.n3 tair-seqviewer.n3 tair-mapviewer tair-mapviewer.n3 pubmed ncbi-megablast sgd-quicksearch pubmed.n3 gramene-query wormbase-query.n3 flybase-genequery.n3 Log Message: Changed references to MOBYProvider to MOBYService moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies wormbase-query,1.2,1.3 tair-seqviewer,1.3,1.4 flybase-genequery,1.2,1.3 ncbi-megablast.n3,1.2,1.3 gramene-query.n3,1.2,1.3 sgd-quicksearch.n3,1.3,1.4 tair-seqviewer.n3,1.3,1.4 tair-mapviewer,1.2,1.3 tair-mapviewer.n3,1.2,1.3 pubmed,1.2,1.3 ncbi-megablast,1.2,1.3 sgd-quicksearch,1.3,1.4 pubmed.n3,1.2,1.3 gramene-query,1.2,1.3 wormbase-query.n3,1.2,1.3 flybase-genequery.n3,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query 2005/09/25 19:17:58 1.3 @@ -10,20 +10,20 @@ - - - C. elegans database query at wormbase.org - http://www.wormbase.org/ - - - WormBase Query - + + - - + + + + + WormBase Query + C. elegans database query at wormbase.org + http://www.wormbase.org/ + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer 2005/05/05 17:35:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer 2005/09/25 19:17:58 1.4 @@ -9,21 +9,21 @@ + + + + - + + + TAIR Sequence Viewer Arabidopsis Sequence Viewer service provided by TAIR - - - http://www.arabidopsis.org/servlets/sv - - - - + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > - + =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast.n3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast.n3 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast.n3 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ @prefix xsd: . ex:ncbi-megablast - a moby:Provider, exterms:ProxyProvider, exterms:BlastProvider ; + a moby:Service, exterms:ProxyProvider, exterms:BlastProvider ; moby:name "NCBI Mega BLAST" ; moby:oneLineDescription "NCBI MegaBlast service provided by NCBI" ; moby:inputURI "http://www.ncbi.nlm.nih.gov/BLAST/Blast.cgi?CMD=Web&LAYOUT=TwoWindows&AUTO_FORMAT=Semiauto&ALIGNMENTS=50&ALIGNMENT_VIEW=Tabular&CLIENT=web&DATABASE=nr&DESCRIPTIONS=100&ENTREZ_QUERY=%28none%29&EXPECT=10&FILTER=L&FORMAT_OBJECT=Alignment&FORMAT_TYPE=HTML&NCBI_GI=on&PAGE=MegaBlast&SERVICE=plain&SET_DEFAULTS.x=34&SET_DEFAULTS.y=8&SHOW_OVERVIEW=on&END_OF_HTTPGET=Yes&SHOW_LINKOUT=yes&GET_SEQUENCE=yes&PERC_IDENT=None,1,-2" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query.n3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query.n3 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query.n3 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ @prefix xsd: . ex:gramene-query - a moby:Provider, exterms:ProxyProvider, exterms:CerealGrainSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:CerealGrainSearchProvider ; moby:name "Gramene Query" ; moby:oneLineDescription "Cereal grains database query at gramene.org" ; moby:inputURI "http://www.gramene.org/" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch.n3,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch.n3 2005/05/05 17:35:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch.n3 2005/09/25 19:17:58 1.4 @@ -7,7 +7,7 @@ @prefix xsd: . ex:sgd-quicksearch - a moby:Provider, exterms:ProxyProvider, exterms:SacchromycesSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:SacchromycesSearchProvider ; moby:name "SGD Quick Search" ; moby:oneLineDescription "Saccharomyces cerevisiae quick search" ; moby:inputURI "http://db.yeastgenome.org/cgi-bin/search/quickSearch" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer.n3,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer.n3 2005/05/05 17:35:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer.n3 2005/09/25 19:17:58 1.4 @@ -7,7 +7,7 @@ @prefix xsd: . ex:tair-seqviewer - a moby:Provider, exterms:ProxyProvider, exterms:ArabidopsisSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:ArabidopsisSearchProvider ; moby:name "TAIR Sequence Viewer" ; moby:oneLineDescription "Arabidopsis Sequence Viewer service provided by TAIR" ; moby:inputURI "http://www.arabidopsis.org/servlets/sv" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer 2005/09/25 19:17:58 1.3 @@ -7,22 +7,22 @@ xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > - http://www.arabidopsis.org/servlets/mapper - + + + TAIR Map Viewer Arabidopsis Map Viewer service provided by TAIR + http://www.arabidopsis.org/servlets/mapper - - + + + + - - - - =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer.n3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer.n3 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer.n3 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ @prefix xsd: . ex:tair-mapviewer - a moby:Provider, exterms:ProxyProvider, exterms:ArabidopsisSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:ArabidopsisSearchProvider ; moby:name "TAIR Map Viewer" ; moby:oneLineDescription "Arabidopsis Map Viewer service provided by TAIR" ; moby:inputURI "http://www.arabidopsis.org/servlets/mapper" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed 2005/09/25 19:17:58 1.3 @@ -7,23 +7,23 @@ xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > - + - + - http://www.ncbi.nlm.nih.gov/entrez/query.fcgi? - - Entrez PubMed service provided by NCBI - PubMed + PubMed + Entrez PubMed service provided by NCBI + http://www.ncbi.nlm.nih.gov/entrez/query.fcgi? + - + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast 2005/09/25 19:17:58 1.3 @@ -21,7 +21,7 @@ NCBI Mega BLAST http://www.ncbi.nlm.nih.gov/BLAST/Blast.cgi?CMD=Web&LAYOUT=TwoWindows&AUTO_FORMAT=Semiauto&ALIGNMENTS=50&ALIGNMENT_VIEW=Tabular&CLIENT=web&DATABASE=nr&DESCRIPTIONS=100&ENTREZ_QUERY=%28none%29&EXPECT=10&FILTER=L&FORMAT_OBJECT=Alignment&FORMAT_TYPE=HTML&NCBI_GI=on&PAGE=MegaBlast&SERVICE=plain&SET_DEFAULTS.x=34&SET_DEFAULTS.y=8&SHOW_OVERVIEW=on&END_OF_HTTPGET=Yes&SHOW_LINKOUT=yes&GET_SEQUENCE=yes&PERC_IDENT=None,1,-2 - + NCBI MegaBlast service provided by NCBI =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch 2005/05/05 17:35:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch 2005/09/25 19:17:58 1.4 @@ -7,25 +7,25 @@ xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > - + - - SGD Quick Search - - - http://db.yeastgenome.org/cgi-bin/search/quickSearch - Saccharomyces cerevisiae quick search - - + + + - - - + + + + + SGD Quick Search + Saccharomyces cerevisiae quick search + http://db.yeastgenome.org/cgi-bin/search/quickSearch + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed.n3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed.n3 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed.n3 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ @prefix xsd: . ex:pubmed - a moby:Provider, exterms:ProxyProvider, exterms:PubSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:PubSearchProvider ; moby:name "PubMed" ; moby:oneLineDescription "Entrez PubMed service provided by NCBI" ; moby:inputURI "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query 2005/09/25 19:17:58 1.3 @@ -15,7 +15,7 @@ Gramene Query - + http://www.gramene.org/ =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query.n3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query.n3 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query.n3 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ @prefix xsd: . ex:wormbase-query - a moby:Provider, exterms:ProxyProvider, exterms:ElegansSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:ElegansSearchProvider ; moby:name "WormBase Query" ; moby:oneLineDescription "C. elegans database query at wormbase.org" ; moby:inputURI "http://www.wormbase.org/" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery.n3,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery.n3 2005/05/05 17:30:46 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery.n3 2005/09/25 19:17:58 1.4 @@ -7,7 +7,7 @@ @prefix xsd: . ex:flybase-genequery - a moby:Provider, exterms:ProxyProvider, exterms:DrosophilaSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:DrosophilaSearchProvider ; moby:name "FlyBase Gene Query" ; moby:oneLineDescription "FlyBase gene query form at flybase.bio.indiana.edu" ; moby:inputURI "http://flybase.bio.indiana.edu/genes/fbgquery.hform" ; From gss at pub.open-bio.org Sun Sep 25 15:39:51 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun, 25 Sep 2005 15:39:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251939.j8PJdpEe013293@pub.open-bio.org> gss Sun Sep 25 15:39:51 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib In directory pub.open-bio.org:/tmp/cvs-serv13269/lib Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib added to the repository moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Sun Sep 25 15:40:43 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun, 25 Sep 2005 15:40:43 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251940.j8PJehVx013393@pub.open-bio.org> gss Sun Sep 25 15:40:43 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF In directory pub.open-bio.org:/tmp/cvs-serv13368/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF Modified Files: .cvsignore Log Message: Don't exclude lib moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF .cvsignore,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore 2005/09/22 17:04:15 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore 2005/09/25 19:40:43 1.4 @@ -1,3 +1,2 @@ -classes smoby.properties -lib +classes From gss at pub.open-bio.org Sun Sep 25 15:41:39 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun, 25 Sep 2005 15:41:39 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251941.j8PJfdWf013422@pub.open-bio.org> gss Sun Sep 25 15:41:39 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib In directory pub.open-bio.org:/tmp/cvs-serv13401/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib Added Files: postgresql-8.0.309.jdbc3.jar Log Message: Added PostgreSQL lib moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib postgresql-8.0.309.jdbc3.jar,NONE,1.1 From senger at pub.open-bio.org Sat Sep 24 13:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:51:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpqJI030828@pub.open-bio.org> senger Sat Sep 24 13:51:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv30711/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java CommonTree.java ConsolePanel.java Dashboard.java DashboardPanel.java DashboardProperties.java EventGeneratorPanel.java NOTES RegistryModel.java RegistryPanel.java Added Files: CommonConsole.java CommonNode.java PropertyChannel.java SwingWorker.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard CommonConsole.java,NONE,1.1 CommonNode.java,NONE,1.1 PropertyChannel.java,NONE,1.1 SwingWorker.java,NONE,1.1 AbstractPanel.java,1.5,1.6 CommonTree.java,1.1,1.2 ConsolePanel.java,1.3,1.4 Dashboard.java,1.3,1.4 DashboardPanel.java,1.3,1.4 DashboardProperties.java,1.2,1.3 EventGeneratorPanel.java,1.2,1.3 NOTES,1.5,1.6 RegistryModel.java,1.1,1.2 RegistryPanel.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/18 14:09:42 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/24 17:51:51 1.6 @@ -20,6 +20,7 @@ import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JTextField; +import javax.swing.JComboBox; import javax.swing.JFileChooser; import javax.swing.AbstractButton; import javax.swing.BorderFactory; @@ -49,6 +50,7 @@ import java.io.File; import java.util.prefs.Preferences; +import java.util.Map; /** * WORK IN PROGRESS.

        @@ -81,11 +83,13 @@ // something need to be done only once - keep it here protected Icon panelIcon; protected JComponent pComponent; - protected Icon confirmIcon; + protected static Icon confirmIcon; // re-use "style" components protected static final Insets BREATH_TOP = new Insets (10,0,0,0); + // + protected PropertyChannel propertyChannel; /********************************************************************* * Default constructor (just for the sub-classes). @@ -139,6 +143,14 @@ public void propertyChange (PropertyChangeEvent event) { } + /************************************************************************** + * Remember a property channel and register itself to it as a listener. + **************************************************************************/ + protected void setPropertyChannel (PropertyChannel propertyChannel) { + this.propertyChannel = propertyChannel; + propertyChannel.addPropertyChangeListener (this); + } + // // Abstract methods // @@ -146,7 +158,7 @@ /************************************************************************** * **************************************************************************/ - abstract public JComponent getComponent(); + abstract public JComponent getComponent (PropertyChannel propertyChannel); /************************************************************************** * @@ -228,23 +240,16 @@ /********************************************************************* * Create a panel with given text field and with a directory/file * browser button attached. - * - * @param chooserMode should be one of - * JFileChooser.DIRECTORIES_ONLY, JFileChooser.FILES_ONLY, and - * JFileChooser.FILES_AND_DIRECTORIES (but it is not tested) ********************************************************************/ protected JFileChooserWithHistory createFileSelector (String chooserTitle, String approveButtonText, - int chooserMode, String defaultValue, - FileFilter filter) { + String preferenceNode, + String eventName) { JFileChooserWithHistory chooser = - new JFileChooserWithHistory (null, this, "cacheDirectory"); + new JFileChooserWithHistory (null, this, preferenceNode); JFileChooser ch = chooser.getFileChooser(); - ch.setFileSelectionMode (chooserMode); - if (filter != null) - ch.setFileFilter (filter); ch.setApproveButtonText (approveButtonText); ch.setDialogTitle (chooserTitle); @@ -252,10 +257,57 @@ chooser.getSelectedFile() == null) chooser.setSelectedFile (new File (defaultValue)); + if (eventName != null) { + JTextFieldWithHistory textField = chooser.getTextField(); + textField.addActionListener (getTextFieldListener (eventName)); + String text = textField.getText(); + if (UUtils.notEmpty (text)) + propertyChannel.put (eventName, text); + } + return chooser; } /********************************************************************* + * Create a text field (possibly with an 'initValue' with history + * taken from given 'preferenceNode'. If 'evenName' is not null + * (which means that the contens of this text filed may be of + * interest of someone outside), add an action event that will + * update the shared property storage (a global variable + * 'propertyChannel') when the text field changes its value. + ********************************************************************/ + protected JTextFieldWithHistory createText (String initValue, + String preferenceNode, + String eventName) { + JTextFieldWithHistory textField = + new JTextFieldWithHistory (initValue, + this, + preferenceNode); + if (eventName != null) { + textField.addActionListener (getTextFieldListener (eventName)); + String text = textField.getText(); + if (UUtils.notEmpty (text)) + propertyChannel.put (eventName, text); + } + + return textField; + } + + /********************************************************************* + * + ********************************************************************/ + private ActionListener getTextFieldListener (String eventName) { + final String name = eventName; + return new ActionListener() { + public void actionPerformed (ActionEvent e) { + String contents = ((JTextFieldWithHistory)e.getSource()).getText(); + propertyChannel.put (name, contents); + } + }; + } + + + /********************************************************************* * ********************************************************************/ protected boolean getPrefValue (String key, @@ -276,11 +328,11 @@ /********************************************************************* * Return true if confirmation dialog passed. ********************************************************************/ - public boolean confirm (Object msg) { + public static boolean confirm (Object msg) { if (confirmIcon == null) confirmIcon = SwingUtils.createIcon ("images/confirmButton.gif", Dashboard.class); - return SwingUtils.confirm (this, msg, confirmIcon); + return SwingUtils.confirm (null, msg, confirmIcon); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/09/18 08:46:26 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/09/24 17:51:51 1.2 @@ -8,20 +8,35 @@ package org.biomoby.service.dashboard; +import org.tulsoft.shared.UUtils; +import org.tulsoft.tools.gui.SwingUtils; + import javax.swing.JTree; import javax.swing.JLabel; import javax.swing.JScrollPane; import javax.swing.Icon; +import javax.swing.JPopupMenu; +import javax.swing.JOptionPane; +import javax.swing.JMenuItem; +import javax.swing.ToolTipManager; +import javax.swing.AbstractAction; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreeSelectionModel; import javax.swing.tree.TreePath; +import javax.swing.event.TreeSelectionListener; +import javax.swing.event.TreeSelectionEvent; import java.awt.Component; import java.awt.Font; +import java.awt.event.ActionEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; + +import java.util.HashSet; +import java.util.Enumeration; // import java.beans.PropertyChangeListener; // import java.beans.PropertyChangeEvent; @@ -40,6 +55,15 @@ public class CommonTree extends JTree { + // some shared constants + final static protected int SORTED_BY_NAME = 0; + final static protected int SORTED_BY_AUTHORITY = 1; + + // tree components + protected JPopupMenu popup; + protected Icon searchIcon; + protected String lastSearchText = ""; + // protected PropertyChangeSupport support; // protected boolean expanded = true; // the status of the application list @@ -47,34 +71,48 @@ * Constructor ********************************************************************/ public CommonTree (String rootNode) { - super (new DefaultTreeModel (new DefaultMutableTreeNode (rootNode))); + super (new DefaultTreeModel (new DefaultMutableTreeNode (new CommonNode (rootNode)))); // create an almost empty tree, only with a root node that // contains just a String holding the name of the root node; - // the tree will be populated later by calling 'updateTree()' - setFont (new Font ("Dialog", Font.PLAIN, 10)); +// setFont (new Font ("Dialog", Font.PLAIN, 10)); putClientProperty ("JTree.lineStyle", "Angled"); setCellRenderer (new CommonTreeCellRenderer()); getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); - addMouseListener (new MouseAdapter() { - public void mouseClicked (MouseEvent e) { - TreePath selPath = getPathForLocation (e.getX(), e.getY()); - if (e.getClickCount() == 1) - onSelected (selPath); +// addMouseListener (new MouseAdapter() { +// public void mouseClicked (MouseEvent e) { +// TreePath selPath = getPathForLocation (e.getX(), e.getY()); +// if (e.getClickCount() == 1) +// onSelected (selPath); +// } +// }); + + // listen for when the selection changes + addTreeSelectionListener ( new TreeSelectionListener() { + public void valueChanged (TreeSelectionEvent e) { + DefaultMutableTreeNode node = + (DefaultMutableTreeNode)getLastSelectedPathComponent(); + if (node == null) return; + selected (node); } }); + + // enable tool tips + ToolTipManager.sharedInstance().registerComponent (this); } // - // I want to display the empty modules with the same icon as - // 'closed' tree branches - therefore I need my own cell renderer - // (also it is suitable for new leaf icon) - // class CommonTreeCellRenderer extends DefaultTreeCellRenderer { + HashSet toBeHighlighted; + + public void setToBeHighlighted (HashSet toBeHighlighted) { + this.toBeHighlighted = toBeHighlighted; + } + public Component getTreeCellRendererComponent (JTree tree, java.lang.Object value, boolean selected, @@ -88,40 +126,170 @@ // Component c = super.getTreeCellRendererComponent (tree, value, selected, expanded, leaf, row, hasFocus); + // add a tool-tip for the root node + if (row == 0) { + setToolTipText ("Right-click will show other options"); + setFont (new Font ("Dialog", Font.BOLD, 12)); + } else { + setToolTipText (null); + setFont (new Font ("Dialog", Font.PLAIN, 10)); + } + // TBD: whale icon? // if (leaf) // ((JLabel)c).setIcon (icons [COMPUTER]); + + // do highlight + Object userObject = ((DefaultMutableTreeNode)value).getUserObject(); + CommonNode nodeObject = (CommonNode)userObject; + if (toBeHighlighted != null && toBeHighlighted.contains (nodeObject.getValue())) + setText ("" + nodeObject + ""); + return c; } } + /********************************************************************* + * Put this tree in a scrollable pane. + ********************************************************************/ public JScrollPane scrollable() { return new JScrollPane (this); } /********************************************************************* - * onAppSelected() - * When an application name is selected it will fire a - * PropertyChange event with SELECTED_BY_NAME property. The value of - * the property will be an instance of Hashtable carrying: - * - module name as MODULE_NAME, - * - application name as APP_NAME, and - * - an this instance as ALBEAN_LIST - ********************************************************************/ - protected void onSelected (TreePath path) { -// if (path == null) return; -// DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent(); -// if (path.getPathCount() < 3) return; // we need to be on an application name -// String appName = (String)node.getUserObject(); -// DefaultMutableTreeNode parent = (DefaultMutableTreeNode)node.getParent(); -// String module = (String)parent.getUserObject(); -// Hashtable result = new Hashtable(); -// result.put (ALBeanListWithGUI.MODULE_NAME, module); -// result.put (ALBeanListWithGUI.APP_NAME, appName); -// result.put (ALBeanListWithGUI.ALBEAN_LIST, this); -// support.firePropertyChange (ALBeanListWithGUI.SELECTED_BY_NAME, null, result); + * Called when a tree node is selected. Does nothing here + ********************************************************************/ + protected void selected (DefaultMutableTreeNode node) { + } + + /********************************************************************* + * Create a popup object with common items. Subclasses can (and + * usually do) add more items, or re-created the whole popup.

        + * + * @param title is given to the popups + ********************************************************************/ + protected void createPopups (String title) { + popup = new JPopupMenu (title); + popup.add + (new JMenuItem (new AbstractAction ("Search") { + public void actionPerformed (ActionEvent e) { + String searchText = searchDialog(); + if (searchText != null) + search (searchText); + } + })); + popup.add + (new JMenuItem (new AbstractAction ("Expand all nodes") { + public void actionPerformed (ActionEvent e) { + expand(); + } + })); + popup.add + (new JMenuItem (new AbstractAction ("Collaps all nodes") { + public void actionPerformed (ActionEvent e) { + collapse(); + } + })); + + // add listener to this tree to bring up popup menus + MouseListener popupListener = new PopupListener(); + addMouseListener (popupListener); + } + + class PopupListener extends MouseAdapter { + public void mousePressed (MouseEvent e) { + maybeShowPopup (e); + } + public void mouseReleased (MouseEvent e) { + maybeShowPopup (e); + } + private void maybeShowPopup (MouseEvent e) { + if (e.isPopupTrigger() && popup.isEnabled()) { + popup.show (e.getComponent(), + e.getX(), e.getY()); + } + } + } + + /********************************************************************* + * Collapse all nodes, starting from the root.

        + ********************************************************************/ + protected void collapse() { + SwingUtils.collapseTree (this, (DefaultMutableTreeNode)getModel().getRoot()); + } + + /********************************************************************* + * Expand all nodes, starting from the root.

        + ********************************************************************/ + protected void expand() { +// SwingUtils.expandTree (this, (DefaultMutableTreeNode)getModel().getRoot()); + + + final SwingWorker worker = new SwingWorker() { + public Object construct() { + SwingUtils.expandTree (CommonTree.this, (DefaultMutableTreeNode)getModel().getRoot()); + return null; // not used here + } + // runs on the event-dispatching thread. + public void finished() { + repaint(); + } + }; + worker.start(); + + } + + /********************************************************************* + * Search underlying objects and highligh nodes corresponding to + * the found objects. But it does nothing here - it is supposed to + * be overwritten by a concrete tree. + ********************************************************************/ + protected void search (String searchText) { + System.out.println ("Search text: " + searchText); + } + + /********************************************************************* + * Show a dialog asking for a search string, and return it. Or + * return null if user cancel the dialog. + ********************************************************************/ + protected String searchDialog() { + if (searchIcon == null) + searchIcon = + SwingUtils.createIcon ("images/viewerButton.gif", Dashboard.class); + + String result = (String)JOptionPane.showInputDialog + (null, + "The search will highlight nodes in this tree that\n" + + "contain (or are related to) the text you enter here.\n" + + "Text is treated as a regular expression. The case-\n" + + "insensitivity is, however, always added by default.\n \n" + + "For example, try: germplasm or mark|kawas.\n \n", + "Search", + JOptionPane.OK_CANCEL_OPTION, + searchIcon, + null, + lastSearchText); + if (result != null) + lastSearchText = result; + return result; + } + + protected void highlightAndJumpTo (HashSet toBeHighlighted) { + + CommonTreeCellRenderer r = (CommonTreeCellRenderer)getCellRenderer(); + r.setToBeHighlighted (toBeHighlighted); + collapse (); + DefaultTreeModel tModel = (DefaultTreeModel)getModel(); + DefaultMutableTreeNode root = (DefaultMutableTreeNode)tModel.getRoot(); + Enumeration en = root.depthFirstEnumeration(); + while (en.hasMoreElements()) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode)en.nextElement(); + if (toBeHighlighted.contains (node.getUserObject().toString())) { + makeVisible (new TreePath (tModel.getPathToRoot (node))); + } + } } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/18 14:09:42 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/24 17:51:51 1.4 @@ -15,7 +15,7 @@ import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JScrollPane; -import javax.swing.JTextArea; +// import javax.swing.JTextArea; import javax.swing.JPanel; import javax.swing.text.html.HTMLDocument; @@ -28,6 +28,7 @@ import java.beans.PropertyChangeEvent; import java.util.Date; +import java.util.Map; /** * A debugging panel. It tries to listen to as many events it can, and @@ -42,13 +43,13 @@ public class ConsolePanel extends AbstractPanel { - JTextArea textArea = null; + CommonConsole console; /********************************************************************* * propertyChange() ********************************************************************/ public void propertyChange (PropertyChangeEvent e) { - if (textArea == null) return; // I am not yet ready + if (console == null) return; // I am not yet ready String prop = e.getPropertyName(); if (prop == null) return; // no interest in non-specific changes @@ -57,8 +58,7 @@ if (value == null) return; // no interest in non-defined new values if (prop.equalsIgnoreCase (DP_LOG_MSG)) { - textArea.append (value.toString()); - textArea.append ("\n"); + console.setText (value.toString() + "\n"); } else { StringBuffer buf = new StringBuffer(); Object source = e.getSource(); @@ -69,38 +69,43 @@ } buf.append (" at "); buf.append (new Date().toString()); - textArea.append ("PROPERTY: " + prop + buf + "\n"); - textArea.append ("VALUE: " + value.toString() + "\n\n"); + console.setText ("PROPERTY: " + prop + buf + "\n" + + "VALUE: " + value.toString() + "\n\n"); } } /************************************************************************** * **************************************************************************/ - public JComponent getComponent() { - JPanel p = new JPanel (new GridBagLayout(), true); + public JComponent getComponent (PropertyChannel propertyChannel) { + setPropertyChannel (propertyChannel); - textArea = new JTextArea (24, 80); - textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); - textArea.setEditable (false); - JScrollPane scroller = new JScrollPane (textArea); - - JButton cleanButton = - createButton (" Clean ", - "Remove all messages from the console area", - KeyEvent.VK_C, - new ActionListener() { - public void actionPerformed (ActionEvent e) { - if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) - textArea.setText (""); - } - }); - - // put it together - SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); - SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); + console = new CommonConsole(); + return console; - return p; +// JPanel p = new JPanel (new GridBagLayout(), true); + +// textArea = new JTextArea (24, 80); +// textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); +// textArea.setEditable (false); +// JScrollPane scroller = new JScrollPane (textArea); + +// JButton cleanButton = +// createButton (" Clean ", +// "Remove all messages from the console area", +// KeyEvent.VK_C, +// new ActionListener() { +// public void actionPerformed (ActionEvent e) { +// if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) +// textArea.setText (""); +// } +// }); + +// // put it together +// SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); +// SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); + +// return p; } /************************************************************************** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/18 14:09:42 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/24 17:51:51 1.4 @@ -34,6 +34,7 @@ import java.util.Vector; import java.util.Enumeration; import java.util.Properties; +import java.util.Hashtable; import java.util.Date; import java.net.URL; import java.text.DateFormat; @@ -54,6 +55,7 @@ public static boolean useLoadMonitor = true; protected JTabbedPane tabbedPane; protected DashboardPanel[] panels; + protected PropertyChannel propertyChannel; protected static Properties dashboardProperties; static { @@ -84,7 +86,8 @@ **************************************************************************/ public Dashboard() { loadPanels(); - dashboard = getComponent(); + propertyChannel = new PropertyChannel(); + dashboard = getComponent (propertyChannel); connectPanels(); } @@ -103,14 +106,14 @@ /************************************************************************** * Connect all available Dashboard panels: a) together, and b) - * with the status bar. + * with the status bar. TBD: It changed... It uses now a PropertyChannel... **************************************************************************/ public void connectPanels() { for (int i = 0; i < panels.length; i++) { - for (int j = 0; j < i; j++) - panels[i].addPropertyChangeListener (panels[j]); - for (int j = i+1; j < panels.length; j++) - panels[i].addPropertyChangeListener (panels[j]); +// for (int j = 0; j < i; j++) +// panels[i].addPropertyChangeListener (panels[j]); +// for (int j = i+1; j < panels.length; j++) +// panels[i].addPropertyChangeListener (panels[j]); if (statusBar != null) panels[i].addPropertyChangeListener (statusBar); } @@ -120,7 +123,8 @@ * Show the main frame. **************************************************************************/ public void show() { - JFrame frame = SwingUtils.createMainFrame (getComponent(), getName()); + JFrame frame = SwingUtils.createMainFrame (getComponent (propertyChannel), + getName()); SwingUtils.showMainFrame (frame, dashboard.getPreferredSize()); } @@ -182,7 +186,7 @@ /************************************************************************** * **************************************************************************/ - public JComponent getComponent() { + public JComponent getComponent (PropertyChannel propertyChannel) { if (dashboard != null) return dashboard; @@ -202,7 +206,9 @@ String name = panels[i].getName(); if (useLoadMonitor) ProgressView.monitor.setTextAndAdd ("Loading " + name + "..."); - tabbedPane.addTab (name, panels[i].getIcon(), panels[i].getComponent()); + tabbedPane.addTab (name, + panels[i].getIcon(), + panels[i].getComponent (propertyChannel)); } statusBar = getStatusBar(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/18 08:46:26 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/24 17:51:51 1.4 @@ -32,9 +32,12 @@ extends PropertyChangeListener, DashboardProperties { /************************************************************************** - * Return a graphical representation of this panel. + * Return a graphical representation of this panel.

        + * + * @param propertyChannel is a shared storage for properties + * @return a GUI representing this panel **************************************************************************/ - JComponent getComponent(); + JComponent getComponent (PropertyChannel propertyChannel); /************************************************************************** * A name identifies a panel in the dashboard's tabs. It should be =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/09/18 08:46:26 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/09/24 17:51:51 1.3 @@ -27,11 +27,17 @@ public interface DashboardProperties { + // names of properties used in property change events static final String DP_LOG_MSG = "log-msg"; static final String DP_STATUS_MSG = "status-msg"; static final String DP_SERVICE_NAME = "dp-service-name"; static final String DP_DATATYPE_NAME = "dp-datatype-name"; + // names of properties used in property channel storage + static final String DP_REGISTRY_ENDPOINT = "dp-registry-endpoint"; + static final String DP_REGISTRY_NAMESPACE = "dp-registry-namespace"; + static final String DP_CACHE_DIR = "dp-cache-dir"; + /** A filename containing Java properties that configure the dashboard. */ static final String DASHBOARD_PROPERTIES_FILE = "dashboard.properties"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java 2005/09/18 08:46:26 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java 2005/09/24 17:51:51 1.3 @@ -25,6 +25,8 @@ import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; +import java.util.Map; + /** * A debugging panel. It generates some events.

        * @@ -40,7 +42,9 @@ /************************************************************************** * **************************************************************************/ - public JComponent getComponent() { + public JComponent getComponent (PropertyChannel propertyChannel) { + setPropertyChannel (propertyChannel); + JPanel p = new JPanel (new GridBagLayout(), true); JLabel desc = @@ -81,7 +85,8 @@ // private void onFire (String propertyName, String value) { - support.firePropertyChange (propertyName, null, value); + propertyChannel.put (propertyName, value); +// support.firePropertyChange (propertyName, null, value); } /************************************************************************** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/22 16:07:09 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/24 17:51:51 1.6 @@ -1,3 +1,123 @@ +invokeLater() +------------- +/** + * Create the GUI and show it. For thread safety, + * this method should be invoked from the + * event-dispatching thread. + */ +private static void createAndShowGUI() { + //Make sure we have nice window decorations. + JFrame.setDefaultLookAndFeelDecorated(true); + + //Create and set up the window. + frame = new JFrame("FocusConceptsDemo"); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + //Create and set up the content pane. + JComponent newContentPane = new FocusConceptsDemo(); + newContentPane.setOpaque(true); //content panes must be opaque + frame.setContentPane(newContentPane); + + //Display the window. + frame.pack(); + frame.setVisible(true); +} +public static void main(String[] args) { + //Schedule a job for the event-dispatching thread: + //creating and showing this application's GUI. + javax.swing.SwingUtilities.invokeLater(new Runnable() { + public void run() { + createAndShowGUI(); + } + }); + +invokeAndWait(): +---------------- +void printTextField() throws Exception { + final String[] myStrings = new String[2]; + + Runnable getTextFieldText = new Runnable() { + public void run() { + myStrings[0] = textField0.getText(); + myStrings[1] = textField1.getText(); + } + }; + SwingUtilities.invokeAndWait(getTextFieldText); + + System.out.println(myStrings[0] + " " + myStrings[1]); +} + +SwingWorker: +------------ + +//BETTER CODE: +public void actionPerformed(ActionEvent e) { + ... + final SwingWorker worker = new SwingWorker() { + public Object construct() { + //...code that might take a while to execute is here... + return someValue; + } + }; + worker.start(); //required for SwingWorker 3 + ... +} + +using finished: + +public void actionPerformed(ActionEvent e) { + ... + if (icon == null) { //haven't viewed this photo before + loadImage(imagedir + pic.filename, current); + } else { + updatePhotograph(current, pic); + } +} +... +//Load an image in a separate thread. +private void loadImage(final String imagePath, final int index) { + final SwingWorker worker = new SwingWorker() { + ImageIcon icon = null; + + public Object construct() { + icon = new ImageIcon(getURL(imagePath)); + return icon; //return value not used by this program + } + + //Runs on the event-dispatching thread. + public void finished() { + Photo pic = (Photo)pictures.elementAt(index); + pic.setIcon(icon); + if (index == current) + updatePhotograph(index, pic); + } + }; + worker.start(); +} + + +---- + +* error messages (dialog window, or a text-area window/save button, something on sterrr?) +? logging (LogPanel and/or usual logging to a file?) +* communication with StatusBar (incl. progress bar, cancel button) +* disabling things during a long-time operation +* general Console panel (save button; various renderes?) +* graphics to trees + + +TODO generally: +--------------- + +* notice that the dasboard is used the first time and offer ti create +a list of wanted panels (some of them are suggested as default) + +* notice that user does not use cache (and that he did not select "do +not check it at startup") and tell him "do you want a cache?" + +* BUG: not sure why so many (repeated) changes from the actionlistener +in JFieldTextWithHistory + TODO with views: ---------------- * change onMethods() to be protected or even private... =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/09/19 08:09:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/09/24 17:51:51 1.2 @@ -8,8 +8,18 @@ package org.biomoby.service.dashboard; +import org.biomoby.shared.MobyException; +import org.biomoby.shared.MobyDataType; +import org.biomoby.shared.CentralAll; +import org.biomoby.client.CentralDigestCachedImpl; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeSupport; + +import java.util.HashSet; +import java.util.Hashtable; +import java.util.regex.Pattern; /** * A real worker that supplies all data to the {@link @@ -20,17 +30,108 @@ * @version $Id$ */ -public class RegistryModel { +public class RegistryModel + extends AbstractModel { + + CentralAll worker; + Hashtable dataTypesTable; /********************************************************************* * Default constructor. ********************************************************************/ public RegistryModel() { + super(); + } + + /********************************************************************* + * Usual constructor that shares support for property changes with + * its creator. + ********************************************************************/ + public RegistryModel (PropertyChangeSupport support) { + super (support); + } + + /********************************************************************* + * + ********************************************************************/ + public MobyDataType[] getDataTypesByNames() + throws MobyException { + + if (worker == null) + initWorker(); + + MobyDataType[] dataTypes = worker.getDataTypes(); + return dataTypes; } /********************************************************************* * ********************************************************************/ + public MobyDataType getDataType (String dataTypeName) + throws MobyException { + if (dataTypeName == null) + return null; + + MobyDataType[] dataTypes = getDataTypesByNames(); + + if (dataTypesTable == null) { + dataTypesTable = new Hashtable(); + for (int i = 0; i < dataTypes.length; i++) { + dataTypesTable.put (dataTypes[i].getName(), dataTypes[i]); + } + } + return (MobyDataType)dataTypesTable.get (dataTypeName); + } + + /********************************************************************* + * Return a HashSet filled with names of data types that have + * somewhere given 'searchText'. Add case-insensitivity to the + * regular expression in 'searchText'. + ********************************************************************/ + public HashSet find (String searchText) + throws MobyException { + HashSet found = new HashSet(); + MobyDataType[] dataTypes = getDataTypesByNames(); + if (! searchText.startsWith ("(?i)")) + searchText = "(?i)" + searchText; + Pattern pattern = Pattern.compile (searchText); + for (int i = 0; i < dataTypes.length; i++) { + if (pattern.matcher (dataTypes[i].toString()).find()) + found.add (dataTypes[i].getName()); + } + return found; + } + + +// /********************************************************************* +// * +// ********************************************************************/ +// public MobyDataType[] getDataTypesByAuthority() +// throws MobyException { + +// if (worker == null) +// initWorker(); + +// MobyDataType[] dataTypes = worker.getDataTypes(); +// java.util.Arrays.sort (dataTypes); +// return dataTypes; +// } + + /********************************************************************* + * + ********************************************************************/ + protected void initWorker() + throws MobyException { + String registryURL = propertyChannel.getString (DP_REGISTRY_ENDPOINT); + String registryNS = propertyChannel.getString (DP_REGISTRY_NAMESPACE); +// String cacheDir = propertyChannel.getString (DP_CACHE_DIR); + String cacheDir = "/home/senger/jMoby/myCache"; +// cacheDir = null; + + worker = new CentralDigestCachedImpl (registryURL, + registryNS, + cacheDir); + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/19 08:08:32 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/24 17:51:51 1.7 @@ -8,6 +8,13 @@ package org.biomoby.service.dashboard; +import org.biomoby.shared.MobyException; +import org.biomoby.shared.Central; +import org.biomoby.shared.MobyDataType; +import org.biomoby.shared.MobyRelationship; +import org.biomoby.service.generator.DataTypesGenerator; + +import org.tulsoft.shared.UUtils; import org.tulsoft.tools.gui.SwingUtils; import org.tulsoft.tools.gui.JTextFieldWithHistory; import org.tulsoft.tools.gui.JFileChooserWithHistory; @@ -21,19 +28,33 @@ import javax.swing.JSplitPane; import javax.swing.JScrollPane; import javax.swing.JTextArea; +import javax.swing.JPopupMenu; +import javax.swing.JMenuItem; +import javax.swing.JCheckBoxMenuItem; +import javax.swing.AbstractAction; import javax.swing.JComponent; import javax.swing.text.html.HTMLDocument; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; import java.awt.GridBagLayout; import java.awt.Font; - import java.awt.event.KeyEvent; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseAdapter; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; +import java.util.Map; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Enumeration; +import java.util.Vector; /** * A panel displaying contents of a Biomoby registry. It also select @@ -58,6 +79,7 @@ // components that are used from more methods JFileChooserWithHistory cacheDir; JLabel labelCacheDir; + CommonConsole console; /********************************************************************* * propertyChange() @@ -78,14 +100,16 @@ ********************************************************************/ public RegistryPanel() { super(); -// registryModel = new RegistryModel (this); - registryModel = new RegistryModel(); + registryModel = new RegistryModel (support); } /************************************************************************** * **************************************************************************/ - public JComponent getComponent() { + public JComponent getComponent (PropertyChannel propertyChannel) { + setPropertyChannel (propertyChannel); + registryModel.setPropertyChannel (propertyChannel); + if (pComponent != null) return pComponent; @@ -94,6 +118,7 @@ // ontology trees ServicesTree servicesTree = new ServicesTree(); DataTypesTree dataTypesTree = new DataTypesTree(); + dataTypesTree.update (CommonTree.SORTED_BY_NAME); NamespacesTree namespacesTree = new NamespacesTree(); JSplitPane split1 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, @@ -110,7 +135,8 @@ split2.setOneTouchExpandable (true); // console panel - JPanel console = getConsole(); + console = new CommonConsole(); + console.setAppendMode (false); JSplitPane split3 = new JSplitPane (JSplitPane.VERTICAL_SPLIT, split2, @@ -177,10 +203,10 @@ protected JPanel getRegistryLocation() { JLabel labelRegistryURL = new JLabel("Endpoint"); JTextFieldWithHistory registryURL = - new JTextFieldWithHistory ("", this, "registryEndpoint"); + createText ("", "registryEndpoint", DP_REGISTRY_ENDPOINT); JLabel labelRegistryNS = new JLabel("Namespace (URI)"); JTextFieldWithHistory registryNS = - new JTextFieldWithHistory ("", this, "registryNamespace"); + createText ("", "registryNamespace", DP_REGISTRY_NAMESPACE); JButton reloadAllButton = createButton (" Reload all ", "Reload all ontology trees from the Biomoby registry", @@ -226,9 +252,11 @@ labelCacheDir = new JLabel("Cache directory"); cacheDir = createFileSelector ("Select directory for/with local cache", "Select", - JFileChooser.DIRECTORIES_ONLY, System.getProperty ("java.io.tmpdir"), - null); + "cacheDirectory", + DP_CACHE_DIR); + cacheDir.getFileChooser().setFileSelectionMode (JFileChooser.DIRECTORIES_ONLY); + onUseCache (usingCache); JButton infoButton = createButton (" Info ", @@ -273,13 +301,13 @@ /************************************************************************** * **************************************************************************/ - protected JPanel getConsole() { - JPanel p = new JPanel (new GridBagLayout()); +// protected JPanel getConsole() { +// JPanel p = new JPanel (new GridBagLayout()); - JTextArea textArea = new JTextArea(); - textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); - textArea.setEditable (false); - JScrollPane scroller = new JScrollPane (textArea); +// JTextArea textArea = new JTextArea(); +// textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); +// textArea.setEditable (false); +// JScrollPane scroller = new JScrollPane (textArea); // JButton cleanButton = // createButton (" Clean ", @@ -292,12 +320,12 @@ // } // }); - // put it together - SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); -// SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); +// // put it together +// SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); +// // SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); - return p; - } +// return p; +// } /************************************************************************** * @@ -312,11 +340,277 @@ * **************************************************************************/ class DataTypesTree extends CommonTree { + MobyDataType[] dataTypes = null; + int lastSorted = SORTED_BY_NAME; + boolean hideBadGuys = false; + boolean showMembers = false; + JCheckBoxMenuItem hideBox; + public DataTypesTree() { super ("DataTypes"); + createPopups ("Data Types Menu"); + } + + protected void createPopups (String title) { + super.createPopups (title); + popup.addSeparator(); + popup.add + (new JMenuItem (new AbstractAction ("Sort by names") { + public void actionPerformed (ActionEvent e) { + update (lastSorted = SORTED_BY_NAME); + hideBox.setEnabled (true); + } + })); + popup.add + (new JMenuItem (new AbstractAction ("Sort by authorities") { + public void actionPerformed (ActionEvent e) { + update (lastSorted = SORTED_BY_AUTHORITY); + hideBox.setEnabled (false); + } + })); + popup.addSeparator(); + + JCheckBoxMenuItem showBox = new JCheckBoxMenuItem ("Show HAS/HASA members"); + showBox.addItemListener (new ItemListener() { + public void itemStateChanged (ItemEvent e) { + showMembers = (e.getStateChange() == ItemEvent.SELECTED); + update (lastSorted); + } + }); + popup.add (showBox); + + hideBox = new JCheckBoxMenuItem ("Hide deprecated objects"); + hideBox.addItemListener (new ItemListener() { + public void itemStateChanged (ItemEvent e) { + hideBadGuys = (e.getStateChange() == ItemEvent.SELECTED); + if (hideBadGuys) + removeBadGuys(); + else + update (lastSorted); + } + }); + popup.add (hideBox); + } + + void update (int howSorted) { + popup.setEnabled (false); + final int sorted = howSorted; + final SwingWorker worker = new SwingWorker() { + public Object construct() { + try { + dataTypes = registryModel.getDataTypesByNames(); + } catch (MobyException e) { + // TBD: what to do here? + System.err.println ("ERROR: " + e.getMessage()); + } + return dataTypes; // not used here + } + + // runs on the event-dispatching thread. + public void finished() { + if (dataTypes != null) { + if (sorted == SORTED_BY_AUTHORITY) + onUpdateDataTreeByAuth (dataTypes); + else + onUpdateDataTree (dataTypes); + popup.setEnabled (true); + } + } + }; + worker.start(); + } + + void onUpdateDataTree (MobyDataType[] dataTypes) { + DefaultTreeModel tModel = (DefaultTreeModel)getModel(); + DefaultMutableTreeNode root = (DefaultMutableTreeNode)tModel.getRoot(); + root.removeAllChildren(); // does not harm if no children exist + HashMap nodes = new HashMap (dataTypes.length); + for (int i = 0; i < dataTypes.length; i++) { + String thisName = dataTypes[i].getName(); + DefaultMutableTreeNode thisNode = (DefaultMutableTreeNode)nodes.get (thisName); + if (thisNode == null) { + thisNode = new DefaultMutableTreeNode (new CommonNode (thisName)); + nodes.put (thisName, thisNode); + } + String[] parents = dataTypes[i].getParentNames(); + if (parents.length == 0) { // we have a top-level object + root.add (thisNode); + } else { + String parentName = parents[0]; + DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode)nodes.get (parentName); + if (parentNode == null) { + parentNode = new DefaultMutableTreeNode (new CommonNode (parentName)); + nodes.put (parentName, parentNode); + } + if (showMembers) + addMembers (thisNode, dataTypes[i]); + parentNode.add (thisNode); + } + } + if (hideBadGuys) + removeBadGuys(); + else + tModel.reload(); + } + + + void onUpdateDataTreeByAuth (MobyDataType[] dataTypes) { + DefaultTreeModel tModel = (DefaultTreeModel)getModel(); + DefaultMutableTreeNode root = (DefaultMutableTreeNode)tModel.getRoot(); + root.removeAllChildren(); // does not harm if no children exist + HashMap nodes = new HashMap (dataTypes.length); + for (int i = 0; i < dataTypes.length; i++) { + String thisName = dataTypes[i].getName(); + DefaultMutableTreeNode thisNode = (DefaultMutableTreeNode)nodes.get (thisName); + if (thisNode == null) { + thisNode = new DefaultMutableTreeNode (new CommonNode (thisName)); + nodes.put (thisName, thisNode); + } + String authority = dataTypes[i].getAuthority(); + if (UUtils.isEmpty (authority)) + authority = ""; + DefaultMutableTreeNode authNode = (DefaultMutableTreeNode)nodes.get (authority); + if (authNode == null) { + authNode = new DefaultMutableTreeNode (new CommonNode (authority)); + nodes.put (authority, authNode); + root.add (authNode); + } + if (showMembers) + addMembers (thisNode, dataTypes[i]); + authNode.add (thisNode); + } + tModel.reload(); } + + void removeBadGuys() { + DefaultTreeModel tModel = (DefaultTreeModel)getModel(); + DefaultMutableTreeNode root = (DefaultMutableTreeNode)tModel.getRoot(); + + Vector removeFromParent = new Vector(); // nodes that will be removed + Vector removeAllChildren = new Vector(); // nodes whose children will be removed + for (Enumeration en = root.children(); en.hasMoreElements(); ) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode)en.nextElement(); + String value = ((CommonNode)node.getUserObject()).getValue(); + if (value.equals ("Object")) { + // primitive type should not have children + for (Enumeration en2 = node.children(); en2.hasMoreElements(); ) { + DefaultMutableTreeNode node2 = (DefaultMutableTreeNode)en2.nextElement(); + String value2 = ((CommonNode)node2.getUserObject()).getValue(); + if (DataTypesGenerator.isPrimitiveType (value2)) + removeAllChildren.addElement (node2); + } + } else { + // only Object can be a root object + removeFromParent.addElement (node); + } + } + for (Enumeration en = removeFromParent.elements(); en.hasMoreElements(); ) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode)en.nextElement(); + node.removeFromParent(); + } + for (Enumeration en = removeAllChildren.elements(); en.hasMoreElements(); ) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode)en.nextElement(); + node.removeAllChildren(); + } + tModel.reload(); + } + + void addMembers (DefaultMutableTreeNode node, MobyDataType dataType) { + MobyRelationship[] rels = dataType.getChildren(); + for (int i = 0; i < rels.length; i++) { + String memberName = rels[i].getName(); + String memberType = rels[i].getDataTypeName(); + int memberRel = rels[i].getRelationshipType(); + node.add (new DefaultMutableTreeNode (new MemberNode (rels[i]))); + } + } + + /********************************************************************* + * Search underlying objects and highligh nodes corresponding to + * the found objects. + ********************************************************************/ + protected void search (String searchText) { + final String regex = searchText; + final SwingWorker worker = new SwingWorker() { + HashSet found = new HashSet(); + public Object construct() { + try { + if (UUtils.notEmpty (regex)) + found = registryModel.find (regex); + } catch (MobyException e) { + // TBD: what to do here? + System.err.println ("ERROR: " + e.getMessage()); + } + return found; // not used here + } + + // runs on the event-dispatching thread. + public void finished() { + if (found != null) + highlightAndJumpTo (found); + } + }; + worker.start(); + } + + /********************************************************************* + * + ********************************************************************/ + protected void selected (DefaultMutableTreeNode node) { + final CommonNode nodeObject = (CommonNode)node.getUserObject(); + final SwingWorker worker = new SwingWorker() { + MobyDataType dataType; + public Object construct() { + try { + dataType = registryModel.getDataType (nodeObject.getValue()); + } catch (MobyException e) { + // TBD: what to do here? + System.err.println ("ERROR: " + e.getMessage()); + } + return dataType; // not used here + } + + // runs on the event-dispatching thread. + public void finished() { + if (dataType != null) +// System.out.println (dataType); + console.setText (dataType.toString()); + } + }; + worker.start(); + } + + class MemberNode extends CommonNode { + MobyRelationship rel; + public MemberNode (MobyRelationship rel) { + this.rel = rel; + } + public String getValue() { + return rel.getDataTypeName(); + } + public String toString() { + String memberName = rel.getName(); + String memberType = rel.getDataTypeName(); + int memberRel = rel.getRelationshipType(); + StringBuffer buf = new StringBuffer (100); + buf.append (""); + buf.append (memberRel == Central.iHAS ? "HAS" : "HASA"); + buf.append (": "); + buf.append (memberType); + if (UUtils.notEmpty (memberName)) { + buf.append (" ("); + buf.append (memberName); + buf.append (")"); + } + return buf.toString(); + } + } + + } + + /************************************************************************** * **************************************************************************/ @@ -342,35 +636,4 @@ return panelIcon; } - -// public void actionPerformed(ActionEvent e) { -// ... -// if (icon == null) { //haven't viewed this photo before -// loadImage(imagedir + pic.filename, current); -// } else { -// updatePhotograph(current, pic); -// } -// } -// ... -// //Load an image in a separate thread. -// private void loadImage(final String imagePath, final int index) { -// final SwingWorker worker = new SwingWorker() { -// ImageIcon icon = null; - -// public Object construct() { -// icon = new ImageIcon(getURL(imagePath)); -// return icon; //return value not used by this program -// } - -// //Runs on the event-dispatching thread. -// public void finished() { -// Photo pic = (Photo)pictures.elementAt(index); -// pic.setIcon(icon); -// if (index == current) -// updatePhotograph(index, pic); -// } -// }; -// worker.start(); -// } - } From mwilkinson at pub.open-bio.org Mon Sep 26 19:19:33 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon, 26 Sep 2005 19:19:33 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509262319.j8QNJXQ8019359@pub.open-bio.org> mwilkinson Mon Sep 26 19:19:33 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv19340/MOBY/Client Modified Files: OntologyServer.pm Log Message: typo moby-live/Perl/MOBY/Client OntologyServer.pm,1.12,1.13 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm 2005/07/06 15:23:07 1.12 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm 2005/09/26 23:19:33 1.13 @@ -189,7 +189,7 @@ =cut -sub relationshipsExists { +sub relationshipExists { my ( $self, %args ) = @_; my $term = $args{'term'}; $term =~ s/^moby://; # if the term is namespaced, then remove that From mwilkinson at pub.open-bio.org Mon Sep 26 19:26:00 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon, 26 Sep 2005 19:26:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509262326.j8QNQ0WZ019519@pub.open-bio.org> mwilkinson Mon Sep 26 19:26:00 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv19500/MOBY Modified Files: Central.pm Log Message: retrieveNamespaces should now retrieve everything about a namespace, no longer a 'sink' as Martin so aptly phrased it moby-live/Perl/MOBY Central.pm,1.216,1.217 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.216 retrieving revision 1.217 diff -u -r1.216 -r1.217 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/20 21:16:11 1.216 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/26 23:26:00 1.217 @@ -2803,8 +2803,8 @@ if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - $ns .= "\n\n\n"; #COMMENT/REMOVE -# $ns .= "\n\n$contact\n$auth\n\n";#UNCOMMENT +# $ns .= "\n\n\n"; #COMMENT/REMOVE + $ns .= "\n\n$contact\n$auth\n\n";#UNCOMMENT } $ns .= ""; return $ns; From mwilkinson at pub.open-bio.org Mon Sep 26 20:01:24 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon, 26 Sep 2005 20:01:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509270001.j8R01ONI019712@pub.open-bio.org> mwilkinson Mon Sep 26 20:01:24 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv19693/MOBY/Client Modified Files: OntologyServer.pm Log Message: fixing ontology server relationshipExists call moby-live/Perl/MOBY/Client OntologyServer.pm,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm 2005/09/26 23:19:33 1.13 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm 2005/09/27 00:01:24 1.14 @@ -192,10 +192,11 @@ sub relationshipExists { my ( $self, %args ) = @_; my $term = $args{'term'}; + my $ontology = $args{'ontology'}; $term =~ s/^moby://; # if the term is namespaced, then remove that my $ua = $self->getUserAgent; my $req = HTTP::Request->new( POST => $self->host ); - $req->content( "relationshipExists=$term" ); + $req->content( "relationshipExists=$term&ontology=$ontology" ); my $res = $ua->request( $req ); if ( $res->is_success ) { return split "\n", $res->content; From mwilkinson at pub.open-bio.org Mon Sep 26 20:01:24 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon, 26 Sep 2005 20:01:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509270001.j8R01O7a019731@pub.open-bio.org> mwilkinson Mon Sep 26 20:01:24 EDT 2005 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv19693/scripts Modified Files: OntologyServer.cgi Log Message: fixing ontology server relationshipExists call moby-live/Perl/scripts OntologyServer.cgi,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/scripts/OntologyServer.cgi,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Perl/scripts/OntologyServer.cgi 2003/10/09 16:49:22 1.4 +++ /home/repository/moby/moby-live/Perl/scripts/OntologyServer.cgi 2005/09/27 00:01:24 1.5 @@ -7,10 +7,10 @@ my $q = CGI->new(); my @params = $q->param; -my $param = $params[0]; # one call per customer +my $subroutine = $params[0]; # one call per customer no strict "refs"; -&$param($q->param($param)); #call that subroutie with the passed value +&$subroutine($q->param($subroutine), $q); #call that subroutie with the passed value use strict; sub testme { @@ -60,10 +60,11 @@ } sub relationshipExists { + my ($term, $CGI) = @_; my $OS = MOBY::OntologyServer->new(ontology => "relationship"); - my ($success, $description, $id) = $OS->relationshipExists(term => $_[0]); - print header(-type => 'text/plain'), "$success\n$description\n$id"; - + my $ontology = $CGI->param('ontology'); + my ($success, $description, $id) = $OS->relationshipExists(ontology => $ontology, term => $term); + print header(-type => 'text/plain'), "$success\n$description\n$id"; } sub serviceExists { From mwilkinson at pub.open-bio.org Mon Sep 26 20:06:25 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon, 26 Sep 2005 20:06:25 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509270006.j8R06PEZ019801@pub.open-bio.org> mwilkinson Mon Sep 26 20:06:25 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv19782/t Modified Files: Client-OntologyServer.t Log Message: fixing ontology server relationshipExists test moby-live/Perl/t Client-OntologyServer.t,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/16 16:38:15 1.4 +++ /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/27 00:06:24 1.5 @@ -88,13 +88,22 @@ or diag("OntologyServer should be able to tell whether a relationship exists"); my @check_rel = qw/ISA HASA HAS/; # There should only be very few valid relationship types. foreach (@check_rel) { - ($success, $msg, $existingURI) = $os->relationshipExists(term => $_); + ($success, $msg, $existingURI) = $os->relationshipExists(term => $_, ontology => 'object'); + is($success, 1) + or diag("Relationship '$_' reported erroneously as non-existent."); + } + my @check_rel2 = qw/ISA/; # There should only be very few valid relationship types. + foreach (@check_rel2) { + ($success, $msg, $existingURI) = $os->relationshipExists(term => $_, ontology => 'service'); is($success, 1) or diag("Relationship '$_' reported erroneously as non-existent."); } my $invalid_rel = "HA"; - ($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel); + ($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel, ontology => 'service'); + is($success, 0) + or diag("Relationship '$invalid_rel' reported erroneously as existent."); + ($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel, ontology => 'object'); is($success, 0) or diag("Relationship '$invalid_rel' reported erroneously as existent."); } From mwilkinson at pub.open-bio.org Mon Sep 26 19:28:44 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon, 26 Sep 2005 19:28:44 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509262328.j8QNSie2019563@pub.open-bio.org> mwilkinson Mon Sep 26 19:28:44 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv19544/MOBY Modified Files: Central.pm Log Message: retrieveNamespaces pod documentation updated moby-live/Perl/MOBY Central.pm,1.217,1.218 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.217 retrieving revision 1.218 diff -u -r1.217 -r1.218 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/26 23:26:00 1.217 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/26 23:28:44 1.218 @@ -2786,6 +2786,8 @@ + email at address.here + authority.uri.here ... ... From kawas at pub.open-bio.org Mon Sep 26 21:26:47 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon, 26 Sep 2005 21:26:47 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509270126.j8R1QlAL020096@pub.open-bio.org> kawas Mon Sep 26 21:26:47 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv20067 Modified Files: OntologyServer.pm Central.pm Log Message: committing the actual uncommentted changes made as per Martins' request moby-live/Perl/MOBY OntologyServer.pm,1.84,1.85 Central.pm,1.218,1.219 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.84 retrieving revision 1.85 diff -u -r1.84 -r1.85 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/20 21:16:34 1.84 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/27 01:26:47 1.85 @@ -924,8 +924,8 @@ my %response; foreach (@$types) { - $response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}]; #COMMENT/REMOVE - #$response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}, $_->{contact_email}, $_->{authority}]; #UNCOMMENT + #$response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}]; #COMMENT/REMOVE + $response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}, $_->{contact_email}, $_->{authority}]; #UNCOMMENT } return \%response; } =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.218 retrieving revision 1.219 diff -u -r1.218 -r1.219 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/26 23:28:44 1.218 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/27 01:26:47 1.219 @@ -2617,14 +2617,14 @@ my $OS = MOBY::OntologyServer->new( ontology => 'service' ); my %types = %{ $OS->retrieveAllServiceTypes() }; my $types = "\n"; - while ( my ( $serv, $descr ) = each %types ) { #COMMENT/REMOVE -# while ( my ( $serv, $descr, $contact, $auth ) = each %types ) { #UNCOMMENT +# while ( my ( $serv, $descr ) = each %types ) { #COMMENT/REMOVE + while ( my ( $serv, $descr, $contact, $auth ) = each %types ) { #UNCOMMENT my ($desc, $lsid) = @$descr; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - $types .="\n\n\n"; #COMMENT/REMOVE -# $types .="\n\n$contact\n$auth\n\n"; #UNCOMMENT +# $types .="\n\n\n"; #COMMENT/REMOVE + $types .="\n\n$contact\n$auth\n\n"; #UNCOMMENT } $types .= "\n"; return $types; From mwilkinson at pub.open-bio.org Tue Sep 27 10:44:34 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 27 Sep 2005 10:44:34 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509271444.j8REiYtu023350@pub.open-bio.org> mwilkinson Tue Sep 27 10:44:34 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv23327/MOBY Modified Files: Central.pm OntologyServer.pm Log Message: well, Eddie, that was ALMOST correct :-) moby-live/Perl/MOBY Central.pm,1.219,1.220 OntologyServer.pm,1.85,1.86 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.219 retrieving revision 1.220 diff -u -r1.219 -r1.220 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/27 01:26:47 1.219 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/27 14:44:34 1.220 @@ -2617,13 +2617,11 @@ my $OS = MOBY::OntologyServer->new( ontology => 'service' ); my %types = %{ $OS->retrieveAllServiceTypes() }; my $types = "\n"; -# while ( my ( $serv, $descr ) = each %types ) { #COMMENT/REMOVE - while ( my ( $serv, $descr, $contact, $auth ) = each %types ) { #UNCOMMENT - my ($desc, $lsid) = @$descr; + while ( my ( $serv, $descr ) = each %types ) { #UNCOMMENT + my ($desc, $lsid, $contact, $auth) = @$descr; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } -# $types .="\n\n\n"; #COMMENT/REMOVE $types .="\n\n$contact\n$auth\n\n"; #UNCOMMENT } $types .= "\n"; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.85 retrieving revision 1.86 diff -u -r1.85 -r1.86 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/27 01:26:47 1.85 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/27 14:44:34 1.86 @@ -924,7 +924,6 @@ my %response; foreach (@$types) { - #$response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}]; #COMMENT/REMOVE $response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}, $_->{contact_email}, $_->{authority}]; #UNCOMMENT } return \%response; From mwilkinson at pub.open-bio.org Tue Sep 27 12:19:21 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 27 Sep 2005 12:19:21 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509271619.j8RGJLQ3026218@pub.open-bio.org> mwilkinson Tue Sep 27 12:19:21 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv26197/MOBY Modified Files: Central.pm Log Message: added two new methods to MOBY Client Central to extract the additional details from namespace and service retrieval moby-live/Perl/MOBY Central.pm,1.220,1.221 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.220 retrieving revision 1.221 diff -u -r1.220 -r1.221 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/27 14:44:34 1.220 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/27 16:19:21 1.221 @@ -2605,6 +2605,8 @@ + your at email.here + authority.uri.here ... ... From mwilkinson at pub.open-bio.org Tue Sep 27 12:19:21 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 27 Sep 2005 12:19:21 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509271619.j8RGJLDY026237@pub.open-bio.org> mwilkinson Tue Sep 27 12:19:21 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv26197/MOBY/Client Modified Files: Central.pm Log Message: added two new methods to MOBY Client Central to extract the additional details from namespace and service retrieval moby-live/Perl/MOBY/Client Central.pm,1.124,1.125 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.124 retrieving revision 1.125 diff -u -r1.124 -r1.125 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/09/16 17:01:10 1.124 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/09/27 16:19:21 1.125 @@ -1236,7 +1236,6 @@ " . ( $SI->XML ) . " "; -# my $return = $self->SOAP_connection($reg)->call(retrieveService => ($message))->paramsall; my ($return) = $self->_call( $reg, 'retrieveService', $message ); my $parser = XML::LibXML->new(); my $doc = $parser->parse_string($return); @@ -1292,7 +1291,7 @@ =head2 retrieveServiceNames - Usage : $names = $MOBY->retrieveServiceNames([$reg_name]) + Usage : $names = $MOBY->retrieveServiceNames(%args) Function : get a (redundant) list of all registered service names (N.B. NOT service types!) Returns : hashref to the following hash @@ -1367,7 +1366,7 @@ =head2 retrieveServiceTypes - Usage : $types = $MOBY->retrieveServiceTypes([$reg_name]) + Usage : $types = $MOBY->retrieveServiceTypes(%args) Function : get the list of all registered service types Returns : hashref of $types{$type} = $definition Args : registry => $reg_name: name of registry you wish to retrieve from (optional) @@ -1414,6 +1413,76 @@ return \%servicetypes; } + +=head2 retrieveServiceTypesFull + + Usage : $types = $MOBY->retrieveServiceTypesFull(%args) + Function : get all details of all service types + Returns : hashref of $types{$type} = {definition => "definition", + authURI => "authority.uri.here", + contactEmail => "email at addy.here"} + Args : registry => $reg_name: name of registry you wish to retrieve from (optional) + as_lsid => $boolean: return the $type as its corresponding LSID (defualt off) + +=cut + + +sub retrieveServiceTypesFull { + my ($self, %args) = shift; + my $reg = $args{registry}; + my $as_lsid = $args{as_lsid}; + + $reg = $reg ? $reg : $self->default_MOBY_servername; + return undef unless ( $self->Connection($reg) ); + +# my $return = $self->SOAP_connection($reg)->call('retrieveServiceTypes' => (@_))->paramsall; + my ($return) = $self->_call( $reg, 'retrieveServiceTypes', "" ); + my $parser = XML::LibXML->new(); + my $doc = $parser->parse_string($return); + my $root = $doc->getDocumentElement; + my $types = $root->childNodes; + my %servicetypes; + for ( my $x = 1 ; $x <= $types->size() ; $x++ ) { + next unless $types->get_node($x)->nodeType == ELEMENT_NODE; + my $type = $types->get_node($x)->getAttributeNode('name')->getValue; + my $lsid = $types->get_node($x)->getAttributeNode('lsid'); + if ($lsid){ + $lsid = $lsid->getValue; + } else { + $lsid = $type; + } + my ($desc, $auth, $email); + for + my $elem ( $types->get_node($x)->getElementsByTagName('Description') ) + { + $desc = $elem->firstChild->toString; + if ( $desc =~ /[^\]]+))\]\]>/ ) { + $desc = $1; + } + } + for + my $elem ( $types->get_node($x)->getElementsByTagName('authURI') ) + { + $auth = $elem->firstChild->toString; + if ( $auth =~ /[^\]]+))\]\]>/ ) { + $auth = $1; + } + } + for + my $elem ( $types->get_node($x)->getElementsByTagName('contactEmail') ) + { + $emai = $elem->firstChild->toString; + if ( $email =~ /[^\]]+))\]\]>/ ) { + $email = $1; + } + } + $desc =~ s/[^\]]+))\]\]>/$1/gs; # somehow these CDATA elements are nested sometimes??? + $servicetypes{$as_lsid?$lsid:$type} = {Description => $desc, authURI => $auth, contactEmail => $email}; + } + return \%servicetypes; +} + + =head2 retrieveObjectNames Usage : $names = $MOBY->retrieveObjectNames([$reg_name]) @@ -1463,7 +1532,7 @@ =head2 retrieveNamespaces - Usage : $ns = $MOBY->retrieveNamespaces([$reg_name]) + Usage : $ns = $MOBY->retrieveNamespaces(%args) Function : get the list of all registered Namespace types Returns : hashref of hash: $ns{$namespace} = $definition @@ -1511,6 +1580,78 @@ return \%namespaces; } +=head2 retrieveNamespacesFull + + Usage : $ns = $MOBY->retrieveNamespaces(%args) + Function : get all details about all namespaces + Returns : hashref of hash: + $ns{$namespace} = {Definition => $definition, + authURI => $authority, + contactEmail => $email} + Args : registry => $reg_name: name of registry you wish to retrieve from (optional) + as_lsid => $boolean: retrieve $namespace as its corresponding LSID (default off) + +=cut + +sub retrieveNamespaces { + my ($self, %args) = shift; + my $reg = $args{registry}; + $reg = $reg ? $reg : $self->default_MOBY_servername; + return undef unless ( $self->Connection($reg) ); + my $as_lsid = $args{as_lsid}; + + my ($return) = $self->_call( $reg, 'retrieveNamespaces', "" ); + my $parser = XML::LibXML->new(); + my $doc = $parser->parse_string($return); + my $root = $doc->getDocumentElement; + my $namesp = $root->childNodes; + my %namespaces; + for ( my $x = 1 ; $x <= $namesp->size() ; $x++ ) { + next unless $namesp->get_node($x)->nodeType == ELEMENT_NODE; + my $ns = $namesp->get_node($x)->getAttributeNode('name')->getValue; + my $lsid = $namesp->get_node($x)->getAttributeNode('lsid'); + if ($lsid){ + $lsid = $lsid->getValue; + } else { + $lsid = $ns; + } + my ($desc, $auth, $email); + for my $elem ( + $namesp->get_node($x)->getElementsByTagName('Description') ) + { + $desc = $elem->firstChild; + $desc = $desc ? $desc->toString : ""; + $desc ||=""; + if ( $desc =~ /[^\]]+))\]\]>/ ) { + $desc = $1; + } + } + for my $elem ( + $namesp->get_node($x)->getElementsByTagName('authURI') ) + { + $auth = $elem->firstChild; + $auth = $auth ? $auth->toString : ""; + $auth ||=""; + if ( $auth =~ /[^\]]+))\]\]>/ ) { + $auth = $1; + } + } + for my $elem ( + $namesp->get_node($x)->getElementsByTagName('contactEmail') ) + { + $email = $elem->firstChild; + $email = $email ? $email->toString : ""; + $email ||=""; + if ( $email =~ /[^\]]+))\]\]>/ ) { + $email = $1; + } + } + $namespaces{$as_lsid?$lsid:$ns} = {Description => $desc, authURI => $auth, contactEmail => $email}; + } + return \%namespaces; +} + + =head2 retrieveObject Usage : $objects = $MOBY->retrieveObjectNames(%args) From mwilkinson at pub.open-bio.org Tue Sep 27 12:21:04 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 27 Sep 2005 12:21:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509271621.j8RGL4XV026334@pub.open-bio.org> mwilkinson Tue Sep 27 12:21:04 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv26315/MOBY/Client Modified Files: Central.pm Log Message: added two new methods to MOBY Client Central to extract the additional details from namespace and service retrieval moby-live/Perl/MOBY/Client Central.pm,1.125,1.126 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.125 retrieving revision 1.126 diff -u -r1.125 -r1.126 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/09/27 16:19:21 1.125 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/09/27 16:21:04 1.126 @@ -1471,7 +1471,7 @@ for my $elem ( $types->get_node($x)->getElementsByTagName('contactEmail') ) { - $emai = $elem->firstChild->toString; + $email = $elem->firstChild->toString; if ( $email =~ /[^\]]+))\]\]>/ ) { $email = $1; } @@ -1593,7 +1593,7 @@ =cut -sub retrieveNamespaces { +sub retrieveNamespacesFull { my ($self, %args) = shift; my $reg = $args{registry}; $reg = $reg ? $reg : $self->default_MOBY_servername; From fgibbons at pub.open-bio.org Tue Sep 27 20:24:26 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 27 Sep 2005 20:24:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509280024.j8S0OQx5027540@pub.open-bio.org> fgibbons Tue Sep 27 20:24:26 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory pub.open-bio.org:/tmp/cvs-serv27515 Modified Files: index_API.html Log Message: - Added a URL. moby-live/Docs/MOBY-S_API index_API.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/index_API.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/index_API.html 2005/08/25 16:03:20 1.2 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/index_API.html 2005/09/28 00:24:26 1.3 @@ -62,8 +62,8 @@ developers' mailing list. Among them are:

        +You can join the MOBY-S community by subscribing to the mailing list. + +You can also report a bug or request a new feature + \ No newline at end of file From fgibbons at pub.open-bio.org Tue Sep 27 20:24:26 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 27 Sep 2005 20:24:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509280024.j8S0OQnN027567@pub.open-bio.org> fgibbons Tue Sep 27 20:24:26 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl In directory pub.open-bio.org:/tmp/cvs-serv27515/Perl Modified Files: ConstructingYourService.html RegisterAnObject.html RegisterNamespace.html Log Message: - Added a URL. moby-live/Docs/MOBY-S_API/Perl ConstructingYourService.html,1.2,1.3 RegisterAnObject.html,1.1,1.2 RegisterNamespace.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html 2005/08/25 16:03:20 1.2 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html 2005/09/28 00:24:26 1.3 @@ -12,23 +12,27 @@ MOBY-S Compliant Services First you need to check the following:
          -
        • Do the object type(s) that your service will consume already -exist in the Object Ontology? If not, Do the object type(s) that your service will consume already +exist in the + +Object Ontology? If not, learn how to design your own MOBY objects
        • -
        • Do the object type(s) that your service will produce already -exist in the Object Ontology? If not, then you need to Do the object type(s) that your service will produce already +exist in the +Object Ontology? If not, then you need to register your objects in the MOBY-S object/class ontology
        • Does an appropriate service type term already exist in the -Service Ontology? You need to Service Ontology? You need to register your new service type in the MOBY-S service ontology.
        • -
        • Do the Namespaces that you are going to use in your objects -already exist in the Service Ontology? Do the namespaces that you are going to use in your objects +already exist in the +Namespace Ontology? Register your namespace, if it doesn't already exist.
        • =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterAnObject.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterAnObject.html 2005/08/25 14:02:54 1.1 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterAnObject.html 2005/09/28 00:24:26 1.2 @@ -10,6 +10,8 @@

          Using the Perl API to register an object

          +MOBY already has a +rather extensive ontology of data/object types. Still, if you can't find what you need, you have to create your own. The signature for the registerObject method is as follows:
           my $REG = $MOBY->registerObject(
          
          ===================================================================
          RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterNamespace.html,v
          retrieving revision 1.1
          retrieving revision 1.2
          diff -u -r1.1 -r1.2
          --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterNamespace.html	2005/08/25 14:03:25	1.1
          +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterNamespace.html	2005/09/28 00:24:26	1.2
          @@ -18,7 +18,10 @@
           that the ID referrs to.  For example, gi numbers always
           represent Genbank records, and identifiers in the format GO::0003346
           always represent Gene Ontology Terms.  As such, much of
          -MOBY-S is built to take advantage of this predeictability.  

          +MOBY-S is built to take advantage of this predeictability. (An + +up-to-date list of currently available namespaces, is available here.) +

          In MOBY-S, service providers will often define their interfaces in terms of Namespaces - i.e. they are saying "I know how to do something From mwilkinson at pub.open-bio.org Wed Sep 28 18:05:59 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 28 Sep 2005 18:05:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509282205.j8SM5xCD031130@pub.open-bio.org> mwilkinson Wed Sep 28 18:05:58 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory pub.open-bio.org:/tmp/cvs-serv31107 Modified Files: CentralRegistry.html XMLPayloads.html Log Message: updating the docs with new features added yesterday v.v. retreival of namespaces and service types. Also a couple of doc errors fixed. moby-live/Docs/MOBY-S_API CentralRegistry.html,1.2,1.3 XMLPayloads.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html 2005/08/25 16:03:20 1.2 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html 2005/09/28 22:05:58 1.3 @@ -72,13 +72,13 @@ retrieveServiceTypes - Retrieve the service ontology, showing all registered service types. +Retrieve the definitions and registration details of all registered service types. retrieveObjectNames - Retrieve the object ontology, showing all registered object types. +Retrieve the object ontology, showing all registered object types. @@ -98,7 +98,7 @@ retrieveObjectSchema - Retrieve an XML schema representation of a particular object class. + Retrieve an XML schema representation of a particular object class. This is currently not implemented since it appears to be impossible to represent MOBY Objects in XML Schema due to limitations of XML Schema =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2005/08/25 16:03:20 1.2 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2005/09/28 22:05:58 1.3 @@ -221,7 +221,16 @@ <Resource name="Namespace" url="...Y..."/> </resourceURLs>

          +

          Notes

          +
            + +
          • Finds the URL from which the RDF of a MOBY Ontology +can be retrieved by HTTP GET. There are five possible ontology names: +"Service", "Object", "Namespace", "ServiceInstance", or "Full" (Full +retrieves all of the ontologies)
          • + +

          retrieveServiceNames

          Input XML

          @@ -235,16 +244,16 @@ ... </serviceNames> -

          Notes

            - -
          • Finds the URL from which the RDF of a MOBY Ontology -can be retrieved by HTTP GET. There are five possible ontology names: -"Service", "Object", "Namespace", "ServiceInstance", or "Full" (Full -retrieves all of the ontologies)
          • - +
          • Retrieves minimal information about all registered MOBY services
          • +
              +
            • serviceName +
            • authority +
            • service instance LSID
            +
          +

          retrieveServiceTypes

          @@ -256,6 +265,8 @@ <serviceTypes> <serviceType name="serviceName" lsid='urn:lsid:authority.uri:servicetype:id'> <Description><![CDATA[free text description here]]></Description> + <contactEmail>email at address here</contactEmail> + <authURI>authority.uri.here</authURI> </serviceType> ... </serviceTypes> @@ -263,7 +274,7 @@

          Notes

            -
          • Gets a full dump of the Service Type ontology (excluding +
          • Gets a full dump of the Service Type ontology as MOBY XML (excluding relationships)
          • A new API call will be created at a later date to retrieve the @@ -343,6 +354,8 @@ <Namespaces> <Namespace name="namespace" lsid='urn:lsid:authority.uri:namespace:id'> <Description><![CDATA[free text description here]]></Description> + <contactEmail>email at address here</contactEmail> + <authURI>authority.uri.here</authURI> </Namespace> ... </Namespaces> From mwilkinson at pub.open-bio.org Wed Sep 28 18:26:21 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 28 Sep 2005 18:26:21 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509282226.j8SMQLsa031220@pub.open-bio.org> mwilkinson Wed Sep 28 18:26:21 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory pub.open-bio.org:/tmp/cvs-serv31201 Modified Files: CentralRegistry.html Log Message: updating the docs with new features added yesterday v.v. retreival of namespaces and service types. Also a couple of doc errors fixed. moby-live/Docs/MOBY-S_API CentralRegistry.html,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html 2005/09/28 22:05:58 1.3 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html 2005/09/28 22:26:21 1.4 @@ -70,15 +70,15 @@ -retrieveServiceTypes +retrieveServiceTypes Retrieve the definitions and registration details of all registered service types. -retrieveObjectNames +retrieveObjectNames -Retrieve the object ontology, showing all registered object types. +Retrieve the definitions and registration details of all registered object types. From kawas at pub.open-bio.org Thu Sep 29 16:14:12 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Thu, 29 Sep 2005 16:14:12 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509292014.j8TKECEq002917@pub.open-bio.org> kawas Thu Sep 29 16:14:11 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util In directory pub.open-bio.org:/tmp/cvs-serv2892/org/biomoby/registry/rdfagent/util Modified Files: Report.java Log Message: Handling the error stream, just in case, so that the system call doesnt hang. moby-live/Java/src/main/org/biomoby/registry/rdfagent/util Report.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java 2005/09/12 18:22:10 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java 2005/09/29 20:14:11 1.8 @@ -12,10 +12,13 @@ * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ +import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; import java.util.ArrayList; import org.biomoby.registry.rdfagent.verifier.Communicator; @@ -101,6 +104,13 @@ "chmod +x _script_.sh"); p.waitFor(); p = Runtime.getRuntime().exec("./_script_.sh"); + InputStream stderr = p.getErrorStream(); + InputStreamReader isr = new InputStreamReader(stderr); + BufferedReader br = new BufferedReader(isr); + String line = null; + while ((line = br.readLine()) != null) { + + } p.waitFor(); Log.info("_script_.sh has " + ((file.delete()) ? "" : "not ") + "been deleted" From kawas at pub.open-bio.org Fri Sep 30 10:44:58 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri, 30 Sep 2005 10:44:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509301444.j8UEiwcf006386@pub.open-bio.org> kawas Fri Sep 30 10:44:58 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared In directory pub.open-bio.org:/tmp/cvs-serv6357/org/biomoby/client/ui/graphical/applets/shared Modified Files: Construct.java MobyTree.java Log Message: modified the code so that an arbitrary tree can be created using any rdf document and a property to base the tree on. This was done mainly for a student project that will create web forms that pop up these trees based on rdf. moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared Construct.java,1.2,1.3 MobyTree.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/Construct.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/Construct.java 2005/08/29 22:59:35 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/Construct.java 2005/09/30 14:44:58 1.3 @@ -1,15 +1,11 @@ package org.biomoby.client.ui.graphical.applets.shared; -import java.io.ByteArrayInputStream; -import java.io.FileInputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; -import org.biomoby.client.ui.graphical.servlet.jresources.RESOURCE; - import com.hp.hpl.jena.mem.ModelMem; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.Statement; @@ -120,4 +116,72 @@ return homes; } + + /** + * + * PRE: none.

            + * POST: A Hashmap containing object names as keys and their relationships,

            + * in an array, as the value. + * @param property the property to build the tree from RDF + * @return returns a hashmap containing the object name as the key + * and an arraylist of children as the value. + */ + public HashMap createHomes(String property) { + HashMap homes = new HashMap(); // (key=parent,val=household) + try { + // create an empty model + Model model = new ModelMem(); + + InputStream in = new URL(url).openStream(); + + // read the RDF/XML data + model.read(new InputStreamReader(in), ""); + StmtIterator iter; + Statement stmt; + + iter = model.listStatements(); + while (iter.hasNext()) { + stmt = (Statement) iter.next(); + + String sub = stmt.getSubject().getURI(); + String obj = stmt.getObject().toString(); + if (sub != null) + sub = sub.substring(sub.indexOf("#") + 1, sub.length()); + if (obj!= null) + obj = obj.substring(obj.indexOf("#") + 1, obj.length()); + + if (stmt.getPredicate().getURI().indexOf(property) > 0) { + //System.out.println(obj); + // we have the relationship that we want in the tree + if (homes.containsKey(obj)) { + // hash contains the home -> get the home and add child to household + Household h = (Household)homes.get(obj); + ArrayList ch = h.getChildren(); + ch.add(sub); + h.setChildren(ch); + if (DEBUG) { + System.out.println(h.toString()); + } + homes.put(obj,h); + } else { + // hash doesn't have the parent, so add the parent and child to a new household + ArrayList ch = new ArrayList(); + ch.add(sub); // add the child + Household h = new Household(obj, ch); + if (DEBUG) { + //System.out.println("New Parent: " + obj + " child: " + sub); + System.out.println(h.toString()); + } + homes.put(obj,h); + } + } // hashmap is created + + } + + } catch (Exception e) { + System.err.println("Failed: " + e.getMessage()+"\n" + e.getStackTrace()); + } + + return homes; + } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java 2005/06/02 15:48:54 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java 2005/09/30 14:44:58 1.3 @@ -67,6 +67,29 @@ JScrollPane scrollPane = new JScrollPane(tree); add(scrollPane); } + + /** + * A moby tree is constructed with the root node labeled as 'name'

            + * and the material for the tree taken from the RDF located at

            + * the url rdf. The tree is created by looking for the property property

            + * @param canEdit - if true then nodes in tree can be edited, otherwise they cannot. + * @param rdf - the url of the RDF describing Moby Objects, Services, Service Types, and Namespaces + * @param name - the name of the root node in the tree. + * @param property - the property to parse the rdf document and base a tree on + */ + public MobyTree(boolean canEdit, String rdf, String name, String property) { + + // create the layout + super(new GridLayout(1, 0)); + this.canEdit = canEdit; + this.rdf = rdf; + this.name = name; + reload(canEdit, name, property); + + + JScrollPane scrollPane = new JScrollPane(tree); + add(scrollPane); + } private void reload(boolean canEdit, String name) { // hashmap contains all the children of the root object @@ -82,6 +105,23 @@ tree.setShowsRootHandles(true); } + + /* + * + * create a tree based on property instead of subClassOf + */ + private void reload(boolean canEdit, String name, String property) { + // hashmap contains all the children of the root object + this.hashmap = new Construct(rdf).createHomes(property); + rootNode = new DefaultMutableTreeNode(name); + treeModel = new DefaultTreeModel(rootNode); + treeModel.addTreeModelListener(new MobyTreeModelListener()); + tree = new JTree(treeModel); + tree.setEditable(canEdit); + tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); + tree.setShowsRootHandles(true); + + } /** * PRE: None.

            From kawas at pub.open-bio.org Fri Sep 30 10:45:56 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri, 30 Sep 2005 10:45:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509301445.j8UEjum8006444@pub.open-bio.org> kawas Fri Sep 30 10:45:56 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/objectCreationTool In directory pub.open-bio.org:/tmp/cvs-serv6419/org/biomoby/client/ui/graphical/applets/objectCreationTool Modified Files: retrieveObjectXML.cgi Log Message: corrected the call to mobycentral that was updated recently. moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/objectCreationTool retrieveObjectXML.cgi,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/objectCreationTool/retrieveObjectXML.cgi,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/objectCreationTool/retrieveObjectXML.cgi 2005/07/19 15:36:24 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/objectCreationTool/retrieveObjectXML.cgi 2005/09/30 14:45:56 1.3 @@ -14,7 +14,7 @@ my $name; my $cgi = CGI->new(); $name = $cgi->param( 'name' ) or die; - $DEFS = $Central->retrieveObjectDefinition($name); + $DEFS = $Central->retrieveObjectDefinition(objectType => $name); print "Content-type: text/plain\n\n"; my $output = $DEFS->{'XML'}; $output =~ s/retrieveObjectDefinition/objectDetails/g; From kawas at pub.open-bio.org Fri Sep 30 10:48:22 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri, 30 Sep 2005 10:48:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509301448.j8UEmMfD006514@pub.open-bio.org> kawas Fri Sep 30 10:48:22 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms In directory pub.open-bio.org:/tmp/cvs-serv6485/org/biomoby/client/ui/graphical/servlet/forms Modified Files: GetSignatureRDFResponse.java GetSignatureRDFForm.java Log Message: *modified the domain to be portless since some people dont like 8090 etc moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms GetSignatureRDFResponse.java,1.3,1.4 GetSignatureRDFForm.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFResponse.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFResponse.java 2005/07/19 15:28:28 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFResponse.java 2005/09/30 14:48:22 1.4 @@ -37,18 +37,18 @@ final private String newline = System.getProperty("line.separator"); - final static private String error = "\r\n" - + "\r\n" - + "\r\n" - + "Please Try Again\r\n" - + "\r\n" - + "\r\n" - + "\r\n" - + "

            Unable to update your information

            \r\n" - + "
            \r\n" - + "

            Make sure that you specify a valid signature url! This field looks like the following: http://myAuthority.domain/path/to/rdf/for/service. Also make sure that you have specified the right case-sensitive service name, if applicable.

            \r\n" - + "

            Back

            \r\n" - + "
            \r\n" + "\r\n" + ""; + final static private String error = "" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + "" + + "Please Try Again" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + "" + + "

            Unable to update your information

            " + System.getProperty("line.separator") + "" + + "
            " + System.getProperty("line.separator") + "" + + "

            Make sure that you specify a valid signature url! This field looks like the following: http://myAuthority.domain/path/to/rdf/for/service. Also make sure that you have specified the right case-sensitive service name, if applicable.

            " + System.getProperty("line.separator") + "" + + "

            Back

            " + System.getProperty("line.separator") + "" + + "
            " + System.getProperty("line.separator") + "" + "" + System.getProperty("line.separator") + "" + ""; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFForm.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFForm.java 2005/07/19 15:28:28 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFForm.java 2005/09/30 14:48:22 1.4 @@ -34,7 +34,7 @@ // some useful variables private final String newline = System.getProperty("line.separator"); - private static final String DOMAIN = "mobycentral.icapture.ubc.ca:8090"; + private static final String DOMAIN = "mobycentral.icapture.ubc.ca"; /* (non-Javadoc) * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) @@ -50,6 +50,7 @@ String[] domains = null; // initialize central try { + //TODO - enter the endpoint here central = new CentralImpl(); domains = central.getProviders(); } catch (MobyException e) { From kawas at pub.open-bio.org Fri Sep 30 10:50:40 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri, 30 Sep 2005 10:50:40 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509301450.j8UEoeNM006580@pub.open-bio.org> kawas Fri Sep 30 10:50:40 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv6551/org/biomoby/client/ui/graphical/servlet/lsid/authority Modified Files: LSIDAuthorityData.java LSIDDataLookup.java Log Message: modified the get data logic. moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority LSIDAuthorityData.java,1.2,1.3 LSIDDataLookup.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDAuthorityData.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDAuthorityData.java 2005/08/30 23:30:58 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDAuthorityData.java 2005/09/30 14:50:40 1.3 @@ -47,19 +47,26 @@ // "No data exists for the given lsid"); LSID lsid = req.getLsid(); if (lookup.isValidDataType(lsid)) { - String datatype = lsid.getObject(); - // build the schema - Builder builder = new Builder(); - Element root = builder.buildSchema(datatype); - // create a jDom document - Document doc = new Document(root); - XMLOutputter fmt = new XMLOutputter(); - Format format = Format.getPrettyFormat(); - fmt.setFormat(format); - // convert document to string - String schema = fmt.outputString(doc); - // return an input stream - return new ByteArrayInputStream(schema.getBytes()); + + int type = lookup.dataLsidType(lsid); + if (type == LSIDDataLookup.OBJECT_CLASS) { + String datatype = lsid.getObject(); + // build the schema + Builder builder = new Builder(); + Element root = builder.buildSchema(datatype); + // create a jDom document + Document doc = new Document(root); + XMLOutputter fmt = new XMLOutputter(); + Format format = Format.getPrettyFormat(); + fmt.setFormat(format); + // convert document to string + String schema = fmt.outputString(doc); + // return an input stream + return new ByteArrayInputStream(schema.getBytes()); + } + if (type == LSIDDataLookup.SERVICE_INSTANCE) { + + } } throw new LSIDServerException(LSIDServerException.NO_DATA_AVAILABLE, "No data exists for the given lsid"); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java 2005/08/30 23:30:58 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java 2005/09/30 14:50:40 1.4 @@ -65,12 +65,34 @@ } + /** + * + * @param lsid an lsid to check whether we have 'data' on it or not + * @return true if getData has actual data under the namespace of the lsid. False otherwise. + */ public boolean isValidDataType (LSID lsid) { String ns = lsid.getNamespace(); - if (ns.equalsIgnoreCase(mobyobject.getProperty("lsid_namespace"))) + if (ns.equalsIgnoreCase(mobyobject.getProperty("lsid_namespace")) || ns.equalsIgnoreCase(mobycentral.getProperty("lsid_namespace"))) return true; return false; } + + + public int dataLsidType(LSID lsid) { + String ns = lsid.getNamespace(); + String id = lsid.getObject(); + String ver = lsid.getRevision(); + if (ver != null || (ver != null && ver.length() != 0)) + return UNKNOWN; + if (ns.equalsIgnoreCase(mobyobject.getProperty("lsid_namespace"))) { + return LSIDDataLookup.OBJECT_CLASS; + } + if (ns.equalsIgnoreCase(mobycentral.getProperty("lsid_namespace"))) { + return LSIDDataLookup.SERVICE_INSTANCE; + } + return UNKNOWN; + } + public int lsidType(LSID lsid) throws LSIDServerException { String ns = lsid.getNamespace(); String id = lsid.getObject(); From kawas at pub.open-bio.org Fri Sep 30 10:52:55 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri, 30 Sep 2005 10:52:55 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509301452.j8UEqttV006638@pub.open-bio.org> kawas Fri Sep 30 10:52:54 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder In directory pub.open-bio.org:/tmp/cvs-serv6613/org/biomoby/client/rdf/builder Modified Files: ServiceInstanceRDF.java Log Message: modified the lsid authority domain to be hard coded to biomoby.org moby-live/Java/src/main/org/biomoby/client/rdf/builder ServiceInstanceRDF.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2005/08/29 20:22:32 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2005/09/30 14:52:54 1.8 @@ -39,9 +39,14 @@ */ /** - * @author Eddie Kawas

            This class was created to present a way to retrieve a - * service instances' RDF using just a service name and authority.

            For - * questions, comments, or bugs

            email me at edward.kawas at gmail.com + * @author Eddie Kawas + *

            + * This class was created to present a way to retrieve a service + * instances' RDF using just a service name and authority. + *

            + * For questions, comments, or bugs + *

            + * email me at edward.kawas at gmail.com */ public class ServiceInstanceRDF { @@ -79,10 +84,13 @@ /** * - * PRE:name is either a valid name or null

            POST:If - * authorURI is a valid authority, then a RDF containing all of the service - * instances will be returned. If authorURI and name are valid then a single - * RDF containing just the service instance identified by name is returned.

            + * PRE: name is either a valid name or null + *

            + * POST: If authorURI is a valid authority, then a RDF containing all + * of the service instances will be returned. If authorURI and name are + * valid then a single RDF containing just the service instance identified + * by name is returned. + *

            * * @param authorURI - * the authority to query @@ -108,8 +116,11 @@ /** * * method that retrieves the RDF describing a specific service instance - * based on the parameters domain, serviceName, url and uri.

            PRE:None. - *

            POST:The RDF describing the service with parameters domain, + * based on the parameters domain, serviceName, url and uri. + *

            + * PRE: None. + *

            + * POST: The RDF describing the service with parameters domain, * serviceName, url and uri is created. * * @param domain - @@ -282,11 +293,23 @@ .getCategory(), "en")); subject.addProperty(DC.source, model.createTypedLiteral(services[i] .getURL())); - subject.addProperty(DC.identifier, model - .createTypedLiteral("urn:lsid:" - + MobyProperties.SERVICE_INSTANCE_PROPERTIES().getProperty("lsid_authority") +":" - + MobyProperties.SERVICE_INSTANCE_PROPERTIES().getProperty("lsid_namespace") +":"+ services[i].getAuthority() - + "," + services[i].getName())); + subject + .addProperty( + DC.identifier, + model + .createTypedLiteral("urn:lsid:" + + "biomoby.org" + + ":" + + (MobyProperties + .SERVICE_INSTANCE_PROPERTIES() + .getProperty( + "lsid_namespace") == null ? "serviceinstance" + : MobyProperties + .SERVICE_INSTANCE_PROPERTIES() + .getProperty( + "lsid_namespace")) + + ":" + services[i].getAuthority() + + "," + services[i].getName())); subject.addProperty(Predicates.performs_task, model .createResource(SRV + services[i].getType())); subject.addProperty(Predicates.SignatureURL, model @@ -375,8 +398,7 @@ .getDefaultValue())); _li.addProperty(Predicates.datatype, model .createTypedLiteral(data.getDataType())); - _li.addProperty(RDF.type, - Predicates.Secondary); + _li.addProperty(RDF.type, Predicates.Secondary); if (data.getDataType().equals("Integer")) { _li .addProperty(Predicates.min, model @@ -476,7 +498,7 @@ return stream.getOutput(); } - + /* * convenience method that adds a resource to a model */ @@ -519,9 +541,12 @@ /** * - * PRE:None

            POST:If a service instance exists such that - * it has a name of name and an authoring URI of uri true is returned, - * otherwise false is returned.

            + * PRE: None + *

            + * POST: If a service instance exists such that it has a name of name + * and an authoring URI of uri true is returned, otherwise false is + * returned. + *

            * * @param uri - * the authors uri @@ -554,10 +579,13 @@ /** * - * Usage: ServiceInstanceRDF authorityURI [serviceName]

            - * authorityURI: is the authortitys' domain to query

            - * serviceName:optional argument that identifies a specific service - * instance

            + * Usage: ServiceInstanceRDF authorityURI [serviceName] + *

            + * authorityURI: is the authortitys' domain to query + *

            + * serviceName: optional argument that identifies a specific service + * instance + *

            * * @throws LSIDException */ @@ -588,4 +616,4 @@ public String getOutput() { return sb.toString(); } -} +} \ No newline at end of file From mwilkinson at pub.open-bio.org Fri Sep 30 19:08:36 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Fri, 30 Sep 2005 19:08:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509302308.j8UN8apA008098@pub.open-bio.org> mwilkinson Fri Sep 30 19:08:35 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv8079/MOBY Modified Files: OntologyServer.pm Log Message: OntologyServer was returning NCBI_Acc as the namespace if you passed it a null query. Yuck moby-live/Perl/MOBY OntologyServer.pm,1.86,1.87 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.86 retrieving revision 1.87 diff -u -r1.86 -r1.87 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/27 14:44:34 1.86 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/30 23:08:35 1.87 @@ -191,6 +191,7 @@ $term =~ s/^moby://; # if the term is namespaced, then remove that my $sth; return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); + return (0, undef, undef) unless defined $term; my $result; @@ -653,6 +654,8 @@ { return ( 1, "external ontology", $term ); } + return (0, undef, undef) unless defined $term; + my $result; $result = $adaptor->query_service(type => $term); my $row = shift(@$result); @@ -783,6 +786,7 @@ return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'namespace' ); my $term = $args{term}; + return (0, undef, undef) unless defined $term; $term =~ s/^moby://; # if the term is namespaced, then remove that if ( $term =~ /^urn:lsid/ && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) From mwilkinson at pub.open-bio.org Fri Sep 30 19:14:13 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Fri, 30 Sep 2005 19:14:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509302314.j8UNED1p008168@pub.open-bio.org> mwilkinson Fri Sep 30 19:14:12 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv8149/MOBY Modified Files: OntologyServer.pm Log Message: OntologyServer was returning NCBI_Acc as the namespace if you passed it a null query. Yuck moby-live/Perl/MOBY OntologyServer.pm,1.87,1.88 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.87 retrieving revision 1.88 diff -u -r1.87 -r1.88 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/30 23:08:35 1.87 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/30 23:14:12 1.88 @@ -191,7 +191,7 @@ $term =~ s/^moby://; # if the term is namespaced, then remove that my $sth; return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); - return (0, undef, undef) unless defined $term; + return (0, undef, undef) unless $term; my $result; @@ -654,7 +654,7 @@ { return ( 1, "external ontology", $term ); } - return (0, undef, undef) unless defined $term; + return (0, undef, undef) unless $term; my $result; $result = $adaptor->query_service(type => $term); @@ -786,7 +786,7 @@ return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'namespace' ); my $term = $args{term}; - return (0, undef, undef) unless defined $term; + return (0, undef, undef) unless $term; $term =~ s/^moby://; # if the term is namespaced, then remove that if ( $term =~ /^urn:lsid/ && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) From mwilkinson at pub.open-bio.org Fri Sep 30 19:23:13 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Fri, 30 Sep 2005 19:23:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509302323.j8UNNDR8008272@pub.open-bio.org> mwilkinson Fri Sep 30 19:23:13 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv8253/MOBY Modified Files: CommonSubs.pm Log Message: the behaviour of getNodeContentsWithArticle were not as advertised in the documentation. They should be now. Text content of the outermost MOBY object node can be extracted if you pass it either the that node, or the Simple article containing that node. moby-live/Perl/MOBY CommonSubs.pm,1.69,1.70 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.69 retrieving revision 1.70 diff -u -r1.69 -r1.70 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/09/21 19:05:14 1.69 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/09/30 23:23:13 1.70 @@ -972,6 +972,13 @@ my @contents; return () unless ( (ref( $node ) =~ /XML\:\:LibXML/) && $element); + + my $nodes = $node->getElementsByTagName( $element ); + unless ( $nodes->get_node( 1 ) ) { + $nodes = $node->getElementsByTagName("moby:$element"); + } + $node = $nodes->get_node(1); # this routine should only ever be called if there is only one possible answer, so this is safe + unless ($articleName){ # the request is for root node if no articleName my $resp; foreach my $child($node->childNodes){ @@ -983,11 +990,6 @@ return @contents; } - my $nodes = $node->getElementsByTagName( $element ); - unless ( $nodes->get_node( 1 ) ) { - $nodes = $node->getElementsByTagName("moby:$element"); - } - # if there is an articleName, then get that specific node for ( 1 .. $nodes->size() ) { my $child = $nodes->get_node( $_ ); From kawas at pub.open-bio.org Thu Sep 1 00:03:56 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 31 Aug 2005 20:03:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509010003.j8103u7G002355@pub.open-bio.org> kawas Wed Aug 31 20:03:56 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool In directory pub.open-bio.org:/tmp/cvs-serv2330/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool Modified Files: DescriptionWindow.java Log Message: commented out a method call specific to java 1.5 sorry martin :-) moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool DescriptionWindow.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/DescriptionWindow.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/DescriptionWindow.java 2005/08/31 23:53:46 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/serviceInstanceCreationTool/DescriptionWindow.java 2005/09/01 00:03:56 1.2 @@ -59,7 +59,7 @@ this.setSize(500, 500); this.setContentPane(getPanel()); this.setLocationRelativeTo(null); - this.setAlwaysOnTop(true); + //this.setAlwaysOnTop(true); } /** * This method initializes jContentPane From senger at pub.open-bio.org Thu Sep 1 01:30:07 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 31 Aug 2005 21:30:07 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509010130.j811U7Q4002580@pub.open-bio.org> senger Wed Aug 31 21:30:07 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv2557 Modified Files: build.properties.template build.xml Log Message: moby-live/Java build.properties.template,1.4,1.5 build.xml,1.24,1.25 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.properties.template,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/build.properties.template 2005/08/26 06:27:02 1.4 +++ /home/repository/moby/moby-live/Java/build.properties.template 2005/09/01 01:30:07 1.5 @@ -7,7 +7,7 @@ build.compiler = jikes -#dot.path = /path/to/dot +#dot.location = /path/to/dot #proxySet = true #http.proxyHost = your proxy host #http.proxyPort = your proxy port @@ -17,19 +17,19 @@ # properties is in the deployment descriptor in # 'src/webapps/web.xml.template -catalina.home = /home/senger/Software/jakarta-catalina -provider.name = Martin Senger -provider.email = senger at ebi.ac.uk -refresh.interval = 3 -cache.dir = /tmp/jmoby -cache.url = http://localhost/jmobycache -default.endpoint = http://localhost/cgi-bin/moby -default.namespace = http://mobycentral.cbr.nrc.ca/MOBY/Central +#catalina.home = /home/senger/Software/jakarta-catalina +#provider.name = your-name +#provider.email = your-email-address +#refresh.interval = 3 +#cache.dir = /tmp/jmoby +#cache.url = http://localhost/jmobycache +#default.endpoint = http://localhost/cgi-bin/moby +#default.namespace = http://mobycentral.cbr.nrc.ca/MOBY/Central -servlet.name.graphs = graphs -servlet.url.graphs = /graphs/* +#servlet.name.graphs = graphs +#servlet.url.graphs = /graphs/* -registry.cache.dir = /tmp/mobycache +#registry.cache.dir = /tmp/mobycache #moses.filter.dt #moses.service = runFasta =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- /home/repository/moby/moby-live/Java/build.xml 2005/08/31 11:39:05 1.24 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/01 01:30:07 1.25 @@ -175,8 +175,8 @@ - - + + @@ -302,8 +302,8 @@ -

            Generated: ${TODAY_LONG}]]>
            - Submit a bug or feature
            Generated: ${TODAY_LONG}]]>
            +
            Generated: ${TODAY_LONG}]]>
            + Submit a bug or feature
            Generated: ${TODAY_LONG}]]>
            @@ -561,7 +561,7 @@ - + @@ -905,8 +905,8 @@ -
            Generated: ${TODAY_LONG}]]>
            - Submit a bug or feature
            Generated: ${TODAY_LONG}]]>
            +
            Generated: ${TODAY_LONG}]]>
            + Submit a bug or feature
            Generated: ${TODAY_LONG}]]>
            @@ -980,9 +980,6 @@ - - - @@ -1065,9 +1062,6 @@ - - - @@ -1084,9 +1078,9 @@ - + - + @@ -1218,8 +1212,8 @@ -
            Generated: ${TODAY_LONG}]]>
            - Submit a bug or feature
            Generated: ${TODAY_LONG}]]>
            +
            Generated: ${TODAY_LONG}]]>
            + Submit a bug or feature
            Generated: ${TODAY_LONG}]]>
            From senger at pub.open-bio.org Thu Sep 1 05:51:18 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 1 Sep 2005 01:51:18 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509010551.j815pIJa003222@pub.open-bio.org> senger Thu Sep 1 01:51:18 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv3203 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.25,1.26 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/01 01:30:07 1.25 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/01 05:51:18 1.26 @@ -612,10 +612,21 @@ - - - - + + + + + + + + + From senger at pub.open-bio.org Thu Sep 1 05:51:18 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 1 Sep 2005 01:51:18 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509010551.j815pIw8003237@pub.open-bio.org> senger Thu Sep 1 01:51:18 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv3203/src/Clients Added Files: TestArgs.java Log Message: moby-live/Java/src/Clients TestArgs.java,NONE,1.1 From senger at pub.open-bio.org Thu Sep 1 08:01:16 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 1 Sep 2005 04:01:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509010801.j8181GTC004629@pub.open-bio.org> senger Thu Sep 1 04:01:16 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv4610 Modified Files: build.xml Log Message: windows scripts improved moby-live/Java build.xml,1.26,1.27 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/01 05:51:18 1.26 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/01 08:01:16 1.27 @@ -618,7 +618,7 @@ --> - + From senger at pub.open-bio.org Thu Sep 1 08:01:16 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 1 Sep 2005 04:01:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509010801.j8181Gau004648@pub.open-bio.org> senger Thu Sep 1 04:01:16 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv4610/docs Modified Files: ChangeLog Log Message: windows scripts improved moby-live/Java/docs ChangeLog,1.38,1.39 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/08/31 11:39:06 1.38 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/01 08:01:16 1.39 @@ -1,3 +1,8 @@ +2005-09-01 Martin Senger + + * Fixed the Windows run...bat scripts in order to accept spaces in + the file names (many double quotes added) + 2005-08-31 Martin Senger * Fixed build.xml (javadoc target) to run under Windows (newlines From senger at pub.open-bio.org Thu Sep 1 08:01:16 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 1 Sep 2005 04:01:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509010801.j8181GXN004701@pub.open-bio.org> senger Thu Sep 1 04:01:16 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv4610/src/config Modified Files: run-any-client.bat run-cache-client.bat run-cmdline-client.bat run-digest-client.bat run-generator.bat run-graphs-client.bat run-moby-parser.bat run-service.bat run-testing-central.bat Log Message: windows scripts improved moby-live/Java/src/config run-any-client.bat,1.2,1.3 run-cache-client.bat,1.1,1.2 run-cmdline-client.bat,1.1,1.2 run-digest-client.bat,1.1,1.2 run-generator.bat,1.1,1.2 run-graphs-client.bat,1.1,1.2 run-moby-parser.bat,1.1,1.2 run-service.bat,1.1,1.2 run-testing-central.bat,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-any-client.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/08/26 06:27:03 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/09/01 08:01:16 1.3 @@ -1,12 +1,12 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% -set CP=%PROJECT_HOME%\build\others\datatypes;%CP% -set CP=%PROJECT_HOME%\build\others\skeletons;%CP% -set CP=%PROJECT_HOME%\build\others\samples;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" +set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" +set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" +set "CP=%PROJECT_HOME%\build\others\samples;%CP%" -java -classpath %CP% %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat 2004/11/14 16:12:50 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat 2005/09/01 08:01:16 1.2 @@ -1,9 +1,9 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" -java -classpath %CP% CacheRegistryClient %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" CacheRegistryClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2004/09/23 00:18:01 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2005/09/01 08:01:16 1.2 @@ -1,9 +1,9 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" -java -classpath %CP% MobyCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" MobyCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat 2004/11/14 16:43:49 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat 2005/09/01 08:01:16 1.2 @@ -1,9 +1,9 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" -java -classpath %CP% MobyDigestClient %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" MobyDigestClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-generator.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-generator.bat 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-generator.bat 2005/09/01 08:01:16 1.2 @@ -1,11 +1,11 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% -set CP=%PROJECT_HOME%\build\others\datatypes;%CP% -set CP=%PROJECT_HOME%\build\others\skeletons;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" +set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" +set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" -java -classpath %CP% MosesGenerators %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" MosesGenerators %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat 2004/09/23 00:18:01 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat 2005/09/01 08:01:16 1.2 @@ -1,9 +1,9 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" -java -classpath %CP% MobyGraphs %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" MobyGraphs %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat 2005/09/01 08:01:16 1.2 @@ -1,10 +1,10 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% -set CP=%PROJECT_HOME%\build\others\datatypes;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" +set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" -java -classpath %CP% TestingMobyParser %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" TestingMobyParser %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-service.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-service.bat 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-service.bat 2005/09/01 08:01:16 1.2 @@ -1,12 +1,12 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% -set CP=%PROJECT_HOME%\build\others\datatypes;%CP% -set CP=%PROJECT_HOME%\build\others\skeletons;%CP% -set CP=%PROJECT_HOME%\build\others\samples;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" +set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" +set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" +set "CP=%PROJECT_HOME%\build\others\samples;%CP%" -java -classpath %CP% org.biomoby.client.BaseCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" org.biomoby.client.BaseCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat 2004/09/23 00:18:01 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat 2005/09/01 08:01:16 1.2 @@ -1,9 +1,9 @@ @echo off -set PROJECT_HOME=@PROJECT_HOME@ +set "PROJECT_HOME=@PROJECT_HOME@" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call %PROJECT_HOME%\cp.bat %%i -set CP=%PROJECT_HOME%\build\classes;%CP% -set CP=%PROJECT_HOME%\build\Clients;%CP% +for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i +set "CP=%PROJECT_HOME%\build\classes;%CP%" +set "CP=%PROJECT_HOME%\build\Clients;%CP%" -java -classpath %CP% TestingCentral %1 %2 %3 %4 %5 %6 %7 %8 %9 +java -classpath "%CP%" TestingCentral %1 %2 %3 %4 %5 %6 %7 %8 %9 From fgibbons at pub.open-bio.org Thu Sep 1 13:50:46 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Thu, 1 Sep 2005 09:50:46 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509011350.j81DokKV005950@pub.open-bio.org> fgibbons Thu Sep 1 09:50:46 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv5921/t Modified Files: Client-Central.t Client-Service.t Log Message: - Make distinctions in API moby-live/Perl/t Client-Central.t,1.40,1.41 Client-Service.t,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Central.t,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- /home/repository/moby/moby-live/Perl/t/Client-Central.t 2005/08/31 22:31:55 1.40 +++ /home/repository/moby/moby-live/Perl/t/Client-Central.t 2005/09/01 13:50:46 1.41 @@ -11,7 +11,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; #use SOAP::Lite +trace; -use Test::More 'no_plan'; #tests => 127; # perldoc Test::More for details +use Test::More 'no_plan'; #skip_all => "Turn off for development"; # See perldoc Test::More for details use strict; use Data::Dumper; #Is the client-code even installed? @@ -55,7 +55,31 @@ isa_ok( $C, 'MOBY::Client::Central',"Connected to test MOBY Central") or die("Cannot Connect to MOBY Central... cannot continue?"); +############ ENFORCE REGISTRY API ############### +# First, mandatory methods for all registries. +my @mandatory = qw/findService retrieveService +retrieveResourceURLs retrieveServiceProviders retrieveServiceNames +retrieveServiceTypes retrieveObjectNames retrieveObjectDefinition +retrieveNamespaces retrieveObjectSchema Relationships/; + +my @mandatory_if_write_access = qw/registerObjectClass deregisterObjectClass +registerServiceType deregisterServiceType +registerNamespace deregisterNamespace +registerService deregisterService/; + +my @optional_recommended = qw/DUMP registerServiceWSDL/; + +can_ok($C, @mandatory ) + or diag("Registry failed to supply mandatory methods"); + +# How do we check whether the registry has 'write' access - most will, so take as default. +can_ok($C, @mandatory_if_write_access) + or diag("Registry has 'write' access and failed to supply mandatory methods"); +# Optional, but probably recommended methods +can_ok($C, @optional_recommended) + or diag("Registry does not supply certain optional methods;\n" + . "you should consider adding them"); ################## MOBY Registration Tests ################# ################## OBJECT REGISTRATION ############# =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Service.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/08/30 19:14:29 1.1 +++ /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/01 13:50:46 1.2 @@ -40,8 +40,8 @@ Even if we do that, we should clearly specify which is the preferred name. OPINION -can_ok("MOBY::Client::Service", qw/new execute ServiceName/) - or diag($opinion); +my @API = qw/new execute ServiceName/; +can_ok("MOBY::Client::Service", @API) or diag($opinion); is(MOBY::Client::Service->new(), undef) or diag("Created a new service without supplying any WSDL - it ain't right, I tell you!"); # Can't do nothing without WSDL From fgibbons at pub.open-bio.org Thu Sep 1 14:00:00 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Thu, 1 Sep 2005 10:00:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509011400.j81E00jc006035@pub.open-bio.org> fgibbons Thu Sep 1 10:00:00 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv6010/MOBY Modified Files: CommonSubs.pm Log Message: - Test for namespace agreement in a way that avoids warning messages. Also remove redundant 'name:' lines, which merely duplicate the =head2 lines above them. moby-live/Perl/MOBY CommonSubs.pm,1.67,1.68 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.67 retrieving revision 1.68 diff -u -r1.67 -r1.68 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/08/30 15:31:52 1.67 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/09/01 14:00:00 1.68 @@ -248,7 +248,6 @@ =head2 genericServiceInputParser - name : genericServiceInputParser function : For the MOST SIMPLE SERVICES that take single Simple or Collection inputs and no Secondaries/Parameters this routine takes the MOBY message and breaks the objects out of it in a useful way @@ -329,7 +328,7 @@ =head2 serviceInputParser - name : DO NOT USE!! + DO NOT USE!! function : to take a MOBY message and break the objects out of it. This is identical to the genericServiceInputParser method above, except that it returns the data as Objects rather than XML::LibXML nodes. This is an improvement! @@ -372,7 +371,6 @@ =head2 complexServiceInputParser - name : complexServiceInputParser function : For more complex services that have multiple articles for each input and/or accept parameters, this routine will take a MOBY message and extract the Simple/Collection/Parameter objects out of it in a @@ -534,7 +532,6 @@ =head2 getSimpleArticleIDs - name : getSimpleArticleIDs function : to get the IDs of simple articles that are in the given namespace usage : my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles); my @ids = getSimpleArticleIDs(\@SimpleArticles); @@ -566,15 +563,17 @@ return undef unless scalar @{$input_nodes}; my @input_nodes = @{$input_nodes}; my $OS = MOBY::Client::OntologyServer->new; - my ( $s, $m ); + my ( $s, $m, $namespace_lsid ); if ( $desired_namespace ) { - ( $s, $m, $desired_namespace ) = + ( $s, $m, $namespace_lsid ) = $OS->namespaceExists( term => $desired_namespace ); # returns (success, message, lsid) unless ( $s ) { # bail if not successful - print STDERR - "MOBY::CommonSubs WARNING ** the namespace '$desired_namespace' does not exist in the MOBY ontology, and is not a valid LSID\n"; + # Printing to STDERR is not very helpful - we should probably return something that can be dealt iwth programatically.... + print STDERR "MOBY::CommonSubs WARNING ** the namespace '$desired_namespace' " + . "does not exist in the MOBY ontology, and does not have a valid LSID\n"; return undef; } + $desired_namespace = $namespace_lsid; # Replace namespace with fully-qualified LSID } my @ids; foreach my $in ( @input_nodes ) { @@ -593,13 +592,15 @@ } $ns = $ns->getValue; # if we have a namespace, then get its value ( $s, $m, $ns ) = $OS->namespaceExists( term => $ns ); - unless ( $ns eq $desired_namespace ) + # A bad namespace will return 'undef' which makes for a bad comparison (Perl warning). + # Better to check directly for success ($s), THEN check that namespace is the one we wanted. + unless ( $s && $ns eq $desired_namespace ) { # we are registering as working in a particular namespace, so check this push @ids, undef; # and push undef onto the stack if it isn't next; } } - + # Now do the same thing for ID's my $id = $_->getAttributeNode( 'id' ) || $_->getAttributeNode( 'moby:id' ); unless ( $id ) { @@ -619,7 +620,6 @@ =head2 getSimpleArticleNamespaceURI - name : getSimpleArticleNamespaceURI function : to get the namespace of a simple article usage : my $ns = getSimpleArticleNamespaceURI($SimpleArticle); args : $Simple - (required) a single XML::LibXML node representing a Simple Article @@ -655,7 +655,6 @@ =head2 simpleResponse - name : simpleResponse function : wraps a simple article in the appropriate (mobyData) structure usage : $resp .= &simpleResponse($object, 'MyArticleName', $queryID); args : (in order) @@ -700,7 +699,6 @@ =head2 collectionResponse - name : collectionResponse function : wraps a set of articles in the appropriate mobyData structure usage : return responseHeader . &collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter; args : (in order) @@ -753,7 +751,6 @@ =head2 complexResponse - name : complexResponse function : wraps articles in the appropriate (mobyData) structure usage : $resp .= &complexResponse(\@data, $qID); args : (in order) @@ -809,7 +806,6 @@ =head2 responseHeader - name : responseHeader function : print the XML string of a MOBY response header +/- serviceNotes usage : responseHeader('illuminae.com') responseHeader( @@ -846,7 +842,6 @@ =head2 responseFooter - name : responseFooter function : print the XML string of a MOBY response footer usage : return responseHeader('illuminae.com') . $DATA . responseFooter; notes : returns everything required after the response articles themselves @@ -880,7 +875,6 @@ =head2 getInputs - name : getInputs function : get the mobyData block(s) as XML::LibXML nodes usage : @queryInputs = getInputArticles($XML) args : the raw XML of a query, or an XML::LibXML document @@ -908,7 +902,6 @@ =head2 getInputID - name : getInputID function : get the value of the queryID element usage : @queryInputs = getInputID($XML) args : the raw XML or XML::LibXML of a queryInput or mobyData block (e.g. from getInputs) @@ -931,7 +924,7 @@ =head2 getArticlesAsObjects - name : DO NOT USE!! + DO NOT USE!! function : get the Simple/Collection articles for a single mobyData or queryResponse node, rethrning them as SimpleArticle, SecondaryArticle, or ServiceInstance objects @@ -970,7 +963,6 @@ =head2 getCollectedSimples - name : getCollectedSimples function : get the Simple articles collected in a moby:Collection block usage : @Simples = getCollectedSimples($XML) args : raw XML or XML::LibXML of a moby:Collection block @@ -995,7 +987,6 @@ =head2 getInputArticles - name : getInputArticles function : get the Simple/Collection articles for each input query, in order usage : @queries = getInputArticles($XML) args : the raw XML of a moby:MOBY query @@ -1050,7 +1041,6 @@ =head2 isSimpleArticle - name : isSimpleArticle function : tests XML (text) or an XML DOM node to see if it represents a Simple article usage : if (isSimpleArticle($node)){do something to it} input : an XML::LibXML node, an XML::LibXML::Document or straight XML @@ -1071,7 +1061,6 @@ =head2 isCollectionArticle - name : isCollectionArticle function : tests XML (text) or an XML DOM node to see if it represents a Collection article usage : if (isCollectionArticle($node)){do something to it} input : an XML::LibXML node, an XML::LibXML::Document or straight XML @@ -1090,7 +1079,6 @@ =head2 isSecondaryArticle - name : isSecondaryArticle function : tests XML (text) or an XML DOM node to see if it represents a Secondary article usage : if (isSecondaryArticle($node)){do something to it} input : an XML::LibXML node, an XML::LibXML::Document or straight XML @@ -1111,7 +1099,6 @@ =head2 extractRawContent - name : extractRawContent function : pass me an article (Simple, or Collection) and I'll give you the content AS A STRING - i.e. the raw XML of the contained MOBY Object(s) usage : extractRawContent($simple) @@ -1133,7 +1120,6 @@ =head2 getNodeContentWithArticle - name : getNodeContentWithArticle function : a very flexible way to get the stringified content of a node that has the correct element and article name or get the value of a Parameter element. @@ -1296,7 +1282,6 @@ =head2 validateNamespaces - name : validateNamespaces function : checks the namespace ontology for the namespace lsid usage : @LSIDs = validateNamespaces(@namespaces) args : ordered list of either human-readable or lsid presumptive namespaces @@ -1321,7 +1306,6 @@ =head2 validateThisNamespace - name : validateThisNamespace function : checks a given namespace against a list of valid namespaces usage : $valid = validateThisNamespace($ns, @validNS); args : ordered list of the namespace of interest and the list of valid NS's @@ -1339,7 +1323,6 @@ =head2 getResponseArticles (a.k.a. extractResponseArticles) - name : getResponseArticles function : get the DOM nodes corresponding to individual Simple or Collection outputs from a MOBY Response usage : ($collections, $simples) = getResponseArticles($node) @@ -1411,7 +1394,6 @@ =head2 getServiceNotes - name : getServiceNotes function : to get the content of the Service Notes block of the MOBY message usage : getServiceNotes($message) args : $message is either the XML::LibXML of the MOBY message, or plain XML @@ -1443,7 +1425,6 @@ =head2 getCrossReferences - name : getCrossReferences function : to get the cross-references for a Simple article usage : @xrefs = getCrossReferences($XML) args : $XML is either a SIMPLE article (...) @@ -1501,7 +1482,6 @@ =head2 whichDeepestParentObject - name : whichDeepestParentObject function : select the parent node from nodeList that is closest to the querynode usage : ($term, $lsid) = whichDeepestParentObject($CENTRAL, $queryTerm, \@termList) From fgibbons at pub.open-bio.org Thu Sep 1 16:09:40 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Thu, 1 Sep 2005 12:09:40 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509011609.j81G9e0G006651@pub.open-bio.org> fgibbons Thu Sep 1 12:09:40 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv6626/t Modified Files: Client-OntologyServer.t Log Message: - Test that 'Exists' functions return success/failure when they should. The relationship function seems to fail, perhaps the test is wrong. moby-live/Perl/t Client-OntologyServer.t,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/08/31 14:17:11 1.1 +++ /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/01 16:09:39 1.2 @@ -14,8 +14,6 @@ #use SOAP::Lite +trace; use Test::More 'no_plan'; # perldoc Test::More for details use strict; -use English; -use Data::Dumper; use MOBY::Client::OntologyServer; #Is the client-code even installed? BEGIN { use_ok('MOBY::Client::OntologyServer') }; @@ -33,8 +31,68 @@ my @API = (@autoload, qw/new getUserAgent objectExists serviceExists namespaceExists relationshipExists/); -my $si = MOBY::Client::OntologyServer->new(); -foreach (@autoload) {eval{$si->$_};} # Call all AUTOLOAD methods, to create them. +my $os = MOBY::Client::OntologyServer->new(); +foreach (@autoload) {eval{$os->$_};} # Call all AUTOLOAD methods, to create them. can_ok("MOBY::Client::OntologyServer", @API) or diag("OntologyServer doesn't implement full API"); +################ CHECK THAT VALID STUFF RETURNS CORRECTLY ########## +# +# It would really be better not to have literal lists of valid namespaces here, +# Can we pull the entire list of valid namespaces in programmatically from somewhere, +# and check them all here? Ditto for Objects, Service-types +# +my ($success, $msg, $existingURI); +my @check_ns = qw/SGD NCBI_gi/; +foreach (@check_ns) { + ($success, $msg, $existingURI) = $os->namespaceExists( term => $_); + is($success, 1) + or diag("Namespace '$_' reported erroneously as non-existent."); +} + +my @check_obj = qw/ Object String Integer Float/; +foreach (@check_obj) { + ($success, $msg, $existingURI) = $os->objectExists(term => $_); + is($success, 1) + or diag("Object '$_' reported erroneously as non-existent."); +} + +my @check_servicetype = qw/Retrieval/; +foreach (@check_servicetype) { + ($success, $msg, $existingURI) = $os->serviceExists(term => $_); + is($success, 1) + or diag("Service type '$_' reported erroneously as non-existent."); +} + +my @check_rel = qw/ISA HASA HAS/; +foreach (@check_rel) { + ($success, $msg, $existingURI) = $os->relationshipExists(term => $_); + is($success, 1) + or diag("Relationship '$_' reported erroneously as non-existent."); +} + + +######### CHECK THAT *IN*VALID STUFF FAILS CORRECTLY ############### +# +# Literal invalid names are OK here, since there's no obvious way to generate them +# and guarantee that they'll be invalid. +# +my $invalid_ns = "InvalidNS"; +($success, $msg, $existingURI) = $os->namespaceExists( term => $invalid_ns); +is($success, 0) + or diag("Namespace '$invalid_ns' reported erroneously as existent."); + +my $invalid_obj = "InvalidObject"; +($success, $msg, $existingURI) = $os->objectExists(term => $invalid_obj); +is($success, 0) + or diag("Object '$invalid_obj' reported erroneously as existent."); + +my $invalid_st = "InvalidServiceType"; +($success, $msg, $existingURI) = $os->serviceExists(term => $invalid_st); +is($success, 0) + or diag("Service type '$invalid_st' reported erroneously as existent."); + +my $invalid_rel = "HA"; +($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel); +is($success, 0) + or diag("Relationship '$invalid_rel' reported erroneously as existent."); From mwilkinson at pub.open-bio.org Thu Sep 1 20:04:40 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 1 Sep 2005 16:04:40 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509012004.j81K4eVc007213@pub.open-bio.org> mwilkinson Thu Sep 1 16:04:40 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv7194/MOBY/Client Modified Files: Service.pm Log Message: fixed docs for Client Service, added a version attribute to the MOBY tag. moby-live/Perl/MOBY/Client Service.pm,1.20,1.21 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/06/30 11:47:19 1.20 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/09/01 20:04:40 1.21 @@ -66,8 +66,9 @@ ( service => [ undef, 'read/write' ], uri => [ undef, 'read/write' ], - ServiceName => [ undef, 'read/write' ], + serviceName => [ undef, 'read/write' ], _soapService => [ undef, 'read/write' ], + smessageVersion => ['0.87', 'read' ], ); #_____________________________________________________________ @@ -123,7 +124,7 @@ return undef unless $wsdl; my $soap = SOAP::Lite->service( "data:,$wsdl" ); if ( $self->uri ) { $soap->uri( $self->uri ) } - $self->ServiceName( &getServiceName( $soap ) ); + $self->serviceName( &_getServiceName( $soap ) ); $self->_soapService( $soap ); return $self; } @@ -219,8 +220,9 @@ # this was added on January 19th, 2005 and may not work! ################### ################### + my $version = $self->smessageVersion(); $data = " - + $data @@ -246,11 +248,21 @@ return $@ ? "" : $response; # the service execution failed then pass back "" } -=head2 ServiceName +=head2 serviceName - Title : ServiceName - Usage : $name = $Service->name() - Function : retrieve the name of your service + Title : serviceName + Usage : $name = $Service->serviceName() + Function : get the name of the service + Returns : string + Args : none + +=cut + +=head2 _getServiceName + + Title : getServiceName + Usage : $name = $Service->getServiceName() + Function : Internal method to retrieve the name of the service from the SOAP object Returns : string Args : none From mwilkinson at pub.open-bio.org Thu Sep 1 20:14:17 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 1 Sep 2005 16:14:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509012014.j81KEHXm007298@pub.open-bio.org> mwilkinson Thu Sep 1 16:14:17 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv7279/MOBY/Client Modified Files: Service.pm Log Message: fixed docs for Client Service, added a version attribute to the MOBY tag. moby-live/Perl/MOBY/Client Service.pm,1.21,1.22 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/09/01 20:04:40 1.21 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/09/01 20:14:17 1.22 @@ -241,7 +241,7 @@ # $data # #]]>"; - my $METHOD = $self->ServiceName; + my $METHOD = $self->serviceName; &_LOG( %args, $METHOD ); my $response; eval { ( $response ) = $self->_soapService->$METHOD( $data ) }; @@ -260,8 +260,8 @@ =head2 _getServiceName - Title : getServiceName - Usage : $name = $Service->getServiceName() + Title : _getServiceName + Usage : $name = $Service->_getServiceName() Function : Internal method to retrieve the name of the service from the SOAP object Returns : string Args : none From mwilkinson at pub.open-bio.org Thu Sep 1 20:16:04 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 1 Sep 2005 16:16:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509012016.j81KG4aH007386@pub.open-bio.org> mwilkinson Thu Sep 1 16:16:04 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv7367/MOBY/Client Modified Files: Service.pm Log Message: fixed docs for Client Service, added a version attribute to the MOBY tag. moby-live/Perl/MOBY/Client Service.pm,1.22,1.23 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/09/01 20:14:17 1.22 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Service.pm 2005/09/01 20:16:04 1.23 @@ -268,7 +268,7 @@ =cut -sub getServiceName { +sub _getServiceName { my ( $service ) = @_; no strict; my ( $method ) = @{ join '::', ref $service, 'EXPORT_OK' }; From mwilkinson at pub.open-bio.org Thu Sep 1 20:20:13 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Thu, 1 Sep 2005 16:20:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509012020.j81KKDs7007458@pub.open-bio.org> mwilkinson Thu Sep 1 16:20:13 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv7439/t Modified Files: Client-Service.t Log Message: updating test for ClientService moby-live/Perl/t Client-Service.t,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Service.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/01 13:50:46 1.2 +++ /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/01 20:20:13 1.3 @@ -33,14 +33,9 @@ my $opinion = <new(), undef) From senger at pub.open-bio.org Fri Sep 2 07:31:50 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 2 Sep 2005 03:31:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020731.j827VoHB009022@pub.open-bio.org> senger Fri Sep 2 03:31:50 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv9004/dashboard Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard added to the repository moby-live/Java/src/main/org/biomoby/service/dashboard - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Sep 2 07:37:42 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 2 Sep 2005 03:37:42 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020737.j827bgxr009068@pub.open-bio.org> senger Fri Sep 2 03:37:42 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files In directory pub.open-bio.org:/tmp/cvs-serv9050/doc-files Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files added to the repository moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Sep 2 07:38:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 2 Sep 2005 03:38:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020738.j827calY009132@pub.open-bio.org> senger Fri Sep 2 03:38:35 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv9113 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.27,1.28 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/01 08:01:16 1.27 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/02 07:38:35 1.28 @@ -80,6 +80,9 @@ + + + From senger at pub.open-bio.org Fri Sep 2 07:38:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 2 Sep 2005 03:38:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020738.j827caMg009151@pub.open-bio.org> senger Fri Sep 2 03:38:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv9113/src/config Modified Files: run-any-client Log Message: moby-live/Java/src/config run-any-client,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-any-client,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-any-client 2005/08/26 06:27:03 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-any-client 2005/09/02 07:38:36 1.3 @@ -15,5 +15,6 @@ CLASSPATH=${PROJECT_HOME}/build/others/skeletons:$CLASSPATH CLASSPATH=${PROJECT_HOME}/build/others/samples:$CLASSPATH CLASSPATH=`echo ${PROJECT_HOME}/lib/*.jar | tr ' ' ':'`:$CLASSPATH +###CLASSPATH=`echo ${PROJECT_HOME}/lib/ant_home/lib/*.jar | tr ' ' ':'`:$CLASSPATH exec java -cp $CLASSPATH "$@" From senger at pub.open-bio.org Fri Sep 2 07:38:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 2 Sep 2005 03:38:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020738.j827calM009185@pub.open-bio.org> senger Fri Sep 2 03:38:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files In directory pub.open-bio.org:/tmp/cvs-serv9113/src/main/org/biomoby/service/dashboard/doc-files Added Files: code-generators-panel.jpg dashboard.jpg deployment-panel.jpg registration-panel.jpg registry-panel.jpg testing-panel.jpg Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/doc-files code-generators-panel.jpg,NONE,1.1 dashboard.jpg,NONE,1.1 deployment-panel.jpg,NONE,1.1 registration-panel.jpg,NONE,1.1 registry-panel.jpg,NONE,1.1 testing-panel.jpg,NONE,1.1 From senger at pub.open-bio.org Fri Sep 2 07:38:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Fri, 2 Sep 2005 03:38:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509020738.j827caip009167@pub.open-bio.org> senger Fri Sep 2 03:38:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv9113/src/main/org/biomoby/service/dashboard Added Files: AbstractPanel.java DashboardPanel.java RegistryPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard AbstractPanel.java,NONE,1.1 DashboardPanel.java,NONE,1.1 RegistryPanel.java,NONE,1.1 From fgibbons at pub.open-bio.org Fri Sep 2 14:29:30 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 2 Sep 2005 10:29:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509021429.j82ETU9n010579@pub.open-bio.org> fgibbons Fri Sep 2 10:29:30 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv10554/t Modified Files: Client-Service.t Log Message: - Call autoload methods to generate code. Still fails on serviceName method. moby-live/Perl/t Client-Service.t,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Service.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/01 20:20:13 1.3 +++ /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/02 14:29:30 1.4 @@ -26,28 +26,23 @@ }; -TODO: { - local $TODO = "Test: new, execute, name, and autoload methods."; - -} - -my $opinion = <new(), undef) +my @autoload = qw/serviceName/; +my @API = (@autoload, qw/new execute/); +my $service = MOBY::Client::Service->new(); +is($service, undef) or diag("Created a new service without supplying any WSDL - it ain't right, I tell you!"); # Can't do nothing without WSDL +foreach (@autoload) { eval{$service->$_()}; } # Call all autoloads, to create them. +can_ok("MOBY::Client::Service", @API) + or diag("MOBY::Client::Service doesn't implement full API."); + # Find a service at MOBY Central, try to create a local instance. my $C = MOBY::Client::Central->new(); my ($s, $r) = $C->findService( authURI => 'www.illuminae.com', name => 'getDragonLocusAlleles' ); ok($s) or diag("Couldn't retrieve service details from MOBY Central"); my $wsdl = $C->retrieveService($$s[0]); -my $service = MOBY::Client::Service->new (service => $wsdl); +$service = MOBY::Client::Service->new (service => $wsdl); isa_ok($service, "MOBY::Client::Service") or diag("Expected new to return MOBY::Client::Service"); From fgibbons at pub.open-bio.org Fri Sep 2 14:32:15 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 2 Sep 2005 10:32:15 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509021432.j82EWFBJ010628@pub.open-bio.org> fgibbons Fri Sep 2 10:32:15 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv10603/t Modified Files: Client-SimpleArticle.t Log Message: - Check API for SimpleArticle. Looks like calls to ->XML() don't do what you'd expect: parse the XML, and modify the object. moby-live/Perl/t Client-SimpleArticle.t,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t 2005/08/31 14:17:11 1.1 +++ /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t 2005/09/02 14:32:15 1.2 @@ -31,7 +31,7 @@ my @autoload = qw/articleName objectType objectLSID namespaces id XML XML_DOM isSimple isCollection isSecondary/; -my @API = (@autoload, qw/new createFromXML createFromDOM/); +my @API = (@autoload, qw/new addNamespace value /); # createFrom[XML|DOM] are not meant to be public my $smpl = MOBY::Client::SimpleArticle->new(); foreach (@autoload) {eval{$smpl->$_};} # Call all AUTOLOAD methods, to create them. @@ -43,3 +43,105 @@ is($smpl->isSecondary, 0) or diag("SimpleArticle cannot be Secondary"); is($smpl->isCollection, 0) or diag("SimpleArticle cannot be Collection"); +my $aName = 'my Article'; +is($smpl->articleName($aName), $aName) or diag("Couldn't set articleName"); +is($smpl->articleName(), $aName) or diag("Couldn't get articleName"); + +my $obj_type = 'String'; +is($smpl->objectType($obj_type), $obj_type) or diag("Couldn't set objectType"); +is($smpl->objectType(), $obj_type) or diag("Couldn't get objectType"); + +my $obj_lsid = 'String'; +is($smpl->objectLSID($obj_lsid), $obj_lsid) or diag("Couldn't set objectLSID"); +is($smpl->objectLSID(), $obj_lsid) or diag("Couldn't get objectLSID"); + +my @ns = qw/SGD FB GO/; +eq_array($smpl->namespaces(\@ns), \@ns) or diag("Couldn't set namespaces"); +eq_array($smpl->namespaces(), \@ns) or diag("Couldn't get namespaces"); + +my $new_ns = 'NCBI_gi'; +# Order is critical in this test: FIRST get existing namespaces, THEN add one, and CHECK +eq_array( [@{$smpl->namespaces()}, $new_ns ], $smpl->addNamespace($new_ns)) + or diag("Couldn't add new namespace ('$new_ns')"); + +# Check XML-generation code. +# In reality, (XML, createFromXML) and (XML_DOM, createFromDOM) should behave the same. +# Let's not assume that though. + +my ($artName, $ns, $id, $obj, $lsid) + = ('my Article', 'SGD', 'S0005111', 'Object', 'urn:foo:bar:my_lsid'); +my $xml_smpl = < + + +XML + +$smpl = MOBY::Client::SimpleArticle->new( XML => $xml_smpl); + +is($smpl->objectLSID(), $lsid) + or diag("SimpleArticle not correctly built from XML (LSID wrong)"); + +is($smpl->articleName(), $artName) + or diag("SimpleArticle not correctly built from XML (articleName wrong)"); + +is($smpl->objectType(), $obj) + or diag("SimpleArticle not correctly built from XML (objectType wrong)"); + +eq_array($smpl->namespaces(), [$ns]) + or diag("SimpleArticle not correctly built from XML (namespace wrong)"); + +is($smpl->id(), $id) + or diag("SimpleArticle not correctly built from XML (id wrong)"); + +sub XML_maker { # Turn XML text into DOM. + my $XML = shift; + my $parser = XML::LibXML->new(); + my $doc; + eval { $doc = $parser->parse_string( $XML ); }; + return '' if ( $EVAL_ERROR ); #("Couldn't parse '$XML' because:\n\t$EVAL_ERROR") + return $doc->getDocumentElement(); +} + + +$smpl = MOBY::Client::SimpleArticle->new( XML_DOM => XML_maker($xml_smpl)); + +is($smpl->objectLSID(), $lsid) + or diag("SimpleArticle not correctly built from XML_DOM (LSID wrong)"); + +is($smpl->articleName(), $artName) + or diag("SimpleArticle not correctly built from XML_DOM (articleName wrong)"); + +is($smpl->objectType(), $obj) + or diag("SimpleArticle not correctly built from XML_DOM (objectType wrong)"); + +eq_array($smpl->namespaces(), [$ns]) + or diag("SimpleArticle not correctly built from XML_DOM (namespace wrong)"); + +is($smpl->id(), $id) + or diag("SimpleArticle not correctly built from XML_DOM (id wrong)"); + + +TODO: { + local $TODO = <new()->XML(\$xml), +I expect that the XML will be *parsed*, to modify the object, +not that the attribute 'XML' will be set, and the rest left unchanged." +TODO + + $smpl = MOBY::Client::SimpleArticle->new(); + $smpl->XML($xml_smpl); + is($smpl->objectLSID(), $lsid) + or diag("Couldn't create SimpleArticle from autoloaded method XML(): LSID wrong"); + + is($smpl->articleName, $artName) + or diag("Couldn't create SimpleArticle from autoloaded method XML(): articleName wrong"); + + is($smpl->objectType(), $obj) + or diag("Couldn't create SimpleArticle from autoloaded method XML(): objectType wrong"); + + eq_array($smpl->namespaces(), [$ns]) + or diag("Couldn't create SimpleArticle from autoloaded method XML(): namespaces wrong"); + + is($smpl->id(), $id) + or diag("Couldn't create SimpleArticle from autoloaded method XML(): id wrong"); +} From fgibbons at pub.open-bio.org Fri Sep 2 14:39:21 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 2 Sep 2005 10:39:21 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509021439.j82EdLtE010687@pub.open-bio.org> fgibbons Fri Sep 2 10:39:20 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv10661 Modified Files: SimpleArticle.pm Log Message: - The tests drove out a few bugs: * extraction of lsid from element was incorrect. * call to the XML method does nothing except set the value of the $self->XML component to the string passed in as the argument. This isn't what you'd expect, since everything else is a get/set method, and setting the XML to a string that doesn't reflect the actual object is not likely to be useful in an API. Solution: Either we remove it from the API, i.e., make it a private method; or we make it do the right thing (see above). - Removed redundant 'Title' lines in perldoc. moby-live/Perl/MOBY/Client SimpleArticle.pm,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm 2005/07/29 18:58:44 1.8 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/SimpleArticle.pm 2005/09/02 14:39:20 1.9 @@ -53,7 +53,6 @@ =head2 new - Title : new Usage : my $SA = MOBY::Client::SimpleArticle->new(%args) Function : create SimpleArticle object Returns : MOBY::Client::SimpleArticle object @@ -64,81 +63,60 @@ XML_DOM => $XML::DOM::NODE -=cut =head2 articleName - Title : articleName Usage : $name = $SA->articleName($name) Function : get/set articleName Returns : string Arguments : (optional) string representing articleName to set -=cut - =head2 objectType - Title : objectType Usage : $type = $SA->objectType($type) Function : get/set name Returns : string Arguments : (optional) string representing objectType to set -=cut - =head2 objectLSID - Title : objectLSID Usage : $type = $SA->objectLSID($type) Function : get/set LSID Returns : string Arguments : (optional) string representing objectLSID to set -=cut - =head2 namespaces - Title : namespaces Usage : $namespaces = $SA->namespaces(\@namespaces) Function : get/set namespaces for the objectType Returns : arrayref of namespace strings Arguments : (optional) arrayref of namespace strings to set -=cut =head2 XML - Title : XML Usage : $SA = $SA->XML($XML) Function : set/reset all parameters for this object from the XML Returns : MOBY::Client::SimpleArticle Arguments : (optional) XML fragment from and including ... -=cut - =head2 XML_DOM - Title : XML_DOM Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) Function : set/reset all parameters for this object from the XML::DOM node for Returns : MOBY::Client::SimpleArticle Arguments : (optional) an $XML::DOM node from the article of a DOM -=cut =head2 addNamespace - Title : addNamespace Usage : $namespaces = $IN->addNamespace($namespace) Function : add another namespace for the objectType Returns : namespace string -=cut - =head2 isSimple - Title : isSimple Usage : $boolean = $IN->isSimple() Function : is this a SimpleArticle type (yes, I know this is obvious, but since you can @@ -147,11 +125,9 @@ to test what you have in-hand) Returns : 1 (true) -=cut =head2 isCollection - Title : isCollection Usage : $boolean = $IN->isCollection() Function : is this a CollectionArticle type (yes, I know this is obvious, but since you can @@ -160,11 +136,8 @@ to test what you have in-hand) Returns : 0 for false -=cut - =head2 isSecondary - Title : isSecondary Usage : $boolean = $IN->isSecondary() Function : is this a SecondaryArticle type? (yes, I know this is obvious) @@ -220,68 +193,65 @@ } sub new { - my ( $caller, %args ) = @_; - my $caller_is_obj = ref( $caller ); - return $caller if $caller_is_obj; - my $class = $caller_is_obj || $caller; - my $proxy; - my $self = bless {}, $class; - foreach my $attrname ( $self->_standard_keys ) { - if ( exists $args{$attrname} ) { - $self->{$attrname} = $args{$attrname}; - } elsif ( $caller_is_obj ) { - $self->{$attrname} = $caller->{$attrname}; - } else { - $self->{$attrname} = $self->_default_for( $attrname ); - } - } - if ( $self->XML && ref( $self->XML ) ) { - return 0; - } elsif ( $self->XML_DOM && !( ref( $self->XML_DOM ) =~ /libxml/i ) ) { - return 0; - } - $self->createFromXML if ( $self->XML ); - $self->createFromDOM( $self->XML_DOM ) if ( $self->XML_DOM ); - return $self; + my ( $caller, %args ) = @_; + my $caller_is_obj = ref( $caller ); + return $caller if $caller_is_obj; + my $class = $caller_is_obj || $caller; + my $proxy; + my $self = bless {}, $class; + foreach my $attrname ( $self->_standard_keys ) { + if ( exists $args{$attrname} ) { + $self->{$attrname} = $args{$attrname}; + } elsif ( $caller_is_obj ) { + $self->{$attrname} = $caller->{$attrname}; + } else { + $self->{$attrname} = $self->_default_for( $attrname ); + } + } + if ( $self->XML && ref( $self->XML ) ) { + return 0; + } elsif ( $self->XML_DOM && !( ref( $self->XML_DOM ) =~ /XML\:\:LibXML/ ) ) { + return 0; + } + + $self->createFromXML if ( $self->XML ); + $self->createFromDOM( $self->XML_DOM ) if ( $self->XML_DOM ); + return $self; } sub createFromXML { - my ( $self ) = @_; - my $p = XML::LibXML->new; - my $doc = $p->parse_string( $self->XML ); - my $root = $doc->getDocumentElement; - return 0 unless ( $root && ( $root->nodeName eq "Simple" ) ); - return $self->createFromDOM( $root ); + my ( $self ) = @_; + my $p = XML::LibXML->new; + my $doc = $p->parse_string( $self->XML ); + my $root = $doc->getDocumentElement; + return 0 unless ( $root && ( $root->nodeName eq "Simple" ) ); + return $self->createFromDOM( $root ); } sub createFromDOM { - my ( $self, $dom ) = @_; - return 0 unless ( $dom && ( $dom->nodeName eq "Simple" ) ); - $self->XML( $dom->toString ); # set the string version of the DOM - $self->namespaces( [] ); # reset! - $self->articleName( "" ); - $self->objectType( "" ); - my $attr = $dom->getAttributeNode( 'articleName' ); - my $lsid = $dom->getAttributeNode( 'lsid' ); - my $articleName = ""; - $articleName = $attr->getValue if $attr; - $lsid = $attr->getValue if $lsid; - - $self->articleName( $articleName ) - if $articleName - ; # it may have already been set if this Simple is part of a Collection... - $self->objectLSID( $lsid) if $lsid; - -# fork here - it may be an instantiated object (coming from a service invocation/response) -# or it may be a template object as in the SimpleArticle element of a registration call -# if the objectType tag exists, then it is a template object - if ( @{ $dom->getElementsByTagName( "objectType" ) }[0] ) { - return $self->_createTemplateArticle( $dom ); - } else { - return $self->_createInstantiatedArticle( $dom ); - } - - # otherwise it should simpy contain an instantiated MOBY object + my ( $self, $dom ) = @_; + return 0 unless ( $dom && ( $dom->nodeName eq "Simple" ) ); + $self->namespaces( [] ); # reset! + $self->articleName( "" ); + $self->objectType( "" ); + my $attr = $dom->getAttributeNode( 'articleName' ); + my $articleName = $attr ? $attr->getValue : ""; + $attr = $dom->getAttributeNode( 'lsid' ); + my $lsid = $attr ? $attr->getValue : ""; + + $self->articleName( $articleName ) + if $articleName; # it may have already been set if this Simple is part of a Collection... + $self->objectLSID( $lsid) if $lsid; + + # fork here - it may be an instantiated object (coming from a service invocation/response) + # or it may be a template object as in the SimpleArticle element of a registration call + # if the objectType tag exists, then it is a template object + if ( @{ $dom->getElementsByTagName( "objectType" ) }[0] ) { + return $self->_createTemplateArticle( $dom ); + } else { + return $self->_createInstantiatedArticle( $dom ); + } + # otherwise it should simpy contain an instantiated MOBY object } sub _createInstantiatedArticle { @@ -333,29 +303,30 @@ } sub AUTOLOAD { - no strict "refs"; - my ( $self, $newval ) = @_; - $AUTOLOAD =~ /.*::(\w+)/; - my $attr = $1; - if ( $self->_accessible( $attr, 'write' ) ) { - *{$AUTOLOAD} = sub { - if ( defined $_[1] ) { $_[0]->{$attr} = $_[1] } - return $_[0]->{$attr}; - }; ### end of created subroutine -### this is called first time only - if ( defined $newval ) { - $self->{$attr} = $newval; - } - return $self->{$attr}; - } elsif ( $self->_accessible( $attr, 'read' ) ) { - *{$AUTOLOAD} = sub { - return $_[0]->{$attr}; - }; ### end of created subroutine - return $self->{$attr}; - } - - # Must have been a mistake then... - croak "No such method: $AUTOLOAD"; + # It seems desirable that if the XML() method is called, the XML should be parsed, rather than just being + no strict "refs"; + my ( $self, $newval ) = @_; + $AUTOLOAD =~ /.*::(\w+)/; + my $attr = $1; + if ( $self->_accessible( $attr, 'write' ) ) { + *{$AUTOLOAD} = sub { + if ( defined $_[1] ) { $_[0]->{$attr} = $_[1]; } + return $_[0]->{$attr}; + }; ### end of created subroutine + ### this is called first time only + if ( defined $newval ) { + $self->{$attr} = $newval; + } + return $self->{$attr}; + } elsif ( $self->_accessible( $attr, 'read' ) ) { + *{$AUTOLOAD} = sub { + return $_[0]->{$attr}; + }; ### end of created subroutine + return $self->{$attr}; + } + + # Must have been a mistake then... + croak "No such method: $AUTOLOAD"; } sub DESTROY { } 1; From senger at pub.open-bio.org Sun Sep 4 13:15:58 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:15:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041315.j84DFwnF027181@pub.open-bio.org> senger Sun Sep 4 09:15:55 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv27126 Modified Files: activation.jar alltools2.jar axis-ant.jar axis.jar jaxrpc.jar saaj.jar servlet.jar xercesImpl.jar xmlParserAPIs.jar Added Files: commons-discovery-0.2.jar commons-httpclient-3.0-rc2.jar commons-logging-1.0.4.jar log4j-1.2.8.jar mailapi_1_3_1.jar wsdl4j-1.5.1.jar Removed Files: commons-discovery.jar commons-logging.jar log4j-1.2.4.jar wsdl4j.jar Log Message: jars-archive/current commons-discovery-0.2.jar,NONE,1.1 commons-httpclient-3.0-rc2.jar,NONE,1.1 commons-logging-1.0.4.jar,NONE,1.1 log4j-1.2.8.jar,NONE,1.1 mailapi_1_3_1.jar,NONE,1.1 wsdl4j-1.5.1.jar,NONE,1.1 activation.jar,1.1,1.2 alltools2.jar,1.1,1.2 axis-ant.jar,1.1,1.2 axis.jar,1.1,1.2 jaxrpc.jar,1.1,1.2 saaj.jar,1.1,1.2 servlet.jar,1.1,1.2 xercesImpl.jar,1.1,1.2 xmlParserAPIs.jar,1.1,1.2 commons-discovery.jar,1.1,NONE commons-logging.jar,1.1,NONE log4j-1.2.4.jar,1.1,NONE wsdl4j.jar,1.1,NONE =================================================================== RCS file: /home/repository/moby/jars-archive/current/activation.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/activation.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/activation.jar 2005/09/04 13:15:54 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/activation.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/08/24 14:24:18 1.1 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/04 13:15:54 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/axis-ant.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/axis-ant.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/axis-ant.jar 2005/09/04 13:15:54 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/axis-ant.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/axis.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/axis.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/axis.jar 2005/09/04 13:15:54 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/axis.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/jaxrpc.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/jaxrpc.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/jaxrpc.jar 2005/09/04 13:15:55 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/jaxrpc.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/saaj.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/saaj.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/saaj.jar 2005/09/04 13:15:55 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/saaj.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/servlet.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/servlet.jar 2005/06/10 13:55:35 1.1 and /home/repository/moby/jars-archive/current/servlet.jar 2005/09/04 13:15:55 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/servlet.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/xercesImpl.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/xercesImpl.jar 2005/06/10 13:55:36 1.1 and /home/repository/moby/jars-archive/current/xercesImpl.jar 2005/09/04 13:15:55 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/xercesImpl.jar: diff failed =================================================================== RCS file: /home/repository/moby/jars-archive/current/xmlParserAPIs.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/jars-archive/current/xmlParserAPIs.jar 2005/06/10 13:55:36 1.1 and /home/repository/moby/jars-archive/current/xmlParserAPIs.jar 2005/09/04 13:15:55 1.2 differ rcsdiff: /home/repository/moby/jars-archive/current/xmlParserAPIs.jar: diff failed rcsdiff: /home/repository/moby/jars-archive/current/RCS/commons-discovery.jar,v: No such file or directory rcsdiff: /home/repository/moby/jars-archive/current/RCS/commons-logging.jar,v: No such file or directory rcsdiff: /home/repository/moby/jars-archive/current/RCS/log4j-1.2.4.jar,v: No such file or directory rcsdiff: /home/repository/moby/jars-archive/current/RCS/wsdl4j.jar,v: No such file or directory From senger at pub.open-bio.org Sun Sep 4 13:45:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjbGP027859@pub.open-bio.org> senger Sun Sep 4 09:45:36 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv27838 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.28,1.29 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/02 07:38:35 1.28 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/04 13:45:36 1.29 @@ -66,6 +66,21 @@ + + + + + + + + + + + + + + + @@ -148,42 +163,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -214,6 +193,11 @@ + + + + @@ -489,26 +473,9 @@ - - - - - - - - - - - + - - - - @@ -521,6 +488,9 @@ + + + @@ -534,11 +504,66 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -596,114 +621,213 @@ - - - - - - - - - - - - - - + - - - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + <undeployment xmlns="http://xml.apache.org/axis/wsdd/"> + <service name="${service.name}"/> + </undeployment> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - + - - - - + + - + - - - + - - No list of service names found. - =============================== - A list can be defined in one of the following ways: - a) Create a property 'services.list' containing - a comma-delimited list of names of services, or - b) For each service, create a property 'service.<service-name> - (replace <service-name> with a real name of service). + No list of service names found. + =============================== + Each service that you want to deploy should de defined + by a property of the following form (parts in upper-cases should be + replaced by the real values): + service.SERVICE-NAME = IMPLEMENTATION-CLASS-NAME + + Each service that you want to undeploy can be defined in the same + way (implementation class is not needed), or simpler by creating + a property 'services.list' containing a comma-delimited list of + names of services to be undeployed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <undeployment xmlns="http://xml.apache.org/axis/wsdd/"> - <service name="${service.name}"/> - </undeployment> - - - - - - - - - - @@ -976,6 +1052,10 @@ + + + + @@ -991,18 +1071,7 @@ - - - - - - - - - - - - + @@ -1044,7 +1113,7 @@ - + @@ -1070,21 +1139,8 @@ - - - - - - - - - - - - - - - + + @@ -1114,7 +1170,7 @@ - + @@ -1156,6 +1212,16 @@ + + + + + + + + + + From senger at pub.open-bio.org Sun Sep 4 13:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjcVm028109@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser In directory pub.open-bio.org:/tmp/cvs-serv27838/src/main/org/biomoby/shared/parser Modified Files: MobyParser.java Log Message: moby-live/Java/src/main/org/biomoby/shared/parser MobyParser.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/MobyParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/MobyParser.java 2005/08/26 06:27:05 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/MobyParser.java 2005/09/04 13:45:38 1.2 @@ -16,11 +16,12 @@ import org.biomoby.shared.datatypes.MobyXref; import org.biomoby.shared.datatypes.MapDataTypesIfc; -import embl.ebi.tools.ICreator; -import embl.ebi.utils.GException; -import embl.ebi.utils.DGUtils; -import embl.ebi.xml.XMLUtils2; -import embl.ebi.xml.XMLErrorHandler; +import org.tulsoft.tools.loaders.ICreator; +import org.tulsoft.shared.GException; +import org.tulsoft.tools.debug.DGUtils; +import org.tulsoft.tools.xml.XMLUtils2; +import org.tulsoft.tools.xml.XMLErrorHandler; + import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.xml.sax.Locator; From senger at pub.open-bio.org Sun Sep 4 13:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84Djc7t028086@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator In directory pub.open-bio.org:/tmp/cvs-serv27838/src/main/org/biomoby/service/generator Modified Files: Generator.java ServicesGenerator.java Log Message: moby-live/Java/src/main/org/biomoby/service/generator Generator.java,1.1,1.2 ServicesGenerator.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/Generator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/Generator.java 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/Generator.java 2005/09/04 13:45:38 1.2 @@ -8,8 +8,11 @@ package org.biomoby.service.generator; -import embl.ebi.utils.FileUtils; -import embl.ebi.utils.GException; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.shared.GException; +import org.tulsoft.tools.external.Executor; +import org.tulsoft.tools.servlets.Html; +import org.tulsoft.tools.servlets.HtmlConstants; import org.biomoby.shared.MobyException; import org.biomoby.shared.Central; @@ -21,8 +24,6 @@ import org.biomoby.client.CentralDigestCachedImpl; import org.biomoby.client.Graphviz; -import embl.ebi.tools.Executor; -import embl.ebi.utils.GException; import java.util.Properties; import java.util.HashMap; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/ServicesGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/ServicesGenerator.java 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/ServicesGenerator.java 2005/09/04 13:45:38 1.2 @@ -27,7 +27,8 @@ import org.biomoby.client.FilterServices; import org.biomoby.client.Graphviz; -import embl.ebi.servlets.Html; +import org.tulsoft.tools.servlets.Html; +import org.tulsoft.tools.servlets.HtmlConstants; import java.util.Properties; import java.util.Iterator; From senger at pub.open-bio.org Sun Sep 4 13:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84Djcxa028148@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/xmls In directory pub.open-bio.org:/tmp/cvs-serv27838/xmls Modified Files: libraries.xml Log Message: moby-live/Java/xmls libraries.xml,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/libraries.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/08/26 06:27:05 1.3 +++ /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/09/04 13:45:38 1.4 @@ -11,19 +11,19 @@ - - - + + + - + - + @@ -43,12 +43,12 @@ + - @@ -57,6 +57,7 @@ + @@ -82,6 +83,7 @@ + @@ -98,7 +100,15 @@ - + + + + + + + + + @@ -109,6 +119,7 @@ + @@ -136,6 +147,7 @@ + From senger at pub.open-bio.org Sun Sep 4 13:45:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjbEg027932@pub.open-bio.org> senger Sun Sep 4 09:45:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv27838/src/Clients Modified Files: CacheRegistryClient.java MobyCmdLineClient.java MobyDigestClient.java MobyGraphs.java MosesGenerators.java TestArgs.java TestingMobyParser.java UnregisterByAuthority.java Log Message: moby-live/Java/src/Clients CacheRegistryClient.java,1.1,1.2 MobyCmdLineClient.java,1.10,1.11 MobyDigestClient.java,1.1,1.2 MobyGraphs.java,1.8,1.9 MosesGenerators.java,1.1,1.2 TestArgs.java,1.1,1.2 TestingMobyParser.java,1.1,1.2 UnregisterByAuthority.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2004/11/14 16:12:50 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/04 13:45:37 1.2 @@ -8,8 +8,9 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import embl.ebi.tools.*; -import embl.ebi.utils.*; +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.shared.GException; import java.net.*; import java.util.*; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/08/07 06:30:49 1.10 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/09/04 13:45:37 1.11 @@ -8,8 +8,10 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import embl.ebi.tools.*; -import embl.ebi.utils.*; +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.shared.StringUtils; +import org.tulsoft.shared.GException; import java.net.*; import java.util.*; @@ -268,12 +270,12 @@ data.setAuthority (cmd.getParam ("-rd-auth")); data.setEmailContact (cmd.getParam ("-rd-email")); if ((param = cmd.getParam ("-rd-isa")) != null ) { - String[] isas = StringUtils.split (param, ","); + String[] isas = param.split (","); for (int i = 0; i < isas.length; i++) data.addParentName (isas [i]); } if ((param = cmd.getParam ("-rd-hasa")) != null ) { - String[] hasas = StringUtils.split (param, ","); + String[] hasas = param.split (","); for (int i = 0; i < hasas.length; i++) { int pos = hasas[i].indexOf (":"); if (pos == -1) { @@ -286,7 +288,7 @@ } } if ((param = cmd.getParam ("-rd-has")) != null ) { - String[] hasas = StringUtils.split (param, ","); + String[] hasas = param.split (","); for (int i = 0; i < hasas.length; i++) { int pos = hasas[i].indexOf (":"); if (pos == -1) { @@ -310,7 +312,7 @@ stype.setAuthority (cmd.getParam ("-rt-auth")); stype.setEmailContact (cmd.getParam ("-rt-email")); if ((param = cmd.getParam ("-rt-isa")) != null ) { - String[] isas = StringUtils.split (param, ","); + String[] isas = param.split (","); for (int i = 0; i < isas.length; i++) stype.addParentName (isas [i]); } @@ -351,9 +353,9 @@ } if ( (param = cmd.getParam ("-rs-in")) != null ) { - String[] inputs = StringUtils.split (param, ","); + String[] inputs = param.split (","); for (int i = 0; i < inputs.length; i++) { - String[] parts = StringUtils.split (inputs[i], "="); + String[] parts = inputs[i].split ("="); if (parts.length >= 2) { MobyPrimaryDataSimple data = new MobyPrimaryDataSimple ("dummy"); data.setDataType (new MobyDataType (parts[0])); @@ -367,7 +369,7 @@ } } if ((param = cmd.getParam ("-rs-ifile")) != null ) { - String[] files = StringUtils.split (param, ","); + String[] files = param.split (","); for (int i = 0; i < files.length; i++) { Properties props = new Properties(); try { @@ -421,9 +423,9 @@ } } if ((param = cmd.getParam ("-rs-out")) != null ) { - String[] outs = StringUtils.split (param, ","); + String[] outs = param.split (","); for (int i = 0; i < outs.length; i++) { - String[] parts = StringUtils.split (outs[i], "="); + String[] parts = outs[i].split ("="); if (parts.length >= 2) { MobyPrimaryDataSimple data = new MobyPrimaryDataSimple ("dummy"); data.setDataType (new MobyDataType (parts[0])); @@ -437,7 +439,7 @@ } } if ((param = cmd.getParam ("-rs-ofile")) != null ) { - String[] files = StringUtils.split (param, ","); + String[] files = param.split (","); for (int i = 0; i < files.length; i++) { Properties props = new Properties(); try { @@ -535,7 +537,7 @@ if ((param = cmd.getParam ("-f")) != null ) { decorationLn ("Looking for services related to: '" + param + "':"); decorationLn ("--------------------------------"); - printServices (worker.findService (StringUtils.split (param, ",")), + printServices (worker.findService (param.split (",")), cmd.hasOption ("-on")); } @@ -555,9 +557,9 @@ pattern.setType (cmd.getParam ("-fs-type")); pattern.setAuthority (cmd.getParam ("-fs-auth")); if ((param = cmd.getParam ("-fs-in")) != null ) { - String[] inputs = StringUtils.split (param, ","); + String[] inputs = param.split (","); for (int i = 0; i < inputs.length; i++) { - String[] parts = StringUtils.split (inputs[i], "="); + String[] parts = inputs[i].split ("="); MobyPrimaryDataSimple input = new MobyPrimaryDataSimple ("dummy"); input.setDataType (new MobyDataType (parts[0])); if (parts.length >= 2) @@ -566,7 +568,7 @@ } } if ((param = cmd.getParam ("-fs-out")) != null ) { - String[] outs = StringUtils.split (param, ","); + String[] outs = param.split (","); for (int i = 0; i < outs.length; i++) { MobyPrimaryDataSimple output = new MobyPrimaryDataSimple ("dummy"); output.setDataType (new MobyDataType (outs[i])); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2004/11/14 16:43:49 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/09/04 13:45:37 1.2 @@ -7,8 +7,9 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import embl.ebi.tools.*; -import embl.ebi.utils.*; +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.shared.GException; /** * A simple client retrieving and printing cummulative (digestive) =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2005/07/19 12:39:58 1.8 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2005/09/04 13:45:37 1.9 @@ -8,8 +8,11 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import embl.ebi.tools.*; -import embl.ebi.utils.*; +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.tools.Printf; +import org.tulsoft.shared.UUtils; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.shared.GException; import java.net.*; import java.util.*; @@ -146,7 +149,7 @@ while ((line = data.readLine()) != null) { if (line.trim().equals ("")) continue; if (line.trim().startsWith ("#")) continue; - String[] fields = StringUtils.split (line); + String[] fields = line.split ("\\s+"); if (fields.length > 1) { if (fields[0].equalsIgnoreCase ("start")) { DataServiceEdge dse = new DataServiceEdge (new MobyDataType ("start"), @@ -181,9 +184,9 @@ String[] serviceNames = null; int depth = 1; if ((param = cmd.getParam ("-auth")) != null ) - authorities = StringUtils.split (param, ","); + authorities = param.split (","); if ((param = cmd.getParam ("-name")) != null ) - serviceNames = StringUtils.split (param, ","); + serviceNames = param.split (","); param = cmd.getParam ("-depth"); if (param != null) { try { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MosesGenerators.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/MosesGenerators.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/MosesGenerators.java 2005/09/04 13:45:37 1.2 @@ -12,7 +12,7 @@ import org.biomoby.shared.MobyException; import org.biomoby.shared.Utils; -import embl.ebi.tools.BaseCmdLine; +import org.tulsoft.tools.BaseCmdLine; import java.util.Properties; /** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestArgs.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/TestArgs.java 2005/09/01 05:51:18 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/TestArgs.java 2005/09/04 13:45:37 1.2 @@ -6,6 +6,9 @@ // Copyright Martin Senger (martin.senger at gmail.com). // +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.shared.UUtils; + /** * Work in progress... * @@ -16,8 +19,17 @@ public static void main (String[] args) throws Exception { - for (int i = 0; i < args.length; i++) { - System. out.println (i + ": " + args[i]); + String withTools = System.getProperty ("with_tools"); + if (UUtils.is (withTools)) { + System.out.println ("Using BaseCmdLine:\n"); + BaseCmdLine cmd = new BaseCmdLine (args, true); + for (int i = 0; i < cmd.params.length; i++) { + System. out.println (i + ": " + cmd.params[i]); + } + } else { + for (int i = 0; i < args.length; i++) { + System. out.println (i + ": " + args[i]); + } } } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestingMobyParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/TestingMobyParser.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/TestingMobyParser.java 2005/09/04 13:45:37 1.2 @@ -10,7 +10,7 @@ import org.biomoby.shared.MobyException; import org.biomoby.shared.Utils; -import embl.ebi.tools.BaseCmdLine; +import org.tulsoft.tools.BaseCmdLine; import java.io.File; /** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/UnregisterByAuthority.java 2005/09/04 13:45:37 1.2 @@ -11,7 +11,7 @@ import org.biomoby.shared.Central; import org.biomoby.client.CentralImpl; -import embl.ebi.tools.BaseCmdLine; +import org.tulsoft.tools.BaseCmdLine; import java.util.Map; import java.util.Map.Entry; From senger at pub.open-bio.org Sun Sep 4 13:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjcT5028036@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service In directory pub.open-bio.org:/tmp/cvs-serv27838/src/main/org/biomoby/service Modified Files: BaseService.java Log Message: moby-live/Java/src/main/org/biomoby/service BaseService.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/BaseService.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/BaseService.java 2005/08/28 10:19:08 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/BaseService.java 2005/09/04 13:45:37 1.3 @@ -8,9 +8,9 @@ package org.biomoby.service; -import embl.ebi.soap.SOAPToolkit; -import embl.ebi.soap.SoapUtils; -import embl.ebi.utils.GException; +import org.tulsoft.tools.soap.SOAPToolkit; +import org.tulsoft.tools.soap.SoapUtils; +import org.tulsoft.shared.GException; import org.biomoby.shared.MobyException; import org.biomoby.shared.parser.MobyParser; @@ -197,7 +197,7 @@ * useful for session management.

            * * See details what a toolkit can provide in - * embl.ebi.soap.SOAPToolkit. + * org.tulsoft.tools.soap.SOAPToolkit. *************************************************************************/ public SOAPToolkit getToolkit() { return toolkit; From senger at pub.open-bio.org Sun Sep 4 13:45:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84Djb0L028017@pub.open-bio.org> senger Sun Sep 4 09:45:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv27838/src/main/org/biomoby/client Modified Files: BaseClient.java BaseCmdLineClient.java CentralDigestImpl.java CentralImpl.java GraphsServlet.java Log Message: moby-live/Java/src/main/org/biomoby/client BaseClient.java,1.1,1.2 BaseCmdLineClient.java,1.1,1.2 CentralDigestImpl.java,1.3,1.4 CentralImpl.java,1.24,1.25 GraphsServlet.java,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseClient.java 2005/09/04 13:45:37 1.2 @@ -15,8 +15,8 @@ import org.biomoby.shared.parser.MobyPackage; import org.biomoby.shared.parser.MobyJob; -import embl.ebi.soap.axis.AxisCall; -import embl.ebi.utils.GException; +import org.tulsoft.tools.soap.axis.AxisCall; +import org.tulsoft.shared.GException; import java.net.URL; import java.net.MalformedURLException; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/09/04 13:45:37 1.2 @@ -17,11 +17,11 @@ import org.biomoby.shared.datatypes.MobyObject; import org.biomoby.shared.datatypes.MapDataTypesIfc; -import embl.ebi.tools.BaseCmdLine; -import embl.ebi.tools.ICreator; -import embl.ebi.utils.GException; -import embl.ebi.utils.FileUtils; -import embl.ebi.utils.DGUtils; +import org.tulsoft.tools.BaseCmdLine; +import org.tulsoft.tools.loaders.ICreator; +import org.tulsoft.shared.GException; +import org.tulsoft.shared.FileUtils; +import org.tulsoft.tools.debug.DGUtils; import java.util.Vector; import java.util.HashMap; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/04/18 23:57:45 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/09/04 13:45:37 1.4 @@ -6,18 +6,17 @@ package org.biomoby.client; -import java.util.Iterator; -import java.util.Map; -import java.util.Vector; - import org.biomoby.shared.CentralDigest; import org.biomoby.shared.MobyDataType; import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; import org.biomoby.shared.MobyServiceType; -import embl.ebi.utils.DGUtils; -// import java.net.*; +import org.tulsoft.tools.debug.DGUtils; + +import java.util.Iterator; +import java.util.Map; +import java.util.Vector; /** * A default implementation of {@link =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/08/26 06:27:04 1.24 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/04 13:45:37 1.25 @@ -23,7 +23,7 @@ import org.biomoby.shared.Utils; import org.biomoby.shared.MobyResourceRef; -import embl.ebi.soap.axis.AxisUtils; +import org.tulsoft.tools.soap.axis.AxisUtils; import org.w3c.dom.Document; import org.w3c.dom.Element; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/05/19 15:57:25 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/09/04 13:45:37 1.11 @@ -8,6 +8,31 @@ package org.biomoby.client; +import org.biomoby.shared.CentralAll; +import org.biomoby.shared.MobyDataType; +import org.biomoby.shared.MobyException; +import org.biomoby.shared.MobyNamespace; +import org.biomoby.shared.MobyPrimaryDataSimple; +import org.biomoby.shared.MobyService; +import org.biomoby.shared.MobyServiceType; +import org.biomoby.shared.Utils; + +import org.tulsoft.tools.servlets.Html; +import org.tulsoft.tools.servlets.HtmlConstants; +import org.tulsoft.tools.external.CatchOutputDefaultImpl; +import org.tulsoft.tools.external.Executor; +import org.tulsoft.tools.Printf; +import org.tulsoft.tools.Sorter; +import org.tulsoft.shared.GException; +import org.tulsoft.shared.StringUtils; +import org.tulsoft.shared.UUtils; + +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -23,32 +48,6 @@ import java.util.Properties; import java.util.Vector; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.biomoby.shared.CentralAll; -import org.biomoby.shared.MobyDataType; -import org.biomoby.shared.MobyException; -import org.biomoby.shared.MobyNamespace; -import org.biomoby.shared.MobyPrimaryDataSimple; -import org.biomoby.shared.MobyService; -import org.biomoby.shared.MobyServiceType; -import org.biomoby.shared.Utils; - -import embl.ebi.servlets.Html; -import embl.ebi.servlets.HtmlConstants; -import embl.ebi.tools.CatchOutputDefaultImpl; -import embl.ebi.tools.Executor; -import embl.ebi.tools.Printf; -import embl.ebi.tools.Sorter; -import embl.ebi.utils.GException; -import embl.ebi.utils.StringUtils; -import embl.ebi.utils.UUtils; - - /** * A servlet making graphs of Moby service instances, Moby data types, * and Moby service types.

            @@ -1489,7 +1488,7 @@ // where is the 'dot' program String dotProg = "dot"; String dotPath = (String)initParams.get (DOT_PATH); - if (! UUtils.isEmpty (dotPath)) + if ( ! UUtils.isEmpty (dotPath) && ! "\"\"".equals (dotPath) ) dotProg = dotPath + System.getProperty ("file.separator") + dotProg; // depending on the cache implementation we may ask From senger at pub.open-bio.org Sun Sep 4 13:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjcvT028060@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv27838/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java RegistryPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard AbstractPanel.java,1.1,1.2 RegistryPanel.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/02 07:38:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/04 13:45:38 1.2 @@ -9,11 +9,14 @@ package org.biomoby.service.dashboard; import javax.swing.JLabel; +import javax.swing.JPanel; import javax.swing.text.html.HTMLDocument; import javax.swing.Icon; import javax.swing.JComponent; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeSupport; /** * WORK IN PROGRESS.

            @@ -23,6 +26,7 @@ */ public abstract class AbstractPanel + extends JPanel implements DashboardPanel { /************************************************************************** @@ -39,20 +43,23 @@ return null; } - /************************************************************************** - * - **************************************************************************/ - public void addPropertyChangeListener (PropertyChangeListener listener) { + /********************************************************************* + * Property change stuff + ********************************************************************/ + protected PropertyChangeSupport support; + + public void addPropertyChangeListener (PropertyChangeListener l) { + if (support != null) + support.addPropertyChangeListener(l); } - /************************************************************************** - * - **************************************************************************/ - public void removePropertyChangeListener(PropertyChangeListener listener) { + public void removePropertyChangeListener (PropertyChangeListener l) { + if (support != null) + support.removePropertyChangeListener(l); } /************************************************************************** - * + * Here we get notified when a property chnage happen. **************************************************************************/ public void propertyChange (PropertyChangeEvent event) { } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/02 07:38:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/04 13:45:38 1.2 @@ -12,7 +12,9 @@ import javax.swing.text.html.HTMLDocument; import javax.swing.Icon; import javax.swing.JComponent; + import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeEvent; /** * @@ -26,6 +28,20 @@ public class RegistryPanel extends AbstractPanel { + /********************************************************************* + * propertyChange() + ********************************************************************/ + public void propertyChange (PropertyChangeEvent e) { + String prop = e.getPropertyName(); + String newVal = (String)e.getNewValue(); + if (newVal == null) return; // no interest in non-defined new values + if (prop == null) return; // no interest in non-specific changes +// else if (prop.equalsIgnoreCase (PROP_MODE)) setMode (checkAndGetOperMode (newVal)); +// else if (prop.equalsIgnoreCase (PROP_BEAN_VISIBLE)) setBeanVisible (BBConfig.getBoolFromString (newVal)); +// else if (prop.equalsIgnoreCase (PROP_LISTEN_TO)) setListenTo (newVal); +// else if (prop.equalsIgnoreCase (PROP_DATA_IDENTITY)) setDataIdentity (newVal); + } + /************************************************************************** * **************************************************************************/ From senger at pub.open-bio.org Sun Sep 4 13:45:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjbQf027878@pub.open-bio.org> senger Sun Sep 4 09:45:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/images In directory pub.open-bio.org:/tmp/cvs-serv27838/docs/images Modified Files: ant-snapshot.png Log Message: moby-live/Java/docs/images ant-snapshot.png,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/images/ant-snapshot.png,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 Binary files /home/repository/moby/moby-live/Java/docs/images/ant-snapshot.png 2005/08/26 06:27:02 1.2 and /home/repository/moby/moby-live/Java/docs/images/ant-snapshot.png 2005/09/04 13:45:36 1.3 differ rcsdiff: /home/repository/moby/moby-live/Java/docs/images/ant-snapshot.png: diff failed From senger at pub.open-bio.org Sun Sep 4 13:45:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84DjbNv027977@pub.open-bio.org> senger Sun Sep 4 09:45:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv27838/src/Clients/help Modified Files: BaseCmdLineClient_usage.txt CacheRegistryClient_usage.txt MobyCmdLineClient_usage.txt MobyDigest_usage.txt MobyGraphs_usage.txt MosesGenerators_usage.txt TestingMobyParser_usage.txt Added Files: argsfile.example Log Message: moby-live/Java/src/Clients/help argsfile.example,NONE,1.1 BaseCmdLineClient_usage.txt,1.1,1.2 CacheRegistryClient_usage.txt,1.2,1.3 MobyCmdLineClient_usage.txt,1.9,1.10 MobyDigest_usage.txt,1.2,1.3 MobyGraphs_usage.txt,1.6,1.7 MosesGenerators_usage.txt,1.1,1.2 TestingMobyParser_usage.txt,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/BaseCmdLineClient_usage.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/help/BaseCmdLineClient_usage.txt 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/help/BaseCmdLineClient_usage.txt 2005/09/04 13:45:37 1.2 @@ -52,3 +52,5 @@ -outxml ... show results as XML -o +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt 2005/08/26 06:27:03 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt 2005/09/04 13:45:37 1.3 @@ -38,3 +38,6 @@ other Moby registries stored in the same -cachedir directory) -q ... quiet mode + +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt 2005/08/07 06:31:03 1.9 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt 2005/09/04 13:45:37 1.10 @@ -210,3 +210,6 @@ format of : service-name[,service-authority] + +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/08/26 06:27:03 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/09/04 13:45:37 1.3 @@ -29,3 +29,6 @@ -details ... print the above with all details (by default only names are printed) + +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2005/08/26 06:27:03 1.6 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2005/09/04 13:45:37 1.7 @@ -120,3 +120,5 @@ workflow creation will produce many messages. By default it does not. +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MosesGenerators_usage.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/help/MosesGenerators_usage.txt 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MosesGenerators_usage.txt 2005/09/04 13:45:37 1.2 @@ -62,4 +62,5 @@ using an external program 'dot' (from Graphviz package). If this program is not on your PATH, specify here where it is. - +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/TestingMobyParser_usage.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/help/TestingMobyParser_usage.txt 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/help/TestingMobyParser_usage.txt 2005/09/04 13:45:37 1.2 @@ -25,3 +25,6 @@ (this is not usually needed at all - only when your data type definitions, the generated data types, are not up-to-date) + +[Note: You can also use -argsfile to read arguments from a +file. See details in src/Client/help/argsfile.example.] From senger at pub.open-bio.org Sun Sep 4 13:45:38 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 4 Sep 2005 09:45:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509041345.j84Djcir028126@pub.open-bio.org> senger Sun Sep 4 09:45:38 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv27838/src/webapps Added Files: standard.wsdd.template Log Message: moby-live/Java/src/webapps standard.wsdd.template,NONE,1.1 From fgibbons at pub.open-bio.org Tue Sep 6 20:23:40 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 6 Sep 2005 16:23:40 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062023.j86KNe0m004114@pub.open-bio.org> fgibbons Tue Sep 6 16:23:40 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv4089/MOBY Modified Files: CrossReference.pm Log Message: - Cleaned up docs (removed redundant Title: attributes). - Enforced the fact that type() can take one of only two values: "xref" and "object" - Puzzled about why these methods return the old value of the parameter, when used to set a parameter. Seems like it'd make more sense to either return the new value (to indicate success), or better yet return the object, to allow chaining. moby-live/Perl/MOBY CrossReference.pm,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CrossReference.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/MOBY/CrossReference.pm 2004/12/14 20:47:04 1.6 +++ /home/repository/moby/moby-live/Perl/MOBY/CrossReference.pm 2005/09/06 20:23:40 1.7 @@ -11,31 +11,23 @@ =head1 SYNOPSIS -=cut - =head1 DESCRIPTION -this holds all of the relevant information for a MOBY -cross reference of either the Xref type, or the -Object type. Object cross-references have only -namespace and id attributes, while Xref cross-references -have namespace, id, authURI, serviceName, xref_type, -and evidence_code attributes. To determine which -type of cross-reference you have in-hand, call the -"type" method. +This holds all of the relevant information for a MOBY cross reference +of either the Xref type, or the Object type. Object cross-references +have only namespace and id attributes, while Xref cross-references +have namespace, id, authURI, serviceName, xref_type, and evidence_code +attributes. To determine which type of cross-reference you have +in-hand, call the "type" method. =head1 AUTHORS Mark Wilkinson (markw at illuminae dot com) -=cut - =head1 METHODS - =head2 new - Title : new Usage : my $XR = MOBY::Client::CrossReference->new(%args) Function : create SimpleArticle object Returns : MOBY::Client::CrossReference object @@ -49,82 +41,58 @@ Object => The XML of a base MOBY Object in this ns/id -=cut - =head2 type - Title : type Usage : $type = $XR->type($name) Function : get/set type attribute Returns : string; returns last value if new value set Arguments : (required)one of "xref" or "object", depending on the type of cross-ref you are making (new, or v0.5 API) -=cut - =head2 namespace - Title : namespace Usage : $ns = $XR->namespace($ns) Function : get/set namespace Returns : string; returns last value if new value set Arguments : (optional) string representing namespace to set -=cut - =head2 id - Title : id Usage : $id = $XR->id($id) Function : get/set id for the cross-reference Returns : string; returns last value if new value set Arguments : (optional) the id of the cross-reference -=cut - =head2 authURI - Title : authURI Usage : $auth = $XR->authURI($auth) Function : get/set id for the authority for the xref Returns : string; returns last value if new value set Arguments : (optional) the new authority of the xref type reference -=cut - =head2 serviceName - Title : serviceName Usage : $name = $XR->serviceName($name) Function : get/set serviceName for the cross-reference Returns : string; returns last value if new value set Arguments : (optional) the new serviceName of the cross-reference -=cut - =head2 evidence_code - Title : evidence_code Usage : $code = $XR->evidence_code($code) Function : get/set evidence_code for the cross-reference Returns : string; returns last value if new value set Arguments : (optional) the evidence_code of the cross-reference -=cut - =head2 xref_type - Title : xref_type Usage : $xreftype = $XR->xref_type($xreftype) Function : get/set xref_type for the cross-reference Returns : string; returns last value if new value set Arguments : (optional) the xref_type of the cross-reference -=cut - =head2 Object - Title : Object Usage : $XML = $XR->Object() Function : retrieve a base MOBY Object XML (e.g. to send to a service) Returns : XML or empty string if there is no namespace or id value @@ -133,98 +101,102 @@ { - sub type { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_type}; - $self->{_type} = $type; - return $old; - } - return $self->{_type}; - } - - sub namespace { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_namespace}; - $self->{_namespace} = $type; - return $old; - } - return $self->{_namespace}; - } - - sub id { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_id}; - $self->{_id} = $type; - return $old; - } - return $self->{_id}; - } - - sub authURI { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_authURI}; - $self->{_authURI} = $type; - return $old; - } - return $self->{_authURI}; - } - - sub serviceName { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_serviceName}; - $self->{_serviceName} = $type; - return $old; - } - return $self->{_serviceName}; - } - - sub evidence_code { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_evidenceCode}; - $self->{_evidenceCode} = $type; - return $old; - } - return $self->{_evidenceCode}; - } - - sub xref_type { - my ( $self, $type ) = @_; - if ($type) { - my $old = $self->{_xref_type}; - $self->{_xref_type} = $type; - return $old; - } - return $self->{_xref_type}; - } +# Why do these methods return the PREVIOUS value of their respective variables? +# How would that be useful? +# Seems more intuitive to return new value, or perhaps even the object itself. + sub type { + # only two types are permitted. + my ( $self, $type ) = @_; + if ($type && ($type =~ /^(xref|object)$/)) { + my $old = $self->{_type}; + $self->{_type} = $type; + return $old; + } + return $self->{_type}; + } + + sub namespace { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_namespace}; + $self->{_namespace} = $type; + return $old; + } + return $self->{_namespace}; + } + + sub id { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_id}; + $self->{_id} = $type; + return $old; + } + return $self->{_id}; + } + + sub authURI { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_authURI}; + $self->{_authURI} = $type; + return $old; + } + return $self->{_authURI}; + } + + sub serviceName { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_serviceName}; + $self->{_serviceName} = $type; + return $old; + } + return $self->{_serviceName}; + } + + sub evidence_code { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_evidenceCode}; + $self->{_evidenceCode} = $type; + return $old; + } + return $self->{_evidenceCode}; + } + + sub xref_type { + my ( $self, $type ) = @_; + if ($type) { + my $old = $self->{_xref_type}; + $self->{_xref_type} = $type; + return $old; + } + return $self->{_xref_type}; + } } sub new { - my ( $caller, %args ) = @_; - my $caller_is_obj = ref($caller); - return $caller if $caller_is_obj; - my $class = $caller_is_obj || $caller; - my $proxy; - my $self = bless {}, $class; - while ( my ( $key, $value ) = each %args ) { - $self->$key($value); - } - return undef unless ( $self->type && $self->namespace && $self->id ); - return $self; + my ( $caller, %args ) = @_; + my $caller_is_obj = ref($caller); + return $caller if $caller_is_obj; + my $class = $caller_is_obj || $caller; + my $proxy; + my $self = bless {}, $class; + while ( my ( $key, $value ) = each %args ) { + $self->$key($value); + } + return undef unless ( $self->type && $self->namespace && $self->id ); + return $self; } sub Object { - my ($self) = @_; - return "" unless ( $self->namespace && $self->id ); - return ""; + my ($self) = @_; + return "" unless ( $self->namespace && $self->id ); + return ""; } sub DESTROY { } 1; From fgibbons at pub.open-bio.org Tue Sep 6 20:24:19 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 6 Sep 2005 16:24:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062024.j86KOJfc004155@pub.open-bio.org> fgibbons Tue Sep 6 16:24:19 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4134/t Added Files: CrossReference.t Log Message: - Test MOBY/CrossReference.pm module. moby-live/Perl/t CrossReference.t,NONE,1.1 From fgibbons at pub.open-bio.org Tue Sep 6 20:28:34 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 6 Sep 2005 16:28:34 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062028.j86KSYrh004200@pub.open-bio.org> fgibbons Tue Sep 6 16:28:34 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv4175/MOBY/Client Modified Files: SecondaryArticle.pm Log Message: - Clean up code, replace duplicate blocks of code (default/datatype/max/min) with single generic. moby-live/Perl/MOBY/Client SecondaryArticle.pm,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/SecondaryArticle.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/MOBY/Client/SecondaryArticle.pm 2004/12/14 22:31:30 1.6 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/SecondaryArticle.pm 2005/09/06 20:28:34 1.7 @@ -22,14 +22,11 @@ Mark Wilkinson (markw at illuminae dot com) -=cut - =head1 METHODS =head2 new - Title : new Usage : my $SA = MOBY::Client::SecondaryArticle->new(%args) Function : create SecondaryArticle object Returns : MOBY::Client::SecondaryArticle object @@ -42,90 +39,57 @@ XML_DOM => $XML_DOM node of the Secondary article (optional) XML => $XML XML string representing the Secondary article (optional) -=cut - =head2 articleName - Title : articleName Usage : $name = $SA->articleName($name) Function : get/set articleName Returns : string Arguments : (optional) string representing articleName to set -=cut - =head2 objectType - Title : objectType Usage : $type = $SA->objectType($type) Function : get/set name Returns : string Arguments : (optional) string representing objectType to set -=cut - =head2 namespaces - Title : namespaces Usage : $namespaces = $SA->namespaces(\@namespaces) Function : get/set namespaces for the objectType Returns : arrayref of namespace strings Arguments : (optional) arrayref of namespace strings to set -=cut - =head2 XML - Title : XML Usage : $SA = $SA->XML($XML) Function : set/reset all parameters for this object from the XML Returns : MOBY::Client::SecondaryArticle Arguments : (optional) XML fragment from and including ... -=cut - =head2 XML_DOM - Title : XML_DOM Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) Function : set/reset all parameters for this object from the XML::DOM node for Returns : MOBY::Client::SecondaryArticle Arguments : (optional) an $XML::DOM node from the article of a DOM -=cut - =head2 isSecondary - Title : isSecondary Usage : $boolean = $IN->isSecondary() - Function : is this a SecondaryArticle type? - (yes, I know this is obvious) + Function : is this a SecondaryArticle type? (yes, I know this is obvious) Returns : 1 (true) -=cut - =head2 isSimple - Title : isSimple Usage : $boolean = $IN->isSimple() Function : is this a SimpleArticle type - (yes, I know this is obvious, but since you can - get both Simple and Collection objects in your - Input and output lists, it is good to be able - to test what you have in-hand) Returns : 0 (false) -=cut - =head2 isCollection - Title : isCollection Usage : $boolean = $IN->isCollection() Function : is this a CollectionArticle type - (yes, I know this is obvious, but since you can - get both Simple and Collection objects in your - Input and output lists, it is good to be able - to test what you have in-hand) Returns : 0 for false =cut @@ -136,11 +100,11 @@ # DATA #___________________________________________________________ #ATTRIBUTES - my %_attr_data = # DEFAULT ACCESSIBILITY + my %_attr_data = # DEFAULT ACCESSIBILITY ( - articleName => [ undef, 'read/write' ], - objectType => [ undef, 'read/write' ], - namespaces => [ [], 'read/write' ], + articleName => [ undef, 'read/write' ], + objectType => [ undef, 'read/write' ], + namespaces => [ [], 'read/write' ], XML_DOM => [ undef, 'read/write' ], XML => [ undef, 'read/write' ], isSecondary => [ 1, 'read' ], @@ -174,39 +138,39 @@ } sub addEnum { - my ( $self, $enum ) = @_; - $self->{enum} = [] unless $self->{enum}; - return $self->{enum} unless defined( $enum ); - push @{ $self->{enum} }, $enum; - return $self->{enum}; + # No return value necessary + my ( $self, $enum ) = @_; + $self->{enum} = [] unless $self->{enum}; + return() unless defined ($enum); + push @{ $self->{enum} }, $enum; } } sub new { - my ( $caller, %args ) = @_; - my $caller_is_obj = ref( $caller ); - return $caller if $caller_is_obj; - my $class = $caller_is_obj || $caller; - my $proxy; - my $self = bless {}, $class; - foreach my $attrname ( $self->_standard_keys ) { - if ( exists $args{$attrname} ) { - $self->{$attrname} = $args{$attrname}; - } elsif ( $caller_is_obj ) { - $self->{$attrname} = $caller->{$attrname}; - } else { - $self->{$attrname} = $self->_default_for( $attrname ); - } - } - $self->{enum} = [] unless $self->enum; - if ( $self->XML && ref( $self->XML ) ) { - return 0; - } elsif ( $self->XML_DOM && !( ref( $self->XML_DOM ) =~ /libxml/i ) ) { - return 0; - } - $self->createFromXML if ( $self->XML ); - $self->createFromDOM( $self->XML_DOM ) if ( $self->XML_DOM ); - return $self; + my ( $caller, %args ) = @_; + my $caller_is_obj = ref( $caller ); + return $caller if $caller_is_obj; + my $class = $caller_is_obj || $caller; + my $proxy; + my $self = bless {}, $class; + foreach my $attrname ( $self->_standard_keys ) { + if ( exists $args{$attrname} ) { + $self->{$attrname} = $args{$attrname}; + } elsif ( $caller_is_obj ) { + $self->{$attrname} = $caller->{$attrname}; + } else { + $self->{$attrname} = $self->_default_for( $attrname ); + } + } + $self->{enum} = [] unless $self->enum; + if ( $self->XML && ref( $self->XML ) ) { + return 0; + } elsif ( $self->XML_DOM && !( ref( $self->XML_DOM ) =~ /libxml/i ) ) { + return 0; + } + $self->createFromXML if ( $self->XML ); + $self->createFromDOM( $self->XML_DOM ) if ( $self->XML_DOM ); + return $self; } sub createFromXML { @@ -226,91 +190,66 @@ $self->articleName( "" ); $self->objectType( "" ); my $attr = $dom->getAttributeNode( 'articleName' ); - my $articleName = ""; - $articleName = $attr->getValue if $attr; - $self->articleName( $articleName ); - + $self->articleName( $attr ? $attr->getValue : "" ); if ( @{ $dom->getElementsByTagName( 'Value' ) }[0] ) { - return $self->_createInstantiatedArticle( $dom ); + return $self->_createInstantiatedArticle( $dom ); } else { - return $self->_createTemplateArticle( $dom ); + return $self->_createTemplateArticle( $dom ); } } sub _createTemplateArticle { - my ( $self, $dom ) = @_; + my ( $self, $dom ) = @_; - #datatype => [undef, 'read/write' ], - #default => [undef, 'read/write' ], - #max => [undef, 'read/write' ], - #min => [undef, 'read/write' ], - #enum => [[], 'read/write' ], - my $objects = $dom->getElementsByTagName( "datatype" ); - if ( $objects->get_node( 1 ) ) { - my $data; - foreach my $child ( $objects->get_node( 1 )->childNodes ) { - next unless $child->nodeType == TEXT_NODE; - $data .= $child->toString; - $data =~ s/\s//g; - } - $self->datatype( $data ); - } - $objects = $dom->getElementsByTagName( "default" ); - if ( $objects->get_node( 1 ) ) { - my $def; - foreach my $child ( $objects->get_node( 1 )->childNodes ) { - next unless $child->nodeType == TEXT_NODE; - $def .= $child->toString; - $def =~ s/\s//g; - } - $self->default( $def ); - } - $objects = $dom->getElementsByTagName( "max" ); - if ( $objects->get_node( 1 ) ) { - my $max; - foreach my $child ( $objects->get_node( 1 )->childNodes ) { - next unless $child->nodeType == TEXT_NODE; - $max .= $child->toString; - $max =~ s/\s//g; - } - $self->max( $max ); - } - $objects = $dom->getElementsByTagName( "min" ); - if ( $objects->get_node( 1 ) ) { - my $min; - foreach my $child ( $objects->get_node( 1 )->childNodes ) { - next unless $child->nodeType == TEXT_NODE; - $min .= $child->toString; - $min =~ s/\s//g; - } - $self->min( $min ); - } - $objects = $dom->getElementsByTagName( "enum" ); - if ( $objects->get_node( 1 ) ) { - foreach ( 1 .. $objects->size() ) { - foreach my $child ( $objects->get_node( $_ )->childNodes ) { - my $val; - next unless $child->nodeType == TEXT_NODE; - $val = $child->toString; - next unless defined( $val ); - $val =~ s/^\s//; - $val =~ s/\s$//; - $self->addEnum( $val ); - } - } - } - return $self; + #datatype => [undef, 'read/write' ], + #default => [undef, 'read/write' ], + #max => [undef, 'read/write' ], + #min => [undef, 'read/write' ], + #enum => [[], 'read/write' ], + my @single_valued = qw/datatype default max min/; + my $objects; + foreach my $param (@single_valued) { + $objects = $dom->getElementsByTagName( $param ); + if ( $objects->get_node( 1 ) ) { + my $data; + foreach my $child ( $objects->get_node( 1 )->childNodes ) { + next unless $child->nodeType == TEXT_NODE; + $data .= $child->toString; + $data =~ s/\s//g; # Trim all whitespace + } + $self->$param( $data ); + } + } + # Since it is (array)multi-valued, 'enum' is a little different from the others. + $objects = $dom->getElementsByTagName( "enum" ); + if ( $objects->get_node( 1 ) ) { + foreach ( 1 .. $objects->size() ) { + foreach my $child ( $objects->get_node( $_ )->childNodes ) { + my $val; + next unless $child->nodeType == TEXT_NODE; + $val = $child->toString; + next unless defined( $val ); + # Trim space from front and back, but leave alone in middle....? + $val =~ s/^\s//; + $val =~ s/\s$//; + $self->addEnum( $val ); + } + } + } + return $self; } sub _createInstantiatedArticle { - my ( $self, $dom ) = @_; + my ( $self, $dom ) = @_; - #43764 - my $values = $dom->getElementsByTagName( 'Value' ); - foreach my $child ( $values->get_node( 1 )->childNodes ) { - next unless $child->nodeType == TEXT_NODE; - $self->value( $self->value . $child->toString ); - } + #43764 + my $values = $dom->getElementsByTagName( 'Value' ); + $self->value( "" ); # Initialize to 1) avoid Perl warnings 2) be good. + foreach my $child ( $values->get_node( 1 )->childNodes ) { + next unless $child->nodeType == TEXT_NODE; + # Would we *really* want to catenate values like this? + $self->value( $self->value . $child->toString ); + } } sub AUTOLOAD { From fgibbons at pub.open-bio.org Tue Sep 6 20:30:08 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 6 Sep 2005 16:30:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062030.j86KU80e004246@pub.open-bio.org> fgibbons Tue Sep 6 16:30:08 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4225/t Added Files: Client-SecondaryArticle.t Log Message: - Test MOBY::Client::SecondaryArticle (i.e., ). moby-live/Perl/t Client-SecondaryArticle.t,NONE,1.1 From fgibbons at pub.open-bio.org Tue Sep 6 20:31:06 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 6 Sep 2005 16:31:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062031.j86KV6ZL004279@pub.open-bio.org> fgibbons Tue Sep 6 16:31:06 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4254/t Modified Files: Client-CollectionArticle.t Log Message: - More tests for CollectionArticle. moby-live/Perl/t Client-CollectionArticle.t,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-CollectionArticle.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/t/Client-CollectionArticle.t 2005/08/31 14:17:11 1.1 +++ /home/repository/moby/moby-live/Perl/t/Client-CollectionArticle.t 2005/09/06 20:31:06 1.2 @@ -25,12 +25,7 @@ }; -TODO: { - local $TODO = "Everything."; -} - -my @autoload = qw/articleName Simples isSimple isCollection isSecondary -XML XML_DOM/; +my @autoload = qw/articleName Simples isSimple isCollection isSecondary XML XML_DOM/; my @API = (@autoload, qw/new createFromXML createFromDOM addSimple/); my $coll = MOBY::Client::CollectionArticle->new(); @@ -42,3 +37,64 @@ is($coll->isSecondary, 0) or diag("CollectionArticle cannot be Secondary"); is($coll->isCollection, 1) or diag("CollectionArticle must return isCollection=1"); +my $aName = 'my Article'; +# Check XML-generation code. +# In reality, (XML, createFromXML) and (XML_DOM, createFromDOM) should behave the same. +# Let's not assume that though. + +my ($artName, $ns, $id, $obj, $lsid) + = ('my Simple Article', 'SGD', 'S0005111', 'Object', 'urn:foo:bar:my_lsid'); +my ($collArtName) = "my Collection"; +my $xml_coll = < + + + + + + + +XML + +$coll = MOBY::Client::CollectionArticle->new( XML => $xml_coll); + +is($coll->articleName(), $collArtName) + or diag("CollectionArticle not correctly built from XML (articleName wrong)"); + +is(scalar @{$coll->Simples()}, 2) + or diag("CollectionArticle didn't return correct number of Simples"); + +TODO: { + local $TODO = "We should ideally check the contents of the Simples that are returned...."; +} + +sub XML_maker { # Turn XML text into DOM. + my $XML = shift; + my $parser = XML::LibXML->new(); + my $doc; + eval { $doc = $parser->parse_string( $XML ); }; + return '' if ( $EVAL_ERROR ); #("Couldn't parse '$XML' because:\n\t$EVAL_ERROR") + return $doc->getDocumentElement(); +} + + +$coll = MOBY::Client::CollectionArticle->new( XML_DOM => XML_maker($xml_coll)); + +is($coll->articleName(), $collArtName) + or diag("CollectionArticle not correctly built from XML_DOM (articleName wrong)"); + + + +TODO: { + local $TODO = <new()->XML(\$xml), +I expect that the XML will be *parsed*, to modify the object, +not that the attribute 'XML' will be set, and the rest left unchanged." +TODO + + $coll = MOBY::Client::CollectionArticle->new(); + $coll->XML($xml_coll); + is($coll->articleName, $collArtName) + or diag("Couldn't create CollectionArticle from autoloaded method XML(): articleName wrong"); + +} From fgibbons at pub.open-bio.org Tue Sep 6 20:43:22 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 6 Sep 2005 16:43:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062043.j86KhM6u004331@pub.open-bio.org> fgibbons Tue Sep 6 16:43:22 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4306/t Modified Files: Client-OntologyServer.t Log Message: - Augment a little, and move tests on relationshipExists() to TODO, since it doesn't appear to work. moby-live/Perl/t Client-OntologyServer.t,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/01 16:09:39 1.2 +++ /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/06 20:43:21 1.3 @@ -43,32 +43,40 @@ # and check them all here? Ditto for Objects, Service-types # my ($success, $msg, $existingURI); -my @check_ns = qw/SGD NCBI_gi/; +my @check_ns = qw/SGD NCBI_gi GO FB PMID/; # These seem pretty solid foreach (@check_ns) { ($success, $msg, $existingURI) = $os->namespaceExists( term => $_); is($success, 1) or diag("Namespace '$_' reported erroneously as non-existent."); } -my @check_obj = qw/ Object String Integer Float/; +# Could get these allowed datatypes from MOBY::Config, +# except that module only works when you've got a local registry set up. +my @check_obj = qw/ Object String Integer Float DateTime/; # At least we can be confident that primitive types will always be valid foreach (@check_obj) { ($success, $msg, $existingURI) = $os->objectExists(term => $_); is($success, 1) or diag("Object '$_' reported erroneously as non-existent."); } -my @check_servicetype = qw/Retrieval/; +my @check_servicetype = qw/Alignment Analysis Conversion Edit +NCBI_Blast Parsing SetIntersection SetOperation SetUnion +Retrieval Registration Resolution +StructuralPrediction/; # Service types don't change much, but who knows.... foreach (@check_servicetype) { ($success, $msg, $existingURI) = $os->serviceExists(term => $_); is($success, 1) or diag("Service type '$_' reported erroneously as non-existent."); } -my @check_rel = qw/ISA HASA HAS/; -foreach (@check_rel) { - ($success, $msg, $existingURI) = $os->relationshipExists(term => $_); - is($success, 1) - or diag("Relationship '$_' reported erroneously as non-existent."); +TODO: { + local $TODO = "Fix whatever is broken with these relationship types - or else fix this test."; + my @check_rel = qw/ISA HASA HAS/; # There should only be very few valid relationship types. + foreach (@check_rel) { + ($success, $msg, $existingURI) = $os->relationshipExists(term => $_); + is($success, 1) + or diag("Relationship '$_' reported erroneously as non-existent."); + } } From fgibbons at pub.open-bio.org Tue Sep 6 20:46:18 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 6 Sep 2005 16:46:18 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062046.j86KkIfc004374@pub.open-bio.org> fgibbons Tue Sep 6 16:46:18 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4353/t Added Files: lsid-authority-ClassResolver.t lsid-authority-Error.t lsid-authority-NamespaceResolver.t lsid-authority-PredicateResolver.t lsid-authority-RDFConfigure.t lsid-authority-RelationshipResolver.t lsid-authority-ServiceInstanceResolver.t lsid-authority-ServiceResolver.t lsid-authority-dbConnect.t Log Message: - Add tests for LSID components. moby-live/Perl/t lsid-authority-ClassResolver.t,NONE,1.1 lsid-authority-Error.t,NONE,1.1 lsid-authority-NamespaceResolver.t,NONE,1.1 lsid-authority-PredicateResolver.t,NONE,1.1 lsid-authority-RDFConfigure.t,NONE,1.1 lsid-authority-RelationshipResolver.t,NONE,1.1 lsid-authority-ServiceInstanceResolver.t,NONE,1.1 lsid-authority-ServiceResolver.t,NONE,1.1 lsid-authority-dbConnect.t,NONE,1.1 From fgibbons at pub.open-bio.org Tue Sep 6 20:47:04 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 6 Sep 2005 16:47:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062047.j86Kl4xc004418@pub.open-bio.org> fgibbons Tue Sep 6 16:47:04 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv4393/t Added Files: Central.t Config.t dbConnect.t Log Message: - Add tests for various components. moby-live/Perl/t Central.t,1.2,1.3 Config.t,NONE,1.1 dbConnect.t,NONE,1.1 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Central.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/t/Central.t 2003/11/12 17:05:48 1.2 +++ /home/repository/moby/moby-live/Perl/t/Central.t 2005/09/06 20:47:04 1.3 @@ -1,15 +1,76 @@ # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl 1.t' +# !!!!STOP!!!! +# This test file is for the MOBY::Central module. +# As a regular Perl user, you probably intend to use MOBY::Client::Central, +# which is discouragingly similarly named, and has many similarly named methods, +# but quite different functionality. +# This code runs on the server side, responding to incoming requests, +# and constructing XML messages that communicate the results of those requests. + +# Note added by Frank Gibbons. +# Tests should, as far as possible, avoid the use of literals. +# If you register a service with authURI => mysite.com, +# and you want to test a retrieved description of the service, don't test that the service returns authURI eq "mysite.com", +# test so that it returns the same value as you used to register it in the first place. + ######################### # change 'tests => 1' to 'tests => last_test_to_print'; - -use Test::More tests => 1; +#use SOAP::Lite +trace; +use Test::More 'no_plan'; +use strict; +use Data::Dumper; +#Is the client-code even installed? BEGIN { use_ok('MOBY::Central') }; + +END {}; -######################### +############ ENFORCE REGISTRY API ############### -# Insert your test code below, the Test::More module is use()ed here so read -# its man page ( perldoc Test::More ) for help writing this test script. +# First, mandatory methods for all registries. +# Notice: new() is NOT defined here, since it is deprecated. +my @API = qw/Registration +registerObjectClass _registerObjectPayload +deregisterObjectClass _deregisterObjectPayload +_testObjectTypeAgainstPrimitives +registerServiceType _registerServiceTypePayload +deregisterServiceType _deregisterServiceTypePayload +retrieveNamespaces _registerNamespacePayload +deregisterNamespace _deregisterNamespacePayload +registerService _registerServicePayload +_getServiceInstanceRDF _registerArticles +deregisterService _deregisterServicePayload +findService _findServicePayload +_extractObjectTypes registerServiceWSDL +_extract_ids +_searchForServicesWithArticle _searchForSimple _searchForCollection +_extractObjectTypesAndNamespaces +retrieveService _retrieveServicePayload +retrieveResourceURLs retrieveServiceProviders retrieveServiceNames +retrieveServiceTypes retrieveRelationshipTypes retrieveObjectNames +retrieveObjectDefinition retrieveNamespaces +retrieveObject _retrieveObjectPayload +Relationships DUMP_MySQL _ISAPayload/; + +can_ok("MOBY::Central", @API) + or diag("MOBY::Central failed to implement full API"); + +################## MOBY Registration Tests ################# + +################## OBJECT REGISTRATION ############# +# Test 3 inherits from two isas - should fail +my %Obj = ( objectType => "Rubbish", + description => "a human-readable description of the object", + contactEmail => 'your at email.address', + authURI => "test.suite.com", + Relationships => { + ISA => [ + ['Object', 'article1'], + ['Object', 'articleName2']], + HASA => [ + ['Object', 'articleName3']] + } + ); From kawas at pub.open-bio.org Tue Sep 6 21:29:10 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 6 Sep 2005 17:29:10 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062129.j86LTAip004582@pub.open-bio.org> kawas Tue Sep 6 17:29:10 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema In directory pub.open-bio.org:/tmp/cvs-serv4557/org/biomoby/shared/schema Modified Files: RdfParser.java Log Message: Removed some imports statements that werent used. Added a check that basically checks if a certain property exists for a datatype and if not then null is returned. moby-live/Java/src/main/org/biomoby/shared/schema RdfParser.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/RdfParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/RdfParser.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/RdfParser.java 2005/09/06 21:29:10 1.2 @@ -1,269 +1,269 @@ -/* - * Created on Jun 17, 2005 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.biomoby.shared.schema; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.StringReader; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.LinkedList; - -import org.biomoby.client.rdf.vocabulary.Predicates; -import org.biomoby.client.ui.graphical.servlet.jresources.RESOURCE; -import org.biomoby.shared.MobyException; - -import com.hp.hpl.jena.graph.Node; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; -import com.hp.hpl.jena.rdf.model.NodeIterator; -import com.hp.hpl.jena.rdf.model.Property; -import com.hp.hpl.jena.rdf.model.RDFNode; -import com.hp.hpl.jena.rdf.model.RDFReader; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.rdf.model.Statement; -import com.hp.hpl.jena.rdf.model.StmtIterator; -import com.hp.hpl.jena.vocabulary.RDF; -import com.hp.hpl.jena.vocabulary.RDFS; - -/** - * @author Eddie - * - * TODO To change the template for this generated type comment go to Window - - * Preferences - Java - Code Style - Code Templates - */ -public class RdfParser { - - public static String OBJECT_URI = "http://biomoby.org/RESOURCES/MOBY-S/Objects#"; - - public static MElement buildMElement(String name) { - String rdf = null; - try { - rdf = getObjectRdf(); - } catch (MobyException e) { - e.printStackTrace(); - } - // return null if i cant build the element - if (rdf == null) - return null; - - // create the model - Model model = ModelFactory.createDefaultModel(); // the RESOURCE model - RDFReader reader = model.getReader(); - reader.read(model, new StringReader(rdf), null); - - // start querying model for what we need and create the MElement - String rootDescription = getDescription(model, name); - MElement root = new MElement(name, "", rootDescription); - String rootsParent = getParentDataType(model, name); - if (rootsParent == null) - rootsParent = ""; - if (MElement.isPrimitive(rootsParent)) { - root.setType(rootsParent); - } else { - root.setType(null); - } - // go through the isa relationships and extract the has/hasa - processRelationships(root, model, name); - - return root; - } - - /** - * @param root - * @param model - * @param name - */ - private static void processRelationships(MElement root, Model model, String name) { - if (name.indexOf("#") > 0) { - name = name.substring(name.indexOf("#")+1); - } - Resource resource = model.getResource(OBJECT_URI + name); - if (resource.hasProperty(RDFS.subClassOf)) { - String parent = resource.getProperty(RDFS.subClassOf) - .getObject().asNode().getURI(); - processRelationships(root, model, parent); - } - // process the has children - processChildrenTypes(root, model, Predicates.has, name); - // process the hasa children - processChildrenTypes(root, model, Predicates.hasa, name); - } - - /** - * @param root - * @param model - * @param has - * @param name - */ - private static void processChildrenTypes(MElement root, Model model, - Property property, String name) { - Resource resource = model.getResource(OBJECT_URI + name); - StmtIterator iterator = resource.listProperties(property); - if (iterator != null) - while (iterator.hasNext()) { - Statement next = (Statement) iterator.next(); - RDFNode object = next.getObject(); - if (object instanceof Resource) { - Resource child = (Resource) object; - String qualifiedName = null; - String childName = ""; - String childArticleName = ""; - String childDescription = ""; - if (child.hasProperty(RDF.type)) { - qualifiedName = child.getProperty(RDF.type).getObject() - .toString(); - childName = stripOutURI(child.getProperty(RDF.type) - .getObject().toString()); - } - if (child.hasProperty(Predicates.articleName)) { - childArticleName = stripOutLiteral(child.getProperty( - Predicates.articleName).getObject().toString()); - } - childDescription = stripOutLiteral(model.getResource( - qualifiedName).getProperty(RDFS.comment) - .getObject().toString()); - - MElement element = new MElement(childName, - childArticleName, childDescription); - String rootsParent = getParentDataType(model, childName); - if (MElement.isPrimitive(rootsParent)) { - element.setType(rootsParent); - } else { - element.setType(null); - } - processChildrenTypes(element, model, Predicates.has, - childName); - processChildrenTypes(element, model, Predicates.hasa, - childName); - if (property.getLocalName().equalsIgnoreCase("hasa")) { - root.addHasaMElement(element); - } else { - root.addHasMElement(element); - } - } - } - } - - /** - * @param model - * @param name - * @return - */ - private static String getParentDataType(Model model, String name) { - - // the statement should return null iff the object is the Moby root - // object - if (name.equals("Object")) - return null; - LinkedList list = new LinkedList(); - list.addFirst(name); - name = OBJECT_URI + name; - String parent = ""; - String previousParent = ""; - Resource resource = model.getResource(name); - Statement statement = resource.getProperty(RDFS.subClassOf); - do { - parent = statement.getObject().toString(); - if (!((String) list.getFirst()).equals(parent)) { - list.addFirst(parent); - } - resource = model.getResource(parent); - statement = resource.getProperty(RDFS.subClassOf); - - } while (statement != null); - // check to see if we have a primitive - parent = (String) list.removeFirst(); - if (list.size() > 0) { - previousParent = (String) list.removeFirst(); - previousParent = stripOutURI(previousParent); - if (MElement.isPrimitive(previousParent)) { - return previousParent; - } - } - // no primitive parent, so every object inherits from object - parent = stripOutURI(parent); - return parent; - } - - /** - * @param model - * @param name - * @return - */ - private static String getDescription(Model model, String name) { - Resource resource = model.getResource(OBJECT_URI + name); - Statement comment = resource.getProperty(RDFS.comment); - String description = comment.getObject().toString(); - description = stripOutLiteral(description); - return description; - } - - private static String getObjectRdf() throws MobyException { - String s = null; - StringBuffer sb = new StringBuffer(); - URL url = null; - try { - url = new URL(OBJECT_URI); - } catch (MalformedURLException e1) { - e1.printStackTrace(); - return null; - } - try { - BufferedReader in = null; - in = new BufferedReader(new InputStreamReader(url.openStream())); - while ((s = in.readLine()) != null) { - sb.append(s); - } - - } catch (IOException e) { - e.printStackTrace(); - return null; - } - return sb.toString(); - } - - private static String stripOutURI(String object) { - if (object.indexOf("#") > 0) - object = object.substring(object.indexOf("#") + 1); - return object; - } - - private static String stripOutLiteral(String object) { - if (object.indexOf("~") > 0) - object = object.substring(0, object.indexOf("~")); - return object; - } - - public static void main(String[] args) { - System.out.println("Is it me?"); - System.out.println("\nOutput Imag Object\n"); - System.out.println(RdfParser.buildMElement("DNASequence")); -/* System.out.println("###########################################"); - System.out.println("Outputting a String object"); - System.out.println(RdfParser.buildMElement("String")); - - System.out.println("###########################################"); - System.out.println("Outputting the base object"); - System.out.println(RdfParser.buildMElement("Object")); - - System.out.println("###########################################"); - System.out.println("Outputting a DNA sequence object"); - System.out.println(RdfParser.buildMElement("DNASequence")); - - System.out.println("###########################################"); - System.out.println("Outputting a GFF object"); - System.out.println(RdfParser.buildMElement("GFF")); - - System.out.println("###########################################"); - System.out.println("Outputting a BasicGFFSequenceFeature object"); - System.out.println(RdfParser.buildMElement("BasicGFFSequenceFeature")); -*/ - } -} +/* + * Created on Jun 17, 2005 + * + * TODO To change the template for this generated file go to + * Window - Preferences - Java - Code Style - Code Templates + */ +package org.biomoby.shared.schema; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.LinkedList; + +import org.biomoby.client.rdf.vocabulary.Predicates; +import org.biomoby.shared.MobyException; + +import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.ModelFactory; +import com.hp.hpl.jena.rdf.model.Property; +import com.hp.hpl.jena.rdf.model.RDFNode; +import com.hp.hpl.jena.rdf.model.RDFReader; +import com.hp.hpl.jena.rdf.model.Resource; +import com.hp.hpl.jena.rdf.model.Statement; +import com.hp.hpl.jena.rdf.model.StmtIterator; +import com.hp.hpl.jena.vocabulary.RDF; +import com.hp.hpl.jena.vocabulary.RDFS; + +/** + * @author Eddie + * + * TODO To change the template for this generated type comment go to Window - + * Preferences - Java - Code Style - Code Templates + */ +public class RdfParser { + + public static String OBJECT_URI = "http://biomoby.org/RESOURCES/MOBY-S/Objects#"; + + public static MElement buildMElement(String name) { + String rdf = null; + try { + rdf = getObjectRdf(); + } catch (MobyException e) { + e.printStackTrace(); + } + // return null if i cant build the element + if (rdf == null) + return null; + + // create the model + Model model = ModelFactory.createDefaultModel(); // the RESOURCE model + RDFReader reader = model.getReader(); + reader.read(model, new StringReader(rdf), null); + + // check if a certain property exists to ensure that you a valid object + if (model.getResource(OBJECT_URI + name).getProperty(RDFS.comment) == null) { + return null; + } + // start querying model for what we need and create the MElement + String rootDescription = getDescription(model, name); + MElement root = new MElement(name, "", rootDescription); + String rootsParent = getParentDataType(model, name); + if (rootsParent == null) + rootsParent = ""; + if (MElement.isPrimitive(rootsParent)) { + root.setType(rootsParent); + } else { + root.setType(null); + } + // go through the isa relationships and extract the has/hasa + processRelationships(root, model, name); + + return root; + } + + /** + * @param root + * @param model + * @param name + */ + private static void processRelationships(MElement root, Model model, String name) { + if (name.indexOf("#") > 0) { + name = name.substring(name.indexOf("#")+1); + } + Resource resource = model.getResource(OBJECT_URI + name); + if (resource.hasProperty(RDFS.subClassOf)) { + String parent = resource.getProperty(RDFS.subClassOf) + .getObject().asNode().getURI(); + processRelationships(root, model, parent); + } + // process the has children + processChildrenTypes(root, model, Predicates.has, name); + // process the hasa children + processChildrenTypes(root, model, Predicates.hasa, name); + } + + /** + * @param root + * @param model + * @param has + * @param name + */ + private static void processChildrenTypes(MElement root, Model model, + Property property, String name) { + Resource resource = model.getResource(OBJECT_URI + name); + StmtIterator iterator = resource.listProperties(property); + if (iterator != null) + while (iterator.hasNext()) { + Statement next = (Statement) iterator.next(); + RDFNode object = next.getObject(); + if (object instanceof Resource) { + Resource child = (Resource) object; + String qualifiedName = null; + String childName = ""; + String childArticleName = ""; + String childDescription = ""; + if (child.hasProperty(RDF.type)) { + qualifiedName = child.getProperty(RDF.type).getObject() + .toString(); + childName = stripOutURI(child.getProperty(RDF.type) + .getObject().toString()); + } + if (child.hasProperty(Predicates.articleName)) { + childArticleName = stripOutLiteral(child.getProperty( + Predicates.articleName).getObject().toString()); + } + childDescription = stripOutLiteral(model.getResource( + qualifiedName).getProperty(RDFS.comment) + .getObject().toString()); + + MElement element = new MElement(childName, + childArticleName, childDescription); + String rootsParent = getParentDataType(model, childName); + if (MElement.isPrimitive(rootsParent)) { + element.setType(rootsParent); + } else { + element.setType(null); + } + processChildrenTypes(element, model, Predicates.has, + childName); + processChildrenTypes(element, model, Predicates.hasa, + childName); + if (property.getLocalName().equalsIgnoreCase("hasa")) { + root.addHasaMElement(element); + } else { + root.addHasMElement(element); + } + } + } + } + + /** + * @param model + * @param name + * @return + */ + private static String getParentDataType(Model model, String name) { + + // the statement should return null iff the object is the Moby root + // object + if (name.equals("Object")) + return null; + LinkedList list = new LinkedList(); + list.addFirst(name); + name = OBJECT_URI + name; + String parent = ""; + String previousParent = ""; + Resource resource = model.getResource(name); + Statement statement = resource.getProperty(RDFS.subClassOf); + do { + parent = statement.getObject().toString(); + if (!((String) list.getFirst()).equals(parent)) { + list.addFirst(parent); + } + resource = model.getResource(parent); + statement = resource.getProperty(RDFS.subClassOf); + + } while (statement != null); + // check to see if we have a primitive + parent = (String) list.removeFirst(); + if (list.size() > 0) { + previousParent = (String) list.removeFirst(); + previousParent = stripOutURI(previousParent); + if (MElement.isPrimitive(previousParent)) { + return previousParent; + } + } + // no primitive parent, so every object inherits from object + parent = stripOutURI(parent); + return parent; + } + + /** + * @param model + * @param name + * @return + */ + private static String getDescription(Model model, String name) { + Resource resource = model.getResource(OBJECT_URI + name); + Statement comment = resource.getProperty(RDFS.comment); + String description = comment.getObject().toString(); + description = stripOutLiteral(description); + return description; + } + + private static String getObjectRdf() throws MobyException { + String s = null; + StringBuffer sb = new StringBuffer(); + URL url = null; + try { + url = new URL(OBJECT_URI); + } catch (MalformedURLException e1) { + e1.printStackTrace(); + return null; + } + try { + BufferedReader in = null; + in = new BufferedReader(new InputStreamReader(url.openStream())); + while ((s = in.readLine()) != null) { + sb.append(s); + } + + } catch (IOException e) { + e.printStackTrace(); + return null; + } + return sb.toString(); + } + + private static String stripOutURI(String object) { + if (object.indexOf("#") > 0) + object = object.substring(object.indexOf("#") + 1); + return object; + } + + private static String stripOutLiteral(String object) { + if (object.indexOf("~") > 0) + object = object.substring(0, object.indexOf("~")); + return object; + } + + public static void main(String[] args) { + System.out.println("Is it me?"); + System.out.println("\nOutput Imag Object\n"); + System.out.println(RdfParser.buildMElement("DNASequence")); +/* System.out.println("###########################################"); + System.out.println("Outputting a String object"); + System.out.println(RdfParser.buildMElement("String")); + + System.out.println("###########################################"); + System.out.println("Outputting the base object"); + System.out.println(RdfParser.buildMElement("Object")); + + System.out.println("###########################################"); + System.out.println("Outputting a DNA sequence object"); + System.out.println(RdfParser.buildMElement("DNASequence")); + + System.out.println("###########################################"); + System.out.println("Outputting a GFF object"); + System.out.println(RdfParser.buildMElement("GFF")); + + System.out.println("###########################################"); + System.out.println("Outputting a BasicGFFSequenceFeature object"); + System.out.println(RdfParser.buildMElement("BasicGFFSequenceFeature")); +*/ + } +} From kawas at pub.open-bio.org Tue Sep 6 21:29:50 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 6 Sep 2005 17:29:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062129.j86LTopo004632@pub.open-bio.org> kawas Tue Sep 6 17:29:50 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema In directory pub.open-bio.org:/tmp/cvs-serv4603/org/biomoby/shared/schema Modified Files: Frame.java MainGUI.java Log Message: Removed some unused import statements moby-live/Java/src/main/org/biomoby/shared/schema Frame.java,1.1,1.2 MainGUI.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Frame.java 2005/09/06 21:29:50 1.2 @@ -5,13 +5,21 @@ * Window - Preferences - Java - Code Style - Code Templates */ package org.biomoby.shared.schema; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.FileWriter; + +import javax.swing.BoxLayout; +import javax.swing.JButton; import javax.swing.JFrame; -import javax.swing.*; -import java.awt.event.*; -import java.awt.*; -import org.jdom.*; -import org.jdom.output.*; -import java.io.*; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextField; + +import org.jdom.Document; +import org.jdom.Element; +import org.jdom.output.Format; +import org.jdom.output.XMLOutputter; /** * @author lixin =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MainGUI.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MainGUI.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/MainGUI.java 2005/09/06 21:29:50 1.2 @@ -12,8 +12,6 @@ * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ -import java.awt.event.*; -import java.io.*; public class MainGUI { public static void main(String[] args) throws Exception From gss at pub.open-bio.org Wed Sep 7 16:01:16 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 7 Sep 2005 12:01:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509071601.j87G1GfY007839@pub.open-bio.org> gss Wed Sep 7 12:01:16 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/doc/User In directory pub.open-bio.org:/tmp/cvs-serv7812/S-MOBY/doc/User Modified Files: devguide.doc Log Message: Changed "Service Provider" to Service; spell check. moby-live/S-MOBY/doc/User devguide.doc,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/doc/User/devguide.doc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/S-MOBY/doc/User/devguide.doc 2005/06/27 20:40:27 1.1 and /home/repository/moby/moby-live/S-MOBY/doc/User/devguide.doc 2005/09/07 16:01:16 1.2 differ rcsdiff: /home/repository/moby/moby-live/S-MOBY/doc/User/devguide.doc: diff failed From kawas at pub.open-bio.org Tue Sep 6 21:31:11 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 6 Sep 2005 17:31:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509062131.j86LVBnl004678@pub.open-bio.org> kawas Tue Sep 6 17:31:11 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema In directory pub.open-bio.org:/tmp/cvs-serv4653/org/biomoby/shared/schema Modified Files: Builder.java Log Message: Added a method that generates a schema for the complete moby message Modified the main method so that 2 different type of schemas could potentially be retrieved. moby-live/Java/src/main/org/biomoby/shared/schema Builder.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Builder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Builder.java 2005/08/30 18:34:11 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/schema/Builder.java 2005/09/06 21:31:11 1.2 @@ -1,1033 +1,1124 @@ -/** - *This class is used to generate a XML schema for a moby objet; To builder a XML schema element, call the method of - *buildSchem of the class; when a name of object is given, we find a MElement for this name; By analysis of the has Vector - *and hasa Vector of the MElement, we get the XML Schema for the object which has the inputed name. - *@author Lixin - *@author Eddie - *@version 1.0 - */ -package org.biomoby.shared.schema; - -import org.jdom.*; -import org.jdom.output.*; -import java.util.*; -import java.io.*; - - - -public class Builder { - - private int typeCount=0; //Everytime we create a type (complexType or simpleType), the variable will increase one. - - private Element root; //The root element of the XML Schema - - private Element firstComplexType; - - public static Namespace namespace; //This namespace is "http://www.3w.org/2001/XMLSchem". - - /** - *Given a string, we will give a element represnting an xml schema which describe the object of the name. - *@param name the name of object - *@return XML Element which represents an XML Schema - */ - public Element buildSchema(String name) - { -/* MElement mElement=new MElement("DNASequence"); - MElement m1=new MElement("string","SequenceString"); - MElement m2=new MElement("Integer","Length"); - mElement.addHasaMElement(m1); - mElement.addHasaMElement(m2);*/ - MElement mElement=new MElement(); - try{ - mElement=RdfParser.buildMElement(name); //find the MElement object representing the moby object - - } - catch(Exception e) - { - e.printStackTrace(); - } - - - - String nameOf=mElement.getName(); - root=getRoot(nameOf); //create a root element for the XML Schema of the moby object - - getElement(mElement); //add the rest part of XML schema to the root element - - return root; - - } - - /** - *the input is a MElement object; we will find all its hasa and has relations with other object; then modify the root - * element of the output xml file; the root element is the root element of a xml schema xml file. - *@param m a MElement - */ - public void getElement(MElement m) - { - Vector hasa=m.getHasaMElements(); - - Vector has=m.getHasMElements(); - - //if this MElement does not have hasa or has relation with other object, only need to return - //the first level. - if((hasa.size()==0)&&(has.size()==0)) - { - getFirstLevel(m, root); - Vector vcc=new Vector(); //create an empty vector as a parameter of function set3Attributes - set3Attributes(m, firstComplexType,vcc); - - - return; - } - else //this MElement have either has or hasa relation with ohter MElment - { - - - getFirstLevel(m,root); - Element sequence=new Element("sequence",namespace); //need a sequence element in XML schema for has - //and hasa object - firstComplexType.addContent(sequence); - - - - //find the primitive element and add them to schema - Vector tempt1; - Vector tempt2; - tempt1=(Vector)has.clone();//do not change tempt1 and tempt2, so clone two vector for them. - tempt2=(Vector)hasa.clone(); - - PrimitiveVector pri=new PrimitiveVector(tempt1, tempt2); - - - - addPrimitiveElement(pri, sequence);//add these primitive elements to the squences - - /*for object other than primitive type*/ - if(has.size()>0) - { - - - for (int i=0; i0)//the following dealing with the object in the hasa vector - { - /*create a MElementHastable for the hasa Vector. The key of the hashtabel is MElement, - and the value of hashtable of a vector containing article names*/ - MElementHashtable hss=new MElementHashtable(hasa); - - Hashtable hs=hss.getHashtable();//get a hashtable - int count=0; - - Enumeration e=hs.keys();//get all keys of the hashtable - - while(e.hasMoreElements())//go through the Enumeration - { - MElement ml=(MElement)e.nextElement(); - - Vector vc=(Vector)hs.get(ml);//get value, a vector of article names, of the hashtable - String namem=ml.getName(); - - - if(!(MElement.isPrimitive(namem))) - { - Element a=new Element("element", namespace);//add the element to the sequence - Attribute at=new Attribute("name",namem); - - String typeNamem=namem+"Typep"+typeCount; - typeCount++; - Attribute at2=new Attribute("type","moby:"+ typeNamem); - - Vector hasaNamesV=getHasaNameVector(ml); - addUniqueElement(a,"unique_1",hasaNamesV);//add an unique element - - - String st=ml.getDescription(); - addDescriptNote(st,sequence); - sequence.addContent(a); - a.setAttribute(at); - a.setAttribute(at2); - - String size=""+vc.size(); - - Attribute o1=new Attribute("minOccurs",size);//add occurence of element - Attribute o2=new Attribute("maxOccurs",size); - a.setAttribute(o1); - a.setAttribute(o2); - - //recursively to find the complex type - Element myCom=getComplexTypeRec(ml,typeNamem,vc); - root.addContent(myCom); - } - } - - - } - Vector vcc2=new Vector();//the empty vector is only used to as a parameter of set3Attributes() - set3Attributes( m,firstComplexType,vcc2); - - - } - - } - - /** - *Given a vector containing possible article names and type name, add an XML Schema element to describe - *the restriction. - *@param roots the root element of the XML Schema - *@param types the name of XML Schema simpleType - *@param articles a vector containing different article names - */ - public void addArticleNameType(Element roots, String types, Vector articles) - { - //create a simpleType XML Schema element - Element simpleType=new Element("simpleType", namespace); - Attribute at=new Attribute("name",types); - simpleType.setAttribute(at); - - //create a XML schema restriction element - Element restriction=new Element("restriction", namespace); - Attribute base=new Attribute("base","xs:string"); - restriction.setAttribute(base); - - simpleType.addContent(restriction); - - //put all article names into the enumeration of the restriction element - for(int i=0;i0) ||(has.size()>0))//if true, we can not use simpleContent XML Schema element - { - flag=0; - } - String articleName=m.getArticleName(); - - Element e1=getNamespaceAttribute(); - Element e2=getIDAttribute(); - Element e3; - - if(ar.size()==0) - { - e3=getArticleName(articleName); - } - else - { - /*if this object can has many article names, we put restriction on the article names*/ - e3=getRestrictionArticleName(ar); - } - - //check whether the type of this element is null or not - String typeName=m.getType(); - - /*check if the name of the element is primitive*/ - String priName=m.getName(); - if(MElement.isPrimitive(priName)) - { - typeName=priName; - } - - if(typeName==null||typeName.length()==0||flag==0) - { - - types.addContent(e1); - types.addContent(e2); - types.addContent(e3); - } - - /*if the type is not empty, and use extensionin schema to describe this relation*/ - else - { - typeName=typeName.toLowerCase(); - - /*create a simpleContent XML Schema element*/ - Element simpleContent=new Element("simpleContent",namespace); - - Element extension=new Element("extension", namespace); - - Attribute base=new Attribute("base","xs:"+typeName); - extension.setAttribute(base); - - extension.addContent(e1); - extension.addContent(e2); - extension.addContent(e3); - - simpleContent.addContent(extension); - - types.addContent(simpleContent); - } - - } - - /** - *create the top level of xml schema element for a moby object. - *@param m a MElement - *@param rt a xML Schema root element - */ - public void getFirstLevel(MElement m, Element rt) - { - String name=m.getName(); - String type=name+"Type"; - - Element tem1=new Element("element",namespace); - Attribute attr1=new Attribute("name",name); - Attribute attr2=new Attribute("type", "moby:"+type); - tem1.setAttribute(attr1); - tem1.setAttribute(attr2); - - /*add unique element for moby objects in the hasa relationship*/ - Vector hasaNames=getHasaNameVector(m); - //add an unique element to the first level - addUniqueElement(tem1,"first", hasaNames); - rt.addContent(tem1); - - String str=m.getDescription(); - addDescriptNote(str,rt); - - /*add the complexType element of XML Schema to the root element*/ - firstComplexType=getComplexType(m, type); - - - rt.addContent(firstComplexType); - } - - /** - *recursively get a complexType XML Shema element for MElement; when this MElement does - *not have has and hasa relation, we use another method called getComplexType; - *@param m a MElement object - *@param typeName the name of complexType - *@param vc1 a vector containing all possible article names for the MElement - *@return the complexType element for this MElement object - */ - public Element getComplexTypeRec(MElement m, String typeName, Vector vc1) - { - - root.addContent(new Comment("This is definition of complexType "+typeName)); - - /*get has and hasa vector for this MElement object*/ - Vector hasa1=m.getHasaMElements(); - - Vector has1=m.getHasMElements(); - - /*create a complexType element*/ - Element complexType=new Element("complexType",namespace); - Attribute at1=new Attribute("name",typeName); - complexType.setAttribute(at1); - - /*if this MElement does not have has or hasa relationship with other object, we have done*/ - if((hasa1.size()==0)&&(has1.size()==0)) - { - - set3Attributes(m,complexType,vc1); - - return complexType; - } - /*if this MElement has has or hasa relationshipe with other object, need puts all object into sequence XML - schema element*/ - else - { - Element sequence1=new Element("sequence",namespace); - complexType.addContent(sequence1); - - //find the primitive elements and add these to schema - PrimitiveVector pri=new PrimitiveVector(hasa1,has1); - addPrimitiveElement(pri, sequence1); - - /*deal with objects in the hasa vector*/ - if(hasa1.size()>0) - { - - MElementHashtable hss=new MElementHashtable(hasa1); - Hashtable hs=hss.getHashtable(); - int count=0; - - Enumeration e=hs.keys(); - - while(e.hasMoreElements()) - { - MElement ml=(MElement)e.nextElement(); - Vector vc=(Vector)hs.get(ml); - String namem=ml.getName(); - - /*we has handled the primitive element before*/ - if(!(MElement.isPrimitive(namem))) - { - Element a=new Element("element",namespace); - Attribute at=new Attribute("name",namem); - - String typeNamem=namem+"Typehasa"+typeCount; - typeCount++; - Attribute at2=new Attribute("type","moby:"+typeNamem); - - Vector hasaNameV=getHasaNameVector(ml); - addUniqueElement(a,"unique_1", hasaNameV); - - a.setAttribute(at); - a.setAttribute(at2); - - String size=""+vc.size(); - Attribute o1=new Attribute("minOccurs",size); - Attribute o2=new Attribute("maxOccurs",size); - a.setAttribute(o1); - a.setAttribute(o2); - sequence1.addContent(a); - - Element myCom=getComplexTypeRec(ml,typeNamem,vc); - root.addContent(myCom); - } - } - - - } - if(has1.size()>0) - { - - - for(int i=0;i + + // this is the line that is modified when handing out the full scale moby schema + + + + */ + + + return moby; + } + + /** + *the input is a MElement object; we will find all its hasa and has relations with other object; then modify the root + * element of the output xml file; the root element is the root element of a xml schema xml file. + *@param m a MElement + */ + public void getElement(MElement m) + { + Vector hasa=m.getHasaMElements(); + + Vector has=m.getHasMElements(); + + //if this MElement does not have hasa or has relation with other object, only need to return + //the first level. + if((hasa.size()==0)&&(has.size()==0)) + { + getFirstLevel(m, root); + Vector vcc=new Vector(); //create an empty vector as a parameter of function set3Attributes + set3Attributes(m, firstComplexType,vcc); + + + return; + } + else //this MElement have has and/or hasa relation with ohter MElment + { + + + getFirstLevel(m,root); + Element sequence=new Element("sequence",namespace); //need a sequence element in XML schema for has + //and hasa object + firstComplexType.addContent(sequence); + + + + //find the primitive element and add them to schema + Vector tempt1; + Vector tempt2; + tempt1=(Vector)has.clone();//do not change tempt1 and tempt2, so clone two vector for them. + tempt2=(Vector)hasa.clone(); + + PrimitiveVector pri=new PrimitiveVector(tempt1, tempt2); + + + + addPrimitiveElement(pri, sequence);//add these primitive elements to the squences + + /*for object other than primitive type*/ + if(has.size()>0) + { + + + for (int i=0; i0)//the following dealing with the object in the hasa vector + { + /*create a MElementHastable for the hasa Vector. The key of the hashtabel is MElement, + and the value of hashtable of a vector containing article names*/ + MElementHashtable hss=new MElementHashtable(hasa); + + Hashtable hs=hss.getHashtable();//get a hashtable + int count=0; + + Enumeration e=hs.keys();//get all keys of the hashtable + + while(e.hasMoreElements())//go through the Enumeration + { + MElement ml=(MElement)e.nextElement(); + + Vector vc=(Vector)hs.get(ml);//get value, a vector of article names, of the hashtable + String namem=ml.getName(); + + + if(!(MElement.isPrimitive(namem))) + { + Element a=new Element("element", namespace);//add the element to the sequence + Attribute at=new Attribute("name",namem); + + String typeNamem=namem+"Typep"+typeCount; + typeCount++; + Attribute at2=new Attribute("type","moby:"+ typeNamem); + + Vector hasaNamesV=getHasaNameVector(ml); + addUniqueElement(a,"unique_1",hasaNamesV);//add an unique element + + + String st=ml.getDescription(); + addDescriptNote(st,sequence); + sequence.addContent(a); + a.setAttribute(at); + a.setAttribute(at2); + + String size=""+vc.size(); + + Attribute o1=new Attribute("minOccurs",size);//add occurence of element + Attribute o2=new Attribute("maxOccurs",size); + a.setAttribute(o1); + a.setAttribute(o2); + + //recursively to find the complex type + Element myCom=getComplexTypeRec(ml,typeNamem,vc); + root.addContent(myCom); + } + } + + + } + Vector vcc2=new Vector();//the empty vector is only used to as a parameter of set3Attributes() + set3Attributes( m,firstComplexType,vcc2); + + + } + + } + + /** + *Given a vector containing possible article names and type name, add an XML Schema element to describe + *the restriction. + *@param roots the root element of the XML Schema + *@param types the name of XML Schema simpleType + *@param articles a vector containing different article names + */ + public void addArticleNameType(Element roots, String types, Vector articles) + { + //create a simpleType XML Schema element + Element simpleType=new Element("simpleType", namespace); + Attribute at=new Attribute("name",types); + simpleType.setAttribute(at); + + //create a XML schema restriction element + Element restriction=new Element("restriction", namespace); + Attribute base=new Attribute("base","xs:string"); + restriction.setAttribute(base); + + simpleType.addContent(restriction); + + //put all article names into the enumeration of the restriction element + for(int i=0;i0) ||(has.size()>0))//if true, we can not use simpleContent XML Schema element + { + flag=0; + } + String articleName=m.getArticleName(); + + Element e1=getNamespaceAttribute(); + Element e2=getIDAttribute(); + Element e3; + + if(ar.size()==0) + { + e3=getArticleName(articleName); + } + else + { + /*if this object can has many article names, we put restriction on the article names*/ + e3=getRestrictionArticleName(ar); + } + + //check whether the type of this element is null or not + String typeName=m.getType(); + + /*check if the name of the element is primitive*/ + String priName=m.getName(); + if(MElement.isPrimitive(priName)) + { + typeName=priName; + } + + if(typeName==null||typeName.length()==0||flag==0) + { + + types.addContent(e1); + types.addContent(e2); + types.addContent(e3); + } + + /*if the type is not empty, and use extensionin schema to describe this relation*/ + else + { + typeName=typeName.toLowerCase(); + + /*create a simpleContent XML Schema element*/ + Element simpleContent=new Element("simpleContent",namespace); + + Element extension=new Element("extension", namespace); + + Attribute base=new Attribute("base","xs:"+typeName); + extension.setAttribute(base); + + extension.addContent(e1); + extension.addContent(e2); + extension.addContent(e3); + + simpleContent.addContent(extension); + + types.addContent(simpleContent); + } + + } + + /** + *create the top level of xml schema element for a moby object. + *@param m a MElement + *@param rt a xML Schema root element + */ + public void getFirstLevel(MElement m, Element rt) + { + String name=m.getName(); + String type=name+"Type"; + + Element tem1=new Element("element",namespace); + Attribute attr1=new Attribute("name",name); + Attribute attr2=new Attribute("type", "moby:"+type); + tem1.setAttribute(attr1); + tem1.setAttribute(attr2); + + /*add unique element for moby objects in the hasa relationship*/ + Vector hasaNames=getHasaNameVector(m); + //add an unique element to the first level + addUniqueElement(tem1,"first", hasaNames); + rt.addContent(tem1); + + String str=m.getDescription(); + addDescriptNote(str,rt); + + /*add the complexType element of XML Schema to the root element*/ + firstComplexType=getComplexType(m, type); + + + rt.addContent(firstComplexType); + } + + /** + *recursively get a complexType XML Shema element for MElement; when this MElement does + *not have has and hasa relation, we use another method called getComplexType; + *@param m a MElement object + *@param typeName the name of complexType + *@param vc1 a vector containing all possible article names for the MElement + *@return the complexType element for this MElement object + */ + public Element getComplexTypeRec(MElement m, String typeName, Vector vc1) + { + + root.addContent(new Comment("This is definition of complexType "+typeName)); + + /*get has and hasa vector for this MElement object*/ + Vector hasa1=m.getHasaMElements(); + + Vector has1=m.getHasMElements(); + + /*create a complexType element*/ + Element complexType=new Element("complexType",namespace); + Attribute at1=new Attribute("name",typeName); + complexType.setAttribute(at1); + + /*if this MElement does not have has or hasa relationship with other object, we have done*/ + if((hasa1.size()==0)&&(has1.size()==0)) + { + + set3Attributes(m,complexType,vc1); + + return complexType; + } + /*if this MElement has has or hasa relationshipe with other object, need puts all object into sequence XML + schema element*/ + else + { + Element sequence1=new Element("sequence",namespace); + complexType.addContent(sequence1); + + //find the primitive elements and add these to schema + PrimitiveVector pri=new PrimitiveVector(hasa1,has1); + addPrimitiveElement(pri, sequence1); + + /*deal with objects in the hasa vector*/ + if(hasa1.size()>0) + { + + MElementHashtable hss=new MElementHashtable(hasa1); + Hashtable hs=hss.getHashtable(); + int count=0; + + Enumeration e=hs.keys(); + + while(e.hasMoreElements()) + { + MElement ml=(MElement)e.nextElement(); + Vector vc=(Vector)hs.get(ml); + String namem=ml.getName(); + + /*we has handled the primitive element before*/ + if(!(MElement.isPrimitive(namem))) + { + Element a=new Element("element",namespace); + Attribute at=new Attribute("name",namem); + + String typeNamem=namem+"Typehasa"+typeCount; + typeCount++; + Attribute at2=new Attribute("type","moby:"+typeNamem); + + Vector hasaNameV=getHasaNameVector(ml); + addUniqueElement(a,"unique_1", hasaNameV); + + a.setAttribute(at); + a.setAttribute(at2); + + String size=""+vc.size(); + Attribute o1=new Attribute("minOccurs",size); + Attribute o2=new Attribute("maxOccurs",size); + a.setAttribute(o1); + a.setAttribute(o2); + sequence1.addContent(a); + + Element myCom=getComplexTypeRec(ml,typeNamem,vc); + root.addContent(myCom); + } + } + + + } + if(has1.size()>0) + { + + + for(int i=0;i moby_data_type"); + System.out.println("where possible options include:"); + System.out.println(" -m generate a schema that describes the complete moby message"); + System.out.println(); + System.exit(1); + } +} + + + + From carrere at pub.open-bio.org Thu Sep 8 13:44:48 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Thu, 8 Sep 2005 09:44:48 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509081344.j88Dimem016358@pub.open-bio.org> carrere Thu Sep 8 09:44:48 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/xsl In directory pub.open-bio.org:/tmp/cvs-serv16334/xsl Log Message: Directory /home/repository/moby/moby-live/Perl/MOBY/xsl added to the repository moby-live/Perl/MOBY/xsl - New directory rcsdiff: /home/repository/moby/moby-live/Perl/MOBY/xsl/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/MOBY/xsl/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/MOBY/xsl/RCS/directory,v: No such file or directory From carrere at pub.open-bio.org Thu Sep 8 13:46:45 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Thu, 8 Sep 2005 09:46:45 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509081346.j88DkjGa016400@pub.open-bio.org> carrere Thu Sep 8 09:46:45 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/xsl In directory pub.open-bio.org:/tmp/cvs-serv16379 Added Files: parseMobyMessage.xsl Log Message: This XSL style-sheet is used by MOBYXSLT.pm module to parse MOBY messages with xsltproc binary. moby-live/Perl/MOBY/xsl parseMobyMessage.xsl,NONE,1.1 From carrere at pub.open-bio.org Thu Sep 8 13:51:06 2005 From: carrere at pub.open-bio.org (Sebastien Carrere) Date: Thu, 8 Sep 2005 09:51:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509081351.j88Dp6Kj016446@pub.open-bio.org> carrere Thu Sep 8 09:51:06 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv16419 Added Files: MOBYXSLT.pm Log Message: This module contains many of CommonSubs methods but doesn't use XML::DOM to parse MOBY message. It uses a first pass xsl transformation (with xsltproc and ./xsl/parseMobyMessage.xsl as a style-sheet) and then build Perl structure upon this parsing. This module has been tested on a 10Mb MOBY message and it's OK. 3 Globals Variable have to be edited before use. moby-live/Perl/MOBY MOBYXSLT.pm,NONE,1.1 From gss at pub.open-bio.org Thu Sep 8 19:46:47 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 8 Sep 2005 15:46:47 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509081946.j88JklED017703@pub.open-bio.org> gss Thu Sep 8 15:46:47 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org In directory pub.open-bio.org:/tmp/cvs-serv17681 Removed Files: .classpath Log Message: Not needed moby-live/S-MOBY/ref-impl/semanticmoby.org .classpath,1.4,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/RCS/.classpath,v: No such file or directory From gss at pub.open-bio.org Thu Sep 8 19:47:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 8 Sep 2005 15:47:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509081947.j88Jl2FH017738@pub.open-bio.org> gss Thu Sep 8 15:47:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev In directory pub.open-bio.org:/tmp/cvs-serv17716/src/org/semanticmoby/ref/servlets/dev Removed Files: OWLValidationServlet.java Log Message: No longer needed moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev OWLValidationServlet.java,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/RCS/OWLValidationServlet.java,v: No such file or directory From senger at pub.open-bio.org Mon Sep 12 02:45:47 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 11 Sep 2005 22:45:47 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509120245.j8C2jlsI006937@pub.open-bio.org> senger Sun Sep 11 22:45:46 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv6918 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.29,1.30 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/04 13:45:36 1.29 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/12 02:45:46 1.30 @@ -1316,6 +1316,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + From kawas at pub.open-bio.org Mon Sep 12 18:21:13 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon, 12 Sep 2005 14:21:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509121821.j8CILDLQ009118@pub.open-bio.org> kawas Mon Sep 12 14:21:13 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test In directory pub.open-bio.org:/tmp/cvs-serv9097/org/biomoby/registry/rdfagent/test Added Files: RDFAgentTestSuite.java Log Message: adding a test driver for the agent. I have to still commit the actual test files that this driver utilizes. moby-live/Java/src/main/org/biomoby/registry/rdfagent/test RDFAgentTestSuite.java,NONE,1.1 From kawas at pub.open-bio.org Mon Sep 12 18:22:10 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon, 12 Sep 2005 14:22:10 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509121822.j8CIMAas009153@pub.open-bio.org> kawas Mon Sep 12 14:22:10 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util In directory pub.open-bio.org:/tmp/cvs-serv9124/org/biomoby/registry/rdfagent/util Modified Files: Report.java Constants.java Log Message: made various bug fixes and added a sendmail option for sending out the results to service providers. moby-live/Java/src/main/org/biomoby/registry/rdfagent/util Report.java,1.6,1.7 Constants.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java 2005/08/04 12:58:40 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java 2005/09/12 18:22:10 1.7 @@ -8,7 +8,7 @@ /** * @author Nina Opushneva - * + * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ @@ -22,132 +22,170 @@ import org.biomoby.registry.rdfagent.verifier.DataMngr; public class Report { - - static ArrayList mr = null; + + static ArrayList mr = null; + static ArrayList ds = null; - - public static void add(String line){ - - if(mr == null){ - mr = new ArrayList(); - } - mr.add(line); - - } - - public static void doBuild(String line){ - - if(ds == null){ - ds = new ArrayList(); - } - ds.add(line); - - } - - public static void send(String signURL){ - - String message = ""; - - if(mr != null){ - - StringBuffer mes1 = new StringBuffer(); - - for (int i=0; i < mr.size(); i++){ - mes1.append(mr.get(i).toString()+"\n"); - } - message += mes1; - } - if(ds != null){ - - StringBuffer mes2 = new StringBuffer(); - - for (int i=0; i < ds.size(); i++){ - mes2.append(ds.get(i).toString()+"\n"); - } - message += mes2; - } - - if (Constants.MB_MAIL_SERVER != null || !Constants.MB_MAIL_SERVER.equals("") ){ - - String to = ""; - to = DataMngr.getContactEmail(signURL); - - if (to.equals("")){ - to = "edward.kawas at gmail.com"; - - } - String subject = "The RDFagent Report"; - Log.info("email message is\n" + message); - Communicator.sendMail(to,subject,message.toString(),Constants.MB_FROM); // send message to the service provider - that service was deregistered - ds = null; - mr = null; - } - } - - public static void createFile(String fileName){ - try { - File file = new File(fileName); - - // Create file if it does not exist - boolean success = file.createNewFile(); - if (success) { - // File did not exist and was created - } else { - // File already exists - file.delete(); - file.createNewFile(); - } - } catch (IOException e) { - Log.warning(e.getMessage()); - } - } - - public static void doWrite(String line) { - - try { - String path = Constants.RDFagentHome; - BufferedWriter out = new BufferedWriter(new FileWriter(path+Constants.SV_REPORT_PATH, true)); - out.write(line); - out.newLine(); - out.close(); - } catch (IOException e) { - Log.warning(e.getMessage()); - } - - } - -/* public static void doBuild(String line) { - - try { - String path = Constants.RDFagentHome; - BufferedWriter out = new BufferedWriter(new FileWriter(path+Constants.SV_DELFILE_PATH, true)); - out.write(line); - out.newLine(); - out.close(); - } catch (IOException e) { - Log.warning(e.getMessage()); - } - - } -*/ - - public static void doSave(String file,String line) { - - try { - - BufferedWriter out = new BufferedWriter(new FileWriter(file, true)); - out.write(line); - out.newLine(); - out.close(); - } catch (IOException e) { - Log.warning(e.getMessage()); - } - - } - - - } + public static void add(String line) { + + if (mr == null) { + mr = new ArrayList(); + } + mr.add(line); + + } + + public static void doBuild(String line) { + + if (ds == null) { + ds = new ArrayList(); + } + ds.add(line); + + } + + public static void send(String signURL) { + + String message = ""; + + if (mr != null) { + + StringBuffer mes1 = new StringBuffer(); + + for (int i = 0; i < mr.size(); i++) { + mes1.append(mr.get(i).toString() + "\n"); + } + message += mes1; + } + if (ds != null) { + + StringBuffer mes2 = new StringBuffer(); + + for (int i = 0; i < ds.size(); i++) { + mes2.append(ds.get(i).toString() + "\n"); + } + message += mes2; + } + + if (Constants.MB_MAIL_SERVER != null + || !Constants.MB_MAIL_SERVER.equals("") + || Constants.MB_MAIL_PRGM != null + || !Constants.MB_MAIL_PRGM.equals("")) { + + String to = ""; + to = DataMngr.getContactEmail(signURL); + + if (to.equals("")) { + to = "edward.kawas at gmail.com"; + + } + String subject = "The RDFagent Report"; + Log.info("email message is\n" + message); + if (Constants.MB_MAIL_PRGM != null + || !Constants.MB_MAIL_PRGM.equals("")) + try { + + //String cmd ="echo \"" + message.toString() + "\" | "+ + // Constants.MB_MAIL_PRGM+ " -s 'The RDFagent Report :-(' '" + // + "markw at illuminae.com"+ "'"; + String cmd = "echo \"" + message.toString() + "\" | " + + Constants.MB_MAIL_PRGM + + " -s 'The RDFagent Report :-(' '" + to + "'"; + File file = new File("_script_.sh"); + FileWriter fw = new FileWriter(file); + fw.write(_shellScriptHeader + cmd); + fw.close(); + + Process p = Runtime.getRuntime().exec( + "chmod +x _script_.sh"); + p.waitFor(); + p = Runtime.getRuntime().exec("./_script_.sh"); + p.waitFor(); + Log.info("_script_.sh has " + + ((file.delete()) ? "" : "not ") + "been deleted" + + System.getProperty("line.separator") + + "The exit value of the spawned process was : " + + p.exitValue()); + } catch (IOException e) { + e.printStackTrace(); + Log.severe("Could not send message using cmd line mail to " + + to); + Report + .doWrite("Could not send message using cmd line mail to " + + to); + // use this only as a last resort + if (Constants.MB_MAIL_SERVER != null + || !Constants.MB_MAIL_SERVER.equals("")) + Communicator.sendMail(to, subject, message.toString(), + Constants.MB_FROM); + } catch (InterruptedException e) { + e.printStackTrace(); + } + //Communicator.sendMail(to,subject,message.toString(),Constants.MB_FROM); + ds = null; + mr = null; + } + } + + public static void createFile(String fileName) { + try { + File file = new File(fileName); + + // Create file if it does not exist + boolean success = file.createNewFile(); + if (success) { + // File did not exist and was created + } else { + // File already exists + file.delete(); + file.createNewFile(); + } + } catch (IOException e) { + Log.warning(e.getMessage()); + } + } + + public static void doWrite(String line) { + + try { + String path = Constants.RDFagentHome; + BufferedWriter out = new BufferedWriter(new FileWriter(path + + Constants.SV_REPORT_PATH, true)); + out.write(line); + out.newLine(); + out.close(); + } catch (IOException e) { + Log.warning(e.getMessage()); + } + + } + + /* + * public static void doBuild(String line) { + * + * try { String path = Constants.RDFagentHome; BufferedWriter out = new + * BufferedWriter(new FileWriter(path+Constants.SV_DELFILE_PATH, true)); + * out.write(line); out.newLine(); out.close(); } catch (IOException e) { + * Log.warning(e.getMessage()); } } + */ + + public static void doSave(String file, String line) { + + try { + + BufferedWriter out = new BufferedWriter(new FileWriter(file, true)); + out.write(line); + out.newLine(); + out.close(); + } catch (IOException e) { + Log.warning(e.getMessage()); + } + + } + private final static String _shellScriptHeader = "#!/bin/sh" + + System.getProperty("line.separator"); +} =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Constants.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Constants.java 2005/04/16 14:32:47 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Constants.java 2005/09/12 18:22:10 1.7 @@ -40,6 +40,7 @@ public static String MB_MAIL_USER = null; public static String MB_MAIL_PSWD = null; public static String MB_FROM = null; + public static String MB_MAIL_PRGM = null; public static String SP_SUBJECT = null; public static String SP_ERR_MSG_CON = null; @@ -78,6 +79,7 @@ MB_SUBJECT = moby.getChildTextTrim("subject"); MB_ERR_MSG = moby.getChildTextTrim("errMessage"); MB_MAIL_SERVER = moby.getChildTextTrim("mailServer"); + MB_MAIL_PRGM = moby.getChildTextTrim("cmdLnMailProgram"); MB_MAIL_USER = moby.getChildTextTrim("mailUser"); MB_MAIL_PSWD = moby.getChildTextTrim("mailPswd"); MB_FROM = moby.getChildTextTrim("from"); From kawas at pub.open-bio.org Mon Sep 12 18:21:08 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon, 12 Sep 2005 14:21:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509121821.j8CIL8aV009084@pub.open-bio.org> kawas Mon Sep 12 14:21:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test In directory pub.open-bio.org:/tmp/cvs-serv9060/org/biomoby/registry/rdfagent/test Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test added to the repository moby-live/Java/src/main/org/biomoby/registry/rdfagent/test - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test/RCS/directory,v: No such file or directory From kawas at pub.open-bio.org Mon Sep 12 18:22:11 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon, 12 Sep 2005 14:22:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509121822.j8CIMB84009172@pub.open-bio.org> kawas Mon Sep 12 14:22:10 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier In directory pub.open-bio.org:/tmp/cvs-serv9124/org/biomoby/registry/rdfagent/verifier Modified Files: Communicator.java Log Message: made various bug fixes and added a sendmail option for sending out the results to service providers. moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier Communicator.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/Communicator.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/Communicator.java 2005/08/04 12:58:41 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/Communicator.java 2005/09/12 18:22:10 1.8 @@ -174,7 +174,6 @@ + " > WILL BE DEREGISTERED FROM mobycentral REGISTRY"); Report .doWrite("======================================================================================="); - // TODO send the report here? } } else { From kawas at pub.open-bio.org Tue Sep 13 02:50:56 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon, 12 Sep 2005 22:50:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130250.j8D2ouWj010280@pub.open-bio.org> kawas Mon Sep 12 22:50:56 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/test In directory pub.open-bio.org:/tmp/cvs-serv10259/org/biomoby/registry/rdfagent/test Added Files: TestException.java Log Message: silly exception class that isnt really used, but caused compile problems. moby-live/Java/src/main/org/biomoby/registry/rdfagent/test TestException.java,NONE,1.1 From senger at pub.open-bio.org Tue Sep 13 06:42:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 13 Sep 2005 02:42:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130642.j8D6gQeI010723@pub.open-bio.org> senger Tue Sep 13 02:42:26 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv10704 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.2,1.3 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/04 13:15:54 1.2 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/13 06:42:26 1.3 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Tue Sep 13 06:46:35 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 13 Sep 2005 02:46:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130646.j8D6kZPV010887@pub.open-bio.org> senger Tue Sep 13 02:46:33 EDT 2005 Update of /home/repository/moby/moby-live/Java/lib/ant_home/lib In directory pub.open-bio.org:/tmp/cvs-serv10759 Modified Files: ant-antlr.jar ant-apache-bcel.jar ant-apache-bsf.jar ant-apache-log4j.jar ant-apache-oro.jar ant-apache-regexp.jar ant-apache-resolver.jar ant-commons-logging.jar ant-commons-net.jar ant-icontract.jar ant-jai.jar ant-javamail.jar ant-jdepend.jar ant-jmf.jar ant-jsch.jar ant-junit.jar ant-launcher.jar ant-netrexx.jar ant-nodeps.jar ant-starteam.jar ant-stylebook.jar ant-swing.jar ant-trax.jar ant-vaj.jar ant-weblogic.jar ant-xalan1.jar ant-xslp.jar ant.jar Log Message: ant version 1.6.5 moby-live/Java/lib/ant_home/lib ant-antlr.jar,1.1,1.2 ant-apache-bcel.jar,1.1,1.2 ant-apache-bsf.jar,1.1,1.2 ant-apache-log4j.jar,1.1,1.2 ant-apache-oro.jar,1.1,1.2 ant-apache-regexp.jar,1.1,1.2 ant-apache-resolver.jar,1.1,1.2 ant-commons-logging.jar,1.1,1.2 ant-commons-net.jar,1.1,1.2 ant-icontract.jar,1.1,1.2 ant-jai.jar,1.1,1.2 ant-javamail.jar,1.1,1.2 ant-jdepend.jar,1.1,1.2 ant-jmf.jar,1.1,1.2 ant-jsch.jar,1.1,1.2 ant-junit.jar,1.1,1.2 ant-launcher.jar,1.1,1.2 ant-netrexx.jar,1.1,1.2 ant-nodeps.jar,1.1,1.2 ant-starteam.jar,1.1,1.2 ant-stylebook.jar,1.1,1.2 ant-swing.jar,1.1,1.2 ant-trax.jar,1.1,1.2 ant-vaj.jar,1.1,1.2 ant-weblogic.jar,1.1,1.2 ant-xalan1.jar,1.1,1.2 ant-xslp.jar,1.1,1.2 ant.jar,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-antlr.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-antlr.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-antlr.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-antlr.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bcel.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bcel.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bcel.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bcel.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bsf.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bsf.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bsf.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-bsf.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-log4j.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-log4j.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-log4j.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-log4j.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-oro.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-oro.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-oro.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-oro.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-regexp.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-regexp.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-regexp.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-regexp.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-resolver.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-resolver.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-resolver.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-apache-resolver.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-logging.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-logging.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-logging.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-logging.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-net.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-net.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-net.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-commons-net.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-icontract.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-icontract.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-icontract.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-icontract.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jai.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jai.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jai.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jai.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-javamail.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-javamail.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-javamail.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-javamail.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jdepend.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jdepend.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jdepend.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jdepend.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jmf.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jmf.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jmf.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jmf.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jsch.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jsch.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jsch.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-jsch.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-junit.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-junit.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-junit.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-junit.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-launcher.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-launcher.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-launcher.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-launcher.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-netrexx.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-netrexx.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-netrexx.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-netrexx.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-nodeps.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-nodeps.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-nodeps.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-nodeps.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-starteam.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-starteam.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-starteam.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-starteam.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-stylebook.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-stylebook.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-stylebook.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-stylebook.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-swing.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-swing.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-swing.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-swing.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-trax.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-trax.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-trax.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-trax.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-vaj.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-vaj.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-vaj.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-vaj.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-weblogic.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-weblogic.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-weblogic.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-weblogic.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xalan1.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xalan1.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xalan1.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xalan1.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xslp.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xslp.jar 2005/05/19 15:57:21 1.1 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xslp.jar 2005/09/13 06:46:33 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant-xslp.jar: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant.jar,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 Binary files /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant.jar 2005/05/19 15:57:21 1.3 and /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant.jar 2005/09/13 06:46:33 1.4 differ rcsdiff: /home/repository/moby/moby-live/Java/lib/ant_home/lib/ant.jar: diff failed From senger at pub.open-bio.org Tue Sep 13 06:53:28 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 13 Sep 2005 02:53:28 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130653.j8D6rSLI010936@pub.open-bio.org> senger Tue Sep 13 02:53:28 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv10917 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.30,1.31 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/12 02:45:46 1.30 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/13 06:53:28 1.31 @@ -817,7 +817,7 @@ - + @@ -1347,5 +1347,28 @@ + + + + + + + + + + + + + + + From senger at pub.open-bio.org Tue Sep 13 06:53:28 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 13 Sep 2005 02:53:28 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130653.j8D6rSee010963@pub.open-bio.org> senger Tue Sep 13 02:53:28 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv10917/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java DashboardPanel.java RegistryPanel.java Added Files: NOTES Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard NOTES,NONE,1.1 AbstractPanel.java,1.2,1.3 DashboardPanel.java,1.1,1.2 RegistryPanel.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/04 13:45:38 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/13 06:53:28 1.3 @@ -8,12 +8,17 @@ package org.biomoby.service.dashboard; +import org.tulsoft.tools.gui.SwingUtils; + import javax.swing.JLabel; import javax.swing.JPanel; -import javax.swing.text.html.HTMLDocument; import javax.swing.Icon; import javax.swing.JComponent; +import javax.swing.AbstractButton; +import javax.swing.text.html.HTMLDocument; +import java.awt.GridBagConstraints; +import java.awt.Insets; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeSupport; @@ -29,6 +34,40 @@ extends JPanel implements DashboardPanel { + + // copy here some often used constants + protected static final int RELATIVE = GridBagConstraints.RELATIVE; + protected static final int REMAINDER = GridBagConstraints.REMAINDER; + protected static final int NONE = GridBagConstraints.NONE; + protected static final int BOTH = GridBagConstraints.BOTH; + protected static final int HORIZONTAL = GridBagConstraints.HORIZONTAL; + protected static final int VERTICAL = GridBagConstraints.VERTICAL; + protected static final int CENTER = GridBagConstraints.CENTER; + protected static final int NORTH = GridBagConstraints.NORTH; + protected static final int NORTHEAST = GridBagConstraints.NORTHEAST; + protected static final int EAST = GridBagConstraints.EAST; + protected static final int SOUTHEAST = GridBagConstraints.SOUTHEAST; + protected static final int SOUTH = GridBagConstraints.SOUTH; + protected static final int SOUTHWEST = GridBagConstraints.SOUTHWEST; + protected static final int WEST = GridBagConstraints.WEST; + protected static final int NORTHWEST = GridBagConstraints.NORTHWEST; + protected static final int PAGE_START = GridBagConstraints.PAGE_START; + protected static final int PAGE_END = GridBagConstraints.PAGE_END; + protected static final int LINE_START = GridBagConstraints.LINE_START; + protected static final int LINE_END = GridBagConstraints.LINE_END; + protected static final int FIRST_LINE_START = GridBagConstraints.FIRST_LINE_START; + protected static final int FIRST_LINE_END = GridBagConstraints.FIRST_LINE_END; + protected static final int LAST_LINE_START = GridBagConstraints.LAST_LINE_START; + protected static final int LAST_LINE_END = GridBagConstraints.LAST_LINE_END; + + + /********************************************************************* + * Default constructor (just for the sub-classes). + ********************************************************************/ + protected AbstractPanel() { + support = new PropertyChangeSupport (this); + } + /************************************************************************** * **************************************************************************/ @@ -59,7 +98,7 @@ } /************************************************************************** - * Here we get notified when a property chnage happen. + * Here we get notified when a property change happen. **************************************************************************/ public void propertyChange (PropertyChangeEvent event) { } @@ -83,4 +122,25 @@ **************************************************************************/ abstract public JLabel getTitle(); + // + // Methods to be used by sub-classes + // + + /********************************************************************* + * Set a button to a common look-and-feel. + ********************************************************************/ + protected static void commonButtonLookAndFeel (AbstractButton but) { +// but.setMargin (new Insets (0,0,0,0)); +// but.setBorderPainted (false); + but.setFocusPainted (false); +// but.setContentAreaFilled (false); + } + + /********************************************************************* + * Return true if confirmation dialog passed. + ********************************************************************/ + public boolean confirm (Object msg) { + return SwingUtils.confirm (this, msg, null); + } + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/02 07:38:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/13 06:53:28 1.2 @@ -29,7 +29,7 @@ */ public interface DashboardPanel - extends PropertyChangeListener { + extends PropertyChangeListener, DashboardProperties { /************************************************************************** * A name identifies a panel in the dashboard's tabs. It should be =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/04 13:45:38 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/13 06:53:28 1.3 @@ -8,16 +8,22 @@ package org.biomoby.service.dashboard; +import org.tulsoft.tools.gui.SwingUtils; + import javax.swing.JLabel; -import javax.swing.text.html.HTMLDocument; import javax.swing.Icon; import javax.swing.JComponent; +import javax.swing.text.html.HTMLDocument; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; /** - * + * A panel displaying contents of a Biomoby registry. It also select + * what Biomoby registry to work with, and what cache directory to + * use.

            * * WORK IN PROGRESS.

            * @@ -60,7 +66,7 @@ * **************************************************************************/ public JLabel getTitle() { - return null; + return new JLabel (getName()); } } From senger at pub.open-bio.org Tue Sep 13 06:54:36 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 13 Sep 2005 02:54:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509130654.j8D6saEL011005@pub.open-bio.org> senger Tue Sep 13 02:54:36 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv10990/src/main/org/biomoby/service/dashboard Added Files: ConsolePanel.java Dashboard.java DashboardProperties.java EventGeneratorPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard ConsolePanel.java,NONE,1.1 Dashboard.java,NONE,1.1 DashboardProperties.java,NONE,1.1 EventGeneratorPanel.java,NONE,1.1 From pieter at pub.open-bio.org Mon Sep 12 13:51:03 2005 From: pieter at pub.open-bio.org (Pieter Neerincs) Date: Mon, 12 Sep 2005 09:51:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509121351.j8CDp3Up008568@pub.open-bio.org> pieter Mon Sep 12 09:51:03 EDT 2005 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv8543/Perl/scripts Modified Files: CloneCentralDatabases.pl Log Message: Fixed small SQL GRANT PRIVILEGES bug in Perl/scripts/CloneCentralDatabases.pl moby-live/Perl/scripts CloneCentralDatabases.pl,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/scripts/CloneCentralDatabases.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/scripts/CloneCentralDatabases.pl 2005/07/07 11:39:54 1.1 +++ /home/repository/moby/moby-live/Perl/scripts/CloneCentralDatabases.pl 2005/09/12 13:51:03 1.2 @@ -143,7 +143,7 @@ $data .= "FLUSH PRIVILEGES\;\n"; $data .= "CREATE DATABASE IF NOT EXISTS $dbname\;\n"; $data .= "USE $dbname\;\n"; - $data .= "GRANT ALL PRIVILEGES ON $dbname TO \"$username\"\@\"localhost\" identified by \"$password\"\;\n"; + $data .= "GRANT ALL PRIVILEGES ON $dbname.* TO \"$username\"\@\"localhost\" identified by \"$password\"\;\n"; $data .= "FLUSH PRIVILEGES\;\n"; } From kawas at pub.open-bio.org Tue Sep 13 13:17:58 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 13 Sep 2005 09:17:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509131317.j8DDHwUB012224@pub.open-bio.org> kawas Tue Sep 13 09:17:58 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi In directory pub.open-bio.org:/tmp/cvs-serv12199/Adaptor/moby/queryapi Modified Files: mysql.pm Log Message: commented out an unused line that was causing grief. The variable that has been removed is unused. moby-live/Perl/MOBY/Adaptor/moby/queryapi mysql.pm,1.72,1.73 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/08/29 22:36:32 1.72 +++ /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/09/13 13:17:58 1.73 @@ -1,1430 +1,1430 @@ -package MOBY::Adaptor::moby::queryapi::mysql; - -use strict; -use vars qw($AUTOLOAD @ISA); -use Carp; -use MOBY::Adaptor::moby::queryapi; -use DBI; -use DBD::mysql; - - at ISA = qw{MOBY::Adaptor::moby::queryapi}; # implements the interface - -{ - #Encapsulated class data - - #___________________________________________________________ - #ATTRIBUTES - my %_attr_data = # DEFAULT ACCESSIBILITY - ( - driver => ["DBI:mysql", 'read/write'], - dbh => [undef, 'read/write'], - - ); - - #_____________________________________________________________ - - # METHODS, to operate on encapsulated class data - - # Is a specified object attribute accessible in a given mode - sub _accessible { - my ($self, $attr, $mode) = @_; - $_attr_data{$attr}[1] =~ /$mode/ - } - - # Classwide default value for a specified object attribute - sub _default_for { - my ($self, $attr) = @_; - $_attr_data{$attr}[0]; - } - - # List of names of all specified object attributes - sub _standard_keys { - keys %_attr_data; - } - - sub driver { - my ($self, $arg) = @_; - $self->{driver} = $arg if defined $arg; - return $self->{driver}; - } - sub dbh { - my ($self, $arg) = @_; - $self->{dbh} = $arg if defined $arg; - return $self->{dbh}; - } - -} - -sub _getDBHandle { - my ($ontology) = @_; - my $CONF = MOBY::Config->new; - my $adap = $CONF->getDataAdaptor(source => $ontology); - return $adap->dbh; -} - -sub new { - my ($caller, %args) = @_; - my $self = $caller->SUPER::new(%args); - - my $caller_is_obj = ref($caller); - my $class = $caller_is_obj || $caller; - - foreach my $attrname ( $self->_standard_keys ) { - if (exists $args{$attrname} && defined $args{$attrname}) { - $self->{$attrname} = $args{$attrname} } - elsif ($caller_is_obj) { - $self->{$attrname} = $caller->{$attrname} } - else { - $self->{$attrname} = $self->_default_for($attrname) } - } - - return unless $self->driver; - my $driver = $self->driver; # inherited from the adaptorI (queryapi) - my $username = $self->username; - my $password = $self->password; - my $port = $self->port; - my $url = $self->url; - my $dbname = $self->dbname; - - my ($dsn) = "$driver:$dbname:$url:$port"; - my $dbh = DBI->connect($dsn, $username, $password, {RaiseError => 1}) or die "can't connect to database"; - - - ############################################################## - unless ($dbh) { - print STDERR "Couldn't connect to the datasource \n",($self->_dump()),"\n\n"; - return undef; - } - - $self->dbh($dbh); - ############################################################# - - return undef unless $self->dbh; - return $self; - -} - -sub _add_condition{ - my ($statement, @params) = @_; - my @bindvalues = (); - my $condition = "where "; - - foreach my $param (@params ) - { - if (($param eq 'and') || ($param eq 'or')) - { - $condition .= $param . " "; - } - else - { - my %pair = %$param; - - for my $key (keys %pair) - { - if (defined $pair{$key}) - { - $condition .= $key . " = ? "; - push(@bindvalues, $pair{$key}); - } - else - { - $condition .= $key . " IS NULL " - } - } - } - } - $statement .= $condition; - return ($statement, @bindvalues); - } - -# preforms query but returns a reference to an array containing hash references -sub do_query{ - my ($dbh, $statement, @bindvalues) = @_; - my $sth = $dbh -> prepare($statement); - if (@bindvalues < 1) - { - $sth->execute; - } - else - { - $sth->execute(@bindvalues); - } - # returns an array of hash references - my $arrayHashRef = $sth->fetchall_arrayref({}); - return $arrayHashRef; -} - -sub get_value{ - my ($key, @params) = @_; - - foreach my $param (@params ) - { - my %pair = %$param; - for my $tmp (keys %pair) - { - if ($tmp eq $key){ - return $pair{$key}; - } - } - } -} - -sub _getSIIDFromLSID { - my ($self, $lsid) = @_; - my $dbh = $self->dbh; - my $sth = $dbh->prepare("select service_instance_id from service_instance where lsid = ?"); - $sth->execute($lsid); - my ($siid) = $sth->fetchrow_array(); - return $siid; -} - -# this should NOT retun a collection ID... needs more work... -# args passed in: service_lsid -sub query_collection_input{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $serv_lsid = $args{'service_instance_lsid'}; - - my $statement = "select - collection_input_id, - article_name - from collection_input as c, service_instance as si where si.service_instance_id = c.service_instance_id and si.lsid = ?"; - my $result = do_query($dbh, $statement, ($serv_lsid)); - return $result; -} - -# args passed in: service_instance_lsid, article_name -sub insert_collection_input { - my ($self, %args) = @_; - my $article = $args{article_name}; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - - $self->dbh->do("insert into collection_input (service_instance_id, article_name) values (?,?)", - undef, $siid, $article); - my $id=$self->dbh->{mysql_insertid}; - return $id; -} - -# pass in service_instance_lsid -sub delete_collection_input{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - - my $statement = "delete from collection_input where service_instance_id = ?"; - $self->dbh->do( $statement, undef, $siid); - - if ($self->dbh->err){ - return (1, $self->dbh->errstr); - } - else{ - return 0; - } -} - -# pass service_instance_lsid -sub query_collection_output{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - - my $statement = "select - collection_output_id, - article_name, - service_instance_id - from collection_output where service_instance_id = ? "; - my $result = do_query($dbh, $statement, ($siid)); - return $result; -} - -# pass service_instance_lsid, article_name -sub insert_collection_output { - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - $self->dbh->do("insert into collection_output (service_instance_id, article_name) values (?,?)", - undef, $siid,$args{'article_name'}); - my $id=$self->dbh->{mysql_insertid}; - return $id; -} - -# pass argument service_instance_lsid -sub delete_collection_output{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - my $statement = "delete from collection_output where service_instance_id = ?"; - my @bindvalues = (); - $dbh->do( $statement, undef, ($siid)); - - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -# pass service_instance_lsid -sub query_simple_input{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $collid = $args{collection_input_id}; - my $id_to_use = $siid?$siid:$collid; - - my $dbh = $self->dbh; - - my $statement = "select - simple_input_id, - object_type_uri, - namespace_type_uris, - article_name, - service_instance_id, - collection_input_id - from simple_input where "; - - my $condition; - $siid && ($condition = " service_instance_id = ? and collection_input_id IS NULL"); - $collid && ($condition = " collection_input_id = ?"); - $statement .= $condition; - - my $result = do_query($dbh, $statement, ($id_to_use)); - return $result; -} - -# pass service_instance_lsid, object_type_uri, namespace_type_uris, article_name, collection_input_id -sub insert_simple_input { - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - $dbh->do("insert into simple_input - (object_type_uri, - namespace_type_uris, - article_name, - service_instance_id, - collection_input_id) - values (?,?,?,?,?)", - undef, - $args{'object_type_uri'}, - $args{'namespace_type_uris'}, - $args{'article_name'}, - $siid, - $args{'collection_input_id'}); - my $id=$dbh->{mysql_insertid}; - return $id; -} - -# pass service_instance_lsid -sub delete_simple_input{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my ($collid) = $args{collection_input_id}; - my $statement1; my $statement2; - $siid && ($statement1 = "delete from simple_input where service_instance_id = ?"); - $collid && ($statement2 = "delete from simple_input where collection_input_id = ?"); - - $siid && ($dbh->do( $statement1, undef,($siid))); - $collid && ($dbh->do($statement2, undef,($collid))); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -sub delete_inputs { # this should replace all other delete_*_input - my ($self, %args) = @_; - my $dbh = $self->dbh; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $result_ids = $self->query_collection_input(service_instance_lsid => $self->lsid); - - my $statement = "delete from simple_input where service_instance_id = ?"; - - $dbh->do( $statement, undef,($siid)); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } - -} - -sub delete_output { # this should replace all other delete_*_output - -} - -# UGH this has to know too much bout the underlying database structure e.g. that one is null and other is full -# this problem is in MOBY::Central line 3321 3346 and 3374 -#****** FIX -# send service_instance_lsid, collection_input_id -sub query_simple_output{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $collid = $args{collection_output_id}; - my $dbh = $self->dbh; - my $id_to_use = $siid?$siid:$collid; - - my $statement = "select - simple_output_id, - object_type_uri, - namespace_type_uris, - article_name, - service_instance_id, - collection_output_id - from simple_output where "; - my $condition; - $siid && ($condition = " service_instance_id = ? and collection_output_id IS NULL"); - $collid && ($condition = " collection_output_id = ?"); - $statement .= $condition; - - - my $result = do_query($dbh, $statement, ($id_to_use)); - return $result; -} - -# pass args service_instance_id and collection_output_id -sub insert_simple_output { - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - - $dbh->do("insert into simple_output - (object_type_uri, - namespace_type_uris, - article_name, - service_instance_id, - collection_output_id) - values (?,?,?,?,?)", - undef,( - $args{'object_type_uri'}, - $args{'namespace_type_uris'}, - $args{'article_name'}, - $siid, - $args{'collection_output_id'})); - my $id=$dbh->{mysql_insertid}; - return $id; - -} - -# pass service_instance_id or collection_output_id -sub delete_simple_output{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my ($collid) = $args{collection_output_id}; - my $statement1; my $statement2; - $siid && ($statement1 = "delete from simple_output where service_instance_id = ?"); - $collid && ($statement2 = "delete from simple_output where collection_output_id = ?"); - - $siid && ($dbh->do( $statement1, undef,($siid))); - $collid && ($dbh->do($statement2, undef,($collid))); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -# pass service_instance_lsid -sub query_secondary_input{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - - my $statement = "select - secondary_input_id, - default_value, - maximum_value, - minimum_value, - enum_value, - datatype, - article_name, - service_instance_id - from secondary_input where service_instance_id = ?"; - my $result = do_query($dbh, $statement, ($siid)); - return $result; -} - -# pass default_value, maximum_value minimum_value enum_value datatype article_name service_instance_lsid -sub insert_secondary_input{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - $dbh->do(q{insert into secondary_input (default_value,maximum_value,minimum_value,enum_value,datatype,article_name,service_instance_id) values (?,?,?,?,?,?,?)}, - undef, - ( - $args{'default_value'}, $args{'maximum_value'}, - $args{'minimum_value'}, $args{'enum_value'}, - $args{'datatype'}, $args{'article_name'},$siid) - ); - return $dbh->{mysql_insertid}; -} - -# pass service_instance_lsid -sub delete_secondary_input{ - my ($self, %args) = @_; - my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); - my $dbh = $self->dbh; - my $statement = "delete from secondary_input where service_instance_id=?"; - - $dbh->do( $statement, undef, ($siid)); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - - -# receives argument "type", that may be either an LSID or a type term -sub query_object { - my ($self, %args) = @_; - my $type = $args{type}; - my $condition = ""; - if ($type =~ /^urn\:lsid/){ - $condition = "where object_lsid = ?"; - } elsif ($type) { - $condition = "where object_type = ?"; - } - my $statement = "select - object_id, - object_lsid, - object_type, - description, - authority, - contact_email - from object $condition"; - - my $dbh = _getDBHandle("mobyobject"); - my $result; - if ($type){ - $result = do_query($dbh, $statement, ($type)); - } else { - $result = do_query($dbh, $statement); - } - return $result; -} - -# inserts a new tuple into object table -# pass object_type object_lsid description authority contact_email -sub insert_object{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - $dbh->do("insert into object - (object_type, - object_lsid, - description, - authority, - contact_email) - values (?,?,?,?,?)", - undef, - $args{'object_type'}, - $args{'object_lsid'}, - $args{'description'}, - $args{'authority'}, - $args{'contact_email'}); - my $id=$dbh->{mysql_insertid}; - return $id; -} - -# pass 'type' which is either an LSID or a term -sub delete_object{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $term = $args{type}; - return 0 unless $term; - my $result = $self->query_object(type => $term); - my $row = shift(@$result); - my $id = $row->{object_id}; - my $lsid = $row->{object_lsid}; - my $statement = "delete from object where object_lsid = ?"; - $dbh->do( $statement,undef, ($lsid) ); - - $self->_delete_object_term2term(id => $id); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -# pass "type" here, should be an LSID, preferably... -sub query_object_term2term{ - my ($self, %args) = @_; - my $type = $args{type}; - my $result = $self->query_object(type => $type); - my $row = shift(@$result); - my $id = $row->{object_id}; - return [{}] unless $id; - my $dbh = $self->dbh; - - my $statement = "select - assertion_id, - relationship_type, - object1_id, - object2_id, - object2_articlename - from object_term2term where object2_id = ?"; - my $result2 = do_query($dbh, $statement, ($id)); - return $result2; -} - -# pass object1_type, object2_type, object2_articlename, relationship_type -sub insert_object_term2term{ - my ($self, %args) = @_; - my $type1 = $args{object1_type}; - my $result = $self->query_object(type => $type1); - my $row = shift(@$result); - my $id1 = $row->{object_id}; - my $type2 = $args{object2_type}; - $result = $self->query_object(type => $type2); - $row = shift(@$result); - my $id2 = $row->{object_id}; - my $relationship_type = $args{relationship_type}; - my $object2_articlename = $args{object2_articlename}; - - my $dbh = $self->dbh; - $dbh->do( - q{insert into object_term2term (relationship_type, object1_id, object2_id, object2_articlename) values (?,?,?,?)}, - undef, - $relationship_type, - $id1, - $id2, - $object2_articlename - ); - - return $dbh->{mysql_insertid}; -} - -# pass object 'type' as term or lsid -# this should be a private routine, not a public one. -# SHOULD NOT BE DOCUMENTED IN THE API -sub _delete_object_term2term{ - my ($self, %args) = @_; - my $o1id = $args{id}; - return 0 unless defined($o1id); - my $dbh = $self->dbh; - my $statement = "delete from object_term2term where object1_id=?"; - $dbh->do( $statement,undef, ($o1id)); - - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -# pass servicename and authority_uri -sub query_service_existence { - my ($self, %args) = @_; - my $dbh = $self->dbh; - - my $servicename = $args{'servicename'}; - my $authURI = $args{'authority_uri'}; - my $result = $self->_query_authority(authority_uri => $authURI); - return 0 unless @$result[0]; - my $id = @$result[0]->{authority_id}; - return 0 unless $id; - my $statement = "select - service_instance_id, - category, - servicename, - service_type_uri, - authority_id, - url, - contact_email, - authoritative, - description, - signatureURL, - lsid - from service_instance where servicename = ? and authority_id = ?"; - my $final = do_query($dbh, $statement, ($servicename, $id)); - if (@$final[0]){return 1} else {return 0} - -} -# selects all the columns from service_instance table -# PAY ATTENTION to what this returns. Not auth_id but auth_uri!! -# IMPORTANT: must use quotes for the keys of the hash (eg. 'authority.authority_uri' => $value ) -sub query_service_instance { - my ($self, %args) = @_; - my $dbh = $self->dbh; - - my @args; - while (my ($k, $v) = each %args){ - push @args, ({$k => $v}, "and"); # format for the_add_condition subroutine - # but too bad won't be scalable for "or" - } - - if (keys(%args)){ pop @args;} # remove final "and" - - my $statement = "select - service_instance_id, - category, - servicename, - service_type_uri, - authority.authority_uri, - url, - service_instance.contact_email, - authoritative, - description, - signatureURL, - lsid - from service_instance, authority "; - my @bindvalues; - ($statement, @bindvalues) =_add_condition($statement, @args); - if (keys(%args)){ - $statement .= " and authority.authority_id = service_instance.authority_id"; - } else { - $statement .= " where authority.authority_id = service_instance.authority_id"; - } - my $final = do_query($dbh, $statement, @bindvalues); - return $final; -} - -# custom query for Moby::Central.pm->findService() -# hmmmmmmm.... I'm not sure that this routine should exist... -# it is redundant to the routine above, if the routine above were executed -# multiple times. I think that is the more correct (though less efficient) -# way to go, since it is "scalable" to every possible underlying data source -# ********FIX change this later... -sub match_service_type_uri{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $uri_list = $args{'service_type_uri'}; - my $statement = "select service_instance_id,category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid from service_instance where service_type_uri in ($uri_list)"; - my @bindvalues = (); - my $result = do_query($dbh, $statement, @bindvalues); - return $result; -} - -# passs........ blah blah..... -sub insert_service_instance { - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $authority_id; - if ($args{'authority_uri'}){ # need to transform URI to a row ID - my $result = $self->_query_authority(authority_uri => $args{'authority_uri'}); - return undef unless @$result[0]; - $authority_id = @$result[0]->{authority_id}; - return undef unless $authority_id; - } - - $dbh->do(q{insert into service_instance (category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid) values (?,?,?,?,?,?,?,?,?,?)}, - undef,( - $args{'category'}, - $args{'servicename'}, - $args{'service_type_uri'}, - $authority_id, - $args{'url'}, - $args{'contact_email'}, - $args{'authoritative'}, - $args{'description'}, - $args{'signatureURL'}, - $args{'lsid'})); - - my $id = $dbh->{mysql_insertid}; - return $id; -} - -# pass service_instance_lsid -sub delete_service_instance{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $statement = "delete from service_instance where lsid = ?"; - $dbh->do( $statement,undef, ($args{service_instance_lsid}) ); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -# Selects all columns EXCEPT authority_id -# pass authority_uri -sub query_authority { - my ($self, %args) = @_; - my $authURI = $args{authority_uri}; - my $dbh = $self->dbh; - - my $statement = "select - authority_common_name, - authority_uri, - contact_email - from authority where authority_uri = ?"; - my $result = do_query($dbh, $statement, ($authURI)); - return $result; -} - -# Selects all columns including authority_id -# pass authority_uri. NOTE THAT THIS IS A PRIVATE ROUTINE -# SHOULD NOT BE DOCUMENTED IN THE API -sub _query_authority { - my ($self, %args) = @_; - my $authURI = $args{authority_uri}; - my $dbh = $self->dbh; - - my $statement = "select - authority_common_name, - authority_uri, - authority_id, - contact_email - from authority where authority_uri = ?"; - my $result = do_query($dbh, $statement, ($authURI)); - return $result; -} - -# custom query routine used in Moby::Central.pm -> retrieveServiceProviders() -# no args passed -sub get_all_authorities{ - my ($self, @args) = @_; - my $dbh = $self->dbh; - my $statement = "select distinct authority_uri from authority"; - my @bindvalues = (); - my $result = do_query($dbh, $statement, @bindvalues); - return $result; -} - -# pass authority_common_name, authority_uri, contact_email, return ID of some sort -sub insert_authority{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - $dbh->do("insert into authority - (authority_common_name, - authority_uri, - contact_email) - values (?,?,?)", - undef, - ($args{'authority_common_name'}, - $args{'authority_uri'}, - $args{'contact_email'})); - my $id = $dbh->{mysql_insertid}; - return $id; -} - -# pass service_type, as term or LSID -sub query_service{ - my ($self, %args) = @_; - my $type = $args{type}; - my $condition = ""; - if ($type =~ /^urn\:lsid/){ - $condition = "where service_lsid = ?"; - } elsif ($type) { - $condition = "where service_type = ?"; - } else { - $condition = ""; - } - - my $dbh = _getDBHandle("mobyservice"); - - my $statement = "select - service_id, - service_lsid, - service_type, - description, - authority, - contact_email - from service $condition"; - my $result; - if ($type){ - $result = do_query($dbh, $statement, ($type)); - } else { - $result = do_query($dbh, $statement); - } - return $result; -} - -# pass in .... -sub insert_service{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - $dbh->do(q{insert into service (service_type, service_lsid, description, authority, contact_email) values (?,?,?,?,?)}, - undef, - ( - $args{'service_type'}, $args{'service_lsid'}, $args{'description'}, - $args{'authority'}, $args{'contact_email'} - ) - ); - return $dbh->{mysql_insertid}; -} - -# pass in 'type' as a term or lsid -sub delete_service{ - my ($self, %args) = @_; - my $type = $args{type}; - my $result = $self->query_service(type => $type); - my $row = shift(@$result); - my $id = $row->{service_id}; - my $lsid = $row->{service_lsid}; - return 0 unless $lsid; - my $dbh = $self->dbh; - my $statement = "delete from service where service_lsid = ?"; - $dbh->do( $statement, undef, ($lsid)); - $self->_delete_service_term2term(id => $id); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -sub query_service_term2term{ - my ($self, %args) = @_; - my $type = $args{type}; - my $result = $self->query_service(type => $type); - my $row = shift(@$result); - my $id = $row->{service_id}; - return [{}] unless $id; - my $dbh = $self->dbh; - - my $statement = "select - assertion_id, - relationship_type, - service1_id, - service2_id - from service_term2term where service2_id = ?"; - my $result2 = do_query($dbh, $statement, ($id)); - return $result2; -} - -#pass relationshiptype, servce1_type, service2_type -sub insert_service_term2term{ - my ($self, %args) = @_; - my $type1 = $args{service1_type}; - my $result = $self->query_service(type => $type1); - my $row = shift(@$result); - my $id1 = $row->{service_id}; - my $type2 = $args{service2_type}; - $result = $self->query_service(type => $type2); - $row = shift(@$result); - my $id2 = $row->{service_id}; - my $relationship_type = $args{relationship_type}; - - my $dbh = $self->dbh; - $dbh->do(q{insert into service_term2term (relationship_type, service1_id, service2_id) values (?,?,?)}, - undef, - ($relationship_type, - $id1, - $id2) - ); - - return $dbh->{mysql_insertid}; -} - - -# NOTE THAT THIS IS A PRIVATE FUNCTION AND SHOULD -# NOT BE DOCUMENTED IN THE API. -sub _delete_service_term2term{ - my ($self, %args) = @_; - my $id = $args{id}; - return 0 unless (defined($id)); - my $dbh = $self->dbh; - my $statement = "delete from service_term2term where service1_id=?"; - $dbh->do( $statement,undef, ($id)); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - - -sub query_relationship{ - my ($self, %args) = @_; - my $type = $args{type} || ""; -# return [{}] unless $type; - my $condition = ""; - if ($type =~ /^urn\:lsid/){ - $condition = " relationship_lsid = ? and "; - } elsif ($type) { - $condition = " relationship_type = ? and "; - } - my $ont = $args{ontology}; - - my $dbh = $self->dbh; - - my $statement = "select - relationship_id, - relationship_lsid, - relationship_type, - container, - description, - authority, - contact_email, - ontology - from relationship where $condition ontology = ?"; - - if ($type){ - return do_query($dbh, $statement, ($type, $ont)); - } else { - return do_query($dbh, $statement, ($ont)); - } -} - -sub query_namespace{ - my ($self, %args) = @_; - my $type = $args{type}; - my $condition = ""; - if ($type =~ /^urn\:lsid/){ - $condition = " where namespace_lsid = ?"; - } elsif ($type) { - $condition = " where namespace_type = ?"; - } else { - $condition = ""; - } - - my $dbh = _getDBHandle("mobynamespace"); - - my $statement = "select - namespace_id, - namespace_lsid, - namespace_type, - description, - authority, - contact_email - from namespace $condition"; - my $result; - if ($type){ - $result = do_query($dbh, $statement, ($type)); - } else { - $result = do_query($dbh, $statement); - } - return $result; -} - - -sub insert_namespace{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - $dbh->do(q{insert into namespace (namespace_type, namespace_lsid, description, authority,contact_email) values (?,?,?,?,?)}, - undef, - ( - $args{'namespace_type'}, $args{'namespace_lsid'},$args{'description'},$args{'authority'},$args{'contact_email'} - ) - ); - return $dbh->{mysql_insertid}; -} - -# pass namesapce_lsid -sub delete_namespace{ - my ($self, %args) = @_; - my $type = $args{type}; - my $result = $self->query_namespace(type => $type); - my $row = shift(@$result); - my $id = $row->{namespace_id}; - my $lsid = $row->{namespace_lsid}; - return 0 unless $lsid; - my $dbh = $self->dbh; - my $statement = "delete from namespace where namespace_lsid = ?"; - $dbh->do( $statement, undef, ($lsid)); - $self->_delete_namespace_term2term(id => $id); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} - -sub query_namespace_term2term{ - my ($self, %args) = @_; - my $type = $args{type}; - my $result = $self->query_namespace(type => $type); - my $row = shift(@$result); - my $id = $row->{namespace_id}; - return [{}] unless $id; - my $dbh = $self->dbh; - - my $statement = "select - assertion_id, - relationship_type, - namespace1_id, - namespace2_id - from namespace_term2term where namespace2_id = ?"; - my $result2 = do_query($dbh, $statement, ($id)); - return $result2; -} - -# PRIVATE, NOT PART OF API! -sub _delete_namespace_term2term{ - my ($self, %args) = @_; - my $id = $args{id}; - return 0 unless defined($id); - my $dbh = $self->dbh; - my $statement = "delete from namespace_term2term where namespace1_id=?"; - $dbh->do( $statement,undef, ($id)); - if ($dbh->err){ - return (1, $dbh->errstr); - } - else{ - return 0; - } -} -# pass type as LSID or term -sub check_object_usage{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $errorMsg = 1; - my $type = $args{type}; - return 0 unless $type; - my $result = $self->query_object(type => $type); - my $row = shift @$result; - my $lsid = $row->{object_lsid}; - - my ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join simple_input where object_type_uri = ?}, - undef, $lsid - ); - return $errorMsg - if ($id); - - ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join simple_output where object_type_uri = ?}, - undef, $lsid - ); - return $errorMsg - if ($id); - - ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join collection_input natural join simple_input where object_type_uri = ?}, - undef, $lsid - ); - return $errorMsg - if ($id); - - ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join collection_output natural join simple_output where object_type_uri = ?}, - undef, $lsid - ); - return $errorMsg - if ($id); - - return 0; -} - -# custom query routine for Moby::Central.pm -> deregisterNamespace() -sub check_namespace_usage{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $errorMsg = 1; - my $type = $args{type}; - return 0 unless $type; - my $result = $self->query_namespace(type => $type); - my $row = shift @$result; - my $lsid = $row->{namespace_lsid}; - - my $sth = $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join simple_input where INSTR(namespace_type_uris,'$lsid')" - ); - $sth->execute; - - while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { - my @nss = split ",", $ns; - foreach (@nss) { - $_ =~ s/\s//g; - my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; - return (1, $errstr) - if ( $_ eq $lsid ); - } - } - $sth = $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join simple_output where INSTR(namespace_type_uris,'$lsid')" - ); - $sth->execute; - while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { - my @nss = split ",", $ns; - foreach (@nss) { - $_ =~ s/\s//g; - my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; - return (1, $errstr) - if ( $_ eq $lsid ); - } - } - $sth = - $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join collection_input natural join simple_input where INSTR(namespace_type_uris, '$lsid')" - ); - $sth->execute; - while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { - my @nss = split ",", $ns; - foreach (@nss) { - $_ =~ s/\s//g; - my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; - return (1, $errstr) - if ( $_ eq $lsid ); - } - } - $sth = - $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join collection_output natural join simple_output where INSTR(namespace_type_uris, '$lsid')" - ); - $sth->execute; - while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { - my @nss = split ",", $ns; - foreach (@nss) { - $_ =~ s/\s//g; - my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; - return (1, $errstr) - if ( $_ eq $lsid ); - } - } - return (0, ""); -} - -# custom query routine for Moby::Central.pm -> findService() -sub check_keywords{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $param = $args{keywords}; - return ([{}]) unless (ref($param) =~ /ARRAY/); - my @keywords = @$param; - my %findme = %$param; - my $searchstring; - foreach my $kw ( @keywords ) { - $kw =~ s/\*//g; - $kw = $dbh->quote("%$kw%"); - $searchstring .= " OR description like $kw "; - } - $searchstring =~ s/OR//; # remove just the first OR in the longer statement - - my $statement = "select service_instance_id,category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid from service_instance where $searchstring"; - my @bindvalues = (); - - my $ids = do_query($dbh, $statement, @bindvalues); - return ($ids); -} - -# custom query subroutine for Moby::Central.pm->_searchForSimple() -sub find_by_simple{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $inout = $args{'inout'}; - my $ancestor_string = $args{'ancestor_string'}; - my $namespaceURIs = $args{'namespaceURIs'}; - - my $query ="select service_instance_id, namespace_type_uris from simple_$inout where object_type_uri in ($ancestor_string) and service_instance_id IS NOT NULL " - ; # if service_instance_id is null then it must be a collection input. - my $nsquery; - foreach my $ns ( @{$namespaceURIs} ) { # namespaces are already URI's - $nsquery .= " OR INSTR(namespace_type_uris, '$ns') "; - } - if ($nsquery) { - $nsquery =~ s/OR//; # just the first - $nsquery .= " OR namespace_type_uris IS NULL"; - $query .= " AND ($nsquery) "; - } - - my $result = do_query($dbh, $query, ()); - return $result; -} - -# custom query subroutine for Moby::Central.pm->_searchForCollection() -sub find_by_collection{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $inout = $args{'inout'}; - my $objectURI = $args{'objectURI'}; - my $namespaceURIs = $args{'namespaceURIs'}; - - my $query = "select - c.service_instance_id, - s.namespace_type_uris - from - simple_$inout as s, - collection_$inout as c - where - s.collection_${inout}_id IS NOT NULL - AND s.collection_${inout}_id = c.collection_${inout}_id - AND object_type_uri = '$objectURI' "; - my $nsquery; - foreach my $ns ( @{$namespaceURIs} ) { # namespaces are already URI's - $nsquery .= " OR INSTR(namespace_type_uris, '$ns') "; - } - if ($nsquery) { - $nsquery =~ s/^\sOR//; # just the first - $nsquery .= " OR namespace_type_uris IS NULL"; - $query .= " AND ($nsquery) "; # add the AND clause - } - - my $result = do_query($dbh, $query, ()); - return $result; -} - -# custom query subroutine for Moby::Central.pm->RetrieveServiceNames -sub get_service_names{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $statement = "select authority_uri, servicename from authority as a, service_instance as s where s.authority_id = a.authority_id"; - my @bindvalues = (); - - my $result = do_query($dbh, $statement, @bindvalues); - return $result; -} - -# custom query for Moby::Central.pm->_flatten -sub get_parent_terms{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - - my $type_id = $args{'relationship_type_id'}; - my $statement = " - select - OE1.term - from - OntologyEntry as OE1, - OntologyEntry as OE2, - Term2Term as TT - where - ontologyentry2_id = OE2.id - and ontologyentry1_id = OE1.id - and relationship_type_id = $type_id - and OE2.term = ?"; - - my @bindvalues = (); - push(@bindvalues, $args{'term'}); - - my $result = do_query($dbh, $statement, @bindvalues); - return $result; -} - -# custom query subroutine for selecting from object_term2term and object tables -# used in Moby::OntologyServer.pm->retrieveObject() -sub get_object_relationships{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $type = $args{type}; - return 0 unless $type; - my $result = $self->query_object(type => $type); - my $row = shift @$result; - my $id = $row->{object_id}; - - my $statement = "select - relationship_type, - object_type, - object_lsid, - description, - authority, - contact_email, - object2_articlename - from object_term2term, object - where object1_id = ? and object2_id = object_id"; - - my $result2 = do_query($dbh, $statement, ($id)); - return $result2; -} - -# relationship query for any table used in Moby::OntologyServer->_doRelationshipQuery() -# note: returns a reference to an array containing ARRAY references -sub get_relationship{ - my ($self, %args) = @_; - my $dbh = $self->dbh; - my $direction = $args{'direction'}; - my $ontology = $args{'ontology'}; - my $relationship = $args{'relationship'}; # this is assumed to be an LSID - - my $type = $args{'term'}; - return 0 unless $type; - my $lsid; - if ($ontology eq "service"){ - my $result = $self->query_service(type => $type); - my $row = shift @$result; - $lsid = $row->{service_lsid}; - } else { - my $result = $self->query_object(type => $type); - my $row = shift @$result; - $lsid = $row->{object_lsid}; - } - my $defs; - my $extra_columns; - $extra_columns = ", relationship_type "; - if ($ontology eq "object"){$extra_columns .=", object2_articlename ";} - if ( $direction eq 'root' ) { - unless ( defined $relationship ) { - $defs = $self->dbh->selectall_arrayref( " - select distinct s2.${ontology}_lsid $extra_columns from - ${ontology}_term2term as t2t, - $ontology as s1, - $ontology as s2 - where - s1.${ontology}_id = t2t.${ontology}1_id and - s2.${ontology}_id = t2t.${ontology}2_id and - s1.${ontology}_lsid = ?", undef, $lsid ); # ") - } else { - $defs = $self->dbh->selectall_arrayref( " - select distinct s2.${ontology}_lsid $extra_columns from - ${ontology}_term2term as t2t, - $ontology as s1, - $ontology as s2 - where - relationship_type = ? and - s1.${ontology}_id = t2t.${ontology}1_id and - s2.${ontology}_id = t2t.${ontology}2_id and - s1.${ontology}_lsid = ?", undef, $relationship, $lsid ); # ") - } - } else { - unless ( defined $relationship ) { - $defs = $self->dbh->selectall_arrayref( " - select distinct s2.${ontology}_lsid $extra_columns from - ${ontology}_term2term as t2t, - $ontology as s1, - $ontology as s2 - where - s1.${ontology}_id = t2t.${ontology}1_id and - s2.${ontology}_id = t2t.${ontology}2_id and - s2.${ontology}_lsid = ?", undef, $lsid); # ") - } else { - $defs = $self->dbh->selectall_arrayref( " - select distinct s2.${ontology}_lsid $extra_columns from - ${ontology}_term2term as t2t, - $ontology as s1, - $ontology as s2 - where - relationship_type = ? and - s1.${ontology}_id = t2t.${ontology}1_id and - s2.${ontology}_id = t2t.${ontology}2_id and - s2.${ontology}_lsid = ?", undef, $relationship, $lsid ); # ") - } - } - return $defs; -} - -sub _checkURI { - -# my $uri = "http://www.ics.uci.edu/pub/ietf/uri/#Related"; -#print "$1, $2, $3, $4, $5, $6, $7, $8, $9" if -# $uri =~ m{^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?}; -# -#The license for this recipe is available here. -# -#Discussion: -# -#If the match is successful, a URL such as -# -#http://www.ics.uci.edu/pub/ietf/uri/#Related -# -#will be broken down into the following group match variables: -# -#$1 = http: -#$2 = http -#$3 = //www.ics.uci.edu -#$4 = www.ics.uci.edu -#$5 = /pub/ietf/uri/ -#$6 = -#$7 = -#$8 = #Related -#$9 = Related -# -#In general, this regular expression breaks a URI down into the following parts, -#as defined in the RFC: -# -#scheme = $2 -#authority = $4 -#path = $5 -#query = $7 -#fragment = $9 - -} - -sub DESTROY {} - -1; +package MOBY::Adaptor::moby::queryapi::mysql; + +use strict; +use vars qw($AUTOLOAD @ISA); +use Carp; +use MOBY::Adaptor::moby::queryapi; +use DBI; +use DBD::mysql; + + at ISA = qw{MOBY::Adaptor::moby::queryapi}; # implements the interface + +{ + #Encapsulated class data + + #___________________________________________________________ + #ATTRIBUTES + my %_attr_data = # DEFAULT ACCESSIBILITY + ( + driver => ["DBI:mysql", 'read/write'], + dbh => [undef, 'read/write'], + + ); + + #_____________________________________________________________ + + # METHODS, to operate on encapsulated class data + + # Is a specified object attribute accessible in a given mode + sub _accessible { + my ($self, $attr, $mode) = @_; + $_attr_data{$attr}[1] =~ /$mode/ + } + + # Classwide default value for a specified object attribute + sub _default_for { + my ($self, $attr) = @_; + $_attr_data{$attr}[0]; + } + + # List of names of all specified object attributes + sub _standard_keys { + keys %_attr_data; + } + + sub driver { + my ($self, $arg) = @_; + $self->{driver} = $arg if defined $arg; + return $self->{driver}; + } + sub dbh { + my ($self, $arg) = @_; + $self->{dbh} = $arg if defined $arg; + return $self->{dbh}; + } + +} + +sub _getDBHandle { + my ($ontology) = @_; + my $CONF = MOBY::Config->new; + my $adap = $CONF->getDataAdaptor(source => $ontology); + return $adap->dbh; +} + +sub new { + my ($caller, %args) = @_; + my $self = $caller->SUPER::new(%args); + + my $caller_is_obj = ref($caller); + my $class = $caller_is_obj || $caller; + + foreach my $attrname ( $self->_standard_keys ) { + if (exists $args{$attrname} && defined $args{$attrname}) { + $self->{$attrname} = $args{$attrname} } + elsif ($caller_is_obj) { + $self->{$attrname} = $caller->{$attrname} } + else { + $self->{$attrname} = $self->_default_for($attrname) } + } + + return unless $self->driver; + my $driver = $self->driver; # inherited from the adaptorI (queryapi) + my $username = $self->username; + my $password = $self->password; + my $port = $self->port; + my $url = $self->url; + my $dbname = $self->dbname; + + my ($dsn) = "$driver:$dbname:$url:$port"; + my $dbh = DBI->connect($dsn, $username, $password, {RaiseError => 1}) or die "can't connect to database"; + + + ############################################################## + unless ($dbh) { + print STDERR "Couldn't connect to the datasource \n",($self->_dump()),"\n\n"; + return undef; + } + + $self->dbh($dbh); + ############################################################# + + return undef unless $self->dbh; + return $self; + +} + +sub _add_condition{ + my ($statement, @params) = @_; + my @bindvalues = (); + my $condition = "where "; + + foreach my $param (@params ) + { + if (($param eq 'and') || ($param eq 'or')) + { + $condition .= $param . " "; + } + else + { + my %pair = %$param; + + for my $key (keys %pair) + { + if (defined $pair{$key}) + { + $condition .= $key . " = ? "; + push(@bindvalues, $pair{$key}); + } + else + { + $condition .= $key . " IS NULL " + } + } + } + } + $statement .= $condition; + return ($statement, @bindvalues); + } + +# preforms query but returns a reference to an array containing hash references +sub do_query{ + my ($dbh, $statement, @bindvalues) = @_; + my $sth = $dbh -> prepare($statement); + if (@bindvalues < 1) + { + $sth->execute; + } + else + { + $sth->execute(@bindvalues); + } + # returns an array of hash references + my $arrayHashRef = $sth->fetchall_arrayref({}); + return $arrayHashRef; +} + +sub get_value{ + my ($key, @params) = @_; + + foreach my $param (@params ) + { + my %pair = %$param; + for my $tmp (keys %pair) + { + if ($tmp eq $key){ + return $pair{$key}; + } + } + } +} + +sub _getSIIDFromLSID { + my ($self, $lsid) = @_; + my $dbh = $self->dbh; + my $sth = $dbh->prepare("select service_instance_id from service_instance where lsid = ?"); + $sth->execute($lsid); + my ($siid) = $sth->fetchrow_array(); + return $siid; +} + +# this should NOT retun a collection ID... needs more work... +# args passed in: service_lsid +sub query_collection_input{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $serv_lsid = $args{'service_instance_lsid'}; + + my $statement = "select + collection_input_id, + article_name + from collection_input as c, service_instance as si where si.service_instance_id = c.service_instance_id and si.lsid = ?"; + my $result = do_query($dbh, $statement, ($serv_lsid)); + return $result; +} + +# args passed in: service_instance_lsid, article_name +sub insert_collection_input { + my ($self, %args) = @_; + my $article = $args{article_name}; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + + $self->dbh->do("insert into collection_input (service_instance_id, article_name) values (?,?)", + undef, $siid, $article); + my $id=$self->dbh->{mysql_insertid}; + return $id; +} + +# pass in service_instance_lsid +sub delete_collection_input{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + + my $statement = "delete from collection_input where service_instance_id = ?"; + $self->dbh->do( $statement, undef, $siid); + + if ($self->dbh->err){ + return (1, $self->dbh->errstr); + } + else{ + return 0; + } +} + +# pass service_instance_lsid +sub query_collection_output{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + + my $statement = "select + collection_output_id, + article_name, + service_instance_id + from collection_output where service_instance_id = ? "; + my $result = do_query($dbh, $statement, ($siid)); + return $result; +} + +# pass service_instance_lsid, article_name +sub insert_collection_output { + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + $self->dbh->do("insert into collection_output (service_instance_id, article_name) values (?,?)", + undef, $siid,$args{'article_name'}); + my $id=$self->dbh->{mysql_insertid}; + return $id; +} + +# pass argument service_instance_lsid +sub delete_collection_output{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + my $statement = "delete from collection_output where service_instance_id = ?"; + my @bindvalues = (); + $dbh->do( $statement, undef, ($siid)); + + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +# pass service_instance_lsid +sub query_simple_input{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $collid = $args{collection_input_id}; + my $id_to_use = $siid?$siid:$collid; + + my $dbh = $self->dbh; + + my $statement = "select + simple_input_id, + object_type_uri, + namespace_type_uris, + article_name, + service_instance_id, + collection_input_id + from simple_input where "; + + my $condition; + $siid && ($condition = " service_instance_id = ? and collection_input_id IS NULL"); + $collid && ($condition = " collection_input_id = ?"); + $statement .= $condition; + + my $result = do_query($dbh, $statement, ($id_to_use)); + return $result; +} + +# pass service_instance_lsid, object_type_uri, namespace_type_uris, article_name, collection_input_id +sub insert_simple_input { + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + $dbh->do("insert into simple_input + (object_type_uri, + namespace_type_uris, + article_name, + service_instance_id, + collection_input_id) + values (?,?,?,?,?)", + undef, + $args{'object_type_uri'}, + $args{'namespace_type_uris'}, + $args{'article_name'}, + $siid, + $args{'collection_input_id'}); + my $id=$dbh->{mysql_insertid}; + return $id; +} + +# pass service_instance_lsid +sub delete_simple_input{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my ($collid) = $args{collection_input_id}; + my $statement1; my $statement2; + $siid && ($statement1 = "delete from simple_input where service_instance_id = ?"); + $collid && ($statement2 = "delete from simple_input where collection_input_id = ?"); + + $siid && ($dbh->do( $statement1, undef,($siid))); + $collid && ($dbh->do($statement2, undef,($collid))); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +sub delete_inputs { # this should replace all other delete_*_input + my ($self, %args) = @_; + my $dbh = $self->dbh; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $result_ids = $self->query_collection_input(service_instance_lsid => $self->lsid); + + my $statement = "delete from simple_input where service_instance_id = ?"; + + $dbh->do( $statement, undef,($siid)); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } + +} + +sub delete_output { # this should replace all other delete_*_output + +} + +# UGH this has to know too much bout the underlying database structure e.g. that one is null and other is full +# this problem is in MOBY::Central line 3321 3346 and 3374 +#****** FIX +# send service_instance_lsid, collection_input_id +sub query_simple_output{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $collid = $args{collection_output_id}; + my $dbh = $self->dbh; + my $id_to_use = $siid?$siid:$collid; + + my $statement = "select + simple_output_id, + object_type_uri, + namespace_type_uris, + article_name, + service_instance_id, + collection_output_id + from simple_output where "; + my $condition; + $siid && ($condition = " service_instance_id = ? and collection_output_id IS NULL"); + $collid && ($condition = " collection_output_id = ?"); + $statement .= $condition; + + + my $result = do_query($dbh, $statement, ($id_to_use)); + return $result; +} + +# pass args service_instance_id and collection_output_id +sub insert_simple_output { + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + + $dbh->do("insert into simple_output + (object_type_uri, + namespace_type_uris, + article_name, + service_instance_id, + collection_output_id) + values (?,?,?,?,?)", + undef,( + $args{'object_type_uri'}, + $args{'namespace_type_uris'}, + $args{'article_name'}, + $siid, + $args{'collection_output_id'})); + my $id=$dbh->{mysql_insertid}; + return $id; + +} + +# pass service_instance_id or collection_output_id +sub delete_simple_output{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my ($collid) = $args{collection_output_id}; + my $statement1; my $statement2; + $siid && ($statement1 = "delete from simple_output where service_instance_id = ?"); + $collid && ($statement2 = "delete from simple_output where collection_output_id = ?"); + + $siid && ($dbh->do( $statement1, undef,($siid))); + $collid && ($dbh->do($statement2, undef,($collid))); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +# pass service_instance_lsid +sub query_secondary_input{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + + my $statement = "select + secondary_input_id, + default_value, + maximum_value, + minimum_value, + enum_value, + datatype, + article_name, + service_instance_id + from secondary_input where service_instance_id = ?"; + my $result = do_query($dbh, $statement, ($siid)); + return $result; +} + +# pass default_value, maximum_value minimum_value enum_value datatype article_name service_instance_lsid +sub insert_secondary_input{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + $dbh->do(q{insert into secondary_input (default_value,maximum_value,minimum_value,enum_value,datatype,article_name,service_instance_id) values (?,?,?,?,?,?,?)}, + undef, + ( + $args{'default_value'}, $args{'maximum_value'}, + $args{'minimum_value'}, $args{'enum_value'}, + $args{'datatype'}, $args{'article_name'},$siid) + ); + return $dbh->{mysql_insertid}; +} + +# pass service_instance_lsid +sub delete_secondary_input{ + my ($self, %args) = @_; + my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid}); + my $dbh = $self->dbh; + my $statement = "delete from secondary_input where service_instance_id=?"; + + $dbh->do( $statement, undef, ($siid)); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + + +# receives argument "type", that may be either an LSID or a type term +sub query_object { + my ($self, %args) = @_; + my $type = $args{type}; + my $condition = ""; + if ($type =~ /^urn\:lsid/){ + $condition = "where object_lsid = ?"; + } elsif ($type) { + $condition = "where object_type = ?"; + } + my $statement = "select + object_id, + object_lsid, + object_type, + description, + authority, + contact_email + from object $condition"; + + my $dbh = _getDBHandle("mobyobject"); + my $result; + if ($type){ + $result = do_query($dbh, $statement, ($type)); + } else { + $result = do_query($dbh, $statement); + } + return $result; +} + +# inserts a new tuple into object table +# pass object_type object_lsid description authority contact_email +sub insert_object{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + $dbh->do("insert into object + (object_type, + object_lsid, + description, + authority, + contact_email) + values (?,?,?,?,?)", + undef, + $args{'object_type'}, + $args{'object_lsid'}, + $args{'description'}, + $args{'authority'}, + $args{'contact_email'}); + my $id=$dbh->{mysql_insertid}; + return $id; +} + +# pass 'type' which is either an LSID or a term +sub delete_object{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $term = $args{type}; + return 0 unless $term; + my $result = $self->query_object(type => $term); + my $row = shift(@$result); + my $id = $row->{object_id}; + my $lsid = $row->{object_lsid}; + my $statement = "delete from object where object_lsid = ?"; + $dbh->do( $statement,undef, ($lsid) ); + + $self->_delete_object_term2term(id => $id); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +# pass "type" here, should be an LSID, preferably... +sub query_object_term2term{ + my ($self, %args) = @_; + my $type = $args{type}; + my $result = $self->query_object(type => $type); + my $row = shift(@$result); + my $id = $row->{object_id}; + return [{}] unless $id; + my $dbh = $self->dbh; + + my $statement = "select + assertion_id, + relationship_type, + object1_id, + object2_id, + object2_articlename + from object_term2term where object2_id = ?"; + my $result2 = do_query($dbh, $statement, ($id)); + return $result2; +} + +# pass object1_type, object2_type, object2_articlename, relationship_type +sub insert_object_term2term{ + my ($self, %args) = @_; + my $type1 = $args{object1_type}; + my $result = $self->query_object(type => $type1); + my $row = shift(@$result); + my $id1 = $row->{object_id}; + my $type2 = $args{object2_type}; + $result = $self->query_object(type => $type2); + $row = shift(@$result); + my $id2 = $row->{object_id}; + my $relationship_type = $args{relationship_type}; + my $object2_articlename = $args{object2_articlename}; + + my $dbh = $self->dbh; + $dbh->do( + q{insert into object_term2term (relationship_type, object1_id, object2_id, object2_articlename) values (?,?,?,?)}, + undef, + $relationship_type, + $id1, + $id2, + $object2_articlename + ); + + return $dbh->{mysql_insertid}; +} + +# pass object 'type' as term or lsid +# this should be a private routine, not a public one. +# SHOULD NOT BE DOCUMENTED IN THE API +sub _delete_object_term2term{ + my ($self, %args) = @_; + my $o1id = $args{id}; + return 0 unless defined($o1id); + my $dbh = $self->dbh; + my $statement = "delete from object_term2term where object1_id=?"; + $dbh->do( $statement,undef, ($o1id)); + + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +# pass servicename and authority_uri +sub query_service_existence { + my ($self, %args) = @_; + my $dbh = $self->dbh; + + my $servicename = $args{'servicename'}; + my $authURI = $args{'authority_uri'}; + my $result = $self->_query_authority(authority_uri => $authURI); + return 0 unless @$result[0]; + my $id = @$result[0]->{authority_id}; + return 0 unless $id; + my $statement = "select + service_instance_id, + category, + servicename, + service_type_uri, + authority_id, + url, + contact_email, + authoritative, + description, + signatureURL, + lsid + from service_instance where servicename = ? and authority_id = ?"; + my $final = do_query($dbh, $statement, ($servicename, $id)); + if (@$final[0]){return 1} else {return 0} + +} +# selects all the columns from service_instance table +# PAY ATTENTION to what this returns. Not auth_id but auth_uri!! +# IMPORTANT: must use quotes for the keys of the hash (eg. 'authority.authority_uri' => $value ) +sub query_service_instance { + my ($self, %args) = @_; + my $dbh = $self->dbh; + + my @args; + while (my ($k, $v) = each %args){ + push @args, ({$k => $v}, "and"); # format for the_add_condition subroutine + # but too bad won't be scalable for "or" + } + + if (keys(%args)){ pop @args;} # remove final "and" + + my $statement = "select + service_instance_id, + category, + servicename, + service_type_uri, + authority.authority_uri, + url, + service_instance.contact_email, + authoritative, + description, + signatureURL, + lsid + from service_instance, authority "; + my @bindvalues; + ($statement, @bindvalues) =_add_condition($statement, @args); + if (keys(%args)){ + $statement .= " and authority.authority_id = service_instance.authority_id"; + } else { + $statement .= " where authority.authority_id = service_instance.authority_id"; + } + my $final = do_query($dbh, $statement, @bindvalues); + return $final; +} + +# custom query for Moby::Central.pm->findService() +# hmmmmmmm.... I'm not sure that this routine should exist... +# it is redundant to the routine above, if the routine above were executed +# multiple times. I think that is the more correct (though less efficient) +# way to go, since it is "scalable" to every possible underlying data source +# ********FIX change this later... +sub match_service_type_uri{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $uri_list = $args{'service_type_uri'}; + my $statement = "select service_instance_id,category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid from service_instance where service_type_uri in ($uri_list)"; + my @bindvalues = (); + my $result = do_query($dbh, $statement, @bindvalues); + return $result; +} + +# passs........ blah blah..... +sub insert_service_instance { + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $authority_id; + if ($args{'authority_uri'}){ # need to transform URI to a row ID + my $result = $self->_query_authority(authority_uri => $args{'authority_uri'}); + return undef unless @$result[0]; + $authority_id = @$result[0]->{authority_id}; + return undef unless $authority_id; + } + + $dbh->do(q{insert into service_instance (category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid) values (?,?,?,?,?,?,?,?,?,?)}, + undef,( + $args{'category'}, + $args{'servicename'}, + $args{'service_type_uri'}, + $authority_id, + $args{'url'}, + $args{'contact_email'}, + $args{'authoritative'}, + $args{'description'}, + $args{'signatureURL'}, + $args{'lsid'})); + + my $id = $dbh->{mysql_insertid}; + return $id; +} + +# pass service_instance_lsid +sub delete_service_instance{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $statement = "delete from service_instance where lsid = ?"; + $dbh->do( $statement,undef, ($args{service_instance_lsid}) ); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +# Selects all columns EXCEPT authority_id +# pass authority_uri +sub query_authority { + my ($self, %args) = @_; + my $authURI = $args{authority_uri}; + my $dbh = $self->dbh; + + my $statement = "select + authority_common_name, + authority_uri, + contact_email + from authority where authority_uri = ?"; + my $result = do_query($dbh, $statement, ($authURI)); + return $result; +} + +# Selects all columns including authority_id +# pass authority_uri. NOTE THAT THIS IS A PRIVATE ROUTINE +# SHOULD NOT BE DOCUMENTED IN THE API +sub _query_authority { + my ($self, %args) = @_; + my $authURI = $args{authority_uri}; + my $dbh = $self->dbh; + + my $statement = "select + authority_common_name, + authority_uri, + authority_id, + contact_email + from authority where authority_uri = ?"; + my $result = do_query($dbh, $statement, ($authURI)); + return $result; +} + +# custom query routine used in Moby::Central.pm -> retrieveServiceProviders() +# no args passed +sub get_all_authorities{ + my ($self, @args) = @_; + my $dbh = $self->dbh; + my $statement = "select distinct authority_uri from authority"; + my @bindvalues = (); + my $result = do_query($dbh, $statement, @bindvalues); + return $result; +} + +# pass authority_common_name, authority_uri, contact_email, return ID of some sort +sub insert_authority{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + $dbh->do("insert into authority + (authority_common_name, + authority_uri, + contact_email) + values (?,?,?)", + undef, + ($args{'authority_common_name'}, + $args{'authority_uri'}, + $args{'contact_email'})); + my $id = $dbh->{mysql_insertid}; + return $id; +} + +# pass service_type, as term or LSID +sub query_service{ + my ($self, %args) = @_; + my $type = $args{type}; + my $condition = ""; + if ($type =~ /^urn\:lsid/){ + $condition = "where service_lsid = ?"; + } elsif ($type) { + $condition = "where service_type = ?"; + } else { + $condition = ""; + } + + my $dbh = _getDBHandle("mobyservice"); + + my $statement = "select + service_id, + service_lsid, + service_type, + description, + authority, + contact_email + from service $condition"; + my $result; + if ($type){ + $result = do_query($dbh, $statement, ($type)); + } else { + $result = do_query($dbh, $statement); + } + return $result; +} + +# pass in .... +sub insert_service{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + $dbh->do(q{insert into service (service_type, service_lsid, description, authority, contact_email) values (?,?,?,?,?)}, + undef, + ( + $args{'service_type'}, $args{'service_lsid'}, $args{'description'}, + $args{'authority'}, $args{'contact_email'} + ) + ); + return $dbh->{mysql_insertid}; +} + +# pass in 'type' as a term or lsid +sub delete_service{ + my ($self, %args) = @_; + my $type = $args{type}; + my $result = $self->query_service(type => $type); + my $row = shift(@$result); + my $id = $row->{service_id}; + my $lsid = $row->{service_lsid}; + return 0 unless $lsid; + my $dbh = $self->dbh; + my $statement = "delete from service where service_lsid = ?"; + $dbh->do( $statement, undef, ($lsid)); + $self->_delete_service_term2term(id => $id); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +sub query_service_term2term{ + my ($self, %args) = @_; + my $type = $args{type}; + my $result = $self->query_service(type => $type); + my $row = shift(@$result); + my $id = $row->{service_id}; + return [{}] unless $id; + my $dbh = $self->dbh; + + my $statement = "select + assertion_id, + relationship_type, + service1_id, + service2_id + from service_term2term where service2_id = ?"; + my $result2 = do_query($dbh, $statement, ($id)); + return $result2; +} + +#pass relationshiptype, servce1_type, service2_type +sub insert_service_term2term{ + my ($self, %args) = @_; + my $type1 = $args{service1_type}; + my $result = $self->query_service(type => $type1); + my $row = shift(@$result); + my $id1 = $row->{service_id}; + my $type2 = $args{service2_type}; + $result = $self->query_service(type => $type2); + $row = shift(@$result); + my $id2 = $row->{service_id}; + my $relationship_type = $args{relationship_type}; + + my $dbh = $self->dbh; + $dbh->do(q{insert into service_term2term (relationship_type, service1_id, service2_id) values (?,?,?)}, + undef, + ($relationship_type, + $id1, + $id2) + ); + + return $dbh->{mysql_insertid}; +} + + +# NOTE THAT THIS IS A PRIVATE FUNCTION AND SHOULD +# NOT BE DOCUMENTED IN THE API. +sub _delete_service_term2term{ + my ($self, %args) = @_; + my $id = $args{id}; + return 0 unless (defined($id)); + my $dbh = $self->dbh; + my $statement = "delete from service_term2term where service1_id=?"; + $dbh->do( $statement,undef, ($id)); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + + +sub query_relationship{ + my ($self, %args) = @_; + my $type = $args{type} || ""; +# return [{}] unless $type; + my $condition = ""; + if ($type =~ /^urn\:lsid/){ + $condition = " relationship_lsid = ? and "; + } elsif ($type) { + $condition = " relationship_type = ? and "; + } + my $ont = $args{ontology}; + + my $dbh = $self->dbh; + + my $statement = "select + relationship_id, + relationship_lsid, + relationship_type, + container, + description, + authority, + contact_email, + ontology + from relationship where $condition ontology = ?"; + + if ($type){ + return do_query($dbh, $statement, ($type, $ont)); + } else { + return do_query($dbh, $statement, ($ont)); + } +} + +sub query_namespace{ + my ($self, %args) = @_; + my $type = $args{type}; + my $condition = ""; + if ($type =~ /^urn\:lsid/){ + $condition = " where namespace_lsid = ?"; + } elsif ($type) { + $condition = " where namespace_type = ?"; + } else { + $condition = ""; + } + + my $dbh = _getDBHandle("mobynamespace"); + + my $statement = "select + namespace_id, + namespace_lsid, + namespace_type, + description, + authority, + contact_email + from namespace $condition"; + my $result; + if ($type){ + $result = do_query($dbh, $statement, ($type)); + } else { + $result = do_query($dbh, $statement); + } + return $result; +} + + +sub insert_namespace{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + $dbh->do(q{insert into namespace (namespace_type, namespace_lsid, description, authority,contact_email) values (?,?,?,?,?)}, + undef, + ( + $args{'namespace_type'}, $args{'namespace_lsid'},$args{'description'},$args{'authority'},$args{'contact_email'} + ) + ); + return $dbh->{mysql_insertid}; +} + +# pass namesapce_lsid +sub delete_namespace{ + my ($self, %args) = @_; + my $type = $args{type}; + my $result = $self->query_namespace(type => $type); + my $row = shift(@$result); + my $id = $row->{namespace_id}; + my $lsid = $row->{namespace_lsid}; + return 0 unless $lsid; + my $dbh = $self->dbh; + my $statement = "delete from namespace where namespace_lsid = ?"; + $dbh->do( $statement, undef, ($lsid)); + $self->_delete_namespace_term2term(id => $id); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} + +sub query_namespace_term2term{ + my ($self, %args) = @_; + my $type = $args{type}; + my $result = $self->query_namespace(type => $type); + my $row = shift(@$result); + my $id = $row->{namespace_id}; + return [{}] unless $id; + my $dbh = $self->dbh; + + my $statement = "select + assertion_id, + relationship_type, + namespace1_id, + namespace2_id + from namespace_term2term where namespace2_id = ?"; + my $result2 = do_query($dbh, $statement, ($id)); + return $result2; +} + +# PRIVATE, NOT PART OF API! +sub _delete_namespace_term2term{ + my ($self, %args) = @_; + my $id = $args{id}; + return 0 unless defined($id); + my $dbh = $self->dbh; + my $statement = "delete from namespace_term2term where namespace1_id=?"; + $dbh->do( $statement,undef, ($id)); + if ($dbh->err){ + return (1, $dbh->errstr); + } + else{ + return 0; + } +} +# pass type as LSID or term +sub check_object_usage{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $errorMsg = 1; + my $type = $args{type}; + return 0 unless $type; + my $result = $self->query_object(type => $type); + my $row = shift @$result; + my $lsid = $row->{object_lsid}; + + my ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join simple_input where object_type_uri = ?}, + undef, $lsid + ); + return $errorMsg + if ($id); + + ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join simple_output where object_type_uri = ?}, + undef, $lsid + ); + return $errorMsg + if ($id); + + ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join collection_input natural join simple_input where object_type_uri = ?}, + undef, $lsid + ); + return $errorMsg + if ($id); + + ($id) = $dbh->selectrow_array(q{select service_instance.service_instance_id from service_instance natural join collection_output natural join simple_output where object_type_uri = ?}, + undef, $lsid + ); + return $errorMsg + if ($id); + + return 0; +} + +# custom query routine for Moby::Central.pm -> deregisterNamespace() +sub check_namespace_usage{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $errorMsg = 1; + my $type = $args{type}; + return 0 unless $type; + my $result = $self->query_namespace(type => $type); + my $row = shift @$result; + my $lsid = $row->{namespace_lsid}; + + my $sth = $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join simple_input where INSTR(namespace_type_uris,'$lsid')" + ); + $sth->execute; + + while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { + my @nss = split ",", $ns; + foreach (@nss) { + $_ =~ s/\s//g; + my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; + return (1, $errstr) + if ( $_ eq $lsid ); + } + } + $sth = $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join simple_output where INSTR(namespace_type_uris,'$lsid')" + ); + $sth->execute; + while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { + my @nss = split ",", $ns; + foreach (@nss) { + $_ =~ s/\s//g; + my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; + return (1, $errstr) + if ( $_ eq $lsid ); + } + } + $sth = + $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join collection_input natural join simple_input where INSTR(namespace_type_uris, '$lsid')" + ); + $sth->execute; + while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { + my @nss = split ",", $ns; + foreach (@nss) { + $_ =~ s/\s//g; + my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; + return (1, $errstr) + if ( $_ eq $lsid ); + } + } + $sth = + $dbh->prepare("select service_instance.service_instance_id, namespace_type_uris from service_instance natural join collection_output natural join simple_output where INSTR(namespace_type_uris, '$lsid')" + ); + $sth->execute; + while ( my ( $id, $ns ) = $sth->fetchrow_array() ) { + my @nss = split ",", $ns; + foreach (@nss) { + $_ =~ s/\s//g; + my $errstr = "Namespace Type $type ($_) is used by a service (service ID number $id) and may not be deregistered"; + return (1, $errstr) + if ( $_ eq $lsid ); + } + } + return (0, ""); +} + +# custom query routine for Moby::Central.pm -> findService() +sub check_keywords{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $param = $args{keywords}; + return ([{}]) unless (ref($param) =~ /ARRAY/); + my @keywords = @$param; + #my %findme = %$param; + my $searchstring; + foreach my $kw ( @keywords ) { + $kw =~ s/\*//g; + $kw = $dbh->quote("%$kw%"); + $searchstring .= " OR description like $kw "; + } + $searchstring =~ s/OR//; # remove just the first OR in the longer statement + + my $statement = "select service_instance_id,category, servicename, service_type_uri, authority_id, url, contact_email, authoritative, description, signatureURL, lsid from service_instance where $searchstring"; + my @bindvalues = (); + + my $ids = do_query($dbh, $statement, @bindvalues); + return ($ids); +} + +# custom query subroutine for Moby::Central.pm->_searchForSimple() +sub find_by_simple{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $inout = $args{'inout'}; + my $ancestor_string = $args{'ancestor_string'}; + my $namespaceURIs = $args{'namespaceURIs'}; + + my $query ="select service_instance_id, namespace_type_uris from simple_$inout where object_type_uri in ($ancestor_string) and service_instance_id IS NOT NULL " + ; # if service_instance_id is null then it must be a collection input. + my $nsquery; + foreach my $ns ( @{$namespaceURIs} ) { # namespaces are already URI's + $nsquery .= " OR INSTR(namespace_type_uris, '$ns') "; + } + if ($nsquery) { + $nsquery =~ s/OR//; # just the first + $nsquery .= " OR namespace_type_uris IS NULL"; + $query .= " AND ($nsquery) "; + } + + my $result = do_query($dbh, $query, ()); + return $result; +} + +# custom query subroutine for Moby::Central.pm->_searchForCollection() +sub find_by_collection{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $inout = $args{'inout'}; + my $objectURI = $args{'objectURI'}; + my $namespaceURIs = $args{'namespaceURIs'}; + + my $query = "select + c.service_instance_id, + s.namespace_type_uris + from + simple_$inout as s, + collection_$inout as c + where + s.collection_${inout}_id IS NOT NULL + AND s.collection_${inout}_id = c.collection_${inout}_id + AND object_type_uri = '$objectURI' "; + my $nsquery; + foreach my $ns ( @{$namespaceURIs} ) { # namespaces are already URI's + $nsquery .= " OR INSTR(namespace_type_uris, '$ns') "; + } + if ($nsquery) { + $nsquery =~ s/^\sOR//; # just the first + $nsquery .= " OR namespace_type_uris IS NULL"; + $query .= " AND ($nsquery) "; # add the AND clause + } + + my $result = do_query($dbh, $query, ()); + return $result; +} + +# custom query subroutine for Moby::Central.pm->RetrieveServiceNames +sub get_service_names{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $statement = "select authority_uri, servicename from authority as a, service_instance as s where s.authority_id = a.authority_id"; + my @bindvalues = (); + + my $result = do_query($dbh, $statement, @bindvalues); + return $result; +} + +# custom query for Moby::Central.pm->_flatten +sub get_parent_terms{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + + my $type_id = $args{'relationship_type_id'}; + my $statement = " + select + OE1.term + from + OntologyEntry as OE1, + OntologyEntry as OE2, + Term2Term as TT + where + ontologyentry2_id = OE2.id + and ontologyentry1_id = OE1.id + and relationship_type_id = $type_id + and OE2.term = ?"; + + my @bindvalues = (); + push(@bindvalues, $args{'term'}); + + my $result = do_query($dbh, $statement, @bindvalues); + return $result; +} + +# custom query subroutine for selecting from object_term2term and object tables +# used in Moby::OntologyServer.pm->retrieveObject() +sub get_object_relationships{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $type = $args{type}; + return 0 unless $type; + my $result = $self->query_object(type => $type); + my $row = shift @$result; + my $id = $row->{object_id}; + + my $statement = "select + relationship_type, + object_type, + object_lsid, + description, + authority, + contact_email, + object2_articlename + from object_term2term, object + where object1_id = ? and object2_id = object_id"; + + my $result2 = do_query($dbh, $statement, ($id)); + return $result2; +} + +# relationship query for any table used in Moby::OntologyServer->_doRelationshipQuery() +# note: returns a reference to an array containing ARRAY references +sub get_relationship{ + my ($self, %args) = @_; + my $dbh = $self->dbh; + my $direction = $args{'direction'}; + my $ontology = $args{'ontology'}; + my $relationship = $args{'relationship'}; # this is assumed to be an LSID + + my $type = $args{'term'}; + return 0 unless $type; + my $lsid; + if ($ontology eq "service"){ + my $result = $self->query_service(type => $type); + my $row = shift @$result; + $lsid = $row->{service_lsid}; + } else { + my $result = $self->query_object(type => $type); + my $row = shift @$result; + $lsid = $row->{object_lsid}; + } + my $defs; + my $extra_columns; + $extra_columns = ", relationship_type "; + if ($ontology eq "object"){$extra_columns .=", object2_articlename ";} + if ( $direction eq 'root' ) { + unless ( defined $relationship ) { + $defs = $self->dbh->selectall_arrayref( " + select distinct s2.${ontology}_lsid $extra_columns from + ${ontology}_term2term as t2t, + $ontology as s1, + $ontology as s2 + where + s1.${ontology}_id = t2t.${ontology}1_id and + s2.${ontology}_id = t2t.${ontology}2_id and + s1.${ontology}_lsid = ?", undef, $lsid ); # ") + } else { + $defs = $self->dbh->selectall_arrayref( " + select distinct s2.${ontology}_lsid $extra_columns from + ${ontology}_term2term as t2t, + $ontology as s1, + $ontology as s2 + where + relationship_type = ? and + s1.${ontology}_id = t2t.${ontology}1_id and + s2.${ontology}_id = t2t.${ontology}2_id and + s1.${ontology}_lsid = ?", undef, $relationship, $lsid ); # ") + } + } else { + unless ( defined $relationship ) { + $defs = $self->dbh->selectall_arrayref( " + select distinct s2.${ontology}_lsid $extra_columns from + ${ontology}_term2term as t2t, + $ontology as s1, + $ontology as s2 + where + s1.${ontology}_id = t2t.${ontology}1_id and + s2.${ontology}_id = t2t.${ontology}2_id and + s2.${ontology}_lsid = ?", undef, $lsid); # ") + } else { + $defs = $self->dbh->selectall_arrayref( " + select distinct s2.${ontology}_lsid $extra_columns from + ${ontology}_term2term as t2t, + $ontology as s1, + $ontology as s2 + where + relationship_type = ? and + s1.${ontology}_id = t2t.${ontology}1_id and + s2.${ontology}_id = t2t.${ontology}2_id and + s2.${ontology}_lsid = ?", undef, $relationship, $lsid ); # ") + } + } + return $defs; +} + +sub _checkURI { + +# my $uri = "http://www.ics.uci.edu/pub/ietf/uri/#Related"; +#print "$1, $2, $3, $4, $5, $6, $7, $8, $9" if +# $uri =~ m{^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?}; +# +#The license for this recipe is available here. +# +#Discussion: +# +#If the match is successful, a URL such as +# +#http://www.ics.uci.edu/pub/ietf/uri/#Related +# +#will be broken down into the following group match variables: +# +#$1 = http: +#$2 = http +#$3 = //www.ics.uci.edu +#$4 = www.ics.uci.edu +#$5 = /pub/ietf/uri/ +#$6 = +#$7 = +#$8 = #Related +#$9 = Related +# +#In general, this regular expression breaks a URI down into the following parts, +#as defined in the RFC: +# +#scheme = $2 +#authority = $4 +#path = $5 +#query = $7 +#fragment = $9 + +} + +sub DESTROY {} + +1; From fgibbons at pub.open-bio.org Thu Sep 15 14:09:44 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Thu, 15 Sep 2005 10:09:44 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509151409.j8FE9iGI019624@pub.open-bio.org> fgibbons Thu Sep 15 10:09:44 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory pub.open-bio.org:/tmp/cvs-serv19603 Added Files: RFC.html Log Message: - How to we handle changes to the API (RFCs) moby-live/Docs/MOBY-S_API RFC.html,NONE,1.1 From gss at pub.open-bio.org Wed Sep 14 22:05:49 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:05:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142205.j8EM5nii016998@pub.open-bio.org> gss Wed Sep 14 18:05:48 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core In directory pub.open-bio.org:/tmp/cvs-serv16973 Modified Files: .cvsignore Log Message: More to ignore moby-live/S-MOBY/ref-impl/core .cvsignore,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.cvsignore,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.cvsignore 2005/03/21 21:32:01 1.7 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/.cvsignore 2005/09/14 22:05:48 1.8 @@ -1,3 +1,4 @@ classes .classpath .project +.settings From gss at pub.open-bio.org Wed Sep 14 22:06:10 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:10 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6ADW017093@pub.open-bio.org> gss Wed Sep 14 18:06:10 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph In directory pub.open-bio.org:/tmp/cvs-serv17011/src/org/semanticmoby/graph Modified Files: MOBYCollection.java MOBYSubject.java MOBYGraphNode.java MOBYOrderedCollection.java MOBYResizableCollection.java MOBYEnumeration.java MOBYFixedCollection.java MOBYObject.java MOBYGraph.java MOBYMappingElement.java MOBYUnorderedCollection.java Added Files: MOBYServiceSet.java MOBYPropValStmt.java CollectionWrapper.java ContainerWrapper.java MOBYService.java ListWrapper.java Removed Files: MOBYPropertyValueConstraint.java MOBYProviderSet.java MOBYDescriptor.java MOBYDocument.java MOBYOntology.java MOBYNonPositiveIntegerConstraint.java MOBYPropertyValue.java MOBYDateConstraint.java MOBYSingleElement.java MOBYIntegerConstraint.java MOBYNonNegativeIntegerConstraint.java MOBYProvider.java MOBYPropertyValueStatement.java MOBYNumericConstraint.java MOBYLiteral.java MOBYPropertyValueException.java MOBYResource.java Log Message: Major API overhaul moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph MOBYServiceSet.java,NONE,1.1 MOBYPropValStmt.java,NONE,1.1 CollectionWrapper.java,NONE,1.1 ContainerWrapper.java,NONE,1.1 MOBYService.java,NONE,1.1 ListWrapper.java,NONE,1.1 MOBYCollection.java,1.2,1.3 MOBYSubject.java,1.2,1.3 MOBYGraphNode.java,1.2,1.3 MOBYOrderedCollection.java,1.2,1.3 MOBYResizableCollection.java,1.2,1.3 MOBYEnumeration.java,1.2,1.3 MOBYFixedCollection.java,1.2,1.3 MOBYObject.java,1.2,1.3 MOBYGraph.java,1.1,1.2 MOBYMappingElement.java,1.2,1.3 MOBYUnorderedCollection.java,1.2,1.3 MOBYPropertyValueConstraint.java,1.1,NONE MOBYProviderSet.java,1.2,NONE MOBYDescriptor.java,1.2,NONE MOBYDocument.java,1.2,NONE MOBYOntology.java,1.2,NONE MOBYNonPositiveIntegerConstraint.java,1.1,NONE MOBYPropertyValue.java,1.1,NONE MOBYDateConstraint.java,1.1,NONE MOBYSingleElement.java,1.2,NONE MOBYIntegerConstraint.java,1.1,NONE MOBYNonNegativeIntegerConstraint.java,1.1,NONE MOBYProvider.java,1.2,NONE MOBYPropertyValueS! tatement.java,1.1,NONE MOBYNumericConstraint.java,1.1,NONE MOBYLiteral.java,1.1,NONE MOBYPropertyValueException.java,1.1,NONE MOBYResource.java,1.1,NONE =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYCollection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYCollection.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYCollection.java 2005/09/14 22:06:10 1.3 @@ -3,6 +3,7 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.util.iterator.ExtendedIterator; /** * A common abstract class for collections, both fixed sized and @@ -10,54 +11,61 @@ */ public abstract class MOBYCollection extends MOBYGraphNode { - /** - * A list to hold the elements of the collection - */ - protected List elements = new ArrayList(); + protected CollectionWrapper wrapper; /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements + * Creates an instance for the given model and defining statement */ - public MOBYCollection(List initialElements, Resource resource, - Model model) - { - super(resource, model); + public MOBYCollection(Model jenaModel, Statement definingStmt, + CollectionWrapper wrapper, List items) { + super(jenaModel, definingStmt); + this.wrapper = wrapper; - if (initialElements != null) { - elements.addAll(initialElements); + for (Iterator it = items.iterator(); it.hasNext();) + { + MOBYGraphNode node = (MOBYGraphNode) it.next(); + wrapper.add(node); } } /** - * Return the size of the collection. + * Returns the size of the collection. */ public int size() { - return elements.size(); + return wrapper.size(); } - + /** - * Return an iterator for traversing the elements + * Returns an iterator for traversing the elements */ - public Iterator iterator() + public ExtendedIterator iterator() { - return elements.iterator(); + return wrapper.iterator(); } - /** - * Return whether or not this object is a collection. - */ - public boolean isCollection() + public void add(MOBYGraphNode node) { - return true; + wrapper.add(node); } + /** - * Return whether or not this object is a singular element. + * Remove from the model all statements that make up this API object. + * This includes the defining statement (bnode rdf:type rdf:List), the + * statements that make up each of the nested API objects, and the + * statements that make this an RDF List, which are encapsulated in + * the Jena RDFList object. */ - public boolean isSingular() + public void removeStatements() { - return false; + ExtendedIterator it = wrapper.iterator(); + while (it.hasNext()) + { + MOBYGraphNode node = (MOBYGraphNode) it.next(); + node.removeStatements(); + } + it.close(); + wrapper.removeStatements(); } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYSubject.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYSubject.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYSubject.java 2005/09/14 22:06:10 1.3 @@ -1,12 +1,19 @@ package org.semanticmoby.graph; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + import org.semanticmoby.graph.*; +import org.semanticmoby.vocabulary.MOBY; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.Resource; +import com.hp.hpl.jena.rdf.model.Statement; +import com.hp.hpl.jena.vocabulary.RDF; /** - * An object that represents the subject of one or more mappings. In + * A class that represents the subject of one or more mappings. In * RDF graph terms, this represents a node (either blank or a resource) * that is a moby:Subject, an RDF data structure (List, Bag, Seq, Alt), * or both. @@ -23,24 +30,87 @@ { /** * The collection of direct mappings, i.e. moby:mapsTo statements - * whose subject is this. + * whose subject is this; keyed by the mapsTo statement. */ - private MOBYUnorderedCollection directMappings; + private Map directMappingStmts; - public MOBYSubject(Resource resource, MOBYFixedCollection statements, - MOBYUnorderedCollection directMappings, - MOBYCollection nestedMappings, Model underlying) + /** + * Creates an instance with the given parameters; should be called from + * parsing code. + */ + public MOBYSubject(Model jenaModel, Statement definingStmt, List propValStmts, + Map directMappingStmts, MOBYCollection nestedMappings) { - super(resource, statements, nestedMappings, underlying); - this.directMappings = directMappings; + super(jenaModel, definingStmt, propValStmts, nestedMappings); + this.directMappingStmts = directMappingStmts; } - + + /** + * Creates an instance with the given parameters; should be called + * when creating an instance from scratch (i.e. not from parsing). + */ + public MOBYSubject(Model jenaModel, Resource head, List propValStmts, + List directMappings, MOBYCollection nestedMappings) + { + super(jenaModel, + jenaModel.createStatement(head, RDF.type, MOBY.Subject), + propValStmts, nestedMappings); + + for (Iterator it = directMappings.iterator(); it.hasNext();) + { + MOBYGraphNode node = (MOBYGraphNode) it.next(); + addDirectMapping(node); + } + } + + /** + * Add the given node to the direct mappings, and add a mapsTo + * statement to the underlying model + */ + public void addDirectMapping(MOBYGraphNode node) + { + this.directMappingStmts.put( + node, + jenaModel.createStatement( + getResource(), MOBY.mapsTo, node.getResource())); + } + + /** + * Remove the given node from the direct mappings and remove the + * underlying RDF statements from the Jena model + */ + public void removeDirectMapping(MOBYGraphNode node) + { + Statement stmt = (Statement) directMappingStmts.get(node); + if (stmt != null) { + jenaModel.remove(stmt); + } + node.removeStatements(); + } + /** - * Return the collection of direct mappings, i.e. moby:mapsTo statements - * whose subject is this. + * Return an iterator over the direct mappings + */ + public Iterator getDirectMappings() + { + return directMappingStmts.keySet().iterator(); + } + + /* + * (non-Javadoc) + * @see org.semanticmoby.graph.MOBYGraphNode#removeStatements() */ - public MOBYUnorderedCollection getDirectMappings() + public void removeStatements() { - return directMappings; + super.removeStatements(); + if (directMappingStmts != null) + { + for (Iterator it = directMappingStmts.keySet().iterator(); it.hasNext();) + { + MOBYGraphNode node = (MOBYGraphNode) it.next(); + removeDirectMapping(node); + } + directMappingStmts = null; + } } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraphNode.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraphNode.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraphNode.java 2005/09/14 22:06:10 1.3 @@ -3,31 +3,88 @@ import com.hp.hpl.jena.rdf.model.*; /** - * An abstract class for nodes in an RDF graph; these nodes are either - * collections or singular elements. + * An abstract class for representing parts of a MOBY graph structure. */ -public abstract class MOBYGraphNode extends MOBYDescriptor +public abstract class MOBYGraphNode { - public MOBYGraphNode(Resource resource, Model model) + /** + * The underlying Jena model that holds the statements for this + * graph component + */ + protected Model jenaModel; + + /** + * Graph nodes all have an rdf:type statement that makes them what they + * are, with the exception of MOBYMappingElement instances, which can at + * times have no defining statement (see the discussion in the class + * documentation for MOBYMappingElement). + */ + protected Statement definingStmt; + + /** + * Creates an instance for the given model and defining statement + */ + protected MOBYGraphNode(Model jenaModel, Statement definingStmt) { - super(resource, model); + this.jenaModel = jenaModel; + this.definingStmt = definingStmt; + + if (definingStmt != null) { + jenaModel.add(definingStmt); + } } - + /** - * Return whether or not this node represents a blank node + * Returns the model that holds statements describing this component */ - public boolean isBlank() + public Model getJenaModel() { - return (resource == null) || (resource.getURI() == null); + return jenaModel; } /** - * Return whether or not this object is a collection. + * Returns the defining statement for this component */ - public abstract boolean isCollection(); + public Statement getDefiningStmt() + { + return definingStmt; + } /** - * Return whether or not this object is a singular element. + * Returns the resource that is the subject of the defining statement + * if it has one, else returns null; */ - public abstract boolean isSingular(); + public Resource getResource() + { + return (definingStmt == null) ? null : definingStmt.getSubject(); + } + + /** + * Removes the statements representing this component; subclasses should + * also call removeDefiningStatement() and call removeStatements() on all + * MOBYGraphNode instances nested within them. + */ + public abstract void removeStatements(); + + /** + * Removes and nulls out the defining statement if it has not already + * been removed and nulled out. + */ + protected void removeDefiningStatement() + { + if (definingStmt != null) + { + jenaModel.remove(definingStmt); + definingStmt = null; + } + } + + /** + * Returns the URI of the underlying resource if there is a defining + * statement, else returns null. + */ + public String getURI() + { + return (getResource() == null) ? null : getResource().getURI(); + } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYOrderedCollection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYOrderedCollection.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYOrderedCollection.java 2005/09/14 22:06:10 1.3 @@ -3,6 +3,7 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.vocabulary.RDF; /** * A class representing collections that can be resized (i.e. @@ -12,47 +13,24 @@ public class MOBYOrderedCollection extends MOBYResizableCollection { /** - * Create an instance with no elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Constructor for creating a fixed collection API object from scratch. */ - public MOBYOrderedCollection(Resource resource, - Model underlyingJenaModel) + public MOBYOrderedCollection(Model jenaModel, Resource head, List items) { - super(null, resource, underlyingJenaModel); + super(jenaModel, + jenaModel.createStatement(head, RDF.type, RDF.Seq), + new ContainerWrapper((Seq) head.as(Seq.class)), items); } /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Create an instance with the list of items */ - public MOBYOrderedCollection(List initialElements, Resource resource, - Model underlyingJenaModel) + public MOBYOrderedCollection(Model jenaModel, Statement definingStmt, + List items) { - super(initialElements, resource, underlyingJenaModel); - } - - /** - * Return the element at the given index - * @param index the zero-based index of the element to retrieve - * @return the element - */ - public Object get(int index) - { - return elements.get(index); - } - - /** - * Add the given element to the collection so that its new - * zero-based index is given index - * @param index the zero-based index at which the new element - * should be added - * @param elementToAdd the element to add - */ - public void add(int index, Object elementToAdd) - { - elements.add(index, elementToAdd); + super(jenaModel, + definingStmt, + new ContainerWrapper((Seq) definingStmt.getSubject().as(Seq.class)), + items); } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYResizableCollection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYResizableCollection.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYResizableCollection.java 2005/09/14 22:06:10 1.3 @@ -3,59 +3,23 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.util.iterator.ExtendedIterator; +import com.hp.hpl.jena.vocabulary.RDF; /** * A class representing collections that can be resized (i.e. * elements added to or removed from); such collections can be - * either ordered or unordered. + * either ordered or unordered. This corresponds to the three + * RDF container classes, namely Bag, Seq, and Alt. */ public abstract class MOBYResizableCollection extends MOBYCollection { /** - * Create an instance with no elements - * @param resource the resource node that represents this collection - * @param model the Jena model from which this is derived + * Constructor for creating a resizable collection API object from scratch. */ - public MOBYResizableCollection(Resource resource, Model model) + public MOBYResizableCollection(Model jenaModel, Statement definingStmt, + CollectionWrapper wrapper, List items) { - super(null, resource, model); - } - - /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored - */ - public MOBYResizableCollection(List initialElements, Resource resource, - Model underlyingJenaModel) - { - super(initialElements, resource, underlyingJenaModel); - } - - /** - * Add an element to the collection - * @param elementToAdd the element to add to the collection - */ - public void add(Object elementToAdd) - { - elements.add(elementToAdd); - } - - /** - * Remove an element from the collection - * @param elementToRemove the element to remove - */ - public void remove(Object elementToRemove) - { - elements.remove(elementToRemove); - } - - /** - * Remove all the elements from the collection - */ - public void clear() - { - elements.clear(); + super(jenaModel, definingStmt, wrapper, items); } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYEnumeration.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYEnumeration.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYEnumeration.java 2005/09/14 22:06:10 1.3 @@ -3,6 +3,7 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.vocabulary.RDF; /** * A class representing collections that can be resized (i.e. @@ -14,25 +15,24 @@ public class MOBYEnumeration extends MOBYUnorderedCollection { /** - * Create an instance with no elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Constructor for creating a fixed collection API object from scratch. */ - public MOBYEnumeration(Resource resource, - Model underlyingJenaModel) + public MOBYEnumeration(Model jenaModel, Resource head, List items) { - super(null, resource, underlyingJenaModel); + super(jenaModel, + jenaModel.createStatement(head, RDF.type, RDF.Alt), + new ContainerWrapper((Alt) head.as(Alt.class)), items); } /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Create an instance with the list of items */ - public MOBYEnumeration(List initialElements, Resource resource, - Model underlyingJenaModel) + public MOBYEnumeration(Model jenaModel, Statement definingStmt, + List items) { - super(initialElements, resource, underlyingJenaModel); + super(jenaModel, + definingStmt, + new ContainerWrapper((Alt) definingStmt.getSubject().as(Alt.class)), + items); } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYFixedCollection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYFixedCollection.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYFixedCollection.java 2005/09/14 22:06:10 1.3 @@ -3,32 +3,34 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.util.iterator.ExtendedIterator; +import com.hp.hpl.jena.vocabulary.RDF; /** - * A class for holding an ordered, fixed sized collection - * of objects; corresponds to an RDF List. + * A class for holding an ordered, fixed sized collection of API objects + * (subclasses of MOBYGraphNode); corresponds to an RDF List. */ public class MOBYFixedCollection extends MOBYCollection { /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements - * @param resource the resource node that represents this collection - * @param model the Jena model from which this is derived + * Constructor for creating a fixed collection API object from scratch. */ - public MOBYFixedCollection(List initialElements, Resource resource, - Model model) + public MOBYFixedCollection(Model jenaModel, Resource head, List items) { - super(initialElements, resource, model); + super(jenaModel, + jenaModel.createStatement(head, RDF.type, RDF.List), + new ListWrapper((RDFList) head.as(RDFList.class)), items); } /** - * Return the element at the given index - * @param index the zero-based index of the element to retrieve - * @return the element + * Create an instance with the list of items */ - public Object get(int index) + public MOBYFixedCollection(Model jenaModel, Statement definingStmt, + List items) { - return elements.get(index); + super(jenaModel, + definingStmt, + new ListWrapper((RDFList) definingStmt.getSubject().as(RDFList.class)), + items); } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYObject.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYObject.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYObject.java 2005/09/14 22:06:10 1.3 @@ -1,16 +1,44 @@ package org.semanticmoby.graph; +import java.util.List; + +import org.semanticmoby.vocabulary.MOBY; + import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.vocabulary.RDF; /** - * An object that represents the object of a mapping. + * A class that represents the object of one or more mappings. In + * RDF graph terms, this represents a node (either blank or a resource) + * that is a moby:Subject, an RDF data structure (List, Bag, Seq, Alt), + * or both. + *

            + * As an RDF data structure, it can have one or more elements, each + * of which can itself be either a moby:Object, an RDF data structure, + * or both. This collection of elements is returned by getNestedMappings(). */ public class MOBYObject extends MOBYMappingElement { - public MOBYObject(Resource resource, MOBYFixedCollection statements, - MOBYCollection nestedElements, Model underlying) + /** + * Creates an instance with the given parameters; should be called from + * parsing code. + */ + public MOBYObject(Model jenaModel, Statement definingStmt, + List propValStmts, MOBYCollection nestedMappings) + { + super(jenaModel, definingStmt, propValStmts, nestedMappings); + } + + /** + * Creates an instance with the given parameters; should be called + * when creating an instance from scratch (i.e. not from parsing). + */ + public MOBYObject(Model jenaModel, Resource head, List propValStmts, + MOBYCollection nestedMappings) { - super(resource, statements, nestedElements, underlying); + super(jenaModel, + jenaModel.createStatement(head, RDF.type, MOBY.Object), + propValStmts, nestedMappings); } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraph.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraph.java 2004/11/23 00:18:46 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYGraph.java 2005/09/14 22:06:10 1.2 @@ -1,26 +1,105 @@ package org.semanticmoby.graph; +import org.semanticmoby.vocabulary.MOBY; + import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.vocabulary.RDF; /** - * This class represents singular (i.e. not collection) subgraphs - * that have a single mapping. + * This class represents a singular (i.e. not collection) subgraph + * that has a single mapping. */ -public class MOBYGraph extends MOBYSingleElement +public class MOBYGraph extends MOBYGraphNode { + /** + * Wrapper object for the underlying subgraph pointed to by a + * hasMapping property + */ private MOBYGraphNode hasMapping; - public MOBYGraph(Resource resource, MOBYGraphNode hasMapping, Model underlying) + /** + * The statement that asserts that this graph has the mapping wrapped + * by the hasMapping instance variable + */ + private Statement hasMappingStmt; + + /** + * Creates an instance for the given model, defining statement, + * hasMapping statement, and MOBYGraphNode that was parsed from + * the value of the hasMapping statement + */ + public MOBYGraph(Model jenaModel, Statement definingStmt, + Statement hasMappingStmt, MOBYGraphNode hasMapping) { - super(resource, underlying); + super(jenaModel, definingStmt); + this.hasMappingStmt = hasMappingStmt; this.hasMapping = hasMapping; } + + /** + * Creates an instance from scratch + */ + public MOBYGraph(Model jenaModel) + { + super(jenaModel, + jenaModel.createStatement( + jenaModel.createResource(), RDF.type, MOBY.Graph)); + } + + /** + * Creates an instance from scratch, and includes an initial mapping + */ + public MOBYGraph(Model jenaModel, MOBYGraphNode hasMapping) + { + this(jenaModel); + setHasMapping(hasMapping); + } + + /** + * Sets the value of a hasMapping instance variable, and adds a hasMapping + * statement to the underlying model. + */ + public void setHasMapping(MOBYGraphNode hasMapping) + { + removeHasMapping(); + this.hasMapping = hasMapping; + hasMappingStmt = jenaModel.createStatement( + getResource(), MOBY.hasMapping, hasMapping.getResource()); + jenaModel.add(hasMappingStmt); + } + + /** + * Removes the hasMapping statement from the underlying model and nulls + * the hasMapping instance variable + */ + public void removeHasMapping() + { + if (hasMapping != null) + { + jenaModel.remove(hasMappingStmt); + hasMappingStmt = null; + hasMapping.removeStatements(); + hasMapping = null; + } + } /** - * Return the object of this graph's hasMapping property. + * Returns the object of this graph's hasMapping property. */ public MOBYGraphNode getHasMapping() { return hasMapping; } + + /* + * (non-Javadoc) + * @see org.semanticmoby.graph.MOBYGraphNode#removeStatements() + */ + public void removeStatements() + { + removeDefiningStatement(); + if (hasMapping != null) { + hasMapping.removeStatements(); + } + } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYMappingElement.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYMappingElement.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYMappingElement.java 2005/09/14 22:06:10 1.3 @@ -1,37 +1,91 @@ package org.semanticmoby.graph; - +import java.util.Iterator; +import java.util.List; import com.hp.hpl.jena.rdf.model.*; - -public class MOBYMappingElement extends MOBYSingleElement +/** + * This class represents graph nodes that are within a containing subgraph, + * which is pointed to by a hasMapping or mapsTo property. Such nodes can have + * property value setting statements (instances of MOBYPropertyValueStatement) + * associated with them. If the containing subgraph is pointed to by a + * hasMapping property, the node can optionally be an instance of moby:Subject, + * in which case its defining statement is the rdf:type statement making that + * assertion; if it is not a moby:Subject, then the defining statement is null. + * Similarly, if the containing subgraph is pointed to by a mapsTo property, + * the node can optionally be an instance of moby:Object, in which case its + * defining statement is the rdf:type statement making that assertion; if it + * is not a moby:Object, then the defining statement is null. + *

            + * Nodes represented by this class can also optionally be instances of + * collections (subclasses of MOBYCollection), in which case their collective + * nature is expressed through the nestedMappings instance variable. + */ +public abstract class MOBYMappingElement extends MOBYGraphNode { - private MOBYFixedCollection statements; - private MOBYCollection nestedElements; + /** + * Property value statements whose subjects are this node's resource + */ + private List propValStmts; - public MOBYMappingElement(Resource resource, MOBYFixedCollection statements, - MOBYCollection nestedElements, Model underlying) + /** + * A view of this node as a collection + */ + private MOBYCollection nestedMappings; + + /** + * Creates an instance with the given parameters. + */ + protected MOBYMappingElement(Model jenaModel, Statement definingStmt, + List propValStmts, MOBYCollection nestedMappings) { - super(resource, underlying); - this.statements = statements; - this.nestedElements = nestedElements; + super(jenaModel, definingStmt); + this.propValStmts = propValStmts; + this.nestedMappings = nestedMappings; } - + /** - * Return the collection of property-setting statements associated + * Returns the collection of property-setting statements associated * with this mapping element. */ - public MOBYFixedCollection getPropertyValueStatements() + public List getPropValStmts() { - return statements; + return propValStmts; } /** - * Return the collection of mappings that are nested within this + * Returns the collection of mappings that are nested within this * mapping element through its role as a data structure. */ - public MOBYCollection getNestedElements() { - return nestedElements; + public MOBYCollection getNestedMappings() + { + return nestedMappings; } - -} + + /** + * Removes the statements associated with this objects nested within + * this object. + */ + public void removeStatements() + { + removeDefiningStatement(); + if (propValStmts != null) + { + for (Iterator it = propValStmts.iterator(); it.hasNext();) + { + MOBYPropValStmt stmt = (MOBYPropValStmt) it.next(); + stmt.removeStatements(); + } + propValStmts = null; + } + if (nestedMappings != null) + { + for (Iterator it = nestedMappings.iterator(); it.hasNext();) + { + MOBYGraphNode node = (MOBYGraphNode) it.next(); + node.removeStatements(); + } + nestedMappings = null; + } + } +} \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYUnorderedCollection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYUnorderedCollection.java 2005/03/21 21:29:44 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/MOBYUnorderedCollection.java 2005/09/14 22:06:10 1.3 @@ -3,6 +3,8 @@ import java.util.*; import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.util.iterator.ExtendedIterator; +import com.hp.hpl.jena.vocabulary.RDF; /** * A class representing collections that can be resized (i.e. @@ -12,25 +14,33 @@ public class MOBYUnorderedCollection extends MOBYResizableCollection { /** - * Create an instance with no elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Constructor for creating a fixed collection API object from scratch. */ - public MOBYUnorderedCollection(Resource resource, - Model underlyingJenaModel) + public MOBYUnorderedCollection(Model jenaModel, Resource head, List items) { - super(null, resource, underlyingJenaModel); + super(jenaModel, + jenaModel.createStatement(head, RDF.type, RDF.Bag), + new ContainerWrapper((Bag) head.as(Bag.class)), items); } /** - * Create an instance with the initial list of elements - * @param initialElements the initial elements - * @param resource the resource node that represents this collection - * @param underlyingJenaModel the Jena model from which this is stored + * Create an instance with the list of items */ - public MOBYUnorderedCollection(List initialElements, Resource resource, - Model underlyingJenaModel) + public MOBYUnorderedCollection(Model jenaModel, Statement definingStmt, + List items) { - super(initialElements, resource, underlyingJenaModel); + super(jenaModel, + definingStmt, + new ContainerWrapper((Bag) definingStmt.getSubject().as(Bag.class)), + items); + } + + /** + * Constructor for creating an unordered collection API object from scratch. + */ + public MOBYUnorderedCollection(Model jenaModel, Statement definingStmt, + CollectionWrapper wrapper, List items) + { + super(jenaModel, definingStmt, wrapper, items); } } \ No newline at end of file rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYPropertyValueConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYProviderSet.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYDescriptor.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYDocument.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYOntology.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYNonPositiveIntegerConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYPropertyValue.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYDateConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYSingleElement.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYIntegerConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYNonNegativeIntegerConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYProvider.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYPropertyValueStatement.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYNumericConstraint.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYLiteral.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYPropertyValueException.java,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/graph/RCS/MOBYResource.java,v: No such file or directory From gss at pub.open-bio.org Wed Sep 14 22:06:11 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6BPu017112@pub.open-bio.org> gss Wed Sep 14 18:06:10 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser In directory pub.open-bio.org:/tmp/cvs-serv17011/src/org/semanticmoby/parser Modified Files: Parser.java Added Files: NamespaceBasedPropertyDetector.java MOBYPropertyDetector.java Log Message: Major API overhaul moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser NamespaceBasedPropertyDetector.java,NONE,1.1 MOBYPropertyDetector.java,NONE,1.1 Parser.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser/Parser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser/Parser.java 2005/03/21 21:32:38 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/parser/Parser.java 2005/09/14 22:06:10 1.3 @@ -12,9 +12,9 @@ import com.hp.hpl.jena.vocabulary.*; /** - * This class is used to parse RDF models, stored as Jena2 models, into - * objects that implement interfaces from the org.semanticmoby.graph - * package. + * This class is used to parse RDF models, stored as Jena2 Model objects, + * into API wrapper objects that insulate the programmer from the details + * of RDF. */ public class Parser { @@ -28,6 +28,9 @@ */ public final static String LANGUAGE_N3 = "N3"; + private MOBYPropertyDetector propDetector = + new NamespaceBasedPropertyDetector(); + /** * Since models are stored in a single Jena model, we * segregate the single model into multiple sub-models, @@ -35,12 +38,6 @@ * plus all statements that are reachable from it. */ private List subModels = new ArrayList(); - - /** - * A map relating a property's URI to an Inference model derived from - * its base model - */ - private Map cachedPropertyModels = new HashMap(); /** * Create and return a parser for parsing an N3 file @@ -130,7 +127,7 @@ */ public Parser(Model model) { - StmtIterator it = model.listStatements(null, RDF.type, MOBY.Provider); + StmtIterator it = model.listStatements(null, RDF.type, MOBY.Service); while (it.hasNext()) { Statement stmt = it.nextStatement(); @@ -143,84 +140,86 @@ } /** - * Parse a provider from the model. If the model contains - * multiple providers, only one will be returned (at random). If - * the model is expected to contain multiple providers, then call - * parseProviders() instead to get all the providers in a + * Parse a MOBYService from the model. If the model contains multiple + * services, only one will be returned (at random), so if the model is + * expected to contain multiple services, then call parseServices() instead to get all the providers in a * MOBYCollection. */ - public MOBYProvider parseProvider() + public MOBYService parseService() + throws NonCanonicalException { - MOBYUnorderedCollection providers = parseProviders(); + List services = parseServices(); - if (providers.size() == 0) { + if (services.size() == 0) { return null; } else { - return (MOBYProvider) providers.iterator().next(); + return (MOBYService) services.iterator().next(); } } /** - * Parse and return an unordered collection of providers + * Parse and return an list of MOBYService objects */ - public MOBYUnorderedCollection parseProviders() + public List parseServices() + throws NonCanonicalException { - ArrayList providers = new ArrayList(); + ArrayList services = new ArrayList(); - // Parse each provider - // Iterator it = subModels.iterator(); while (it.hasNext()) { Model model = (Model) it.next(); - StmtIterator it2 = model.listStatements(null, RDF.type, MOBY.Provider); + StmtIterator it2 = model.listStatements(null, RDF.type, MOBY.Service); if (it2 != null) { Statement stmt = it2.nextStatement(); - Resource provider = stmt.getSubject(); - providers.add(parseProvider(provider)); + services.add(parseService(stmt)); } } - - // Create and return an unordered collection of the parsed providers - // - return new MOBYUnorderedCollection(providers, null, null); + return services; } /** - * Parse a provider starting from the given resource (i.e. a resource that - * is the subject of an rdf:type statement with object of moby:Provider) + * Parse a service starting from the given resource (i.e. a resource that + * is the subject of an rdf:type statement with object of moby:Service) */ - public MOBYProvider parseProvider(Resource provider) + public MOBYService parseService(Statement typeStmt) + throws NonCanonicalException { - Model model = provider.getModel(); + Resource headResource = typeStmt.getSubject(); + + Model model = headResource.getModel(); - // First parse the scalar properties name, oneLineDescription, and aboutURI - // - Statement nameStmt = model.getProperty(provider, MOBY.name); - Statement oneLineDescriptionStmt = model.getProperty(provider, MOBY.oneLineDescription); - Statement aboutURIStmt = model.getProperty(provider, MOBY.aboutURI); + // First parse the scalar properties + + Statement nameStmt = + model.getProperty(headResource, MOBY.name); - // A provider can have multiple operatesOn properties, each of + Statement oneLineDescriptionStmt = + model.getProperty(headResource, MOBY.oneLineDescription); + + Statement aboutURIStmt = + model.getProperty(headResource, MOBY.aboutURI); + + // A service can have multiple operatesOn properties, each of // which leads to a subgraph. Parse each of these subgraphs. - // - List operatesOn = new ArrayList(); - StmtIterator it = model.listStatements(provider, MOBY.operatesOn, (RDFNode) null); + Map operatesOn = new HashMap(); + StmtIterator it = + model.listStatements(headResource, MOBY.operatesOn, (RDFNode) null); while (it.hasNext()) { - Statement stmt = it.nextStatement(); - Resource r = (Resource) stmt.getObject(); - operatesOn.add(parseOperatesOn(r)); + Statement operatesOnStmt = it.nextStatement(); + Resource r = (Resource) operatesOnStmt.getObject(); + operatesOn.put(operatesOnStmt, parseOperatesOn(r)); } - // Create and return a new Provider object using the provider URI, name, + // Create and return a new Service object using the service URI, name, // oneLineDescription, aboutURI, and collection of operatesOn subgraphs // - return new MOBYProvider( - provider, nameStmt, oneLineDescriptionStmt, aboutURIStmt, - new MOBYUnorderedCollection(operatesOn, provider, model), - model); + return new MOBYService(model, typeStmt, nameStmt, + oneLineDescriptionStmt, + aboutURIStmt, operatesOn); } /** @@ -231,25 +230,48 @@ * each element of the data structure should be a mapping subgraph. */ private MOBYGraphNode parseOperatesOn(Resource res) + throws NonCanonicalException { Model model = res.getModel(); if (isGraph(res)) { - // The resource is a MOBY Graph, so should have exactly one + // Throw an exception if it is also a data structure + if (isDataStructure(res)) + { + throw new NonCanonicalException( + "A resource was found to be both a Graph " + + "and Data Structure", model); + } + + // The defining statement for the MOBYGraph instance + Statement typeStmt = model.listStatements( + res, RDF.type, MOBY.Graph).nextStatement(); + + // The statement that asserts the hasMapping property + Statement hasMappingStmt = model.listStatements( + res, MOBY.hasMapping, (RDFNode) null).nextStatement(); + + // Since the resource is a MOBY Graph, it should have exactly one // hasMapping property that leads to its mapping subgraph. - // Resource hasMapping = getResourcePropertyValue(res, MOBY.hasMapping); - return new MOBYGraph(res, parseHasMapping(hasMapping), model); + return new MOBYGraph(model, typeStmt, hasMappingStmt, + parseHasMapping(hasMapping)); } else { + // Throw an exception if it is also a graph + if (isGraph(res)) + { + throw new NonCanonicalException( + "A resource was found to be both a Graph " + + "and Data Structure", model); + } // The resource is a data structure, so has multiple mapping // subgraphs, each of which is headed by an element in the // data structure. Iterate through the data structure elements, // parsing a mapping subgraph from each by recursively calling // this method. - // Iterator it = iteratorFor(res); List subgraphs = new ArrayList(); while (it.hasNext()) @@ -260,7 +282,6 @@ // Create and return a collection of the subgraphs; the type // of the collection depends on the type of the passed resource - // return collectionFor(res, subgraphs); } } @@ -273,37 +294,52 @@ * each element of the data structure should be a mapped subgraph. */ private MOBYSubject parseHasMapping(Resource res) + throws NonCanonicalException { - Model model = res.getModel(); - - // Collect the properties of this subject resource that are - // subproperties of moby:Property, and create MOBY statements - // for each. - // - List statements = mobyPropertyStatementsOf(res); + Model model = res.getModel(); + + // It is *not* legal for the object of a hasMapping to be *neither* + // a Subject nor a data structure, so throw an exception if this is + // the case. + if ((! isSubject(res)) && (! isDataStructure(res))) + { + throw new NonCanonicalException( + "A hasMapping property was found to have a value that " + + "is neither a Subject nor a data structure", model); + } + + // Collect the properties of this subject that are + // meant to be filled in by the client + List propValStmts = mobyPropertyStatementsOf(res); // List of direct mappings, i.e. those related through hasMapping // properties. - // - List directMappings = new ArrayList(); + Map directMappings = new HashMap(); // List of nested hasMapping subgraphs - // List nestedMappings = new ArrayList(); + // The statement that asserts this to be of rdf:type moby:Subject. + // Since it is legal for this to not be a Subject, then the statement + // can be null + Statement typeStmt = null; + if (isSubject(res)) { + typeStmt = model.listStatements( + res, RDF.type, MOBY.Subject).nextStatement(); + // The resource is a MOBY Subject, so should have one or more // mapsTo properties that lead to its mapped subgraphs. - // List mapsTo = new ArrayList(); - StmtIterator it = model.listStatements(res, MOBY.mapsTo, (RDFNode) null); + StmtIterator it = + model.listStatements(res, MOBY.mapsTo, (RDFNode) null); while (it.hasNext()) { - Statement stmt = it.nextStatement(); - Resource mapsToSubject = stmt.getResource(); + Statement mapsToStmt = it.nextStatement(); + Resource mapsToSubject = mapsToStmt.getResource(); MOBYGraphNode object = parseMapsTo(mapsToSubject); - directMappings.add(object); + directMappings.put(object, mapsToStmt); } } @@ -313,7 +349,6 @@ // nested in each element. For each element in the data structure, // recursively call this method to create a mapping subgraph, an // save the parsed object in the nestedMappings list. - // Iterator it = iteratorFor(res); while (it.hasNext()) { @@ -322,13 +357,66 @@ } } - // Create and return a Subject to describe this hasMapping subgraph - // - return new MOBYSubject(res, - new MOBYFixedCollection(statements, res, model), - new MOBYUnorderedCollection(directMappings, res, model), - collectionFor(res, nestedMappings), - model); + return new MOBYSubject(model, typeStmt, propValStmts, directMappings, + collectionFor(res, nestedMappings)); + } + + /** + * Parse the object of an mapsTo statement, which should be a + * Subject, a data structure, or both. If the object is a Subject, + * then it should be connected to one or more mapped subgraphs through + * mapsTo properties. If the object is a data structure, then + * each element of the data structure should be a mapped subgraph. + */ + private MOBYObject parseMapsTo(Resource res) + throws NonCanonicalException + { + Model model = res.getModel(); + + // It is *not* legal for the object of a mapsTo to be *neither* + // an Object nor a data structure, so throw an exception if this is + // the case. + if ((! isObject(res)) && (! isDataStructure(res))) + { + throw new NonCanonicalException( + "A mapsTo property was found to have a value " + + "is neither an Object nor a data structure", model); + } + + // Collect the properties of this subject that are + // meant to be filled in by the client + List propValStmts = mobyPropertyStatementsOf(res); + + // List of nested Object subgraphs + List nestedObjects = new ArrayList(); + + // The statement that asserts this to be of rdf:type moby:Object. + // Since it is legal for this to not be an Object, then the statement + // can be null + Statement typeStmt = null; + + if (isObject(res)) + { + typeStmt = model.listStatements( + res, RDF.type, MOBY.Object).nextStatement(); + } + + if (isDataStructure(res)) + { + // The resource is a data structure, so has a mapping subgraph + // nested in each element. For each element in the data structure, + // recursively call this method to create a mapping subgraph, an + // save the parsed object in the nestedMappings list. + Iterator it = iteratorFor(res); + while (it.hasNext()) + { + Resource r = (Resource) it.next(); + nestedObjects.add(parseMapsTo(r)); + } + } + + return new MOBYObject(model, typeStmt, propValStmts, + collectionFor(res, nestedObjects)); } @@ -336,14 +424,15 @@ * Parse the object of a mapsTo statement, which should be an * Object, a data structure, or both. If the object is a data * structure, then each element of the data structure should - * be a mapped subgraph. + * in turn be an Object, a data structure, or both. */ + /* private MOBYObject parseMapsTo(Resource res) { - // Collect the properties of this subject resource that are - // subproperties of moby:Property, and create MOBY statements - // for each. - // + Model model = res.getModel(); + + // Collect the properties of this object that are + // meant to be filled in by the service List statements = mobyPropertyStatementsOf(res); // List of nested mapsTo statements @@ -364,14 +453,11 @@ nested.add(parseMapsTo(r)); } } - - // Create and return a new MOBYObject - // - Model model = res.getModel(); return new MOBYObject(res, new MOBYFixedCollection(statements, res, model), collectionFor(res, nested), model); } + */ /** * Return a list of statements for whom the subject is a given resource, @@ -381,86 +467,22 @@ private List mobyPropertyStatementsOf(Resource res) { // The statements to return - // List stmts = new ArrayList(); // Iterate over the statements whose subjects are the resource - // StmtIterator it = res.listProperties(); while (it.hasNext()) { Statement stmt = it.nextStatement(); - Property p = stmt.getPredicate(); - RDFNode pval = stmt.getObject(); - - // Try to retrieve a description of the property at - // its URI. - // - InfModel model = getPropertyModel(p); - - if (isMobyProperty(p, model)) + if (stmt.getObject().isAnon() && + !propDetector.isMOBYProperty(stmt.getPredicate())) { - MOBYPropertyValueStatement pvalStmt = - new MOBYPropertyValueStatement(stmt, model); - - Statement s = p.getProperty(RDFS.range); - - if ((s != null) && (s.getObject().canAs(Resource.class))) - { - Resource range = (Resource) s.getObject(); - if (range.equals(XSD.date)) { - pvalStmt.setConstraint(new MOBYDateConstraint()); - } else if (range.equals(XSD.integer)) { - pvalStmt.setConstraint(new MOBYIntegerConstraint()); - } else if (range.equals(XSD.nonNegativeInteger)) { - pvalStmt.setConstraint( - new MOBYNonNegativeIntegerConstraint()); - } else if (range.equals(XSD.nonPositiveInteger)) { - pvalStmt.setConstraint( - new MOBYNonPositiveIntegerConstraint()); - } - } - - stmts.add(pvalStmt); + stmts.add(stmt); } } return stmts; } - /** - * Get the model describing a given property by doing a GET - * on its URI, and creating an inference model from it. - */ - private InfModel getPropertyModel(Property p) - { - InfModel cachedModel = (InfModel) - cachedPropertyModels.get(p.getURI()); - - if (cachedModel == null) - { - Model model = ModelRetriever.retrieveModel(p.getURI()); - - if (model != null) - { - cachedModel = ModelFactory.createRDFSModel(model); - cachedPropertyModels.put(p.getURI(), cachedModel); - } - } - return cachedModel; - } - - /** - * Return whether or not the given property is a MOBY property. - * This will be true if there is a statement in the model saying - * that the property is an rdfs:subPropertyOf moby:Property. - */ - private boolean isMobyProperty(Property p, InfModel model) - { - return - model != null && - model.contains(p, RDFS.subPropertyOf, MOBY.Property); - } - private Resource getResourcePropertyValue(Resource subject, Property property) { Statement s = subject.getModel().getProperty(subject, property); @@ -490,21 +512,31 @@ * an RDF:Seq yields a MOBYOrderedCollection; an RDF Alt yields a * MOBYEnumeration. */ - private MOBYCollection collectionFor(Resource res, List elements) + private MOBYCollection collectionFor(Resource res, List items) { + Model model = res.getModel(); if (isList(res)) { - return new MOBYFixedCollection(elements, res, res.getModel()); + return new MOBYFixedCollection( + model, typeStatement(res, RDF.List), items); } else if (isBag(res)) { - return new MOBYUnorderedCollection(elements, res, res.getModel()); + return new MOBYUnorderedCollection( + model, typeStatement(res, RDF.Bag), items); } else if (isSeq(res)) { - return new MOBYOrderedCollection(elements, res, res.getModel()); + return new MOBYOrderedCollection( + model, typeStatement(res, RDF.Seq), items); } else if (isAlt(res)) { - return new MOBYEnumeration(elements, res, res.getModel()); + return new MOBYEnumeration( + model, typeStatement(res, RDF.Alt), items); } else { return null; } } + private Statement typeStatement(Resource subject, Resource objectType) { + return subject.getModel().listStatements( + subject, RDF.type, objectType).nextStatement(); + } + /** * Return whether or not the given resource is an RDF List */ From gss at pub.open-bio.org Wed Sep 14 22:06:11 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6B0i017132@pub.open-bio.org> gss Wed Sep 14 18:06:11 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv17011/src/org/semanticmoby/vocabulary Modified Files: MOBY.java Log Message: Major API overhaul moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/vocabulary MOBY.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java 2004/11/23 00:18:46 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/vocabulary/MOBY.java 2005/09/14 22:06:10 1.2 @@ -31,7 +31,7 @@ model.setNsPrefix(getNsPrefix(), getURI()); } - public static final Resource Provider = resource(getURI(), "Provider"); + public static final Resource Service = resource(getURI(), "Service"); public static final Resource Graph = resource(getURI(), "Graph"); public static final Resource Subject = resource(getURI(), "Subject"); public static final Resource Object = resource(getURI(), "Object"); From gss at pub.open-bio.org Wed Sep 14 22:06:11 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6BH0017151@pub.open-bio.org> gss Wed Sep 14 18:06:11 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/servlet In directory pub.open-bio.org:/tmp/cvs-serv17011/src/org/semanticmoby/servlet Modified Files: AbstractMobyServlet.java Log Message: Major API overhaul moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/servlet AbstractMobyServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java 2004/11/23 00:18:46 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/src/org/semanticmoby/servlet/AbstractMobyServlet.java 2005/09/14 22:06:11 1.2 @@ -58,7 +58,7 @@ * in, that serves as "input" to the provider. * @return a graph containing the work product of the provider. */ - protected abstract void handleRequest(MOBYProvider requestGraph); + protected abstract void handleRequest(MOBYService requestGraph); /** * A utility method for getting a buffered reader (as returned by @@ -108,16 +108,16 @@ MOBY.GRAPH_PARAMETER_NAME, request); Parser parser = Parser.forString( graphString, Parser.LANGUAGE_RDF_XML); - MOBYProvider provider = parser.parseProvider(); + MOBYService service = parser.parseService(); // Invoke the abstract handleRequest() method in order for the // provider servlet to do whatever it does to the graph. // - handleRequest(provider); + handleRequest(service); // Send the graph back in response // - provider.serialize(out); + service.serialize(out); } catch (Throwable t) { From gss at pub.open-bio.org Wed Sep 14 22:06:55 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:55 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6tJN017217@pub.open-bio.org> gss Wed Sep 14 18:06:55 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools In directory pub.open-bio.org:/tmp/cvs-serv17172/src/org/semanticmoby/ref/tools Modified Files: InvocationBroker.java KeywordFinder.java KeywordList.java URIInvestigator.java KeywordQuery.java DiscoveryQuery.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools InvocationBroker.java,1.2,1.3 KeywordFinder.java,1.2,1.3 KeywordList.java,1.1,1.2 URIInvestigator.java,1.2,1.3 KeywordQuery.java,1.2,1.3 DiscoveryQuery.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/InvocationBroker.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/InvocationBroker.java 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/InvocationBroker.java 2005/09/14 22:06:55 1.3 @@ -16,7 +16,7 @@ /** * This class is used to invoke and display the results of Semantic - * MOBY providers. + * MOBY services. */ public class InvocationBroker { @@ -55,64 +55,64 @@ this.out = out; } - private String rdfxmlString(MOBYProvider provider) + private String rdfxmlString(MOBYService service) { StringWriter writer = new StringWriter(); - provider.getModel().write(writer); + service.getJenaModel().write(writer); return writer.toString(); } - private String n3String(MOBYProvider provider) + private String n3String(MOBYService service) { StringWriter writer = new StringWriter(); - provider.getModel().write(writer, "N3"); + service.getJenaModel().write(writer, "N3"); return writer.toString(); } /** - * Handle a request to invoke a provider at a given URI. - * If the provider requires inputs, and the provider has + * Handle a request to invoke a service at a given URI. + * If the service requires inputs, and the service has * a valid inputURI property, redirect to the URI that is - * the value of the property. If the provider requires input + * the value of the property. If the service requires input * and has no inputURI property, then build a simple input * GUI from scratch. *

            - * If the provider doesn't require any inputs, then do an HTTP - * POST to the provider URI, passing the graph as a parameter. + * If the service doesn't require any inputs, then do an HTTP + * POST to the service URI, passing the graph as a parameter. */ - public void invokeURI(String providerURI) + public void invokeURI(String serviceURI) { - // Try to retrieve and parse a provider graph from the URI; + // Try to retrieve and parse a service graph from the URI; // on failure, print a message and return. // - MOBYProvider canonicalProvider = null; + MOBYService service = null; try { Model model = ModelFactory.createDefaultModel(); - model.read(providerURI); + model.read(serviceURI); Parser parser = new Parser(model); - canonicalProvider = parser.parseProvider(); + service = parser.parseService(); } catch (Throwable t) { - out.println("No valid provider could be found at"); - out.print(""); - out.print(" "); out.println(providerURI); out.println(""); + out.println("No valid service could be found at"); + out.print(""); + out.print(" "); out.println(serviceURI); out.println(""); return; } - if (requiresInputs(canonicalProvider)) + if (requiresInputs(service)) { - // Since the provider requires input, either redirect to its + // Since the service requires input, either redirect to its // inputURI (if it has one) or build a simple GUI for it. // try { - String inputURI = getInputURI(canonicalProvider); + String inputURI = getInputURI(service); if (inputURI == null) { - buildInputGUI(canonicalProvider); + buildInputGUI(service); } else { @@ -128,23 +128,23 @@ if (status == HttpStatus.SC_OK) { response.sendRedirect(inputURI); } else { - buildInputGUI(canonicalProvider); + buildInputGUI(service); } } } catch (Throwable t) { - buildInputGUI(canonicalProvider); + buildInputGUI(service); } } else // No input required { try { - // Invoke the provider + // Invoke the service // HTTPRequest rqst = - HTTPRequest.newPostRequest(canonicalProvider.getURI()); + HTTPRequest.newPostRequest(service.getURI()); rqst.addParameter(MOBY.GRAPH_PARAMETER_NAME, - rdfxmlString(canonicalProvider)); + rdfxmlString(service)); HTTPResponse resp = rqst.send(); // Check the status @@ -158,16 +158,16 @@ Model model = ModelFactory.createDefaultModel(); model.read(resp.getBodyAsStream(), ""); Parser parser = new Parser(model); - MOBYProvider resultsProvider = parser.parseProvider(); + MOBYService resultsService = parser.parseService(); - String outputURI = getOutputURI(resultsProvider); + String outputURI = getOutputURI(resultsService); if (outputURI == null) { // No output URI was specified, so build a generic // display of the results // - buildOutputGUI(resultsProvider); + buildOutputGUI(resultsService); } else { @@ -186,7 +186,7 @@ // by trying to invoke it. // rqst = HTTPRequest.newPostRequest(outputURI); - String graphString = rdfxmlString(resultsProvider); + String graphString = rdfxmlString(resultsService); rqst.addParameter( MOBY.GRAPH_PARAMETER_NAME, graphString); resp = rqst.send(); @@ -204,22 +204,22 @@ // The output URI returned a status other than // 200 OK, so fall back to a default output GUI // - buildOutputGUI(resultsProvider); + buildOutputGUI(resultsService); } } catch (Throwable t) { - buildOutputGUI(resultsProvider); + buildOutputGUI(resultsService); } } } else { - out.println("Sorry - an error occurred invoking the provider"); + out.println("Sorry - an error occurred invoking the service"); } } catch (Throwable t) { - out.println("Sorry - an error occurred invoking the provider"); + out.println("Sorry - an error occurred invoking the service"); return; } } @@ -243,57 +243,55 @@ dispatcher.forward(request, response); } - private String getInputURI(MOBYProvider provider) + private String getInputURI(MOBYService service) { try { - Model model = provider.getModel(); - Statement stmt = model.listStatements( - provider.getResource(), MOBY.inputURI, - (String) null).nextStatement(); + Model model = service.getJenaModel(); + Statement stmt = + model.getProperty(service.getResource(), MOBY.inputURI); return stmt.getString(); } catch (Throwable t) { return null; } } - private String getOutputURI(MOBYProvider provider) + private String getOutputURI(MOBYService service) { try { - Model model = provider.getModel(); - Statement stmt = model.listStatements( - provider.getResource(), MOBY.outputURI, - (String) null).nextStatement(); + Model model = service.getJenaModel(); + Statement stmt = + model.getProperty(service.getResource(), MOBY.outputURI); return stmt.getString(); } catch (Throwable t) { return null; } } - public void buildInputGUI(MOBYProvider provider) + public void buildInputGUI(MOBYService service) { - out.println("This provider has not provided a valid URL for"); + out.println("This service has not provided a valid URL for"); out.println("gathering its required inputs."); } - public void buildOutputGUI(MOBYProvider provider) + public void buildOutputGUI(MOBYService service) throws IOException, ServletException { HttpSession session = request.getSession(true); session.setAttribute("n3Graph", - n3String(provider) + n3String(service) .replaceAll("<", "<") .replaceAll(">", ">") .replaceAll("\"", """)); session.setAttribute("rdfxmlGraph", - rdfxmlString(provider) + rdfxmlString(service) .replaceAll("<", "<") .replaceAll(">", ">") .replaceAll("\"", """)); redirectToPage("/jsp/display.jsp"); } - private boolean requiresInputs(MOBYProvider provider) + private boolean requiresInputs(MOBYService service) { - return getInputURI(provider) != null; + return getInputURI(service) != null; } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordFinder.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordFinder.java 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordFinder.java 2005/09/14 22:06:55 1.3 @@ -12,15 +12,15 @@ public class KeywordFinder { /** - * The MOBY provider for which to find keywords + * The MOBY service for which to find keywords */ - private MOBYProvider provider; + private MOBYService service; /** - * The underlying Jena model on which the MOBY provider + * The underlying Jena model on which the MOBY service * is based */ - private Model providerModel; + private Model serviceModel; /** * A keyword list object to hold the keywords that are @@ -29,17 +29,17 @@ private KeywordList keywords = null; /** - * Construct an instance for the given provider and model + * Construct an instance for the given service and model */ - public KeywordFinder(MOBYProvider provider, Model providerModel) + public KeywordFinder(MOBYService service) { - this.provider = provider; - this.providerModel = providerModel; + this.service = service; + this.serviceModel = service.getJenaModel(); } /** * Retrieve, if necessary, and return the keywords associated - * with the provider. + * with the service. */ public KeywordList getKeywords() throws Exception @@ -53,21 +53,20 @@ } /** - * Collect keywords for the provider + * Collect keywords for the service */ private void collectKeywords() { - // Add keywords from classes that the provider is asserted to - // be an instance of (i.e. provider rdf:type ) + // Add keywords from classes that the service is asserted to + // be an instance of (i.e. service rdf:type ) // - Resource res = provider.getResource(); - keywords.addProviderKeywords(getKeywordsFor(res)); + Resource res = service.getResource(); + keywords.addServiceKeywords(getKeywordsFor(res)); // Add keywords from subjects and objects of each // operatesOn subgraph // - MOBYCollection coll = provider.getOperatesOn(); - for (Iterator it = coll.iterator(); it.hasNext();) + for (Iterator it = service.getOperatesOn(); it.hasNext();) { MOBYGraphNode node = (MOBYGraphNode) it.next(); addGraphKeywordsFor(node); @@ -104,10 +103,11 @@ MOBYSubject subject = (MOBYSubject) node; keywords.addSubjectKeywords( getKeywordsFor(subject.getResource())); - Iterator it = subject.getDirectMappings().iterator(); + Iterator it = subject.getDirectMappings(); while (it.hasNext()) { - MOBYGraphNode node2 = (MOBYGraphNode) it.next(); + Object obj = it.next(); + MOBYGraphNode node2 = (MOBYGraphNode) obj; addObjectKeywordsFor(node2); } } @@ -123,6 +123,11 @@ } } + // TODO: Note that in some cases, this doesn't work, + // when node is a MOBYObject that has no defining + // statement (see the discussion in the class doc for + // its parent class MappingObject). So, this as well + // as addSubjectKeywordsFor() needs to be fixed private void addObjectKeywordsFor(MOBYGraphNode node) { if (node instanceof MOBYObject) @@ -153,9 +158,9 @@ // Iterate over the resource's rdf:type properties // - StmtIterator it = providerModel.listStatements( - res, RDF.type, (RDFNode) null); - + StmtIterator it = + serviceModel.listStatements(res, RDF.type, (RDFNode) null); + while (it.hasNext()) { Statement s1 = it.nextStatement(); @@ -163,7 +168,7 @@ // If the value of the rdf:type property is a resource // - if (node.canAs(Resource.class)) + if ((res != null) && (node.canAs(Resource.class))) { Resource classNode = (Resource) node.as(Resource.class); @@ -188,7 +193,7 @@ } } - if (res.canAs(Bag.class)) + if ((res != null) && (res.canAs(Bag.class))) { Bag bag = (Bag) res.as(Bag.class); for (Iterator it2 = bag.iterator(); it2.hasNext();) @@ -236,40 +241,4 @@ return list; } - - public static void main(String[] args) - throws Exception - { - Model model = ModelFactory.createDefaultModel(); -// model.read("http://brebiou.cshl.org:8080/get-individuals"); - model.read("http://www.semanticmoby.org/examples/hello-world"); - Parser parser = new Parser(model); - MOBYProvider provider = parser.parseProvider(); - KeywordFinder kf = new KeywordFinder(provider, model); - KeywordList list = kf.getKeywords(); - - System.out.print("Provider keywords: "); - for (Iterator it = list.getProviderKeywords(); it.hasNext();) { - System.out.print("\""); - System.out.print(it.next().toString()); - System.out.print("\" "); - } - System.out.println(); - - System.out.print("Subject keywords: "); - for (Iterator it = list.getSubjectKeywords(); it.hasNext();) { - System.out.print("\""); - System.out.print(it.next().toString()); - System.out.print("\" "); - } - System.out.println(); - - System.out.print("Object keywords: "); - for (Iterator it = list.getObjectKeywords(); it.hasNext();) { - System.out.print("\""); - System.out.print(it.next().toString()); - System.out.print("\" "); - } - System.out.println(); - } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordList.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordList.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordList.java 2005/09/14 22:06:55 1.2 @@ -6,20 +6,20 @@ public class KeywordList { - private Set providerKeywords = new HashSet(); + private Set serviceKeywords = new HashSet(); private Set subjectKeywords = new HashSet(); private Set objectKeywords = new HashSet(); - public void addProviderKeyword(String keyword) { - providerKeywords.add(keyword); + public void addServiceKeyword(String keyword) { + serviceKeywords.add(keyword); } - public void addProviderKeywords(List keywords) { - providerKeywords.addAll(keywords); + public void addServiceKeywords(List keywords) { + serviceKeywords.addAll(keywords); } - public Iterator getProviderKeywords() { - return providerKeywords.iterator(); + public Iterator getServiceKeywords() { + return serviceKeywords.iterator(); } public void addSubjectKeyword(String keyword) { =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/URIInvestigator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/URIInvestigator.java 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/URIInvestigator.java 2005/09/14 22:06:55 1.3 @@ -16,7 +16,7 @@ import com.hp.hpl.jena.rdf.model.Model; /** - * This class is used to investigate URIs that potentially contain MOBY graphs. + * This class is used to investigate URLs that potentially contain MOBY graphs. * Multiple instances can exist, each investigating a different URL. Keeping a * map of URL->instance mappings in the instances class variable is a simple * way to prevent multiple instances from investigating the same URL at any one @@ -36,7 +36,7 @@ * The URL that is to be investigated for possible inclusion in the * metadata repository. */ - private String providerURI; + private String serviceURL; private final static Log syncLog = LogFactory.getLog("SYNC"); @@ -47,17 +47,17 @@ * investigated, then this call is a NO-OP. * @param providerURL the URL to investigate */ - public synchronized static void investigate(String providerURL) + public synchronized static void investigate(String serviceURL) { synchronized (instances) { - if (instances.get(providerURL) != null) { - syncLog.warn("Already investigating " + providerURL); + if (instances.get(serviceURL) != null) { + syncLog.warn("Already investigating " + serviceURL); return; } - URIInvestigator investigator = new URIInvestigator(providerURL); - instances.put(providerURL, investigator); + URIInvestigator investigator = new URIInvestigator(serviceURL); + instances.put(serviceURL, investigator); investigator.start(); } } @@ -66,9 +66,9 @@ * Create an instance for investingating the given provider URL * @param providerURL the URL to investigate */ - private URIInvestigator(String providerURL) + private URIInvestigator(String serviceURL) { - this.providerURI = providerURL; + this.serviceURL = serviceURL; } /** @@ -108,7 +108,7 @@ // synchronized (instances) { - instances.remove(providerURI); + instances.remove(serviceURL); } } } @@ -137,18 +137,20 @@ boolean alreadyRegistered = false; try { - lastModifiedDate = manager.getLastModifiedDate(providerURI); + lastModifiedDate = manager.getLastModifiedDate(serviceURL); alreadyRegistered = (lastModifiedDate != null); } catch (StorageException e) { - syncLog.error("Couldn't check for last modified date of provider URL " + providerURI, e); + syncLog.error( + "Couldn't check for last modified date of provider URL " + + serviceURL, e); return; } // Helper class for making the HTTP GET call // - HTTPRequest request = HTTPRequest.newGetRequest(providerURI); + HTTPRequest request = HTTPRequest.newGetRequest(serviceURL); // If there was a last modified date, then request that the graph only // be sent if it has been modified since that date @@ -170,7 +172,7 @@ } catch (HTTPException e) { - syncLog.warn("Couldn't reach suggested provider " + providerURI); + syncLog.warn("Couldn't reach suggested provider " + serviceURL); return; } @@ -181,7 +183,7 @@ // The resource has not been modified since it was // registered, so there is nothing to do but log a message. // - syncLog.info("IN-SYNC : " + providerURI); + syncLog.info("IN-SYNC : " + serviceURL); break; case HttpServletResponse.SC_NOT_FOUND: @@ -190,9 +192,9 @@ // from the database. // if (alreadyRegistered) { - deregisterProvider(manager, true); + deregisterService(manager, true); } else { - syncLog.info("IGNORED : " + providerURI + " doesn't exist"); + syncLog.info("IGNORED : " + serviceURL + " doesn't exist"); } break; @@ -203,11 +205,12 @@ // lastModifiedDate = null; - // Try to parse the Last-Modified header to store in the database + // Try to parse the Last-Modified header to store in the DB // String dateString = ""; try { - dateString = response.getHeaderValue(MOBY.LAST_MODIFIED_HEADER); + dateString = + response.getHeaderValue(MOBY.LAST_MODIFIED_HEADER); lastModifiedDate = DateParser.parseDate(dateString); } catch (HTTPException e) @@ -216,7 +219,7 @@ // retrievable, but register the graph anyway // syncLog.warn("Unable to get Last-Modified date for " - + providerURI + "; using current date"); + + serviceURL + "; using current date"); lastModifiedDate = new Date(); } catch (Throwable t) @@ -224,8 +227,9 @@ // Log a message about the last modified date not being // parsable, but register the graph anyway // - syncLog.warn("Unparsable Last-Modified date " + "(\"" + dateString + - "\") for " + providerURI + "; ignoring"); + syncLog.warn( + "Unparsable Last-Modified date " + "(\"" + dateString + + "\") for " + serviceURL + "; ignoring"); } // The client sent back a graph; so try to parse it. If the @@ -238,38 +242,41 @@ } catch (HTTPException e) { - syncLog.error("Couldn't retrieve graph from " + providerURI); + syncLog.error("Couldn't retrieve graph from " + serviceURL); return; } - MOBYProvider provider = null; + MOBYService service = null; try { Parser parser = Parser.forInputStream(in, Parser.LANGUAGE_RDF_XML); - provider = parser.parseProvider(); + service = parser.parseService(); } catch (Throwable t) { System.err.println("Parse error: " + t); } // De-register the provider, printing a removal message if - // a provider couldn't be parsed + // a service couldn't be parsed // - deregisterProvider(manager, provider==null); + deregisterService(manager, service==null); - // If a provider was parsed, then register it + // If a service was parsed, then register it // - if (provider != null) + if (service != null) { try { - manager.registerProvider(provider, lastModifiedDate); + manager.registerProvider(service, lastModifiedDate); // Log a message about successfully registering the graph: // - syncLog.info((alreadyRegistered ? "UPDATED : " : "ADDED : ") + providerURI); + syncLog.info( + (alreadyRegistered ? "UPDATED : " : "ADDED : ") + + serviceURL); } catch (StorageException e) { - syncLog.error("Error storing graph for " + providerURI, e); + syncLog.error( + "Error storing graph for " + serviceURL, e); } } @@ -280,21 +287,21 @@ // Log a message about the failed attempt to contact the URL // syncLog.error("Status " + status + " received while trying " + - "to contact provider " + providerURI); + "to contact provider " + serviceURL); break; } } - private void deregisterProvider(StorageManager manager, boolean removing) + private void deregisterService(StorageManager manager, boolean removing) { try { - manager.deregisterProvider(providerURI); + manager.deregisterProvider(serviceURL); if (removing) { - syncLog.info("REMOVED : " + providerURI); + syncLog.info("REMOVED : " + serviceURL); } } catch (StorageException e) { - syncLog.error("Unable to de-register provider " + providerURI, e); + syncLog.error("Unable to de-register provider " + serviceURL, e); } } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordQuery.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordQuery.java 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/KeywordQuery.java 2005/09/14 22:06:55 1.3 @@ -44,7 +44,7 @@ while (rs.next()) { String uri = rs.getString("provider_uri"); - MOBYProvider provider = providerAt(uri, model); + MOBYService provider = serviceAt(uri, model); if (provider != null) { matching.add(provider); } @@ -65,7 +65,7 @@ return matching; } - private MOBYProvider providerAt(String uri, Model model) + private MOBYService serviceAt(String uri, Model model) { Model providerModel = ModelFactory.createDefaultModel(); Resource provider = providerModel.createResource(uri); @@ -74,7 +74,7 @@ try { Parser parser = new Parser(providerModel); - return parser.parseProvider(); + return parser.parseService(); } catch (Throwable t) { return null; } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/DiscoveryQuery.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/DiscoveryQuery.java 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/DiscoveryQuery.java 2005/09/14 22:06:55 1.3 @@ -46,7 +46,7 @@ /** * The graph that serves as a template for providers that match. */ - private MOBYProvider queryProvider; + private MOBYService queryProvider; /** * Flag indicating which statements should be returned: URI_ONLY, @@ -65,17 +65,17 @@ */ private int lastBnodeNumber; - public static DiscoveryQuery newMinimalStmtsQuery(MOBYProvider provider) + public static DiscoveryQuery newMinimalStmtsQuery(MOBYService provider) { return new DiscoveryQuery(provider, MINIMAL_STMTS); } - public static DiscoveryQuery newQueryStmtsQuery(MOBYProvider provider) + public static DiscoveryQuery newQueryStmtsQuery(MOBYService provider) { return new DiscoveryQuery(provider, QUERY_STMTS); } - public static DiscoveryQuery newReachableStmtsQuery(MOBYProvider provider) + public static DiscoveryQuery newReachableStmtsQuery(MOBYService provider) { return new DiscoveryQuery(provider, REACHABLE_STMTS); } @@ -87,7 +87,7 @@ * @param statementsToReturn which statements should be returned: URI_ONLY, * QUERY_STMTS_ONLY, or ALL_STMTS (use the static constants on this class). */ - private DiscoveryQuery(MOBYProvider queryProvider, int statementsToReturn) + private DiscoveryQuery(MOBYService queryProvider, int statementsToReturn) { this.queryProvider = queryProvider; this.statementsToReturn = statementsToReturn; @@ -103,14 +103,14 @@ lastBnodeNumber = 0; } - public MOBYProviderSet findMatchingGraphs() + public MOBYServiceSet findMatchingGraphs() { init(); Model dbModel = null; try { - Model queryModel = ((MOBYProvider) queryProvider).getModel(); + Model queryModel = ((MOBYService) queryProvider).getJenaModel(); String queryString = buildQueryString(queryModel); StorageManager manager = new StorageManager(); dbModel = manager.openDBModel(); @@ -128,14 +128,14 @@ } results.close(); - MOBYProviderSet returnSet = new MOBYProviderSet(); + MOBYServiceSet returnSet = new MOBYServiceSet(); for (Iterator it = matching.iterator(); it.hasNext();) { Object next = it.next(); - MOBYProvider mp = buildGraphModel(dbModel, + MOBYService mp = buildGraphModel(dbModel, queryModel, (ResultBinding) next); - returnSet.addProvider(mp); + returnSet.addService(mp); } return returnSet; @@ -244,8 +244,9 @@ * @param binding bindings for variables * @return */ - private MOBYProvider buildGraphModel( + private MOBYService buildGraphModel( Model dbModel, Model queryModel, ResultBinding binding) + throws NonCanonicalException { // Create a default model to return // @@ -279,7 +280,7 @@ // Parse and return a MOBY provider using the adjusted model // Parser parser = new Parser(adjusted); - return parser.parseProvider(); + return parser.parseService(); } /** @@ -319,7 +320,7 @@ // try { Statement providerTypeStmt = original.listStatements( - null, RDF.type, MOBY.Provider).nextStatement(); + null, RDF.type, MOBY.Service).nextStatement(); minimal.add(providerTypeStmt); Resource subject = providerTypeStmt.getSubject(); @@ -370,7 +371,7 @@ // try { Statement providerTypeStmt = original.listStatements( - null, RDF.type, MOBY.Provider).nextStatement(); + null, RDF.type, MOBY.Service).nextStatement(); Resource subject = providerTypeStmt.getSubject(); Util.addReachableStmts(dbModel, reachable, subject, subject.getURI()); } From gss at pub.open-bio.org Wed Sep 14 22:06:55 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:55 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6tpn017240@pub.open-bio.org> gss Wed Sep 14 18:06:55 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev In directory pub.open-bio.org:/tmp/cvs-serv17172/src/org/semanticmoby/ref/servlets/dev Modified Files: MOBYGraphValidationServlet.java ProviderListServlet.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev MOBYGraphValidationServlet.java,1.1,1.2 ProviderListServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/MOBYGraphValidationServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/MOBYGraphValidationServlet.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/MOBYGraphValidationServlet.java 2005/09/14 22:06:55 1.2 @@ -1,6 +1,7 @@ package org.semanticmoby.ref.servlets.dev; import org.semanticmoby.graph.*; +import org.semanticmoby.parser.NonCanonicalException; import org.semanticmoby.parser.Parser; import org.semanticmoby.ref.servlets.BaseServlet; import org.semanticmoby.servlet.*; @@ -28,18 +29,18 @@ StringReader reader = new StringReader(graphString); baseModel.read(reader, null); Parser parser = new Parser(baseModel); - parser.parseProvider(); + parser.parseService(); out.println("Model is canonical"); } catch (ParameterException e) { response.sendError(HttpServletResponse.SC_NOT_ACCEPTABLE, e.getMessage()); } -// catch (NonCanonicalException e) -// { -// out.println("Model failed canonicality test:"); -// out.println(e); -// } + catch (NonCanonicalException e) + { + out.println("Model failed canonicality test:"); + out.println(e); + } catch (IllegalArgumentException e) {} } } =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/ProviderListServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/ProviderListServlet.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/dev/ProviderListServlet.java 2005/09/14 22:06:55 1.2 @@ -23,7 +23,7 @@ Model dbModel = manager.openDBModel(); int count = 0; StmtIterator it = dbModel.listStatements( - null, RDF.type, MOBY.Provider); + null, RDF.type, MOBY.Service); while (it.hasNext()) { Statement stmt = it.nextStatement(); From gss at pub.open-bio.org Wed Sep 14 22:06:56 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6uZY017260@pub.open-bio.org> gss Wed Sep 14 18:06:55 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/db In directory pub.open-bio.org:/tmp/cvs-serv17172/src/org/semanticmoby/ref/tools/db Modified Files: StorageManager.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/db StorageManager.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/db/StorageManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/db/StorageManager.java 2005/03/21 21:42:02 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/db/StorageManager.java 2005/09/14 22:06:55 1.3 @@ -52,16 +52,16 @@ * are in the provider graph's namespace will be stored in the global repository, * and all statements from the provider graph are stored in a separate model * that has as its name the fully expanded URI of the provider. - * @param provider the Provider to store + * @param service the Provider to store * @param lastModifiedDate when the graph was last modified * @throws StorageException if unable to access the database */ - public void registerProvider(MOBYProvider provider, Date lastModifiedDate) + public void registerProvider(MOBYService service, Date lastModifiedDate) throws StorageException { - Model model = ((MOBYProvider) provider).getModel(); + Model model = service.getJenaModel(); Model dbModel = null; - String uriString = provider.getResource().getURI(); + String uriString = service.getResource().getURI(); Resource uri = model.createResource(uriString); try @@ -103,8 +103,8 @@ // Add keywords associated with the provider // - KeywordFinder finder = new KeywordFinder(provider, model); - addKeywords(provider.getResource().getURI(), + KeywordFinder finder = new KeywordFinder(service); + addKeywords(service.getResource().getURI(), finder.getKeywords(), dbModel); // Commit the transaction on the database model @@ -134,7 +134,7 @@ java.sql.Statement sql = conn.createStatement(); - doAddKeywords(providerURI, list.getProviderKeywords(), "P", sql); + doAddKeywords(providerURI, list.getServiceKeywords(), "P", sql); doAddKeywords(providerURI, list.getSubjectKeywords(), "S", sql); doAddKeywords(providerURI, list.getObjectKeywords(), "O", sql); From gss at pub.open-bio.org Wed Sep 14 22:06:56 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6uRt017287@pub.open-bio.org> gss Wed Sep 14 18:06:55 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets In directory pub.open-bio.org:/tmp/cvs-serv17172/src/org/semanticmoby/ref/servlets Modified Files: DiscoveryServlet.java KeywordSearchServlet.java ResultsDisplayServlet.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets DiscoveryServlet.java,1.1,1.2 KeywordSearchServlet.java,1.2,1.3 ResultsDisplayServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/DiscoveryServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/DiscoveryServlet.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/DiscoveryServlet.java 2005/09/14 22:06:55 1.2 @@ -44,7 +44,7 @@ // Parse the query graph into a MOBYGraph object // Parser parser = Parser.forString(graphString, Parser.LANGUAGE_RDF_XML); - MOBYProvider provider = parser.parseProvider(); + MOBYService service = parser.parseService(); // Find which statements the user wishes to have returned // @@ -59,14 +59,14 @@ DiscoveryQuery q = null; if (statements.equalsIgnoreCase("minimal")) { - q = DiscoveryQuery.newMinimalStmtsQuery(provider); + q = DiscoveryQuery.newMinimalStmtsQuery(service); } else if (statements.equalsIgnoreCase("query")) { - q = DiscoveryQuery.newQueryStmtsQuery(provider); + q = DiscoveryQuery.newQueryStmtsQuery(service); } else { - q = DiscoveryQuery.newReachableStmtsQuery(provider); + q = DiscoveryQuery.newReachableStmtsQuery(service); } - MOBYProviderSet matching = q.findMatchingGraphs(); + MOBYServiceSet matching = q.findMatchingGraphs(); if ((matching == null) || (matching.size() == 0)) { =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java 2005/03/21 21:42:02 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/KeywordSearchServlet.java 2005/09/14 22:06:55 1.3 @@ -60,7 +60,7 @@ { for (Iterator it = matching.iterator(); it.hasNext();) { - MOBYProvider p = (MOBYProvider) it.next(); + MOBYService p = (MOBYService) it.next(); showProvider(p, out); } } @@ -171,7 +171,7 @@ /** * Show a provider that matches the keyword search criteria. */ - private void showProvider(MOBYProvider provider, PrintStream out) + private void showProvider(MOBYService provider, PrintStream out) { String uri = provider.getResource().getURI(); String name = provider.getName(); =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/ResultsDisplayServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/ResultsDisplayServlet.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/ResultsDisplayServlet.java 2005/09/14 22:06:55 1.2 @@ -5,7 +5,7 @@ import javax.servlet.*; import javax.servlet.http.*; -import org.semanticmoby.graph.MOBYProvider; +import org.semanticmoby.graph.MOBYService; import org.semanticmoby.parser.Parser; import org.semanticmoby.ref.tools.*; import org.semanticmoby.servlet.*; @@ -27,14 +27,14 @@ MOBY.GRAPH_PARAMETER_NAME, request); Parser parser = Parser.forString( graphString, Parser.LANGUAGE_RDF_XML); - MOBYProvider provider = parser.parseProvider(); + MOBYService service = parser.parseService(); response.setContentType("text/html"); startHTML(response, "Semantic MOBY results display", out); InvocationBroker broker = new InvocationBroker(this, request, response, out); - broker.buildOutputGUI(provider); + broker.buildOutputGUI(service); finishHTML(out); } catch (Throwable t) From gss at pub.open-bio.org Wed Sep 14 22:06:56 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6uXH017310@pub.open-bio.org> gss Wed Sep 14 18:06:56 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/example In directory pub.open-bio.org:/tmp/cvs-serv17172/src/org/semanticmoby/ref/servlets/example Modified Files: HelloWorldServlet.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/example HelloWorldServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/example/HelloWorldServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/example/HelloWorldServlet.java 2004/11/22 22:58:40 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/servlets/example/HelloWorldServlet.java 2005/09/14 22:06:56 1.2 @@ -26,24 +26,21 @@ return getFileReader(DESCRIPTION_GRAPH_FILE); } - protected void handleRequest(MOBYProvider provider) + protected void handleRequest(MOBYService service) { try { - MOBYGraph graph = (MOBYGraph) - provider.getOperatesOn().iterator().next(); + MOBYGraph graph = (MOBYGraph) service.getOperatesOn().next(); MOBYSubject subject = (MOBYSubject) graph.getHasMapping(); MOBYObject object = (MOBYObject) - subject.getDirectMappings().iterator().next(); + subject.getDirectMappings().next(); - MOBYPropertyValueStatement stmt = (MOBYPropertyValueStatement) - object.getPropertyValueStatements().iterator().next(); + MOBYPropValStmt stmt = (MOBYPropValStmt) + object.getPropValStmts().iterator().next(); - stmt.setPropertyValue( - new MOBYLiteral("Hello, world!")); - + stmt.getDefiningStmt().changeObject("Hello, world!"); } // Silently ignore graphs without the required form catch (Throwable t) {} From gss at pub.open-bio.org Wed Sep 14 22:06:56 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6uk3017329@pub.open-bio.org> gss Wed Sep 14 18:06:56 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org In directory pub.open-bio.org:/tmp/cvs-serv17172 Modified Files: .mymetadata Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/semanticmoby.org .mymetadata,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/.mymetadata,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/.mymetadata 2005/03/21 21:40:30 1.4 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/.mymetadata 2005/09/14 22:06:56 1.5 @@ -1,13 +1,13 @@ - + - - - - - + type="WEB" + name="semanticmoby.org" + id="myeclipse.1109704976982" + context-root="/semanticmoby.org" + j2ee-spec="1.4" + archive="semanticmoby.org.war"> + + + + + From gss at pub.open-bio.org Wed Sep 14 22:06:57 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6v6q017373@pub.open-bio.org> gss Wed Sep 14 18:06:57 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org In directory pub.open-bio.org:/tmp/cvs-serv17344 Modified Files: .mymetadata .classpath Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org .mymetadata,1.1,1.2 .classpath,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.mymetadata,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.mymetadata 2005/01/26 18:51:47 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.mymetadata 2005/09/14 22:06:57 1.2 @@ -1,13 +1,13 @@ - + - - - - - + type="WEB" + name="brebiou.cshl.org" + id="myeclipse.1089924010313" + context-root="/brebiou.cshl.org" + j2ee-spec="1.3" + archive="brebiou.cshl.org.war"> + + + + + =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.classpath,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.classpath 2005/01/26 18:51:47 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/.classpath 2005/09/14 22:06:57 1.2 @@ -4,21 +4,16 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + From gss at pub.open-bio.org Wed Sep 14 22:06:57 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6vPP017396@pub.open-bio.org> gss Wed Sep 14 18:06:57 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv17344/WebRoot Modified Files: get-individuals.rdf get-individuals.n3 Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot get-individuals.rdf,1.1,1.2 get-individuals.n3,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.rdf,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.rdf 2005/01/26 18:51:48 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.rdf 2005/09/14 22:06:57 1.2 @@ -6,29 +6,30 @@ xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > + + + + + + http://brebiou.cshl.org:8080/get-individuals.html - Retrieve all individuals for a panel - + get-individuals - - - + + + - - + + - - + + - - - - \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.n3,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.n3 2005/01/26 18:51:48 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/WebRoot/get-individuals.n3 2005/09/14 22:06:57 1.2 @@ -7,7 +7,7 @@ @prefix cshlterms: . cshl:get-individuals - a moby:Provider ; + a moby:Service ; moby:name "get-individuals" ; moby:oneLineDescription "Retrieve all individuals for a panel" ; moby:inputURI "http://brebiou.cshl.org:8080/get-individuals.html" ; @@ -19,7 +19,7 @@ moby:mapsTo [ a rdf:Bag ; rdf:_1 [ - a cshlterms:Individual ; + a moby:Object, cshlterms:Individual ; cshlterms:individualName [] ] ] From gss at pub.open-bio.org Wed Sep 14 22:06:57 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 14 Sep 2005 18:06:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142206.j8EM6vt1017416@pub.open-bio.org> gss Wed Sep 14 18:06:57 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/src/org/cshl/servlets In directory pub.open-bio.org:/tmp/cvs-serv17344/src/org/cshl/servlets Modified Files: GetIndividualsServlet.java Log Message: Changed to work after major API overhaul moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/src/org/cshl/servlets GetIndividualsServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/src/org/cshl/servlets/GetIndividualsServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/src/org/cshl/servlets/GetIndividualsServlet.java 2005/01/26 18:51:48 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/example-providers/brebiou.cshl.org/src/org/cshl/servlets/GetIndividualsServlet.java 2005/09/14 22:06:57 1.2 @@ -40,14 +40,13 @@ /** * Fill a rdf:Bag with Individual instances, given a panel name */ - protected void handleRequest(MOBYProvider provider) + protected void handleRequest(MOBYService provider) { try { // The provider operates on a single moby:Graph; retrieve it // - MOBYGraph graph = (MOBYGraph) - provider.getOperatesOn().iterator().next(); + MOBYGraph graph = (MOBYGraph) provider.getOperatesOn().next(); // The subject of the graph should be a moby:Subject; retrieve it // @@ -55,13 +54,13 @@ // Retrieve the statement that sets a value for the panelName property // - MOBYPropertyValueStatement stmt = (MOBYPropertyValueStatement) - subject.getPropertyValueStatements().iterator().next(); + MOBYPropValStmt pvStmt = (MOBYPropValStmt) + subject.getPropValStmts().iterator().next(); + Statement stmt = pvStmt.getDefiningStmt(); // Retrieve the panel name from the statement - // - MOBYLiteral literal = (MOBYLiteral) stmt.getValue(); - String panelName = literal.getStringValue(); + Literal lit = (Literal) stmt.getObject(); + String panelName = lit.getString(); // Get an iterator over the individual names for the panel // in order to populate the Bag of results @@ -77,8 +76,7 @@ // Empty the Bag that contains the example Individual // - MOBYObject object = (MOBYObject) subject.getDirectMappings() - .iterator().next(); + MOBYObject object = (MOBYObject) subject.getDirectMappings().next(); Resource res = object.getResource(); Model model = res.getModel(); Bag bag = (Bag) res.as(Bag.class); From gordonp at pub.open-bio.org Wed Sep 14 20:06:49 2005 From: gordonp at pub.open-bio.org (Paul Gordon) Date: Wed, 14 Sep 2005 16:06:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509142006.j8EK6n89016329@pub.open-bio.org> gordonp Wed Sep 14 16:06:49 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory pub.open-bio.org:/tmp/cvs-serv16304 Modified Files: MobyDataComposite.java Log Message: Fixed typo moby-live/Java/src/main/org/biomoby/shared/data MobyDataComposite.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java 2005/08/15 17:41:41 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java 2005/09/14 20:06:49 1.5 @@ -115,7 +115,7 @@ StringBuffer instanceXML = new StringBuffer(); // Open tag - instanceXML.append("<"+getDataType().getName()+ + instanceXML.append("<"+getDataType().getName()+" "+ getAttrXML() + ">\n"); //getAttrXML defined in super // Add the info blocks if available From fgibbons at pub.open-bio.org Fri Sep 16 16:36:39 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 16 Sep 2005 12:36:39 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161636.j8GGadFC023705@pub.open-bio.org> fgibbons Fri Sep 16 12:36:39 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv23680/t Modified Files: Client-Central.t Log Message: - Relationships property works now, remove from TODO. retrieveObjectSchema not implemented, put on TODO list. moby-live/Perl/t Client-Central.t,1.41,1.42 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Central.t,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- /home/repository/moby/moby-live/Perl/t/Client-Central.t 2005/09/01 13:50:46 1.41 +++ /home/repository/moby/moby-live/Perl/t/Client-Central.t 2005/09/16 16:36:39 1.42 @@ -61,7 +61,7 @@ my @mandatory = qw/findService retrieveService retrieveResourceURLs retrieveServiceProviders retrieveServiceNames retrieveServiceTypes retrieveObjectNames retrieveObjectDefinition -retrieveNamespaces retrieveObjectSchema Relationships/; +retrieveNamespaces Relationships/; my @mandatory_if_write_access = qw/registerObjectClass deregisterObjectClass registerServiceType deregisterServiceType @@ -80,6 +80,12 @@ can_ok($C, @optional_recommended) or diag("Registry does not supply certain optional methods;\n" . "you should consider adding them"); + +TODO: { + local $TODO = "Method 'retrieveObjectSchema yet to be implemented"; + can_ok($C, "retrieveObjectSchema") + or diag("Registry should be able to return Object Schema"); +} ################## MOBY Registration Tests ################# ################## OBJECT REGISTRATION ############# @@ -154,11 +160,8 @@ or diag("Relationships didn't return a hashref for object types") ; isa_ok( $r->{'isa'}, 'ARRAY') or diag("Relationships didn't return a hash of arrayrefs"); -TODO: { - local $TODO = "Objects don't correctly prepend LSID"; - is(shift @{$r->{'isa'}}, "Object") - or diag("Relationships(objectType) doesn't have the right parentage."); -} +is(shift @{$r->{'isa'}}, "Object") + or diag("Relationships(objectType) doesn't have the right parentage."); $r = $C->Relationships(serviceType => $ServiceType{serviceType}); isa_ok($r, "HASH", "Relationship types hash") @@ -166,12 +169,9 @@ #print STDERR "\n\n\nkeys ",(keys %rel), "\n\n\n"; isa_ok($r->{'isa'}, 'ARRAY') or diag("Relationships didn't return a hash of arrayrefs for services"); -TODO: { - local $TODO = "Objects don't correctly prepend LSID"; - is(shift @{$r->{'isa'}}, - $ServiceType{Relationships}->{ISA}->[0]) - or diag("Relationships (serviceType) doesn't have the right parentage."); -} +is(shift @{$r->{'isa'}}, + $ServiceType{Relationships}->{ISA}->[0]) + or diag("Relationships (serviceType) doesn't have the right parentage."); ############# SERVICE INSTANCE REGISTRATION ########### # Set up a service registration hash. We'll mess with it piece by piece in the next several tests, @@ -498,11 +498,8 @@ $r = $C->retrieveObjectDefinition(objectType => $Obj{objectType}); isa_ok($r , "HASH", "Object definition returns hashref") or diag("Object definition did not return as a hashref") ; -TODO: { - local $TODO = "Objects don't correctly prepend LSID"; - is($r->{objectType}, $Obj{objectType}, "Object reporting correct type") - or diag("Object definition did not report correct type"); -} +is($r->{objectType}, $Obj{objectType}, "Object reporting correct type") + or diag("Object definition did not report correct type"); is($r->{description}, $Obj{description}, "Object reporting correct desccription") or diag("Object definition did not report correct desc"); @@ -529,15 +526,12 @@ or diag("Object didn't return an array of arrays for its ISA relationships"); isa_ok($hasa, 'ARRAY', "") or diag("Object didn't return an array of arrays for its HASA relationships"); -TODO: { - local $TODO = "Objects don't correctly prepend LSID prefix"; - is(${$isa}[0], $Obj{Relationships}->{ISA}->[0]->[0]) or diag("ISA reporting wrong object type"); - is(${$isa}[1], $Obj{Relationships}->{ISA}->[0]->[1]) or diag("ISA reporting wrong object name"); - is(${$hasa}[0], $Obj{Relationships}->{HASA}->[0]->[0]) or diag("HASA reporting wrong object type"); - is(${$hasa}[1], $Obj{Relationships}->{HASA}->[0]->[1]) or diag("HASA reporting wrong object name"); - is($r->{objectLSID}, "urn:lsid:biomoby.org:objectclass:" . $Obj{objectType}) - or diag("Object class LSID reported incorrectly"); -} +is(${$isa}[0], $Obj{Relationships}->{ISA}->[0]->[0]) or diag("ISA reporting wrong object type"); +is(${$isa}[1], $Obj{Relationships}->{ISA}->[0]->[1]) or diag("ISA reporting wrong object name"); +is(${$hasa}[0], $Obj{Relationships}->{HASA}->[0]->[0]) or diag("HASA reporting wrong object type"); +is(${$hasa}[1], $Obj{Relationships}->{HASA}->[0]->[1]) or diag("HASA reporting wrong object name"); +is($r->{objectLSID}, "urn:lsid:biomoby.org:objectclass:" . $Obj{objectType}) + or diag("Object class LSID reported incorrectly"); $r = $C->retrieveNamespaces(); From fgibbons at pub.open-bio.org Fri Sep 16 16:38:15 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 16 Sep 2005 12:38:15 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161638.j8GGcFTB023739@pub.open-bio.org> fgibbons Fri Sep 16 12:38:15 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv23713/t Modified Files: Client-OntologyServer.t Log Message: - TODO list updated: * "Everything" removed (I'm an optimist). * Can't set proxy to default value 'undef', once changed. * relationshipExists is not implemented, so it's SKIPped. (Leaving it on the TODO list creates error messages on 'make test') moby-live/Perl/t Client-OntologyServer.t,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/06 20:43:21 1.3 +++ /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/16 16:38:15 1.4 @@ -12,7 +12,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; #use SOAP::Lite +trace; -use Test::More 'no_plan'; # perldoc Test::More for details +use Test::More 'no_plan'; #skip_all => "Skipped for development"; #'no_plan'; # perldoc Test::More for details use strict; use MOBY::Client::OntologyServer; #Is the client-code even installed? @@ -23,19 +23,30 @@ }; -TODO: { - local $TODO = "Everything."; -} - my @autoload = qw/host proxy/; my @API = (@autoload, qw/new getUserAgent -objectExists serviceExists namespaceExists relationshipExists/); +objectExists serviceExists namespaceExists /); my $os = MOBY::Client::OntologyServer->new(); foreach (@autoload) {eval{$os->$_};} # Call all AUTOLOAD methods, to create them. can_ok("MOBY::Client::OntologyServer", @API) or diag("OntologyServer doesn't implement full API"); +# Check that accessor methods work correctly; +my ($old_host, $old_proxy) = ($os->host(), $os->proxy()); +my ($new_host, $new_proxy) = ("foo.cgi", "bar"); +is($os->host($new_host), $new_host) or diag("Couldn't set new host"); +is($os->host(), $new_host) or diag("Couldn't get host"); +is($os->host($old_host), $old_host) or diag("Couldn't return host to previous value"); + is($os->proxy($new_proxy), $new_proxy) or diag("Couldn't set proxy to new value"); + is($os->proxy(), $new_proxy) or diag("Couldn't get proxy"); +TODO: { + local $TODO = "How come I cant' set proxy back to its original value?"; + is($os->proxy($old_proxy), $old_proxy) or diag("Couldn't return proxy to previous value"); +} + +# Start fresh.... +$os = MOBY::Client::OntologyServer->new(); ################ CHECK THAT VALID STUFF RETURNS CORRECTLY ########## # # It would really be better not to have literal lists of valid namespaces here, @@ -69,14 +80,23 @@ or diag("Service type '$_' reported erroneously as non-existent."); } -TODO: { - local $TODO = "Fix whatever is broken with these relationship types - or else fix this test."; +SKIP: { + skip "relationshipExists not implemented", 5 + unless MOBY::Client::OntologyServer->can("relationshipExists"); + + can_ok("MOBY::Client::OntologyServer", "relationshipExists") + or diag("OntologyServer should be able to tell whether a relationship exists"); my @check_rel = qw/ISA HASA HAS/; # There should only be very few valid relationship types. foreach (@check_rel) { ($success, $msg, $existingURI) = $os->relationshipExists(term => $_); is($success, 1) or diag("Relationship '$_' reported erroneously as non-existent."); } + + my $invalid_rel = "HA"; + ($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel); + is($success, 0) + or diag("Relationship '$invalid_rel' reported erroneously as existent."); } @@ -100,7 +120,3 @@ is($success, 0) or diag("Service type '$invalid_st' reported erroneously as existent."); -my $invalid_rel = "HA"; -($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel); -is($success, 0) - or diag("Relationship '$invalid_rel' reported erroneously as existent."); From fgibbons at pub.open-bio.org Fri Sep 16 16:38:47 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 16 Sep 2005 12:38:47 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161638.j8GGclPb023772@pub.open-bio.org> fgibbons Fri Sep 16 12:38:47 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv23747/t Modified Files: Client-Service.t Log Message: - Update to reflect new API. moby-live/Perl/t Client-Service.t,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Service.t,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/02 14:29:30 1.4 +++ /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/09/16 16:38:47 1.5 @@ -26,16 +26,12 @@ }; -my @autoload = qw/serviceName/; +my @autoload = qw/serviceName service uri smessageVersion _soapService/; my @API = (@autoload, qw/new execute/); my $service = MOBY::Client::Service->new(); is($service, undef) or diag("Created a new service without supplying any WSDL - it ain't right, I tell you!"); # Can't do nothing without WSDL -foreach (@autoload) { eval{$service->$_()}; } # Call all autoloads, to create them. -can_ok("MOBY::Client::Service", @API) - or diag("MOBY::Client::Service doesn't implement full API."); - # Find a service at MOBY Central, try to create a local instance. my $C = MOBY::Client::Central->new(); my ($s, $r) = $C->findService( authURI => 'www.illuminae.com', @@ -46,6 +42,10 @@ isa_ok($service, "MOBY::Client::Service") or diag("Expected new to return MOBY::Client::Service"); +foreach (@autoload) { eval{$service->$_()}; } # Call all autoloads, to create them. +can_ok("MOBY::Client::Service", @API) + or diag("MOBY::Client::Service doesn't implement full API."); + # Empty WSDL should cause 'undef' to be returned, rather than empty Service object. my $emptyWSDL = ""; is(MOBY::Client::Service->new ( service => $emptyWSDL), undef) From fgibbons at pub.open-bio.org Fri Sep 16 16:39:17 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 16 Sep 2005 12:39:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161639.j8GGdHiP023805@pub.open-bio.org> fgibbons Fri Sep 16 12:39:17 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv23780/t Modified Files: Client-SimpleArticle.t Log Message: - TODO list no longer contains 'Everything' moby-live/Perl/t Client-SimpleArticle.t,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t 2005/09/02 14:32:15 1.2 +++ /home/repository/moby/moby-live/Perl/t/Client-SimpleArticle.t 2005/09/16 16:39:17 1.3 @@ -24,11 +24,6 @@ # Clean up after yourself, in case tests fail, or the interpreter is interrupted partway though... }; - -TODO: { - local $TODO = "Everything."; -} - my @autoload = qw/articleName objectType objectLSID namespaces id XML XML_DOM isSimple isCollection isSecondary/; my @API = (@autoload, qw/new addNamespace value /); # createFrom[XML|DOM] are not meant to be public From fgibbons at pub.open-bio.org Fri Sep 16 16:53:35 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 16 Sep 2005 12:53:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161653.j8GGrZtQ023874@pub.open-bio.org> fgibbons Fri Sep 16 12:53:35 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv23849/MOBY Modified Files: Config.pm Log Message: - Replace '||' with 'or' for correct behavior when file cannot be opened. moby-live/Perl/MOBY Config.pm,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Config.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Perl/MOBY/Config.pm 2005/08/02 15:18:00 1.8 +++ /home/repository/moby/moby-live/Perl/MOBY/Config.pm 2005/09/16 16:53:35 1.9 @@ -1,7 +1,6 @@ package MOBY::Config; -BEGIN { -} +BEGIN {} use strict; use Carp; use MOBY::dbConfig; @@ -15,7 +14,7 @@ #Encapsulated class data #___________________________________________________________ #ATTRIBUTES - my %_attr_data = # DEFAULT ACCESSIBILITY + my %_attr_data = # DEFAULT ACCESSIBILITY ( mobycentral => [ undef, 'read/write' ], mobyobject => [ undef, 'read/write' ], @@ -47,7 +46,7 @@ } } -# the expected sectionons (listed above) will have their dbCOnfig objects available +# the expected sections (listed above) will have their dbConfig objects available # as methods. The unexpected sections will have their dbConfig objects available # by $dbConfig = $CONFIG->{section_title} sub new { @@ -70,10 +69,9 @@ ( -e $file ) || die "MOBY Configuration file $file doesn't exist $!\n"; chomp $file; if ( ( -e $file ) && ( !( -d $file ) ) ) { - open IN, - $file - || die - "can't open MOBY Configuration file $file for unknown reasons$!\n"; + open IN, $file + or die + "can't open MOBY Configuration file $file for unknown reasons: $!\n"; } my @sections = split /(\[\s*\S+\s*\][^\[]*)/s, join "", ; @@ -97,14 +95,10 @@ sub getDataAdaptor { my ( $self, %args ) = @_; - my $source = $args{datasource}; - $source ||= $args{source}; - $source ||= "mobycentral"; + my $source = $args{datasource} || $args{source} || "mobycentral"; if ( $self->{"${source}Adaptor"} ) { return $self->{"${source}Adaptor"} } ; # read from cache - my $username = - $self->$source - ->{username}; # $self->$source returns a MOBY::dbConfig object + my $username = $self->$source->{username};# $self->$source returns a MOBY::dbConfig object my $password = $self->$source->{password}; my $port = $self->$source->{port}; my $dbname = $self->$source->{dbname}; From fgibbons at pub.open-bio.org Fri Sep 16 17:01:11 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 16 Sep 2005 13:01:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161701.j8GH1Bmq023927@pub.open-bio.org> fgibbons Fri Sep 16 13:01:11 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv23895/MOBY/Client Modified Files: Central.pm Log Message: - Clean up some regular expressions, make easier to read. - ref operator returns scalar (string), so we should use string comparison. - Remove redundant "Title" in docs. That's what =head2 is for. - Clean up setting default values using short-circuiting || operator. moby-live/Perl/MOBY/Client Central.pm,1.123,1.124 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.123 retrieving revision 1.124 diff -u -r1.123 -r1.124 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/08/31 22:32:27 1.123 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/09/16 17:01:10 1.124 @@ -55,6 +55,9 @@ be sufficient for most or all MOBY Client activities written in Perl. +=cut + + =head1 AUTHORS Mark Wilkinson (markw at illuminae.com) @@ -70,7 +73,6 @@ =head2 new - Title : new Usage : my $MOBY = MOBY::Client::Central->new(Registries => \%regrefs) Function : connect to one or more MOBY-Central registries for searching @@ -140,8 +142,7 @@ ( Connections => [ undef, 'read/write' ], default_MOBY_servername => [ 'mobycentral', 'read/write' ], - default_MOBY_server => [ - + default_MOBY_server => [ 'http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl', 'read/write' ], @@ -239,119 +240,119 @@ } sub new { - my ( $caller, %args ) = @_; - my $caller_is_obj = ref($caller); - return $caller if $caller_is_obj; - my $class = $caller_is_obj || $caller; - my $proxy; - my $self = bless {}, $class; - foreach my $attrname ( $self->_standard_keys ) { - if ( exists $args{$attrname} ) { - $self->{$attrname} = $args{$attrname}; - } - elsif ($caller_is_obj) { - $self->{$attrname} = $caller->{$attrname}; - } - else { - $self->{$attrname} = $self->_default_for($attrname); - } - } - $self->Connections( [] ); # initialize; - - # if user has set up preferred servers, then use those by default - $self->default_MOBY_server( $ENV{MOBY_SERVER} ) if $ENV{MOBY_SERVER}; - $self->default_MOBY_uri( $ENV{MOBY_URI} ) if $ENV{MOBY_URI}; - $self->default_MOBY_type( $ENV{MOBY_TYPE} ) if $ENV{MOBY_TYPE}; - $self->default_MOBY_proxy( $ENV{MOBY_PROXY} ) if $ENV{MOBY_PROXY}; - if ( $self->Registries ) { - my $regno = 0; - my %reg = %{ $self->Registries }; - while ( my ( $name, $acc ) = each %reg ) { - $regno++; # count how many registries we have in total - my $url = $acc->{URL} ? $acc->{URL} : $self->default_MOBY_server; - my $uri = $acc->{URI} ? $acc->{URI} : $self->default_MOBY_uri; - my $type = $acc->{TYPE} ? $acc->{TYPE} : $self->default_MOBY_type; - my $proxy = - $acc->{PROXY} ? $acc->{PROXY} : $self->default_MOBY_proxy; - $type ||= 'soap'; - if ( lc($type) eq "get" ) { - push @{ $self->Connections }, [ $name, $type, $url ]; - } - else { - my @soapargs; - if ($proxy) { - @soapargs = ( $url, proxy => [ 'http' => $proxy ] ); - } - else { - @soapargs = ($url); - } - push @{ $self->Connections }, [ - $name, $type, - SOAP::Lite->proxy(@soapargs)->uri($uri)->on_fault( - sub { - my ( $soap, $res ) = @_; - die ref $res - ? $res->faultstring - : $soap->transport->status, - "\n ERROR ERROR ERROR\n"; - } - ) - ]; - } - } - $self->multiple_registries( $regno - 1 ) - ; # one is not "multiple", it is just a change in default -> set to "false" if only one + my ( $caller, %args ) = @_; + my $caller_is_obj = ref($caller); + return $caller if $caller_is_obj; + my $class = $caller_is_obj || $caller; + my $proxy; + my $self = bless {}, $class; + foreach my $attrname ( $self->_standard_keys ) { + if ( exists $args{$attrname} ) { + $self->{$attrname} = $args{$attrname}; + } + elsif ($caller_is_obj) { + $self->{$attrname} = $caller->{$attrname}; + } + else { + $self->{$attrname} = $self->_default_for($attrname); + } + } + $self->Connections( [] ); # initialize; + + # if user has set up preferred servers, then use those by default + $self->default_MOBY_server( $ENV{MOBY_SERVER} ) if $ENV{MOBY_SERVER}; + $self->default_MOBY_uri( $ENV{MOBY_URI} ) if $ENV{MOBY_URI}; + $self->default_MOBY_type( $ENV{MOBY_TYPE} ) if $ENV{MOBY_TYPE}; + $self->default_MOBY_proxy( $ENV{MOBY_PROXY} ) if $ENV{MOBY_PROXY}; + if ( $self->Registries ) { + my $regno = 0; + my %reg = %{ $self->Registries }; + while ( my ( $name, $acc ) = each %reg ) { + $regno++; # count how many registries we have in total + my $url = $acc->{URL} ? $acc->{URL} : $self->default_MOBY_server; + my $uri = $acc->{URI} ? $acc->{URI} : $self->default_MOBY_uri; + my $type = $acc->{TYPE} ? $acc->{TYPE} : $self->default_MOBY_type; + my $proxy = $acc->{PROXY} ? $acc->{PROXY} : $self->default_MOBY_proxy; + $type ||= 'soap'; + if ( lc($type) eq "get" ) { + push @{ $self->Connections }, [ $name, $type, $url ]; + } + else { + my @soapargs; + if ($proxy) { + @soapargs = ( $url, proxy => [ 'http' => $proxy ] ); } else { - $self->multiple_registries(0); - if ( lc( $self->default_MOBY_type ) eq "get" ) { - push @{ $self->Connections }, - [ - $self->default_MOBY_servername, $self->default_MOBY_type, - $self->default_MOBY_server - ]; - } - else { - $self->Registries( - { - $self->default_MOBY_servername => { - URL => $self->default_MOBY_server, - URI => $self->default_MOBY_uri - } - } - ); - my @soapargs; - if ( $self->default_MOBY_proxy ) { - @soapargs = ( - $self->default_MOBY_server, - proxy => [ 'http' => $self->default_MOBY_proxy ] - ); - } - else { - @soapargs = ( $self->default_MOBY_server ); - } - push @{ $self->Connections }, [ - $self->default_MOBY_servername, - $self->default_MOBY_type, - SOAP::Lite->proxy(@soapargs)->uri( $self->default_MOBY_uri ) - ->on_fault( - sub { - my ( $soap, $res ) = @_; - die ref $res - ? $res->faultstring - : $soap->transport->status, "\n ERROR ERROR ERROR\n"; - } - ) - ]; - } + @soapargs = ($url); } - return undef unless $self->Connection(); # gotta have at least one... - return $self; + push @{ $self->Connections }, + [ + $name, $type, + SOAP::Lite->proxy(@soapargs)->uri($uri)->on_fault( + sub { + my ( $soap, $res ) = @_; + die ref $res + ? $res->faultstring + : $soap->transport->status, + "\n ERROR ERROR ERROR\n"; + } + ) + ]; + } + } + $self->multiple_registries( $regno - 1 ) + ; # one is not "multiple", it is just a change in default -> set to "false" if only one + } + else { + $self->multiple_registries(0); + if ( lc( $self->default_MOBY_type ) eq "get" ) { + push @{ $self->Connections }, + [ + $self->default_MOBY_servername, $self->default_MOBY_type, + $self->default_MOBY_server + ]; + } + else { + $self->Registries( + { + $self->default_MOBY_servername => { + URL => $self->default_MOBY_server, + URI => $self->default_MOBY_uri + } + } + ); + my @soapargs; + if ( $self->default_MOBY_proxy ) { + @soapargs = ( + $self->default_MOBY_server, + proxy => [ 'http' => $self->default_MOBY_proxy ] + ); + } + else { + @soapargs = ( $self->default_MOBY_server ); + } + push @{ $self->Connections }, + [ + $self->default_MOBY_servername, + $self->default_MOBY_type, + SOAP::Lite->proxy(@soapargs)->uri( $self->default_MOBY_uri ) + ->on_fault( + sub { + my ( $soap, $res ) = @_; + die ref $res + ? $res->faultstring + : $soap->transport->status, "\n ERROR ERROR ERROR\n"; + } + ) + ]; + } + } + return undef unless $self->Connection(); # gotta have at least one... + return $self; } =head2 registerObject a.k.a registerObjectClass - Title : registerObject ; registerObjectClass Usage : $REG = $MOBY->registerObject(%args) Usage : $REG = $MOBY->registerObjectClass(%args) Function : register a new type of MOBY Object @@ -383,18 +384,13 @@ "Contact email address (contactEmail parameter) is required for object registration" ) if ( !$a{contactEmail} ); - my $term = $a{'objectType'}; - $term ||= ""; - my $desc = $a{'description'}; - $desc ||= ""; + my $term = $a{'objectType'} || ""; + my $desc = $a{'description'} || ""; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - my $contactEmail = $a{'contactEmail'}; - $contactEmail ||= ""; - my $authURI = $a{'authURI'}; - $authURI ||= ""; - $authURI ||= ""; + my $contactEmail = $a{'contactEmail'} || ""; + my $authURI = $a{'authURI'} || ""; my %Relationships = %{ $a{'Relationships'} }; my $clobber = $a{'Clobber'} ? $a{'Clobber'} : 0; my $message = " @@ -427,7 +423,6 @@ =head2 deregisterObject a.k.a. deregisterObjectClass - Title : deregisterObject ; deregisterObjectClass Usage : $REG = $MOBY->deregisterObject(%args) Usage : $REG = $MOBY->deregisterObjectClass(%args) Function : deregister a MOBY Object @@ -447,8 +442,7 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $id = $a{'objectType'}; - $id ||= ""; + my $id = $a{'objectType'} || ""; my $message = " $id @@ -461,7 +455,6 @@ =head2 retrieveObjectDefinition - Title : retrieveObjectDefinition Usage : $DEF = $MOBY->retrieveObjectDefinition($objectType[,$registry]) Function : retrieve the $XML that was used to register an object and its relationships Returns : hashref, identical to the hash sent during Object registration, plus @@ -567,7 +560,6 @@ =head2 registerServiceType - Title : registerServiceType Usage : $REG = $MOBY->registerServiceType(%args) Function : register a new MOBY Service type Returns : MOBY::Registration object @@ -585,17 +577,14 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $type = $a{'serviceType'}; - $type ||= ""; + my $type = $a{'serviceType'} || ""; my $desc = $a{'description'}; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } $desc ||= ""; - my $email = $a{'contactEmail'}; - $email ||= ""; - my $auth = $a{'authURI'}; - $auth ||= ""; + my $email = $a{'contactEmail'} || ""; + my $auth = $a{'authURI'} || ""; my %Relationships = %{ $a{'Relationships'} }; my $message = " @@ -620,7 +609,6 @@ =head2 deregisterServiceType - Title : deregisterServiceType Usage : $REG = $MOBY->deregisterServiceType(%args) Function : deregister a deprecated MOBY Service Type Returns : MOBY::Registration object @@ -634,8 +622,7 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $id = $a{'serviceType'}; - $id ||= ""; + my $id = $a{'serviceType'} || ""; my $message = " $id @@ -648,7 +635,6 @@ =head2 registerNamespace - Title : registerNamespace Usage : $REG = $MOBY->registerNamespace(%args) Function : register a new Namespace Returns : MOBY::Registration object @@ -665,17 +651,14 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $type = $a{'namespaceType'}; - $type ||= ""; - my $authURI = $a{'authURI'}; - $authURI ||= ""; + my $type = $a{'namespaceType'} || ""; + my $authURI = $a{'authURI'} || ""; my $desc = $a{'description'}; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } $desc ||= ""; - my $contact = $a{'contactEmail'}; - $contact ||= ""; + my $contact = $a{'contactEmail'} || ""; my $message = " $type @@ -691,7 +674,6 @@ =head2 deregisterNamespace - Title : deregisterNamespace Usage : $REG = $MOBY->deregisterNamespace(%args) Function : deregister a deprecated MOBY Namespace Returns : MOBY::Registration object @@ -705,8 +687,7 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $id = $a{'namespaceType'}; - $id ||= ""; + my $id = $a{'namespaceType'} || ""; my $message = " $id @@ -719,7 +700,6 @@ =head2 registerService - Title : registerService Usage : $REG = $MOBY->registerService(%args) Function : register a new MOBY Service instance Returns : MOBY::Registration object @@ -774,24 +754,17 @@ return $self->errorRegXML( "Function not allowed when querying multiple registries") if $self->multiple_registries; - my $name = $a{serviceName}; - $name ||= ""; - my $type = $a{serviceType}; - $type ||= ""; - my $authURI = $a{authURI}; - $authURI ||= ""; - my $email = $a{contactEmail}; - $email ||= ""; - my $URL = $a{URL}; - $URL ||= ""; - my $desc = $a{description}; - $desc ||= ""; + my $name = $a{serviceName} || ""; + my $type = $a{serviceType} || ""; + my $authURI = $a{authURI} || ""; + my $email = $a{contactEmail} || ""; + my $URL = $a{URL} || ""; + my $desc = $a{description} || ""; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - my $signatureURL = $a{signatureURL}; - $signatureURL ||= ""; + my $signatureURL = $a{signatureURL} || ""; my $Category = lc( $a{category} ); chomp $Category; $Category ||= ""; @@ -856,10 +829,10 @@ if ( $Category eq "moby" || $Category eq 'soap' ) { my %SEC; - if ( $a{'secondary'} && ( ref( $a{'secondary'} ) =~ /hash/i ) ) { + if ( $a{'secondary'} && ( ref( $a{'secondary'} ) eq 'HASH' ) ) { %SEC = %{ $a{secondary} }; } - elsif ( $a{'secondary'} && !( ref( $a{'secondary'} ) =~ /hash/i ) ) { + elsif ( $a{'secondary'} && ( ref( $a{'secondary'} ) ne 'HASH' ) ) { return $self->errorRegXML( "invalid structure of secondary parameters. Expected hashref." ); @@ -880,11 +853,11 @@ my ( $articleName, $def ) = @{$article}; $articleName ||= ""; my @Objects; # - unless ( (ref($def) =~ /array/i)) { # $def = [objType => \@ns] or $def=[[objType => \@ns]] + unless ( ref($def) eq 'ARRAY') { # $def = [objType => \@ns] or $def=[[objType => \@ns]] return $self->errorRegXML("invalid structure of $inout objects, expected SINGLE arrayref for article $articleName as required by the 0.86 API"); } my @objectdefs; - if ( ( ref $def->[0] ) =~ /array/i ) { # collection $def->[0] = [objType => \@ns] + if ( ( ref $def->[0] ) eq 'ARRAY' ) { # collection $def->[0] = [objType => \@ns] # def= [[objType2 => [ns3, ns4...]], ...] $message .= "\n"; if (scalar(@{$def->[0]} > 2)){ @@ -899,7 +872,7 @@ @objectdefs = ($def); } foreach my $objectdef (@objectdefs) { - if ( ( ref( $def->[0] ) ) =~ /array/i ) { + if ( ref( $def->[0] ) eq 'ARRAY' ) { $message .= "\n"; } else { @@ -908,7 +881,7 @@ my ( $type, $Namespaces ) = @{$objectdef}; $type ||= ""; $message .= "$type\n"; - unless ( ref($Namespaces) =~ /array/i ) { + unless ( ref($Namespaces) eq 'ARRAY' ) { return $self->errorRegXML( "invalid structure of $inout namespaces for object $type in article $articleName; expected arrayref" ); @@ -918,7 +891,7 @@ } $message .= "\n"; } - if ( ( ref( $def->[0] ) ) =~ /array/i ) { + if ( ref( $def->[0] ) eq 'ARRAY' ) { $message .= "\n"; } } @@ -939,7 +912,7 @@ # $message .= "\n"; while ( my ( $param, $desc ) = each %SEC ) { - unless ( ( ref($desc) ) =~ /hash/i ) { + unless ( ref($desc) eq 'HASH' ) { return $self->errorRegXML( "invalid structure of secondary article $param; expected hashref of limitations" ); } @@ -953,15 +926,12 @@ return $self->errorRegXML("a secondaryArticle must contain at least a datatype value in secondary article $param" ); } - unless ( ( $datatype =~ /Integer/ ) - || ( $datatype =~ /Float/ ) - || ( $datatype =~ /String/ ) - || ( $datatype =~ /DateTime/ ) ) + unless ( $datatype =~ /Integer|Float|String|DateTime/ ) { return $self->errorRegXML("a secondaryArticle must have a datatype of Integer, Float, String, or DateTime" ); } - unless ( ( ref($enums) ) =~ /array/i ) { + unless ( ref($enums) eq 'ARRAY' ) { return $self->errorRegXML("invalid structure of enum limits in secondary article $param; expected arrayref" ); } @@ -1029,9 +999,7 @@ =head2 registerServiceWSDL - Title : registerServiceWSDL - Usage : not yet implemented - + Usage : Needs documentation =cut @@ -1050,7 +1018,6 @@ =head2 deregisterService - Title : deregisterService Usage : $REG = $MOBY->deregisterService(%args) Function : deregister a registered MOBY Service Returns : MOBY::Registration object @@ -1087,7 +1054,6 @@ =head2 findService - Title : findService Usage : ($ServiceInstances, $RegObject) = $MOBY->findService(%args) Function : Find services that match certain search criterion Returns : ON SUCCESS: arrayref of MOBY::Client::ServiceInstance objects, and undef @@ -1123,23 +1089,15 @@ my ( $self, %a ) = @_; my $reg = ( $a{Registry} ) ? $a{Registry} : $self->default_MOBY_servername; my $id = $a{'serviceID'}; - my $servicename = $a{'serviceName'}; - $servicename ||= ""; - my $authoritative = $a{'authoritative'}; - $authoritative ||= 0; - my $serviceType = $a{'serviceType'}; - $serviceType ||= ""; - my $authURI = $a{'authURI'}; - $authURI ||= ""; - my $category = $a{'category'}; - $category ||= "moby"; - my $exObj = $a{'expandObjects'}; - $exObj ||= 0; - my $exServ = $a{'expandServices'}; - $exServ ||= 0; - my $kw = $a{'keywords'}; - $kw ||= []; - ref($kw) =~ /array/i || return ( + my $servicename = $a{'serviceName'} || ""; + my $authoritative = $a{'authoritative'} || 0; + my $serviceType = $a{'serviceType'} || ""; + my $authURI = $a{'authURI'} || ""; + my $category = $a{'category'} || "moby"; + my $exObj = $a{'expandObjects'} || 0; + my $exServ = $a{'expandServices'} || 0; + my $kw = $a{'keywords'} || []; + ref($kw) eq 'ARRAY' || return ( undef, $self->errorRegXML( "invalid structure of keywords. Expected arrayref" @@ -1168,7 +1126,7 @@ #$a{input} = [[]] unless (defined $a{input}); #$a{output} = [[]] unless (defined $a{output}); - if ( defined $a{input} && !( ref( $a{input} ) =~ /array/i ) ) { + if ( defined $a{input} && ( ref( $a{input} ) ne 'ARRAY' ) ) { return ( undef, $self->errorRegXML( @@ -1176,7 +1134,7 @@ ) ); } - if ( defined $a{output} && !( ref( $a{output} ) =~ /array/i ) ) { + if ( defined $a{output} && ( ref( $a{output} ) ne 'ARRAY' ) ) { return ( undef, $self->errorRegXML( @@ -1198,12 +1156,12 @@ die "no inout parameter from teh funkyhash" unless defined $inout; die "no param parameter from teh funkyhash" unless defined $param; die "param parameter should be a listref" - unless ( ref($param) =~ /ARRAY/ ); + unless ( ref($param) eq 'ARRAY' ); my $inout_lc = lc($inout); my @PARAM = @{$param}; $message .= "<${inout_lc}Objects><${inout}>\n"; foreach my $param (@PARAM) { - unless ( ref($param) =~ /array/i ) { + unless ( ref($param) eq 'ARRAY' ) { return ( undef, $self->errorRegXML( @@ -1216,7 +1174,7 @@ #warn "no namespace part of the param" unless defined $namespaces; my @objectdefs; - if ( ( ref $class ) =~ /array/i ) { # collection + if ( ref $class eq 'ARRAY' ) { # collection $message .= "\n"; @objectdefs = $class; } @@ -1229,7 +1187,7 @@ die "type is missing from objectdef " unless $type; $message .= "$type\n"; if ( defined($Namespaces) - && !( ref($Namespaces) =~ /array/i ) ) + && ( ref($Namespaces) ne 'ARRAY' ) ) { return ( undef, @@ -1244,7 +1202,7 @@ } $message .= "\n"; } - if ( ( ref($class) ) =~ /array/i ) { + if ( ref($class) eq 'ARRAY' ) { $message .= "\n"; } } @@ -1259,7 +1217,6 @@ =head2 retrieveService - Title : retrieveService Usage : $WSDL = $MOBY->retrieveService($ServiceInstance) Function : get the WSDL definition of the service with this name/authority URI Returns : a WSDL string @@ -1304,7 +1261,6 @@ =head2 retrieveResourceURLs - Title : retrieveResourceURLs() Usage : $names = $MOBY->retrieveResourceURLs() Function : get a hash of the URL's for each of the MOBY ontologies Returns : hashref to the following hash @@ -1336,7 +1292,6 @@ =head2 retrieveServiceNames - Title : retrieveServiceNames(%args) Usage : $names = $MOBY->retrieveServiceNames([$reg_name]) Function : get a (redundant) list of all registered service names (N.B. NOT service types!) @@ -1382,7 +1337,6 @@ =head2 retrieveServiceProviders - Title : retrieveServiceProviders Usage : @URIs = $MOBY->retrieveServiceProviders([$reg_name]) Function : get the list of all provider's AuthURI's Returns : list of service provider URI strings @@ -1413,7 +1367,6 @@ =head2 retrieveServiceTypes - Title : retrieveServiceTypes(%args) Usage : $types = $MOBY->retrieveServiceTypes([$reg_name]) Function : get the list of all registered service types Returns : hashref of $types{$type} = $definition @@ -1463,7 +1416,6 @@ =head2 retrieveObjectNames - Title : retrieveObjectNames(%args) Usage : $names = $MOBY->retrieveObjectNames([$reg_name]) Function : get the list of all registered Object types Returns : hashref of hash: @@ -1511,7 +1463,6 @@ =head2 retrieveNamespaces - Title : retrieveNamespaces(%args) Usage : $ns = $MOBY->retrieveNamespaces([$reg_name]) Function : get the list of all registered Namespace types Returns : hashref of hash: @@ -1562,7 +1513,6 @@ =head2 retrieveObject - Title : retrieveObject Usage : $objects = $MOBY->retrieveObjectNames(%args) Function : get the object xsd Returns : hashref of hash: @@ -1616,7 +1566,6 @@ =head2 Relationships - Title : Relationships Usage : $def = $MOBY->Relationships(%args) Function : traverse and return the relationships in the ontology Returns : hashref of $hash{relationship_type}=\@lsids @@ -1639,7 +1588,7 @@ my @relationships; @relationships = @{ $args{'Relationships'} } if ( $args{'Relationships'} - && ( ref( $args{'Relationships'} ) =~ /array/i ) ); + && ( ref( $args{'Relationships'} ) eq 'ARRAY' ) ); push @relationships, 'isa' unless $relationships[0]; # need to have at least one relationship my $reg = $args{'Registry'}; my $m; @@ -1714,7 +1663,6 @@ =head2 ISA - Title : ISA Usage : $def = $MOBY->ISA($class1, $class2) Function : a pre-canned use of the Relationships function to quickly get an answer to whether class1 ISA class2 @@ -1760,8 +1708,6 @@ =head2 DUMP - - Title : DUMP Usage : ($mobycentral, $mobyobject, $mobyservice, $mobynamespace, $mobyrelationship) = $MOBY->DUMP(['registry']) Function : DUMP the mysql for the current MOBY Central database Returns : text @@ -1919,7 +1865,6 @@ =head2 LSID_CACHE - Title : LSID_CACHE Usage : $lsid = $MOBY->LSID_CACHE($term, $lsid) Function : get/set LSID from the cache Returns : lsid as a scalar @@ -1944,7 +1889,6 @@ =head2 ISA_CACHE - Title : ISA_CACHE Usage : @lsids = $MOBY->ISA_CACHE($lsid, \@isas) Function : get/set the ISA relationships in the cache Returns : list of ISA relationships. The ISA list @@ -1959,7 +1903,7 @@ sub ISA_CACHE { my ( $self, $desiredterm, $isas ) = @_; my $term = $desiredterm; - return (undef) if $isas && !( ref($isas) =~ /ARRAY/ ); + return (undef) if $isas && ( ref($isas) ne 'ARRAY'); if ( $term && $isas ) { my @isalsids; foreach (@$isas){ From fgibbons at pub.open-bio.org Fri Sep 16 17:02:01 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Fri, 16 Sep 2005 13:02:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509161702.j8GH21nX023960@pub.open-bio.org> fgibbons Fri Sep 16 13:02:01 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv23935/MOBY/Client Modified Files: CollectionArticle.pm Log Message: - No "title" in pod. moby-live/Perl/MOBY/Client CollectionArticle.pm,1.11,1.12 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm 2004/12/14 22:31:30 1.11 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/CollectionArticle.pm 2005/09/16 17:02:01 1.12 @@ -8,7 +8,10 @@ =head1 NAME -MOBY::Client::CollectionArticle - a small object describing the Collection articles from the findService Response message of MOBY Central or representing the collection part of a MOBY invocation or response block +MOBY::Client::CollectionArticle - a small object describing the +Collection articles from the findService Response message of MOBY +Central or representing the collection part of a MOBY invocation or +response block =head1 SYNOPSIS @@ -39,10 +42,6 @@ } - - -=cut - =head1 DESCRIPTION This describes the Collection articles from either the findService Response of MOBY Central @@ -86,14 +85,11 @@ Mark Wilkinson (markw at illuminae dot com) -=cut - =head1 METHODS =head2 new - Title : new Usage : my $IN = MOBY::Client::CollectionArticle->new(%args) Function : create CollectionArticle object Returns : MOBY::Client::SimpleArticle object @@ -103,62 +99,44 @@ XML => $XML XML_DOM => $XML::DOM::NODE -=cut - =head2 articleName - Title : articleName Usage : $name = $IN->articleName($name) Function : get/set articleName Returns : string Arguments : (optional) string to set articleName -=cut - =head2 Simples - Title : Simples Usage : $type = $IN->Simples(\@SimpleArticles) Function : get/set name Returns : arrayRef of MOBY::Client::SimpleArticle's in this collection Arguments : (optional) arrayRef of MOBY::Client::SimpleArticle's in this collection -=cut - =head2 addSimple - Title : addSimple Usage : $namespaces = $IN->addNamespace($SimpleArticle) Function : add another SimpleArticle Returns : arrayref of MOBY::Client::SimpleArticle's or 0 if argument was not a MOBY::Client::SimpleArticle (or other failure) Arguments : a new MOBY::Client::SimpleArticle to add to collection -=cut - =head2 XML - Title : XML Usage : $SA = $SA->XML($XML) Function : set/reset all parameters for this object from the XML Returns : MOBY::Client::SimpleArticle Arguments : (optional) XML fragment from and including ... -=cut - =head2 XML_DOM - Title : XML_DOM Usage : $namespaces = $SA->XML_DOM($XML_DOM_NODE) Function : set/reset all parameters for this object from the XML::DOM node for Returns : MOBY::Client::SimpleArticle Arguments : (optional) an $XML::DOM node from the article of a DOM -=cut - =head2 isSimple - Title : isSimple Usage : $boolean = $IN->isSimple() Function : is this a SimpleArticle type (yes, I know this is obvious, but since you can @@ -167,11 +145,8 @@ to test what you have in-hand) Returns : 0 (false) -=cut - =head2 isCollection - Title : isCollection Usage : $boolean = $IN->isCollection() Function : is this a CollectionArticle type (yes, I know this is obvious, but since you can @@ -180,11 +155,8 @@ to test what you have in-hand) Returns : 1 (true) -=cut - =head2 isSecondary - Title : isSecondary Usage : $boolean = $IN->isSecondary() Function : is this a SecondaryArticle type? (yes, I know this is obvious) @@ -198,10 +170,10 @@ # DATA #___________________________________________________________ #ATTRIBUTES - my %_attr_data = # DEFAULT ACCESSIBILITY + my %_attr_data = # DEFAULT ACCESSIBILITY ( - articleName => [ undef, 'read/write' ], - Simples => [ [], 'read/write' ], + articleName => [ undef, 'read/write' ], + Simples => [ [], 'read/write' ], isSimple => [ 0, 'read' ], isSecondary => [ 0, 'read' ], isCollection => [ 1, 'read' ], From senger at pub.open-bio.org Sun Sep 18 07:26:07 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 03:26:07 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180726.j8I7Q7X5010118@pub.open-bio.org> senger Sun Sep 18 03:26:07 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv10099 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.3,1.4 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/13 06:42:26 1.3 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 07:26:06 1.4 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Sun Sep 18 08:35:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:35:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180835.j8I8ZWHV022465@pub.open-bio.org> senger Sun Sep 18 04:35:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard In directory pub.open-bio.org:/tmp/cvs-serv22447/src/config/dashboard Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard added to the repository moby-live/Java/src/config/dashboard - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 08:35:44 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:35:44 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180835.j8I8Zi3c022515@pub.open-bio.org> senger Sun Sep 18 04:35:44 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF In directory pub.open-bio.org:/tmp/cvs-serv22497/src/config/dashboard/META-INF Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF added to the repository moby-live/Java/src/config/dashboard/META-INF - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 08:35:56 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:35:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180835.j8I8ZuJr022567@pub.open-bio.org> senger Sun Sep 18 04:35:56 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv22547/src/config/dashboard/META-INF/services Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services added to the repository moby-live/Java/src/config/dashboard/META-INF/services - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 08:36:21 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:36:21 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180836.j8I8aLPH022625@pub.open-bio.org> senger Sun Sep 18 04:36:20 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org In directory pub.open-bio.org:/tmp/cvs-serv22607/src/config/dashboard/org Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/org added to the repository moby-live/Java/src/config/dashboard/org - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 08:36:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:36:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180836.j8I8aWrj022675@pub.open-bio.org> senger Sun Sep 18 04:36:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby In directory pub.open-bio.org:/tmp/cvs-serv22657/src/config/dashboard/org/biomoby Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby added to the repository moby-live/Java/src/config/dashboard/org/biomoby - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 08:36:43 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:36:43 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180836.j8I8ahIv022725@pub.open-bio.org> senger Sun Sep 18 04:36:43 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service In directory pub.open-bio.org:/tmp/cvs-serv22707/src/config/dashboard/org/biomoby/service Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service added to the repository moby-live/Java/src/config/dashboard/org/biomoby/service - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 08:36:53 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:36:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180836.j8I8ar6Y022774@pub.open-bio.org> senger Sun Sep 18 04:36:53 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv22755/src/config/dashboard/org/biomoby/service/dashboard Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard added to the repository moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 08:37:04 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:37:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180837.j8I8b4dT022823@pub.open-bio.org> senger Sun Sep 18 04:37:04 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv22805/src/config/dashboard/org/biomoby/service/dashboard/images Log Message: Directory /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images added to the repository moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 08:43:50 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:43:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180843.j8I8hoVG023191@pub.open-bio.org> senger Sun Sep 18 04:43:50 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv23173/src/main/org/biomoby/service/dashboard/images Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images added to the repository moby-live/Java/src/main/org/biomoby/service/dashboard/images - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 08:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:46:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQPh023399@pub.open-bio.org> senger Sun Sep 18 04:46:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv23355/src/config Modified Files: run-any-client run-any-client.bat Log Message: moby-live/Java/src/config run-any-client,1.3,1.4 run-any-client.bat,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-any-client,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/config/run-any-client 2005/09/02 07:38:36 1.3 +++ /home/repository/moby/moby-live/Java/src/config/run-any-client 2005/09/18 08:46:25 1.4 @@ -15,6 +15,5 @@ CLASSPATH=${PROJECT_HOME}/build/others/skeletons:$CLASSPATH CLASSPATH=${PROJECT_HOME}/build/others/samples:$CLASSPATH CLASSPATH=`echo ${PROJECT_HOME}/lib/*.jar | tr ' ' ':'`:$CLASSPATH -###CLASSPATH=`echo ${PROJECT_HOME}/lib/ant_home/lib/*.jar | tr ' ' ':'`:$CLASSPATH exec java -cp $CLASSPATH "$@" =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-any-client.bat,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/09/01 08:01:16 1.3 +++ /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/09/18 08:46:25 1.4 @@ -1,12 +1,13 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd %PROJECT_HOME% set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" -set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" -set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" -set "CP=%PROJECT_HOME%\build\others\samples;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% +set CP=build\others\datatypes;%CP% +set CP=build\others\skeletons;%CP% +set CP=build\others\samples;%CP% java -classpath "%CP%" %1 %2 %3 %4 %5 %6 %7 %8 %9 From senger at pub.open-bio.org Sun Sep 18 08:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:46:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQ2g023503@pub.open-bio.org> senger Sun Sep 18 04:46:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv23355/src/main/org/biomoby/service/dashboard/images Added Files: registry.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images registry.gif,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 08:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:46:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQLn023376@pub.open-bio.org> senger Sun Sep 18 04:46:25 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv23355 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.31,1.32 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/13 06:53:28 1.31 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/18 08:46:25 1.32 @@ -211,6 +211,9 @@ + + + @@ -1325,48 +1328,28 @@ + + - + - - - - - - - - + - - - - - - - - + - + From senger at pub.open-bio.org Sun Sep 18 08:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:46:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQLt023415@pub.open-bio.org> senger Sun Sep 18 04:46:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv23355/src/config/dashboard/META-INF/services Added Files: org.biomoby.service.dashboard.DashboardPanel Log Message: moby-live/Java/src/config/dashboard/META-INF/services org.biomoby.service.dashboard.DashboardPanel,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 08:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:46:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQxl023431@pub.open-bio.org> senger Sun Sep 18 04:46:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv23355/src/config/dashboard/org/biomoby/service/dashboard/images Added Files: moby-small.gif whale-tail-small.jpg Log Message: moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard/images moby-small.gif,NONE,1.1 whale-tail-small.jpg,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 08:48:17 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:48:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180848.j8I8mHFF023621@pub.open-bio.org> senger Sun Sep 18 04:48:17 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard In directory pub.open-bio.org:/tmp/cvs-serv23606/src/config/dashboard Added Files: dashboard.properties Log Message: moby-live/Java/src/config/dashboard dashboard.properties,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 08:48:51 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:48:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180848.j8I8mpPc023684@pub.open-bio.org> senger Sun Sep 18 04:48:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/dashboard In directory pub.open-bio.org:/tmp/cvs-serv23669/src/config/dashboard Added Files: README Log Message: moby-live/Java/src/config/dashboard README,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 12:50:17 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 08:50:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181250.j8ICoHLr025902@pub.open-bio.org> senger Sun Sep 18 08:50:17 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv25883 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.4,1.5 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 07:26:06 1.4 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 12:50:17 1.5 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Sun Sep 18 13:02:35 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 09:02:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181302.j8ID2ZVd025966@pub.open-bio.org> senger Sun Sep 18 09:02:35 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv25947 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.5,1.6 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 12:50:17 1.5 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 13:02:35 1.6 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Sun Sep 18 14:05:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:05:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181405.j8IE5WYj026144@pub.open-bio.org> senger Sun Sep 18 10:05:32 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv26125 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.32,1.33 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/18 08:46:25 1.32 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/18 14:05:32 1.33 @@ -1338,9 +1338,12 @@ + + + From senger at pub.open-bio.org Sun Sep 18 14:05:33 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:05:33 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181405.j8IE5Xn1026159@pub.open-bio.org> senger Sun Sep 18 10:05:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv26125/src/config Added Files: run-dashboard run-dashboard.bat Log Message: moby-live/Java/src/config run-dashboard,NONE,1.1 run-dashboard.bat,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 14:09:42 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:09:42 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181409.j8IE9g67026288@pub.open-bio.org> senger Sun Sep 18 10:09:42 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/images In directory pub.open-bio.org:/tmp/cvs-serv26273/docs/images Added Files: whale-tail.jpg Log Message: moby-live/Java/docs/images whale-tail.jpg,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 14:09:42 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:09:42 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181409.j8IE9gr2026324@pub.open-bio.org> senger Sun Sep 18 10:09:42 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv26273/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java ConsolePanel.java Dashboard.java NOTES RegistryPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard AbstractPanel.java,1.4,1.5 ConsolePanel.java,1.2,1.3 Dashboard.java,1.2,1.3 NOTES,1.2,1.3 RegistryPanel.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/18 08:46:26 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/18 14:09:42 1.5 @@ -81,6 +81,7 @@ // something need to be done only once - keep it here protected Icon panelIcon; protected JComponent pComponent; + protected Icon confirmIcon; // re-use "style" components protected static final Insets BREATH_TOP = new Insets (10,0,0,0); @@ -276,7 +277,10 @@ * Return true if confirmation dialog passed. ********************************************************************/ public boolean confirm (Object msg) { - return SwingUtils.confirm (this, msg, null); + if (confirmIcon == null) + confirmIcon = + SwingUtils.createIcon ("images/confirmButton.gif", Dashboard.class); + return SwingUtils.confirm (this, msg, confirmIcon); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/18 08:46:26 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/18 14:09:42 1.3 @@ -15,7 +15,6 @@ import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JScrollPane; -import javax.swing.JViewport; import javax.swing.JTextArea; import javax.swing.JPanel; import javax.swing.text.html.HTMLDocument; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/18 08:46:26 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/18 14:09:42 1.3 @@ -10,6 +10,7 @@ import org.tulsoft.tools.gui.SwingUtils; import org.tulsoft.tools.gui.AwtUtils; +import org.tulsoft.tools.gui.ProgressView; import org.apache.commons.discovery.tools.Service; @@ -50,6 +51,7 @@ private JComponent dashboard; private StatusBar statusBar; private DashboardHeader header; + public static boolean useLoadMonitor = true; protected JTabbedPane tabbedPane; protected DashboardPanel[] panels; protected static Properties dashboardProperties; @@ -185,6 +187,11 @@ if (dashboard != null) return dashboard; + if (useLoadMonitor) { + ProgressView.monitor = new ProgressView (panels.length); + ProgressView.monitor.show ("Welcome to Biomoby Dashboard"); + } + // create itself JPanel p = new JPanel (new GridBagLayout(), true); @@ -192,10 +199,16 @@ tabbedPane = new JTabbedPane(); tabbedPane.addChangeListener (this); for (int i = 0; i < panels.length; i++) { - tabbedPane.addTab (panels[i].getName(), panels[i].getIcon(), panels[i].getComponent()); + String name = panels[i].getName(); + if (useLoadMonitor) + ProgressView.monitor.setTextAndAdd ("Loading " + name + "..."); + tabbedPane.addTab (name, panels[i].getIcon(), panels[i].getComponent()); } statusBar = getStatusBar(); + if (useLoadMonitor) + ProgressView.monitor.destroy(); + // put it all together SwingUtils.addComponent (p, header, 0, 0, 1, 1, AbstractPanel.HORI, AbstractPanel.NWEST, 1.0, 0.0); SwingUtils.addComponent (p, tabbedPane, 0, 1, 1, 1, AbstractPanel.BOTH, AbstractPanel.NWEST, 1.0, 1.0); @@ -295,6 +308,8 @@ * **************************************************************************/ public static void main (String[] args) { + if (args.length > 0 && args[0].equals ("-nop")) + Dashboard.useLoadMonitor = false; new Dashboard().show(); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/18 08:46:26 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/18 14:09:42 1.3 @@ -9,9 +9,7 @@ * configure dashbard (add/remove dynamically panels) * configure user preferences -* Registry panel: - - trees should be in panned blocks (user-resizable) - +* running from run-dashboard does not work Registry panel -------------- =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/18 08:46:26 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/18 14:09:42 1.5 @@ -18,10 +18,14 @@ import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JFileChooser; +import javax.swing.JSplitPane; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; import javax.swing.JComponent; import javax.swing.text.html.HTMLDocument; import java.awt.GridBagLayout; +import java.awt.Font; import java.awt.event.KeyEvent; import java.awt.event.ActionEvent; @@ -80,16 +84,38 @@ DataTypesTree dataTypesTree = new DataTypesTree(); NamespacesTree namespacesTree = new NamespacesTree(); + JSplitPane split1 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, + servicesTree.scrollable(), + dataTypesTree.scrollable()); + split1.setResizeWeight (0.5); + split1.setContinuousLayout (true); + split1.setOneTouchExpandable (true); + JSplitPane split2 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, + split1, + namespacesTree.scrollable()); + split2.setResizeWeight (0.7); + split2.setContinuousLayout (true); + split2.setOneTouchExpandable (true); + + // console panel + JPanel console = getConsole(); + + JSplitPane split3 = new JSplitPane (JSplitPane.VERTICAL_SPLIT, + split2, + console); + split3.setResizeWeight (0.75); + split3.setContinuousLayout (true); + split3.setOneTouchExpandable (true); + + // registry and cache locations JPanel regLocation = getRegistryLocation(); JPanel cacheLocation = getCacheLocation(); // put all together - SwingUtils.addComponent (pComponent, servicesTree.scrollable(), 0, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); - SwingUtils.addComponent (pComponent, dataTypesTree.scrollable(), 1, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); - SwingUtils.addComponent (pComponent, namespacesTree.scrollable(), 2, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); - SwingUtils.addComponent (pComponent, regLocation, 3, 0, 1, 1, HORI, NWEST, 0.1, 0.0); - SwingUtils.addComponent (pComponent, cacheLocation, 3, 1, 1, 1, HORI, NWEST, 0.1, 0.0); + SwingUtils.addComponent (pComponent, split3, 0, 0, 1, 2, BOTH, NWEST, 1.0, 1.0); + SwingUtils.addComponent (pComponent, regLocation, 1, 0, 1, 1, HORI, NWEST, 0.0, 0.0); + SwingUtils.addComponent (pComponent, cacheLocation, 1, 1, 1, 1, HORI, NWEST, 0.0, 0.0); return pComponent; } @@ -235,6 +261,35 @@ /************************************************************************** * **************************************************************************/ + protected JPanel getConsole() { + JPanel p = new JPanel (new GridBagLayout()); + + JTextArea textArea = new JTextArea(); + textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); + textArea.setEditable (false); + JScrollPane scroller = new JScrollPane (textArea); + +// JButton cleanButton = +// createButton (" Clean ", +// "Remove all messages from the console area", +// KeyEvent.VK_C, +// new ActionListener() { +// public void actionPerformed (ActionEvent e) { +// if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) +// textArea.setText (""); +// } +// }); + + // put it together + SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); +// SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); + + return p; + } + + /************************************************************************** + * + **************************************************************************/ class ServicesTree extends CommonTree { public ServicesTree() { super ("Services"); From senger at pub.open-bio.org Sun Sep 18 14:12:01 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:12:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181412.j8IEC117026412@pub.open-bio.org> senger Sun Sep 18 10:12:01 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv26397/src/main/org/biomoby/service/dashboard/images Added Files: confirmButton.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images confirmButton.gif,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 14:36:13 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:36:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181436.j8IEaDWV026495@pub.open-bio.org> senger Sun Sep 18 10:36:13 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard In directory pub.open-bio.org:/tmp/cvs-serv26477/src/samples-resources/GCP-dashboard Log Message: Directory /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard added to the repository moby-live/Java/src/samples-resources/GCP-dashboard - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 14:36:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:36:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181436.j8IEaqUc026537@pub.open-bio.org> senger Sun Sep 18 10:36:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv26519/images Log Message: Directory /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images added to the repository moby-live/Java/src/samples-resources/GCP-dashboard/images - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 14:36:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:36:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181436.j8IEaqV3026555@pub.open-bio.org> senger Sun Sep 18 10:36:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF In directory pub.open-bio.org:/tmp/cvs-serv26519/META-INF Log Message: Directory /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF added to the repository moby-live/Java/src/samples-resources/GCP-dashboard/META-INF - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 14:36:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:36:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181436.j8IEaq05026573@pub.open-bio.org> senger Sun Sep 18 10:36:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv26519/META-INF/services Log Message: Directory /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services added to the repository moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sun Sep 18 14:38:27 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:38:27 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181438.j8IEcRaA026639@pub.open-bio.org> senger Sun Sep 18 10:38:27 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard In directory pub.open-bio.org:/tmp/cvs-serv26624/src/samples-resources/GCP-dashboard Added Files: README dashboard.properties Log Message: moby-live/Java/src/samples-resources/GCP-dashboard README,NONE,1.1 dashboard.properties,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 14:38:27 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:38:27 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181438.j8IEcRBb026654@pub.open-bio.org> senger Sun Sep 18 10:38:27 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services In directory pub.open-bio.org:/tmp/cvs-serv26624/src/samples-resources/GCP-dashboard/META-INF/services Added Files: org.biomoby.service.dashboard.DashboardPanel Log Message: moby-live/Java/src/samples-resources/GCP-dashboard/META-INF/services org.biomoby.service.dashboard.DashboardPanel,NONE,1.1 From senger at pub.open-bio.org Sun Sep 18 14:38:27 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 10:38:27 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509181438.j8IEcR7Y026670@pub.open-bio.org> senger Sun Sep 18 10:38:27 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/samples-resources/GCP-dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv26624/src/samples-resources/GCP-dashboard/images Added Files: dashboard.jpg dashboard2.jpg dashboard3.jpg gcp.png Log Message: moby-live/Java/src/samples-resources/GCP-dashboard/images dashboard.jpg,NONE,1.1 dashboard2.jpg,NONE,1.1 dashboard3.jpg,NONE,1.1 gcp.png,NONE,1.1 From senger at pub.open-bio.org Mon Sep 19 02:24:51 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 22:24:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190224.j8J2OphA028109@pub.open-bio.org> senger Sun Sep 18 22:24:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv28089/src/Clients Modified Files: CacheRegistryClient.java Log Message: remove Eclipse warnings moby-live/Java/src/Clients CacheRegistryClient.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/04 13:45:37 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/19 02:24:51 1.3 @@ -12,9 +12,7 @@ import org.tulsoft.shared.FileUtils; import org.tulsoft.shared.GException; -import java.net.*; import java.util.*; -import java.io.*; /** * This is a command-line client creating (and removing) a cache of a @@ -108,9 +106,9 @@ if (cmd.hasOption ("-fill")) { castWorker.removeFromCache (null); decorationLn ("Retrieving data types..."); - MobyDataType[] dataTypes = worker.getDataTypes(); + worker.getDataTypes(); decorationLn ("Retrieving services..."); - MobyService[] services = worker.getServices(); + worker.getServices(); } // From senger at pub.open-bio.org Mon Sep 19 08:08:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 04:08:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88WHH029116@pub.open-bio.org> senger Mon Sep 19 04:08:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv29075/docs Modified Files: ChangeLog Log Message: caching also namespaces moby-live/Java/docs ChangeLog,1.39,1.40 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/01 08:01:16 1.39 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/19 08:08:32 1.40 @@ -1,3 +1,7 @@ +2005-09-19 Martin Senger + + * Added caching for namespaces to CentralDigestCachedImpl + 2005-09-01 Martin Senger * Fixed the Windows run...bat scripts in order to accept spaces in From senger at pub.open-bio.org Mon Sep 19 08:08:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 04:08:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88WgU029097@pub.open-bio.org> senger Mon Sep 19 04:08:31 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv29075 Modified Files: build.xml Log Message: caching also namespaces moby-live/Java build.xml,1.33,1.34 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/18 14:05:32 1.33 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/19 08:08:31 1.34 @@ -545,7 +545,15 @@ ---> + --> + + + From senger at pub.open-bio.org Mon Sep 19 08:08:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 04:08:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88WBr029240@pub.open-bio.org> senger Mon Sep 19 04:08:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv29075/src/main/org/biomoby/client Modified Files: CentralDigestCachedImpl.java CentralImpl.java Log Message: caching also namespaces moby-live/Java/src/main/org/biomoby/client CentralDigestCachedImpl.java,1.5,1.6 CentralImpl.java,1.25,1.26 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/08/26 06:27:04 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/19 08:08:32 1.6 @@ -50,6 +50,7 @@ private String cacheDir; // as defined in the constructor protected File dataTypesCache; protected File servicesCache; + protected File namespacesCache; // cache age private long cacheAge = -1; @@ -95,11 +96,15 @@ long dataTypesCacheAge = (isCacheEmpty (dataTypesCache) ? -1 : dataTypesCache.lastModified()); servicesCache = createSubCacheDir (cache, "services"); long servicesCacheAge = (isCacheEmpty (servicesCache) ? -1 : servicesCache.lastModified()); + namespacesCache = createSubCacheDir (cache, "namespaces"); + long namespacesCacheAge = (isCacheEmpty (namespacesCache) ? -1 : namespacesCache.lastModified()); - if (dataTypesCacheAge > -1 && servicesCacheAge > -1) - cacheAge = Math.min (dataTypesCacheAge, servicesCacheAge); + if (dataTypesCacheAge > -1 && servicesCacheAge > -1 && namespacesCacheAge > -1) + cacheAge = Math.min (Math.min (dataTypesCacheAge, servicesCacheAge), + namespacesCacheAge); else - cacheAge = Math.max (dataTypesCacheAge, servicesCacheAge); + cacheAge = Math.max (Math.max (dataTypesCacheAge, servicesCacheAge), + namespacesCacheAge); } } @@ -318,6 +323,20 @@ } } + // + protected void fillNamespacesCache() + throws MobyException { + try { + String xml = getNamespacesAsXML(); + store (namespacesCache, "all_namespaces_in_one_go", xml); + if (cacheAge <= 0) + cacheAge = namespacesCache.lastModified(); + + } catch (Exception e) { + throw new MobyException (formatException (e)); + } + } + // read all data types public MobyDataType[] getDataTypes() throws MobyException { @@ -375,6 +394,35 @@ } } +// public MobyNamespace[] getNamespaces() + public Map getNamespaces() + throws MobyException { + if (namespacesCache == null) + return super.getNamespaces(); + synchronized (namespacesCache) { + if (isCacheEmpty (namespacesCache)) { + initCache(); + fillNamespacesCache(); + } + File[] list = namespacesCache.listFiles(); + if (list == null) + throw new MobyException + ("Surprisingly, '" + namespacesCache.getAbsolutePath() + "' is not a directory. Strange..."); + for (int i = 0; i < list.length; i++) { + try { + if (list[i].getPath().endsWith ("~")) + continue; // ignore some files + return createNamespacesFromXML (load (list[i])); + } catch (MobyException e) { + System.err.println ("Ignoring '" + list[i].getPath() + + "'. It should not be in the cache directory:" + + e.getMessage()); + } + } + } + return null; + } + /************************************************************************** * It always (if it functions as a cache which is when 'cacheDir' * was given) disables caching in the parent (so no memory caching =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/04 13:45:37 1.25 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/19 08:08:32 1.26 @@ -848,14 +848,26 @@ public Map getNamespaces() throws MobyException { + String result = getNamespacesAsXML(); + return createNamespacesFromXML (result); + } + + // + protected String getNamespacesAsXML() + throws MobyException { + return (String)doCall ("retrieveNamespaces", + new Object[] {}); + } + + // + protected Map createNamespacesFromXML (String result) + throws MobyException { + String cacheId = "retrieveNamespaces"; Map cachedResults = (Map)getContents (cacheId); if (cachedResults != null) return cachedResults; - String result = (String)doCall ("retrieveNamespaces", - new Object[] {}); - // parse returned XML Map results = new HashMap(); Document document = null; From senger at pub.open-bio.org Mon Sep 19 08:08:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 04:08:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88WMT029153@pub.open-bio.org> senger Mon Sep 19 04:08:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv29075/src/Clients Modified Files: MobyCmdLineClient.java MobyDigestClient.java MobyGraphs.java PopulateLocalCentralForTesting.java TestingCentral.java Log Message: caching also namespaces moby-live/Java/src/Clients MobyCmdLineClient.java,1.11,1.12 MobyDigestClient.java,1.2,1.3 MobyGraphs.java,1.9,1.10 PopulateLocalCentralForTesting.java,1.4,1.5 TestingCentral.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/09/04 13:45:37 1.11 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2005/09/19 08:08:32 1.12 @@ -13,7 +13,6 @@ import org.tulsoft.shared.StringUtils; import org.tulsoft.shared.GException; -import java.net.*; import java.util.*; import java.io.*; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/09/04 13:45:37 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/09/19 08:08:32 1.3 @@ -1,7 +1,9 @@ // MobyDigestClient.java // -// senger at ebi.ac.uk -// September 2004 +// Created: September 2004 +// +// This file is a component of the BioMoby project. +// Copyright Martin Senger (martin.senger at gmail.com). // import org.biomoby.shared.*; @@ -11,12 +13,15 @@ import org.tulsoft.shared.FileUtils; import org.tulsoft.shared.GException; +import java.util.Map; +import java.util.Iterator; + /** * A simple client retrieving and printing cummulative (digestive) * registry entries. It can collaborate with the locally cached * registry entries.

            * - * @author Martin Senger + * @author Martin Senger * @version $Id$ */ @@ -101,6 +106,17 @@ } } + // read all namespaces + if (cmd.hasOption ("-n")) { + Map namespaces = worker.getNamespaces(); + for (Iterator it = namespaces.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + System.out.println (entry.getKey()); + if (details) + System.out.println ("\t" + entry.getValue()); + } + } + } catch (Exception e) { System.err.println ("===ERROR==="); e.printStackTrace(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2005/09/04 13:45:37 1.9 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2005/09/19 08:08:32 1.10 @@ -14,7 +14,6 @@ import org.tulsoft.shared.FileUtils; import org.tulsoft.shared.GException; -import java.net.*; import java.util.*; import java.io.*; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/PopulateLocalCentralForTesting.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/Clients/PopulateLocalCentralForTesting.java 2005/05/19 15:57:24 1.4 +++ /home/repository/moby/moby-live/Java/src/Clients/PopulateLocalCentralForTesting.java 2005/09/19 08:08:32 1.5 @@ -7,9 +7,6 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import java.net.*; -import java.util.*; - /** * This is a very specialized client, meant solely for testing * purposes, and to be used on a local installation of a Moby Central =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/08/31 00:48:39 1.5 +++ /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/09/19 08:08:32 1.6 @@ -8,7 +8,6 @@ import org.biomoby.shared.*; import org.biomoby.client.*; -import java.net.*; import java.util.*; /** From senger at pub.open-bio.org Mon Sep 19 08:08:33 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 04:08:33 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88WK6029270@pub.open-bio.org> senger Mon Sep 19 04:08:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv29075/src/main/org/biomoby/service/dashboard Modified Files: NOTES RegistryPanel.java Log Message: caching also namespaces moby-live/Java/src/main/org/biomoby/service/dashboard NOTES,1.3,1.4 RegistryPanel.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/18 14:09:42 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/19 08:08:32 1.4 @@ -1,9 +1,16 @@ TODO with views: ---------------- +* change onMethods() to be protected or even private... + +* add a progress bar to the status bar (on the right) + - add also a cancel buton there + - do not allow more than one progressbar-aware action in the same time + file:///c/Development/java-tutorial/uiswing/components/progress.html + ? small icons to buttons ? use FileSystemView in file choosers -* alltools2: - PrefsUtils may become just a common parent for both *WithHistory classes - - combo box history is not updated if exit happened while focus is till in the text field +? alltools2: + - combo box history is not updated if exit happened while focus is till in the text field ? configure dashboard from menu: * configure dashbard (add/remove dynamically panels) @@ -11,6 +18,20 @@ * running from run-dashboard does not work +TODO for cache: +--------------- +* add namespaces and service types +* store services under names: authority-service_name +* emit log events +* poor-man update: keep what's there but add what is not there + (and perhaps delete what should not be thre) - but do not + check any age of existing +* getInfo() method +* corresponding changes with command-line clients for cache + implementations + +? start to work on/think of the RDF-based cache + Registry panel -------------- =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/18 14:09:42 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/19 08:08:32 1.6 @@ -52,6 +52,9 @@ // names of user preferences keys static final String USE_CACHE = "use-cache"; + // associated model working behind the scenes + RegistryModel registryModel; + // components that are used from more methods JFileChooserWithHistory cacheDir; JLabel labelCacheDir; @@ -70,6 +73,15 @@ // else if (prop.equalsIgnoreCase (PROP_DATA_IDENTITY)) setDataIdentity (newVal); } + /********************************************************************* + * Default constructor + ********************************************************************/ + public RegistryPanel() { + super(); +// registryModel = new RegistryModel (this); + registryModel = new RegistryModel(); + } + /************************************************************************** * **************************************************************************/ @@ -153,7 +165,7 @@ /************************************************************************** * **************************************************************************/ - public void onUseCache (boolean enabled) { + protected void onUseCache (boolean enabled) { cacheDir.setEnabled (enabled); labelCacheDir.setEnabled (enabled); setPrefValue (USE_CACHE, enabled); @@ -331,4 +343,34 @@ } +// public void actionPerformed(ActionEvent e) { +// ... +// if (icon == null) { //haven't viewed this photo before +// loadImage(imagedir + pic.filename, current); +// } else { +// updatePhotograph(current, pic); +// } +// } +// ... +// //Load an image in a separate thread. +// private void loadImage(final String imagePath, final int index) { +// final SwingWorker worker = new SwingWorker() { +// ImageIcon icon = null; + +// public Object construct() { +// icon = new ImageIcon(getURL(imagePath)); +// return icon; //return value not used by this program +// } + +// //Runs on the event-dispatching thread. +// public void finished() { +// Photo pic = (Photo)pictures.elementAt(index); +// pic.setIcon(icon); +// if (index == current) +// updatePhotograph(index, pic); +// } +// }; +// worker.start(); +// } + } From senger at pub.open-bio.org Mon Sep 19 08:08:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 04:08:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190808.j8J88Wj6029217@pub.open-bio.org> senger Mon Sep 19 04:08:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config/templates In directory pub.open-bio.org:/tmp/cvs-serv29075/src/config/templates Modified Files: DataTypeTemplate.java MembersHASTemplate.java MethodsHASTemplate.java MethodsHAS_string_Template.java ServicePISetTemplate.java ServicePISimpleTemplate.java ServicePOSetTemplate.java ServicePOSimpleTemplate.java ServiceParameterTemplate.java ServiceSkeletonTemplate.java ToStringHASTemplate.java ToXMLHASTemplate.java Log Message: caching also namespaces moby-live/Java/src/config/templates DataTypeTemplate.java,1.1,1.2 MembersHASTemplate.java,1.1,1.2 MethodsHASTemplate.java,1.1,1.2 MethodsHAS_string_Template.java,1.1,1.2 ServicePISetTemplate.java,1.1,1.2 ServicePISimpleTemplate.java,1.1,1.2 ServicePOSetTemplate.java,1.1,1.2 ServicePOSimpleTemplate.java,1.1,1.2 ServiceParameterTemplate.java,1.1,1.2 ServiceSkeletonTemplate.java,1.1,1.2 ToStringHASTemplate.java,1.1,1.2 ToXMLHASTemplate.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/DataTypeTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/DataTypeTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/DataTypeTemplate.java 2005/09/19 08:08:32 1.2 @@ -6,11 +6,6 @@ package org.biomoby.shared.datatypes; -import org.biomoby.shared.MobyException; -import org.jdom.Element; -import java.util.Vector; -import java.util.Enumeration; - /** * Data type name: @DATATYPE at .
            * Authority: @AUTHORITY@
            @@ -57,8 +52,8 @@ /************************************************************************** * *************************************************************************/ - public Element toXML() { - Element elem_I_am_sorry_that_this_produces_a_warning = super.toXML(); + public org.jdom.Element toXML() { + org.jdom.Element elem_I_am_sorry_that_this_produces_a_warning = super.toXML(); elem_I_am_sorry_that_this_produces_a_warning.setName (DATA_TYPE_NAME); @TO_XML@ return elem_I_am_sorry_that_this_produces_a_warning; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/MembersHASTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/MembersHASTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/MembersHASTemplate.java 2005/09/19 08:08:32 1.2 @@ -1,5 +1,5 @@ /** An article name for a member of this object. */ public static final String ARTICLE_NAME_ at ESC_UPPER_ARTICLE_NAME@ = "@ARTICLE_NAME@"; // elements are of type @CHILDTYPE_NAME@ - protected Vector @ESC_ARTICLE_NAME@ = new Vector(); + protected java.util.Vector @ESC_ARTICLE_NAME@ = new java.util.Vector(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/MethodsHASTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/MethodsHASTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/MethodsHASTemplate.java 2005/09/19 08:08:32 1.2 @@ -19,7 +19,7 @@ * only one value *************************************************************************/ public void set_ at ESC_ARTICLE_NAME@ (@CHILDTYPE_NAME@[] value) { - this. at ESC_ARTICLE_NAME@ = new Vector(); + this. at ESC_ARTICLE_NAME@ = new java.util.Vector(); for (int i = 0; i < value.length; i++) set_ at ESC_ARTICLE_NAME@ (value[i]); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/MethodsHAS_string_Template.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/MethodsHAS_string_Template.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/MethodsHAS_string_Template.java 2005/09/19 08:08:32 1.2 @@ -21,7 +21,7 @@ * only one value *************************************************************************/ public void set_ at ESC_ARTICLE_NAME@ (String[] value) { - this. at ESC_ARTICLE_NAME@ = new Vector(); + this. at ESC_ARTICLE_NAME@ = new java.util.Vector(); for (int i = 0; i < value.length; i++) set_ at ESC_ARTICLE_NAME@ (value[i]); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServicePISetTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServicePISetTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServicePISetTemplate.java 2005/09/19 08:08:32 1.2 @@ -3,10 +3,10 @@ * * @param request represents input data coming from a client * @return a type specific object (that is known to this service) - * @throws MobyException if something goes wrong + * @throws org.biomoby.shared.MobyException if something goes wrong *************************************************************************/ public @DATATYPE@[] get_ at ESC_ARTICLE_NAME@Set (MobyJob request) - throws MobyException { + throws org.biomoby.shared.MobyException { return (@DATATYPE@[])request.getDataSet ("@ARTICLE_NAME@", "@DATATYPE@"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServicePISimpleTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServicePISimpleTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServicePISimpleTemplate.java 2005/09/19 08:08:32 1.2 @@ -3,9 +3,9 @@ * * @param request represents input data coming from a client * @return a type specific object (that is known to this service) - * @throws MobyException if something goes wrong + * @throws org.biomoby.shared.MobyException if something goes wrong *************************************************************************/ public @DATATYPE@ get_ at ESC_ARTICLE_NAME@ (MobyJob request) - throws MobyException { + throws org.biomoby.shared.MobyException { return (@DATATYPE@)request.getData ("@ARTICLE_NAME@", "@DATATYPE@"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSetTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSetTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSetTemplate.java 2005/09/19 08:08:32 1.2 @@ -3,10 +3,10 @@ * * @param response represents output data that will go to a client * @param values is to be stored in the 'response' - * @throws MobyException if something goes wrong + * @throws org.biomoby.shared.MobyException if something goes wrong *************************************************************************/ public void set_ at ESC_ARTICLE_NAME@Set (MobyJob response, @DATATYPE@[] values) - throws MobyException { + throws org.biomoby.shared.MobyException { response.setDataSet (values, "@ARTICLE_NAME@"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSimpleTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSimpleTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServicePOSimpleTemplate.java 2005/09/19 08:08:32 1.2 @@ -3,10 +3,10 @@ * * @param response represents output data that will go to a client * @param value is to be stored in the 'response' - * @throws MobyException if something goes wrong + * @throws org.biomoby.shared.MobyException if something goes wrong *************************************************************************/ public void set_ at ESC_ARTICLE_NAME@ (MobyJob response, @DATATYPE@ value) - throws MobyException { + throws org.biomoby.shared.MobyException { response.setData (value, "@ARTICLE_NAME@"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServiceParameterTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServiceParameterTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServiceParameterTemplate.java 2005/09/19 08:08:32 1.2 @@ -4,10 +4,10 @@ * * @param request represents input data coming from a client * @return value of a "secondary" parameter - * @throws MobyException if something goes wrong + * @throws org.biomoby.shared.MobyException if something goes wrong *************************************************************************/ public String getParameter_ at ESC_ARTICLE_NAME@ (MobyJob request) - throws MobyException { + throws org.biomoby.shared.MobyException { return request.getParameter ("@ARTICLE_NAME@"); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ServiceSkeletonTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ServiceSkeletonTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ServiceSkeletonTemplate.java 2005/09/19 08:08:32 1.2 @@ -4,8 +4,6 @@ package @PACKAGE_NAME@; import org.biomoby.service.BaseService; -import org.biomoby.shared.MobyException; -import org.biomoby.shared.parser.MobyParameter; import org.biomoby.shared.parser.MobyJob; import org.biomoby.shared.parser.MobyPackage; import org.biomoby.shared.datatypes.*; @@ -61,7 +59,7 @@ // and return an XML back return mobyOutput.toXML(); - } catch (MobyException e) { + } catch (org.biomoby.shared.MobyException e) { return error (e.getMessage(), mobyOutput); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ToStringHASTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ToStringHASTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ToStringHASTemplate.java 2005/09/19 08:08:32 1.2 @@ -1,2 +1,2 @@ - for (Enumeration en = @ESC_ARTICLE_NAME at .elements(); en.hasMoreElements(); ) + for (java.util.Enumeration en = @ESC_ARTICLE_NAME at .elements(); en.hasMoreElements(); ) buf_I_am_sorry_that_this_produces_a_warning.append ( ((@CHILDTYPE_NAME@)en.nextElement()).format (1) ); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/templates/ToXMLHASTemplate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/templates/ToXMLHASTemplate.java 2005/08/26 06:27:03 1.1 +++ /home/repository/moby/moby-live/Java/src/config/templates/ToXMLHASTemplate.java 2005/09/19 08:08:32 1.2 @@ -1,2 +1,2 @@ - for (Enumeration en = @ESC_ARTICLE_NAME at .elements(); en.hasMoreElements(); ) + for (java.util.Enumeration en = @ESC_ARTICLE_NAME at .elements(); en.hasMoreElements(); ) elem_I_am_sorry_that_this_produces_a_warning.addContent ( ((@CHILDTYPE_NAME@)en.nextElement()).toXML() ); From senger at pub.open-bio.org Mon Sep 19 08:09:22 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 04:09:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190809.j8J89Mqj029314@pub.open-bio.org> senger Mon Sep 19 04:09:22 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv29299/src/main/org/biomoby/service/dashboard Added Files: RegistryModel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard RegistryModel.java,NONE,1.1 From senger at pub.open-bio.org Mon Sep 19 08:11:53 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 04:11:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509190811.j8J8Briq029359@pub.open-bio.org> senger Mon Sep 19 04:11:53 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv29344/src/Clients Added Files: TestAnt.java Log Message: moby-live/Java/src/Clients TestAnt.java,NONE,1.1 From senger at pub.open-bio.org Mon Sep 19 16:19:27 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Mon, 19 Sep 2005 12:19:27 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509191619.j8JGJRgQ030536@pub.open-bio.org> senger Mon Sep 19 12:19:27 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv30520/Java/src/Clients Removed Files: TestAnt.java Log Message: moby-live/Java/src/Clients TestAnt.java,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/Clients/RCS/TestAnt.java,v: No such file or directory From senger at pub.open-bio.org Tue Sep 20 07:30:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 20 Sep 2005 03:30:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509200730.j8K7U9YS003941@pub.open-bio.org> senger Tue Sep 20 03:30:09 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs/images In directory pub.open-bio.org:/tmp/cvs-serv3903/images Modified Files: stylesheet.css Added Files: smile.gif smile_sad.gif Log Message: moby-live/Java/docs/images smile.gif,NONE,1.1 smile_sad.gif,NONE,1.1 stylesheet.css,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/images/stylesheet.css,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/docs/images/stylesheet.css 2005/08/29 13:21:59 1.4 +++ /home/repository/moby/moby-live/Java/docs/images/stylesheet.css 2005/09/20 07:30:09 1.5 @@ -93,3 +93,8 @@ color: navy; } +b.step { + background-color: white; + color: navy; + font-size: 8pt; + } From senger at pub.open-bio.org Tue Sep 20 07:30:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 20 Sep 2005 03:30:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509200730.j8K7U9nq003922@pub.open-bio.org> senger Tue Sep 20 03:30:09 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv3903 Modified Files: index.html Added Files: EclipseAndJMoby.html Log Message: moby-live/Java/docs EclipseAndJMoby.html,NONE,1.1 index.html,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/index.html,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Java/docs/index.html 2005/08/28 10:43:27 1.13 +++ /home/repository/moby/moby-live/Java/docs/index.html 2005/09/20 07:30:09 1.14 @@ -44,6 +44,7 @@

          • How to use jMoby @@ -89,7 +90,7 @@
            Martin Senger
            -Last modified: Sun Aug 28 19:37:25 2005 +Last modified: Tue Sep 20 12:21:24 2005
            From senger at pub.open-bio.org Tue Sep 20 07:43:25 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 20 Sep 2005 03:43:25 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509200743.j8K7hP2j004055@pub.open-bio.org> senger Tue Sep 20 03:43:25 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv4036 Modified Files: ToDo.html Log Message: moby-live/Java/docs ToDo.html,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ToDo.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/docs/ToDo.html 2005/05/19 11:00:41 1.3 +++ /home/repository/moby/moby-live/Java/docs/ToDo.html 2005/09/20 07:43:25 1.4 @@ -40,24 +40,10 @@
            MS - Generate a complete XML Schema for registered services. This -will allow to have complete WSDLs for BioMoby services, which will -further allow to use all existing tools using such WSDLs for -generating code and documentation. + Biomoby Dashboard - an ultimate GUI for maintaining and browsing Biomoby.

            -

            MS - Support for auto-generated clients (using the outcome of the -previous issue). -

            - -

            MS - Similar support for BioMoby service providers - a library -helping to hide SOAP and BioMoby envelope layers so service providers -can concentrate only on the business logic. -

            - -

            MS +
            ED More support for BioMoby complex data type in Taverna.

            @@ -84,9 +70,6 @@ reading directly RDF files with BioMoby entities.

            -

            - Consolidate all SOAP calls using (already in jMoby existing) -libraries SoapUtils and AxisUtils.

            @@ -94,7 +77,7 @@

            -

            Known bugs

            +

            Known bugs (see also Open-bio Bugzilla)

            @@ -119,7 +102,7 @@
            Martin Senger
            -Last modified: Thu May 19 11:20:08 2005 +Last modified: Tue Sep 20 16:34:17 2005
            From senger at pub.open-bio.org Tue Sep 20 07:48:14 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 20 Sep 2005 03:48:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509200748.j8K7mEK3004147@pub.open-bio.org> senger Tue Sep 20 03:48:14 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv4128 Modified Files: EclipseAndJMoby.html Log Message: moby-live/Java/docs EclipseAndJMoby.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/20 07:30:09 1.1 +++ /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/20 07:48:14 1.2 @@ -319,6 +319,10 @@ outside Eclipse you need refresh Eclipse: F5 or (jMoby) -> Refresh.

            +And, of course, for us, dinosaurs, change Windows +-> Preferences -> General -> Keys -> Modify -> +Schema to Emacs.

            + Good luck.

            @@ -326,7 +330,7 @@

            Martin Senger
            -Last modified: Tue Sep 20 16:21:13 2005 +Last modified: Tue Sep 20 16:39:39 2005
            From senger at pub.open-bio.org Tue Sep 20 15:17:55 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 20 Sep 2005 11:17:55 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509201517.j8KFHt51005654@pub.open-bio.org> senger Tue Sep 20 11:17:55 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv5631 Modified Files: ChangeLog EclipseAndJMoby.html Log Message: moby-live/Java/docs ChangeLog,1.40,1.41 EclipseAndJMoby.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/19 08:08:32 1.40 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/20 15:17:55 1.41 @@ -1,3 +1,8 @@ +2005-09-20 Martin Senger + + * Fixed CentralDigestImpl - it shows now correct service type + description. + 2005-09-19 Martin Senger * Added caching for namespaces to CentralDigestCachedImpl =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/20 07:48:14 1.2 +++ /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/20 15:17:55 1.3 @@ -32,7 +32,7 @@ ways to do" things in Eclipse (but not as many as in Perl ) so the steps described below may not represent the only way, and I do not claim that are the most -efficient - but TGB (The Good Thing) is that they work.

            +efficient - but TGT (The Good Thing) is that they work.

            jMoby is just like any other Ant-based Java project. It has its own build.xml and it has many @@ -330,7 +330,7 @@

            Martin Senger
            -Last modified: Tue Sep 20 16:39:39 2005 +Last modified: Wed Sep 21 00:09:16 2005
            From kawas at pub.open-bio.org Tue Sep 20 21:16:11 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 20 Sep 2005 17:16:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202116.j8KLGBJP006460@pub.open-bio.org> kawas Tue Sep 20 17:16:11 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv6435 Modified Files: Central.pm Log Message: added the suggestions asked for by martin. Code that has been added is commented out until a decision is made on whether to support the changes. Code marked by: #UNCOMMENT denotes code that should be uncommented to add functionality #COMMENT/REMOVE denotes code that should be removed in conjunction with the additions. Lines subject to removal: 2620, 2626, 2806 Lines subject to addition: 2621, 2627, 2807 moby-live/Perl/MOBY Central.pm,1.215,1.216 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.215 retrieving revision 1.216 diff -u -r1.215 -r1.216 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/08/31 22:44:29 1.215 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/20 21:16:11 1.216 @@ -2617,12 +2617,14 @@ my $OS = MOBY::OntologyServer->new( ontology => 'service' ); my %types = %{ $OS->retrieveAllServiceTypes() }; my $types = "\n"; - while ( my ( $serv, $descr ) = each %types ) { + while ( my ( $serv, $descr ) = each %types ) { #COMMENT/REMOVE +# while ( my ( $serv, $descr, $contact, $auth ) = each %types ) { #UNCOMMENT my ($desc, $lsid) = @$descr; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - $types .="\n\n\n"; + $types .="\n\n\n"; #COMMENT/REMOVE +# $types .="\n\n$contact\n$auth\n\n"; #UNCOMMENT } $types .= "\n"; return $types; @@ -2801,7 +2803,8 @@ if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - $ns .= "\n\n\n"; + $ns .= "\n\n\n"; #COMMENT/REMOVE +# $ns .= "\n\n$contact\n$auth\n\n";#UNCOMMENT } $ns .= ""; return $ns; From gss at pub.open-bio.org Tue Sep 20 22:37:03 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Tue, 20 Sep 2005 18:37:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202237.j8KMb33n006752@pub.open-bio.org> gss Tue Sep 20 18:37:03 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org In directory pub.open-bio.org:/tmp/cvs-serv6729 Removed Files: .mymetadata .project Log Message: Removed unused files moby-live/S-MOBY/ref-impl/semanticmoby.org .mymetadata,1.5,NONE .project,1.4,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/RCS/.mymetadata,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/RCS/.project,v: No such file or directory From gss at pub.open-bio.org Tue Sep 20 22:39:03 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Tue, 20 Sep 2005 18:39:03 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202239.j8KMd3jC006793@pub.open-bio.org> gss Tue Sep 20 18:39:03 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/.settings In directory pub.open-bio.org:/tmp/cvs-serv6771/S-MOBY/ref-impl/semanticmoby.org/.settings Removed Files: org.eclipse.core.resources.prefs Log Message: Removed unused files moby-live/S-MOBY/ref-impl/semanticmoby.org/.settings org.eclipse.core.resources.prefs,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/.settings/RCS/org.eclipse.core.resources.prefs,v: No such file or directory From gss at pub.open-bio.org Tue Sep 20 22:42:18 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Tue, 20 Sep 2005 18:42:18 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202242.j8KMgIsD006852@pub.open-bio.org> gss Tue Sep 20 18:42:18 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv6829/S-MOBY/ref-impl/semanticmoby.org/WebRoot Removed Files: log4j.properties smoby.example.properties Log Message: Removed unused files moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot log4j.properties,1.1,NONE smoby.example.properties,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/RCS/log4j.properties,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/RCS/smoby.example.properties,v: No such file or directory From gss at pub.open-bio.org Tue Sep 20 22:43:04 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Tue, 20 Sep 2005 18:43:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202243.j8KMh499006893@pub.open-bio.org> gss Tue Sep 20 18:43:04 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv6871/S-MOBY/ref-impl/semanticmoby.org/WebRoot Removed Files: .cvsignore Log Message: Removed unused files moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot .cvsignore,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/RCS/.cvsignore,v: No such file or directory From senger at pub.open-bio.org Wed Sep 21 01:12:21 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 20 Sep 2005 21:12:21 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210112.j8L1CLfm007280@pub.open-bio.org> senger Tue Sep 20 21:12:20 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv7261 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.34,1.35 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/19 08:08:31 1.34 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/21 01:12:20 1.35 @@ -100,6 +100,21 @@ + + + + + + + + + + @@ -276,7 +291,7 @@ packagenames="*.*" excludepackagenames="notyet" destdir="${javadoc.dir}" - classpathref="build.classpath" + classpathref="build.classpath.for.javadoc" defaultexcludes="yes" breakiterator="yes" windowtitle="jMoby" From senger at pub.open-bio.org Wed Sep 21 01:20:01 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Tue, 20 Sep 2005 21:20:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210120.j8L1K1Xe007374@pub.open-bio.org> senger Tue Sep 20 21:20:01 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv7350 Modified Files: EclipseAndJMoby.html Log Message: moby-live/Java/docs EclipseAndJMoby.html,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/20 15:17:55 1.3 +++ /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/21 01:20:01 1.4 @@ -310,6 +310,25 @@ class="step">Window -> Preferences -> Java -> Compiler -> Errors/Warnings not to see them.

            +

            Fix javadoc location

            + +Ant's targets using javadoc (such as docs or +moses-docs) may fail reporting an error +CreateProcess...javadoc.exe.... This is because the +executable javadoc.exe was not found. Eclipse has not +impressed me here: it can find java but but javadoc (even though I am +aware that javadoc in this case is considered as an external tool). So +you need to tell where is your javadoc.

            + +Either outside of Eclipse: add it to the environment variable PATH (a +usual way). Or inside Eclipse (but here I know only how to set it for +an individual project, not generally): Run -> +External Tools -> External Tool -> Ant Build -> jMoby +build.xml, select tab Environment -> New, +and create a new environment variable PATH and +give it directory where is javadoc, e.g. c:\Program +Files\Java\jdk1.5.0_05\bin.

            +

            Misc

            The project name now should have attached the CVS location. If not you @@ -330,7 +349,7 @@
            Martin Senger
            -Last modified: Wed Sep 21 00:09:16 2005 +Last modified: Wed Sep 21 10:11:37 2005
            From senger at pub.open-bio.org Wed Sep 21 04:02:15 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 21 Sep 2005 00:02:15 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210402.j8L42F87007753@pub.open-bio.org> senger Wed Sep 21 00:02:15 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv7734 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.35,1.36 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/21 01:12:20 1.35 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/21 04:02:15 1.36 @@ -72,8 +72,8 @@ - - + + @@ -1205,11 +1205,11 @@ - + - + - Property 'moses.service' is not set. + Neither property 'moses.service' or 'moses.authority is set. This means that skeletons for ALL services will be generated. If this is what you want, press 'y'. Continue? @@ -1248,6 +1248,13 @@ + + + + + + + From senger at pub.open-bio.org Wed Sep 21 05:26:18 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 21 Sep 2005 01:26:18 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210526.j8L5QIT7008156@pub.open-bio.org> senger Wed Sep 21 01:26:18 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv8101/src/config Modified Files: run-any-client.bat run-cache-client.bat run-cmdline-client.bat run-dashboard.bat run-digest-client.bat run-generator.bat run-graphs-client.bat run-moby-parser.bat run-service.bat run-testing-central.bat Log Message: making windows scripts better \(but not much\) moby-live/Java/src/config run-any-client.bat,1.4,1.5 run-cache-client.bat,1.2,1.3 run-cmdline-client.bat,1.3,1.4 run-dashboard.bat,1.1,1.2 run-digest-client.bat,1.2,1.3 run-generator.bat,1.2,1.3 run-graphs-client.bat,1.2,1.3 run-moby-parser.bat,1.2,1.3 run-service.bat,1.2,1.3 run-testing-central.bat,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-any-client.bat,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/09/18 08:46:25 1.4 +++ /home/repository/moby/moby-live/Java/src/config/run-any-client.bat 2005/09/21 05:26:18 1.5 @@ -1,7 +1,7 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" -cd %PROJECT_HOME% +cd "%PROJECT_HOME%" set CP= for %%i in (lib\*.jar) do call cp.bat %%i set CP=build\classes;%CP% =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-cache-client.bat 2005/09/21 05:26:18 1.3 @@ -1,9 +1,10 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% java -classpath "%CP%" CacheRegistryClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2005/09/21 05:17:32 1.3 +++ /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2005/09/21 05:26:18 1.4 @@ -1,7 +1,7 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" -cd %PROJECT_HOME% +cd "%PROJECT_HOME%" set CP= for %%i in (lib\*.jar) do call cp.bat %%i set CP=build\classes;%CP% =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat 2005/09/18 14:05:32 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat 2005/09/21 05:26:18 1.2 @@ -1,12 +1,13 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" -set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" -set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" -set "CP=%PROJECT_HOME%\build\others\samples;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% +set CP=build\others\datatypes;%CP% +set CP=build\others\skeletons;%CP% +set CP=build\others\samples;%CP% java -classpath "%CP%" org.biomoby.service.dashboard.Dashboard %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-digest-client.bat 2005/09/21 05:26:18 1.3 @@ -1,9 +1,10 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% java -classpath "%CP%" MobyDigestClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-generator.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-generator.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-generator.bat 2005/09/21 05:26:18 1.3 @@ -1,11 +1,12 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" -set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" -set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% +set CP=build\others\datatypes;%CP% +set CP=build\others\skeletons;%CP% java -classpath "%CP%" MosesGenerators %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-graphs-client.bat 2005/09/21 05:26:18 1.3 @@ -1,9 +1,10 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% java -classpath "%CP%" MobyGraphs %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-moby-parser.bat 2005/09/21 05:26:18 1.3 @@ -1,10 +1,11 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" -set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% +set CP=build\others\datatypes;%CP% java -classpath "%CP%" TestingMobyParser %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-service.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-service.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-service.bat 2005/09/21 05:26:18 1.3 @@ -1,12 +1,13 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" -set "CP=%PROJECT_HOME%\build\others\datatypes;%CP%" -set "CP=%PROJECT_HOME%\build\others\skeletons;%CP%" -set "CP=%PROJECT_HOME%\build\others\samples;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% +set CP=build\others\datatypes;%CP% +set CP=build\others\skeletons;%CP% +set CP=build\others\samples;%CP% java -classpath "%CP%" org.biomoby.client.BaseCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-testing-central.bat 2005/09/21 05:26:18 1.3 @@ -1,9 +1,10 @@ @echo off set "PROJECT_HOME=@PROJECT_HOME@" +cd "%PROJECT_HOME%" set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% java -classpath "%CP%" TestingCentral %1 %2 %3 %4 %5 %6 %7 %8 %9 From senger at pub.open-bio.org Wed Sep 21 06:03:49 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 21 Sep 2005 02:03:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210603.j8L63nsa008383@pub.open-bio.org> senger Wed Sep 21 02:03:49 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv8360 Modified Files: ChangeLog EclipseAndJMoby.html Log Message: moby-live/Java/docs ChangeLog,1.41,1.42 EclipseAndJMoby.html,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/20 15:17:55 1.41 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/21 06:03:49 1.42 @@ -1,3 +1,8 @@ +2005-09-21 Martin Senger + + * Fixed build.xml not to produce javadoc warnings with Java 1.5 in + Eclipse. + 2005-09-20 Martin Senger * Fixed CentralDigestImpl - it shows now correct service type =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/21 01:20:01 1.4 +++ /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/21 06:03:49 1.5 @@ -329,6 +329,34 @@ give it directory where is javadoc, e.g. c:\Program Files\Java\jdk1.5.0_05\bin.

            +

            Running jMoby command-line scripts

            + +jMoby has a few scripts that can be invoked from a command-line with +number of arguments. From the Eclipse point of view, they are the same +as any other external tools. Perhaps the only difference is that they +must be first copied from their source directory (src/config) +to their destination place (build/run). The copying is not +used because it matters where they are invoked from, but because they +are not only copied but also updated. That's why - before you use them +- you need (at least once) to run a jMoby Ant's task compile or config. Eclipse own +compilation (called building) is not enough, it does not copy +the scripts.

            + +Once you have them in build/run you can run them from Eclipse +(as always with external scripts, you type more the first time you use +a script, but Eclipse remembers it and the next time you will see +already your script name in a menu): Run -> +External Tools -> External Tools -> Program -> New. Name +it (e.g. run-cmdline-client), and Location +-> Browse Workspace to select it (in our example find and +select build/run/run-cmdline-client.bat). Most of these +scripts have an option -help - so put it in Arguments - and change it each time you wish to +invoke them with different arguments.

            + + +

            Misc

            The project name now should have attached the CVS location. If not you @@ -349,7 +377,7 @@
            Martin Senger
            -Last modified: Wed Sep 21 10:11:37 2005 +Last modified: Wed Sep 21 14:55:00 2005
            From senger at pub.open-bio.org Wed Sep 21 05:17:32 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 21 Sep 2005 01:17:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210517.j8L5HWaS008047@pub.open-bio.org> senger Wed Sep 21 01:17:32 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv8028/src/config Modified Files: run-cmdline-client.bat Log Message: make it better for windows moby-live/Java/src/config run-cmdline-client.bat,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2005/09/01 08:01:16 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-cmdline-client.bat 2005/09/21 05:17:32 1.3 @@ -1,9 +1,10 @@ - at echo off - -set "PROJECT_HOME=@PROJECT_HOME@" -set CP= -for %%i in (%PROJECT_HOME%\lib\*.jar) do call "%PROJECT_HOME%\cp.bat" %%i -set "CP=%PROJECT_HOME%\build\classes;%CP%" -set "CP=%PROJECT_HOME%\build\Clients;%CP%" - -java -classpath "%CP%" MobyCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 + at echo off + +set "PROJECT_HOME=@PROJECT_HOME@" +cd %PROJECT_HOME% +set CP= +for %%i in (lib\*.jar) do call cp.bat %%i +set CP=build\classes;%CP% +set CP=build\Clients;%CP% + +java -classpath "%CP%" MobyCmdLineClient %1 %2 %3 %4 %5 %6 %7 %8 %9 From senger at pub.open-bio.org Wed Sep 21 06:13:28 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 21 Sep 2005 02:13:28 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210613.j8L6DSAa008441@pub.open-bio.org> senger Wed Sep 21 02:13:28 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/config In directory pub.open-bio.org:/tmp/cvs-serv8418 Modified Files: run-dashboard run-dashboard.bat Log Message: moby-live/Java/src/config run-dashboard,1.1,1.2 run-dashboard.bat,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-dashboard,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/config/run-dashboard 2005/09/18 14:05:32 1.1 +++ /home/repository/moby/moby-live/Java/src/config/run-dashboard 2005/09/21 06:13:28 1.2 @@ -12,6 +12,7 @@ CLASSPATH=${PROJECT_HOME}/build/others/datatypes:$CLASSPATH CLASSPATH=${PROJECT_HOME}/build/others/skeletons:$CLASSPATH CLASSPATH=${PROJECT_HOME}/build/others/samples:$CLASSPATH +CLASSPATH=${PROJECT_HOME}/build/lib/dashboard-config.jar:$CLASSPATH CLASSPATH=`echo ${PROJECT_HOME}/lib/*.jar | tr ' ' ':'`:$CLASSPATH exec java -cp $CLASSPATH org.biomoby.service.dashboard.Dashboard "$@" =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat 2005/09/21 05:26:18 1.2 +++ /home/repository/moby/moby-live/Java/src/config/run-dashboard.bat 2005/09/21 06:13:28 1.3 @@ -9,5 +9,6 @@ set CP=build\others\datatypes;%CP% set CP=build\others\skeletons;%CP% set CP=build\others\samples;%CP% +set CP=build\lib\dashboard-config.jar;%CP% java -classpath "%CP%" org.biomoby.service.dashboard.Dashboard %1 %2 %3 %4 %5 %6 %7 %8 %9 From senger at pub.open-bio.org Wed Sep 21 07:56:55 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Wed, 21 Sep 2005 03:56:55 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509210756.j8L7ut1R008830@pub.open-bio.org> senger Wed Sep 21 03:56:55 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv8807 Modified Files: EclipseAndJMoby.html index.html Added Files: WindowsAndJMoby.html Log Message: moby-live/Java/docs WindowsAndJMoby.html,NONE,1.1 EclipseAndJMoby.html,1.5,1.6 index.html,1.14,1.15 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/21 06:03:49 1.5 +++ /home/repository/moby/moby-live/Java/docs/EclipseAndJMoby.html 2005/09/21 07:56:55 1.6 @@ -331,17 +331,17 @@

            Running jMoby command-line scripts

            -jMoby has a few scripts that can be invoked from a command-line with -number of arguments. From the Eclipse point of view, they are the same -as any other external tools. Perhaps the only difference is that they -must be first copied from their source directory (src/config) -to their destination place (build/run). The copying is not -used because it matters where they are invoked from, but because they -are not only copied but also updated. That's why - before you use them -- you need (at least once) to run a jMoby Ant's task compile or config. Eclipse own -compilation (called building) is not enough, it does not copy -the scripts.

            +jMoby has a few scripts that can be +invoked from a command-line with number of arguments. From the Eclipse +point of view, they are the same as any other external tools. Perhaps +the only difference is that they must be first copied from their +source directory (src/config) to their destination place +(build/run). The copying is not used because it matters where +they are invoked from, but because they are not only copied but also +updated. That's why - before you use them - you need (at least once) +to run a jMoby Ant's task compile or config. Eclipse own compilation (called +building) is not enough, it does not copy the scripts.

            Once you have them in build/run you can run them from Eclipse (as always with external scripts, you type more the first time you use @@ -377,7 +377,7 @@

            Martin Senger
            -Last modified: Wed Sep 21 14:55:00 2005 +Last modified: Wed Sep 21 15:07:18 2005
            =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/index.html,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- /home/repository/moby/moby-live/Java/docs/index.html 2005/09/20 07:30:09 1.14 +++ /home/repository/moby/moby-live/Java/docs/index.html 2005/09/21 07:56:55 1.15 @@ -45,6 +45,7 @@ @@ -90,7 +91,7 @@
            Martin Senger
            -Last modified: Tue Sep 20 12:21:24 2005 +Last modified: Wed Sep 21 15:27:30 2005
            From kawas at pub.open-bio.org Wed Sep 21 17:11:39 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Wed, 21 Sep 2005 13:11:39 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509211711.j8LHBd6h012052@pub.open-bio.org> kawas Wed Sep 21 13:11:39 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/errorpages In directory pub.open-bio.org:/tmp/cvs-serv12027/org/biomoby/client/ui/graphical/servlet/errorpages Modified Files: Error404.java Log Message: removed carriage returns moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/errorpages Error404.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/errorpages/Error404.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/errorpages/Error404.java 2005/04/07 21:02:01 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/errorpages/Error404.java 2005/09/21 17:11:39 1.3 @@ -86,7 +86,7 @@ + " contents='';" + " row=Math.max(0,index-7);" + " while(row kawas Wed Sep 21 13:13:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources In directory pub.open-bio.org:/tmp/cvs-serv12084/org/biomoby/client/ui/graphical/servlet/jresources Modified Files: RESOURCE.java Log Message: removed carriage returns and replaced \n with more portable java system calls. moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources RESOURCE.java,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java 2005/08/29 23:11:08 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java 2005/09/21 17:13:51 1.11 @@ -130,7 +130,7 @@ + " contents='';" + " row=Math.max(0,index-7);" + " while(row\r\n"); + "" + System.getProperty("line.separator") + ""); // add the predicates here buffer.append(createOntologyBlock("http://biomoby.org/RESOURCES/MOBY-S/Predicates#", "The BioMoby Predicates Vocabulary (moby)", @@ -1163,7 +1163,7 @@ // end the addition of predicates here buffer.append( - "\r\n" + + "" + System.getProperty("line.separator") + "" + ""); return buffer.toString(); } @@ -1171,56 +1171,56 @@ private String createPropertyBlock(String about, String definedBy, String label, String comment, String domain, String range) { String s = - "\r\n\r\n" + - " \r\n" + - " " + label + "\r\n" + - " " + comment + "\r\n" + - " \r\n" + - " \r\n" + - "\r\n"; + "" + System.getProperty("line.separator") + "" + System.getProperty("line.separator") + "" + + " " + System.getProperty("line.separator") + "" + + " " + label + "" + System.getProperty("line.separator") + "" + + " " + comment + "" + System.getProperty("line.separator") + "" + + " " + System.getProperty("line.separator") + "" + + " " + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + ""; return s; } private String createClassBlock(String about, String definedBy, String label, String comment, String subClassOf) { String s = - "\r\n\r\n" + - " \r\n" + - " "+ label +"\r\n" + - " "+ comment +"\r\n" + - " \r\n" + - "\r\n"; + "" + System.getProperty("line.separator") + "" + System.getProperty("line.separator") + "" + + " " + System.getProperty("line.separator") + "" + + " "+ label +"" + System.getProperty("line.separator") + "" + + " "+ comment +"" + System.getProperty("line.separator") + "" + + " " + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + ""; return s; } private String createDescriptionBlock(String about, String[] seeAlsos) { if (seeAlsos == null) - return "\r\n"; + return "" + System.getProperty("line.separator") + ""; StringBuffer sb = new StringBuffer(); - sb.append(" \r\n"); + sb.append(" " + System.getProperty("line.separator") + ""); for (int x = 0; x < seeAlsos.length; x++) { - sb.append(" \r\n"); + sb.append(" " + System.getProperty("line.separator") + ""); } - sb.append("\r\n"); + sb.append("" + System.getProperty("line.separator") + ""); return sb.toString(); } private String createOntologyBlock(String about, String title, String description) { - String s ="\r\n\r\n" + " " + title + "\r\n" - + " " + description + "\r\n" - + "\r\n"; + String s ="" + System.getProperty("line.separator") + "" + System.getProperty("line.separator") + "" + " " + title + "" + System.getProperty("line.separator") + "" + + " " + description + "" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + ""; return s; } private String createEscapedComment(String comment) { - String s = "\r\n\r\n"; + String s = "" + System.getProperty("line.separator") + "" + System.getProperty("line.separator") + ""; return s; } public static void main(String[] args) throws Exception { - System.out.println(new RESOURCE().getRESOURCES("Namespaces")); + System.out.println(new RESOURCE().getRESOURCES("Predicates")); } } \ No newline at end of file From fgibbons at pub.open-bio.org Wed Sep 21 19:08:28 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Wed, 21 Sep 2005 15:08:28 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509211908.j8LJ8Sc0012462@pub.open-bio.org> fgibbons Wed Sep 21 15:08:28 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv12437/t Modified Files: CommonSubs.t Log Message: - Added new test of collectionResponse, including tests for correct failure. - Still needs tests for complexResponse, whatever that is .... - Fixed earlier test that tried to create article from empty string. moby-live/Perl/t CommonSubs.t,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/CommonSubs.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/t/CommonSubs.t 2005/08/30 15:19:05 1.2 +++ /home/repository/moby/moby-live/Perl/t/CommonSubs.t 2005/09/21 19:08:28 1.3 @@ -11,13 +11,13 @@ # change 'tests => 1' to 'tests => last_test_to_print'; #use SOAP::Lite +trace; -use Test::More 'no_plan'; #tests => 127; # perldoc Test::More for details +use Test::More 'no_plan'; #skip_all => "Turned off for development"; #'no_plan'; use strict; use English; use Data::Dumper; #Is the client-code even installed? BEGIN { use_ok('MOBY::CommonSubs') }; -use MOBY::CommonSubs qw /:all/; +use MOBY::CommonSubs qw/:all/; use XML::LibXML; use MOBY::MobyXMLConstants; @@ -26,33 +26,34 @@ }; my @must_implement = qw/ - genericServiceInputParser - genericServiceInputParserAsObject + collectionResponse + complexResponse complexServiceInputParser extractRawContent - validateNamespaces - validateThisNamespace + extractResponseArticles + genericServiceInputParser + genericServiceInputParserAsObject + getArticles + getCollectedSimples + getCrossReferences getInputArticles - getInputs getInputID - getArticles + getInputs + getNodeContentWithArticle + getResponseArticles + getServiceNotes getSimpleArticleIDs getSimpleArticleNamespaceURI - getCollectedSimples - getNodeContentWithArticle - isSimpleArticle isCollectionArticle isSecondaryArticle - extractResponseArticles - getResponseArticles - getCrossReferences - simpleResponse - collectionResponse - complexResponse - responseHeader + isSimpleArticle responseFooter + responseHeader + simpleResponse + validateNamespaces + validateThisNamespace whichDeepestParentObject - getServiceNotes/; +/; can_ok('MOBY::CommonSubs', @must_implement) or diag("CommonSubs doesn't implement all the methods that it should"); @@ -65,21 +66,21 @@ # complexServiceInputParser ######## EXTRACT CONTENTS ######### +my @query_ids = (1, 'a', 23, 24); my $msg = < - - -foo + + + +foo EOF my @inputs = getInputs(responseHeader() . $msg . responseFooter()); -is(scalar @inputs, 4) +is(scalar @inputs, scalar @query_ids) or diag("Wrong number of inputs returned from getInputs"); -is(getInputID($inputs[0]), 1) or diag("Wrong input ID returned for $inputs[0]"); -is(getInputID($inputs[1]), 'a') or diag("Wrong input ID returned for $inputs[1]"); -is(getInputID($inputs[2]), 23) or diag("Wrong input ID returned for $inputs[2]"); -is(getInputID($inputs[3]), 24) or diag("Wrong input ID returned for $inputs[3]"); - +for (my $i = 0; $i < @query_ids; $i++) { + is(getInputID($inputs[$i]), $query_ids[$i]) + or diag("Wrong input ID returned for queryID $i: $inputs[$i]"); +} # This message contains two articles: Collection, and Parameter # The Collection, of course, contains some Simple Articles, but they are not top-level articles. my $article_msg = < - + " @@ -252,7 +258,11 @@ my $parser = XML::LibXML->new(); my $doc; eval { $doc = $parser->parse_string( $XML ); }; - return '' if ( $EVAL_ERROR ); #("Couldn't parse '$XML' because:\n\t$EVAL_ERROR") + if ($EVAL_ERROR) { + my ($package, $filename, $line) = caller; + die "XML_maker called from line $line:Couldn't parse '$XML' because:\n\t" + . "$EVAL_ERROR"; + } return $doc->getDocumentElement(); } @@ -280,7 +290,7 @@ # and for completely fictitious parameters. # Examples here should be syntactically correct (namespace should be correct) # just wrong article-types. -my @not_articles = ("", "", "foo", +my @not_articles = ("", "foo", "", "", ""); for my $a (@not_articles) { for my $test (\&isSimpleArticle, \&isCollectionArticle, \&isSecondaryArticle) { @@ -322,18 +332,19 @@ my $sresp = XML_maker(responseHeader() # Need header for namespace def . simpleResponse($data, $articleName, $qID) . responseFooter()); -$sresp = $sresp->getElementsByTagName('moby:mobyData') - || $sresp->getElementsByTagName('mobyData'); +$sresp = $sresp->getElementsByTagName('moby:mobyData'); +# || $sresp->getElementsByTagName('mobyData'); is($sresp->size(), 1) or diag("SimpleResponse should contain only a single mobyData element."); my $mobyData = $sresp->get_node(1); -is($mobyData->getAttribute('queryID') || $mobyData->getAttribute('moby:queryID'), $qID) +is($mobyData->getAttribute('moby:queryID') || $mobyData->getAttribute('queryID'), + $qID) or diag("SimpleResponse didn't contain right queryID"); -my $children = $mobyData->childNodes; + my $simple; my $count_elements = 0; -foreach ($children->get_nodelist) { - if ($_->nodeType == ELEMENT_NODE) { $simple = $_; $count_elements++;} +foreach ($mobyData->childNodes->get_nodelist) { + if ($_->nodeType == ELEMENT_NODE) { $count_elements++ } } is($count_elements, 1) or diag("SimpleResponse's mobyData should have only a single child element:"); @@ -347,10 +358,80 @@ TODO: { local $TODO = "Need tests for collectionResponse and complexResponse"; - # collectionResponse - # complexResponse +# complexResponse takes two arguments: $data, $qID +# $data is arrayref, elements can also be arrayref, or string. +#my $data = ''; + +} +{ + # collectionResponse takes 3 args: $data, $articlename, $qID + # $data is a arrayref of MOBY OBjects as raw XML. + my ($qID, $aname, $ns, $id, $string) = ("23", "my_artIcLe", "taxon", "foo", "some_text"); + my $simple = "$string"; + my $data = [$simple, $simple, $simple]; + my $coll_resp = collectionResponse($data, $aname, $qID); + + # Regular expressions are not the best way (!) to validate XML, but it's worth a quick check. + ok($coll_resp =~ /^\s* \ # Top-level tag should be mobyData +\s* \ +.* # Don't worry too much about the innermost details - we'll get them with DOM. +\s* \<\/moby\:Collection\> +\s* \<\/moby\:mobyData\> \s* $/sx) + # In above regexpt, 's' allows matching in multiline strings; + # 'x' ignores comments and literal whitespace in regexp + # Because we attempt to return 'pretty' XML, we need to allow for whitespace between all tags, + # which explains why the regexp is peppered with '\s*' + or diag("collectionResponse should have mobyData as outermost tag: got '$coll_resp'"); + # Now parse the XML, and make sure it checks out according to DOM + my $coll_resp_dom = XML_maker(responseHeader() . $coll_resp . responseFooter()); + my $mData = $coll_resp_dom->getElementsByTagName('moby:mobyData'); + is($mData->size(), 1) + or diag("CollectionResponse should contain only a single mobyData element."); + $mData = $mData->get_node(1); + is($mData->getAttribute('moby:queryID') || $mData->getAttribute('queryID'), + $qID) + or diag("CollectionResponse's mobyData element didn't contain correct queryID"); + my $colls = $mData->getElementsByTagName("moby:Collection"); + is ($colls->size(), 1) + or diag("CollectionResponse should have only a single child: Collection."); + my $Coll = $colls->get_node(1); + is($Coll->getAttribute('moby:articleName') || $Coll->getAttribute('articleName'), + $aname) + or diag("CollectionResponse didn't contain correct articleName"); + my $simples = $Coll->getElementsByTagName("moby:Simple") + || $Coll->getElementsByTagName("Simple"); + is(scalar @{$simples}, scalar @{$data}) + or diag("CollectionResponse contains wrong number of Simples"); + + # # Finally, parse the sucker with the tools in CommonSubs: it should be able to understand its own creations! + my @inputs = getInputs(responseHeader() . $coll_resp . responseFooter() ); + is(scalar @inputs, 1) + or diag("CollectionResponse should contain only one mobyData block"); + is(getInputID($inputs[0]), $qID) + or diag("CollectionResponse returned mobyData block with incorrect queryID attribute"); + my @articles = getArticles($inputs[0]); + is(scalar @articles, 1) + or diag("CollectionResponse should contain only one Collection"); + is($articles[0]->[0], $aname) + or diag("CollectionResponse had incorrect articleName"); + my @collected_simples = getCollectedSimples($articles[0]->[1]); + is(scalar @collected_simples , scalar @{$data}) + or diag("CollectionResponse contained incorrect number of Simples"); + +# Test response when one or more simples are empty/undef. +# They should result in empty Simple tags, but the total response should NOT be empty. + $coll_resp = collectionResponse([], $aname, $qID); + ok($coll_resp =~ /^\s*\$/) + or diag("CollectionResponse should be empty mobyData tag when empty data supplied"); + $data = [undef, $simple, $simple]; + $coll_resp = collectionResponse($data, $aname, $qID); + ok( !($coll_resp =~ /^\s*\$/sx)) + or diag("CollectionResponse should not be empty " + . "just because first element evaluates to false"); } +#------------------ # Check header/footer # How can we parse incomplete XML for correctness....? my ($authURI, $service_notes) = ("your.site.here", From senger at pub.open-bio.org Sun Sep 18 08:46:26 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 18 Sep 2005 04:46:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509180846.j8I8kQgF023487@pub.open-bio.org> senger Sun Sep 18 04:46:26 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv23355/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java ConsolePanel.java Dashboard.java DashboardPanel.java DashboardProperties.java EventGeneratorPanel.java NOTES RegistryPanel.java Added Files: CommonTree.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard CommonTree.java,NONE,1.1 AbstractPanel.java,1.3,1.4 ConsolePanel.java,1.1,1.2 Dashboard.java,1.1,1.2 DashboardPanel.java,1.2,1.3 DashboardProperties.java,1.1,1.2 EventGeneratorPanel.java,1.1,1.2 NOTES,1.1,1.2 RegistryPanel.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/13 06:53:28 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/18 08:46:26 1.4 @@ -8,21 +8,48 @@ package org.biomoby.service.dashboard; +import org.tulsoft.shared.UUtils; +import org.tulsoft.shared.PrefsUtils; import org.tulsoft.tools.gui.SwingUtils; +import org.tulsoft.tools.gui.JTextFieldWithHistory; +import org.tulsoft.tools.gui.JFileChooserWithHistory; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.Icon; -import javax.swing.JComponent; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JTextField; +import javax.swing.JFileChooser; import javax.swing.AbstractButton; +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.border.Border; +import javax.swing.border.TitledBorder; +import javax.swing.border.CompoundBorder; +import javax.swing.border.EmptyBorder; +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.filechooser.FileFilter; import javax.swing.text.html.HTMLDocument; +import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import java.awt.Insets; +import java.awt.Font; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import java.awt.event.ItemListener; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeSupport; +import java.io.File; +import java.util.prefs.Preferences; + /** * WORK IN PROGRESS.

            * @@ -34,31 +61,29 @@ extends JPanel implements DashboardPanel { - // copy here some often used constants protected static final int RELATIVE = GridBagConstraints.RELATIVE; protected static final int REMAINDER = GridBagConstraints.REMAINDER; protected static final int NONE = GridBagConstraints.NONE; protected static final int BOTH = GridBagConstraints.BOTH; - protected static final int HORIZONTAL = GridBagConstraints.HORIZONTAL; - protected static final int VERTICAL = GridBagConstraints.VERTICAL; + protected static final int HORI = GridBagConstraints.HORIZONTAL; + protected static final int VERT = GridBagConstraints.VERTICAL; protected static final int CENTER = GridBagConstraints.CENTER; protected static final int NORTH = GridBagConstraints.NORTH; - protected static final int NORTHEAST = GridBagConstraints.NORTHEAST; + protected static final int NEAST = GridBagConstraints.NORTHEAST; protected static final int EAST = GridBagConstraints.EAST; - protected static final int SOUTHEAST = GridBagConstraints.SOUTHEAST; + protected static final int SEAST = GridBagConstraints.SOUTHEAST; protected static final int SOUTH = GridBagConstraints.SOUTH; - protected static final int SOUTHWEST = GridBagConstraints.SOUTHWEST; + protected static final int SWEST = GridBagConstraints.SOUTHWEST; protected static final int WEST = GridBagConstraints.WEST; - protected static final int NORTHWEST = GridBagConstraints.NORTHWEST; - protected static final int PAGE_START = GridBagConstraints.PAGE_START; - protected static final int PAGE_END = GridBagConstraints.PAGE_END; - protected static final int LINE_START = GridBagConstraints.LINE_START; - protected static final int LINE_END = GridBagConstraints.LINE_END; - protected static final int FIRST_LINE_START = GridBagConstraints.FIRST_LINE_START; - protected static final int FIRST_LINE_END = GridBagConstraints.FIRST_LINE_END; - protected static final int LAST_LINE_START = GridBagConstraints.LAST_LINE_START; - protected static final int LAST_LINE_END = GridBagConstraints.LAST_LINE_END; + protected static final int NWEST = GridBagConstraints.NORTHWEST; + + // something need to be done only once - keep it here + protected Icon panelIcon; + protected JComponent pComponent; + + // re-use "style" components + protected static final Insets BREATH_TOP = new Insets (10,0,0,0); /********************************************************************* @@ -82,6 +107,16 @@ return null; } + /************************************************************************** + * + **************************************************************************/ + public JLabel getTitle() { + JLabel title = new JLabel (getName(), getIcon(), JLabel.CENTER); + title.setFont (new Font ("Serif", Font.BOLD, 20)); + title.setForeground (new Color (12, 55, 241)); + return title; + } + /********************************************************************* * Property change stuff ********************************************************************/ @@ -117,11 +152,6 @@ **************************************************************************/ abstract public String getName(); - /************************************************************************** - * - **************************************************************************/ - abstract public JLabel getTitle(); - // // Methods to be used by sub-classes // @@ -137,6 +167,112 @@ } /********************************************************************* + * Create a button (with a unified style). + ********************************************************************/ + protected static JButton createButton (String name, + String toolTipText, + int mnemonic, + ActionListener listener) { + JButton button = new JButton (name); + commonButtonLookAndFeel (button); + button.setToolTipText (toolTipText); + if (mnemonic > 0) + button.setMnemonic (mnemonic); + button.addActionListener (listener); + return button; + } + + /********************************************************************* + * Create a check-box (with a unified style). + ********************************************************************/ + protected static JCheckBox createCheckBox (String label, + boolean isSelected, + int mnemonic, + ItemListener listener) { + JCheckBox box = new JCheckBox (label, isSelected); + if (mnemonic > 0) + box.setMnemonic (mnemonic); + box.addItemListener (listener); + box.setFocusPainted (false); + return box; + } + + /********************************************************************* + * Create a horizontal panel with given buttons. + ********************************************************************/ + protected static JPanel createButtonPanel (JButton[] buttons) { + + JPanel buttonPanel = new JPanel(); + buttonPanel.setLayout (new BoxLayout (buttonPanel, BoxLayout.LINE_AXIS)); + buttonPanel.setBorder (BorderFactory.createEmptyBorder (10, 0, 0, 10)); + buttonPanel.add (Box.createHorizontalGlue()); + for (int i = 0; i < buttons.length; i++) + buttonPanel.add (buttons[i]); + return buttonPanel; + } + + /********************************************************************* + * Create a titled panel using the given title and GridBagLayout. + ********************************************************************/ + protected static JPanel createTitledPanel (String title) { + JPanel titledPanel = new JPanel (new GridBagLayout()); + Border blackline = BorderFactory.createLineBorder (Color.black); + CompoundBorder compoundBorder = + BorderFactory.createCompoundBorder (BorderFactory.createTitledBorder (blackline, title), + BorderFactory.createEmptyBorder (5, 5, 5, 5)); + titledPanel.setBorder (compoundBorder); + return titledPanel; + } + + /********************************************************************* + * Create a panel with given text field and with a directory/file + * browser button attached. + * + * @param chooserMode should be one of + * JFileChooser.DIRECTORIES_ONLY, JFileChooser.FILES_ONLY, and + * JFileChooser.FILES_AND_DIRECTORIES (but it is not tested) + ********************************************************************/ + protected JFileChooserWithHistory createFileSelector (String chooserTitle, + String approveButtonText, + int chooserMode, + String defaultValue, + FileFilter filter) { + JFileChooserWithHistory chooser = + new JFileChooserWithHistory (null, this, "cacheDirectory"); + + JFileChooser ch = chooser.getFileChooser(); + ch.setFileSelectionMode (chooserMode); + if (filter != null) + ch.setFileFilter (filter); + ch.setApproveButtonText (approveButtonText); + ch.setDialogTitle (chooserTitle); + + if (UUtils.notEmpty (defaultValue) && + chooser.getSelectedFile() == null) + chooser.setSelectedFile (new File (defaultValue)); + + return chooser; + } + + /********************************************************************* + * + ********************************************************************/ + protected boolean getPrefValue (String key, + boolean defaultValue) { + Preferences node = PrefsUtils.getNode (this.getClass()); + return node.getBoolean (key, defaultValue); + } + + /********************************************************************* + * + ********************************************************************/ + protected void setPrefValue (String key, + boolean value) { + Preferences node = PrefsUtils.getNode (this.getClass()); + node.putBoolean (key, value); + } + + /********************************************************************* * Return true if confirmation dialog passed. ********************************************************************/ public boolean confirm (Object msg) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/13 06:54:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/18 08:46:26 1.2 @@ -22,6 +22,7 @@ import java.awt.Font; import java.awt.GridBagLayout; +import java.awt.event.KeyEvent; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.beans.PropertyChangeListener; @@ -85,19 +86,20 @@ textArea.setEditable (false); JScrollPane scroller = new JScrollPane (textArea); - JButton cleanButton = new JButton (" Clean "); - commonButtonLookAndFeel (cleanButton); - cleanButton.setToolTipText ("Remove all messages from the console area"); - cleanButton.addActionListener (new ActionListener() { - public void actionPerformed (ActionEvent e) { - if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) - textArea.setText (""); - } - }); + JButton cleanButton = + createButton (" Clean ", + "Remove all messages from the console area", + KeyEvent.VK_C, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) + textArea.setText (""); + } + }); // put it together - SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, FIRST_LINE_START, 1.0, 1.0); - SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, FIRST_LINE_START, 0.0, 0.0); + SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); + SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); return p; } @@ -109,11 +111,4 @@ return "Debugging Console"; } - /************************************************************************** - * - **************************************************************************/ - public JLabel getTitle() { - return new JLabel (getName()); - } - } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/13 06:54:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/18 08:46:26 1.2 @@ -20,7 +20,11 @@ import javax.swing.JLabel; import javax.swing.Icon; import javax.swing.text.html.HTMLDocument; +import javax.swing.event.ChangeListener; +import javax.swing.event.ChangeEvent; + import java.awt.GridBagLayout; +import java.awt.Font; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; @@ -29,7 +33,9 @@ import java.util.Vector; import java.util.Enumeration; import java.util.Properties; +import java.util.Date; import java.net.URL; +import java.text.DateFormat; /** * WORK IN PROGRESS.

            @@ -39,13 +45,16 @@ */ public class Dashboard - implements DashboardPanel { + implements DashboardPanel, ChangeListener { + private JComponent dashboard; + private StatusBar statusBar; + private DashboardHeader header; + protected JTabbedPane tabbedPane; protected DashboardPanel[] panels; protected static Properties dashboardProperties; static { - final String DASHBOARD_PROPERTIES_FILE = "dashboard.properties"; try { // get the classloader for this class ClassLoader loader = Dashboard.class.getClassLoader(); @@ -53,11 +62,8 @@ loader = Thread.currentThread().getContextClassLoader(); } -// unknownProcessorIcon = -// new ImageIcon(loader.getResource("org/embl/ebi/escience/scuflui/icons/explorer/unknownprocessor.png")); - - // load values from any dashboard.properties file located - // by the class resource loader + // load dashboard properties from a file located by the + // class resource loader Enumeration en = loader.getResources (DASHBOARD_PROPERTIES_FILE); dashboardProperties = new Properties(); while (en.hasMoreElements()) { @@ -71,6 +77,16 @@ } /************************************************************************** + * Default constructor. It loads all panels, connect them and + * creates the GUI - but does not show it yet. + **************************************************************************/ + public Dashboard() { + loadPanels(); + dashboard = getComponent(); + connectPanels(); + } + + /************************************************************************** * Load all available Dashboard panels... **************************************************************************/ public void loadPanels() { @@ -84,31 +100,26 @@ } /************************************************************************** - * Connect all available Dashboard panels... + * Connect all available Dashboard panels: a) together, and b) + * with the status bar. **************************************************************************/ public void connectPanels() { for (int i = 0; i < panels.length; i++) { for (int j = 0; j < i; j++) - connect (panels[i], panels[j]); + panels[i].addPropertyChangeListener (panels[j]); for (int j = i+1; j < panels.length; j++) - connect (panels[i], panels[j]); + panels[i].addPropertyChangeListener (panels[j]); + if (statusBar != null) + panels[i].addPropertyChangeListener (statusBar); } } - // - void connect (DashboardPanel one, DashboardPanel two) { - one.addPropertyChangeListener (two); - } - /************************************************************************** * Show the main frame. **************************************************************************/ public void show() { - JComponent dashboard = getComponent(); - - JFrame frame = SwingUtils.createMainFrame (dashboard, getName()); + JFrame frame = SwingUtils.createMainFrame (getComponent(), getName()); SwingUtils.showMainFrame (frame, dashboard.getPreferredSize()); -// SwingUtils.showMainFrame (frame, dashboard.getPreferredFrameSize()); } /************************************************************************** @@ -125,20 +136,6 @@ return new String (buf); } - /************************************************************************** - * - **************************************************************************/ - public static void main (String[] args) { - SwingUtils.checkJavaVersion(); - - Dashboard dashboard = new Dashboard(); - dashboard.loadPanels(); - dashboard.connectPanels(); -// System.out.println ("DASHBOARD:\n" + dashboard.toString()); - dashboard.show(); - - } - // // Implement DashboardPanel interface // @@ -154,7 +151,15 @@ * **************************************************************************/ public JLabel getTitle() { - return new JLabel (getName()); + Icon titleIcon = + SwingUtils.createIcon (dashboardProperties.getProperty (DP_TITLE_ICON), + this); + String titleStr = dashboardProperties.getProperty (DP_TITLE); + if (titleStr == null && titleIcon == null) + titleStr = getName(); + JLabel title = new JLabel (titleStr, titleIcon, JLabel.CENTER); + title.setFont (new Font ("Serif", Font.BOLD, 30)); + return title; } /************************************************************************** @@ -168,7 +173,8 @@ * **************************************************************************/ public Icon getIcon() { - return null; + return SwingUtils.createIcon (dashboardProperties.getProperty (DP_TITLE_ICON), + this); } /************************************************************************** @@ -176,24 +182,93 @@ **************************************************************************/ public JComponent getComponent() { + if (dashboard != null) + return dashboard; + + // create itself JPanel p = new JPanel (new GridBagLayout(), true); - JComponent header = createHeader(); - JTabbedPane tabbedPane = new JTabbedPane(); + header = getHeader(); + tabbedPane = new JTabbedPane(); + tabbedPane.addChangeListener (this); for (int i = 0; i < panels.length; i++) { tabbedPane.addTab (panels[i].getName(), panels[i].getIcon(), panels[i].getComponent()); } + statusBar = getStatusBar(); // put it all together - SwingUtils.addComponent (p, header, 0, 0, 1, 1, AbstractPanel.HORIZONTAL, AbstractPanel.FIRST_LINE_START, 1.0, 0.0); - SwingUtils.addComponent (p, tabbedPane, 0, 1, 1, 1, AbstractPanel.BOTH, AbstractPanel.FIRST_LINE_START, 1.0, 1.0); + SwingUtils.addComponent (p, header, 0, 0, 1, 1, AbstractPanel.HORI, AbstractPanel.NWEST, 1.0, 0.0); + SwingUtils.addComponent (p, tabbedPane, 0, 1, 1, 1, AbstractPanel.BOTH, AbstractPanel.NWEST, 1.0, 1.0); + SwingUtils.addComponent (p, statusBar, 0, 2, 1, 1, AbstractPanel.HORI, AbstractPanel.WEST, 1.0, 0.0); return p; } - // - JComponent createHeader() { - return getTitle(); + /************************************************************************** + * + **************************************************************************/ + DashboardHeader getHeader() { + DashboardHeader h = new DashboardHeader (dashboardProperties); + if (panels.length > 0) + h.setPanelTitle (panels[0].getTitle()); + return h; + } + + class DashboardHeader extends JPanel { + public DashboardHeader (Properties props) { + super (new GridBagLayout()); + JLabel mainTitle = getTitle(); + JLabel mainIcon = + new JLabel ("", + SwingUtils.createIcon (props.getProperty (DP_ICON), this), + JLabel.CENTER); + JLabel panelTitle = new JLabel(); + + // put it all together (keep 'panelTitle' always as the 3rd component) + SwingUtils.addComponent (this, mainIcon, 0, 0, 1, 2, AbstractPanel.NONE, AbstractPanel.NWEST, 0.0, 0.0); + SwingUtils.addComponent (this, mainTitle, 1, 0, 1, 1, AbstractPanel.NONE, AbstractPanel.NORTH, 1.0, 0.0); + SwingUtils.addComponent (this, panelTitle, 1, 1, 1, 1, AbstractPanel.NONE, AbstractPanel.SOUTH, 0.0, 0.0); + } + public void setPanelTitle (JLabel newTitle) { + remove (2); + SwingUtils.addComponent (this, newTitle, 1, 1, 1, 1, AbstractPanel.NONE, AbstractPanel.SOUTH, 0.0, 0.0); + AwtUtils.redisplay (this); + } + } + + /************************************************************************** + * Return a component representing status bar (usually placed at + * the bottom of a dashboard). + **************************************************************************/ + StatusBar getStatusBar() { + return new StatusBar ("Status: Work in progress"); + } + + class StatusBar extends JLabel implements PropertyChangeListener { + DateFormat df = DateFormat.getTimeInstance(); + public StatusBar (String text) { + super (text); + } + public void propertyChange (PropertyChangeEvent e) { + String prop = e.getPropertyName(); + if (prop == null) return; // no interest in non-specific changes + Object value = e.getNewValue(); + if (value == null) return; // no interest in non-defined new values + if (prop.equalsIgnoreCase (DP_STATUS_MSG)) + setText ("[" + df.format (new Date()) + "] " + value.toString()); + } + } + + /************************************************************************** + * Dashboard is listening to the changes of panels in order to + * repaint the header with a label of a currently selected panel. + **************************************************************************/ + public void stateChanged (ChangeEvent e) { + int panelIndex = tabbedPane.getSelectedIndex(); + if (panelIndex < 0 || panelIndex >= panels.length) + header.setPanelTitle (null); + else + header.setPanelTitle (panels[panelIndex].getTitle()); } /************************************************************************** @@ -214,9 +289,13 @@ public void propertyChange (PropertyChangeEvent event) { } -// Preferences prefs = Preferences.userNodeForPackage (DataThingViewer.class); -// String curDir = prefs.get ("currentDir", System.getProperty("user.home")); -// ... -// prefs.put ("currentDir", fc.getCurrentDirectory().toString()); + /************************************************************************** + * + * An entry point... + * + **************************************************************************/ + public static void main (String[] args) { + new Dashboard().show(); + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/13 06:53:28 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/18 08:46:26 1.3 @@ -16,7 +16,7 @@ /** * An interface that must be implemented by each panel that wants to - * sit on the dashboard.

            + * sit on a dashboard.

            * * WORK IN PROGRESS

            * @@ -32,6 +32,11 @@ extends PropertyChangeListener, DashboardProperties { /************************************************************************** + * Return a graphical representation of this panel. + **************************************************************************/ + JComponent getComponent(); + + /************************************************************************** * A name identifies a panel in the dashboard's tabs. It should be * relatively short, without newlines, or any other special * characters.

            @@ -63,11 +68,6 @@ Icon getIcon(); /************************************************************************** - * The main contents. Here is everything... - **************************************************************************/ - JComponent getComponent(); - - /************************************************************************** * Add a PropertyChangeListener to the listener list of a * panel. All listeners will be notified if this panel changes * some property.

            =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/09/13 06:54:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/09/18 08:46:26 1.2 @@ -18,7 +18,8 @@ /** * A list of names of most/all recognized properties that can be fired - * by dashboard panels.

            + * by dashboard panels, and a list of names of Java properties that + * can be used to configure the dashboard.

            * * @author Martin Senger * @version $Id$ @@ -27,7 +28,34 @@ public interface DashboardProperties { static final String DP_LOG_MSG = "log-msg"; + static final String DP_STATUS_MSG = "status-msg"; static final String DP_SERVICE_NAME = "dp-service-name"; static final String DP_DATATYPE_NAME = "dp-datatype-name"; + /** A filename containing Java properties that configure the + dashboard. */ + static final String DASHBOARD_PROPERTIES_FILE = "dashboard.properties"; + + /** A property name. Its value contains a title that will appear + * in big fonts on top of the dashboard. It may be empty if + * property {@link #DP_TITLE_ICON} is defined; otherwise a default + * value will be used. + */ + static final String DP_TITLE = "dashboard.title"; + + /** A property name. Its value contains a filename with an icon + * accompanying a dashboard title (defined by property {@link + * #DP_TITLE}. No default value used. Specify here either an + * absolute path (not recommended) or a relative path whose + * beginning can be found somewhere on the CLASSPATH. + */ + static final String DP_TITLE_ICON = "dashboard.title.icon"; + + /** A property name. Its value contains a filename with the main + * dashboard icon. Specify here either an absolute path (not + * recommended) or a relative path whose beginning can be found + * somewhere on the CLASSPATH. + */ + static final String DP_ICON = "dashboard.icon"; + } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java 2005/09/13 06:54:36 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java 2005/09/18 08:46:26 1.2 @@ -48,13 +48,14 @@ "Some buttons may use a text put in the adjacent form field.
            " + "For some events, the form field accepts a comma-separated list."); - SwingUtils.addComponent (p, desc, 0, 0, REMAINDER, 1, HORIZONTAL, FIRST_LINE_START, 0.0, 0.0); + SwingUtils.addComponent (p, desc, 0, 0, REMAINDER, 1, HORI, NWEST, 0.0, 0.0); addStringEvent (p, "Service name", DP_SERVICE_NAME); addStringEvent (p, "Data type name", DP_DATATYPE_NAME); + addStringEvent (p, "Status bar message", DP_STATUS_MSG); JLabel empty = new JLabel(); - SwingUtils.addComponent (p, empty, 0, RELATIVE, 2, 1, HORIZONTAL, FIRST_LINE_START, 0.0, 0.1); + SwingUtils.addComponent (p, empty, 0, RELATIVE, 2, 1, HORI, NWEST, 0.0, 0.1); return p; } @@ -74,8 +75,8 @@ }); // add it to the common panel - SwingUtils.addComponent (p, button, 0, RELATIVE, 1, 1, HORIZONTAL, FIRST_LINE_START, 0.0, 0.0); - SwingUtils.addComponent (p, text, 1, RELATIVE, 1, 1, HORIZONTAL, LINE_START, 1.0, 0.0); + SwingUtils.addComponent (p, button, 0, RELATIVE, 1, 1, HORI, NWEST, 0.0, 0.0); + SwingUtils.addComponent (p, text, 1, RELATIVE, 1, 1, HORI, WEST, 1.0, 0.0); } // @@ -90,11 +91,5 @@ return "Debugging Event Generator"; } - /************************************************************************** - * - **************************************************************************/ - public JLabel getTitle() { - return new JLabel (getName()); - } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/13 06:53:28 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/18 08:46:26 1.2 @@ -1,18 +1,17 @@ +TODO with views: +---------------- +? small icons to buttons +? use FileSystemView in file choosers +* alltools2: - PrefsUtils may become just a common parent for both *WithHistory classes + - combo box history is not updated if exit happened while focus is till in the text field + +? configure dashboard from menu: + * configure dashbard (add/remove dynamically panels) + * configure user preferences -src/main/org/biomoby/service/dashboard/Dashboard.java - -Dashboard configuration - by getResource() ------------------------ - -* SPI for panel interfaces (Apache - commons - Discovery) - -* persistence of the last used properties (at least those easily -serializable) - -* own properties, such as: - - title, icon, sub-title (will be replaced by a panel title) +* Registry panel: + - trees should be in panned blocks (user-resizable) -* java.beans (property chnages) Registry panel -------------- @@ -42,3 +41,10 @@ * model (worker: antWorker) +Other (future, possible) panels: +-------------------------------- +- verify registry +- browsing in graphs +- RDF resources +- Log panel +- Configure a new Dashboard =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/13 06:53:28 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/18 08:46:26 1.4 @@ -9,14 +9,25 @@ package org.biomoby.service.dashboard; import org.tulsoft.tools.gui.SwingUtils; +import org.tulsoft.tools.gui.JTextFieldWithHistory; +import org.tulsoft.tools.gui.JFileChooserWithHistory; +import javax.swing.JPanel; import javax.swing.JLabel; import javax.swing.Icon; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JFileChooser; import javax.swing.JComponent; import javax.swing.text.html.HTMLDocument; +import java.awt.GridBagLayout; + +import java.awt.event.KeyEvent; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; @@ -34,6 +45,13 @@ public class RegistryPanel extends AbstractPanel { + // names of user preferences keys + static final String USE_CACHE = "use-cache"; + + // components that are used from more methods + JFileChooserWithHistory cacheDir; + JLabel labelCacheDir; + /********************************************************************* * propertyChange() ********************************************************************/ @@ -52,21 +70,210 @@ * **************************************************************************/ public JComponent getComponent() { - return null; + if (pComponent != null) + return pComponent; + + pComponent = new JPanel (new GridBagLayout(), true); + + // ontology trees + ServicesTree servicesTree = new ServicesTree(); + DataTypesTree dataTypesTree = new DataTypesTree(); + NamespacesTree namespacesTree = new NamespacesTree(); + + // registry and cache locations + JPanel regLocation = getRegistryLocation(); + JPanel cacheLocation = getCacheLocation(); + + // put all together + SwingUtils.addComponent (pComponent, servicesTree.scrollable(), 0, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); + SwingUtils.addComponent (pComponent, dataTypesTree.scrollable(), 1, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); + SwingUtils.addComponent (pComponent, namespacesTree.scrollable(), 2, 0, 1, 2, BOTH, NWEST, 0.25, 0.66); + SwingUtils.addComponent (pComponent, regLocation, 3, 0, 1, 1, HORI, NWEST, 0.1, 0.0); + SwingUtils.addComponent (pComponent, cacheLocation, 3, 1, 1, 1, HORI, NWEST, 0.1, 0.0); + + return pComponent; + } + + /************************************************************************** + * + **************************************************************************/ + public void onReloadAll() { + } + + /************************************************************************** + * + **************************************************************************/ + public void onDefaults() { + } + + /************************************************************************** + * + **************************************************************************/ + public void onCacheInfo() { + } + + /************************************************************************** + * + **************************************************************************/ + public void onCacheErase() { + } + + /************************************************************************** + * + **************************************************************************/ + public void onCacheUpdate() { + } + + /************************************************************************** + * + **************************************************************************/ + public void onUseCache (boolean enabled) { + cacheDir.setEnabled (enabled); + labelCacheDir.setEnabled (enabled); + setPrefValue (USE_CACHE, enabled); + } + + /************************************************************************** + * Panel for registry. + **************************************************************************/ + protected JPanel getRegistryLocation() { + JLabel labelRegistryURL = new JLabel("Endpoint"); + JTextFieldWithHistory registryURL = + new JTextFieldWithHistory ("", this, "registryEndpoint"); + JLabel labelRegistryNS = new JLabel("Namespace (URI)"); + JTextFieldWithHistory registryNS = + new JTextFieldWithHistory ("", this, "registryNamespace"); + JButton reloadAllButton = + createButton (" Reload all ", + "Reload all ontology trees from the Biomoby registry", + KeyEvent.VK_R, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + onReloadAll(); + } + }); + JButton defaultsButton = + createButton (" Restore defaults ", + "Fill the text fields above with the default values", + KeyEvent.VK_D, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + onDefaults(); + } + }); + JPanel buttonPanel = createButtonPanel (new JButton[] { reloadAllButton, + defaultsButton }); + JPanel rLocation = createTitledPanel ("Biomoby registry location"); + SwingUtils.addComponent (rLocation, labelRegistryURL, 0, 0, 1, 1, NONE, NWEST, 0.0, 0.0); + SwingUtils.addComponent (rLocation, registryURL, 0, 1, 1, 1, HORI, NWEST, 1.0, 0.0); + SwingUtils.addComponent (rLocation, labelRegistryNS, 0, 2, 1, 1, NONE, NWEST, 0.0, 0.0, BREATH_TOP); + SwingUtils.addComponent (rLocation, registryNS, 0, 3, 1, 1, HORI, NWEST, 1.0, 0.0); + SwingUtils.addComponent (rLocation, buttonPanel, 0, 4, 1, 1, NONE, SWEST, 0.0, 0.0); + + return rLocation; + } + + /************************************************************************** + * Panel for local cache. + **************************************************************************/ + protected JPanel getCacheLocation() { + boolean usingCache = getPrefValue (USE_CACHE, true); + JCheckBox useCache = + createCheckBox ("Use local cache", usingCache, KeyEvent.VK_C, + new ItemListener() { + public void itemStateChanged (ItemEvent e) { + onUseCache (e.getStateChange() == ItemEvent.SELECTED); + } + }); + labelCacheDir = new JLabel("Cache directory"); + cacheDir = createFileSelector ("Select directory for/with local cache", + "Select", + JFileChooser.DIRECTORIES_ONLY, + System.getProperty ("java.io.tmpdir"), + null); + onUseCache (usingCache); + JButton infoButton = + createButton (" Info ", + "Show current information about the local cache", + KeyEvent.VK_I, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + onCacheInfo(); + } + }); + JButton updateButton = + createButton (" Update ", + "Update local cache from Biomoby registry", + KeyEvent.VK_U, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + onCacheUpdate(); + } + }); + JButton eraseButton = + createButton (" Erase ", + "Remove everything from the local cache", + KeyEvent.VK_E, + new ActionListener() { + public void actionPerformed (ActionEvent e) { + onCacheErase(); + } + }); + JPanel buttonPanel = createButtonPanel (new JButton[] { infoButton, + updateButton, + eraseButton }); + + JPanel cLocation = createTitledPanel ("Local cache"); + SwingUtils.addComponent (cLocation, useCache, 0, 0, 1, 1, NONE, NWEST, 0.0, 0.0); + SwingUtils.addComponent (cLocation, labelCacheDir, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0, BREATH_TOP); + SwingUtils.addComponent (cLocation, cacheDir, 0, 2, 1, 1, HORI, NWEST, 1.0, 0.0); + SwingUtils.addComponent (cLocation, buttonPanel, 0, 3, 1, 1, NONE, SWEST, 0.0, 0.0); + + return cLocation; + } + + /************************************************************************** + * + **************************************************************************/ + class ServicesTree extends CommonTree { + public ServicesTree() { + super ("Services"); + } + } + + /************************************************************************** + * + **************************************************************************/ + class DataTypesTree extends CommonTree { + public DataTypesTree() { + super ("DataTypes"); + } + } + + /************************************************************************** + * + **************************************************************************/ + class NamespacesTree extends CommonTree { + public NamespacesTree() { + super ("Namespaces"); + } } /************************************************************************** * **************************************************************************/ public String getName() { - return "Biomoby Registry"; + return "Registry Browser"; } /************************************************************************** * **************************************************************************/ - public JLabel getTitle() { - return new JLabel (getName()); + public Icon getIcon() { + if (panelIcon == null) + panelIcon = SwingUtils.createIcon ("images/registry.gif", this); + return panelIcon; } + } From kawas at pub.open-bio.org Tue Sep 20 21:16:34 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Tue, 20 Sep 2005 17:16:34 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509202116.j8KLGYkp006490@pub.open-bio.org> kawas Tue Sep 20 17:16:34 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv6465 Modified Files: OntologyServer.pm Log Message: added the suggestions asked for by martin. Code that has been added is commented out until a decision is made on whether to support the changes. Code marked by: #UNCOMMENT denotes code that should be uncommented to add functionality #COMMENT/REMOVE denotes code that should be removed in conjunction with the additions. Lines subject to removal: 927 Lines subject to addition: 928 moby-live/Perl/MOBY OntologyServer.pm,1.83,1.84 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.83 retrieving revision 1.84 diff -u -r1.83 -r1.84 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/08/30 14:52:15 1.83 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/20 21:16:34 1.84 @@ -1,1315 +1,1316 @@ -#$Id$ -# this module needs to talk to the 'real' ontology -# server as well as the MOBY Central database -# in order to ensure that they are both in sync - -=head1 NAME - -MOBY::OntologyServer - A way for MOBY Central to query the -object, service, namespace, and relationship ontologies - -=cut - -=head1 SYNOPSIS - - use MOBY::OntologyServer; - my $OS = MOBY::OntologyServer->new(ontology => "object"); - - my ($success, $message, $existingURI) = $OS->objectExists(term => "Object"); - - if ($success){ - print "object exists and it has the LSID $existingURI\n"; - } else { - print "object does not exist; additional message from server: $message\n"; - } - - -=cut - -=head1 DESCRIPTION - -Swappable interface to ontologies. It should deal with LSID's 100% -of the time, and also deal with MOBY-specific common names for objects, -services, namespaces, and relationship types. - - - -=head1 AUTHORS - -Mark Wilkinson (markw at illuminae.com) - -BioMOBY Project: http://www.biomoby.org - - -=cut - -=head1 METHODS - - -=head2 new - - Title : new - Usage : my $OS = MOBY::OntologyServer->new(%args) - Function : - Returns : MOBY::OntologyServer object - Args : ontology => [object || service || namespace || relationship] - database => mysql databasename that holds the ontologies - host => mysql hostname - username => mysql username - password => mysql password - port => mysql port - dbh => pre-existing database handle to a mysql database - -=cut - -package MOBY::OntologyServer; -use strict; -use Carp; -use vars qw($AUTOLOAD); -use DBI; -use DBD::mysql; -use MOBY::Config; -my $debug = 0; -{ - - #Encapsulated class data - #___________________________________________________________ - #ATTRIBUTES - my %_attr_data = # DEFAULT ACCESSIBILITY - ( - ontology => [ undef, 'read/write' ], - database => [ undef, 'read/write' ], - host => [ undef, 'read/write' ], - username => [ undef, 'read/write' ], - password => [ undef, 'read/write' ], - port => [ undef, 'read/write' ], - dbh => [ undef, 'read/write' ], - ); - - #_____________________________________________________________ - # METHODS, to operate on encapsulated class data - # Is a specified object attribute accessible in a given mode - sub _accessible { - my ( $self, $attr, $mode ) = @_; - $_attr_data{$attr}[1] =~ /$mode/; - } - - # Classwide default value for a specified object attribute - sub _default_for { - my ( $self, $attr ) = @_; - $_attr_data{$attr}[0]; - } - - # List of names of all specified object attributes - sub _standard_keys { - keys %_attr_data; - } -} - -sub new { - my ( $caller, %args ) = @_; - my $caller_is_obj = ref($caller); - my $class = $caller_is_obj || $caller; - my $self = bless {}, $class; - foreach my $attrname ( $self->_standard_keys ) { - if ( exists $args{$attrname} && defined $args{$attrname} ) { - $self->{$attrname} = $args{$attrname}; - } elsif ($caller_is_obj) { - $self->{$attrname} = $caller->{$attrname}; - } else { - $self->{$attrname} = $self->_default_for($attrname); - } - } - $self->ontology eq 'object' && $self->database('mobyobject'); - $self->ontology eq 'namespace' && $self->database('mobynamespace'); - $self->ontology eq 'service' && $self->database('mobyservice'); - $self->ontology eq 'relationship' && $self->database('mobyrelationship'); - - #print STDERR "\n\nCONFIG object is $CONFIG\n\n"; - $CONFIG ||= MOBY::Config->new; - -#print STDERR "got username ",($CONFIG->{mobycentral}->{username})," for mobycentral\n"; - $self->username( $CONFIG->{ $self->database }->{username} ) - unless $self->username; - $self->password( $CONFIG->{ $self->database }->{password} ) - unless $self->password; - $self->port( $CONFIG->{ $self->database }->{port} ) unless $self->port; - $self->host( $CONFIG->{ $self->database }->{url} ) unless $self->host; - my $host = $self->host ? $self->host : $ENV{MOBY_CENTRAL_URL}; - chomp $host; - my $username = - $self->username ? $self->username : $ENV{MOBY_CENTRAL_DBUSER}; - chomp $username; - my $password = - $self->password ? $self->password : $ENV{MOBY_CENTRAL_DBPASS}; - chomp $password if $password; - $password =~ s/\s//g if $password; - my $port = $self->port ? $self->port : $ENV{MOBY_CENTRAL_DBPORT}; - chomp $port; - my ($dsn) = - "DBI:mysql:" - . ( $CONFIG->{ $self->database }->{dbname} ) . ":" - . ($host) . ":" - . ($port); - - #print STDERR "\n\nDSN was $dsn\n\n"; - my $dbh; - -# $debug && &_LOG("connecting to db with params ",$self->database, $self->username, $self->password,"\n"); - if ( defined $password ) { - $dbh = DBI->connect( $dsn, $username, $password, { RaiseError => 1 } ) - or die "can't connect to database"; - } else { - $dbh = DBI->connect( $dsn, $username, undef, { RaiseError => 1 } ) - or die "can't connect to database"; - } - - # $debug && &_LOG("CONNECTED!\n"); - if ($dbh) { - $self->dbh($dbh); - return $self; - } else { - return undef; - } -} - -=head2 objectExists - - moby:newterm will return (0, $message, $MOBYLSID) - newterm will return (0, $message, $MOBYLSID - oldterm will return (1, $message, undef) - newLSID will return (0, $desc, $lsid) -=cut - -sub objectExists { - my ( $self, %args ) = @_; - - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - - my $term = $args{term}; - $term =~ s/^moby://; # if the term is namespaced, then remove that - my $sth; - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); - - my $result; - - $result = $adaptor->query_object(type => $term); - - my $row = shift(@$result); - my $lsid = $row->{object_lsid}; - my $type = $row->{object_type}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $email = $row->{contact_email}; - - if ($lsid) - { # if it is in there, then it has been discovered regardless of being foreign or not - return ( 1, $desc, $lsid ); - } elsif ( _isForeignLSID($term) ) - { # if not in our ontology, but is a foreign LSID, then pass it back verbatim - return ( - 0, -"LSID $term does not exist in the biomoby.org Object Class system\n", - $term - ); - } else { # under all other circumstances (i.e. not a term, or a non-existent biomoby LSID) then fail - return ( - 0, -"Object type $term does not exist in the biomoby.org Object Class system\n", - '' - ); - } -} - -sub _isMOBYLSID { - my ($lsid) = @_; - return 1 if $lsid =~ /^urn\:lsid\:biomoby.org/; - return 0; -} - -sub _isForeignLSID { - my ($lsid) = @_; - return 0 if $lsid =~ /^urn\:lsid\:biomoby.org/; - return 1; -} - -=head2 createObject - -=cut - -sub createObject { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); - return ( 0, "requires a object type node", '' ) unless ( $args{node} ); - return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); - return ( 0, "requires a contact email address", '' ) - unless ( $args{contact_email} ); - return ( 0, "requires a object description", '' ) - unless ( $args{description} ); - my $term = $args{node}; - - my $LSID = - ( $args{'node'} =~ /urn\:lsid/ ) - ? $args{'node'} - : $self->setURI( $args{'node'} ); - unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } - my $result; - $result = $adaptor->query_object(type => $term); - my $row = shift(@$result); - my $lsid = $row->{object_lsid}; - my $type = $row->{object_type}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $email = $row->{contact_email}; - - if ($lsid) { # if it is in there, then the object exists - return ( 0, "This term already exists: $lsid", $lsid ); - } - $args{description} =~ s/^\s+(.*?)\s+$/$1/s; - $args{node} =~ s/^\s+(.*?)\s+$/$1/s; - $args{contact_email} =~ s/^\s+(.*?)\s+$/$1/s; - $args{authority} =~ s/^\s+(.*?)\s+$/$1/s; - - my $insertid = $adaptor->insert_object(object_type => $args{'node'}, - object_lsid => $LSID, - description => $args{'description'}, - authority => $args{'authority'}, - contact_email => $args{'contact_email'}); - unless ( $insertid ) { - return ( 0, "Object creation failed for unknown reasons", '' ); - } - return ( 1, "Object creation succeeded", $LSID ); -} - -=head2 retrieveObject - -=cut - -sub retrieveObject { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - my $term = $args{'type'}; - $term ||=$args{'node'}; - - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); - return ( 0, "requires a object type node as an argument", '' ) - unless ( $term ); - my $LSID = - ( $term =~ /urn\:lsid/ ) - ? $term - : $self->getObjectURI($term); - unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } - my $result = $adaptor->query_object(type => $LSID); - my $row = shift(@$result); -# my $id = $row->{object_id}; - my $type = $row->{object_type}; - my $lsid = $row->{object_lsid}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $contact = $row->{contact_email}; - - unless ($lsid) { return ( 0, "Object doesn't exist in ontology", "" ) } - - # my $OS = MOBY::OntologyServer->new(ontology => "relationship"); - - $result = $adaptor->get_object_relationships(type => $lsid); - my %rel; - foreach my $row (@$result) - { - my $relationship_type = $row->{relationship_type}; - my $objectlsid = $row->{object_lsid}; - my $article = $row->{object2_articlename}; - my $contact = $row->{contact_email}; - my $def = $row->{definition}; - my $auth = $row->{authority}; - my $type = $row->{object_type}; - - push @{ $rel{$relationship_type} }, [ $objectlsid, $article, $type, $def, $auth, $contact ]; - } - return { - objectType => $type, - objectLSID => $lsid, - description => $desc, - contactEmail => $contact, - authURI => $auth, - Relationships => \%rel - }; -} - -=head2 deprecateObject - -=cut - -sub deprecateObject { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - - return ( 0, "WRONG ONTOLOGY", '' ) unless ( $self->ontology eq 'object' ); - my $term = $args{term}; - -# if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ -# return (0, "can't delete from external ontology", $term); -# } - my $LSID; - unless ( $term =~ /urn\:lsid/ ) { $LSID = $self->getObjectURI($term) } else { $LSID = $term } - return ( 0, q{Object type $term cannot be resolved to an LSID}, "" ) - unless $LSID; - - my $result = $adaptor->query_object(type => $LSID); - my $row = shift(@$result); - my $id = $row->{object_id}; - my $lsid = $row->{object_lsid}; - - # object1_id ISA object2_id? - my $isa = $adaptor->query_object_term2term(type => $lsid); - my $isas = shift @$isa; - if ( $isas->{object1_id}) { - return ( 0, - qq{Object type $term has object dependencies in the ontology}, - $lsid ); - } - - my ($err, $errstr) = $adaptor->delete_object(type => $lsid); - if ( $err ) { - return ( 0, "Delete from Object Class table failed: $errstr", - $lsid ); - } - return ( 1, "Object $term Deleted", $lsid ); -} - -=head2 deleteObject - -=cut - -sub deleteObject { - my $self = shift; - $self->deprecateObject(@_); -} - -=head2 relationshipExists - -=cut - -sub relationshipExists { - - # term => $term - # ontology => $ontology - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); - return ( 0, "WRONG ONTOLOGY!", '' ) - unless ( $self->ontology eq 'relationship' ); - my $term = lc( $args{term} ); - $term =~ s/^moby://; # if the term is namespaced, then remove that - my $ont = $args{ontology}; - return ( 0, "requires both term and ontology arguments\n", '' ) - unless ( defined($term) && defined($ont) ); - my $result; - if ( $term =~ /^urn\:lsid/ ) { - - $result = $adaptor->query_relationship( - type => $term, - ontology => $ont); - - } else { - - $result = $adaptor->query_relationship(type => $term, ontology => $ont); - - } - my $row = shift(@$result); - my $lsid = $row->{relationship_lsid}; - my $type = $row->{relationship_type}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $email = $row->{contact_email}; - if ($lsid) { - return ( 1, $desc, $lsid, $type, $auth, $email ); - } else { - return ( - 0,"Relationship Type $term does not exist in the biomoby.org Relationship Type system\n", - '', '', '', '' - ); - } -} - -=head2 addObjectRelationship - -=cut - -sub addObjectRelationship { - - # adds a relationship - #subject_node => $term, - #relationship => $reltype, - #object_node => $objectType, - #articleName => $articleName, - #authority => $auth, - #contact_email => $email - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); - - my $result = $adaptor->query_object(type => $args{subject_node}); - my $row = shift(@$result); - my $subj_lsid = $row->{object_lsid}; - return ( 0, qq{Object type $args{subject_node} does not exist in the ontology}, '' ) - unless defined $subj_lsid; - - $result = $adaptor->query_object(type => $args{object_node}); - $row = shift(@$result); - my $obj_lsid = $row->{object_lsid}; - return ( 0,qq{Object type $args{object_node} does not exist in the ontology},'' ) - unless defined $obj_lsid; - my $isa = $adaptor->query_object_term2term(type => $subj_lsid); - my $isarow = shift @$isa; - if ( $isarow->{object_lsid} ) { - return ( - 0, - qq{Object type $args{subject_node} has existing object dependencies in the ontology. It cannot be changed.}, - $subj_lsid - ); - } - my $OE = MOBY::OntologyServer->new( ontology => 'relationship' ); - my ( $success, $desc, $rel_lsid ) = $OE->relationshipExists( - term => $args{relationship}, - ontology => 'object' ); - ($success) || return ( 0, - qq{Relationship $args{relationship} does not exist in the ontology}, - '' ); - - # need to ensure that identical article names dont' end up at the same level - my $articleNameInvalid = &_testIdenticalArticleName(term => $subj_lsid, articleName => $args{articleName}); - return (0, "Object will have conflicting articleName ".($args{articleName}), '') if $articleNameInvalid; - - my $insertid = $adaptor->insert_object_term2term(relationship_type => $rel_lsid, - object1_type => $subj_lsid, - object2_type => $obj_lsid, - object2_articlename => $args{articleName}); - - - if ($insertid ) { - return ( 1, "Object relationsihp created successfully", '' ); - } else { - return ( 0, "Object relationship creation failed for unknown reasons", - '' ); - } -} - -sub _testIdenticalArticleName { - my (%args)= @_; - my $term = $args{term}; - my $articleName = $args{articleName}; - my $foundCommonArticleNameFlag = 0; - # need to first traverse down the ISA pathway to root - # then for each ISA test the hAS and HASA's for their articlenames and see if they are the same - # case insensitive? - my $OS = MOBY::OntologyServer->new(ontology => 'object'); - my $OSrel = MOBY::OntologyServer->new(ontology => 'relationship'); - my ($exists1, $desc, $isalsid) = $OSrel->relationshipExists(term => 'isa', ontology => 'object'); - my ($exists2, $desc2, $hasalsid) = $OSrel->relationshipExists(term => 'hasa', ontology => 'object'); - my ($exists3, $desc3, $haslsid) = $OSrel->relationshipExists(term => 'has', ontology => 'object'); - - return 1 unless ($exists1 && $exists2 && $exists3); # this is bad, since it returns boolean suggesting that it found a common articlename rather than finding that a given relationship doesn't exist, but... hey.... - # check the hasa relationships for common articleName - $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $args{term}, relationship => $hasalsid, targetArticleName => $articleName); - # check the has relationships for common articleName - $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $args{term}, relationship => $haslsid, targetArticleName => $articleName); - - # now get all of its inherited parents - my $relationships = $OS->Relationships( - ontology => 'object', - term => $args{term}, - relationship => $isalsid, - direction => 'root', - expand => 1); - #relationships{relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] - my ($isa) = keys(%$relationships); # can only be one key returned, and must be isa in this case - my @ISAlist; - (@ISAlist = @{$relationships->{$isa}}) if ($relationships->{$isa}) ; - # for each of the inherited parents, check their articleNames - foreach my $ISA(@ISAlist){ # $ISA = [lsid, articleName] (but articleName shuld be null anyway in this case) - my $what_it_is = shift @$ISA; - # check the hasa relationships for common articleName - $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $what_it_is, relationship => $hasalsid, targetArticleName => $articleName); - # check the has relationships for common articleName - $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $what_it_is, relationship => $haslsid, targetArticleName => $articleName); - } - return $foundCommonArticleNameFlag; -} - -sub _compareArticleNames { - my (%args) = @_; - my $OS = $args{OS}; - my $what_it_is = $args{type}; - my $lsid = $args{relationship}; - my $targetArticleName = $args{targetArticleName}; - my $foundCommonArticleNameFlag = 0; - my $contents = $OS->Relationships( - ontology => 'object', - term => $what_it_is, - relationship => $lsid, - direction => 'root', - ); - if ($contents){ - #$hasarelationships{relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] - my ($content) = keys(%$contents); - if ($contents->{$content}){ - my @CONTENTlist = @{$contents->{$content}}; - foreach my $CONTAINED(@CONTENTlist){ - $foundCommonArticleNameFlag = 1 if ($CONTAINED->[1] eq $targetArticleName); #->[1] is the articleName field - } - } - } - return $foundCommonArticleNameFlag; -} - -=head2 addServiceRelationship - -=cut - -sub addServiceRelationship { - - # adds an ISA relationship - # fail if another object is in relation to this objevt - #subject_node => $term, - #relationship => $relationship, - #predicate_node => $pred - #authority => $auth, - #contact_email => $email); - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); - - my $result = $adaptor->query_service(type => $args{subject_node}); - my $row = shift(@$result); - my $sbj_lsid = $row->{service_lsid}; - - return (0, - qq{Service type $args{subject_node} has object dependencies in the ontology. It can not be changed}, - $sbj_lsid - ) unless defined $sbj_lsid; - - my $isa = $adaptor->query_service_term2term(service2_id => $sbj_lsid); - my $isarow = shift @$isa; - if ( $isarow->{service_lsid} ) { - return ( - 0, - qq{Service type $args{subject_node} has object dependencies in the ontology. It can not be changed}, - $sbj_lsid - ); - } - $result = $adaptor->query_service(type => $args{object_node}); - $row = shift(@$result); - my $obj_lsid = $row->{service_lsid}; - # get ID of the related service - - defined $obj_lsid - || return ( 0, - qq{Service $args{object_node} does not exist in the service ontology}, - '' ); - my $OE = MOBY::OntologyServer->new( ontology => 'relationship' ); - my ( $success, $desc, $rel_lsid ) = $OE->relationshipExists( - term => $args{relationship}, - ontology => 'service' ); - ($success) - || return ( 0, - qq{Relationship $args{relationship} does not exist in the ontology}, - '' ); - - my $insertid = $adaptor->insert_service_term2term(relationship_type => $rel_lsid, - service1_type => $sbj_lsid, - service2_type => $obj_lsid); - if ( defined($insertid)) { - return ( 1, "Service relationship created successfully", '' ); - } else { - return ( 0, "Service relationship creation failed for unknown reasons", - '' ); - } -} - -=head2 serviceExists - -=cut - -sub serviceExists { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); - my $term = $args{term}; - $term =~ s/^moby://; # if the term is namespaced, then remove that - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) - { - return ( 1, "external ontology", $term ); - } - my $result; - $result = $adaptor->query_service(type => $term); - my $row = shift(@$result); - my $id = $row->{service_id}; - my $type = $row->{service_type}; - my $lsid = $row->{service_lsid}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $email = $row->{contact_email}; - - if ($id) { - return ( 1, $desc, $lsid ); - } else { - return ( - 0, -"Service Type $term does not exist in the biomoby.org Service Type ontology\n", - '' - ); - } -} - -=head2 createServiceType - -=cut - -sub createServiceType { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - - #node => $term, - #descrioption => $desc, - #authority => $auth, - #contact_email => $email); - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); - return ( 0, "requires a object type node", '' ) unless ( $args{node} ); - return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); - return ( 0, "requires a contact email address", '' ) - unless ( $args{contact_email} ); - return ( 0, "requires a object description", '' ) - unless ( $args{description} ); - my $term = $args{node}; - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) - { # if it is an LSID, but not a MOBY LSID, than barf - return ( 0, "can't create a term in a non-MOBY ontology!", $term ); - } - my $LSID = - ( $args{'node'} =~ /urn\:lsid/ ) - ? $args{'node'} - : $self->setURI( $args{'node'} ); - unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } - - my $insertid = $adaptor->insert_service(service_type => $args{'node'}, - service_lsid => $LSID, - description => $args{'description'}, - authority => $args{'authority'}, - contact_email => $args{'contact_email'}); - - unless ( $insertid ) { - return ( 0, "Service creation failed for unknown reasons", '' ); - } - return ( 1, "Service creation succeeded", $LSID ); -} - -=head2 deleteServiceType - -=cut - -sub deleteServiceType { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - - return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); - my $term = $args{term}; - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) - { - return ( 0, "can't delete from external ontology", $term ); - } - my $LSID; - unless ( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) { - $LSID = $self->getServiceURI($term); - } else { - $LSID = $term; - } - return ( - 0, q{Service type $term cannot be resolved to an LSID in the MOBY ontologies},"" - ) unless $LSID; - - my $result = $adaptor->query_service(type => $LSID); - my $row = shift(@$result); - my $lsid = $row->{service_lsid}; - - if ( !defined $lsid ) { - return ( 0, q{Service type $term does not exist in the ontology}, - $lsid ); - } - - # service1_id ISA service2_id? - my $isa = $adaptor->query_service_term2term(type => $lsid); - my $isas = shift(@$isa); - - if ( $isas->{service1_id} ) { - return ( 0, qq{Service type $term has dependencies in the ontology}, - $lsid ); - } - my ($err, $errstr) = $adaptor->delete_service(type => $lsid); - - if ( $err ) { - return ( 0, "Delete from Service Type table failed: $errstr", - $lsid ); - } - - return ( 1, "Service Type $term Deleted", $lsid ); -} - -=head2 namespaceExists - -=cut - -sub namespaceExists { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - - return ( 0, "WRONG ONTOLOGY!", '' ) - unless ( $self->ontology eq 'namespace' ); - my $term = $args{term}; - $term =~ s/^moby://; # if the term is namespaced, then remove that - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) - { - return ( 1, "external ontology", $term ); - } - my $result; - $result = $adaptor->query_namespace(type => $term); - my $row = shift(@$result); - my $id = $row->{namespace_id}; - my $type = $row->{namespace_type}; - my $lsid = $row->{namespace_lsid}; - my $desc = $row->{description}; - my $auth = $row->{authority}; - my $email = $row->{contact_email}; - - if ($id) { - return ( 1, $desc, $lsid ); - } else { - return ( - 0, -"Namespace Type $term does not exist in the biomoby.org Namespace Type ontology\n", - '' - ); - } -} - -=head2 createNamespace - -=cut - -sub createNamespace { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - #node => $term, - #descrioption => $desc, - #authority => $auth, - #contact_email => $email); - return ( 0, "WRONG ONTOLOGY!", '' ) - unless ( $self->ontology eq 'namespace' ); - return ( 0, "requires a namespace type node", '' ) unless ( $args{node} ); - return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); - return ( 0, "requires a contact email address", '' ) - unless ( $args{contact_email} ); - return ( 0, "requires a object description", '' ) - unless ( $args{description} ); - my $term = $args{node}; - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) - { # if it is an LSID, but not a MOBY LSID, than barf - return ( 0, "can't create a term in a non-MOBY ontology!", $term ); - } - my $LSID = - ( $args{'node'} =~ /urn\:lsid/ ) - ? $args{'node'} - : $self->setURI( $args{'node'} ); - unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } - - my $insertid = $adaptor->insert_namespace(namespace_type => $args{'node'}, - namespace_lsid => $LSID, - description => $args{'description'}, - authority => $args{'authority'}, - contact_email => $args{'contact_email'}); - - unless ( $insertid ) { - return ( 0, "Namespace creation failed for unknown reasons", '' ); - } - return ( 1, "Namespace creation succeeded", $LSID ); -} - -=head2 deleteNamespace - -=cut - -sub deleteNamespace { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - return ( 0, "WRONG ONTOLOGY!", '' ) - unless ( $self->ontology eq 'namespace' ); - my $term = $args{term}; - my $LSID; - unless ( $term =~ /urn\:lsid/ ) { $LSID = $self->getNamespaceURI($term) } else { $LSID = $term } - return ( 0, q{Namespace type $term cannot be resolved to an LSID}, "" ) - unless $LSID; - if ( $term =~ /^urn:lsid/ - && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) - { - return ( 0, "cannot delete a term from an external ontology", $term ); - } - - my $result = $adaptor->query_namespace(type => $LSID); - my $row = shift(@$result); - my $lsid = $row->{namespace_lsid}; - - unless ($lsid) { - return ( 0, q{Namespace type $term does not exist in the ontology}, - $lsid ); - } - - # service1_id ISA service2_id? - my $isa = $adaptor->query_namespace_term2term(type => $lsid); - my $isas = shift @$isa; - - if ($isas->{namespace1_id} ) { - return ( 0, qq{Namespace type $term has dependencies in the ontology}, - $lsid ); - } - - my ($err, $errstr) = $adaptor->delete_namespace(type => $lsid); - - if ( $err ) { - return ( 0, "Delete from namespace table failed: $errstr", - $lsid ); - } - - #($err, $errstr) = $adaptor->delete_namespace_term2term(namespace1_id => $lsid); - # - #if ( $err ) { - # return ( - # 0, - # "Delete from namespace term2term table failed: $errstr", - # $lsid - # ); - #} - return ( 1, "Namespace Type $term Deleted", $lsid ); -} - -=head2 retrieveAllServiceTypes - -=cut - -sub retrieveAllServiceTypes { - my ($self) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - my $types = $adaptor->query_service(); - - my %response; - foreach (@$types) { - $response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}]; - } - return \%response; -} - -=head2 retrieveAllNamespaceTypes - -=cut - -sub retrieveAllNamespaceTypes { - my ($self) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - my $types = $adaptor->query_namespace(); - - my %response; - foreach (@$types) { - $response{ $_->{namespace_type} } = [$_->{description}, $_->{namespace_lsid}, $_->{authority}, $_->{contact_email}]; - } - return \%response; -} - -=head2 retrieveAllObjectClasses - -=cut - -sub retrieveAllObjectClasses { - my ($self) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - my $types = $adaptor->query_object(); - - my %response; - foreach (@$types) { - $response{ $_->{object_type} } = [$_->{description}, $_->{object_lsid}]; - } - return \%response; -} -*retrieveAllObjectTypes = \&retrieveAllObjectClasses; -*retrieveAllObjectTypes = \&retrieveAllObjectClasses; - -=head2 getObjectCommonName - -=cut - -sub getObjectCommonName { - my ( $self, $URI ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - return undef unless $URI =~ /urn\:lsid/; - my $result = $adaptor->query_object(type => $URI); - my $row = shift(@$result); - my $name = $row->{object_type}; - - return $name ? $name : $URI; -} - -=head2 getNamespaceCommonName - -=cut - -sub getNamespaceCommonName { - my ( $self, $URI ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - return undef unless $URI =~ /urn\:lsid/; - my $result = $adaptor->query_namespace(type => $URI); - my $row = shift(@$result); - my $name = $row->{namespace_type}; - - return $name ? $name : $URI; -} - -=head2 getServiceCommonName - -=cut - -sub getServiceCommonName { - my ( $self, $URI ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - return undef unless $URI =~ /urn\:lsid/; - my $result = $adaptor->query_service(type => $URI); - my $row = shift(@$result); - my $name = $row->{service_type}; - - return $name ? $name : $URI; -} - -=head2 getServiceURI - -=cut - -sub getServiceURI { - my ( $self, $term ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); - return $term if $term =~ /urn\:lsid/; - - my $result = $adaptor->query_service(type => $term); - my $row = shift(@$result); - my $id = $row->{service_lsid}; - - return $id; -} - -=head2 getObjectURI - -=cut - -sub getObjectURI { - my ( $self, $term ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); - return $term if $term =~ /urn\:lsid/; - - my $result = $adaptor->query_object(type => $term); - my $row = shift(@$result); - my $id = $row->{object_lsid}; - - return $id; -} - -=head2 getNamespaceURI - -=cut - -sub getNamespaceURI { - my ( $self, $term ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); - - return $term if $term =~ /urn\:lsid/; - - my $result = $adaptor->query_namespace(type => $term); - my $row = shift(@$result); - my $id = $row->{namespace_lsid}; - - return $id; -} - -=head2 getRelationshipURI - -consumes ontology (object/service) -consumes relationship term as term or LSID - -=cut - -sub getRelationshipURI { - my ( $self, $ontology, $term ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); - - return $term if $term =~ /urn\:lsid/; - - my $result = $adaptor->query_relationship(type => $term, ontology => $ontology); - my $row = shift(@$result); - my $id = $row->{relationship_lsid}; - - return $id; -} - -=head2 getRelationshipTypes - -=cut - -sub getRelationshipTypes { - my ( $self, %args ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); - - my $ontology = $args{'ontology'}; - my $OS = MOBY::OntologyServer->new( ontology => "relationship" ); - - my $defs = $adaptor->query_relationship(ontology => $ontology); - - my %result; - foreach ( @$defs ) { - $result{ $_->{relationship_lsid} } = [ $_->{relationship_type}, $_->{authority}, $_->{description} ]; - } - return \%result; -} - -=head2 Relationships - -=cut - -sub Relationships { - - # this entire subroutine assumes that there is NOT multiple parenting!! - my ( $self, %args ) = @_; - my $ontology = $args{ontology} ? $args{ontology} : $self->ontology; - my $term = $args{term}; - my $relationship = $args{relationship}; - my $direction = $args{direction} ? $args{direction} : 'root'; - my $expand = $args{expand} ? 1 : 0; - return - unless ( $ontology - && $term - && ( ( $ontology eq 'service' ) || ( $ontology eq 'object' ) ) ); - - # convert $term into an LSID if it isn't already - if ( $ontology eq 'service' ) { - $term = $self->getServiceURI($term); - $relationship ||="isa"; - my $OS = MOBY::OntologyServer->new(ontology => 'relationship'); - $relationship = $OS->getRelationshipURI("service", $relationship); - } elsif ( $ontology eq 'object' ) { - $term = $self->getObjectURI($term); - $relationship ||="isa"; - my $OS = MOBY::OntologyServer->new(ontology => 'relationship'); - $relationship = $OS->getRelationshipURI("object", $relationship); - } - my %results; - while ( ( $term ne 'urn:lsid:biomoby.org:objectclass:Object' ) - && ( $term ne 'urn:lsid:biomoby.org:servicetype:Service' ) ) - { - my $defs = $self->_doRelationshipsQuery( $ontology, $term, - $relationship, $direction ); - return {[]} unless $defs; # somethig has gone terribly wrong! - my $lsid; - my $rel; - my $articleName; - foreach ( @{$defs} ) { - $lsid = $_->[0]; - $rel = $_->[1]; - $articleName = $_->[2]; - $articleName ||=""; - $debug - && _LOG("\t\tADDING RELATIONSHIP $_ : $lsid to $rel\n"); - push @{ $results{$rel} }, [$lsid, $articleName]; - } - last unless ($expand); - last unless ( $direction eq "root" ); # if we aren't going to root, then be careful or we'll loop infnitely - $term = $lsid; # this entire subroutine assumes that there is NOT multiple parenting... - } - return \%results; #results(relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] -} - -sub _doRelationshipsQuery { - my ( $self, $ontology, $term, $relationship, $direction ) = @_; - $CONFIG ||= MOBY::Config->new; # exported by Config.pm - my $datasource = "moby$ontology"; # like mobyobject, or mobyservice - my $adaptor = $CONFIG->getDataAdaptor( datasource => $datasource ); - my $defs; - # query returns a reference to an array containing array references - $defs = $adaptor->get_relationship(direction => $direction, - ontology => $ontology, - term => $term, - relationship => $relationship); - # a very long piece of SQL statements have been refactored into Moby::Adaptor::moby::queryapi::mysql.pm - return $defs; -} - -=head2 setURI - -=cut - -sub setURI { - my ( $self, $id ) = @_; - my $URI; - - # $id = lc($id); - if ( $self->ontology eq 'object' ) { - $URI = "urn:lsid:biomoby.org:objectclass:$id"; - } elsif ( $self->ontology eq 'namespace' ) { - $URI = "urn:lsid:biomoby.org:namespacetype:$id"; - } elsif ( $self->ontology eq 'service' ) { - $URI = "urn:lsid:biomoby.org:servicetype:$id"; - } elsif ( $self->ontology eq 'relationship' ) { - $URI = "urn:lsid:biomoby.org:relationshiptype:$id"; - } else { - $URI = 0; - } - return $URI; -} - -=head2 traverseDAG - -=cut - -sub traverseDAG { - my ( $self, $term, $direction ) = @_; - my $ontology = $self->ontology; - return {} unless $ontology; - return {} unless $term; - $direction = "root" unless ($direction); - return {} unless ( ( $direction eq 'root' ) || ( $direction eq 'leaves' ) ); - if ( $ontology eq 'service' ) { - $term = $self->getServiceURI($term); - } elsif ( $ontology eq 'object' ) { - $term = $self->getObjectURI($term); - } - return {} unless $term =~ /^urn\:lsid/; # now its a URI - my $relhash = $self->getRelationshipTypes( ontology => $ontology ); # get teh types of relationships for the object/service ontology - return {} unless $relhash; - my @rels = keys %{$relhash}; #@rels is the list of relationship types for that ontology - my %relationships; - foreach my $relationship (@rels) { - my %IDS; - my $OS = MOBY::OntologyServer->new( ontology => 'relationship' ); - my $reluri = - $OS->getRelationshipURI( $ontology, $relationship ) - ; # get the URI for that relationship type if it ins't already a URI - $IDS{$term} = "untestedroot"; # mark the one in-hand as being untested - while ( grep /untested/, ( values %IDS ) ) - { # now, while there are untested services in our list... - foreach my $termthingy ( keys %IDS ) - { # start parsing through the current list (hash keys) - $debug && _LOG("testing $relationship of $termthingy\n"); - next - if ( $IDS{$termthingy} eq "tested" ) - ; # if it has been tested already then move on - my $lsids = $self->Relationships( - term => $termthingy, - relationship => $relationship, - direction => $direction - ) - ; # get the related terms for this type; this should return a single hash value - if ( $IDS{$termthingy} =~ /root/ ) - { # here is where we remove self - delete $IDS{$termthingy}; - $debug && _LOG("deleting $termthingy\n"); - } else { - $debug && _LOG("marking $termthingy as TESTED\n"); - $IDS{$termthingy} = - "tested"; # mark the current one as now being "done" - } - - #${$lsids}{relationshiptype}=[lsid, lsid, lsid]; - foreach my $lsid_article ( @{ $lsids->{$relationship} } ) - { # go through the related terms - my ($lsid, $article) = @{$lsid_article}; - $debug && _LOG("found $lsid as relationship"); - next - if ( defined $IDS{$lsid} ) - ; # if we have already seen that term, skip it - $debug && _LOG("setting $lsid as untested\n"); - $IDS{$lsid} = - "untested" # otherwise add it to the list and loop again. - } - } - } - my @IDS = keys %IDS; - $relationships{$relationship} = - \@IDS; # and associate them all with the current relationship type - } - return \%relationships; -} - -sub _LOG { - return unless $debug; - - #print join "\n", @_; - #print "\n---\n"; - #return; - open LOG, ">>/tmp/OntologyServer.txt" or die "can't open logfile $!\n"; - print LOG join "\n", @_; - print LOG "\n---\n"; - close LOG; -} -sub DESTROY { } - -sub AUTOLOAD { - no strict "refs"; - my ( $self, $newval ) = @_; - $AUTOLOAD =~ /.*::(\w+)/; - my $attr = $1; - if ( $self->_accessible( $attr, 'write' ) ) { - *{$AUTOLOAD} = sub { - if ( defined $_[1] ) { $_[0]->{$attr} = $_[1] } - return $_[0]->{$attr}; - }; ### end of created subroutine -### this is called first time only - if ( defined $newval ) { - $self->{$attr} = $newval; - } - return $self->{$attr}; - } elsif ( $self->_accessible( $attr, 'read' ) ) { - *{$AUTOLOAD} = sub { - return $_[0]->{$attr}; - }; ### end of created subroutine - return $self->{$attr}; - } - - # Must have been a mistake then... - croak "No such method: $AUTOLOAD"; -} -1; +#$Id$ +# this module needs to talk to the 'real' ontology +# server as well as the MOBY Central database +# in order to ensure that they are both in sync + +=head1 NAME + +MOBY::OntologyServer - A way for MOBY Central to query the +object, service, namespace, and relationship ontologies + +=cut + +=head1 SYNOPSIS + + use MOBY::OntologyServer; + my $OS = MOBY::OntologyServer->new(ontology => "object"); + + my ($success, $message, $existingURI) = $OS->objectExists(term => "Object"); + + if ($success){ + print "object exists and it has the LSID $existingURI\n"; + } else { + print "object does not exist; additional message from server: $message\n"; + } + + +=cut + +=head1 DESCRIPTION + +Swappable interface to ontologies. It should deal with LSID's 100% +of the time, and also deal with MOBY-specific common names for objects, +services, namespaces, and relationship types. + + + +=head1 AUTHORS + +Mark Wilkinson (markw at illuminae.com) + +BioMOBY Project: http://www.biomoby.org + + +=cut + +=head1 METHODS + + +=head2 new + + Title : new + Usage : my $OS = MOBY::OntologyServer->new(%args) + Function : + Returns : MOBY::OntologyServer object + Args : ontology => [object || service || namespace || relationship] + database => mysql databasename that holds the ontologies + host => mysql hostname + username => mysql username + password => mysql password + port => mysql port + dbh => pre-existing database handle to a mysql database + +=cut + +package MOBY::OntologyServer; +use strict; +use Carp; +use vars qw($AUTOLOAD); +use DBI; +use DBD::mysql; +use MOBY::Config; +my $debug = 0; +{ + + #Encapsulated class data + #___________________________________________________________ + #ATTRIBUTES + my %_attr_data = # DEFAULT ACCESSIBILITY + ( + ontology => [ undef, 'read/write' ], + database => [ undef, 'read/write' ], + host => [ undef, 'read/write' ], + username => [ undef, 'read/write' ], + password => [ undef, 'read/write' ], + port => [ undef, 'read/write' ], + dbh => [ undef, 'read/write' ], + ); + + #_____________________________________________________________ + # METHODS, to operate on encapsulated class data + # Is a specified object attribute accessible in a given mode + sub _accessible { + my ( $self, $attr, $mode ) = @_; + $_attr_data{$attr}[1] =~ /$mode/; + } + + # Classwide default value for a specified object attribute + sub _default_for { + my ( $self, $attr ) = @_; + $_attr_data{$attr}[0]; + } + + # List of names of all specified object attributes + sub _standard_keys { + keys %_attr_data; + } +} + +sub new { + my ( $caller, %args ) = @_; + my $caller_is_obj = ref($caller); + my $class = $caller_is_obj || $caller; + my $self = bless {}, $class; + foreach my $attrname ( $self->_standard_keys ) { + if ( exists $args{$attrname} && defined $args{$attrname} ) { + $self->{$attrname} = $args{$attrname}; + } elsif ($caller_is_obj) { + $self->{$attrname} = $caller->{$attrname}; + } else { + $self->{$attrname} = $self->_default_for($attrname); + } + } + $self->ontology eq 'object' && $self->database('mobyobject'); + $self->ontology eq 'namespace' && $self->database('mobynamespace'); + $self->ontology eq 'service' && $self->database('mobyservice'); + $self->ontology eq 'relationship' && $self->database('mobyrelationship'); + + #print STDERR "\n\nCONFIG object is $CONFIG\n\n"; + $CONFIG ||= MOBY::Config->new; + +#print STDERR "got username ",($CONFIG->{mobycentral}->{username})," for mobycentral\n"; + $self->username( $CONFIG->{ $self->database }->{username} ) + unless $self->username; + $self->password( $CONFIG->{ $self->database }->{password} ) + unless $self->password; + $self->port( $CONFIG->{ $self->database }->{port} ) unless $self->port; + $self->host( $CONFIG->{ $self->database }->{url} ) unless $self->host; + my $host = $self->host ? $self->host : $ENV{MOBY_CENTRAL_URL}; + chomp $host; + my $username = + $self->username ? $self->username : $ENV{MOBY_CENTRAL_DBUSER}; + chomp $username; + my $password = + $self->password ? $self->password : $ENV{MOBY_CENTRAL_DBPASS}; + chomp $password if $password; + $password =~ s/\s//g if $password; + my $port = $self->port ? $self->port : $ENV{MOBY_CENTRAL_DBPORT}; + chomp $port; + my ($dsn) = + "DBI:mysql:" + . ( $CONFIG->{ $self->database }->{dbname} ) . ":" + . ($host) . ":" + . ($port); + + #print STDERR "\n\nDSN was $dsn\n\n"; + my $dbh; + +# $debug && &_LOG("connecting to db with params ",$self->database, $self->username, $self->password,"\n"); + if ( defined $password ) { + $dbh = DBI->connect( $dsn, $username, $password, { RaiseError => 1 } ) + or die "can't connect to database"; + } else { + $dbh = DBI->connect( $dsn, $username, undef, { RaiseError => 1 } ) + or die "can't connect to database"; + } + + # $debug && &_LOG("CONNECTED!\n"); + if ($dbh) { + $self->dbh($dbh); + return $self; + } else { + return undef; + } +} + +=head2 objectExists + + moby:newterm will return (0, $message, $MOBYLSID) + newterm will return (0, $message, $MOBYLSID + oldterm will return (1, $message, undef) + newLSID will return (0, $desc, $lsid) +=cut + +sub objectExists { + my ( $self, %args ) = @_; + + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + + my $term = $args{term}; + $term =~ s/^moby://; # if the term is namespaced, then remove that + my $sth; + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); + + my $result; + + $result = $adaptor->query_object(type => $term); + + my $row = shift(@$result); + my $lsid = $row->{object_lsid}; + my $type = $row->{object_type}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $email = $row->{contact_email}; + + if ($lsid) + { # if it is in there, then it has been discovered regardless of being foreign or not + return ( 1, $desc, $lsid ); + } elsif ( _isForeignLSID($term) ) + { # if not in our ontology, but is a foreign LSID, then pass it back verbatim + return ( + 0, +"LSID $term does not exist in the biomoby.org Object Class system\n", + $term + ); + } else { # under all other circumstances (i.e. not a term, or a non-existent biomoby LSID) then fail + return ( + 0, +"Object type $term does not exist in the biomoby.org Object Class system\n", + '' + ); + } +} + +sub _isMOBYLSID { + my ($lsid) = @_; + return 1 if $lsid =~ /^urn\:lsid\:biomoby.org/; + return 0; +} + +sub _isForeignLSID { + my ($lsid) = @_; + return 0 if $lsid =~ /^urn\:lsid\:biomoby.org/; + return 1; +} + +=head2 createObject + +=cut + +sub createObject { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); + return ( 0, "requires a object type node", '' ) unless ( $args{node} ); + return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); + return ( 0, "requires a contact email address", '' ) + unless ( $args{contact_email} ); + return ( 0, "requires a object description", '' ) + unless ( $args{description} ); + my $term = $args{node}; + + my $LSID = + ( $args{'node'} =~ /urn\:lsid/ ) + ? $args{'node'} + : $self->setURI( $args{'node'} ); + unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } + my $result; + $result = $adaptor->query_object(type => $term); + my $row = shift(@$result); + my $lsid = $row->{object_lsid}; + my $type = $row->{object_type}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $email = $row->{contact_email}; + + if ($lsid) { # if it is in there, then the object exists + return ( 0, "This term already exists: $lsid", $lsid ); + } + $args{description} =~ s/^\s+(.*?)\s+$/$1/s; + $args{node} =~ s/^\s+(.*?)\s+$/$1/s; + $args{contact_email} =~ s/^\s+(.*?)\s+$/$1/s; + $args{authority} =~ s/^\s+(.*?)\s+$/$1/s; + + my $insertid = $adaptor->insert_object(object_type => $args{'node'}, + object_lsid => $LSID, + description => $args{'description'}, + authority => $args{'authority'}, + contact_email => $args{'contact_email'}); + unless ( $insertid ) { + return ( 0, "Object creation failed for unknown reasons", '' ); + } + return ( 1, "Object creation succeeded", $LSID ); +} + +=head2 retrieveObject + +=cut + +sub retrieveObject { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + my $term = $args{'type'}; + $term ||=$args{'node'}; + + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); + return ( 0, "requires a object type node as an argument", '' ) + unless ( $term ); + my $LSID = + ( $term =~ /urn\:lsid/ ) + ? $term + : $self->getObjectURI($term); + unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } + my $result = $adaptor->query_object(type => $LSID); + my $row = shift(@$result); +# my $id = $row->{object_id}; + my $type = $row->{object_type}; + my $lsid = $row->{object_lsid}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $contact = $row->{contact_email}; + + unless ($lsid) { return ( 0, "Object doesn't exist in ontology", "" ) } + + # my $OS = MOBY::OntologyServer->new(ontology => "relationship"); + + $result = $adaptor->get_object_relationships(type => $lsid); + my %rel; + foreach my $row (@$result) + { + my $relationship_type = $row->{relationship_type}; + my $objectlsid = $row->{object_lsid}; + my $article = $row->{object2_articlename}; + my $contact = $row->{contact_email}; + my $def = $row->{definition}; + my $auth = $row->{authority}; + my $type = $row->{object_type}; + + push @{ $rel{$relationship_type} }, [ $objectlsid, $article, $type, $def, $auth, $contact ]; + } + return { + objectType => $type, + objectLSID => $lsid, + description => $desc, + contactEmail => $contact, + authURI => $auth, + Relationships => \%rel + }; +} + +=head2 deprecateObject + +=cut + +sub deprecateObject { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + + return ( 0, "WRONG ONTOLOGY", '' ) unless ( $self->ontology eq 'object' ); + my $term = $args{term}; + +# if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objectclass/)){ +# return (0, "can't delete from external ontology", $term); +# } + my $LSID; + unless ( $term =~ /urn\:lsid/ ) { $LSID = $self->getObjectURI($term) } else { $LSID = $term } + return ( 0, q{Object type $term cannot be resolved to an LSID}, "" ) + unless $LSID; + + my $result = $adaptor->query_object(type => $LSID); + my $row = shift(@$result); + my $id = $row->{object_id}; + my $lsid = $row->{object_lsid}; + + # object1_id ISA object2_id? + my $isa = $adaptor->query_object_term2term(type => $lsid); + my $isas = shift @$isa; + if ( $isas->{object1_id}) { + return ( 0, + qq{Object type $term has object dependencies in the ontology}, + $lsid ); + } + + my ($err, $errstr) = $adaptor->delete_object(type => $lsid); + if ( $err ) { + return ( 0, "Delete from Object Class table failed: $errstr", + $lsid ); + } + return ( 1, "Object $term Deleted", $lsid ); +} + +=head2 deleteObject + +=cut + +sub deleteObject { + my $self = shift; + $self->deprecateObject(@_); +} + +=head2 relationshipExists + +=cut + +sub relationshipExists { + + # term => $term + # ontology => $ontology + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); + return ( 0, "WRONG ONTOLOGY!", '' ) + unless ( $self->ontology eq 'relationship' ); + my $term = lc( $args{term} ); + $term =~ s/^moby://; # if the term is namespaced, then remove that + my $ont = $args{ontology}; + return ( 0, "requires both term and ontology arguments\n", '' ) + unless ( defined($term) && defined($ont) ); + my $result; + if ( $term =~ /^urn\:lsid/ ) { + + $result = $adaptor->query_relationship( + type => $term, + ontology => $ont); + + } else { + + $result = $adaptor->query_relationship(type => $term, ontology => $ont); + + } + my $row = shift(@$result); + my $lsid = $row->{relationship_lsid}; + my $type = $row->{relationship_type}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $email = $row->{contact_email}; + if ($lsid) { + return ( 1, $desc, $lsid, $type, $auth, $email ); + } else { + return ( + 0,"Relationship Type $term does not exist in the biomoby.org Relationship Type system\n", + '', '', '', '' + ); + } +} + +=head2 addObjectRelationship + +=cut + +sub addObjectRelationship { + + # adds a relationship + #subject_node => $term, + #relationship => $reltype, + #object_node => $objectType, + #articleName => $articleName, + #authority => $auth, + #contact_email => $email + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); + + my $result = $adaptor->query_object(type => $args{subject_node}); + my $row = shift(@$result); + my $subj_lsid = $row->{object_lsid}; + return ( 0, qq{Object type $args{subject_node} does not exist in the ontology}, '' ) + unless defined $subj_lsid; + + $result = $adaptor->query_object(type => $args{object_node}); + $row = shift(@$result); + my $obj_lsid = $row->{object_lsid}; + return ( 0,qq{Object type $args{object_node} does not exist in the ontology},'' ) + unless defined $obj_lsid; + my $isa = $adaptor->query_object_term2term(type => $subj_lsid); + my $isarow = shift @$isa; + if ( $isarow->{object_lsid} ) { + return ( + 0, + qq{Object type $args{subject_node} has existing object dependencies in the ontology. It cannot be changed.}, + $subj_lsid + ); + } + my $OE = MOBY::OntologyServer->new( ontology => 'relationship' ); + my ( $success, $desc, $rel_lsid ) = $OE->relationshipExists( + term => $args{relationship}, + ontology => 'object' ); + ($success) || return ( 0, + qq{Relationship $args{relationship} does not exist in the ontology}, + '' ); + + # need to ensure that identical article names dont' end up at the same level + my $articleNameInvalid = &_testIdenticalArticleName(term => $subj_lsid, articleName => $args{articleName}); + return (0, "Object will have conflicting articleName ".($args{articleName}), '') if $articleNameInvalid; + + my $insertid = $adaptor->insert_object_term2term(relationship_type => $rel_lsid, + object1_type => $subj_lsid, + object2_type => $obj_lsid, + object2_articlename => $args{articleName}); + + + if ($insertid ) { + return ( 1, "Object relationsihp created successfully", '' ); + } else { + return ( 0, "Object relationship creation failed for unknown reasons", + '' ); + } +} + +sub _testIdenticalArticleName { + my (%args)= @_; + my $term = $args{term}; + my $articleName = $args{articleName}; + my $foundCommonArticleNameFlag = 0; + # need to first traverse down the ISA pathway to root + # then for each ISA test the hAS and HASA's for their articlenames and see if they are the same + # case insensitive? + my $OS = MOBY::OntologyServer->new(ontology => 'object'); + my $OSrel = MOBY::OntologyServer->new(ontology => 'relationship'); + my ($exists1, $desc, $isalsid) = $OSrel->relationshipExists(term => 'isa', ontology => 'object'); + my ($exists2, $desc2, $hasalsid) = $OSrel->relationshipExists(term => 'hasa', ontology => 'object'); + my ($exists3, $desc3, $haslsid) = $OSrel->relationshipExists(term => 'has', ontology => 'object'); + + return 1 unless ($exists1 && $exists2 && $exists3); # this is bad, since it returns boolean suggesting that it found a common articlename rather than finding that a given relationship doesn't exist, but... hey.... + # check the hasa relationships for common articleName + $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $args{term}, relationship => $hasalsid, targetArticleName => $articleName); + # check the has relationships for common articleName + $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $args{term}, relationship => $haslsid, targetArticleName => $articleName); + + # now get all of its inherited parents + my $relationships = $OS->Relationships( + ontology => 'object', + term => $args{term}, + relationship => $isalsid, + direction => 'root', + expand => 1); + #relationships{relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] + my ($isa) = keys(%$relationships); # can only be one key returned, and must be isa in this case + my @ISAlist; + (@ISAlist = @{$relationships->{$isa}}) if ($relationships->{$isa}) ; + # for each of the inherited parents, check their articleNames + foreach my $ISA(@ISAlist){ # $ISA = [lsid, articleName] (but articleName shuld be null anyway in this case) + my $what_it_is = shift @$ISA; + # check the hasa relationships for common articleName + $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $what_it_is, relationship => $hasalsid, targetArticleName => $articleName); + # check the has relationships for common articleName + $foundCommonArticleNameFlag += _compareArticleNames(OS => $OS, type => $what_it_is, relationship => $haslsid, targetArticleName => $articleName); + } + return $foundCommonArticleNameFlag; +} + +sub _compareArticleNames { + my (%args) = @_; + my $OS = $args{OS}; + my $what_it_is = $args{type}; + my $lsid = $args{relationship}; + my $targetArticleName = $args{targetArticleName}; + my $foundCommonArticleNameFlag = 0; + my $contents = $OS->Relationships( + ontology => 'object', + term => $what_it_is, + relationship => $lsid, + direction => 'root', + ); + if ($contents){ + #$hasarelationships{relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] + my ($content) = keys(%$contents); + if ($contents->{$content}){ + my @CONTENTlist = @{$contents->{$content}}; + foreach my $CONTAINED(@CONTENTlist){ + $foundCommonArticleNameFlag = 1 if ($CONTAINED->[1] eq $targetArticleName); #->[1] is the articleName field + } + } + } + return $foundCommonArticleNameFlag; +} + +=head2 addServiceRelationship + +=cut + +sub addServiceRelationship { + + # adds an ISA relationship + # fail if another object is in relation to this objevt + #subject_node => $term, + #relationship => $relationship, + #predicate_node => $pred + #authority => $auth, + #contact_email => $email); + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); + + my $result = $adaptor->query_service(type => $args{subject_node}); + my $row = shift(@$result); + my $sbj_lsid = $row->{service_lsid}; + + return (0, + qq{Service type $args{subject_node} has object dependencies in the ontology. It can not be changed}, + $sbj_lsid + ) unless defined $sbj_lsid; + + my $isa = $adaptor->query_service_term2term(service2_id => $sbj_lsid); + my $isarow = shift @$isa; + if ( $isarow->{service_lsid} ) { + return ( + 0, + qq{Service type $args{subject_node} has object dependencies in the ontology. It can not be changed}, + $sbj_lsid + ); + } + $result = $adaptor->query_service(type => $args{object_node}); + $row = shift(@$result); + my $obj_lsid = $row->{service_lsid}; + # get ID of the related service + + defined $obj_lsid + || return ( 0, + qq{Service $args{object_node} does not exist in the service ontology}, + '' ); + my $OE = MOBY::OntologyServer->new( ontology => 'relationship' ); + my ( $success, $desc, $rel_lsid ) = $OE->relationshipExists( + term => $args{relationship}, + ontology => 'service' ); + ($success) + || return ( 0, + qq{Relationship $args{relationship} does not exist in the ontology}, + '' ); + + my $insertid = $adaptor->insert_service_term2term(relationship_type => $rel_lsid, + service1_type => $sbj_lsid, + service2_type => $obj_lsid); + if ( defined($insertid)) { + return ( 1, "Service relationship created successfully", '' ); + } else { + return ( 0, "Service relationship creation failed for unknown reasons", + '' ); + } +} + +=head2 serviceExists + +=cut + +sub serviceExists { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); + my $term = $args{term}; + $term =~ s/^moby://; # if the term is namespaced, then remove that + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) + { + return ( 1, "external ontology", $term ); + } + my $result; + $result = $adaptor->query_service(type => $term); + my $row = shift(@$result); + my $id = $row->{service_id}; + my $type = $row->{service_type}; + my $lsid = $row->{service_lsid}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $email = $row->{contact_email}; + + if ($id) { + return ( 1, $desc, $lsid ); + } else { + return ( + 0, +"Service Type $term does not exist in the biomoby.org Service Type ontology\n", + '' + ); + } +} + +=head2 createServiceType + +=cut + +sub createServiceType { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + + #node => $term, + #descrioption => $desc, + #authority => $auth, + #contact_email => $email); + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); + return ( 0, "requires a object type node", '' ) unless ( $args{node} ); + return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); + return ( 0, "requires a contact email address", '' ) + unless ( $args{contact_email} ); + return ( 0, "requires a object description", '' ) + unless ( $args{description} ); + my $term = $args{node}; + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) + { # if it is an LSID, but not a MOBY LSID, than barf + return ( 0, "can't create a term in a non-MOBY ontology!", $term ); + } + my $LSID = + ( $args{'node'} =~ /urn\:lsid/ ) + ? $args{'node'} + : $self->setURI( $args{'node'} ); + unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } + + my $insertid = $adaptor->insert_service(service_type => $args{'node'}, + service_lsid => $LSID, + description => $args{'description'}, + authority => $args{'authority'}, + contact_email => $args{'contact_email'}); + + unless ( $insertid ) { + return ( 0, "Service creation failed for unknown reasons", '' ); + } + return ( 1, "Service creation succeeded", $LSID ); +} + +=head2 deleteServiceType + +=cut + +sub deleteServiceType { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + + return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' ); + my $term = $args{term}; + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) ) + { + return ( 0, "can't delete from external ontology", $term ); + } + my $LSID; + unless ( $term =~ /^urn:lsid:biomoby.org:servicetype/ ) { + $LSID = $self->getServiceURI($term); + } else { + $LSID = $term; + } + return ( + 0, q{Service type $term cannot be resolved to an LSID in the MOBY ontologies},"" + ) unless $LSID; + + my $result = $adaptor->query_service(type => $LSID); + my $row = shift(@$result); + my $lsid = $row->{service_lsid}; + + if ( !defined $lsid ) { + return ( 0, q{Service type $term does not exist in the ontology}, + $lsid ); + } + + # service1_id ISA service2_id? + my $isa = $adaptor->query_service_term2term(type => $lsid); + my $isas = shift(@$isa); + + if ( $isas->{service1_id} ) { + return ( 0, qq{Service type $term has dependencies in the ontology}, + $lsid ); + } + my ($err, $errstr) = $adaptor->delete_service(type => $lsid); + + if ( $err ) { + return ( 0, "Delete from Service Type table failed: $errstr", + $lsid ); + } + + return ( 1, "Service Type $term Deleted", $lsid ); +} + +=head2 namespaceExists + +=cut + +sub namespaceExists { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + + return ( 0, "WRONG ONTOLOGY!", '' ) + unless ( $self->ontology eq 'namespace' ); + my $term = $args{term}; + $term =~ s/^moby://; # if the term is namespaced, then remove that + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) + { + return ( 1, "external ontology", $term ); + } + my $result; + $result = $adaptor->query_namespace(type => $term); + my $row = shift(@$result); + my $id = $row->{namespace_id}; + my $type = $row->{namespace_type}; + my $lsid = $row->{namespace_lsid}; + my $desc = $row->{description}; + my $auth = $row->{authority}; + my $email = $row->{contact_email}; + + if ($id) { + return ( 1, $desc, $lsid ); + } else { + return ( + 0, +"Namespace Type $term does not exist in the biomoby.org Namespace Type ontology\n", + '' + ); + } +} + +=head2 createNamespace + +=cut + +sub createNamespace { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + #node => $term, + #descrioption => $desc, + #authority => $auth, + #contact_email => $email); + return ( 0, "WRONG ONTOLOGY!", '' ) + unless ( $self->ontology eq 'namespace' ); + return ( 0, "requires a namespace type node", '' ) unless ( $args{node} ); + return ( 0, "requires an authURI ", '' ) unless ( $args{authority} ); + return ( 0, "requires a contact email address", '' ) + unless ( $args{contact_email} ); + return ( 0, "requires a object description", '' ) + unless ( $args{description} ); + my $term = $args{node}; + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) + { # if it is an LSID, but not a MOBY LSID, than barf + return ( 0, "can't create a term in a non-MOBY ontology!", $term ); + } + my $LSID = + ( $args{'node'} =~ /urn\:lsid/ ) + ? $args{'node'} + : $self->setURI( $args{'node'} ); + unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) } + + my $insertid = $adaptor->insert_namespace(namespace_type => $args{'node'}, + namespace_lsid => $LSID, + description => $args{'description'}, + authority => $args{'authority'}, + contact_email => $args{'contact_email'}); + + unless ( $insertid ) { + return ( 0, "Namespace creation failed for unknown reasons", '' ); + } + return ( 1, "Namespace creation succeeded", $LSID ); +} + +=head2 deleteNamespace + +=cut + +sub deleteNamespace { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + return ( 0, "WRONG ONTOLOGY!", '' ) + unless ( $self->ontology eq 'namespace' ); + my $term = $args{term}; + my $LSID; + unless ( $term =~ /urn\:lsid/ ) { $LSID = $self->getNamespaceURI($term) } else { $LSID = $term } + return ( 0, q{Namespace type $term cannot be resolved to an LSID}, "" ) + unless $LSID; + if ( $term =~ /^urn:lsid/ + && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) + { + return ( 0, "cannot delete a term from an external ontology", $term ); + } + + my $result = $adaptor->query_namespace(type => $LSID); + my $row = shift(@$result); + my $lsid = $row->{namespace_lsid}; + + unless ($lsid) { + return ( 0, q{Namespace type $term does not exist in the ontology}, + $lsid ); + } + + # service1_id ISA service2_id? + my $isa = $adaptor->query_namespace_term2term(type => $lsid); + my $isas = shift @$isa; + + if ($isas->{namespace1_id} ) { + return ( 0, qq{Namespace type $term has dependencies in the ontology}, + $lsid ); + } + + my ($err, $errstr) = $adaptor->delete_namespace(type => $lsid); + + if ( $err ) { + return ( 0, "Delete from namespace table failed: $errstr", + $lsid ); + } + + #($err, $errstr) = $adaptor->delete_namespace_term2term(namespace1_id => $lsid); + # + #if ( $err ) { + # return ( + # 0, + # "Delete from namespace term2term table failed: $errstr", + # $lsid + # ); + #} + return ( 1, "Namespace Type $term Deleted", $lsid ); +} + +=head2 retrieveAllServiceTypes + +=cut + +sub retrieveAllServiceTypes { + my ($self) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + my $types = $adaptor->query_service(); + + my %response; + foreach (@$types) { + $response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}]; #COMMENT/REMOVE + #$response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}, $_->{contact_email}, $_->{authority}]; #UNCOMMENT + } + return \%response; +} + +=head2 retrieveAllNamespaceTypes + +=cut + +sub retrieveAllNamespaceTypes { + my ($self) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + my $types = $adaptor->query_namespace(); + + my %response; + foreach (@$types) { + $response{ $_->{namespace_type} } = [$_->{description}, $_->{namespace_lsid}, $_->{authority}, $_->{contact_email}]; + } + return \%response; +} + +=head2 retrieveAllObjectClasses + +=cut + +sub retrieveAllObjectClasses { + my ($self) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + my $types = $adaptor->query_object(); + + my %response; + foreach (@$types) { + $response{ $_->{object_type} } = [$_->{description}, $_->{object_lsid}]; + } + return \%response; +} +*retrieveAllObjectTypes = \&retrieveAllObjectClasses; +*retrieveAllObjectTypes = \&retrieveAllObjectClasses; + +=head2 getObjectCommonName + +=cut + +sub getObjectCommonName { + my ( $self, $URI ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + return undef unless $URI =~ /urn\:lsid/; + my $result = $adaptor->query_object(type => $URI); + my $row = shift(@$result); + my $name = $row->{object_type}; + + return $name ? $name : $URI; +} + +=head2 getNamespaceCommonName + +=cut + +sub getNamespaceCommonName { + my ( $self, $URI ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + return undef unless $URI =~ /urn\:lsid/; + my $result = $adaptor->query_namespace(type => $URI); + my $row = shift(@$result); + my $name = $row->{namespace_type}; + + return $name ? $name : $URI; +} + +=head2 getServiceCommonName + +=cut + +sub getServiceCommonName { + my ( $self, $URI ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + return undef unless $URI =~ /urn\:lsid/; + my $result = $adaptor->query_service(type => $URI); + my $row = shift(@$result); + my $name = $row->{service_type}; + + return $name ? $name : $URI; +} + +=head2 getServiceURI + +=cut + +sub getServiceURI { + my ( $self, $term ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' ); + return $term if $term =~ /urn\:lsid/; + + my $result = $adaptor->query_service(type => $term); + my $row = shift(@$result); + my $id = $row->{service_lsid}; + + return $id; +} + +=head2 getObjectURI + +=cut + +sub getObjectURI { + my ( $self, $term ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' ); + return $term if $term =~ /urn\:lsid/; + + my $result = $adaptor->query_object(type => $term); + my $row = shift(@$result); + my $id = $row->{object_lsid}; + + return $id; +} + +=head2 getNamespaceURI + +=cut + +sub getNamespaceURI { + my ( $self, $term ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' ); + + return $term if $term =~ /urn\:lsid/; + + my $result = $adaptor->query_namespace(type => $term); + my $row = shift(@$result); + my $id = $row->{namespace_lsid}; + + return $id; +} + +=head2 getRelationshipURI + +consumes ontology (object/service) +consumes relationship term as term or LSID + +=cut + +sub getRelationshipURI { + my ( $self, $ontology, $term ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); + + return $term if $term =~ /urn\:lsid/; + + my $result = $adaptor->query_relationship(type => $term, ontology => $ontology); + my $row = shift(@$result); + my $id = $row->{relationship_lsid}; + + return $id; +} + +=head2 getRelationshipTypes + +=cut + +sub getRelationshipTypes { + my ( $self, %args ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' ); + + my $ontology = $args{'ontology'}; + my $OS = MOBY::OntologyServer->new( ontology => "relationship" ); + + my $defs = $adaptor->query_relationship(ontology => $ontology); + + my %result; + foreach ( @$defs ) { + $result{ $_->{relationship_lsid} } = [ $_->{relationship_type}, $_->{authority}, $_->{description} ]; + } + return \%result; +} + +=head2 Relationships + +=cut + +sub Relationships { + + # this entire subroutine assumes that there is NOT multiple parenting!! + my ( $self, %args ) = @_; + my $ontology = $args{ontology} ? $args{ontology} : $self->ontology; + my $term = $args{term}; + my $relationship = $args{relationship}; + my $direction = $args{direction} ? $args{direction} : 'root'; + my $expand = $args{expand} ? 1 : 0; + return + unless ( $ontology + && $term + && ( ( $ontology eq 'service' ) || ( $ontology eq 'object' ) ) ); + + # convert $term into an LSID if it isn't already + if ( $ontology eq 'service' ) { + $term = $self->getServiceURI($term); + $relationship ||="isa"; + my $OS = MOBY::OntologyServer->new(ontology => 'relationship'); + $relationship = $OS->getRelationshipURI("service", $relationship); + } elsif ( $ontology eq 'object' ) { + $term = $self->getObjectURI($term); + $relationship ||="isa"; + my $OS = MOBY::OntologyServer->new(ontology => 'relationship'); + $relationship = $OS->getRelationshipURI("object", $relationship); + } + my %results; + while ( ( $term ne 'urn:lsid:biomoby.org:objectclass:Object' ) + && ( $term ne 'urn:lsid:biomoby.org:servicetype:Service' ) ) + { + my $defs = $self->_doRelationshipsQuery( $ontology, $term, + $relationship, $direction ); + return {[]} unless $defs; # somethig has gone terribly wrong! + my $lsid; + my $rel; + my $articleName; + foreach ( @{$defs} ) { + $lsid = $_->[0]; + $rel = $_->[1]; + $articleName = $_->[2]; + $articleName ||=""; + $debug + && _LOG("\t\tADDING RELATIONSHIP $_ : $lsid to $rel\n"); + push @{ $results{$rel} }, [$lsid, $articleName]; + } + last unless ($expand); + last unless ( $direction eq "root" ); # if we aren't going to root, then be careful or we'll loop infnitely + $term = $lsid; # this entire subroutine assumes that there is NOT multiple parenting... + } + return \%results; #results(relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]] +} + +sub _doRelationshipsQuery { + my ( $self, $ontology, $term, $relationship, $direction ) = @_; + $CONFIG ||= MOBY::Config->new; # exported by Config.pm + my $datasource = "moby$ontology"; # like mobyobject, or mobyservice + my $adaptor = $CONFIG->getDataAdaptor( datasource => $datasource ); + my $defs; + # query returns a reference to an array containing array references + $defs = $adaptor->get_relationship(direction => $direction, + ontology => $ontology, + term => $term, + relationship => $relationship); + # a very long piece of SQL statements have been refactored into Moby::Adaptor::moby::queryapi::mysql.pm + return $defs; +} + +=head2 setURI + +=cut + +sub setURI { + my ( $self, $id ) = @_; + my $URI; + + # $id = lc($id); + if ( $self->ontology eq 'object' ) { + $URI = "urn:lsid:biomoby.org:objectclass:$id"; + } elsif ( $self->ontology eq 'namespace' ) { + $URI = "urn:lsid:biomoby.org:namespacetype:$id"; + } elsif ( $self->ontology eq 'service' ) { + $URI = "urn:lsid:biomoby.org:servicetype:$id"; + } elsif ( $self->ontology eq 'relationship' ) { + $URI = "urn:lsid:biomoby.org:relationshiptype:$id"; + } else { + $URI = 0; + } + return $URI; +} + +=head2 traverseDAG + +=cut + +sub traverseDAG { + my ( $self, $term, $direction ) = @_; + my $ontology = $self->ontology; + return {} unless $ontology; + return {} unless $term; + $direction = "root" unless ($direction); + return {} unless ( ( $direction eq 'root' ) || ( $direction eq 'leaves' ) ); + if ( $ontology eq 'service' ) { + $term = $self->getServiceURI($term); + } elsif ( $ontology eq 'object' ) { + $term = $self->getObjectURI($term); + } + return {} unless $term =~ /^urn\:lsid/; # now its a URI + my $relhash = $self->getRelationshipTypes( ontology => $ontology ); # get teh types of relationships for the object/service ontology + return {} unless $relhash; + my @rels = keys %{$relhash}; #@rels is the list of relationship types for that ontology + my %relationships; + foreach my $relationship (@rels) { + my %IDS; + my $OS = MOBY::OntologyServer->new( ontology => 'relationship' ); + my $reluri = + $OS->getRelationshipURI( $ontology, $relationship ) + ; # get the URI for that relationship type if it ins't already a URI + $IDS{$term} = "untestedroot"; # mark the one in-hand as being untested + while ( grep /untested/, ( values %IDS ) ) + { # now, while there are untested services in our list... + foreach my $termthingy ( keys %IDS ) + { # start parsing through the current list (hash keys) + $debug && _LOG("testing $relationship of $termthingy\n"); + next + if ( $IDS{$termthingy} eq "tested" ) + ; # if it has been tested already then move on + my $lsids = $self->Relationships( + term => $termthingy, + relationship => $relationship, + direction => $direction + ) + ; # get the related terms for this type; this should return a single hash value + if ( $IDS{$termthingy} =~ /root/ ) + { # here is where we remove self + delete $IDS{$termthingy}; + $debug && _LOG("deleting $termthingy\n"); + } else { + $debug && _LOG("marking $termthingy as TESTED\n"); + $IDS{$termthingy} = + "tested"; # mark the current one as now being "done" + } + + #${$lsids}{relationshiptype}=[lsid, lsid, lsid]; + foreach my $lsid_article ( @{ $lsids->{$relationship} } ) + { # go through the related terms + my ($lsid, $article) = @{$lsid_article}; + $debug && _LOG("found $lsid as relationship"); + next + if ( defined $IDS{$lsid} ) + ; # if we have already seen that term, skip it + $debug && _LOG("setting $lsid as untested\n"); + $IDS{$lsid} = + "untested" # otherwise add it to the list and loop again. + } + } + } + my @IDS = keys %IDS; + $relationships{$relationship} = + \@IDS; # and associate them all with the current relationship type + } + return \%relationships; +} + +sub _LOG { + return unless $debug; + + #print join "\n", @_; + #print "\n---\n"; + #return; + open LOG, ">>/tmp/OntologyServer.txt" or die "can't open logfile $!\n"; + print LOG join "\n", @_; + print LOG "\n---\n"; + close LOG; +} +sub DESTROY { } + +sub AUTOLOAD { + no strict "refs"; + my ( $self, $newval ) = @_; + $AUTOLOAD =~ /.*::(\w+)/; + my $attr = $1; + if ( $self->_accessible( $attr, 'write' ) ) { + *{$AUTOLOAD} = sub { + if ( defined $_[1] ) { $_[0]->{$attr} = $_[1] } + return $_[0]->{$attr}; + }; ### end of created subroutine +### this is called first time only + if ( defined $newval ) { + $self->{$attr} = $newval; + } + return $self->{$attr}; + } elsif ( $self->_accessible( $attr, 'read' ) ) { + *{$AUTOLOAD} = sub { + return $_[0]->{$attr}; + }; ### end of created subroutine + return $self->{$attr}; + } + + # Must have been a mistake then... + croak "No such method: $AUTOLOAD"; +} +1; From fgibbons at pub.open-bio.org Wed Sep 21 19:05:14 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Wed, 21 Sep 2005 15:05:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509211905.j8LJ5EKD012429@pub.open-bio.org> fgibbons Wed Sep 21 15:05:14 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv12383/MOBY Modified Files: CommonSubs.pm Log Message: - Major re-arrangement of code, with a few small additions, which I try to describe below: - Code re-arranged into blocks, according to broad functional category. This module is one of the most confusing to newbies, since there's all this stuff just thrown in, with no apparent order to it. - POD adjusted to take more advantage of HTML output. Previously, it was just all one big dump of text - it's a lot easier to read when there's bolding and different sized fonts. Also those annoying "Title" headings are gone. - Because we're so lax about namespaces, any time we try to getAttribute() on a DOM node, we have to check for two things. Now there are two new routines that take care of that: _moby_getAttribute and _moby_getAttributeNode They're not exported, since they're intended for internal use only. - In generating a collectionResponse, we want to return an empty message if the $data passed in is empty. There's a bug fix that tests for an entirely empty $data arrayref. Previously, it just tested the first element. - Most tags are tightened up, and regexps are contracted. moby-live/Perl/MOBY CommonSubs.pm,1.68,1.69 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.68 retrieving revision 1.69 diff -u -r1.68 -r1.69 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/09/01 14:00:00 1.68 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/09/21 19:05:14 1.69 @@ -6,14 +6,21 @@ useful in clients and services to deal with the input/output from MOBY Services -=cut +=head1 DESCRIPTION + +CommonSubs are used to do various manipulations of MOBY Messages. It is useful +both Client and Service side to construct and parse MOBY Messages, and ensure +that the message structure is valid as per the API. + +It DOES NOT connect to MOBY Central for any of its functions, though it does +contact the ontology server, so it will require a network connection. + +=head1 SYNTAX =head2 Client Side Paradigm not written yet -=cut - =head2 Service-Side Paradigm The following is a generalized architecture for *all* @@ -23,7 +30,7 @@ sub myServiceName { my ($caller, $data) = @_; my $MOBY_RESPONSE; # holds the response raw XML - + # genericServiceInputParser # unpacks incoming message into an array of arrarefs. # Each element of the array is a queryInput block, or a mobyData block @@ -31,11 +38,11 @@ # [SIMPLE, $queryID, $simple] # the first element is an exported constant SIMPLE, COLLECTION, SECONDARY # the second element is the queryID (required for enumerating the responses) - # the third element is the XML::LibXML for the Simple, Collection, or Parameter block - my (@inputs)= genericServiceInputParser($data); + # the third element is the XML::LibXML for the Simple, Collection, or Parameter block + my (@inputs)= genericServiceInputParser($data); # or fail properly with an empty response return SOAP::Data->type('base64' => responseHeader("my.authURI.com") . responseFooter()) unless (scalar(@inputs)); - + # you only need to do this if you are intending to be namespace aware # some services might not care what namespace the data is in, so long # as there is data... @@ -53,16 +60,15 @@ # (see pod docs for other possibilities) my $namespace = getSimpleArticleNamespaceURI($input); # get namespace my ($identifier) = getSimpleArticleIDs($input); # get ID (note array output! see pod) - + # here is where you do whatever manipulation you need to do # for your particular service. - # you will be building an XML document into $MOBY_RESPONSE + # you will be building an XML document into $MOBY_RESPONSE } } - return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter)); + return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter)); } -=cut =head1 EXAMPLE @@ -113,7 +119,7 @@ unless ($accession =~/^GO:/){ $accession = "GO:$accession"; # we still haven't decided on whether id's should include the prefix... } - $sth->execute($accession); + $sth->execute($accession); my ($term, $def) = $sth->fetchrow_array; if ($term){ $MOBY_RESPONSE .= simpleResponse(" @@ -126,19 +132,9 @@ } } } - - return SOAP::Data->type('base64' => (responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter)); - } - - -=head1 DESCRIPTION - -CommonSubs are used to do various manipulations of MOBY Messages. It is useful -both Client and Service side to construct and parse MOBY Messages, and ensure -that the message structure is valid as per the API. -It DOES NOT connect to MOBY Central for any of its functions, though it does -contact the ontology server, so it will require a network connection. + return SOAP::Data->type('base64' => (responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter)); + } =head1 AUTHORS @@ -147,9 +143,7 @@ BioMOBY Project: http://www.biomoby.org -=cut - -=head1 METHODS +=head1 PARSING INPUT =cut @@ -172,41 +166,6 @@ use constant BE_STRICT => 0; our @ISA = qw(Exporter); our @EXPORT = qw(COLLECTION SIMPLE SECONDARY PARAMETER BE_NICE BE_STRICT); -our @EXPORT_OK = qw( - getSimpleArticleIDs - getSimpleArticleNamespaceURI - simpleResponse - collectionResponse - complexResponse - responseHeader - responseFooter - getInputArticles - getInputs - getInputID - getArticles - getCollectedSimples - getNodeContentWithArticle - extractRawContent - validateNamespaces - validateThisNamespace - isSimpleArticle - isCollectionArticle - isSecondaryArticle - extractResponseArticles - getResponseArticles - getCrossReferences - genericServiceInputParser - genericServiceInputParserAsObject - complexServiceInputParser - whichDeepestParentObject - getServiceNotes - COLLECTION - SIMPLE - SECONDARY - PARAMETER - BE_NICE - BE_STRICT -); our %EXPORT_TAGS = ( all => [ qw( @@ -244,98 +203,127 @@ BE_STRICT ) ] -); +);# complexResponse is *not* here, but is in @EXPORT_OK + + +our @EXPORT_OK = ("collectionResponse", @{$EXPORT_TAGS{'all'}}); =head2 genericServiceInputParser - function : For the MOST SIMPLE SERVICES that take single Simple or Collection inputs - and no Secondaries/Parameters this routine takes the MOBY message and - breaks the objects out of it in a useful way - usage : my @inputs = genericServiceInputParser($MOBY_mssage)); - args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message - returns : @inputs - the structure of @inputs is a list of listrefs. - Each listref has three components: - 1. COLLECTION|SIMPLE (i.e. constants 1, 2) - 2. queryID - 3. $data - the data takes several forms - a. $article XML::LibXML node for Simples - ... - b. \@article XML:LibXML nodes for Collections - - for example, the input message: - - - - - - - - - - - +B For the MOST SIMPLE SERVICES that take single Simple or +Collection inputs and no Secondaries/Parameters this routine takes the +MOBY message and breaks the objects out of it in a useful way + +B + my @inputs = genericServiceInputParser($MOBY_mssage)); + +B C<$message> - this is the SOAP payload; i.e. the XML document containing the MOBY message + +B C<@inputs> - the structure of @inputs is a list of listrefs. + +Each listref has three components: + +=over 4 + +=item * +COLLECTION|SIMPLE (i.e. constants 1, 2) + +=item * +queryID + +=item * +$data - the data takes several forms + +=over 4 + +=item * +$article XML::LibXML node for Simples ... + +=item * +\@article XML:LibXML nodes for Collections - will become: +=back + +=back + +For example, the input message: + + + + + + + + + + + +will become: (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module) @inputs = ([SIMPLE, 1, $DOM], [SIMPLE, 2, $DOM]) # the block - for example, the input message: - - - - - - - - - - - +For example, the input message: - will become: + + + + + + + + + + - @inputs = ( [COLLECTION, 1, [$DOM, $DOM]] ) # the block +will become: + + @inputs = ( [COLLECTION, 1, [$DOM, $DOM]] ) # the block =cut sub genericServiceInputParser { - my ( $message ) = @_; # get the incoming MOBY query XML - my @inputs; # set empty response - my @queries = - getInputs( $message ); # returns XML::LibXML nodes ... - foreach my $query ( @queries ) { - my $queryID = - getInputID( $query ); # get the queryID attribute of the mobyData - my @input_articles = - getArticles( $query ) - ; # get the Simple/Collection/Secondary articles making up this query ... or ... or ... - foreach my $input ( @input_articles ) { # input is a listref - my ( $articleName, $article ) = @{$input}; # get the named article - if ( isCollectionArticle( $article ) ) { - my @simples = getCollectedSimples( $article ); - push @inputs, [ COLLECTION, $queryID, \@simples ]; - } elsif ( isSimpleArticle( $article ) ) { - push @inputs, [ SIMPLE, $queryID, $article ]; - } elsif ( isSecondaryArticle( $article ) ) - { # should never happen in a generic service parser! - push @inputs, [ SECONDARY, $queryID, $article ]; - } - } + my ( $message ) = @_; # get the incoming MOBY query XML + my @inputs; # set empty response + my @queries = getInputs( $message ); # returns XML::LibXML nodes ... + foreach my $query ( @queries ) { + my $queryID = getInputID( $query ); # get the queryID attribute of the mobyData + my @input_articles = + getArticles( $query ) + ; # get the Simple/Collection/Secondary articles making up this query ... or ... or ... + foreach my $input ( @input_articles ) { # input is a listref + my ( $articleName, $article ) = @{$input}; # get the named article + if ( isCollectionArticle( $article ) ) { + my @simples = getCollectedSimples( $article ); + push @inputs, [ COLLECTION, $queryID, \@simples ]; + } elsif ( isSimpleArticle( $article ) ) { + push @inputs, [ SIMPLE, $queryID, $article ]; + } elsif ( isSecondaryArticle( $article ) ) + { # should never happen in a generic service parser! + push @inputs, [ SECONDARY, $queryID, $article ]; } - return @inputs; + } + } + return @inputs; } =head2 serviceInputParser - DO NOT USE!! - function : to take a MOBY message and break the objects out of it. This is identical - to the genericServiceInputParser method above, except that it returns the data as - Objects rather than XML::LibXML nodes. This is an improvement! - usage : my @inputs = serviceInputParser($MOBY_mssage)); - args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message - returns : @inputs - the structure of @inputs is a list of listrefs. - Each listref has three components: +DO NOT USE!! + +B to take a MOBY message and break the objects out of it. +This is identical to the genericServiceInputParser method above, +except that it returns the data as Objects rather than XML::LibXML +nodes. This is an improvement! + +B C + +B C<$message> - this is the SOAP payload; i.e. the XML document containing the MOBY message + +B C<@inputs> - the structure of @inputs is a list of listrefs. + +Each listref has three components: + 1. COLLECTION|SIMPLE|SECONDARY (i.e. constants 1, 2, 3) 2. queryID (undef for Secondary parameters) 3. $data - either MOBY::Client::SimpleArticle, CollectionArticle, or SecondaryArticle @@ -343,108 +331,103 @@ =cut sub serviceInputParser { - my ( $message ) = @_; # get the incoming MOBY query XML - my @inputs; # set empty response - my @queries = - getInputs( $message ); # returns XML::LibXML nodes ... - -# mark, this doesn't work for complex services. We need to allow more than one input per invocation - foreach my $query ( @queries ) { - my $queryID = - getInputID( $query ); # get the queryID attribute of the mobyData - my @input_articles = - getArticlesAsObjects( $query ) - ; # get the Simple/Collection articles making up this query ... or ... or ...isCollection ) { - my @simples = getCollectedSimples( $article->XML ); - push @inputs, [ COLLECTION, $queryID, \@simples ]; - } elsif ( $article->isSimple ) { - push @inputs, [ SIMPLE, $queryID, $article ]; - } elsif ( $article->isSecondary ) { - push @inputs, [ SECONDARY, $queryID, $article ]; - } - } - } - return @inputs; + my ( $message ) = @_; # get the incoming MOBY query XML + my @inputs; # set empty response + my @queries = getInputs( $message ); # returns XML::LibXML nodes ... + + # mark, this doesn't work for complex services. We need to allow more than one input per invocation + foreach my $query ( @queries ) { + my $queryID = getInputID( $query ); # get the queryID attribute of the mobyData + # get the Simple/Collection articles making up this query + # ... or ... + # or ...isCollection ) { + my @simples = getCollectedSimples( $article->XML ); + push @inputs, [ COLLECTION, $queryID, \@simples ]; + } elsif ( $article->isSimple ) { + push @inputs, [ SIMPLE, $queryID, $article ]; + } elsif ( $article->isSecondary ) { + push @inputs, [ SECONDARY, $queryID, $article ]; + } + } + } + return @inputs; } =head2 complexServiceInputParser - function : For more complex services that have multiple articles for each input - and/or accept parameters, this routine will take a MOBY message and - extract the Simple/Collection/Parameter objects out of it in a - useful way. - usage : my $inputs = complexServiceInputParser($MOBY_mssage)); - args : $message - this is the SOAP payload; i.e. the XML document containing the MOBY message - returns : $inputs is a hashref with the following structure: - +B For more complex services that have multiple articles for +each input and/or accept parameters, this routine will take a MOBY +message and extract the Simple/Collection/Parameter objects out of it +in a useful way. + +B C + +B C<$message> - this is the SOAP payload; i.e. the XML document containing the MOBY message + +B C<$inputs> is a hashref with the following structure: + $inputs->{$queryID} = [ [TYPE, $DOM], [TYPE, $DOM], [TYPE, $DOM] ] - - Simples ------------------------ - - for example, the input message: - - - - - - - 10 - - - will become: - (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module) - +=head3 Simples + +For example, the input message: + + + + + + + 10 + + + +will become: (note that SIMPLE, COLLECTION, and SECONDARY are exported constants from this module) + $inputs->{1} = [ [SIMPLE, $DOM_name1], # the block [SECONDARY, $DOM_cutoff] # $DOM_cutoff= block ] - Please see the XML::LibXML pod documentation for information about how - to parse XML DOM objects. +Please see the XML::LibXML pod documentation for information about how to parse XML DOM objects. +=head3 Collections - Collections -------------------- - - With inputs that have collections these are presented as a - listref of Simple article DOM's. So for the following message: - - - - - - - - - - - - 10 - - +With inputs that have collections these are presented as a listref of +Simple article DOM's. So for the following message: + + + + + + + + + + + + 10 + + + +will become - will become - $inputs->{1} = [ [COLLECTION, [$DOM, $DOM] ], # $DOM is the Block! [SECONDARY, $DOM_cutoff] # $DOM_cutoff = Block ] - Please see the XML::LibXML pod documentation for information about how - to parse XML DOM objects. - +Please see the XML::LibXML pod documentation for information about how to parse XML DOM objects. =cut sub complexServiceInputParser { my ( $message ) = @_; # get the incoming MOBY query XML my @inputs; # set empty response - my @queries = - getInputs( $message ); # returns XML::LibXML nodes ... + my @queries = getInputs( $message ); # returns XML::LibXML nodes ... my %input_parameters; # $input_parameters{$queryID} = [ foreach my $query ( @queries ) { - my $queryID = - getInputID( $query ); # get the queryID attribute of the mobyData + my $queryID = getInputID( $query ); # get the queryID attribute of the mobyData my @input_articles = getArticles( $query ) ; # get the Simple/Collection/Secondary articles making up this query ... or ... or ... @@ -466,14 +449,17 @@ =head2 getArticles - function : get the Simple/Collection/Parameter articles for a single mobyData - usage : @articles = getArticles($XML) - args : raw XML or XML::LibXML of a queryInput, mobyData, or queryResponse block (e.g. from getInputs) - returns : a list of listrefs; each listref is one component of the queryInput or mobyData block - a single block may consist of one or more named or unnamed - simple, collection, or parameter articles. - The listref structure is thus [name, $ARTICLE_DOM]: - +B get the Simple/Collection/Parameter articles for a single mobyData + +B C<@articles = getArticles($XML)> + +B raw XML or XML::LibXML of a queryInput, mobyData, or queryResponse block (e.g. from getInputs) + +B a list of listrefs; each listref is one component of the +queryInput or mobyData block a single block may consist of one or more +named or unnamed simple, collection, or parameter articles. The +listref structure is thus C<[name, $ARTICLE_DOM]>: + e.g.: @articles = ['name1', $SIMPLE_DOM] generated from the following sample XML: @@ -483,24 +469,24 @@ - + or : @articles = ['name1', $COLL_DOM], ['paramname1', $PARAM_DOM] generated from the following sample XML: - - - - - - - - - - - 10 - - + + + + + + + + + + + 10 + + =cut @@ -509,16 +495,15 @@ $moby = _string_to_DOM($moby); return undef unless ( ($moby->nodeType == ELEMENT_NODE) - && ( $moby->nodeName =~ /queryInput|queryResponse|mobyData/ ) ); + && ( $moby->nodeName =~ /^(moby:|)(queryInput|queryResponse|mobyData)$/ ) ); my @articles; foreach my $child ( $moby->childNodes ) { # there may be more than one Simple/Collection per input; iterate over them next unless ( ($child->nodeType == ELEMENT_NODE) # ignore whitespace - && ( $child->nodeName =~ /Simple|Collection|Parameter/ ) ); - my $articleName = $child->getAttribute( 'articleName' ) - || $child->getAttribute( 'moby:articleName' ); + && ( $child->nodeName =~ /^(moby:|)(Simple|Collection|Parameter)$/ ) ); + my $articleName = _moby_getAttribute($child, 'articleName' ); # push the named child DOM elements (which are or , ) - push @articles, [ $articleName, $child ]; + push @articles, [ $articleName, $child ]; } return @articles; # return them. } @@ -532,25 +517,34 @@ =head2 getSimpleArticleIDs - function : to get the IDs of simple articles that are in the given namespace - usage : my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles); - my @ids = getSimpleArticleIDs(\@SimpleArticles); - args : $Namespace - (optional) a namespace stringfrom the MOBY namespace ontology, or undef if you don't care - \@Simples - (required) a listref of Simple XML::LibXML nodes - i.e. the XML::LibXML representing an XML structure like this: - - - - note : If you provide a namespace, it will return *only* the ids that are in the given namespace, - but will return 'undef' for any articles in the WRONG namespace so that you get an - equivalent number of outputs to inputs. - - Note that if you call this with a single argument, this is assumed to - be \@Articles, so you will get ALL id's regardless of namespace! +B to get the IDs of simple articles that are in the given namespace + +B + + my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles); + my @ids = getSimpleArticleIDs(\@SimpleArticles); + +B + +C<$Namespace> - (optional) a namespace stringfrom the MOBY namespace ontology, or undef if you don't care + +C<\@Simples> - (required) a listref of Simple XML::LibXML nodes i.e. the XML::LibXML representing an XML structure like this: + + + + + +Note : If you provide a namespace, it will return *only* the ids that +are in the given namespace, but will return 'undef' for any articles +in the WRONG namespace so that you get an equivalent number of outputs +to inputs. + +Note that if you call this with a single argument, this is assumed to +be C<\@Articles>, so you will get ALL id's regardless of namespace! =cut -#Eddie - converted + sub getSimpleArticleIDs { my ( $desired_namespace, $input_nodes ) = @_; if ( $desired_namespace && !$input_nodes ) @@ -569,9 +563,10 @@ $OS->namespaceExists( term => $desired_namespace ); # returns (success, message, lsid) unless ( $s ) { # bail if not successful # Printing to STDERR is not very helpful - we should probably return something that can be dealt iwth programatically.... - print STDERR "MOBY::CommonSubs WARNING ** the namespace '$desired_namespace' " - . "does not exist in the MOBY ontology, and does not have a valid LSID\n"; - return undef; + die("MOBY::CommonSubs: the namespace '$desired_namespace' " + . "does not exist in the MOBY ontology, " + . "and does not have a valid LSID"); +# return undef; } $desired_namespace = $namespace_lsid; # Replace namespace with fully-qualified LSID } @@ -579,13 +574,12 @@ foreach my $in ( @input_nodes ) { next unless $in; #$in = "" - next unless $in->nodeName =~ /Simple/; # only allow simples + next unless $in->nodeName =~ /^(moby:|)Simple$/; # only allow simples my @simples = $in->childNodes; foreach ( @simples ) { # $_ = next unless $_->nodeType == ELEMENT_NODE; if ( $desired_namespace ) { - my $ns = $_->getAttributeNode( 'namespace' ) # get the namespace DOM node - || $_->getAttributeNode( 'moby:namespace' ); + my $ns = _moby_getAttributeNode($_, 'namespace' ); # get the namespace DOM node unless ( $ns ) { # if we don't get it at all, then move on to the next input push @ids, undef; # but push an undef onto teh stack in order next; @@ -594,7 +588,7 @@ ( $s, $m, $ns ) = $OS->namespaceExists( term => $ns ); # A bad namespace will return 'undef' which makes for a bad comparison (Perl warning). # Better to check directly for success ($s), THEN check that namespace is the one we wanted. - unless ( $s && $ns eq $desired_namespace ) + unless ( $s && $ns eq $desired_namespace ) { # we are registering as working in a particular namespace, so check this push @ids, undef; # and push undef onto the stack if it isn't next; @@ -602,7 +596,7 @@ } # Now do the same thing for ID's - my $id = $_->getAttributeNode( 'id' ) || $_->getAttributeNode( 'moby:id' ); + my $id = _moby_getAttributeNode($_, 'id' ); unless ( $id ) { push @ids, undef; next; @@ -620,31 +614,34 @@ =head2 getSimpleArticleNamespaceURI - function : to get the namespace of a simple article - usage : my $ns = getSimpleArticleNamespaceURI($SimpleArticle); - args : $Simple - (required) a single XML::LibXML node representing a Simple Article - i.e. the XML::LibXML representing an XML structure like this: - - - +B to get the namespace of a simple article + +B C + +B C<$Simple> - (required) a single XML::LibXML node +representing a Simple Article i.e. the XML::LibXML representing an XML +structure like this: + + + + =cut -#Eddie - converted + sub getSimpleArticleNamespaceURI { # pass me a input node and I will give you the lsid of the namespace of that input object my ( $input_node ) = @_; return undef unless $input_node; my $OS = MOBY::Client::OntologyServer->new; - + #$input_node = "" my @simples = $input_node->childNodes; foreach ( @simples ) { # $_ = # should be just one, so I will return at will from this routine next unless $_->nodeType == ELEMENT_NODE; - my $ns = $_->getAttributeNode( 'namespace' ) # get the namespace DOM node - || $_->getAttributeNode( 'moby:namespace' ); + my $ns = _moby_getAttributeNode($_, 'namespace' ); # get the namespace DOM node return undef unless ( $ns ); # if we don't get it at all, then move on to the next input my ( $s, $m, $lsid ) = $OS->namespaceExists( term => $ns->getValue ); # if we have a namespace, then get its value @@ -653,306 +650,111 @@ } } -=head2 simpleResponse +sub _string_to_DOM { +# Convert string to DOM. +# If DOM passed in, just return it (i.e., this should be idempotent) +# By Frank Gibbons, Aug. 2005 +# Utility subroutine, not for external use (no export), widely used in this package. + my $XML = shift; + my $moby; + return $XML if ( ref($XML) =~ /^XML\:\:LibXML/ ); - function : wraps a simple article in the appropriate (mobyData) structure - usage : $resp .= &simpleResponse($object, 'MyArticleName', $queryID); - args : (in order) - $object - (optional) a MOBY Object as raw XML - $article - (optional) an articeName for this article - $query - (optional, but strongly recommended) the queryID value for the - mobyData block to which you are responding - notes : as required by the API you must return a response for every input. - If one of the inputs was invalid, you return a valid (empty) MOBY - response by calling &simpleResponse(undef, undef, $queryID) with no arguments. + my $parser = XML::LibXML->new(); + my $doc; + eval { $doc = $parser->parse_string( $XML ) }; + die("CommonSubs couldn't parse XML '$XML' because\n\t$@") if $@; + return $doc->getDocumentElement(); +} -=cut +=head2 getInputs -sub simpleResponse { - my ( $data, $articleName, $qID ) = @_; # articleName optional - $qID = &_getQueryID( $qID ) - if ref( $qID ) =~ /XML\:\:LibXML/; # in case they send the DOM instead of the ID - $data ||= ''; # initialize to avoid uninit value errors - $articleName ||= ""; - $qID ||= ""; - if ( $articleName || $data) { # Linebreaks in XML make it easier for human debuggers to read! - return " - - $data - - "; - } else { - return " - - "; - } -} +B get the mobyData block(s) as XML::LibXML nodes -#Eddie - converted -sub _getQueryID { - my ( $query ) = @_; - $query = _string_to_XML($query); - return '' unless ( $query->nodeName =~ /queryInput|mobyData/ ); #Eddie - unsure - return ($query->getAttribute( 'queryID' ) - || $query->getAttribute( 'moby:queryID' )); -} +B C<@queryInputs = getInputArticles($XML)> -=head2 collectionResponse +B the raw XML of a query, or an XML::LibXML document - function : wraps a set of articles in the appropriate mobyData structure - usage : return responseHeader . &collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter; - args : (in order) - \@objects - (optional) a listref of MOBY Objects as raw XML - $article - (optional) an articeName for this article - $queryID - (optional, but strongly recommended) the mobyData ID - to which you are responding - notes : as required by the API you must return a response for every input. - If one of the inputs was invalid, you return a valid (empty) MOBY - response by calling &collectionResponse(undef, undef, $queryID). +B a list of XML::LibXML::Node's, each is a queryInput or mobyData block. + +B< Note:> Remember that these blocks are enumerated! This is what you +pass as the third argument to the simpleResponse or collectionResponse +subroutine to associate the numbered input to the numbered response =cut -sub collectionResponse { - my ( $data, $articleName, $qID ) = @_; # articleName optional - my $content = ""; - $data ||= []; - $qID ||= ''; - unless ( ( ref($data) eq 'ARRAY' ) && $data->[0] ) - { # we're expecting an arrayref as input data,and it must not be empty - return ""; - } - foreach ( @{$data} ) { - if ( $_ ) { - $content .= " - $_ - "; - } else { - $content .= " - - "; +sub getInputs { + my ( $XML ) = @_; + my $moby = _string_to_DOM($XML); + my @queries; + foreach my $querytag qw( queryInput moby:queryInput mobyData moby:mobyData ) + { + my $x = $moby->getElementsByTagName( $querytag ); # get the mobyData block + for ( 1 .. $x->size() ) { # there may be more than one mobyData per message + push @queries, $x->get_node( $_ ); + } } - } - if ( $articleName ) { - return " - - - $content - - - "; - } else { - return " - - $content - - "; - } + return @queries; # return them in the order that they were discovered. } -=head2 complexResponse +=head2 getInputID - function : wraps articles in the appropriate (mobyData) structure - usage : $resp .= &complexResponse(\@data, $qID); - args : (in order) - \@data - (optional) a listref of arrays. - each element of @data is itself a listref of [$articleName, $XML] - $qID - (optional, but strongly recommended) the queryID value for the - mobyData block to which you are responding - notes : as required by the API you must return a response for every input. - If one of the inputs was invalid, you return a valid (empty) MOBY - response by calling &complexResponse(undef, $queryID) with no arguments. +B get the value of the queryID element -=cut +B C<@queryInputs = getInputID($XML)> -sub complexResponse { - my ( $data, $qID ) = @_; - #return 'ERROR: expected listref [element1, element2, ...] for data' unless ( ref( $data ) =~ /array/i ); - return "\n" - unless ( ref( $data ) eq 'ARRAY' ); - $qID = &_getQueryID( $qID ) - if ref( $qID ) =~ /XML\:\:LibXML/; # in case they send the DOM instead of the ID - my @inputs = @{$data}; - my $output = ""; - foreach ( @inputs ) { - #return 'ERROR: expected listref [articleName, XML] for data element' unless ( ref( $_ ) =~ /array/i ); - return "\n" unless ( ref($_) eq 'ARRAY' ); - while ( my ( $articleName, $XML ) = splice( @{$_}, 0, 2 ) ) { - if ( ref($XML) ne 'ARRAY' ) { - $articleName ||= ""; - $XML ||= ""; - if ( ( $XML =~ /\/ ) || ( $XML =~ /\/ ) ) - { - $output .= - "$XML"; - } else { - $output .= - "\n$XML\n\n"; - } - - # need to do this for collections also!!!!!! - } elsif ( ref($XML) eq 'ARRAY' ) { - my @objs = @{$XML}; - $output .= "\n"; - foreach ( @objs ) { - $output .= "$_\n"; - } - $output .= "\n"; - } - } - } - $output .= "\n"; - return $output; -} +B the raw XML or XML::LibXML of a queryInput or mobyData block (e.g. from getInputs) -=head2 responseHeader +B integer, or '' - function : print the XML string of a MOBY response header +/- serviceNotes - usage : responseHeader('illuminae.com') - responseHeader( - -authority => 'illuminae.com', - -note => 'here is some data from the service provider') - args : a string representing the service providers authority URI, - OR a set of named arguments with the authority and the - service provision notes. - caveat : - notes : returns everything required up to the response articles themselves. - i.e. something like: - - - - - -=cut - -sub responseHeader { - use HTML::Entities (); - my ( $auth, $notes ) = &_rearrange( [qw[AUTHORITY NOTE]], @_ ); - $auth ||= "not_provided"; - $notes ||= ""; - my $xml = - "" - . "" - . ""; - if ( $notes ) { - my $encodednotes = HTML::Entities::encode( $notes ); - $xml .= "$encodednotes"; - } - return $xml; -} - -=head2 responseFooter - - function : print the XML string of a MOBY response footer - usage : return responseHeader('illuminae.com') . $DATA . responseFooter; - notes : returns everything required after the response articles themselves - i.e. something like: - - - - -=cut - -sub responseFooter { - return ""; -} - - -sub _string_to_DOM { -# Convert string to DOM. -# If DOM passed in, just return it (i.e., this should be idempotent) -# By Frank Gibbons, Aug. 2005 -# Utility subroutine, not for external use (no export), widely used in this package. - my $XML = shift; - my $moby; - return $XML if ( ref($XML) =~ /^XML\:\:LibXML/ ); - - my $parser = XML::LibXML->new(); - my $doc; - eval { $doc = $parser->parse_string( $XML ) }; - die("CommonSubs couldn't parse XML '$XML' because\n\t$@") if $@; - return $doc->getDocumentElement(); -} - -=head2 getInputs - - function : get the mobyData block(s) as XML::LibXML nodes - usage : @queryInputs = getInputArticles($XML) - args : the raw XML of a query, or an XML::LibXML document - returns : a list of XML::LibXML::Node's, each is a queryInput or mobyData block. - Note : Remember that these blocks are enumerated! This is what you - pass as the third argument to the simpleResponse or collectionResponse - subroutine to associate the numbered input to the numbered response - -=cut - -#Eddie - converted -sub getInputs { - my ( $XML ) = @_; - my $moby = _string_to_DOM($XML); - my @queries; - foreach my $querytag qw( queryInput moby:queryInput mobyData moby:mobyData ) - { - my $x = $moby->getElementsByTagName( $querytag ); # get the mobyData block - for ( 1 .. $x->size() ) { # there may be more than one mobyData per message - push @queries, $x->get_node( $_ ); - } - } - return @queries; # return them in the order that they were discovered. -} - -=head2 getInputID - - function : get the value of the queryID element - usage : @queryInputs = getInputID($XML) - args : the raw XML or XML::LibXML of a queryInput or mobyData block (e.g. from getInputs) - returns : integer, or '' - Note : Inputs and Responses are coordinately enumerated! - The integer you get here is what you - pass as the third argument to the simpleResponse or collectionResponse - subroutine to associate the numbered input to the numbered response +B< Note:> Inputs and Responses are coordinately enumerated! The +integer you get here is what you pass as the third argument to the +simpleResponse or collectionResponse subroutine to associate the +numbered input to the numbered response =cut sub getInputID { my ( $XML ) = @_; my $moby = _string_to_DOM($XML); - return '' unless ( $moby->nodeName =~ /queryInput|mobyData/ ); - my $qid = $moby->getAttribute( 'queryID' ) - || $moby->getAttribute( 'moby:queryID' ); + return '' unless ( $moby->nodeName =~ /^(moby:|)queryInput|mobyData$/ ); + my $qid = _moby_getAttribute($moby, 'queryID' ); return defined( $qid ) ? $qid : ''; } =head2 getArticlesAsObjects DO NOT USE!! - function : get the Simple/Collection articles for a single mobyData - or queryResponse node, rethrning them as SimpleArticle, - SecondaryArticle, or ServiceInstance objects - usage : @articles = getArticles($XML) - args : raw XML or XML::LibXML of a moby:mobyData block - returns : + +B get the Simple/Collection articles for a single mobyData +or queryResponse node, rethrning them as SimpleArticle, +SecondaryArticle, or ServiceInstance objects + +B C<@articles = getArticles($XML)> + +B raw XML or XML::LibXML of a moby:mobyData block + +B =cut -#Eddie - converted sub getArticlesAsObjects { my ( $moby ) = @_; $moby = _string_to_DOM($moby); return undef unless $moby->nodeType == ELEMENT_NODE; return undef - unless ($moby->nodeName =~ /queryInput|queryResponse|mobyData/); + unless ($moby->nodeName =~ /^(moby:|)(queryInput|queryResponse|mobyData)$/); my @articles; foreach my $child ( $moby->childNodes ) { # there may be more than one Simple/Collection per input; iterate over them next unless $child->nodeType == ELEMENT_NODE; # ignore whitespace next - unless ( $child->nodeName =~ /Simple|Collection|Parameter/ ); + unless ( $child->nodeName =~ /^(moby:|)(Simple|Collection|Parameter)$/ ); my $object; - if ( $child->nodeName =~ /Simple/ ) { + if ( $child->nodeName =~ /^(moby:|)Simple$/ ) { $object = MOBY::Client::SimpleArticle->new( XML_DOM => $child ); - } elsif ( $child->nodeName =~ /Collection/ ) { + } elsif ( $child->nodeName =~ /^(moby:|)Collection$/ ) { $object = MOBY::Client::CollectionArticle->new( XML_DOM => $child ); - } elsif ( $child->nodeName =~ /Parameter/ ) { + } elsif ( $child->nodeName =~ /^(moby:|)Parameter$/ ) { $object = MOBY::Client::SecondaryArticle->new( XML_DOM => $child ); } next unless $object; @@ -963,10 +765,13 @@ =head2 getCollectedSimples - function : get the Simple articles collected in a moby:Collection block - usage : @Simples = getCollectedSimples($XML) - args : raw XML or XML::LibXML of a moby:Collection block - returns : a list of XML::LibXML nodes, each of which is a moby:Simple block +B get the Simple articles collected in a moby:Collection block + +B C<@Simples = getCollectedSimples($XML)> + +B raw XML or XML::LibXML of a moby:Collection block + +B a list of XML::LibXML nodes, each of which is a moby:Simple block =cut @@ -974,31 +779,36 @@ my ( $moby ) = @_; $moby = _string_to_DOM($moby); return undef unless $moby->nodeType == ELEMENT_NODE; - return undef unless ( $moby->nodeName =~ /Collection$/ ); + return undef unless ( $moby->nodeName =~ /^(moby\:|)Collection$/ ); my @articles; foreach my $child ( $moby->childNodes ) { # there may be more than one Simple/Collection per input; iterate over them next unless $child->nodeType == ELEMENT_NODE; # ignore whitespace - next unless ( $child->nodeName =~ /Simple$/ ); + next unless ( $child->nodeName =~ /^(moby\:|)Simple$/ ); push @articles, $child; # take the child elements, which are or } - return ( @articles ); # return them. + return @articles; # return them. } =head2 getInputArticles - function : get the Simple/Collection articles for each input query, in order - usage : @queries = getInputArticles($XML) - args : the raw XML of a moby:MOBY query - returns : a list of listrefs, each listref is the input to a single query. - Remember that the input to a single query may be one or more Simple - and/or Collection articles. These are provided as XML::LibXML nodes. - + +B get the Simple/Collection articles for each input query, in order + +B C<@queries = getInputArticles($XML)> + +B the raw XML of a moby:MOBY query + +B a list of listrefs, each listref is the input to a single +query. Remember that the input to a single query may be one or more +Simple and/or Collection articles. These are provided as XML::LibXML +nodes. + i.e.: @queries = ([$SIMPLE_DOM_NODE], [$SIMPLE_DOM_NODE2]) or : @queries = ([$COLLECTION_DOM_NODE], [$COLLECTION_DOM_NODE2]) - + The former is generated from the following XML: - + ... @@ -1016,7 +826,6 @@ =cut -#Eddie - converted sub getInputArticles { my ( $moby ) = @_; $moby = _string_to_DOM($moby); @@ -1039,71 +848,17 @@ return @queries; # return them in the order that they were discovered. } -=head2 isSimpleArticle - - function : tests XML (text) or an XML DOM node to see if it represents a Simple article - usage : if (isSimpleArticle($node)){do something to it} - input : an XML::LibXML node, an XML::LibXML::Document or straight XML - returns : boolean - -=cut - -#Eddie - converted -sub isSimpleArticle { - my ( $DOM ) = @_; - eval { $DOM = _string_to_DOM($DOM) }; - if ($@) { - return 0; - } - $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); - return ($DOM->nodeName =~ /^(moby:|)Simple$/) ? 1 : 0; #Optional 'moby:' namespace prefix -} - -=head2 isCollectionArticle - - function : tests XML (text) or an XML DOM node to see if it represents a Collection article - usage : if (isCollectionArticle($node)){do something to it} - input : an XML::LibXML node, an XML::LibXML::Document or straight XML - returns : boolean - -=cut - -#Eddie - converted -sub isCollectionArticle { - my ( $DOM ) = @_; - eval {$DOM = _string_to_DOM($DOM) }; - return 0 if $@; - $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); - return ( $DOM->nodeName =~ /^(moby\:|)Collection$/ ) ? 1 : 0; #Optional 'moby:' prefix -} - -=head2 isSecondaryArticle - - function : tests XML (text) or an XML DOM node to see if it represents a Secondary article - usage : if (isSecondaryArticle($node)){do something to it} - input : an XML::LibXML node, an XML::LibXML::Document or straight XML - returns : boolean - -=cut +=head2 extractRawContent -#Eddie - converted -sub isSecondaryArticle { - my ( $XML ) = @_; - my $DOM; - eval {$DOM = _string_to_DOM($XML)} ; - return 0 if $@; - $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); - return ($DOM->nodeName =~ /^(moby\:|)Parameter$/) ? 1 : 0; #Optional 'moby:' prefix -} +B pass me an article (Simple, or Collection) and I'll give +you the content AS A STRING - i.e. the raw XML of the contained MOBY +Object(s) +B C -=head2 extractRawContent +B the one element of the output from getArticles - function : pass me an article (Simple, or Collection) and I'll give you the - content AS A STRING - i.e. the raw XML of the contained MOBY Object(s) - usage : extractRawContent($simple) - input : the one element of the output from getArticles - returns : string +B string =cut @@ -1114,37 +869,36 @@ foreach ( $article->childNodes ) { $response .= $_->toString; } - print STDERR "RESPONSE = $response\n"; +# print STDERR "RESPONSE = $response\n"; return $response; } =head2 getNodeContentWithArticle - function : a very flexible way to get the stringified content of a node - that has the correct element and article name - or get the value of a Parameter element. - usage : @strings = getNodeContentWithArticle($node, $tagname, $articleName) - args : (in order) - $node - an XML::LibXML node, or straight XML. It may even - be the entire mobyData block. - $tagname - the tagname (effectively from the Object type ontology), - or "Parameter" if you are trying to get secondaries - $articleName - the articleName that we are searching for. - to get the content of the primary object, leave - this field blank! - - returns : an ARRAY of the stringified text content for each - node that matched the tagname/articleName specified; one - array element for each matching node. Newlines are NOT considered - new nodes (as they are in normal XML). - - notes : This was written for the purpose of getting the values of - String, Integer, Float, Date_Time, and other such primitives. +B a very flexible way to get the stringified content of a +node that has the correct element and article name or get the value of +a Parameter element. + +B C<@strings = getNodeContentWithArticle($node, $tagname, $articleName)> + +B (in order) + +C<$node> - an XML::LibXML node, or straight XML. It may even be the entire mobyData block. +C<$tagname> - the tagname (effectively from the Object type ontology), or "Parameter" if you are trying to get secondaries +C<$articleName> - the articleName that we are searching for. to get the content of the primary object, leave this field blank! + + +B an ARRAY of the stringified text content for each +node that matched the tagname/articleName specified; one +array element for each matching node. Newlines are NOT considered +new nodes (as they are in normal XML). + +B This was written for the purpose of getting the values of +String, Integer, Float, Date_Time, and other such primitives. For example, in the following XML: ... - ... @@ -1156,8 +910,7 @@ ... - ... - + would be analysed as follows: # get $input - e.g. from genericServiceInputParser or complexServiceInputParser @@ -1166,7 +919,6 @@ For Parameters, such as the following ... - ... @@ -1181,7 +933,6 @@ ... - ... You would parse it as follows: @@ -1208,7 +959,6 @@ =cut -#Eddie - converted sub getNodeContentWithArticle { # give me a DOM, a TagName, an articleName and I will return you the content # of that node **as a string** (beware if there are additional XML tags in there!) @@ -1241,13 +991,8 @@ # if there is an articleName, then get that specific node for ( 1 .. $nodes->size() ) { my $child = $nodes->get_node( $_ ); - if ( - ( $child->getAttribute("articleName") - && ( $child->getAttribute("articleName") eq $articleName ) - ) - || ( $child->getAttribute("moby:articleName") - && ( $child->getAttribute("moby:articleName") eq $articleName ) - ) + if ( _moby_getAttribute($child, "articleName") + && ( $child->getAttribute("articleName") eq $articleName ) ) { # now we have a valid child, get the content... stringified... regardless of what it is @@ -1280,62 +1025,21 @@ return @contents; } -=head2 validateNamespaces - - function : checks the namespace ontology for the namespace lsid - usage : @LSIDs = validateNamespaces(@namespaces) - args : ordered list of either human-readable or lsid presumptive namespaces - returns : ordered list of the LSID's corresponding to those - presumptive namespaces; undef for each namespace that was invalid - - -=cut - -sub validateNamespaces { - # give me a list of namespaces and I will return the LSID's in order - # I return undef in that list position if the namespace is invalid - my ( @namespaces ) = @_; - my $OS = MOBY::Client::OntologyServer->new; - my @lsids; - foreach ( @namespaces ) { - my ( $s, $m, $LSID ) = $OS->namespaceExists( term => $_ ); - push @lsids, $s ? $LSID : undef; - } - return @lsids; -} - -=head2 validateThisNamespace +*getResponseArticles = \&extractResponseArticles; +*getResponseArticles = \&extractResponseArticles; - function : checks a given namespace against a list of valid namespaces - usage : $valid = validateThisNamespace($ns, @validNS); - args : ordered list of the namespace of interest and the list of valid NS's - returns : boolean +=head2 getResponseArticles (a.k.a. extractResponseArticles) -=cut +B get the DOM nodes corresponding to individual Simple or Collection outputs from a MOBY Response -sub validateThisNamespace { - my ( $ns, @namespaces ) = @_; - return 1 unless scalar @namespaces; # if you don't give me a list, I assume everything is valid... - @namespaces = @{$namespaces[0]} # if you send me an arrayref I should be kind... DWIM! - if ( ref $namespaces[0] eq 'ARRAY' ); - return grep /$ns/, @namespaces; -} +B C<($collections, $simples) = getResponseArticles($node)> -=head2 getResponseArticles (a.k.a. extractResponseArticles) +B C<$node> - either raw XML or an XML::LibXML::Document to be searched - function : get the DOM nodes corresponding to individual - Simple or Collection outputs from a MOBY Response - usage : ($collections, $simples) = getResponseArticles($node) - args : $node - either raw XML or an XML::LibXML::Document to be searched - returns : an array-ref of Collection article XML::LibXML::Node's - an array-ref of Simple article XML::LibXML::Node's +B an array-ref of Collection article XML::LibXML::Node's or an array-ref of Simple article XML::LibXML::Node's =cut -*getResponseArticles = \&extractResponseArticles; -*getResponseArticles = \&extractResponseArticles; - -#Eddie - converted sub extractResponseArticles { my ( $result ) = @_; return ( [], [] ) unless $result; @@ -1351,8 +1055,8 @@ my @collections; my @Xrefs; my $success = 0; - foreach my $which ( 'moby:queryResponse', 'queryResponse', 'mobyData', - 'moby:mobyData' ) + foreach my $which ( 'moby:queryResponse', 'queryResponse', + 'mobyData', 'moby:mobyData' ) { my $responses = $moby->getElementsByTagName( $which ); next unless $responses; @@ -1360,23 +1064,19 @@ my $resp = $responses->get_node( $n ); foreach my $response_component ( $resp->childNodes ) { next unless $response_component->nodeType == ELEMENT_NODE; - if ( ( $response_component->nodeName eq "Simple" ) - || ( $response_component->nodeName eq "moby:Simple" ) ) - { + if ( $response_component->nodeName =~ /^(moby:|)Simple$/ ) + { foreach my $Object ( $response_component->childNodes ) { next unless $Object->nodeType == ELEMENT_NODE; $success = 1; push @objects, $Object; } - } elsif ( ( $response_component->nodeName eq "Collection" ) - || ( $response_component->nodeName eq "moby:Collection" ) ) + } elsif ( $response_component->nodeName =~ /^(moby:|)Collection$/ ) { my @objects; foreach my $simple ( $response_component->childNodes ) { next unless $simple->nodeType == ELEMENT_NODE; - next - unless ( ( $simple->nodeName eq "Simple" ) - || ( $simple->nodeName eq "moby:Simple" ) ); + next unless ( $simple->nodeName =~ /^(moby:|)Simple$/ ); foreach my $Object ( $simple->childNodes ) { next unless $Object->nodeType == ELEMENT_NODE; $success = 1; @@ -1392,16 +1092,125 @@ return ( \@collections, \@objects ); } + + +=head1 IDENTITY AND VALIDATION + +This section describes functionality associated with identifying parts of a message, +and checking that it is valid. + +=head2 isSimpleArticle, isCollectionArticle, isSecondaryArticle + +B tests XML (text) or an XML DOM node to see if it represents a Simple, Collection, or Secondary article + +B + + if (isSimpleArticle($node)){do something to it} + +or + + if (isCollectionArticle($node)){do something to it} + +or + + if (isSecondaryArticle($node)){do something to it} + +B< input :> an XML::LibXML node, an XML::LibXML::Document or straight XML + +B boolean + +=cut + +sub isSimpleArticle { + my ( $DOM ) = @_; + eval { $DOM = _string_to_DOM($DOM) }; + return 0 if $@; + $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); + return ($DOM->nodeName =~ /^(moby:|)Simple$/) ? 1 : 0; #Optional 'moby:' namespace prefix +} + +sub isCollectionArticle { + my ( $DOM ) = @_; + eval {$DOM = _string_to_DOM($DOM) }; + return 0 if $@; + $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); + return ( $DOM->nodeName =~ /^(moby\:|)Collection$/ ) ? 1 : 0; #Optional 'moby:' prefix +} + +sub isSecondaryArticle { + my ( $XML ) = @_; + my $DOM; + eval {$DOM = _string_to_DOM($XML)} ; + return 0 if $@; + $DOM = $DOM->getDocumentElement if ( $DOM->isa( "XML::LibXML::Document" ) ); + return ($DOM->nodeName =~ /^(moby\:|)Parameter$/) ? 1 : 0; #Optional 'moby:' prefix +} + + +=head2 validateNamespaces + +B checks the namespace ontology for the namespace lsid + +B C<@LSIDs = validateNamespaces(@namespaces)> + +B ordered list of either human-readable or lsid presumptive namespaces + +B ordered list of the LSID's corresponding to those +presumptive namespaces; undef for each namespace that was invalid + +=cut + +sub validateNamespaces { + # give me a list of namespaces and I will return the LSID's in order + # I return undef in that list position if the namespace is invalid + my ( @namespaces ) = @_; + my $OS = MOBY::Client::OntologyServer->new; + my @lsids; + foreach ( @namespaces ) { + my ( $s, $m, $LSID ) = $OS->namespaceExists( term => $_ ); + push @lsids, $s ? $LSID : undef; + } + return @lsids; +} + +=head2 validateThisNamespace + +B checks a given namespace against a list of valid namespaces + +B C<$valid = validateThisNamespace($ns, @validNS);> + +B ordered list of the namespace of interest and the list of valid NS's + +B boolean + +=cut + +sub validateThisNamespace { + my ( $ns, @namespaces ) = @_; + return 1 unless scalar @namespaces; # if you don't give me a list, I assume everything is valid... + @namespaces = @{$namespaces[0]} # if you send me an arrayref I should be kind... DWIM! + if ( ref $namespaces[0] eq 'ARRAY' ); + return grep /$ns/, @namespaces; +} + + +=head1 ANCILIARY ELEMENTS + +This section contains subroutines that handle processing of optional message elements containing +meta-data. Examples are the ServiceNotes, and CrossReference blocks. + =head2 getServiceNotes - function : to get the content of the Service Notes block of the MOBY message - usage : getServiceNotes($message) - args : $message is either the XML::LibXML of the MOBY message, or plain XML - returns : String content of the ServiceNotes block of the MOBY Message +B to get the content of the Service Notes block of the MOBY message + +B C + +B C<$message> is either the XML::LibXML of the MOBY message, or plain XML + +B String content of the ServiceNotes block of the MOBY Message =cut -#Eddie - converted sub getServiceNotes { my ( $result ) = @_; return ( "" ) unless $result; @@ -1425,13 +1234,17 @@ =head2 getCrossReferences - function : to get the cross-references for a Simple article - usage : @xrefs = getCrossReferences($XML) - args : $XML is either a SIMPLE article (...) - or an object (the payload of a Simple article), and - may be either raw XML or an XML::LibXML node. - returns : an array of MOBY::CrossReference objects - example : +B to get the cross-references for a Simple article + +B C<@xrefs = getCrossReferences($XML)> + +B C<$XML> is either a SIMPLE article (...) or an +object (the payload of a Simple article), and may be either raw XML or +an XML::LibXML node. + +B an array of MOBY::CrossReference objects + +B my (($colls, $simps) = getResponseArticles($query); # returns DOM nodes foreach (@{$simps}){ @@ -1448,14 +1261,13 @@ =cut -#Eddie - converted sub getCrossReferences { my ( $XML ) = @_; $XML = _string_to_DOM($XML); my @xrefs; my @XREFS; - return () if ( $XML->nodeName =~ /Collection/ ); - if ( $XML->nodeName =~ /Simple/ ) { + return () if ( $XML->nodeName =~ /^(moby:|)Collection$/ ); + if ( $XML->nodeName =~ /^(moby:|)Simple$/ ) { foreach my $child ( $XML->childNodes ) { next unless $child->nodeType == ELEMENT_NODE; $XML = $child; @@ -1464,54 +1276,352 @@ } foreach ( $XML->childNodes ) { next unless (($_->nodeType == ELEMENT_NODE) - || ($_->nodeName =~ /CrossReference/) ); + || ($_->nodeName =~ /^(moby:|)CrossReference$/) ); foreach my $xref ( $_->childNodes ) { next unless ( ($xref->nodeType == ELEMENT_NODE) - || ($xref->nodeName =~ /Xref|Object/) ); + || ($xref->nodeName =~ /^(moby:|)(Xref|Object)$/) ); push @xrefs, $xref; } } foreach ( @xrefs ) { my $x; - if ($_->nodeName =~ /Xref/) { $x = &_makeXrefType( $_ ) } - elsif ($_->nodeName =~ /Object/) { $x = &_makeObjectType( $_ ) } + if ($_->nodeName =~ /^(moby:|)Xref$/) { $x = _makeXrefType( $_ ) } + elsif ($_->nodeName =~ /^(moby:|)Object$/) { $x = _makeObjectType( $_ ) } push @XREFS, $x if $x; } return @XREFS; } + +=head1 CONSTRUCTING OUTPUT + +This section describes how to construct output, in response to an +incoming message. Responses come in three varieties: 'Simple', 'Collection', and +'Complex' (Collections and Simples together). + +=head2 simpleResponse + +B wraps a simple article in the appropriate (mobyData) structure + +B + + $resp .= simpleResponse($object, 'MyArticleName', $queryID); + +B (in order) +C<$object> - (optional) a MOBY Object as raw XML +C<$article> - (optional) an articeName for this article +C<$query> - (optional, but strongly recommended) the queryID value for the mobyData block to which you are responding + +B As required by the API you must return a response for every +input. If one of the inputs was invalid, you return a valid (empty) +MOBY response by calling simpleResponse(undef, undef, $queryID) with +no arguments. + +=cut + +sub simpleResponse { + my ( $data, $articleName, $qID ) = @_; # articleName optional + $qID = _getQueryID( $qID ) + if ref( $qID ) =~ /XML\:\:LibXML/; # in case they send the DOM instead of the ID + $data ||= ''; # initialize to avoid uninit value errors + $articleName ||= ""; + $qID ||= ""; + if ( $articleName || $data) { # Linebreaks in XML make it easier for human debuggers to read! + return " + + $data + + "; + } else { + return " + + "; + } +} + + +=head2 collectionResponse + +B wraps a set of articles in the appropriate mobyData structure + +B + + return responseHeader . collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter; + +B (in order) +C<\@objects> - (optional) a listref of MOBY Objects as raw XML +C<$article> - (optional) an articeName for this article +C<$queryID> - (optional, but strongly recommended) the mobyData ID to which you are responding + +B as required by the API you must return a response for every +input. If one of the inputs was invalid, you return a valid (empty) +MOBY response by calling collectionResponse(undef, undef, $queryID). + +=cut + +sub collectionResponse { + my ( $data, $articleName, $qID ) = @_; # articleName optional + my $content = ""; + $data ||= []; + $qID ||= ''; + # The response should only be completely empty when the input $data is completely empty. + # Testing just the first element is incorrect. + my $not_completely_empty = 0; + foreach (@{$data}) { $not_completely_empty += defined $_ } + unless ( ( ref($data) eq 'ARRAY' ) && $not_completely_empty ) + { # we're expecting an arrayref as input data, and it must not be empty + return ""; + } + foreach ( @{$data} ) { # Newlines are for ease of human reading (pretty-printing). + # It's really hard to keep this kind of thing in sync with itself, but for what it's worth, let's leave it in. + if ( $_ ) { + $content .= "$_\n"; + } else { + $content .= "\n"; + } + } + if ( $articleName ) { + return " + + + $content + + + "; + } else { + return " + + $content + + "; + } +} + +=head2 complexResponse + +B wraps articles in the appropriate (mobyData) structure + +B $resp .= complexResponse(\@data, $qID); + +B (in order) + +C<\@data> - (optional) a listref of arrays. each element of @data is +itself a listref of [$articleName, $XML] + +C<$qID> - (optional, but strongly recommended) the queryID value for +the mobyData block to which you are responding + +B as required by the API you must return a response for every +input. If one of the inputs was invalid, you return a valid (empty) +MOBY response by calling complexResponse(undef, $queryID) with no +arguments. + +=cut + +sub complexResponse { + my ( $data, $qID ) = @_; + #return 'ERROR: expected listref [element1, element2, ...] for data' unless ( ref( $data ) =~ /array/i ); + return "\n" + unless ( ref( $data ) eq 'ARRAY' ); + $qID = _getQueryID( $qID ) + if ref( $qID ) =~ /XML\:\:LibXML/; # in case they send the DOM instead of the ID + my @inputs = @{$data}; + my $output = ""; + foreach ( @inputs ) { + #return 'ERROR: expected listref [articleName, XML] for data element' unless ( ref( $_ ) =~ /array/i ); + return "\n" + unless ( ref($_) eq 'ARRAY' ); + while ( my ( $articleName, $XML ) = splice( @{$_}, 0, 2 ) ) { + if ( ref($XML) ne 'ARRAY' ) { + $articleName ||= ""; + $XML ||= ""; + if ( $XML =~ /\<(moby:|)Value\>/ ) + { + $output .= + "$XML\n"; + } else { + $output .= + "\n$XML\n\n"; + } + + # need to do this for collections also!!!!!! + } else { + my @objs = @{$XML}; + $output .= "\n"; + foreach ( @objs ) { + $output .= "$_\n"; + } + $output .= "\n"; + } + } + } + $output .= "\n"; + return $output; +} + +=head2 responseHeader + +B print the XML string of a MOBY response header +/- serviceNotes + +B + + responseHeader('illuminae.com') + + responseHeader( + -authority => 'illuminae.com', + -note => 'here is some data from the service provider') + +B a string representing the service providers authority URI, OR +a set of named arguments with the authority and the service provision +notes. + +B< caveat :> + +B returns everything required up to the response articles themselves. i.e. something like: + + + + + +=cut + +sub responseHeader { + use HTML::Entities (); + my ( $auth, $notes ) = _rearrange( [qw[AUTHORITY NOTE]], @_ ); + $auth ||= "not_provided"; + $notes ||= ""; + my $xml = + "" + . "" + . ""; + if ( $notes ) { + my $encodednotes = HTML::Entities::encode( $notes ); + $xml .= "$encodednotes"; + } + return $xml; +} + +=head2 responseFooter + +B print the XML string of a MOBY response footer + +B + + return responseHeader('illuminae.com') . $DATA . responseFooter; + +B returns everything required after the response articles themselves i.e. something like: + + + + +=cut + +sub responseFooter { + return ""; +} + + + +=head1 MISCELLANEOUS + +This section contains routines that didn't quite seem to fit anywhere else. + +=cut + +=head2 _moby_getAttributeNode, _moby_getAttribute + +B Perform the same task as the DOM routine +getAttribute(Node), but check for both the prefixed and un-prefixed +attribute name (the prefix in question being, of course, +"moby:"). + +B + + $id = _moby_getAttribute($xml_libxml, "id"); + +where C is an attribute in the XML block given as C<$xml_libxml> + +B This function is intended for use internal to this package +only. It's not exported. + +=cut + +sub _moby_getAttributeNode { + # Mimics behavior of XML::LibXML method getAttributeNode, but if the unqualified attribute cannot be found, + # we qualify it with "moby:" and try again. + # We do this so often this module, it's worth having a separate subroutine to do this. + my ($xref, $attr) = @_; + my ($package, $filename, $line) = caller; + if ( !(ref($xref) =~ "^XML\:\:LibXML") ) { + warn "_moby_getAttributeNode: Looking for attribute '$attr'" + . "Can't parse non-XML argument '$xref',\n" + . " called from line $line"; + return ''; + } + if (!defined $attr) { + warn "_moby_getAttributeNode: Non-empty attribute is required" + . "\n called from line $line"; + return ''; + } + return ( $xref->getAttributeNode($attr) || $xref->getAttributeNode( "moby:$attr" ) ); +} + +sub _moby_getAttribute { + # Mimics behavior of XML::LibXML method getAttribute, but if the unqualified attribute cannot be found, + # we qualify it with "moby:" and try again. + # We do this so often this module, it's worth having a separate subroutine to do this. + my ($xref, $attr) = @_; + my ($package, $filename, $line) = caller; + if ( !(ref($xref) =~ "^XML\:\:LibXML")) { + warn "_moby_getAttribute: Looking for attribute '$attr', " + ."can't parse non-XML argument '$xref'\n" + . "_moby_getAttribute called from line $line"; + return ''; + } + if (!defined $attr) { + warn "_moby_getAttribute: Non-empty attribute is required" + . "\n called from line $line"; + return ''; + } + return ( $xref->getAttribute($attr) || $xref->getAttribute("moby:$attr") ); +} + =head2 whichDeepestParentObject - function : select the parent node from nodeList that is - closest to the querynode - usage : ($term, $lsid) = whichDeepestParentObject($CENTRAL, $queryTerm, \@termList) - args : $CENTRAL - your MOBY::Client::Central object - $queryTerm - the object type I am interested in - \@termlist - the list of object types that I know about - returns : an ontology term and LSID as a scalar, or undef if there - is no parent of this node in the nodelist. - (note that it will only return the term if you give it - term names in the @termList. If you give it - LSID's in the termList, then both the parameters - returned will be LSID's - it doesn't back-translate...) +B select the parent node from nodeList that is closest to the querynode + +B + + ($term, $lsid) = whichDeepestParentObject($CENTRAL, $queryTerm, \@termList) + +B + +C<$CENTRAL> - your MOBY::Client::Central object + +C<$queryTerm> - the object type I am interested in + +C<\@termlist> - the list of object types that I know about + +B an ontology term and LSID as a scalar, or undef if there is +no parent of this node in the nodelist. note that it will only return +the term if you give it term names in the @termList. If you give it +LSID's in the termList, then both the parameters returned will be +LSID's - it doesn't back-translate...) =cut sub whichDeepestParentObject { my ( $CENTRAL, $queryTerm, $termlist ) = @_; return ( undef, undef ) - unless ( $CENTRAL - && $queryTerm - && $termlist - && ( ref( $termlist ) =~ /ARRAY/ ) ); + unless ( $CENTRAL && $queryTerm + && $termlist && ( ref( $termlist ) eq 'ARRAY' ) ); my %nodeLSIDs; my $queryLSID = $CENTRAL->ObjLSID( $queryTerm ); foreach ( @$termlist ) { # get list of known LSIDs - my $lsid = $CENTRAL->ObjLSID( $_ ); - return ( $_, $lsid ) - if ( $lsid eq $queryLSID ) - ; # of course, if we find it in the list, then return it right away! - $nodeLSIDs{$lsid} = $_; + my $lsid = $CENTRAL->ObjLSID( $_ ); + return ( $_, $lsid ) + if ( $lsid eq $queryLSID ); # of course, if we find it in the list, then return it right away! + $nodeLSIDs{$lsid} = $_; } return ( undef, undef ) unless keys( %nodeLSIDs ); my $isa = @@ -1528,26 +1638,20 @@ return ( undef, undef ); } -#Eddie - converted + sub _makeXrefType { my ( $xref ) = @_; - my $ns = $xref->getAttributeNode( 'namespace' ) - || $xref->getAttributeNode( 'moby:namespace' ); + my $ns = _moby_getAttributeNode($xref, 'namespace' ); return undef unless $ns; - my $id = $xref->getAttributeNode( 'id' ) - || $xref->getAttributeNode( 'moby:id' ); + my $id = _moby_getAttributeNode($xref, 'id' ); return undef unless $id; - my $xr = $xref->getAttributeNode( 'xref_type' ) - || $xref->getAttributeNode( 'moby:xref_type' ); + my $xr = _moby_getAttributeNode($xref, 'xref_type' ); return undef unless $xr; - my $ec = $xref->getAttributeNode( 'evidence_code' ) - || $xref->getAttributeNode( 'moby:evidence_code' ); + my $ec = _moby_getAttributeNode($xref, 'evidence_code' ); return undef unless $ec; - my $au = $xref->getAttributeNode( 'authURI' ) - || $xref->getAttributeNode( 'moby:authURI' ); + my $au = _moby_getAttributeNode($xref, 'authURI' ); return undef unless $au; - my $sn = $xref->getAttributeNode( 'serviceName' ) - || $xref->getAttributeNode( 'moby:serviceName' ); + my $sn = _moby_getAttributeNode($xref, 'serviceName' ); return undef unless $sn; my $XREF = MOBY::CrossReference->new( type => "xref", @@ -1561,14 +1665,12 @@ return $XREF; } -#Eddie - converted + sub _makeObjectType { my ( $xref ) = @_; - my $ns = $xref->getAttributeNode( 'namespace' ) - || $xref->getAttributeNode( 'moby:namespace' ); + my $ns = _moby_getAttributeNode($xref, 'namespace' ); return undef unless $ns; - my $id = $xref->getAttributeNode( 'id' ) - || $xref->getAttributeNode( 'moby:id' ); + my $id = _moby_getAttributeNode($xref, 'id'); return undef unless $id; my $XREF = MOBY::CrossReference->new( type => "object", @@ -1577,76 +1679,72 @@ ); } -# _rearrange stolen from BioPerl's Bio::RootI.pm -# because it is just so useful! - =head2 _rearrange (stolen from BioPerl ;-) ) - Usage : $object->_rearrange( array_ref, list_of_arguments) - Purpose : Rearranges named parameters to requested order. - Example : $self->_rearrange([qw(SEQUENCE ID DESC)], at param); - : Where @param = (-sequence => $s, - : -desc => $d, - : -id => $i); - Returns : @params - an array of parameters in the requested order. - : The above example would return ($s, $i, $d). - : Unspecified parameters will return undef. For example, if - : @param = (-sequence => $s); - : the above _rearrange call would return ($s, undef, undef) - Argument : $order : a reference to an array which describes the desired - : order of the named parameters. - : @param : an array of parameters, either as a list (in - : which case the function simply returns the list), - : or as an associative array with hyphenated tags - : (in which case the function sorts the values - : according to @{$order} and returns that new array.) - : The tags can be upper, lower, or mixed case - : but they must start with a hyphen (at least the - : first one should be hyphenated.) - Source : This function was taken from CGI.pm, written by Dr. Lincoln - : Stein, and adapted for use in Bio::Seq by Richard Resnick and - : then adapted for use in Bio::Root::Object.pm by Steve Chervitz, - : then migrated into Bio::Root::RootI.pm by Ewan Birney. - Comments : - : Uppercase tags are the norm, - : (SAC) - : This method may not be appropriate for method calls that are - : within in an inner loop if efficiency is a concern. - : - : Parameters can be specified using any of these formats: - : @param = (-name=>'me', -color=>'blue'); - : @param = (-NAME=>'me', -COLOR=>'blue'); - : @param = (-Name=>'me', -Color=>'blue'); - : @param = ('me', 'blue'); - : A leading hyphenated argument is used by this function to - : indicate that named parameters are being used. - : Therefore, the ('me', 'blue') list will be returned as-is. - : - : Note that Perl will confuse unquoted, hyphenated tags as - : function calls if there is a function of the same name - : in the current namespace: - : -name => 'foo' is interpreted as -&name => 'foo' - : - : For ultimate safety, put single quotes around the tag: - : ('-name'=>'me', '-color' =>'blue'); - : This can be a bit cumbersome and I find not as readable - : as using all uppercase, which is also fairly safe: - : (-NAME=>'me', -COLOR =>'blue'); - : - : Personal note (SAC): I have found all uppercase tags to - : be more managable: it involves less single-quoting, - : the key names stand out better, and there are no method naming - : conflicts. - : The drawbacks are that it's not as easy to type as lowercase, - : and lots of uppercase can be hard to read. - : - : Regardless of the style, it greatly helps to line - : the parameters up vertically for long/complex lists. +B + $object->_rearrange( array_ref, list_of_arguments) + +B Rearranges named parameters to requested order. + +B + $self->_rearrange([qw(SEQUENCE ID DESC)], at param); +Where C<@param = (-sequence => $s, -desc => $d, -id => $i);> + +B C<@params> - an array of parameters in the requested order. + +The above example would return ($s, $i, $d). +Unspecified parameters will return undef. For example, if + C<@param = (-sequence => $s);> +the above _rearrange call would return ($s, undef, undef) + +B C<$order> : a reference to an array which describes the desired order of the named parameters. + +C<@param :> an array of parameters, either as a list (in which case the function +simply returns the list), or as an associative array with hyphenated +tags (in which case the function sorts the values according to +@{$order} and returns that new array.) The tags can be upper, lower, +or mixed case but they must start with a hyphen (at least the first +one should be hyphenated.) + +B< Source:> This function was taken from CGI.pm, written by +Dr. Lincoln Stein, and adapted for use in Bio::Seq by Richard Resnick +and then adapted for use in Bio::Root::Object.pm by Steve Chervitz, +then migrated into Bio::Root::RootI.pm by Ewan Birney. + +B +Uppercase tags are the norm, (SAC) This method may not be appropriate +for method calls that are within in an inner loop if efficiency is a +concern. + +Parameters can be specified using any of these formats: + @param = (-name=>'me', -color=>'blue'); + @param = (-NAME=>'me', -COLOR=>'blue'); + @param = (-Name=>'me', -Color=>'blue'); + @param = ('me', 'blue'); + +A leading hyphenated argument is used by this function to indicate +that named parameters are being used. Therefore, the ('me', 'blue') +list will be returned as-is. + +Note that Perl will confuse unquoted, hyphenated tags as function +calls if there is a function of the same name in the current +namespace: C<-name => 'foo'> is interpreted as C<-&name => 'foo'> + +For ultimate safety, put single quotes around the tag: C<('-name'=>'me', '-color' =>'blue');> + +This can be a bit cumbersome and I find not as readable as using all +uppercase, which is also fairly safe:C<(-NAME=>'me', -COLOR =>'blue');> + +Personal note (SAC): I have found all uppercase tags to be more +managable: it involves less single-quoting, the key names stand out +better, and there are no method naming conflicts. The drawbacks are +that it's not as easy to type as lowercase, and lots of uppercase can +be hard to read. Regardless of the style, it greatly helps to line the parameters up +vertically for long/complex lists. =cut sub _rearrange { - # my $dummy = shift; my $order = shift; return @_ unless ( substr( $_[0] || '', 0, 1 ) eq '-' ); @@ -1659,3 +1757,11 @@ map { $_ = uc( $_ ) } @$order; # for bug #1343, but is there perf hit here? return @param{@$order}; } + +sub _getQueryID { + my ( $query ) = @_; + $query = _string_to_XML($query); + return '' unless ( $query->nodeName =~ /^(moby:|)(queryInput|mobyData)$/ ); #Eddie - unsure + return _moby_getAttribute($query, 'queryID' ); +} + From gss at pub.open-bio.org Wed Sep 21 21:54:20 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 21 Sep 2005 17:54:20 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212154.j8LLsKgf012809@pub.open-bio.org> gss Wed Sep 21 17:54:20 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api In directory pub.open-bio.org:/tmp/cvs-serv12775 Removed Files: allclasses-frame.html allclasses-noframe.html constant-values.html deprecated-list.html help-doc.html index.html overview-frame.html overview-summary.html overview-tree.html package-list packages.html serialized-form.html stylesheet.css Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api allclasses-frame.html,1.2,NONE allclasses-noframe.html,1.2,NONE constant-values.html,1.2,NONE deprecated-list.html,1.2,NONE help-doc.html,1.2,NONE index.html,1.2,NONE overview-frame.html,1.2,NONE overview-summary.html,1.2,NONE overview-tree.html,1.2,NONE package-list,1.2,NONE packages.html,1.2,NONE serialized-form.html,1.2,NONE stylesheet.css,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/allclasses-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/allclasses-noframe.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/constant-values.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/deprecated-list.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/help-doc.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/index.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/overview-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/overview-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/overview-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/package-list,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/packages.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/serialized-form.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/RCS/stylesheet.css,v: No such file or directory From gss at pub.open-bio.org Wed Sep 21 22:17:41 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 21 Sep 2005 18:17:41 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212217.j8LMHfX7012905@pub.open-bio.org> gss Wed Sep 21 18:17:41 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer In directory pub.open-bio.org:/tmp/cvs-serv12884/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer Added Files: .cvsignore Log Message: Don't keep javadoc under CVS control moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer .cvsignore,NONE,1.1 From gss at pub.open-bio.org Wed Sep 21 22:40:31 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 21 Sep 2005 18:40:31 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212240.j8LMeVhB012972@pub.open-bio.org> gss Wed Sep 21 18:40:31 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot In directory pub.open-bio.org:/tmp/cvs-serv12947/S-MOBY/ref-impl/semanticmoby.org/WebRoot Modified Files: index.html Log Message: Changed to reference new location of API docs moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot index.html,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/index.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/index.html 2005/03/21 21:42:01 1.6 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/index.html 2005/09/21 22:40:31 1.7 @@ -42,7 +42,7 @@ About Semantic MOBY   Help on Searching
            - + Developers: see the JavaDoc for the Semantic MOBY API!

            From gss at pub.open-bio.org Wed Sep 21 22:56:37 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 21 Sep 2005 18:56:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212256.j8LMubU8013026@pub.open-bio.org> gss Wed Sep 21 18:56:37 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/lib In directory pub.open-bio.org:/tmp/cvs-serv13002/lib Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/lib added to the repository moby-live/S-MOBY/ref-impl/lib - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/lib/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/lib/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/lib/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Wed Sep 21 23:01:52 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 21 Sep 2005 19:01:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212301.j8LN1qAd013126@pub.open-bio.org> gss Wed Sep 21 19:01:52 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/lib In directory pub.open-bio.org:/tmp/cvs-serv13105 Added Files: .cvsignore README.txt antlr-2.7.5.jar antlr.jar commons-codec-1.3.jar commons-httpclient-3.0-rc3.jar commons-logging.jar concurrent.jar icu4j.jar jakarta-oro-2.0.8.jar jena.jar log4j-1.2.12.jar servlet-api.jar xercesImpl.jar xml-apis.jar Log Message: Initial jar files needed to build core and semanticmoby.org moby-live/S-MOBY/ref-impl/lib .cvsignore,NONE,1.1 README.txt,NONE,1.1 antlr-2.7.5.jar,NONE,1.1 antlr.jar,NONE,1.1 commons-codec-1.3.jar,NONE,1.1 commons-httpclient-3.0-rc3.jar,NONE,1.1 commons-logging.jar,NONE,1.1 concurrent.jar,NONE,1.1 icu4j.jar,NONE,1.1 jakarta-oro-2.0.8.jar,NONE,1.1 jena.jar,NONE,1.1 log4j-1.2.12.jar,NONE,1.1 servlet-api.jar,NONE,1.1 xercesImpl.jar,NONE,1.1 xml-apis.jar,NONE,1.1 From gss at pub.open-bio.org Wed Sep 21 23:07:16 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 21 Sep 2005 19:07:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212307.j8LN7GYS013162@pub.open-bio.org> gss Wed Sep 21 19:07:16 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build In directory pub.open-bio.org:/tmp/cvs-serv13137 Modified Files: .cvsignore Log Message: Ignore the war file; built it each time it's needed moby-live/S-MOBY/ref-impl/semanticmoby.org/build .cvsignore,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/.cvsignore 2005/03/21 21:40:00 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/.cvsignore 2005/09/21 23:07:16 1.2 @@ -1,2 +1,2 @@ -classes semanticmoby.org.war +javadoc From gss at pub.open-bio.org Wed Sep 21 23:08:04 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Wed, 21 Sep 2005 19:08:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509212308.j8LN84r5013195@pub.open-bio.org> gss Wed Sep 21 19:08:04 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build In directory pub.open-bio.org:/tmp/cvs-serv13170 Modified Files: build.xml Log Message: Build standalone instead of being invoked from ../../build.xml moby-live/S-MOBY/ref-impl/semanticmoby.org/build build.xml,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/03/21 21:40:00 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/09/21 23:08:04 1.2 @@ -5,9 +5,6 @@ - - - @@ -20,36 +17,78 @@ - - - + + + + + + + + + - + + + + + + + + + + + + + + + + - - - - - + + + + + + - - + + + + + + + + + + + + + + + From senger at pub.open-bio.org Thu Sep 22 07:55:44 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 03:55:44 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509220755.j8M7tiRa014444@pub.open-bio.org> senger Thu Sep 22 03:55:44 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv14429 Added Files: cp.bat deploy deploy.bat remote.deploy.build.xml.template Log Message: moby-live/Java/src/webapps cp.bat,NONE,1.1 deploy,NONE,1.1 deploy.bat,NONE,1.1 remote.deploy.build.xml.template,NONE,1.1 From senger at pub.open-bio.org Thu Sep 22 08:54:40 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 04:54:40 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509220854.j8M8se9w015241@pub.open-bio.org> senger Thu Sep 22 04:54:40 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv15222 Modified Files: Moses.html Added Files: Moses-deploy.html Log Message: moby-live/Java/docs Moses-deploy.html,NONE,1.1 Moses.html,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/Moses.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/docs/Moses.html 2005/08/29 13:21:59 1.5 +++ /home/repository/moby/moby-live/Java/docs/Moses.html 2005/09/22 08:54:40 1.6 @@ -52,7 +52,7 @@

            -

          • Support for service deployment (not yet fully implemented) +
          • Support for service deployment

            @@ -302,21 +302,10 @@


            -

            - -Documentation in progress... (as long as I can keep my eyes open):

            - -

            - -Will be (almost) finished before the end of August 2005...

            - -

            - -


            Martin Senger
            -Last modified: Mon Aug 29 16:07:55 2005 +Last modified: Thu Sep 22 08:42:37 2005
            From senger at pub.open-bio.org Thu Sep 22 09:47:43 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 05:47:43 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509220947.j8M9lhdQ015744@pub.open-bio.org> senger Thu Sep 22 05:47:43 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv15725 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.36,1.37 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/21 04:02:15 1.36 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/22 09:47:43 1.37 @@ -95,9 +95,11 @@ + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + @@ -799,6 +784,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -897,8 +917,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +=========================================================== +File ${build.dir}/${result.file}.tar.gz +for a remote deployment was created. Copy it to the machine +where you wish the services to be deployed. Untar it, +change to the created directory, and invoke: + sh deploy (or deploy.bat on Windows) +=========================================================== + + + + + + + + + + + + + + + + +<undeployment xmlns="http://xml.apache.org/axis/wsdd/"> + <service name="${service.name}"/> +</undeployment> + + + + + + From senger at pub.open-bio.org Thu Sep 22 16:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 12:07:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG78vX017258@pub.open-bio.org> senger Thu Sep 22 12:07:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv17235/docs Modified Files: ChangeLog Moses-deploy.html Log Message: moby-live/Java/docs ChangeLog,1.42,1.43 Moses-deploy.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/21 06:03:49 1.42 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/22 16:07:08 1.43 @@ -1,3 +1,11 @@ +2005-09-23 Martin Senger + + * Add a new method getFullNamespaces() to CentralDigest interface. + + * Changed some outputs of the command-line clients. + + * Significantly improved local caching. + 2005-09-21 Martin Senger * Fixed build.xml not to produce javadoc warnings with Java 1.5 in =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/Moses-deploy.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/Moses-deploy.html 2005/09/22 08:54:40 1.1 +++ /home/repository/moby/moby-live/Java/docs/Moses-deploy.html 2005/09/22 16:07:08 1.2 @@ -52,7 +52,7 @@ times.

            - +

            Deployment properties

            The deployment is an Ant target (task) - so everything is driven by @@ -419,7 +419,7 @@
            Martin Senger
            -Last modified: Thu Sep 22 17:42:41 2005 +Last modified: Thu Sep 22 18:24:09 2005
            From senger at pub.open-bio.org Thu Sep 22 16:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 12:07:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG79j4017284@pub.open-bio.org> senger Thu Sep 22 12:07:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv17235/src/Clients Modified Files: CacheRegistryClient.java MobyDigestClient.java TestingCentral.java Log Message: moby-live/Java/src/Clients CacheRegistryClient.java,1.3,1.4 MobyDigestClient.java,1.3,1.4 TestingCentral.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/19 02:24:51 1.3 +++ /home/repository/moby/moby-live/Java/src/Clients/CacheRegistryClient.java 2005/09/22 16:07:08 1.4 @@ -17,14 +17,14 @@ /** * This is a command-line client creating (and removing) a cache of a * Moby registry. It allows to store locally (in a file system) - * objects representing data types and service instances (the service - * types are ignored, at least for now).

            + * objects representing data types, service instances, namespaces, and + * service types.

            * * The client is quite simple and its basic functionality is included * also in other clients (such as {@link MobyGraphs}. The reason for * having this client separately is also to show how to use {@link * org.biomoby.client.CentralDigestCachedImpl CentralDigestCachedImpl} - * - a real caching worker.

            + * - which is a real caching worker.

            * * @author Martin Senger * @version $Id$ @@ -86,40 +86,65 @@ // // how old is the current cache? // - if (cmd.hasOption ("-age") || cmd.hasOption ("-rawage")) { + if (cmd.hasOption ("-age") || cmd.hasOption ("-rawage") || cmd.hasOption ("-agediff")) { decorationLn ("Cache age for " + worker.getRegistryEndpoint() + ":"); long age = castWorker.getCacheAge(); if (age < 0) - decoration ("(cache is empty)"); + decorationLn ("(cache is empty)"); else { if (cmd.hasOption ("-age")) - System.out.print (new Date (castWorker.getCacheAge()).toString()); - else - System.out.print (castWorker.getCacheAge()); + System.out.println (new Date (age).toString()); + if (cmd.hasOption ("-agediff")) + System.out.println (ms2Human (new Date().getTime() - age)); + if (cmd.hasOption ("-ageraw")) + System.out.println (age); } - decorationLn (""); } // // [re-]fill the cache // - if (cmd.hasOption ("-fill")) { - castWorker.removeFromCache (null); + if (cmd.hasOption ("-fill") || cmd.hasOption ("-fill-d")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_DATATYPES); decorationLn ("Retrieving data types..."); worker.getDataTypes(); + } + if (cmd.hasOption ("-fill") || cmd.hasOption ("-fill-s")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_SERVICES); decorationLn ("Retrieving services..."); worker.getServices(); } + if (cmd.hasOption ("-fill") || cmd.hasOption ("-fill-t")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_SERVICETYPES); + decorationLn ("Retrieving service types..."); + worker.getFullServiceTypes(); + } + if (cmd.hasOption ("-fill") || cmd.hasOption ("-fill-n")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_NAMESPACES); + decorationLn ("Retrieving namespaces..."); + worker.getNamespaces(); + } // // remove the cache // - if (cmd.hasOption ("-remove")) { - castWorker.removeFromCache (null); - decorationLn ("Cache removed."); + if (cmd.hasOption ("-remove") || cmd.hasOption ("-remove-d")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_DATATYPES); + decorationLn ("Cache for data types removed."); + } + if (cmd.hasOption ("-remove") || cmd.hasOption ("-remove-s")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_SERVICES); + decorationLn ("Cache for services removed."); + } + if (cmd.hasOption ("-remove") || cmd.hasOption ("-remove-t")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_SERVICETYPES); + decorationLn ("Cache for service types removed."); + } + if (cmd.hasOption ("-remove") || cmd.hasOption ("-remove-n")) { + castWorker.removeFromCache (CentralDigestCachedImpl.CACHE_PART_NAMESPACES); + decorationLn ("Cache for namespaces removed."); } - } catch (Exception e) { System.err.println ("===ERROR==="); e.printStackTrace(); @@ -128,6 +153,21 @@ } /************************************************************************* + * Give me an elapsed time (given in milllis) in a human readable form. + *************************************************************************/ + public static String ms2Human (long millis) { + StringBuffer buf = new StringBuffer (100); + long seconds = millis / 1000; + long minutes = seconds / 60; + long hours = minutes / 60; + long days = hours / 24; + if (days > 0) + buf.append (days + " days and "); + buf.append ((hours % 24) + ":" + (minutes % 60) + ":" + (seconds % 60) + "." + (millis % 1000)); + return new String (buf); + } + + /************************************************************************* * Print 'msg' but only if in verbose mode *************************************************************************/ static void decoration (String msg) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/09/19 08:08:32 1.3 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyDigestClient.java 2005/09/22 16:07:08 1.4 @@ -67,15 +67,19 @@ if (cmd.hasOption ("-verbose")) worker.setDebug (true); - // read all data types and their relationships + // read (sometimes all) data types and their relationships if (cmd.hasOption ("-d")) { - MobyDataType[] dataTypes = worker.getDataTypes(); - for (int i = 0; i < dataTypes.length; i++) { - if (details) { + if (details) { + MobyDataType[] dataTypes = worker.getDataTypes(); + for (int i = 0; i < dataTypes.length; i++) { System.out.println (dataTypes[i].toString()); System.out.println ("---"); - } else { - System.out.println (dataTypes[i].getName()); + } + } else { + Map dataTypeNames = worker.getDataTypeNames(); + for (Iterator it = dataTypeNames.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + System.out.println (entry.getKey()); } } } @@ -95,13 +99,21 @@ // read all services if (cmd.hasOption ("-s")) { - MobyService[] services = worker.getServices(); - for (int i = 0; i < services.length; i++) { - if (details) { + if (details) { + MobyService[] services = worker.getServices(); + for (int i = 0; i < services.length; i++) { System.out.println (services[i].toString()); System.out.println ("---"); - } else { - System.out.println (services[i].getName()); + } + } else { + Map authorities = worker.getServiceNamesByAuthority(); + for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String authority = (String)entry.getKey(); + String[] names = (String[])entry.getValue(); + for (int i = 0; i < names.length; i++) { + System.out.println (names[i] + " (" + authority + ")"); + } } } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/09/19 08:08:32 1.6 +++ /home/repository/moby/moby-live/Java/src/Clients/TestingCentral.java 2005/09/22 16:07:08 1.7 @@ -162,37 +162,35 @@ worker.setDebug (debug); // ...and call other methods: - String result; - - + // retrieve things try { start ("retrieveServiceNames"); - Map serviceNames = worker.getServiceNames(); + worker.getServiceNamesByAuthority(); ok(); } catch (MobyException e) { error (e); } try { start ("retrieveServiceProviders"); - String[] providers = worker.getProviders(); + worker.getProviders(); ok(); } catch (MobyException e) { error (e); } try { start ("retrieveServiceTypes"); - Map serviceTypes = worker.getServiceNames(); + worker.getServiceTypes(); ok(); } catch (MobyException e) { error (e); } try { start ("retrieveNamespaces"); - Map namespaces = worker.getNamespaces(); + worker.getNamespaces(); ok(); } catch (MobyException e) { error (e); } try { start ("retrieveObjectNames"); - Map typeNames = worker.getDataTypeNames(); + worker.getDataTypeNames(); ok(); } catch (MobyException e) { error (e); } From senger at pub.open-bio.org Thu Sep 22 16:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 12:07:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG79RK017308@pub.open-bio.org> senger Thu Sep 22 12:07:08 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv17235/src/Clients/help Modified Files: CacheRegistryClient_usage.txt MobyDigest_usage.txt Log Message: moby-live/Java/src/Clients/help CacheRegistryClient_usage.txt,1.3,1.4 MobyDigest_usage.txt,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt 2005/09/04 13:45:37 1.3 +++ /home/repository/moby/moby-live/Java/src/Clients/help/CacheRegistryClient_usage.txt 2005/09/22 16:07:08 1.4 @@ -23,20 +23,34 @@ (or print nothing if the cache is empty; - in verbose mode print 'cache is empty'); format: dow mon dd hh:mm:ss zzz yyyy + -agediff ... print how old is cache + (or print nothing if the cache is empty; + - in verbose mode print 'cache is empty') -rawage ... print date when the cache was created (or print nothing if the cache is empty; - in verbose mode print 'cache is empty'); format: number of milliseconds since the standard base time known as "the epoch" (January 1, 1970, 00:00:00 GMT) + -fill ... remove the current cache and reread all data from the given Moby registry and cache them (note that this does not influence data from other Moby registries stored in the same -cachedir directory) + -fill-d ... ditto as -fill but only for data types + -fill-s ... ditto as -fill but only for services + -fill-t ... ditto as -fill but only for service types + -fill-n ... ditto as -fill but only for namespaces + -remove ... remove the current cache of the given Moby registry (again it does not influence data from other Moby registries stored in the same -cachedir directory) + -remove-d ...ditto as -remove but only for data types + -remove-s ...ditto as -remove but only for services + -remove-t ...ditto as -remove but only for service types + -remove-n ...ditto as -remove but only for namespaces + -q ... quiet mode [Note: You can also use -argsfile to read arguments from a =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/09/04 13:45:37 1.3 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyDigest_usage.txt 2005/09/22 16:07:08 1.4 @@ -26,6 +26,7 @@ -t ... print all service types -s ... print all service instances -d ... print all data types + -n ... print all namespaces -details ... print the above with all details (by default only names are printed) From senger at pub.open-bio.org Thu Sep 22 16:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 12:07:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG79Jn017371@pub.open-bio.org> senger Thu Sep 22 12:07:09 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv17235/src/main/org/biomoby/service/dashboard Modified Files: NOTES Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard NOTES,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/19 08:08:32 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/22 16:07:09 1.5 @@ -10,26 +10,25 @@ ? small icons to buttons ? use FileSystemView in file choosers ? alltools2: - - combo box history is not updated if exit happened while focus is till in the text field + - combo box history is not updated if exit happened while focus is still in the text field ? configure dashboard from menu: * configure dashbard (add/remove dynamically panels) * configure user preferences -* running from run-dashboard does not work - TODO for cache: --------------- -* add namespaces and service types -* store services under names: authority-service_name -* emit log events +* emit log events; use them also in cmdline clients * poor-man update: keep what's there but add what is not there - (and perhaps delete what should not be thre) - but do not + (and perhaps delete what should not be there) - but do not check any age of existing * getInfo() method * corresponding changes with command-line clients for cache implementations +* remove memory-caching from CentralImpl +* graphics by default: yes for datatyeps and no for services +? improve API javadoc of all these Central*Impl ? start to work on/think of the RDF-based cache Registry panel From senger at pub.open-bio.org Thu Sep 22 16:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 12:07:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG794k017420@pub.open-bio.org> senger Thu Sep 22 12:07:09 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv17235/src/main/org/biomoby/shared Modified Files: CentralDigest.java MobyDataType.java MobyNamespace.java MobyPrimaryDataSet.java MobyPrimaryDataSimple.java MobySecondaryData.java MobyService.java Log Message: moby-live/Java/src/main/org/biomoby/shared CentralDigest.java,1.1,1.2 MobyDataType.java,1.7,1.8 MobyNamespace.java,1.1,1.2 MobyPrimaryDataSet.java,1.2,1.3 MobyPrimaryDataSimple.java,1.4,1.5 MobySecondaryData.java,1.3,1.4 MobyService.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java 2004/10/18 14:49:30 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/CentralDigest.java 2005/09/22 16:07:09 1.2 @@ -1,14 +1,16 @@ // CentralDigest.java // -// senger at ebi.ac.uk -// September 2004 +// Created: September 2004 +// +// This file is a component of the BioMoby project. +// Copyright Martin Senger (martin.senger at gmail.com). // package org.biomoby.shared; /** - * An interface to the cumulated (digested) contents of the Moby Registry. - *

            + * An interface to the cumulated (digested) contents of the Moby + * Registry.

            * * The main purpose of this interface is for those clients that are * accessing the whole, or a substantial part of, Moby registry. The @@ -16,7 +18,7 @@ * registry API that allow to get more information in one go - saving * significantly network and time.

            * - * @author Martin Senger + * @author Martin Senger * @version $Id$ */ @@ -44,6 +46,17 @@ throws MobyException; /************************************************************************* + * Get definition of all known namespaces. It differs from the + * {@link Central#getNamespaces} because it returns an array of + * full definitions of namespaces, and not just their names and + * descriptions.

            + * + * @throws MobyException if communication with the Moby Registry fails + *************************************************************************/ + MobyNamespace[] getFullNamespaces() + throws MobyException; + + /************************************************************************* * Get definition of all registered service instances. It is a * cumulation of many individual calls to {@link * Central#findService(MobyService) findService by name} for all =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/08/26 06:27:04 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/09/22 16:07:09 1.8 @@ -7,6 +7,7 @@ package org.biomoby.shared; +import org.tulsoft.shared.UUtils; /** @@ -246,20 +247,27 @@ public String toString() { StringBuffer buf = new StringBuffer(); buf.append ("Name: " + name + "\n"); - buf.append ("Auth: " + authority + "\n"); - buf.append ("Desc: " + description + "\n"); - buf.append ("Contact: " + emailContact + "\n"); + if (UUtils.notEmpty (authority)) buf.append ("Auth: " + authority + "\n"); + if (UUtils.notEmpty (description)) buf.append ("Desc: " + description + "\n"); + if (UUtils.notEmpty (emailContact)) buf.append ("Contact: " + emailContact + "\n"); if (id != null) buf.append ("ID: " + id + "\n"); - buf.append ("Parents:\n"); - for (int i = 0 ; i < parentNames.length; i++) { - buf.append (Utils.format (null, 1)); - buf.append (parentNames [i]); + if (parentNames.length > 0) { + buf.append ("Parents: "); + for (int i = 0 ; i < parentNames.length; i++) { + if (i > 0) buf.append (", "); + buf.append (parentNames [i]); + } buf.append ("\n"); } - buf.append ("Children (only those registered here):\n"); - for (int i = 0 ; i < children.length; i++) { - buf.append (Utils.format (null, 1)); - buf.append (children[i].toString()); + int chLen = children.length; + if (chLen > 0) { + buf.append ("Children (only those registered here): "); + if (chLen > 1) + buf.append ("\n"); + for (int i = 0 ; i < chLen; i++) { + if (i > 0) buf.append ("\n\t"); + buf.append (children[i].toString()); + } buf.append ("\n"); } return new String (buf); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java 2003/09/24 14:33:37 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyNamespace.java 2005/09/22 16:07:09 1.2 @@ -6,6 +6,7 @@ // package org.biomoby.shared; +import org.tulsoft.shared.UUtils; /** * A container representing a namespace used in the Moby registry. @@ -69,10 +70,12 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name + "\n"); - buf.append ("Auth: " + authority + "\n"); - buf.append ("Desc: " + description + "\n"); - buf.append ("ID: " + id + "\n"); + buf.append ("Name: " + name); + if (UUtils.notEmpty (authority)) + buf.append (", Auth: " + authority); + if (id != null) buf.append (", ID: " + id); + if (UUtils.notEmpty (description)) + buf.append ("\n\t" + description); return new String (buf); } public String format (int indent) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSet.java 2005/04/07 16:37:02 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSet.java 2005/09/22 16:07:09 1.3 @@ -6,6 +6,8 @@ package org.biomoby.shared; +import org.tulsoft.shared.UUtils; + import java.util.Enumeration; import java.util.Vector; @@ -106,8 +108,9 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name + "\n"); - buf.append ("ID: " + id + "\n"); + if (UUtils.notEmpty (name)) + buf.append ("Name: " + name + "\n"); + if (id != null) buf.append ("ID: " + id + "\n"); buf.append ("Elements in collection:\n"); for (Enumeration en = elements.elements(); en.hasMoreElements(); ) { buf.append (((MobyPrimaryDataSimple)en.nextElement()).format (1)); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSimple.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSimple.java 2005/04/07 16:37:02 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSimple.java 2005/09/22 16:07:09 1.5 @@ -6,6 +6,8 @@ package org.biomoby.shared; +import org.tulsoft.shared.UUtils; + import java.util.Enumeration; import java.util.Vector; @@ -130,15 +132,18 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name + "\n"); + if (UUtils.notEmpty (name)) + buf.append ("Name: " + name + "\n"); if (id != null) buf.append ("ID: " + id + "\n"); if (dataType != null) buf.append ("Data Type:\n" + dataType.format (1)); - buf.append ("Namespaces:\n"); - for (Enumeration en = namespaces.elements(); en.hasMoreElements(); ) { - buf.append (((MobyNamespace)en.nextElement()).format (1)); + if (namespaces.size() > 0) { + buf.append ("Namespaces:\n"); + for (Enumeration en = namespaces.elements(); en.hasMoreElements(); ) { + buf.append (((MobyNamespace)en.nextElement()).format (1)); + buf.append ("\n"); + } } - buf.append ("\n"); return new String (buf); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobySecondaryData.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobySecondaryData.java 2005/04/19 17:58:49 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobySecondaryData.java 2005/09/22 16:07:09 1.4 @@ -6,6 +6,8 @@ package org.biomoby.shared; +import org.tulsoft.shared.UUtils; + import java.util.Enumeration; import java.util.Vector; @@ -178,19 +180,23 @@ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append ("Name: " + name + "\n"); - buf.append ("ID: " + id + "\n"); + if (UUtils.notEmpty (name)) + buf.append ("Name: " + name + "\n"); + if (id != null) buf.append ("ID: " + id + "\n"); buf.append ("Data Type: " + dataType + "\n"); - buf.append ("Default: " + defaultValue + "\n"); + if (UUtils.notEmpty (defaultValue)) + buf.append ("Default: " + defaultValue + "\n"); if (minimumValue != Integer.MIN_VALUE) buf.append ("Min: " + minimumValue + "\n"); if (maximumValue != Integer.MAX_VALUE) buf.append ("Max: " + maximumValue + "\n"); - buf.append ("Allowed values: "); - for (Enumeration en = allowedValues.elements(); en.hasMoreElements(); ) { - buf.append (en.nextElement() + " "); + if (allowedValues.size() > 0) { + buf.append ("Allowed values: "); + for (Enumeration en = allowedValues.elements(); en.hasMoreElements(); ) { + buf.append (en.nextElement() + " "); + } + buf.append ("\n"); } - buf.append ("\n"); return new String (buf); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2005/08/26 06:27:04 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2005/09/22 16:07:09 1.7 @@ -7,6 +7,8 @@ package org.biomoby.shared; +import org.tulsoft.shared.UUtils; + import java.util.Enumeration; import java.util.Vector; @@ -70,6 +72,15 @@ setName (name); } + /************************************************************************** + * Even more normal constructor - because a service is fully + * qualified only by its name and its authority.

            + *************************************************************************/ + public MobyService (String name, String authority) { + setName (name); + setAuthority (authority); + } + public String getUniqueName() { return name + "/" + authority; } @@ -302,24 +313,25 @@ buf.append ("Desc: " + description + "\n"); buf.append ("URL: " + url + "\n"); buf.append ("Contact: " + emailContact + "\n"); - buf.append ("Signature URL: " + signatureURL + "\n"); - buf.append ("Path to RDF: " + pathToRDF + "\n"); + if (UUtils.notEmpty (signatureURL)) + buf.append ("Signature URL: " + signatureURL + "\n"); + if (UUtils.notEmpty (pathToRDF)) + buf.append ("Path to RDF: " + pathToRDF + "\n"); if (id != null) buf.append ("ID: " + id + "\n"); - buf.append ("\nPrimary inputs:\n"); + buf.append ("Primary inputs:\n"); for (Enumeration en = primaryInputs.elements(); en.hasMoreElements(); ) buf.append (((MobyData)en.nextElement()).format (1)); - buf.append ("\n"); - buf.append ("\nSecondary inputs:\n"); - for (Enumeration en = secondaryInputs.elements(); en.hasMoreElements(); ) - buf.append (en.nextElement().toString()); - buf.append ("\n"); + if (secondaryInputs.size() > 0) { + buf.append ("Secondary inputs:\n"); + for (Enumeration en = secondaryInputs.elements(); en.hasMoreElements(); ) + buf.append (((MobyData)en.nextElement()).format (1)); + } - buf.append ("\nOutputs:\n"); + buf.append ("Outputs:\n"); for (Enumeration en = primaryOutputs.elements(); en.hasMoreElements(); ) - buf.append (en.nextElement().toString()); - buf.append ("\n"); + buf.append (((MobyData)en.nextElement()).format (1)); return new String (buf); } From senger at pub.open-bio.org Thu Sep 22 16:07:09 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Thu, 22 Sep 2005 12:07:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221607.j8MG79XJ017350@pub.open-bio.org> senger Thu Sep 22 12:07:09 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv17235/src/main/org/biomoby/client Modified Files: BaseCmdLineClient.java CentralDigestCachedImpl.java CentralDigestImpl.java CentralImpl.java GraphsServlet.java ServiceConnections.java Log Message: moby-live/Java/src/main/org/biomoby/client BaseCmdLineClient.java,1.2,1.3 CentralDigestCachedImpl.java,1.6,1.7 CentralDigestImpl.java,1.4,1.5 CentralImpl.java,1.26,1.27 GraphsServlet.java,1.11,1.12 ServiceConnections.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/09/04 13:45:37 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/BaseCmdLineClient.java 2005/09/22 16:07:08 1.3 @@ -288,8 +288,7 @@ *************************************************************************/ protected MobyObject createInstance (String className) throws MobyException { - MobyObject data = null; - try { + try { Class theClass = mapDataTypes.getClass (className); if (theClass == null) throw new MobyException ("Cannot instantiate data type '" + className + "'. Does it exist?"); @@ -533,7 +532,6 @@ throw new MobyException ("Service name was not given. Try to add parameter: -service "); - String xmlResponse = null; String methodName = serviceName; Method method = null; Object service = null; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/19 08:08:32 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/22 16:07:08 1.7 @@ -21,6 +21,7 @@ import org.biomoby.shared.MobyDataType; import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; +import org.biomoby.shared.MobyServiceType; import org.biomoby.shared.NoSuccessException; /** @@ -29,7 +30,7 @@ * does not need to access Moby registry all the time. The other * methods of the Central interface do not use the results of the * cached cumulative results (their implementation is just passed to - * the parent class). It does not cache service types.

            + * the parent class).

            * * The caching is done in the file system, not in memory, so the * results are permanent (until someone removes the caching @@ -46,14 +47,27 @@ extends CentralDigestImpl implements CentralAll { + // filename for a list of cached entities + protected static final String LIST_FILE = "__L__I__S__T__"; + + /** An ID used in {@link #removeFromCache} indicating data types part. */ + public static final String CACHE_PART_DATATYPES = "c1"; + + /** An ID used in {@link #removeFromCache} indicating services part. */ + public static final String CACHE_PART_SERVICES = "c2"; + + /** An ID used in {@link #removeFromCache} indicating service types part. */ + public static final String CACHE_PART_SERVICETYPES = "c3"; + + /** An ID used in {@link #removeFromCache} indicating namespaces part. */ + public static final String CACHE_PART_NAMESPACES = "c4"; + // cache location private String cacheDir; // as defined in the constructor protected File dataTypesCache; protected File servicesCache; protected File namespacesCache; - - // cache age - private long cacheAge = -1; + protected File serviceTypesCache; // for optimalization private String fileSeparator; @@ -93,31 +107,40 @@ File cache = createCacheDir (cacheDir, getRegistryEndpoint()); messageLn ("Using cache directory: " + cache); dataTypesCache = createSubCacheDir (cache, "dataTypes"); - long dataTypesCacheAge = (isCacheEmpty (dataTypesCache) ? -1 : dataTypesCache.lastModified()); servicesCache = createSubCacheDir (cache, "services"); - long servicesCacheAge = (isCacheEmpty (servicesCache) ? -1 : servicesCache.lastModified()); namespacesCache = createSubCacheDir (cache, "namespaces"); - long namespacesCacheAge = (isCacheEmpty (namespacesCache) ? -1 : namespacesCache.lastModified()); - - if (dataTypesCacheAge > -1 && servicesCacheAge > -1 && namespacesCacheAge > -1) - cacheAge = Math.min (Math.min (dataTypesCacheAge, servicesCacheAge), - namespacesCacheAge); - else - cacheAge = Math.max (Math.max (dataTypesCacheAge, servicesCacheAge), - namespacesCacheAge); + serviceTypesCache = createSubCacheDir (cache, "serviceTypes"); } } /************************************************************************** - * It removes the whole cache (for the Moby registry this instance - * as initiated for), regardless of the 'id' passed. + * Removes object groups from the cache. If 'id' is null it + * removes the whole cache (for the Moby registry this instance as + * initiated for). Otherwise 'id' indicates what part of the cache + * that will be removed.

            + * + * @param id should be either null, or one of the fillowing: + * {@link #CACHE_PART_DATATYPES}, {@link #CACHE_PART_SERVICES}, + * {@link #CACHE_PART_SERVICETYPES}, and {@link + * #CACHE_PART_NAMESPACES}. **************************************************************************/ public void removeFromCache (String id) { try { if (cacheDir != null) { - removeCacheDir (cacheDir, getRegistryEndpoint(), - new String[] { "dataTypes", "services" }); - cacheAge= -1; + String[] parts = null; + if (id == null) + parts = new String[] { "dataTypes", "services", "serviceTypes", "namespaces" }; + else if (id.equals (CACHE_PART_SERVICES)) + parts = new String[] { "services" }; + else if (id.equals (CACHE_PART_DATATYPES)) + parts = new String[] { "dataTypes" }; + else if (id.equals (CACHE_PART_SERVICETYPES)) + parts = new String[] { "serviceTypes" }; + else if (id.equals (CACHE_PART_NAMESPACES)) + parts = new String[] { "namespaces" }; + if (parts != null) { + removeCacheDir (cacheDir, getRegistryEndpoint(), parts); + } } } catch (MobyException e) { // TBD: keep this here at least for some time (until we @@ -255,8 +278,10 @@ } } - // read a cached file - protected String load (File file) + /************************************************************************** + * Read a cached file + *************************************************************************/ + protected static String load (File file) throws MobyException { try { StringBuffer buf = new StringBuffer(); @@ -280,6 +305,7 @@ // protected boolean isCacheEmpty (File cache) throws MobyException { + if (cache == null) return true; String[] list = cache.list(); return ( list == null || list.length == 0 ); } @@ -287,7 +313,9 @@ protected void fillDataTypesCache() throws MobyException { try { - Map types = getDataTypeNames(); + String typesAsXML = getDataTypeNamesAsXML(); + store (dataTypesCache, LIST_FILE, typesAsXML); + Map types = createDataTypeNamesFromXML (typesAsXML); for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); String name = (String)entry.getKey(); @@ -295,9 +323,6 @@ String xml = getDataTypeAsXML (name); store (dataTypesCache, name, xml); } - if (cacheAge <= 0) - cacheAge = dataTypesCache.lastModified(); - } catch (Exception e) { throw new MobyException (formatException (e)); } @@ -307,17 +332,36 @@ throws MobyException { try { messageLn ("(CDCI) Asking for all service names..."); - Map names = getServiceNames(); - for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { + String byAuthorityAsXML = getServiceNamesByAuthorityAsXML(); + store (servicesCache, LIST_FILE, byAuthorityAsXML); + Map authorities = createServiceNamesByAuthorityFromXML (byAuthorityAsXML); + for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); - String name = (String)entry.getKey(); - messageLn ("(CDCI) Processing service " + name + "..."); - String xml = getServicesAsXML (new MobyService (name), null, true, true); - store (servicesCache, name, xml); + String authority = (String)entry.getKey(); + messageLn ("(CDCI) Processing authority " + authority + "..."); + String xml = getServicesAsXML (new MobyService (MobyService.DUMMY_NAME, authority), null, true, true); + store (servicesCache, authority, xml); } - if (cacheAge <= 0) - cacheAge = servicesCache.lastModified(); + } catch (Exception e) { + throw new MobyException (formatException (e)); + } + } + // + protected void fillServiceTypesCache() + throws MobyException { + try { + messageLn ("(CDCI) Asking for all service type names..."); + String typesAsXML = getServiceTypesAsXML(); + store (serviceTypesCache, LIST_FILE, typesAsXML); + Map types = createServiceTypesFromXML (typesAsXML); + for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String name = (String)entry.getKey(); + messageLn ("(CDCI) Processing service type " + name + "..."); + String xml = getServiceTypeRelationshipsAsXML (name, false); + store (serviceTypesCache, name, xml); + } } catch (Exception e) { throw new MobyException (formatException (e)); } @@ -328,16 +372,34 @@ throws MobyException { try { String xml = getNamespacesAsXML(); - store (namespacesCache, "all_namespaces_in_one_go", xml); - if (cacheAge <= 0) - cacheAge = namespacesCache.lastModified(); - + store (namespacesCache, LIST_FILE, xml); } catch (Exception e) { throw new MobyException (formatException (e)); } } - // read all data types + /************************************************************************* + * + *************************************************************************/ + public Map getDataTypeNames() + throws MobyException { + if (dataTypesCache == null) + return super.getDataTypeNames(); + synchronized (dataTypesCache) { + if (isCacheEmpty (dataTypesCache)) { + initCache(); + fillDataTypesCache(); + } + + // get a list file (with all data type names) + String xmlList = getListFile (dataTypesCache); + return createDataTypeNamesFromXML (xmlList); + } + } + + /************************************************************************* + * + *************************************************************************/ public MobyDataType[] getDataTypes() throws MobyException { if (dataTypesCache == null) @@ -350,15 +412,14 @@ } File[] list = dataTypesCache.listFiles(); if (list == null) - throw new MobyException ("Surprisingly, '" + dataTypesCache.getAbsolutePath() + "' is not a directory. Strange..."); + throw new MobyException (MSG_CACHE_NOT_DIR (dataTypesCache)); + for (int i = 0; i < list.length; i++) { try { - if (list[i].getPath().endsWith ("~")) - continue; // ignore some files + if (ignored (list[i])) continue; v.addElement (createDataTypeFromXML (load (list[i]), "-dummy-")); } catch (NoSuccessException e) { - System.err.println ("Ignoring '" + list[i].getPath() + "'. It should not be in the cache directory."); -// throw new MobyException (e.getMessage() + " (" + e.getCulprit() + ")"); + System.err.println (MSG_CACHE_BAD_FILE (list[i], e)); } } MobyDataType[] result = new MobyDataType [v.size()]; @@ -367,7 +428,28 @@ } } - // read all services + /************************************************************************* + * + *************************************************************************/ + public Map getServiceNamesByAuthority() + throws MobyException { + if (servicesCache == null) + return super.getServiceNamesByAuthority(); + synchronized (servicesCache) { + if (isCacheEmpty (servicesCache)) { + initCache(); + fillServicesCache(); + } + + // get a list file (with all service names) + String xmlList = getListFile (servicesCache); + return createServiceNamesByAuthorityFromXML (xmlList); + } + } + + /************************************************************************* + * + *************************************************************************/ public MobyService[] getServices() throws MobyException { if (servicesCache == null) @@ -380,13 +462,17 @@ } File[] list = servicesCache.listFiles(); if (list == null) - throw new MobyException ("Surprisingly, '" + servicesCache.getAbsolutePath() + "' is not a directory. Strange..."); + throw new MobyException (MSG_CACHE_NOT_DIR (servicesCache)); for (int i = 0; i < list.length; i++) { - if (list[i].getPath().endsWith ("~")) - continue; // ignore some files - MobyService[] servs = extractServices (load (list[i])); - for (int j = 0; j < servs.length; j++) - v.addElement (servs[j]); + try { + if (ignored (list[i])) continue; + MobyService[] servs = extractServices (load (list[i])); + for (int j = 0; j < servs.length; j++) { + v.addElement (servs[j]); + } + } catch (MobyException e) { + System.err.println (MSG_CACHE_BAD_FILE (list[i], e)); + } } MobyService[] result = new MobyService [v.size()]; v.copyInto (result); @@ -394,7 +480,10 @@ } } -// public MobyNamespace[] getNamespaces() + /************************************************************************* + * + *************************************************************************/ +// public MobyNamespace[] getNamespaces() //TBD: later, when API allows it public Map getNamespaces() throws MobyException { if (namespacesCache == null) @@ -404,23 +493,89 @@ initCache(); fillNamespacesCache(); } - File[] list = namespacesCache.listFiles(); - if (list == null) - throw new MobyException - ("Surprisingly, '" + namespacesCache.getAbsolutePath() + "' is not a directory. Strange..."); - for (int i = 0; i < list.length; i++) { + + // get a list file (with all namespaces) + String xmlList = getListFile (namespacesCache); + return createNamespacesFromXML (xmlList); + } + } + + /************************************************************************* + * + *************************************************************************/ + protected MobyServiceType[] readServiceTypes() + throws MobyException { + if (serviceTypesCache == null) + return super.readServiceTypes(); + synchronized (serviceTypesCache) { + if (isCacheEmpty (serviceTypesCache)) { + initCache(); + fillServiceTypesCache(); + } + + // get a list file (with all service type names) + String xmlList = getListFile (serviceTypesCache); + Map types = createServiceTypesFromXML (xmlList); + + // get individual (almost) full service types + Vector v = new Vector(); + for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String name = (String)entry.getKey(); + File file = new File (serviceTypesCache, name); try { - if (list[i].getPath().endsWith ("~")) - continue; // ignore some files - return createNamespacesFromXML (load (list[i])); + MobyServiceType serviceType = new MobyServiceType (name); + serviceType.setParentNames (createServiceTypeRelationshipsFromXML (load (file))); + serviceType.setDescription ((String)entry.getValue()); + v.addElement (serviceType); } catch (MobyException e) { - System.err.println ("Ignoring '" + list[i].getPath() + - "'. It should not be in the cache directory:" + - e.getMessage()); + System.err.println (MSG_CACHE_BAD_FILE (file, e)); } } + MobyServiceType[] result = new MobyServiceType [v.size()]; + v.copyInto (result); + return result; } - return null; + } + + /************************************************************************** + * + *************************************************************************/ + protected static String getListFile (File cache) + throws MobyException { + File listFile = new File (cache, LIST_FILE); + if (! listFile.exists()) + throw new MobyException ("Corrupted cache '" + cache + "': Missing a LIST file."); + return load (listFile); + } + + /************************************************************************** + * Some file (when being read from a cache directory) are ignored. + *************************************************************************/ + protected static boolean ignored (File file) { + String path = file.getPath(); + return + path.endsWith ("~") || + path.endsWith (LIST_FILE); + } + + /************************************************************************** + * + *************************************************************************/ + protected static String MSG_CACHE_NOT_DIR (File cache) { + return + "Surprisingly, '" + cache.getAbsolutePath() + + "' is not a directory. Strange..."; + } + + /************************************************************************** + * + *************************************************************************/ + protected static String MSG_CACHE_BAD_FILE (File file, Exception e) { + return + "Ignoring '" + file.getPath() + + "'. It should not be in the cache directory:" + + e.getMessage(); } /************************************************************************** @@ -434,7 +589,7 @@ /************************************************************************** * It always (again, if it functions as a cache which is when - * 'cacheDir' was given) reports that caching is disabled (even + * 'cacheDir' is given) reports that caching is disabled (even * though for the cumulative results is actually always enabled - * but that is obvious from the name of this class, isn't it?). **************************************************************************/ @@ -445,12 +600,28 @@ /************************************************************************** * Return age of the current (whole) cache in millis from the * beginning of the Epoch; or -1 if cache is empty, or the age is - * unknown. + * unknown.

            * - * The cache age is taken as the oldest (but filled) cache part. + * @return the cache age which is taken as the oldest (but filled) + * cache part (part is considered e.g. 'services', or 'data + * types', not their individual entities) **************************************************************************/ public long getCacheAge() { - return cacheAge; + try { + long dataTypesCacheAge = + (isCacheEmpty (dataTypesCache) ? Long.MAX_VALUE : dataTypesCache.lastModified()); + long servicesCacheAge = + (isCacheEmpty (servicesCache) ? Long.MAX_VALUE : servicesCache.lastModified()); + long namespacesCacheAge = + (isCacheEmpty (namespacesCache) ? Long.MAX_VALUE : namespacesCache.lastModified()); + long serviceTypesCacheAge = + (isCacheEmpty (serviceTypesCache) ? Long.MAX_VALUE : serviceTypesCache.lastModified()); + long age = Math.min (Math.min (dataTypesCacheAge, servicesCacheAge), + Math.min (namespacesCacheAge, serviceTypesCacheAge)); + return (age == Long.MAX_VALUE ? -1 : age); + } catch (MobyException e) { + return -1; + } } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/09/04 13:45:37 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestImpl.java 2005/09/22 16:07:09 1.5 @@ -11,6 +11,7 @@ import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; import org.biomoby.shared.MobyServiceType; +import org.biomoby.shared.MobyNamespace; import org.tulsoft.tools.debug.DGUtils; @@ -35,6 +36,7 @@ protected MobyDataType[] dataTypes = new MobyDataType[] {}; protected MobyServiceType[] serviceTypes = new MobyServiceType[] {}; protected MobyService[] services = new MobyService[] {}; + protected MobyNamespace[] namespaces = new MobyNamespace[] {}; /************************************************************************* @@ -101,7 +103,7 @@ String typeName = (String)entry.getKey(); messageLn ("(CDI) Processing service type " + typeName + "..."); MobyServiceType serviceType = new MobyServiceType (typeName); - serviceType.setDescription ((String)entry.getKey()); + serviceType.setDescription ((String)entry.getValue()); serviceType.setParentNames (getServiceTypeRelationships (typeName, false)); v.addElement (serviceType); } @@ -115,6 +117,36 @@ } /************************************************************************* + * Physically gather together all namespaces. It is not that hard + * (comparing to other Biomoby entities) because all namespaces + * are delivered by a single call to Biomoby. This method differs + * form the Central.getNamespaces() in the type of returned + * result, and - hopefully in the future - also in the amount of + * information stored in the returned value (but at the monent, + * because of a limitation of the Biomoby API, both result types + * contain the same information). + *************************************************************************/ + protected MobyNamespace[] readNamespaces() + throws MobyException { + try { + Map names = getNamespaces(); + MobyNamespace[] result = new MobyNamespace [ names.size() ]; + int i = 0; + for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String name = (String)entry.getKey(); + MobyNamespace ns = new MobyNamespace (name); + ns.setDescription ((String)entry.getValue()); + result[i++] = ns; + } + return result; + + } catch (Exception e) { + throw new MobyException (formatException (e)); + } + } + + /************************************************************************* * Physically gather together all service instances. *************************************************************************/ protected MobyService[] readServices() @@ -122,14 +154,17 @@ try { Vector v = new Vector(); messageLn ("(CDI) Asking for all service names..."); - Map names = getServiceNames(); - for (Iterator it = names.entrySet().iterator(); it.hasNext(); ) { + Map authorities = getServiceNamesByAuthority(); + for (Iterator it = authorities.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); - String name = (String)entry.getKey(); - messageLn ("(CDI) Processing service " + name + "..."); - MobyService[] servs = findService (new MobyService (name)); - for (int i = 0; i < servs.length; i++) - v.addElement (servs[i]); + String authority = (String)entry.getKey(); + String[] names = (String[])entry.getValue(); + for (int i = 0; i < names.length; i++) { + messageLn ("(CDI) Processing service " + names[i] + "..."); + MobyService[] servs = findService (new MobyService (names[i], authority)); + for (int j = 0; j < servs.length; j++) + v.addElement (servs[j]); + } } MobyService[] result = new MobyService [v.size()]; v.copyInto (result); @@ -227,6 +262,22 @@ /************************************************************************* * *************************************************************************/ + public MobyNamespace[] getFullNamespaces() + throws MobyException { + synchronized (namespaces) { + if (getCacheMode()) { + if (namespaces.length == 0) + namespaces = readNamespaces(); + return namespaces; + } else { + return readNamespaces(); + } + } + } + + /************************************************************************* + * + *************************************************************************/ public MobyService[] getServices() throws MobyException { synchronized (services) { @@ -240,7 +291,6 @@ } } - // Work in progress - implement the methods above by getting RDF // graphs in-one-go and parsing them. Actually ability to get such // graphs was the main motivation for this implementation, and for =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/19 08:08:32 1.26 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/22 16:07:09 1.27 @@ -23,6 +23,7 @@ import org.biomoby.shared.Utils; import org.biomoby.shared.MobyResourceRef; +import org.tulsoft.shared.UUtils; import org.tulsoft.tools.soap.axis.AxisUtils; import org.w3c.dom.Document; @@ -401,7 +402,7 @@ buf.append ("" + service.getType() + "\n"); String name = service.getName(); - if (!name.equals ("") && !name.equals ("dummy")) + if (!name.equals ("") && !name.equals ("dummy") && !name.equals (MobyService.DUMMY_NAME)) buf.append ("" + service.getName() + "\n"); buf.append ("" + service.getCategory() + "\n"); @@ -622,7 +623,7 @@ * further calls unless it is set to true again.

            * * @param shouldCache whether retrieveXXX call results should be - * cached in case they are called again (i.e. don't requery + * cached in case they are called again (i.e. don't request * MobyCentral every time) **************************************************************************/ public void setCacheMode (boolean shouldCache) { @@ -659,11 +660,6 @@ public Map getServiceNames() throws MobyException { - String cacheId = "retrieveServiceNames"; - Map cachedResults = (Map)getContents (cacheId); - if (cachedResults != null) - return cachedResults; - String result = (String)doCall ("retrieveServiceNames", new Object[] {}); @@ -683,9 +679,6 @@ elem.getAttribute ("authURI")); } - // Add this data to the cache in case we get called again - setContents (cacheId, results); - return results; } @@ -701,14 +694,20 @@ *************************************************************************/ public Map getServiceNamesByAuthority() throws MobyException { + String result = getServiceNamesByAuthorityAsXML(); + return createServiceNamesByAuthorityFromXML (result); + } - String cacheId = "retrieveServiceNamesByAuthority"; - Map cachedResults = (Map)getContents (cacheId); - if (cachedResults != null) - return cachedResults; + // + protected String getServiceNamesByAuthorityAsXML() + throws MobyException { + return (String)doCall ("retrieveServiceNames", + new Object[] {}); + } - String result = (String)doCall ("retrieveServiceNames", - new Object[] {}); + // + protected Map createServiceNamesByAuthorityFromXML (String result) + throws MobyException { // parse returned XML Map results = new HashMap(); @@ -738,9 +737,6 @@ entry.setValue (servNames); } - // Add this data to the cache in case we get called again - setContents (cacheId, results); - return results; } @@ -798,14 +794,20 @@ *************************************************************************/ public Map getServiceTypes() throws MobyException { + String result = getServiceTypesAsXML(); + return createServiceTypesFromXML (result); + } - String cacheId = "retrieveServiceTypes"; - Map cachedResults = (Map)getContents (cacheId); - if (cachedResults != null) - return cachedResults; + // + protected String getServiceTypesAsXML() + throws MobyException { + return (String)doCall ("retrieveServiceTypes", + new Object[] {}); + } - String result = (String)doCall ("retrieveServiceTypes", - new Object[] {}); + // + protected Map createServiceTypesFromXML (String result) + throws MobyException { // parse returned XML Map results = new HashMap(); @@ -826,10 +828,6 @@ } } } - - // Add this data to the cache in case we get called again - setContents (cacheId, results); - return results; } @@ -863,11 +861,6 @@ protected Map createNamespacesFromXML (String result) throws MobyException { - String cacheId = "retrieveNamespaces"; - Map cachedResults = (Map)getContents (cacheId); - if (cachedResults != null) - return cachedResults; - // parse returned XML Map results = new HashMap(); Document document = null; @@ -898,9 +891,6 @@ } } - // Add this data to the cache in case we get called again - setContents (cacheId, results); - return results; } @@ -918,14 +908,20 @@ *************************************************************************/ public Map getDataTypeNames() throws MobyException { + String result = getDataTypeNamesAsXML(); + return createDataTypeNamesFromXML (result); + } - String cacheId = "retrieveObjectNames"; - Map cachedResults = (Map)getContents (cacheId); - if (cachedResults != null) - return cachedResults; + // + protected String getDataTypeNamesAsXML() + throws MobyException { + return (String)doCall ("retrieveObjectNames", + new Object[] {}); + } - String result = (String)doCall ("retrieveObjectNames", - new Object[] {}); + // + protected Map createDataTypeNamesFromXML (String result) + throws MobyException { // parse returned XML Map results = new HashMap(); @@ -949,7 +945,6 @@ } } - setContents (cacheId, results); return results; } @@ -986,20 +981,12 @@ protected String getDataTypeAsXML (String dataTypeName) throws MobyException, NoSuccessException { - String cacheId = "retrieveObjectDefinition_" + dataTypeName; - String cachedResults = (String)getContents (cacheId); - if (cachedResults != null) - return cachedResults; - - String results = - (String)doCall ("retrieveObjectDefinition", - new Object[] { - "" + - "" + dataTypeName + "" + - "" - }); - setContents (cacheId, results); - return results; + return (String)doCall ("retrieveObjectDefinition", + new Object[] { + "" + + "" + dataTypeName + "" + + "" + }); } protected MobyDataType createDataTypeFromXML (String xmlSource, String dataTypeName) @@ -1475,13 +1462,15 @@ public String[] getServiceTypeRelationships (String serviceTypeName, boolean expand) throws MobyException { + String result = getServiceTypeRelationshipsAsXML (serviceTypeName, expand); + return createServiceTypeRelationshipsFromXML (result); + } - String cacheId = "Relationships_" + serviceTypeName + ":" + expand; - String[] cachedResults = (String[])getContents (cacheId); - if (cachedResults != null) - return cachedResults; - - String result = + // + protected String getServiceTypeRelationshipsAsXML (String serviceTypeName, + boolean expand) + throws MobyException { + return (String)doCall ("Relationships", new Object[] { "" + @@ -1490,6 +1479,11 @@ "" + (expand ? "1" : "0") + "" + "" }); + } + + // + protected String[] createServiceTypeRelationshipsFromXML (String result) + throws MobyException { // parse returned XML Vector v = new Vector(); @@ -1509,8 +1503,6 @@ } String[] results = new String [v.size()]; v.copyInto (results); - - setContents (cacheId, results); return results; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/09/04 13:45:37 1.11 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2005/09/22 16:07:09 1.12 @@ -275,10 +275,10 @@ // read some suggested defaults from the init parameters defaultEndpoint = (String)initParams.get (DEFAULT_ENDPOINT); - if (UUtils.isEmpty (defaultEndpoint)) + if ( UUtils.isEmpty (defaultEndpoint) || defaultEndpoint.equals ("\"\"") ) defaultEndpoint = CentralImpl.DEFAULT_ENDPOINT; defaultNamespace = (String)initParams.get (DEFAULT_NAMESPACE); - if (UUtils.isEmpty (defaultNamespace)) + if ( UUtils.isEmpty (defaultNamespace) || defaultNamespace.equals ("\"\"") ) defaultNamespace = CentralImpl.DEFAULT_NAMESPACE; registryCacheDir = (String)initParams.get (REGISTRY_CACHE_DIR); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java 2005/08/26 06:27:04 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServiceConnections.java 2005/09/22 16:07:09 1.7 @@ -244,7 +244,6 @@ // we need to remember all connections (edges) created for this output // because only after we finish with it we will find if the connections // are 'weak' or not (as described in ServicesEdge.isWeakConnection) - int startingFrom = v.size(); boolean headCollection = false; MobyPrimaryDataSimple output; From kawas at pub.open-bio.org Thu Sep 22 16:23:13 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Thu, 22 Sep 2005 12:23:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221623.j8MGNDlp017500@pub.open-bio.org> kawas Thu Sep 22 12:23:13 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi In directory pub.open-bio.org:/tmp/cvs-serv17475/Adaptor/moby/queryapi Modified Files: mysql.pm Log Message: added case sensitive servicename queries moby-live/Perl/MOBY/Adaptor/moby/queryapi mysql.pm,1.73,1.74 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/09/13 13:17:58 1.73 +++ /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/09/22 16:23:13 1.74 @@ -123,7 +123,12 @@ { if (defined $pair{$key}) { - $condition .= $key . " = ? "; + #added a check for servicename to support case sensitivity + if ($key eq "servicename") { + $condition .= $key . " LIKE binary ? "; + } else { + $condition .= $key . " = ? "; + } push(@bindvalues, $pair{$key}); } else @@ -621,6 +626,7 @@ } # pass servicename and authority_uri +# TODO added LIKE binary here sub query_service_existence { my ($self, %args) = @_; my $dbh = $self->dbh; @@ -643,7 +649,7 @@ description, signatureURL, lsid - from service_instance where servicename = ? and authority_id = ?"; + from service_instance where servicename LIKE binary ? and authority_id = ?"; my $final = do_query($dbh, $statement, ($servicename, $id)); if (@$final[0]){return 1} else {return 0} From gss at pub.open-bio.org Thu Sep 22 16:57:58 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:57:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvwEp017665@pub.open-bio.org> gss Thu Sep 22 12:57:58 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/graph/tools Removed Files: MOBYProviderTraverser.html package-summary.html package-tree.html package-use.html package-frame.html MOBYProviderVisitorAdapter.html MOBYProviderTraversalException.html MOBYProviderVisitor.html MOBYProviderXMLGenerator.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools MOBYProviderTraverser.html,1.1,NONE package-summary.html,1.1,NONE package-tree.html,1.1,NONE package-use.html,1.1,NONE package-frame.html,1.1,NONE MOBYProviderVisitorAdapter.html,1.1,NONE MOBYProviderTraversalException.html,1.1,NONE MOBYProviderVisitor.html,1.1,NONE MOBYProviderXMLGenerator.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/MOBYProviderTraverser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/MOBYProviderVisitorAdapter.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/MOBYProviderTraversalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/MOBYProviderVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/RCS/MOBYProviderXMLGenerator.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:57:58 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:57:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvwrW017685@pub.open-bio.org> gss Thu Sep 22 12:57:58 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/test Removed Files: package-summary.html package-use.html package-tree.html Test.html package-frame.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test package-summary.html,1.1,NONE package-use.html,1.1,NONE package-tree.html,1.1,NONE Test.html,1.1,NONE package-frame.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/RCS/Test.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/RCS/package-frame.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:57:58 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:57:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvw1u017739@pub.open-bio.org> gss Thu Sep 22 12:57:58 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/graph Removed Files: MOBYProviderSet.html MOBYProvider.html MOBYObject.html MOBYSingleElement.html package-tree.html MOBYPropertyValueException.html MOBYDocument.html MOBYCollection.html MOBYPropertyValueConstraint.html MOBYNonNegativeIntegerConstraint.html MOBYGraphNode.html MOBYResource.html package-summary.html MOBYPropertyValue.html MOBYLiteral.html package-frame.html MOBYPropertyValueStatement.html MOBYOrderedCollection.html MOBYGraphVisitor.html MOBYEnumeration.html MOBYNumericConstraint.html MOBYDateConstraint.html MOBYDescriptor.html MOBYOntology.html MOBYUnorderedCollection.html package-use.html MOBYNonPositiveIntegerConstraint.html MOBYResizableCollection.html MOBYSubject.html MOBYMappingElement.html MOBYIntegerConstraint.html MOBYGraph.html MOBYFixedCollection.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph MOBYProviderSet.html,1.1,NONE MOBYProvider.html,1.1,NONE MOBYObject.html,1.1,NONE MOBYSingleElement.html,1.1,NONE package-tree.html,1.1,NONE MOBYPropertyValueException.html,1.1,NONE MOBYDocument.html,1.1,NONE MOBYCollection.html,1.1,NONE MOBYPropertyValueConstraint.html,1.1,NONE MOBYNonNegativeIntegerConstraint.html,1.1,NONE MOBYGraphNode.html,1.1,NONE MOBYResource.html,1.1,NONE package-summary.html,1.1,NONE MOBYPropertyValue.html,1.1,NONE MOBYLiteral.html,1.1,NONE package-frame.html,1.1,NONE MOBYPropertyValueStatement.html,1.1,NONE MOBYOrderedCollection.html,1.1,NONE MOBYGraphVisitor.html,1.1,NONE MOBYEnumeration.html,1.1,NONE MOBYNumericConstraint.html,1.1,NONE MOBYDateConstraint.html,1.1,NONE MOBYDescriptor.html,1.1,NONE MOBYOntology.html,1.1,NONE MOBYUnorderedCollection.html,1.1,NONE package-use.html,1.1,NONE MOBYNonPositiveIntegerConstraint.html,1.1,NONE MOBYResizableCollection.! html,1.1,NONE MOBYSubject.html,1.1,NONE MOBYMappingElement.html,1.1,NONE MOBYIntegerConstraint.html,1.1,NONE MOBYGraph.html,1.1,NONE MOBYFixedCollection.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYProviderSet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYProvider.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYObject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYSingleElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYPropertyValueException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYDocument.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYPropertyValueConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYNonNegativeIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYGraphNode.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYResource.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYPropertyValue.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYLiteral.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYPropertyValueStatement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYOrderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYGraphVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYEnumeration.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYNumericConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYDateConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYDescriptor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYOntology.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYUnorderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYNonPositiveIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYResizableCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYSubject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYMappingElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYGraph.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/RCS/MOBYFixedCollection.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:57:59 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:57:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvxvq017815@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/parser/test Removed Files: package-use.html package-frame.html Test.html ParserTest.html package-tree.html package-summary.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test package-use.html,1.1,NONE package-frame.html,1.1,NONE Test.html,1.1,NONE ParserTest.html,1.1,NONE package-tree.html,1.1,NONE package-summary.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/Test.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/ParserTest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/RCS/package-summary.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:57:59 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:57:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvxIr017891@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/graph/class-use Removed Files: MOBYCollection.html MOBYResource.html MOBYResizableCollection.html MOBYPropertyValueException.html MOBYLiteral.html MOBYProvider.html MOBYObject.html MOBYGraph.html MOBYDateConstraint.html MOBYNumericConstraint.html MOBYNonPositiveIntegerConstraint.html MOBYNonNegativeIntegerConstraint.html MOBYFixedCollection.html MOBYPropertyValue.html MOBYDocument.html MOBYMappingElement.html MOBYPropertyValueStatement.html MOBYPropertyValueConstraint.html MOBYGraphVisitor.html MOBYProviderSet.html MOBYGraphNode.html MOBYEnumeration.html MOBYOrderedCollection.html MOBYIntegerConstraint.html MOBYSingleElement.html MOBYUnorderedCollection.html MOBYOntology.html MOBYDescriptor.html MOBYSubject.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use MOBYCollection.html,1.1,NONE MOBYResource.html,1.1,NONE MOBYResizableCollection.html,1.1,NONE MOBYPropertyValueException.html,1.1,NONE MOBYLiteral.html,1.1,NONE MOBYProvider.html,1.1,NONE MOBYObject.html,1.1,NONE MOBYGraph.html,1.1,NONE MOBYDateConstraint.html,1.1,NONE MOBYNumericConstraint.html,1.1,NONE MOBYNonPositiveIntegerConstraint.html,1.1,NONE MOBYNonNegativeIntegerConstraint.html,1.1,NONE MOBYFixedCollection.html,1.1,NONE MOBYPropertyValue.html,1.1,NONE MOBYDocument.html,1.1,NONE MOBYMappingElement.html,1.1,NONE MOBYPropertyValueStatement.html,1.1,NONE MOBYPropertyValueConstraint.html,1.1,NONE MOBYGraphVisitor.html,1.1,NONE MOBYProviderSet.html,1.1,NONE MOBYGraphNode.html,1.1,NONE MOBYEnumeration.html,1.1,NONE MOBYOrderedCollection.html,1.1,NONE MOBYIntegerConstraint.html,1.1,NONE MOBYSingleElement.html,1.1,NONE MOBYUnorderedCollection.html,1.1,NONE MOBYOntology.htm! l,1.1,NONE MOBYDescriptor.html,1.1,NONE MOBYSubject.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYResource.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYResizableCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYPropertyValueException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYLiteral.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYProvider.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYObject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYGraph.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYDateConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYNumericConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYNonPositiveIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYNonNegativeIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYFixedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYPropertyValue.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYDocument.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYMappingElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYPropertyValueStatement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYPropertyValueConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYGraphVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYProviderSet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYGraphNode.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYEnumeration.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYOrderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYSingleElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYUnorderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYOntology.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYDescriptor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/class-use/RCS/MOBYSubject.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:57:59 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:57:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvxfB017837@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/graph/tools/class-use Removed Files: MOBYProviderTraverser.html MOBYProviderTraversalException.html MOBYProviderVisitorAdapter.html MOBYProviderXMLGenerator.html MOBYProviderVisitor.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use MOBYProviderTraverser.html,1.1,NONE MOBYProviderTraversalException.html,1.1,NONE MOBYProviderVisitorAdapter.html,1.1,NONE MOBYProviderXMLGenerator.html,1.1,NONE MOBYProviderVisitor.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use/RCS/MOBYProviderTraverser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use/RCS/MOBYProviderTraversalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use/RCS/MOBYProviderVisitorAdapter.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use/RCS/MOBYProviderXMLGenerator.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/class-use/RCS/MOBYProviderVisitor.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:57:59 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:57:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvxBw017791@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/graph Removed Files: MOBYUnorderedCollection.html MOBYDocument.html MOBYLiteral.html MOBYObject.html MOBYSingleElement.html package-summary.html MOBYDescriptor.html MOBYResizableCollection.html MOBYSubject.html MOBYCollection.html package-frame.html MOBYIntegerConstraint.html MOBYGraphNode.html package-tree.html MOBYFixedCollection.html MOBYProviderSet.html MOBYProvider.html MOBYPropertyValue.html MOBYPropertyValueException.html MOBYPropertyValueStatement.html MOBYNonNegativeIntegerConstraint.html MOBYMappingElement.html MOBYGraphVisitor.html MOBYGraph.html MOBYOntology.html package-use.html MOBYNonPositiveIntegerConstraint.html MOBYResource.html MOBYDateConstraint.html MOBYNumericConstraint.html MOBYEnumeration.html MOBYPropertyValueConstraint.html MOBYOrderedCollection.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph MOBYUnorderedCollection.html,1.2,NONE MOBYDocument.html,1.2,NONE MOBYLiteral.html,1.2,NONE MOBYObject.html,1.2,NONE MOBYSingleElement.html,1.2,NONE package-summary.html,1.2,NONE MOBYDescriptor.html,1.2,NONE MOBYResizableCollection.html,1.2,NONE MOBYSubject.html,1.2,NONE MOBYCollection.html,1.2,NONE package-frame.html,1.2,NONE MOBYIntegerConstraint.html,1.1,NONE MOBYGraphNode.html,1.2,NONE package-tree.html,1.2,NONE MOBYFixedCollection.html,1.2,NONE MOBYProviderSet.html,1.2,NONE MOBYProvider.html,1.2,NONE MOBYPropertyValue.html,1.2,NONE MOBYPropertyValueException.html,1.2,NONE MOBYPropertyValueStatement.html,1.2,NONE MOBYNonNegativeIntegerConstraint.html,1.1,NONE MOBYMappingElement.html,1.2,NONE MOBYGraphVisitor.html,1.1,NONE MOBYGraph.html,1.2,NONE MOBYOntology.html,1.2,NONE package-use.html,1.2,NONE MOBYNonPositiveIntegerConstraint.html,1.1,NONE MOBYResource.html,1.2,NONE MOBYDateConstrain! t.html,1.1,NONE MOBYNumericConstraint.html,1.1,NONE MOBYEnumeration.html,1.2,NONE MOBYPropertyValueConstraint.html,1.2,NONE MOBYOrderedCollection.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYUnorderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYDocument.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYLiteral.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYObject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYSingleElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYDescriptor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYResizableCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYSubject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYGraphNode.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYFixedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYProviderSet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYProvider.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYPropertyValue.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYPropertyValueException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYPropertyValueStatement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYNonNegativeIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYMappingElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYGraphVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYGraph.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYOntology.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYNonPositiveIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYResource.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYDateConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYNumericConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYEnumeration.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYPropertyValueConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/RCS/MOBYOrderedCollection.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:57:59 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:57:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221657.j8MGvxaO017911@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/test Removed Files: package-tree.html package-use.html package-summary.html package-frame.html Test.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test package-tree.html,1.1,NONE package-use.html,1.1,NONE package-summary.html,1.1,NONE package-frame.html,1.1,NONE Test.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/RCS/Test.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0pX018075@pub.open-bio.org> gss Thu Sep 22 12:58:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/parser/class-use Removed Files: Parser.html UnparsableGraphException.html NonCanonicalException.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/class-use Parser.html,1.1,NONE UnparsableGraphException.html,1.1,NONE NonCanonicalException.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/class-use/RCS/Parser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/class-use/RCS/UnparsableGraphException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/class-use/RCS/NonCanonicalException.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0gg018056@pub.open-bio.org> gss Thu Sep 22 12:58:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/graph/class-use Removed Files: MOBYNonNegativeIntegerConstraint.html MOBYPropertyValue.html MOBYDocument.html MOBYSubject.html MOBYSingleElement.html MOBYGraphNode.html MOBYObject.html MOBYResizableCollection.html MOBYDateConstraint.html MOBYCollection.html MOBYProvider.html MOBYEnumeration.html MOBYGraphVisitor.html MOBYDescriptor.html MOBYNumericConstraint.html MOBYUnorderedCollection.html MOBYProviderSet.html MOBYPropertyValueStatement.html MOBYFixedCollection.html MOBYOntology.html MOBYLiteral.html MOBYResource.html MOBYIntegerConstraint.html MOBYGraph.html MOBYPropertyValueException.html MOBYOrderedCollection.html MOBYPropertyValueConstraint.html MOBYNonPositiveIntegerConstraint.html MOBYMappingElement.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use MOBYNonNegativeIntegerConstraint.html,1.1,NONE MOBYPropertyValue.html,1.2,NONE MOBYDocument.html,1.2,NONE MOBYSubject.html,1.2,NONE MOBYSingleElement.html,1.2,NONE MOBYGraphNode.html,1.2,NONE MOBYObject.html,1.2,NONE MOBYResizableCollection.html,1.2,NONE MOBYDateConstraint.html,1.1,NONE MOBYCollection.html,1.2,NONE MOBYProvider.html,1.2,NONE MOBYEnumeration.html,1.2,NONE MOBYGraphVisitor.html,1.1,NONE MOBYDescriptor.html,1.2,NONE MOBYNumericConstraint.html,1.1,NONE MOBYUnorderedCollection.html,1.2,NONE MOBYProviderSet.html,1.2,NONE MOBYPropertyValueStatement.html,1.2,NONE MOBYFixedCollection.html,1.2,NONE MOBYOntology.html,1.2,NONE MOBYLiteral.html,1.2,NONE MOBYResource.html,1.2,NONE MOBYIntegerConstraint.html,1.1,NONE MOBYGraph.html,1.2,NONE MOBYPropertyValueException.html,1.2,NONE MOBYOrderedCollection.html,1.2,NONE MOBYPropertyValueConstraint.html,1.2,NONE MOBYNonPositiveIntege! rConstraint.html,1.1,NONE MOBYMappingElement.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYNonNegativeIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYPropertyValue.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYDocument.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYSubject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYSingleElement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYGraphNode.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYObject.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYResizableCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYDateConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYProvider.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYEnumeration.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYGraphVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYDescriptor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYNumericConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYUnorderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYProviderSet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYPropertyValueStatement.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYFixedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYOntology.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYLiteral.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYResource.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYGraph.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYPropertyValueException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYOrderedCollection.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYPropertyValueConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYNonPositiveIntegerConstraint.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/class-use/RCS/MOBYMappingElement.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0E8017937@pub.open-bio.org> gss Thu Sep 22 12:57:59 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/parser Removed Files: package-tree.html NonCanonicalException.html package-use.html UnparsableGraphException.html package-frame.html Parser.html package-summary.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser package-tree.html,1.1,NONE NonCanonicalException.html,1.1,NONE package-use.html,1.1,NONE UnparsableGraphException.html,1.1,NONE package-frame.html,1.1,NONE Parser.html,1.1,NONE package-summary.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/NonCanonicalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/UnparsableGraphException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/Parser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/RCS/package-summary.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0JD017955@pub.open-bio.org> gss Thu Sep 22 12:58:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/servlet/class-use Removed Files: AbstractMobyServlet.html ParameterException.html ParamReader.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/class-use AbstractMobyServlet.html,1.2,NONE ParameterException.html,1.2,NONE ParamReader.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/class-use/RCS/AbstractMobyServlet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/class-use/RCS/ParameterException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/class-use/RCS/ParamReader.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0hI017981@pub.open-bio.org> gss Thu Sep 22 12:58:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/http Removed Files: HTTPResponse.html package-frame.html HTTPRequest.html package-use.html package-tree.html package-summary.html HTTPException.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http HTTPResponse.html,1.1,NONE package-frame.html,1.1,NONE HTTPRequest.html,1.1,NONE package-use.html,1.1,NONE package-tree.html,1.1,NONE package-summary.html,1.1,NONE HTTPException.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/HTTPResponse.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/HTTPRequest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/RCS/HTTPException.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw1p1018096@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/vocabulary Removed Files: package-tree.html MOBY.html package-use.html VocabularyDescription.html package-summary.html package-frame.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary package-tree.html,1.1,NONE MOBY.html,1.1,NONE package-use.html,1.1,NONE VocabularyDescription.html,1.1,NONE package-summary.html,1.1,NONE package-frame.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/MOBY.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/VocabularyDescription.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/RCS/package-frame.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw0Ui018007@pub.open-bio.org> gss Thu Sep 22 12:58:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/vocabulary Removed Files: MOBY.html VocabularyDescription.html package-use.html package-frame.html package-summary.html package-tree.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary MOBY.html,1.2,NONE VocabularyDescription.html,1.2,NONE package-use.html,1.2,NONE package-frame.html,1.2,NONE package-summary.html,1.2,NONE package-tree.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/MOBY.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/VocabularyDescription.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/RCS/package-tree.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw2GN018229@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/parser Removed Files: package-frame.html package-use.html NonCanonicalException.html package-tree.html package-summary.html Parser.html UnparsableGraphException.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser package-frame.html,1.2,NONE package-use.html,1.2,NONE NonCanonicalException.html,1.2,NONE package-tree.html,1.2,NONE package-summary.html,1.2,NONE Parser.html,1.2,NONE UnparsableGraphException.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/NonCanonicalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/Parser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/RCS/UnparsableGraphException.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw2Gm018254@pub.open-bio.org> gss Thu Sep 22 12:58:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/servlet Removed Files: ParameterException.html package-summary.html package-frame.html package-tree.html AbstractMobyServlet.html package-use.html ParamReader.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet ParameterException.html,1.2,NONE package-summary.html,1.2,NONE package-frame.html,1.2,NONE package-tree.html,1.2,NONE AbstractMobyServlet.html,1.2,NONE package-use.html,1.2,NONE ParamReader.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/ParameterException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/AbstractMobyServlet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/servlet/RCS/ParamReader.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5Ll018423@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/parser/class-use Removed Files: NonCanonicalException.html UnparsableGraphException.html Parser.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/class-use NonCanonicalException.html,1.2,NONE UnparsableGraphException.html,1.2,NONE Parser.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/class-use/RCS/NonCanonicalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/class-use/RCS/UnparsableGraphException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/class-use/RCS/Parser.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5Pw018515@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/http/class-use Removed Files: HTTPRequest.html HTTPException.html HTTPResponse.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/class-use HTTPRequest.html,1.1,NONE HTTPException.html,1.1,NONE HTTPResponse.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/class-use/RCS/HTTPRequest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/class-use/RCS/HTTPException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/http/class-use/RCS/HTTPResponse.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5Fl018401@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/graph/tools Removed Files: MOBYProviderTraverser.html package-frame.html package-use.html MOBYProviderTraversalException.html package-summary.html package-tree.html MOBYProviderVisitor.html MOBYProviderXMLGenerator.html MOBYProviderVisitorAdapter.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools MOBYProviderTraverser.html,1.1,NONE package-frame.html,1.1,NONE package-use.html,1.1,NONE MOBYProviderTraversalException.html,1.1,NONE package-summary.html,1.1,NONE package-tree.html,1.1,NONE MOBYProviderVisitor.html,1.1,NONE MOBYProviderXMLGenerator.html,1.1,NONE MOBYProviderVisitorAdapter.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/MOBYProviderTraverser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/MOBYProviderTraversalException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/MOBYProviderVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/MOBYProviderXMLGenerator.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/graph/tools/RCS/MOBYProviderVisitorAdapter.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw17l018182@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use Removed Files: MOBYProviderTraverser.html MOBYProviderXMLGenerator.html MOBYProviderVisitorAdapter.html MOBYProviderVisitor.html MOBYProviderTraversalException.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use MOBYProviderTraverser.html,1.1,NONE MOBYProviderXMLGenerator.html,1.1,NONE MOBYProviderVisitorAdapter.html,1.1,NONE MOBYProviderVisitor.html,1.1,NONE MOBYProviderTraversalException.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use/RCS/MOBYProviderTraverser.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use/RCS/MOBYProviderXMLGenerator.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use/RCS/MOBYProviderVisitorAdapter.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use/RCS/MOBYProviderVisitor.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/graph/tools/class-use/RCS/MOBYProviderTraversalException.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5Et018493@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/test/class-use Removed Files: Test.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/class-use Test.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/test/class-use/RCS/Test.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw10i018162@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/index-files Removed Files: index-10.html index-5.html index-18.html index-12.html index-16.html index-2.html index-17.html index-6.html index-3.html index-4.html index-15.html index-8.html index-13.html index-14.html index-1.html index-9.html index-11.html index-7.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files index-10.html,1.3,NONE index-5.html,1.3,NONE index-18.html,1.1,NONE index-12.html,1.3,NONE index-16.html,1.3,NONE index-2.html,1.3,NONE index-17.html,1.1,NONE index-6.html,1.3,NONE index-3.html,1.3,NONE index-4.html,1.3,NONE index-15.html,1.3,NONE index-8.html,1.3,NONE index-13.html,1.3,NONE index-14.html,1.3,NONE index-1.html,1.3,NONE index-9.html,1.3,NONE index-11.html,1.3,NONE index-7.html,1.3,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-10.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-5.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-18.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-12.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-16.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-2.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-17.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-6.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-3.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-4.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-15.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-8.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-13.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-14.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-1.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-9.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-11.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/index-files/RCS/index-7.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:06 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw6bw018575@pub.open-bio.org> gss Thu Sep 22 12:58:06 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/vocabulary/class-use Removed Files: VocabularyDescription.html MOBY.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/class-use VocabularyDescription.html,1.1,NONE MOBY.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/class-use/RCS/VocabularyDescription.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/vocabulary/class-use/RCS/MOBY.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 17:04:15 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:04:15 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221704.j8MH4FaV018766@pub.open-bio.org> gss Thu Sep 22 13:04:15 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF In directory pub.open-bio.org:/tmp/cvs-serv18741/WebRoot/WEB-INF Modified Files: .cvsignore Log Message: Also ignore lib directory; it is created by the war task in the build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF .cvsignore,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore 2005/03/21 21:42:01 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore 2005/09/22 17:04:15 1.3 @@ -1,2 +1,3 @@ classes smoby.properties +lib From gss at pub.open-bio.org Thu Sep 22 17:00:08 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:00:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221700.j8MH07RB018682@pub.open-bio.org> gss Thu Sep 22 13:00:07 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build In directory pub.open-bio.org:/tmp/cvs-serv18657/build Modified Files: .cvsignore Log Message: Don't put under CVS control the Javadoc that is generated by the core ant build script moby-live/S-MOBY/ref-impl/core/build .cvsignore,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/.cvsignore 2005/03/21 21:31:31 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/.cvsignore 2005/09/22 17:00:07 1.2 @@ -1 +1,2 @@ classes +javadoc From gss at pub.open-bio.org Thu Sep 22 17:01:24 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:01:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221701.j8MH1Ogg018725@pub.open-bio.org> gss Thu Sep 22 13:01:24 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build In directory pub.open-bio.org:/tmp/cvs-serv18700/build Modified Files: build.xml Log Message: Added Javadoc target & supporting classpath ref moby-live/S-MOBY/ref-impl/core/build build.xml,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/03/21 21:31:31 1.1 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/09/22 17:01:24 1.2 @@ -17,17 +17,22 @@ + + + + + + + + + + - - - - - - + @@ -38,6 +43,15 @@ filesonly="true"/> + + + + + + + + From gss at pub.open-bio.org Thu Sep 22 16:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw1Bf018121@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/http Removed Files: package-tree.html HTTPException.html package-frame.html HTTPResponse.html HTTPRequest.html package-summary.html package-use.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http package-tree.html,1.2,NONE HTTPException.html,1.2,NONE package-frame.html,1.2,NONE HTTPResponse.html,1.2,NONE HTTPRequest.html,1.2,NONE package-summary.html,1.2,NONE package-use.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/HTTPException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/HTTPResponse.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/HTTPRequest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/RCS/package-use.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:01 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw1uw018205@pub.open-bio.org> gss Thu Sep 22 12:58:01 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/parser/test Removed Files: package-use.html package-frame.html Test.html package-tree.html ParserTest.html package-summary.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test package-use.html,1.2,NONE package-frame.html,1.2,NONE Test.html,1.2,NONE package-tree.html,1.2,NONE ParserTest.html,1.2,NONE package-summary.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/Test.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/ParserTest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/RCS/package-summary.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw29e018275@pub.open-bio.org> gss Thu Sep 22 12:58:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use Removed Files: ParamReader.html AbstractMobyServlet.html ParameterException.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use ParamReader.html,1.1,NONE AbstractMobyServlet.html,1.1,NONE ParameterException.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use/RCS/ParamReader.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use/RCS/AbstractMobyServlet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/class-use/RCS/ParameterException.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw4W2018359@pub.open-bio.org> gss Thu Sep 22 12:58:04 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/parser/test/class-use Removed Files: Test.html ParserTest.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/class-use Test.html,1.1,NONE ParserTest.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/class-use/RCS/Test.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/parser/test/class-use/RCS/ParserTest.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw2oT018300@pub.open-bio.org> gss Thu Sep 22 12:58:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/tools Removed Files: package-use.html Util.html package-summary.html package-frame.html ModelRetriever.html package-tree.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools package-use.html,1.1,NONE Util.html,1.1,NONE package-summary.html,1.1,NONE package-frame.html,1.1,NONE ModelRetriever.html,1.1,NONE package-tree.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/Util.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/ModelRetriever.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/RCS/package-tree.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:02 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:02 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw21O018319@pub.open-bio.org> gss Thu Sep 22 12:58:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/tools/class-use Removed Files: ModelRetriever.html Util.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/class-use ModelRetriever.html,1.1,NONE Util.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/class-use/RCS/ModelRetriever.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/tools/class-use/RCS/Util.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw2rI018342@pub.open-bio.org> gss Thu Sep 22 12:58:02 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/tools Removed Files: package-use.html package-frame.html ModelRetriever.html Util.html package-summary.html package-tree.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools package-use.html,1.2,NONE package-frame.html,1.2,NONE ModelRetriever.html,1.1,NONE Util.html,1.2,NONE package-summary.html,1.2,NONE package-tree.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/package-use.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/ModelRetriever.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/Util.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/RCS/package-tree.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5ab018376@pub.open-bio.org> gss Thu Sep 22 12:58:04 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/parser/test/class-use Removed Files: ParserTest.html Test.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/class-use ParserTest.html,1.2,NONE Test.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/class-use/RCS/ParserTest.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/parser/test/class-use/RCS/Test.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw56g018443@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/http/class-use Removed Files: HTTPResponse.html HTTPException.html HTTPRequest.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/class-use HTTPResponse.html,1.2,NONE HTTPException.html,1.2,NONE HTTPRequest.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/class-use/RCS/HTTPResponse.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/class-use/RCS/HTTPException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/http/class-use/RCS/HTTPRequest.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:05 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw5HV018474@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/semanticmoby/servlet Removed Files: AbstractMobyServlet.html package-summary.html package-tree.html ParameterException.html ParamReader.html package-frame.html package-use.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet AbstractMobyServlet.html,1.1,NONE package-summary.html,1.1,NONE package-tree.html,1.1,NONE ParameterException.html,1.1,NONE ParamReader.html,1.1,NONE package-frame.html,1.1,NONE package-use.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/AbstractMobyServlet.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/package-summary.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/package-tree.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/ParameterException.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/ParamReader.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/package-frame.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/semanticmoby/servlet/RCS/package-use.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:06 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw6QF018534@pub.open-bio.org> gss Thu Sep 22 12:58:05 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/vocabulary/class-use Removed Files: VocabularyDescription.html MOBY.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/class-use VocabularyDescription.html,1.2,NONE MOBY.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/class-use/RCS/VocabularyDescription.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/vocabulary/class-use/RCS/MOBY.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:06 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw6Qc018554@pub.open-bio.org> gss Thu Sep 22 12:58:06 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/tools/class-use Removed Files: ModelRetriever.html Util.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/class-use ModelRetriever.html,1.1,NONE Util.html,1.2,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/class-use/RCS/ModelRetriever.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/tools/class-use/RCS/Util.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:06 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw6gV018592@pub.open-bio.org> gss Thu Sep 22 12:58:06 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/class-use In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/org/smoby/test/class-use Removed Files: Test.html Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/class-use Test.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/org/smoby/test/class-use/RCS/Test.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 16:58:06 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 12:58:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221658.j8MGw66B018610@pub.open-bio.org> gss Thu Sep 22 12:58:06 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/resources In directory pub.open-bio.org:/tmp/cvs-serv17635/WebRoot/developer/java-api/resources Removed Files: inherit.gif Log Message: Removed javadoc files; these will be generated by the semanticmoby.org ant build script moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/resources inherit.gif,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/developer/java-api/resources/RCS/inherit.gif,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 17:36:48 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:36:48 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221736.j8MHamZt018858@pub.open-bio.org> gss Thu Sep 22 13:36:48 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools In directory pub.open-bio.org:/tmp/cvs-serv18834/archive/WebRoot/tools Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools added to the repository moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 17:36:50 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:36:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221736.j8MHaoeN018893@pub.open-bio.org> gss Thu Sep 22 13:36:50 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save In directory pub.open-bio.org:/tmp/cvs-serv18871/WebRoot/save Removed Files: index.html Log Message: Moved potentially useful stuff that isn't needed now to the archive directory moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save index.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save/RCS/index.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 17:36:50 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:36:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221736.j8MHaoG5018908@pub.open-bio.org> gss Thu Sep 22 13:36:50 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools In directory pub.open-bio.org:/tmp/cvs-serv18871/archive/WebRoot/tools Added Files: client.html index.html Log Message: Moved potentially useful stuff that isn't needed now to the archive directory moby-live/S-MOBY/ref-impl/semanticmoby.org/archive/WebRoot/tools client.html,NONE,1.1 index.html,NONE,1.1 From gss at pub.open-bio.org Thu Sep 22 17:37:11 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:37:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221737.j8MHbBVH018960@pub.open-bio.org> gss Thu Sep 22 13:37:11 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build In directory pub.open-bio.org:/tmp/cvs-serv18935/build Modified Files: build.xml Log Message: Misc fixes moby-live/S-MOBY/ref-impl/semanticmoby.org/build build.xml,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/09/21 23:08:04 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/09/22 17:37:11 1.3 @@ -55,8 +55,23 @@ + + + + + The file smoby.properties is missing from the WebRoot/WEB-INF + directory. The file smoby.example.properties should be copied + to smoby.properties, which should then be modified to include + appropriate values for database connections, etc. + + + - + - + - + + + + + @@ -86,9 +105,10 @@ - + + From gss at pub.open-bio.org Thu Sep 22 17:37:19 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:37:19 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221737.j8MHbJti018990@pub.open-bio.org> gss Thu Sep 22 13:37:19 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build In directory pub.open-bio.org:/tmp/cvs-serv18965/build Modified Files: build.xml Log Message: Misc fixes moby-live/S-MOBY/ref-impl/core/build build.xml,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/09/22 17:01:24 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/core/build/build.xml 2005/09/22 17:37:19 1.3 @@ -54,7 +54,8 @@ - + + From gss at pub.open-bio.org Thu Sep 22 17:36:50 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:36:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221736.j8MHaoEr018925@pub.open-bio.org> gss Thu Sep 22 13:36:50 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save/tools In directory pub.open-bio.org:/tmp/cvs-serv18871/WebRoot/save/tools Removed Files: client.html Log Message: Moved potentially useful stuff that isn't needed now to the archive directory moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save/tools client.html,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/save/tools/RCS/client.html,v: No such file or directory From gss at pub.open-bio.org Thu Sep 22 17:44:13 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Thu, 22 Sep 2005 13:44:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509221744.j8MHiDnd019075@pub.open-bio.org> gss Thu Sep 22 13:44:13 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl In directory pub.open-bio.org:/tmp/cvs-serv19048/S-MOBY/ref-impl Removed Files: .cvsignore INSTALL.html build.xml common.example.properties common.xml servlet.xml Log Message: Removed some files that are no longer needed moby-live/S-MOBY/ref-impl .cvsignore,1.1,NONE INSTALL.html,1.2,NONE build.xml,1.2,NONE common.example.properties,1.1,NONE common.xml,1.2,NONE servlet.xml,1.1,NONE rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/.cvsignore,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/INSTALL.html,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/build.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/common.example.properties,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/common.xml,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/RCS/servlet.xml,v: No such file or directory From senger at pub.open-bio.org Sat Sep 24 17:41:16 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:41:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241741.j8OHfGD8030416@pub.open-bio.org> senger Sat Sep 24 13:41:16 EDT 2005 Update of /home/repository/moby/jars-archive/current In directory pub.open-bio.org:/tmp/cvs-serv30397 Modified Files: alltools2.jar Log Message: jars-archive/current alltools2.jar,1.6,1.7 =================================================================== RCS file: /home/repository/moby/jars-archive/current/alltools2.jar,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 Binary files /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/18 13:02:35 1.6 and /home/repository/moby/jars-archive/current/alltools2.jar 2005/09/24 17:41:16 1.7 differ rcsdiff: /home/repository/moby/jars-archive/current/alltools2.jar: diff failed From senger at pub.open-bio.org Sat Sep 24 17:51:51 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:51:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpplv030732@pub.open-bio.org> senger Sat Sep 24 13:51:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv30711/docs Modified Files: ChangeLog Log Message: moby-live/Java/docs ChangeLog,1.43,1.44 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/22 16:07:08 1.43 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2005/09/24 17:51:51 1.44 @@ -1,3 +1,8 @@ +2005-09-24 Martin Senger + + * Added sorting to the most of the returned results from + CentralImpl. + 2005-09-23 Martin Senger * Add a new method getFullNamespaces() to CentralDigest interface. From senger at pub.open-bio.org Sat Sep 24 17:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:51:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpqxq030843@pub.open-bio.org> senger Sat Sep 24 13:51:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory pub.open-bio.org:/tmp/cvs-serv30711/src/main/org/biomoby/service/dashboard/images Added Files: resetButton.gif viewerButton.gif Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard/images resetButton.gif,NONE,1.1 viewerButton.gif,NONE,1.1 From senger at pub.open-bio.org Sat Sep 24 17:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:51:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpqoF030888@pub.open-bio.org> senger Sat Sep 24 13:51:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv30711/src/main/org/biomoby/shared Modified Files: MobyDataType.java Log Message: moby-live/Java/src/main/org/biomoby/shared MobyDataType.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/09/22 16:07:09 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyDataType.java 2005/09/24 17:51:52 1.9 @@ -24,7 +24,14 @@ * @version $Id$ */ -public class MobyDataType { +public class MobyDataType implements Comparable { + + public int compareTo (Object obj) { + return name.compareToIgnoreCase ( ((MobyDataType)obj).getName() ); + } + public boolean equals (Object obj) { + return name.equals ( ((MobyDataType)obj).getName() ); + } protected String name; protected String authority = ""; From senger at pub.open-bio.org Sat Sep 24 17:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:51:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpqCb030910@pub.open-bio.org> senger Sat Sep 24 13:51:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/xmls In directory pub.open-bio.org:/tmp/cvs-serv30711/xmls Modified Files: libraries.xml Log Message: moby-live/Java/xmls libraries.xml,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/libraries.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/09/04 13:45:38 1.4 +++ /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/09/24 17:51:52 1.5 @@ -109,7 +109,7 @@ - + From senger at pub.open-bio.org Sat Sep 24 17:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:51:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpqYB030862@pub.open-bio.org> senger Sat Sep 24 13:51:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator In directory pub.open-bio.org:/tmp/cvs-serv30711/src/main/org/biomoby/service/generator Modified Files: DataTypesGenerator.java Log Message: moby-live/Java/src/main/org/biomoby/service/generator DataTypesGenerator.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/DataTypesGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/DataTypesGenerator.java 2005/08/26 06:40:53 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/generator/DataTypesGenerator.java 2005/09/24 17:51:52 1.2 @@ -437,7 +437,7 @@ * primary concern, that's why it does not throw any exception if * it fails). * - * Put an client-side-image map (HTML hyperlinks) into + * Put a client-side-image map (HTML hyperlinks) into * 'spaceForImageMap' (if you decide to create it). * * Return true if an image file was successfull created (so other @@ -496,7 +496,7 @@ /************************************************************************* * Return true if 'dataTypeName' is a Biomoby primitive type. *************************************************************************/ - protected static boolean isPrimitiveType (String dataTypeName) { + public static boolean isPrimitiveType (String dataTypeName) { return (dataTypeName.equals (MobyTags.MOBYSTRING) || dataTypeName.equals (MobyTags.MOBYINTEGER) || dataTypeName.equals (MobyTags.MOBYFLOAT) || From senger at pub.open-bio.org Sat Sep 24 17:54:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:54:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241754.j8OHsbpP031039@pub.open-bio.org> senger Sat Sep 24 13:54:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/lib In directory pub.open-bio.org:/tmp/cvs-serv31023/lib Removed Files: alltools2.jar Log Message: moby-live/Java/lib alltools2.jar,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Java/lib/RCS/alltools2.jar,v: No such file or directory From senger at pub.open-bio.org Sat Sep 24 17:54:37 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:54:37 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241754.j8OHsb6r031054@pub.open-bio.org> senger Sat Sep 24 13:54:37 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv31023/src/main/org/biomoby/service/dashboard Added Files: AbstractModel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard AbstractModel.java,NONE,1.1 From senger at pub.open-bio.org Sat Sep 24 17:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:51:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHppJ8030770@pub.open-bio.org> senger Sat Sep 24 13:51:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv30711/src/main/org/biomoby/client Modified Files: CentralDigestCachedImpl.java CentralImpl.java Log Message: moby-live/Java/src/main/org/biomoby/client CentralDigestCachedImpl.java,1.7,1.8 CentralImpl.java,1.27,1.28 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/22 16:07:08 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java 2005/09/24 17:51:51 1.8 @@ -16,6 +16,8 @@ import java.util.Iterator; import java.util.Map; import java.util.Vector; +import java.util.Arrays; +import java.util.Comparator; import org.biomoby.shared.CentralAll; import org.biomoby.shared.MobyDataType; @@ -413,6 +415,7 @@ File[] list = dataTypesCache.listFiles(); if (list == null) throw new MobyException (MSG_CACHE_NOT_DIR (dataTypesCache)); + Arrays.sort (list, getFileComparator()); for (int i = 0; i < list.length; i++) { try { @@ -463,6 +466,7 @@ File[] list = servicesCache.listFiles(); if (list == null) throw new MobyException (MSG_CACHE_NOT_DIR (servicesCache)); + Arrays.sort (list, getFileComparator()); for (int i = 0; i < list.length; i++) { try { if (ignored (list[i])) continue; @@ -550,6 +554,17 @@ } /************************************************************************** + * Return a comparator for Files that compares in case-insensitive way. + *************************************************************************/ + protected static Comparator getFileComparator() { + return new Comparator() { + public int compare (Object o1, Object o2) { + return o1.toString().compareToIgnoreCase (o2.toString()); + } + }; + } + + /************************************************************************** * Some file (when being read from a cache directory) are ignored. *************************************************************************/ protected static boolean ignored (File file) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/22 16:07:09 1.27 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2005/09/24 17:51:51 1.28 @@ -49,6 +49,8 @@ import java.util.Map; import java.util.Properties; import java.util.Vector; +import java.util.TreeMap; +import java.util.Comparator; /** * A default implementation of the @@ -664,7 +666,7 @@ new Object[] {}); // parse returned XML - Map results = new HashMap(); + Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse(new ByteArrayInputStream(result.getBytes())); @@ -710,7 +712,7 @@ throws MobyException { // parse returned XML - Map results = new HashMap(); + Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse (new ByteArrayInputStream (result.getBytes())); @@ -810,7 +812,7 @@ throws MobyException { // parse returned XML - Map results = new HashMap(); + Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse(new ByteArrayInputStream(result.getBytes()));} @@ -862,7 +864,7 @@ throws MobyException { // parse returned XML - Map results = new HashMap(); + Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse(new ByteArrayInputStream(result.getBytes())); @@ -924,7 +926,7 @@ throws MobyException { // parse returned XML - Map results = new HashMap(); + Map results = new TreeMap (getStringComparator()); Document document = null; try { document = docBuilder.parse(new ByteArrayInputStream(result.getBytes())); @@ -944,7 +946,6 @@ } } } - return results; } @@ -1711,4 +1712,16 @@ } throw new MobyException ("No resource found for '" + resourceName + "'."); } + + /************************************************************************** + * Return a case-insensitive comparator of Strings. It is used to + * create various TreeMaps where keys are strings. + *************************************************************************/ + protected static Comparator getStringComparator() { + return new Comparator() { + public int compare (Object o1, Object o2) { + return ((String)o1).compareToIgnoreCase ((String)o2); + } + }; + } } From senger at pub.open-bio.org Sat Sep 24 17:57:06 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:57:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241757.j8OHv6ue031183@pub.open-bio.org> senger Sat Sep 24 13:57:06 EDT 2005 Update of /home/repository/moby/moby-live/Java/xmls In directory pub.open-bio.org:/tmp/cvs-serv31163/xmls Modified Files: libraries.xml Log Message: moby-live/Java/xmls libraries.xml,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/libraries.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/09/24 17:51:52 1.5 +++ /home/repository/moby/moby-live/Java/xmls/libraries.xml 2005/09/24 17:57:06 1.6 @@ -109,7 +109,7 @@ - + From senger at pub.open-bio.org Sat Sep 24 17:51:51 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:51:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHppc6030747@pub.open-bio.org> senger Sat Sep 24 13:51:51 EDT 2005 Update of /home/repository/moby/moby-live/Java/lib In directory pub.open-bio.org:/tmp/cvs-serv30711/lib Added Files: alltools2.jar Log Message: moby-live/Java/lib alltools2.jar,NONE,1.1 From senger at pub.open-bio.org Sun Sep 25 09:07:22 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 25 Sep 2005 05:07:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509250907.j8P97M6n011318@pub.open-bio.org> senger Sun Sep 25 05:07:22 EDT 2005 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv11299 Modified Files: build.xml Log Message: moby-live/Java build.xml,1.37,1.38 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- /home/repository/moby/moby-live/Java/build.xml 2005/09/22 09:47:43 1.37 +++ /home/repository/moby/moby-live/Java/build.xml 2005/09/25 09:07:22 1.38 @@ -112,9 +112,11 @@ + @@ -690,6 +692,7 @@ Targets for local deployment are: deploy-services tomcat-populate + -populate deploy-wsdd -find-services create-wsdd @@ -697,7 +700,7 @@ undeploy-services (TBD: does not work) Targets for remote deployment are: - TBD + deploy-remote --> @@ -922,8 +925,8 @@ - + @@ -994,7 +997,7 @@ - + @@ -1293,7 +1296,7 @@ - + @@ -1350,7 +1353,7 @@ - + From senger at pub.open-bio.org Sun Sep 25 09:07:23 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 25 Sep 2005 05:07:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509250907.j8P97NLY011365@pub.open-bio.org> senger Sun Sep 25 05:07:22 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv11299/src/webapps Modified Files: remote.deploy.build.xml.template Log Message: moby-live/Java/src/webapps remote.deploy.build.xml.template,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/webapps/remote.deploy.build.xml.template,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/webapps/remote.deploy.build.xml.template 2005/09/22 07:55:44 1.1 +++ /home/repository/moby/moby-live/Java/src/webapps/remote.deploy.build.xml.template 2005/09/25 09:07:22 1.2 @@ -23,6 +23,7 @@ + @@ -183,7 +184,7 @@ - + From senger at pub.open-bio.org Sun Sep 25 09:07:22 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sun, 25 Sep 2005 05:07:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509250907.j8P97MGQ011345@pub.open-bio.org> senger Sun Sep 25 05:07:22 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv11299/src/main/org/biomoby/service/dashboard Modified Files: NOTES RegistryModel.java RegistryPanel.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard NOTES,1.6,1.7 RegistryModel.java,1.2,1.3 RegistryPanel.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/24 17:51:51 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/25 09:07:22 1.7 @@ -105,6 +105,24 @@ * general Console panel (save button; various renderes?) * graphics to trees +--- +To put this somewhere (a small "Memory panel" that can be add +anywhere in time of debugging...): + +The heap is the area in memory in which objects are created. + + // Get current size of heap in bytes + long heapSize = Runtime.getRuntime().totalMemory(); + + // Get maximum size of heap in bytes. The heap cannot grow beyond this size. + // Any attempt will result in an OutOfMemoryException. + long heapMaxSize = Runtime.getRuntime().maxMemory(); + + // Get amount of free memory within the heap in bytes. This size will increase + // after garbage collection and decrease as new objects are created. + long heapFreeSize = Runtime.getRuntime().freeMemory(); + +--- TODO generally: --------------- =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/09/24 17:51:51 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/09/25 09:07:22 1.3 @@ -19,6 +19,7 @@ import java.util.HashSet; import java.util.Hashtable; +import java.util.Comparator; import java.util.regex.Pattern; /** @@ -61,6 +62,30 @@ initWorker(); MobyDataType[] dataTypes = worker.getDataTypes(); + java.util.Arrays.sort (dataTypes); + return dataTypes; + } + + /********************************************************************* + * + ********************************************************************/ + public MobyDataType[] getDataTypesByAuthority() + throws MobyException { + + if (worker == null) + initWorker(); + + MobyDataType[] dataTypes = worker.getDataTypes(); + java.util.Arrays.sort + (dataTypes, + new Comparator() { + public int compare (Object o1, Object o2) { + String a1 = ((MobyDataType)o1).getAuthority(); + String a2 = ((MobyDataType)o2).getAuthority(); + return (a1).compareToIgnoreCase ((String)a2); + } + }); + return dataTypes; } @@ -102,21 +127,6 @@ return found; } - -// /********************************************************************* -// * -// ********************************************************************/ -// public MobyDataType[] getDataTypesByAuthority() -// throws MobyException { - -// if (worker == null) -// initWorker(); - -// MobyDataType[] dataTypes = worker.getDataTypes(); -// java.util.Arrays.sort (dataTypes); -// return dataTypes; -// } - /********************************************************************* * ********************************************************************/ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/24 17:51:51 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/25 09:07:22 1.8 @@ -301,35 +301,6 @@ /************************************************************************** * **************************************************************************/ -// protected JPanel getConsole() { -// JPanel p = new JPanel (new GridBagLayout()); - -// JTextArea textArea = new JTextArea(); -// textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); -// textArea.setEditable (false); -// JScrollPane scroller = new JScrollPane (textArea); - -// JButton cleanButton = -// createButton (" Clean ", -// "Remove all messages from the console area", -// KeyEvent.VK_C, -// new ActionListener() { -// public void actionPerformed (ActionEvent e) { -// if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) -// textArea.setText (""); -// } -// }); - -// // put it together -// SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); -// // SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); - -// return p; -// } - - /************************************************************************** - * - **************************************************************************/ class ServicesTree extends CommonTree { public ServicesTree() { super ("Services"); @@ -398,7 +369,10 @@ final SwingWorker worker = new SwingWorker() { public Object construct() { try { - dataTypes = registryModel.getDataTypesByNames(); + if (sorted == SORTED_BY_AUTHORITY) + dataTypes = registryModel.getDataTypesByAuthority(); + else + dataTypes = registryModel.getDataTypesByNames(); } catch (MobyException e) { // TBD: what to do here? System.err.println ("ERROR: " + e.getMessage()); From gss at pub.open-bio.org Sun Sep 25 19:17:00 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun, 25 Sep 2005 15:17:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251917.j8PJH0dx013037@pub.open-bio.org> gss Sun Sep 25 15:17:00 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build In directory pub.open-bio.org:/tmp/cvs-serv13012/build Modified Files: build.xml Log Message: Make sure WEB-INF/lib/*.jar gets added to war file moby-live/S-MOBY/ref-impl/semanticmoby.org/build build.xml,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/09/22 17:37:11 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/build/build.xml 2005/09/25 19:17:00 1.4 @@ -86,6 +86,11 @@ + + + + + From gss at pub.open-bio.org Sun Sep 25 19:17:29 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun, 25 Sep 2005 15:17:29 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251917.j8PJHTF7013072@pub.open-bio.org> gss Sun Sep 25 15:17:28 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello In directory pub.open-bio.org:/tmp/cvs-serv13043/WebRoot/examples/hello Modified Files: hello-world.rdf hello-world.n3 Log Message: Changed references to MOBYProvider to MOBYService moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello hello-world.rdf,1.3,1.4 hello-world.n3,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.rdf,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.rdf 2004/11/04 22:28:02 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.rdf 2005/09/25 19:17:28 1.4 @@ -6,24 +6,24 @@ xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > + + + + - - http://www.semanticmoby.org/examples/display-hello-world-results + - Simple example of a Semantic MOBY provider - Semantic MOBY Hello World provider + Simple example of a Semantic MOBY provider + http://www.semanticmoby.org/examples/display-hello-world-results + - - - - - + - + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.n3,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.n3 2004/11/04 22:28:02 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/hello/hello-world.n3 2005/09/25 19:17:28 1.4 @@ -7,7 +7,7 @@ @prefix xsd: . ex:hello-world - a moby:Provider, exterms:GreetingProvider ; + a moby:Service, exterms:GreetingProvider ; moby:name "Semantic MOBY Hello World provider" ; moby:oneLineDescription "Simple example of a Semantic MOBY provider" ; moby:outputURI "http://www.semanticmoby.org/examples/display-hello-world-results" ; From gss at pub.open-bio.org Sun Sep 25 19:17:58 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun, 25 Sep 2005 15:17:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251917.j8PJHwma013162@pub.open-bio.org> gss Sun Sep 25 15:17:58 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies In directory pub.open-bio.org:/tmp/cvs-serv13077/WebRoot/examples/proxies Modified Files: wormbase-query tair-seqviewer flybase-genequery ncbi-megablast.n3 gramene-query.n3 sgd-quicksearch.n3 tair-seqviewer.n3 tair-mapviewer tair-mapviewer.n3 pubmed ncbi-megablast sgd-quicksearch pubmed.n3 gramene-query wormbase-query.n3 flybase-genequery.n3 Log Message: Changed references to MOBYProvider to MOBYService moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies wormbase-query,1.2,1.3 tair-seqviewer,1.3,1.4 flybase-genequery,1.2,1.3 ncbi-megablast.n3,1.2,1.3 gramene-query.n3,1.2,1.3 sgd-quicksearch.n3,1.3,1.4 tair-seqviewer.n3,1.3,1.4 tair-mapviewer,1.2,1.3 tair-mapviewer.n3,1.2,1.3 pubmed,1.2,1.3 ncbi-megablast,1.2,1.3 sgd-quicksearch,1.3,1.4 pubmed.n3,1.2,1.3 gramene-query,1.2,1.3 wormbase-query.n3,1.2,1.3 flybase-genequery.n3,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query 2005/09/25 19:17:58 1.3 @@ -10,20 +10,20 @@ - - - C. elegans database query at wormbase.org - http://www.wormbase.org/ - - - WormBase Query - + + - - + + + + + WormBase Query + C. elegans database query at wormbase.org + http://www.wormbase.org/ + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer 2005/05/05 17:35:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer 2005/09/25 19:17:58 1.4 @@ -9,21 +9,21 @@ + + + + - + + + TAIR Sequence Viewer Arabidopsis Sequence Viewer service provided by TAIR - - - http://www.arabidopsis.org/servlets/sv - - - - + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > - + =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast.n3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast.n3 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast.n3 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ @prefix xsd: . ex:ncbi-megablast - a moby:Provider, exterms:ProxyProvider, exterms:BlastProvider ; + a moby:Service, exterms:ProxyProvider, exterms:BlastProvider ; moby:name "NCBI Mega BLAST" ; moby:oneLineDescription "NCBI MegaBlast service provided by NCBI" ; moby:inputURI "http://www.ncbi.nlm.nih.gov/BLAST/Blast.cgi?CMD=Web&LAYOUT=TwoWindows&AUTO_FORMAT=Semiauto&ALIGNMENTS=50&ALIGNMENT_VIEW=Tabular&CLIENT=web&DATABASE=nr&DESCRIPTIONS=100&ENTREZ_QUERY=%28none%29&EXPECT=10&FILTER=L&FORMAT_OBJECT=Alignment&FORMAT_TYPE=HTML&NCBI_GI=on&PAGE=MegaBlast&SERVICE=plain&SET_DEFAULTS.x=34&SET_DEFAULTS.y=8&SHOW_OVERVIEW=on&END_OF_HTTPGET=Yes&SHOW_LINKOUT=yes&GET_SEQUENCE=yes&PERC_IDENT=None,1,-2" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query.n3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query.n3 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query.n3 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ @prefix xsd: . ex:gramene-query - a moby:Provider, exterms:ProxyProvider, exterms:CerealGrainSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:CerealGrainSearchProvider ; moby:name "Gramene Query" ; moby:oneLineDescription "Cereal grains database query at gramene.org" ; moby:inputURI "http://www.gramene.org/" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch.n3,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch.n3 2005/05/05 17:35:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch.n3 2005/09/25 19:17:58 1.4 @@ -7,7 +7,7 @@ @prefix xsd: . ex:sgd-quicksearch - a moby:Provider, exterms:ProxyProvider, exterms:SacchromycesSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:SacchromycesSearchProvider ; moby:name "SGD Quick Search" ; moby:oneLineDescription "Saccharomyces cerevisiae quick search" ; moby:inputURI "http://db.yeastgenome.org/cgi-bin/search/quickSearch" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer.n3,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer.n3 2005/05/05 17:35:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-seqviewer.n3 2005/09/25 19:17:58 1.4 @@ -7,7 +7,7 @@ @prefix xsd: . ex:tair-seqviewer - a moby:Provider, exterms:ProxyProvider, exterms:ArabidopsisSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:ArabidopsisSearchProvider ; moby:name "TAIR Sequence Viewer" ; moby:oneLineDescription "Arabidopsis Sequence Viewer service provided by TAIR" ; moby:inputURI "http://www.arabidopsis.org/servlets/sv" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer 2005/09/25 19:17:58 1.3 @@ -7,22 +7,22 @@ xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > - http://www.arabidopsis.org/servlets/mapper - + + + TAIR Map Viewer Arabidopsis Map Viewer service provided by TAIR + http://www.arabidopsis.org/servlets/mapper - - + + + + - - - - =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer.n3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer.n3 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/tair-mapviewer.n3 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ @prefix xsd: . ex:tair-mapviewer - a moby:Provider, exterms:ProxyProvider, exterms:ArabidopsisSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:ArabidopsisSearchProvider ; moby:name "TAIR Map Viewer" ; moby:oneLineDescription "Arabidopsis Map Viewer service provided by TAIR" ; moby:inputURI "http://www.arabidopsis.org/servlets/mapper" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed 2005/09/25 19:17:58 1.3 @@ -7,23 +7,23 @@ xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > - + - + - http://www.ncbi.nlm.nih.gov/entrez/query.fcgi? - - Entrez PubMed service provided by NCBI - PubMed + PubMed + Entrez PubMed service provided by NCBI + http://www.ncbi.nlm.nih.gov/entrez/query.fcgi? + - + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/ncbi-megablast 2005/09/25 19:17:58 1.3 @@ -21,7 +21,7 @@ NCBI Mega BLAST http://www.ncbi.nlm.nih.gov/BLAST/Blast.cgi?CMD=Web&LAYOUT=TwoWindows&AUTO_FORMAT=Semiauto&ALIGNMENTS=50&ALIGNMENT_VIEW=Tabular&CLIENT=web&DATABASE=nr&DESCRIPTIONS=100&ENTREZ_QUERY=%28none%29&EXPECT=10&FILTER=L&FORMAT_OBJECT=Alignment&FORMAT_TYPE=HTML&NCBI_GI=on&PAGE=MegaBlast&SERVICE=plain&SET_DEFAULTS.x=34&SET_DEFAULTS.y=8&SHOW_OVERVIEW=on&END_OF_HTTPGET=Yes&SHOW_LINKOUT=yes&GET_SEQUENCE=yes&PERC_IDENT=None,1,-2 - + NCBI MegaBlast service provided by NCBI =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch 2005/05/05 17:35:26 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/sgd-quicksearch 2005/09/25 19:17:58 1.4 @@ -7,25 +7,25 @@ xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:moby="http://www.semanticmoby.org/ontologies/core/" > - + - - SGD Quick Search - - - http://db.yeastgenome.org/cgi-bin/search/quickSearch - Saccharomyces cerevisiae quick search - - + + + - - - + + + + + SGD Quick Search + Saccharomyces cerevisiae quick search + http://db.yeastgenome.org/cgi-bin/search/quickSearch + - + \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed.n3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed.n3 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/pubmed.n3 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ @prefix xsd: . ex:pubmed - a moby:Provider, exterms:ProxyProvider, exterms:PubSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:PubSearchProvider ; moby:name "PubMed" ; moby:oneLineDescription "Entrez PubMed service provided by NCBI" ; moby:inputURI "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/gramene-query 2005/09/25 19:17:58 1.3 @@ -15,7 +15,7 @@ Gramene Query - + http://www.gramene.org/ =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query.n3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query.n3 2005/05/05 17:30:46 1.2 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/wormbase-query.n3 2005/09/25 19:17:58 1.3 @@ -7,7 +7,7 @@ @prefix xsd: . ex:wormbase-query - a moby:Provider, exterms:ProxyProvider, exterms:ElegansSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:ElegansSearchProvider ; moby:name "WormBase Query" ; moby:oneLineDescription "C. elegans database query at wormbase.org" ; moby:inputURI "http://www.wormbase.org/" ; =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery.n3,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery.n3 2005/05/05 17:30:46 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/examples/proxies/flybase-genequery.n3 2005/09/25 19:17:58 1.4 @@ -7,7 +7,7 @@ @prefix xsd: . ex:flybase-genequery - a moby:Provider, exterms:ProxyProvider, exterms:DrosophilaSearchProvider ; + a moby:Service, exterms:ProxyProvider, exterms:DrosophilaSearchProvider ; moby:name "FlyBase Gene Query" ; moby:oneLineDescription "FlyBase gene query form at flybase.bio.indiana.edu" ; moby:inputURI "http://flybase.bio.indiana.edu/genes/fbgquery.hform" ; From gss at pub.open-bio.org Sun Sep 25 19:39:51 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun, 25 Sep 2005 15:39:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251939.j8PJdpEe013293@pub.open-bio.org> gss Sun Sep 25 15:39:51 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib In directory pub.open-bio.org:/tmp/cvs-serv13269/lib Log Message: Directory /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib added to the repository moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib - New directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib/RCS/directory,v: No such file or directory From gss at pub.open-bio.org Sun Sep 25 19:40:43 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun, 25 Sep 2005 15:40:43 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251940.j8PJehVx013393@pub.open-bio.org> gss Sun Sep 25 15:40:43 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF In directory pub.open-bio.org:/tmp/cvs-serv13368/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF Modified Files: .cvsignore Log Message: Don't exclude lib moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF .cvsignore,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore 2005/09/22 17:04:15 1.3 +++ /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/.cvsignore 2005/09/25 19:40:43 1.4 @@ -1,3 +1,2 @@ -classes smoby.properties -lib +classes From gss at pub.open-bio.org Sun Sep 25 19:41:39 2005 From: gss at pub.open-bio.org (Gary Schiltz) Date: Sun, 25 Sep 2005 15:41:39 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509251941.j8PJfdWf013422@pub.open-bio.org> gss Sun Sep 25 15:41:39 EDT 2005 Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib In directory pub.open-bio.org:/tmp/cvs-serv13401/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib Added Files: postgresql-8.0.309.jdbc3.jar Log Message: Added PostgreSQL lib moby-live/S-MOBY/ref-impl/semanticmoby.org/WebRoot/WEB-INF/lib postgresql-8.0.309.jdbc3.jar,NONE,1.1 From senger at pub.open-bio.org Sat Sep 24 17:51:52 2005 From: senger at pub.open-bio.org (Martin Senger) Date: Sat, 24 Sep 2005 13:51:52 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509241751.j8OHpqJI030828@pub.open-bio.org> senger Sat Sep 24 13:51:52 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory pub.open-bio.org:/tmp/cvs-serv30711/src/main/org/biomoby/service/dashboard Modified Files: AbstractPanel.java CommonTree.java ConsolePanel.java Dashboard.java DashboardPanel.java DashboardProperties.java EventGeneratorPanel.java NOTES RegistryModel.java RegistryPanel.java Added Files: CommonConsole.java CommonNode.java PropertyChannel.java SwingWorker.java Log Message: moby-live/Java/src/main/org/biomoby/service/dashboard CommonConsole.java,NONE,1.1 CommonNode.java,NONE,1.1 PropertyChannel.java,NONE,1.1 SwingWorker.java,NONE,1.1 AbstractPanel.java,1.5,1.6 CommonTree.java,1.1,1.2 ConsolePanel.java,1.3,1.4 Dashboard.java,1.3,1.4 DashboardPanel.java,1.3,1.4 DashboardProperties.java,1.2,1.3 EventGeneratorPanel.java,1.2,1.3 NOTES,1.5,1.6 RegistryModel.java,1.1,1.2 RegistryPanel.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/18 14:09:42 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java 2005/09/24 17:51:51 1.6 @@ -20,6 +20,7 @@ import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JTextField; +import javax.swing.JComboBox; import javax.swing.JFileChooser; import javax.swing.AbstractButton; import javax.swing.BorderFactory; @@ -49,6 +50,7 @@ import java.io.File; import java.util.prefs.Preferences; +import java.util.Map; /** * WORK IN PROGRESS.

            @@ -81,11 +83,13 @@ // something need to be done only once - keep it here protected Icon panelIcon; protected JComponent pComponent; - protected Icon confirmIcon; + protected static Icon confirmIcon; // re-use "style" components protected static final Insets BREATH_TOP = new Insets (10,0,0,0); + // + protected PropertyChannel propertyChannel; /********************************************************************* * Default constructor (just for the sub-classes). @@ -139,6 +143,14 @@ public void propertyChange (PropertyChangeEvent event) { } + /************************************************************************** + * Remember a property channel and register itself to it as a listener. + **************************************************************************/ + protected void setPropertyChannel (PropertyChannel propertyChannel) { + this.propertyChannel = propertyChannel; + propertyChannel.addPropertyChangeListener (this); + } + // // Abstract methods // @@ -146,7 +158,7 @@ /************************************************************************** * **************************************************************************/ - abstract public JComponent getComponent(); + abstract public JComponent getComponent (PropertyChannel propertyChannel); /************************************************************************** * @@ -228,23 +240,16 @@ /********************************************************************* * Create a panel with given text field and with a directory/file * browser button attached. - * - * @param chooserMode should be one of - * JFileChooser.DIRECTORIES_ONLY, JFileChooser.FILES_ONLY, and - * JFileChooser.FILES_AND_DIRECTORIES (but it is not tested) ********************************************************************/ protected JFileChooserWithHistory createFileSelector (String chooserTitle, String approveButtonText, - int chooserMode, String defaultValue, - FileFilter filter) { + String preferenceNode, + String eventName) { JFileChooserWithHistory chooser = - new JFileChooserWithHistory (null, this, "cacheDirectory"); + new JFileChooserWithHistory (null, this, preferenceNode); JFileChooser ch = chooser.getFileChooser(); - ch.setFileSelectionMode (chooserMode); - if (filter != null) - ch.setFileFilter (filter); ch.setApproveButtonText (approveButtonText); ch.setDialogTitle (chooserTitle); @@ -252,10 +257,57 @@ chooser.getSelectedFile() == null) chooser.setSelectedFile (new File (defaultValue)); + if (eventName != null) { + JTextFieldWithHistory textField = chooser.getTextField(); + textField.addActionListener (getTextFieldListener (eventName)); + String text = textField.getText(); + if (UUtils.notEmpty (text)) + propertyChannel.put (eventName, text); + } + return chooser; } /********************************************************************* + * Create a text field (possibly with an 'initValue' with history + * taken from given 'preferenceNode'. If 'evenName' is not null + * (which means that the contens of this text filed may be of + * interest of someone outside), add an action event that will + * update the shared property storage (a global variable + * 'propertyChannel') when the text field changes its value. + ********************************************************************/ + protected JTextFieldWithHistory createText (String initValue, + String preferenceNode, + String eventName) { + JTextFieldWithHistory textField = + new JTextFieldWithHistory (initValue, + this, + preferenceNode); + if (eventName != null) { + textField.addActionListener (getTextFieldListener (eventName)); + String text = textField.getText(); + if (UUtils.notEmpty (text)) + propertyChannel.put (eventName, text); + } + + return textField; + } + + /********************************************************************* + * + ********************************************************************/ + private ActionListener getTextFieldListener (String eventName) { + final String name = eventName; + return new ActionListener() { + public void actionPerformed (ActionEvent e) { + String contents = ((JTextFieldWithHistory)e.getSource()).getText(); + propertyChannel.put (name, contents); + } + }; + } + + + /********************************************************************* * ********************************************************************/ protected boolean getPrefValue (String key, @@ -276,11 +328,11 @@ /********************************************************************* * Return true if confirmation dialog passed. ********************************************************************/ - public boolean confirm (Object msg) { + public static boolean confirm (Object msg) { if (confirmIcon == null) confirmIcon = SwingUtils.createIcon ("images/confirmButton.gif", Dashboard.class); - return SwingUtils.confirm (this, msg, confirmIcon); + return SwingUtils.confirm (null, msg, confirmIcon); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/09/18 08:46:26 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java 2005/09/24 17:51:51 1.2 @@ -8,20 +8,35 @@ package org.biomoby.service.dashboard; +import org.tulsoft.shared.UUtils; +import org.tulsoft.tools.gui.SwingUtils; + import javax.swing.JTree; import javax.swing.JLabel; import javax.swing.JScrollPane; import javax.swing.Icon; +import javax.swing.JPopupMenu; +import javax.swing.JOptionPane; +import javax.swing.JMenuItem; +import javax.swing.ToolTipManager; +import javax.swing.AbstractAction; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreeSelectionModel; import javax.swing.tree.TreePath; +import javax.swing.event.TreeSelectionListener; +import javax.swing.event.TreeSelectionEvent; import java.awt.Component; import java.awt.Font; +import java.awt.event.ActionEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; + +import java.util.HashSet; +import java.util.Enumeration; // import java.beans.PropertyChangeListener; // import java.beans.PropertyChangeEvent; @@ -40,6 +55,15 @@ public class CommonTree extends JTree { + // some shared constants + final static protected int SORTED_BY_NAME = 0; + final static protected int SORTED_BY_AUTHORITY = 1; + + // tree components + protected JPopupMenu popup; + protected Icon searchIcon; + protected String lastSearchText = ""; + // protected PropertyChangeSupport support; // protected boolean expanded = true; // the status of the application list @@ -47,34 +71,48 @@ * Constructor ********************************************************************/ public CommonTree (String rootNode) { - super (new DefaultTreeModel (new DefaultMutableTreeNode (rootNode))); + super (new DefaultTreeModel (new DefaultMutableTreeNode (new CommonNode (rootNode)))); // create an almost empty tree, only with a root node that // contains just a String holding the name of the root node; - // the tree will be populated later by calling 'updateTree()' - setFont (new Font ("Dialog", Font.PLAIN, 10)); +// setFont (new Font ("Dialog", Font.PLAIN, 10)); putClientProperty ("JTree.lineStyle", "Angled"); setCellRenderer (new CommonTreeCellRenderer()); getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); - addMouseListener (new MouseAdapter() { - public void mouseClicked (MouseEvent e) { - TreePath selPath = getPathForLocation (e.getX(), e.getY()); - if (e.getClickCount() == 1) - onSelected (selPath); +// addMouseListener (new MouseAdapter() { +// public void mouseClicked (MouseEvent e) { +// TreePath selPath = getPathForLocation (e.getX(), e.getY()); +// if (e.getClickCount() == 1) +// onSelected (selPath); +// } +// }); + + // listen for when the selection changes + addTreeSelectionListener ( new TreeSelectionListener() { + public void valueChanged (TreeSelectionEvent e) { + DefaultMutableTreeNode node = + (DefaultMutableTreeNode)getLastSelectedPathComponent(); + if (node == null) return; + selected (node); } }); + + // enable tool tips + ToolTipManager.sharedInstance().registerComponent (this); } // - // I want to display the empty modules with the same icon as - // 'closed' tree branches - therefore I need my own cell renderer - // (also it is suitable for new leaf icon) - // class CommonTreeCellRenderer extends DefaultTreeCellRenderer { + HashSet toBeHighlighted; + + public void setToBeHighlighted (HashSet toBeHighlighted) { + this.toBeHighlighted = toBeHighlighted; + } + public Component getTreeCellRendererComponent (JTree tree, java.lang.Object value, boolean selected, @@ -88,40 +126,170 @@ // Component c = super.getTreeCellRendererComponent (tree, value, selected, expanded, leaf, row, hasFocus); + // add a tool-tip for the root node + if (row == 0) { + setToolTipText ("Right-click will show other options"); + setFont (new Font ("Dialog", Font.BOLD, 12)); + } else { + setToolTipText (null); + setFont (new Font ("Dialog", Font.PLAIN, 10)); + } + // TBD: whale icon? // if (leaf) // ((JLabel)c).setIcon (icons [COMPUTER]); + + // do highlight + Object userObject = ((DefaultMutableTreeNode)value).getUserObject(); + CommonNode nodeObject = (CommonNode)userObject; + if (toBeHighlighted != null && toBeHighlighted.contains (nodeObject.getValue())) + setText ("" + nodeObject + ""); + return c; } } + /********************************************************************* + * Put this tree in a scrollable pane. + ********************************************************************/ public JScrollPane scrollable() { return new JScrollPane (this); } /********************************************************************* - * onAppSelected() - * When an application name is selected it will fire a - * PropertyChange event with SELECTED_BY_NAME property. The value of - * the property will be an instance of Hashtable carrying: - * - module name as MODULE_NAME, - * - application name as APP_NAME, and - * - an this instance as ALBEAN_LIST - ********************************************************************/ - protected void onSelected (TreePath path) { -// if (path == null) return; -// DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent(); -// if (path.getPathCount() < 3) return; // we need to be on an application name -// String appName = (String)node.getUserObject(); -// DefaultMutableTreeNode parent = (DefaultMutableTreeNode)node.getParent(); -// String module = (String)parent.getUserObject(); -// Hashtable result = new Hashtable(); -// result.put (ALBeanListWithGUI.MODULE_NAME, module); -// result.put (ALBeanListWithGUI.APP_NAME, appName); -// result.put (ALBeanListWithGUI.ALBEAN_LIST, this); -// support.firePropertyChange (ALBeanListWithGUI.SELECTED_BY_NAME, null, result); + * Called when a tree node is selected. Does nothing here + ********************************************************************/ + protected void selected (DefaultMutableTreeNode node) { + } + + /********************************************************************* + * Create a popup object with common items. Subclasses can (and + * usually do) add more items, or re-created the whole popup.

            + * + * @param title is given to the popups + ********************************************************************/ + protected void createPopups (String title) { + popup = new JPopupMenu (title); + popup.add + (new JMenuItem (new AbstractAction ("Search") { + public void actionPerformed (ActionEvent e) { + String searchText = searchDialog(); + if (searchText != null) + search (searchText); + } + })); + popup.add + (new JMenuItem (new AbstractAction ("Expand all nodes") { + public void actionPerformed (ActionEvent e) { + expand(); + } + })); + popup.add + (new JMenuItem (new AbstractAction ("Collaps all nodes") { + public void actionPerformed (ActionEvent e) { + collapse(); + } + })); + + // add listener to this tree to bring up popup menus + MouseListener popupListener = new PopupListener(); + addMouseListener (popupListener); + } + + class PopupListener extends MouseAdapter { + public void mousePressed (MouseEvent e) { + maybeShowPopup (e); + } + public void mouseReleased (MouseEvent e) { + maybeShowPopup (e); + } + private void maybeShowPopup (MouseEvent e) { + if (e.isPopupTrigger() && popup.isEnabled()) { + popup.show (e.getComponent(), + e.getX(), e.getY()); + } + } + } + + /********************************************************************* + * Collapse all nodes, starting from the root.

            + ********************************************************************/ + protected void collapse() { + SwingUtils.collapseTree (this, (DefaultMutableTreeNode)getModel().getRoot()); + } + + /********************************************************************* + * Expand all nodes, starting from the root.

            + ********************************************************************/ + protected void expand() { +// SwingUtils.expandTree (this, (DefaultMutableTreeNode)getModel().getRoot()); + + + final SwingWorker worker = new SwingWorker() { + public Object construct() { + SwingUtils.expandTree (CommonTree.this, (DefaultMutableTreeNode)getModel().getRoot()); + return null; // not used here + } + // runs on the event-dispatching thread. + public void finished() { + repaint(); + } + }; + worker.start(); + + } + + /********************************************************************* + * Search underlying objects and highligh nodes corresponding to + * the found objects. But it does nothing here - it is supposed to + * be overwritten by a concrete tree. + ********************************************************************/ + protected void search (String searchText) { + System.out.println ("Search text: " + searchText); + } + + /********************************************************************* + * Show a dialog asking for a search string, and return it. Or + * return null if user cancel the dialog. + ********************************************************************/ + protected String searchDialog() { + if (searchIcon == null) + searchIcon = + SwingUtils.createIcon ("images/viewerButton.gif", Dashboard.class); + + String result = (String)JOptionPane.showInputDialog + (null, + "The search will highlight nodes in this tree that\n" + + "contain (or are related to) the text you enter here.\n" + + "Text is treated as a regular expression. The case-\n" + + "insensitivity is, however, always added by default.\n \n" + + "For example, try: germplasm or mark|kawas.\n \n", + "Search", + JOptionPane.OK_CANCEL_OPTION, + searchIcon, + null, + lastSearchText); + if (result != null) + lastSearchText = result; + return result; + } + + protected void highlightAndJumpTo (HashSet toBeHighlighted) { + + CommonTreeCellRenderer r = (CommonTreeCellRenderer)getCellRenderer(); + r.setToBeHighlighted (toBeHighlighted); + collapse (); + DefaultTreeModel tModel = (DefaultTreeModel)getModel(); + DefaultMutableTreeNode root = (DefaultMutableTreeNode)tModel.getRoot(); + Enumeration en = root.depthFirstEnumeration(); + while (en.hasMoreElements()) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode)en.nextElement(); + if (toBeHighlighted.contains (node.getUserObject().toString())) { + makeVisible (new TreePath (tModel.getPathToRoot (node))); + } + } } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/18 14:09:42 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java 2005/09/24 17:51:51 1.4 @@ -15,7 +15,7 @@ import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JScrollPane; -import javax.swing.JTextArea; +// import javax.swing.JTextArea; import javax.swing.JPanel; import javax.swing.text.html.HTMLDocument; @@ -28,6 +28,7 @@ import java.beans.PropertyChangeEvent; import java.util.Date; +import java.util.Map; /** * A debugging panel. It tries to listen to as many events it can, and @@ -42,13 +43,13 @@ public class ConsolePanel extends AbstractPanel { - JTextArea textArea = null; + CommonConsole console; /********************************************************************* * propertyChange() ********************************************************************/ public void propertyChange (PropertyChangeEvent e) { - if (textArea == null) return; // I am not yet ready + if (console == null) return; // I am not yet ready String prop = e.getPropertyName(); if (prop == null) return; // no interest in non-specific changes @@ -57,8 +58,7 @@ if (value == null) return; // no interest in non-defined new values if (prop.equalsIgnoreCase (DP_LOG_MSG)) { - textArea.append (value.toString()); - textArea.append ("\n"); + console.setText (value.toString() + "\n"); } else { StringBuffer buf = new StringBuffer(); Object source = e.getSource(); @@ -69,38 +69,43 @@ } buf.append (" at "); buf.append (new Date().toString()); - textArea.append ("PROPERTY: " + prop + buf + "\n"); - textArea.append ("VALUE: " + value.toString() + "\n\n"); + console.setText ("PROPERTY: " + prop + buf + "\n" + + "VALUE: " + value.toString() + "\n\n"); } } /************************************************************************** * **************************************************************************/ - public JComponent getComponent() { - JPanel p = new JPanel (new GridBagLayout(), true); + public JComponent getComponent (PropertyChannel propertyChannel) { + setPropertyChannel (propertyChannel); - textArea = new JTextArea (24, 80); - textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); - textArea.setEditable (false); - JScrollPane scroller = new JScrollPane (textArea); - - JButton cleanButton = - createButton (" Clean ", - "Remove all messages from the console area", - KeyEvent.VK_C, - new ActionListener() { - public void actionPerformed (ActionEvent e) { - if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) - textArea.setText (""); - } - }); - - // put it together - SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); - SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); + console = new CommonConsole(); + return console; - return p; +// JPanel p = new JPanel (new GridBagLayout(), true); + +// textArea = new JTextArea (24, 80); +// textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); +// textArea.setEditable (false); +// JScrollPane scroller = new JScrollPane (textArea); + +// JButton cleanButton = +// createButton (" Clean ", +// "Remove all messages from the console area", +// KeyEvent.VK_C, +// new ActionListener() { +// public void actionPerformed (ActionEvent e) { +// if (! "".equals (textArea.getText()) && confirm ("Remove all messages?")) +// textArea.setText (""); +// } +// }); + +// // put it together +// SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); +// SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); + +// return p; } /************************************************************************** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/18 14:09:42 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java 2005/09/24 17:51:51 1.4 @@ -34,6 +34,7 @@ import java.util.Vector; import java.util.Enumeration; import java.util.Properties; +import java.util.Hashtable; import java.util.Date; import java.net.URL; import java.text.DateFormat; @@ -54,6 +55,7 @@ public static boolean useLoadMonitor = true; protected JTabbedPane tabbedPane; protected DashboardPanel[] panels; + protected PropertyChannel propertyChannel; protected static Properties dashboardProperties; static { @@ -84,7 +86,8 @@ **************************************************************************/ public Dashboard() { loadPanels(); - dashboard = getComponent(); + propertyChannel = new PropertyChannel(); + dashboard = getComponent (propertyChannel); connectPanels(); } @@ -103,14 +106,14 @@ /************************************************************************** * Connect all available Dashboard panels: a) together, and b) - * with the status bar. + * with the status bar. TBD: It changed... It uses now a PropertyChannel... **************************************************************************/ public void connectPanels() { for (int i = 0; i < panels.length; i++) { - for (int j = 0; j < i; j++) - panels[i].addPropertyChangeListener (panels[j]); - for (int j = i+1; j < panels.length; j++) - panels[i].addPropertyChangeListener (panels[j]); +// for (int j = 0; j < i; j++) +// panels[i].addPropertyChangeListener (panels[j]); +// for (int j = i+1; j < panels.length; j++) +// panels[i].addPropertyChangeListener (panels[j]); if (statusBar != null) panels[i].addPropertyChangeListener (statusBar); } @@ -120,7 +123,8 @@ * Show the main frame. **************************************************************************/ public void show() { - JFrame frame = SwingUtils.createMainFrame (getComponent(), getName()); + JFrame frame = SwingUtils.createMainFrame (getComponent (propertyChannel), + getName()); SwingUtils.showMainFrame (frame, dashboard.getPreferredSize()); } @@ -182,7 +186,7 @@ /************************************************************************** * **************************************************************************/ - public JComponent getComponent() { + public JComponent getComponent (PropertyChannel propertyChannel) { if (dashboard != null) return dashboard; @@ -202,7 +206,9 @@ String name = panels[i].getName(); if (useLoadMonitor) ProgressView.monitor.setTextAndAdd ("Loading " + name + "..."); - tabbedPane.addTab (name, panels[i].getIcon(), panels[i].getComponent()); + tabbedPane.addTab (name, + panels[i].getIcon(), + panels[i].getComponent (propertyChannel)); } statusBar = getStatusBar(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/18 08:46:26 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardPanel.java 2005/09/24 17:51:51 1.4 @@ -32,9 +32,12 @@ extends PropertyChangeListener, DashboardProperties { /************************************************************************** - * Return a graphical representation of this panel. + * Return a graphical representation of this panel.

            + * + * @param propertyChannel is a shared storage for properties + * @return a GUI representing this panel **************************************************************************/ - JComponent getComponent(); + JComponent getComponent (PropertyChannel propertyChannel); /************************************************************************** * A name identifies a panel in the dashboard's tabs. It should be =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/09/18 08:46:26 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/DashboardProperties.java 2005/09/24 17:51:51 1.3 @@ -27,11 +27,17 @@ public interface DashboardProperties { + // names of properties used in property change events static final String DP_LOG_MSG = "log-msg"; static final String DP_STATUS_MSG = "status-msg"; static final String DP_SERVICE_NAME = "dp-service-name"; static final String DP_DATATYPE_NAME = "dp-datatype-name"; + // names of properties used in property channel storage + static final String DP_REGISTRY_ENDPOINT = "dp-registry-endpoint"; + static final String DP_REGISTRY_NAMESPACE = "dp-registry-namespace"; + static final String DP_CACHE_DIR = "dp-cache-dir"; + /** A filename containing Java properties that configure the dashboard. */ static final String DASHBOARD_PROPERTIES_FILE = "dashboard.properties"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java 2005/09/18 08:46:26 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/EventGeneratorPanel.java 2005/09/24 17:51:51 1.3 @@ -25,6 +25,8 @@ import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; +import java.util.Map; + /** * A debugging panel. It generates some events.

            * @@ -40,7 +42,9 @@ /************************************************************************** * **************************************************************************/ - public JComponent getComponent() { + public JComponent getComponent (PropertyChannel propertyChannel) { + setPropertyChannel (propertyChannel); + JPanel p = new JPanel (new GridBagLayout(), true); JLabel desc = @@ -81,7 +85,8 @@ // private void onFire (String propertyName, String value) { - support.firePropertyChange (propertyName, null, value); + propertyChannel.put (propertyName, value); +// support.firePropertyChange (propertyName, null, value); } /************************************************************************** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/22 16:07:09 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/24 17:51:51 1.6 @@ -1,3 +1,123 @@ +invokeLater() +------------- +/** + * Create the GUI and show it. For thread safety, + * this method should be invoked from the + * event-dispatching thread. + */ +private static void createAndShowGUI() { + //Make sure we have nice window decorations. + JFrame.setDefaultLookAndFeelDecorated(true); + + //Create and set up the window. + frame = new JFrame("FocusConceptsDemo"); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + //Create and set up the content pane. + JComponent newContentPane = new FocusConceptsDemo(); + newContentPane.setOpaque(true); //content panes must be opaque + frame.setContentPane(newContentPane); + + //Display the window. + frame.pack(); + frame.setVisible(true); +} +public static void main(String[] args) { + //Schedule a job for the event-dispatching thread: + //creating and showing this application's GUI. + javax.swing.SwingUtilities.invokeLater(new Runnable() { + public void run() { + createAndShowGUI(); + } + }); + +invokeAndWait(): +---------------- +void printTextField() throws Exception { + final String[] myStrings = new String[2]; + + Runnable getTextFieldText = new Runnable() { + public void run() { + myStrings[0] = textField0.getText(); + myStrings[1] = textField1.getText(); + } + }; + SwingUtilities.invokeAndWait(getTextFieldText); + + System.out.println(myStrings[0] + " " + myStrings[1]); +} + +SwingWorker: +------------ + +//BETTER CODE: +public void actionPerformed(ActionEvent e) { + ... + final SwingWorker worker = new SwingWorker() { + public Object construct() { + //...code that might take a while to execute is here... + return someValue; + } + }; + worker.start(); //required for SwingWorker 3 + ... +} + +using finished: + +public void actionPerformed(ActionEvent e) { + ... + if (icon == null) { //haven't viewed this photo before + loadImage(imagedir + pic.filename, current); + } else { + updatePhotograph(current, pic); + } +} +... +//Load an image in a separate thread. +private void loadImage(final String imagePath, final int index) { + final SwingWorker worker = new SwingWorker() { + ImageIcon icon = null; + + public Object construct() { + icon = new ImageIcon(getURL(imagePath)); + return icon; //return value not used by this program + } + + //Runs on the event-dispatching thread. + public void finished() { + Photo pic = (Photo)pictures.elementAt(index); + pic.setIcon(icon); + if (index == current) + updatePhotograph(index, pic); + } + }; + worker.start(); +} + + +---- + +* error messages (dialog window, or a text-area window/save button, something on sterrr?) +? logging (LogPanel and/or usual logging to a file?) +* communication with StatusBar (incl. progress bar, cancel button) +* disabling things during a long-time operation +* general Console panel (save button; various renderes?) +* graphics to trees + + +TODO generally: +--------------- + +* notice that the dasboard is used the first time and offer ti create +a list of wanted panels (some of them are suggested as default) + +* notice that user does not use cache (and that he did not select "do +not check it at startup") and tell him "do you want a cache?" + +* BUG: not sure why so many (repeated) changes from the actionlistener +in JFieldTextWithHistory + TODO with views: ---------------- * change onMethods() to be protected or even private... =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/09/19 08:09:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/09/24 17:51:51 1.2 @@ -8,8 +8,18 @@ package org.biomoby.service.dashboard; +import org.biomoby.shared.MobyException; +import org.biomoby.shared.MobyDataType; +import org.biomoby.shared.CentralAll; +import org.biomoby.client.CentralDigestCachedImpl; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeSupport; + +import java.util.HashSet; +import java.util.Hashtable; +import java.util.regex.Pattern; /** * A real worker that supplies all data to the {@link @@ -20,17 +30,108 @@ * @version $Id$ */ -public class RegistryModel { +public class RegistryModel + extends AbstractModel { + + CentralAll worker; + Hashtable dataTypesTable; /********************************************************************* * Default constructor. ********************************************************************/ public RegistryModel() { + super(); + } + + /********************************************************************* + * Usual constructor that shares support for property changes with + * its creator. + ********************************************************************/ + public RegistryModel (PropertyChangeSupport support) { + super (support); + } + + /********************************************************************* + * + ********************************************************************/ + public MobyDataType[] getDataTypesByNames() + throws MobyException { + + if (worker == null) + initWorker(); + + MobyDataType[] dataTypes = worker.getDataTypes(); + return dataTypes; } /********************************************************************* * ********************************************************************/ + public MobyDataType getDataType (String dataTypeName) + throws MobyException { + if (dataTypeName == null) + return null; + + MobyDataType[] dataTypes = getDataTypesByNames(); + + if (dataTypesTable == null) { + dataTypesTable = new Hashtable(); + for (int i = 0; i < dataTypes.length; i++) { + dataTypesTable.put (dataTypes[i].getName(), dataTypes[i]); + } + } + return (MobyDataType)dataTypesTable.get (dataTypeName); + } + + /********************************************************************* + * Return a HashSet filled with names of data types that have + * somewhere given 'searchText'. Add case-insensitivity to the + * regular expression in 'searchText'. + ********************************************************************/ + public HashSet find (String searchText) + throws MobyException { + HashSet found = new HashSet(); + MobyDataType[] dataTypes = getDataTypesByNames(); + if (! searchText.startsWith ("(?i)")) + searchText = "(?i)" + searchText; + Pattern pattern = Pattern.compile (searchText); + for (int i = 0; i < dataTypes.length; i++) { + if (pattern.matcher (dataTypes[i].toString()).find()) + found.add (dataTypes[i].getName()); + } + return found; + } + + +// /********************************************************************* +// * +// ********************************************************************/ +// public MobyDataType[] getDataTypesByAuthority() +// throws MobyException { + +// if (worker == null) +// initWorker(); + +// MobyDataType[] dataTypes = worker.getDataTypes(); +// java.util.Arrays.sort (dataTypes); +// return dataTypes; +// } + + /********************************************************************* + * + ********************************************************************/ + protected void initWorker() + throws MobyException { + String registryURL = propertyChannel.getString (DP_REGISTRY_ENDPOINT); + String registryNS = propertyChannel.getString (DP_REGISTRY_NAMESPACE); +// String cacheDir = propertyChannel.getString (DP_CACHE_DIR); + String cacheDir = "/home/senger/jMoby/myCache"; +// cacheDir = null; + + worker = new CentralDigestCachedImpl (registryURL, + registryNS, + cacheDir); + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/19 08:08:32 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/24 17:51:51 1.7 @@ -8,6 +8,13 @@ package org.biomoby.service.dashboard; +import org.biomoby.shared.MobyException; +import org.biomoby.shared.Central; +import org.biomoby.shared.MobyDataType; +import org.biomoby.shared.MobyRelationship; +import org.biomoby.service.generator.DataTypesGenerator; + +import org.tulsoft.shared.UUtils; import org.tulsoft.tools.gui.SwingUtils; import org.tulsoft.tools.gui.JTextFieldWithHistory; import org.tulsoft.tools.gui.JFileChooserWithHistory; @@ -21,19 +28,33 @@ import javax.swing.JSplitPane; import javax.swing.JScrollPane; import javax.swing.JTextArea; +import javax.swing.JPopupMenu; +import javax.swing.JMenuItem; +import javax.swing.JCheckBoxMenuItem; +import javax.swing.AbstractAction; import javax.swing.JComponent; import javax.swing.text.html.HTMLDocument; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; import java.awt.GridBagLayout; import java.awt.Font; - import java.awt.event.KeyEvent; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseAdapter; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; +import java.util.Map; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Enumeration; +import java.util.Vector; /** * A panel displaying contents of a Biomoby registry. It also select @@ -58,6 +79,7 @@ // components that are used from more methods JFileChooserWithHistory cacheDir; JLabel labelCacheDir; + CommonConsole console; /********************************************************************* * propertyChange() @@ -78,14 +100,16 @@ ********************************************************************/ public RegistryPanel() { super(); -// registryModel = new RegistryModel (this); - registryModel = new RegistryModel(); + registryModel = new RegistryModel (support); } /************************************************************************** * **************************************************************************/ - public JComponent getComponent() { + public JComponent getComponent (PropertyChannel propertyChannel) { + setPropertyChannel (propertyChannel); + registryModel.setPropertyChannel (propertyChannel); + if (pComponent != null) return pComponent; @@ -94,6 +118,7 @@ // ontology trees ServicesTree servicesTree = new ServicesTree(); DataTypesTree dataTypesTree = new DataTypesTree(); + dataTypesTree.update (CommonTree.SORTED_BY_NAME); NamespacesTree namespacesTree = new NamespacesTree(); JSplitPane split1 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, @@ -110,7 +135,8 @@ split2.setOneTouchExpandable (true); // console panel - JPanel console = getConsole(); + console = new CommonConsole(); + console.setAppendMode (false); JSplitPane split3 = new JSplitPane (JSplitPane.VERTICAL_SPLIT, split2, @@ -177,10 +203,10 @@ protected JPanel getRegistryLocation() { JLabel labelRegistryURL = new JLabel("Endpoint"); JTextFieldWithHistory registryURL = - new JTextFieldWithHistory ("", this, "registryEndpoint"); + createText ("", "registryEndpoint", DP_REGISTRY_ENDPOINT); JLabel labelRegistryNS = new JLabel("Namespace (URI)"); JTextFieldWithHistory registryNS = - new JTextFieldWithHistory ("", this, "registryNamespace"); + createText ("", "registryNamespace", DP_REGISTRY_NAMESPACE); JButton reloadAllButton = createButton (" Reload all ", "Reload all ontology trees from the Biomoby registry", @@ -226,9 +252,11 @@ labelCacheDir = new JLabel("Cache directory"); cacheDir = createFileSelector ("Select directory for/with local cache", "Select", - JFileChooser.DIRECTORIES_ONLY, System.getProperty ("java.io.tmpdir"), - null); + "cacheDirectory", + DP_CACHE_DIR); + cacheDir.getFileChooser().setFileSelectionMode (JFileChooser.DIRECTORIES_ONLY); + onUseCache (usingCache); JButton infoButton = createButton (" Info ", @@ -273,13 +301,13 @@ /************************************************************************** * **************************************************************************/ - protected JPanel getConsole() { - JPanel p = new JPanel (new GridBagLayout()); +// protected JPanel getConsole() { +// JPanel p = new JPanel (new GridBagLayout()); - JTextArea textArea = new JTextArea(); - textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); - textArea.setEditable (false); - JScrollPane scroller = new JScrollPane (textArea); +// JTextArea textArea = new JTextArea(); +// textArea.setFont (new Font ("Courier", Font.PLAIN, 10)); +// textArea.setEditable (false); +// JScrollPane scroller = new JScrollPane (textArea); // JButton cleanButton = // createButton (" Clean ", @@ -292,12 +320,12 @@ // } // }); - // put it together - SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); -// SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); +// // put it together +// SwingUtils.addComponent (p, scroller, 0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0); +// // SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0); - return p; - } +// return p; +// } /************************************************************************** * @@ -312,11 +340,277 @@ * **************************************************************************/ class DataTypesTree extends CommonTree { + MobyDataType[] dataTypes = null; + int lastSorted = SORTED_BY_NAME; + boolean hideBadGuys = false; + boolean showMembers = false; + JCheckBoxMenuItem hideBox; + public DataTypesTree() { super ("DataTypes"); + createPopups ("Data Types Menu"); + } + + protected void createPopups (String title) { + super.createPopups (title); + popup.addSeparator(); + popup.add + (new JMenuItem (new AbstractAction ("Sort by names") { + public void actionPerformed (ActionEvent e) { + update (lastSorted = SORTED_BY_NAME); + hideBox.setEnabled (true); + } + })); + popup.add + (new JMenuItem (new AbstractAction ("Sort by authorities") { + public void actionPerformed (ActionEvent e) { + update (lastSorted = SORTED_BY_AUTHORITY); + hideBox.setEnabled (false); + } + })); + popup.addSeparator(); + + JCheckBoxMenuItem showBox = new JCheckBoxMenuItem ("Show HAS/HASA members"); + showBox.addItemListener (new ItemListener() { + public void itemStateChanged (ItemEvent e) { + showMembers = (e.getStateChange() == ItemEvent.SELECTED); + update (lastSorted); + } + }); + popup.add (showBox); + + hideBox = new JCheckBoxMenuItem ("Hide deprecated objects"); + hideBox.addItemListener (new ItemListener() { + public void itemStateChanged (ItemEvent e) { + hideBadGuys = (e.getStateChange() == ItemEvent.SELECTED); + if (hideBadGuys) + removeBadGuys(); + else + update (lastSorted); + } + }); + popup.add (hideBox); + } + + void update (int howSorted) { + popup.setEnabled (false); + final int sorted = howSorted; + final SwingWorker worker = new SwingWorker() { + public Object construct() { + try { + dataTypes = registryModel.getDataTypesByNames(); + } catch (MobyException e) { + // TBD: what to do here? + System.err.println ("ERROR: " + e.getMessage()); + } + return dataTypes; // not used here + } + + // runs on the event-dispatching thread. + public void finished() { + if (dataTypes != null) { + if (sorted == SORTED_BY_AUTHORITY) + onUpdateDataTreeByAuth (dataTypes); + else + onUpdateDataTree (dataTypes); + popup.setEnabled (true); + } + } + }; + worker.start(); + } + + void onUpdateDataTree (MobyDataType[] dataTypes) { + DefaultTreeModel tModel = (DefaultTreeModel)getModel(); + DefaultMutableTreeNode root = (DefaultMutableTreeNode)tModel.getRoot(); + root.removeAllChildren(); // does not harm if no children exist + HashMap nodes = new HashMap (dataTypes.length); + for (int i = 0; i < dataTypes.length; i++) { + String thisName = dataTypes[i].getName(); + DefaultMutableTreeNode thisNode = (DefaultMutableTreeNode)nodes.get (thisName); + if (thisNode == null) { + thisNode = new DefaultMutableTreeNode (new CommonNode (thisName)); + nodes.put (thisName, thisNode); + } + String[] parents = dataTypes[i].getParentNames(); + if (parents.length == 0) { // we have a top-level object + root.add (thisNode); + } else { + String parentName = parents[0]; + DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode)nodes.get (parentName); + if (parentNode == null) { + parentNode = new DefaultMutableTreeNode (new CommonNode (parentName)); + nodes.put (parentName, parentNode); + } + if (showMembers) + addMembers (thisNode, dataTypes[i]); + parentNode.add (thisNode); + } + } + if (hideBadGuys) + removeBadGuys(); + else + tModel.reload(); + } + + + void onUpdateDataTreeByAuth (MobyDataType[] dataTypes) { + DefaultTreeModel tModel = (DefaultTreeModel)getModel(); + DefaultMutableTreeNode root = (DefaultMutableTreeNode)tModel.getRoot(); + root.removeAllChildren(); // does not harm if no children exist + HashMap nodes = new HashMap (dataTypes.length); + for (int i = 0; i < dataTypes.length; i++) { + String thisName = dataTypes[i].getName(); + DefaultMutableTreeNode thisNode = (DefaultMutableTreeNode)nodes.get (thisName); + if (thisNode == null) { + thisNode = new DefaultMutableTreeNode (new CommonNode (thisName)); + nodes.put (thisName, thisNode); + } + String authority = dataTypes[i].getAuthority(); + if (UUtils.isEmpty (authority)) + authority = ""; + DefaultMutableTreeNode authNode = (DefaultMutableTreeNode)nodes.get (authority); + if (authNode == null) { + authNode = new DefaultMutableTreeNode (new CommonNode (authority)); + nodes.put (authority, authNode); + root.add (authNode); + } + if (showMembers) + addMembers (thisNode, dataTypes[i]); + authNode.add (thisNode); + } + tModel.reload(); } + + void removeBadGuys() { + DefaultTreeModel tModel = (DefaultTreeModel)getModel(); + DefaultMutableTreeNode root = (DefaultMutableTreeNode)tModel.getRoot(); + + Vector removeFromParent = new Vector(); // nodes that will be removed + Vector removeAllChildren = new Vector(); // nodes whose children will be removed + for (Enumeration en = root.children(); en.hasMoreElements(); ) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode)en.nextElement(); + String value = ((CommonNode)node.getUserObject()).getValue(); + if (value.equals ("Object")) { + // primitive type should not have children + for (Enumeration en2 = node.children(); en2.hasMoreElements(); ) { + DefaultMutableTreeNode node2 = (DefaultMutableTreeNode)en2.nextElement(); + String value2 = ((CommonNode)node2.getUserObject()).getValue(); + if (DataTypesGenerator.isPrimitiveType (value2)) + removeAllChildren.addElement (node2); + } + } else { + // only Object can be a root object + removeFromParent.addElement (node); + } + } + for (Enumeration en = removeFromParent.elements(); en.hasMoreElements(); ) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode)en.nextElement(); + node.removeFromParent(); + } + for (Enumeration en = removeAllChildren.elements(); en.hasMoreElements(); ) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode)en.nextElement(); + node.removeAllChildren(); + } + tModel.reload(); + } + + void addMembers (DefaultMutableTreeNode node, MobyDataType dataType) { + MobyRelationship[] rels = dataType.getChildren(); + for (int i = 0; i < rels.length; i++) { + String memberName = rels[i].getName(); + String memberType = rels[i].getDataTypeName(); + int memberRel = rels[i].getRelationshipType(); + node.add (new DefaultMutableTreeNode (new MemberNode (rels[i]))); + } + } + + /********************************************************************* + * Search underlying objects and highligh nodes corresponding to + * the found objects. + ********************************************************************/ + protected void search (String searchText) { + final String regex = searchText; + final SwingWorker worker = new SwingWorker() { + HashSet found = new HashSet(); + public Object construct() { + try { + if (UUtils.notEmpty (regex)) + found = registryModel.find (regex); + } catch (MobyException e) { + // TBD: what to do here? + System.err.println ("ERROR: " + e.getMessage()); + } + return found; // not used here + } + + // runs on the event-dispatching thread. + public void finished() { + if (found != null) + highlightAndJumpTo (found); + } + }; + worker.start(); + } + + /********************************************************************* + * + ********************************************************************/ + protected void selected (DefaultMutableTreeNode node) { + final CommonNode nodeObject = (CommonNode)node.getUserObject(); + final SwingWorker worker = new SwingWorker() { + MobyDataType dataType; + public Object construct() { + try { + dataType = registryModel.getDataType (nodeObject.getValue()); + } catch (MobyException e) { + // TBD: what to do here? + System.err.println ("ERROR: " + e.getMessage()); + } + return dataType; // not used here + } + + // runs on the event-dispatching thread. + public void finished() { + if (dataType != null) +// System.out.println (dataType); + console.setText (dataType.toString()); + } + }; + worker.start(); + } + + class MemberNode extends CommonNode { + MobyRelationship rel; + public MemberNode (MobyRelationship rel) { + this.rel = rel; + } + public String getValue() { + return rel.getDataTypeName(); + } + public String toString() { + String memberName = rel.getName(); + String memberType = rel.getDataTypeName(); + int memberRel = rel.getRelationshipType(); + StringBuffer buf = new StringBuffer (100); + buf.append (""); + buf.append (memberRel == Central.iHAS ? "HAS" : "HASA"); + buf.append (": "); + buf.append (memberType); + if (UUtils.notEmpty (memberName)) { + buf.append (" ("); + buf.append (memberName); + buf.append (")"); + } + return buf.toString(); + } + } + + } + + /************************************************************************** * **************************************************************************/ @@ -342,35 +636,4 @@ return panelIcon; } - -// public void actionPerformed(ActionEvent e) { -// ... -// if (icon == null) { //haven't viewed this photo before -// loadImage(imagedir + pic.filename, current); -// } else { -// updatePhotograph(current, pic); -// } -// } -// ... -// //Load an image in a separate thread. -// private void loadImage(final String imagePath, final int index) { -// final SwingWorker worker = new SwingWorker() { -// ImageIcon icon = null; - -// public Object construct() { -// icon = new ImageIcon(getURL(imagePath)); -// return icon; //return value not used by this program -// } - -// //Runs on the event-dispatching thread. -// public void finished() { -// Photo pic = (Photo)pictures.elementAt(index); -// pic.setIcon(icon); -// if (index == current) -// updatePhotograph(index, pic); -// } -// }; -// worker.start(); -// } - } From mwilkinson at pub.open-bio.org Mon Sep 26 23:19:33 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon, 26 Sep 2005 19:19:33 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509262319.j8QNJXQ8019359@pub.open-bio.org> mwilkinson Mon Sep 26 19:19:33 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv19340/MOBY/Client Modified Files: OntologyServer.pm Log Message: typo moby-live/Perl/MOBY/Client OntologyServer.pm,1.12,1.13 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm 2005/07/06 15:23:07 1.12 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm 2005/09/26 23:19:33 1.13 @@ -189,7 +189,7 @@ =cut -sub relationshipsExists { +sub relationshipExists { my ( $self, %args ) = @_; my $term = $args{'term'}; $term =~ s/^moby://; # if the term is namespaced, then remove that From mwilkinson at pub.open-bio.org Mon Sep 26 23:26:00 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon, 26 Sep 2005 19:26:00 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509262326.j8QNQ0WZ019519@pub.open-bio.org> mwilkinson Mon Sep 26 19:26:00 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv19500/MOBY Modified Files: Central.pm Log Message: retrieveNamespaces should now retrieve everything about a namespace, no longer a 'sink' as Martin so aptly phrased it moby-live/Perl/MOBY Central.pm,1.216,1.217 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.216 retrieving revision 1.217 diff -u -r1.216 -r1.217 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/20 21:16:11 1.216 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/26 23:26:00 1.217 @@ -2803,8 +2803,8 @@ if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - $ns .= "\n\n\n"; #COMMENT/REMOVE -# $ns .= "\n\n$contact\n$auth\n\n";#UNCOMMENT +# $ns .= "\n\n\n"; #COMMENT/REMOVE + $ns .= "\n\n$contact\n$auth\n\n";#UNCOMMENT } $ns .= ""; return $ns; From mwilkinson at pub.open-bio.org Tue Sep 27 00:01:24 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon, 26 Sep 2005 20:01:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509270001.j8R01ONI019712@pub.open-bio.org> mwilkinson Mon Sep 26 20:01:24 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv19693/MOBY/Client Modified Files: OntologyServer.pm Log Message: fixing ontology server relationshipExists call moby-live/Perl/MOBY/Client OntologyServer.pm,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm 2005/09/26 23:19:33 1.13 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm 2005/09/27 00:01:24 1.14 @@ -192,10 +192,11 @@ sub relationshipExists { my ( $self, %args ) = @_; my $term = $args{'term'}; + my $ontology = $args{'ontology'}; $term =~ s/^moby://; # if the term is namespaced, then remove that my $ua = $self->getUserAgent; my $req = HTTP::Request->new( POST => $self->host ); - $req->content( "relationshipExists=$term" ); + $req->content( "relationshipExists=$term&ontology=$ontology" ); my $res = $ua->request( $req ); if ( $res->is_success ) { return split "\n", $res->content; From mwilkinson at pub.open-bio.org Tue Sep 27 00:01:24 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon, 26 Sep 2005 20:01:24 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509270001.j8R01O7a019731@pub.open-bio.org> mwilkinson Mon Sep 26 20:01:24 EDT 2005 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv19693/scripts Modified Files: OntologyServer.cgi Log Message: fixing ontology server relationshipExists call moby-live/Perl/scripts OntologyServer.cgi,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/scripts/OntologyServer.cgi,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Perl/scripts/OntologyServer.cgi 2003/10/09 16:49:22 1.4 +++ /home/repository/moby/moby-live/Perl/scripts/OntologyServer.cgi 2005/09/27 00:01:24 1.5 @@ -7,10 +7,10 @@ my $q = CGI->new(); my @params = $q->param; -my $param = $params[0]; # one call per customer +my $subroutine = $params[0]; # one call per customer no strict "refs"; -&$param($q->param($param)); #call that subroutie with the passed value +&$subroutine($q->param($subroutine), $q); #call that subroutie with the passed value use strict; sub testme { @@ -60,10 +60,11 @@ } sub relationshipExists { + my ($term, $CGI) = @_; my $OS = MOBY::OntologyServer->new(ontology => "relationship"); - my ($success, $description, $id) = $OS->relationshipExists(term => $_[0]); - print header(-type => 'text/plain'), "$success\n$description\n$id"; - + my $ontology = $CGI->param('ontology'); + my ($success, $description, $id) = $OS->relationshipExists(ontology => $ontology, term => $term); + print header(-type => 'text/plain'), "$success\n$description\n$id"; } sub serviceExists { From mwilkinson at pub.open-bio.org Tue Sep 27 00:06:25 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon, 26 Sep 2005 20:06:25 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509270006.j8R06PEZ019801@pub.open-bio.org> mwilkinson Mon Sep 26 20:06:25 EDT 2005 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv19782/t Modified Files: Client-OntologyServer.t Log Message: fixing ontology server relationshipExists test moby-live/Perl/t Client-OntologyServer.t,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/16 16:38:15 1.4 +++ /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/27 00:06:24 1.5 @@ -88,13 +88,22 @@ or diag("OntologyServer should be able to tell whether a relationship exists"); my @check_rel = qw/ISA HASA HAS/; # There should only be very few valid relationship types. foreach (@check_rel) { - ($success, $msg, $existingURI) = $os->relationshipExists(term => $_); + ($success, $msg, $existingURI) = $os->relationshipExists(term => $_, ontology => 'object'); + is($success, 1) + or diag("Relationship '$_' reported erroneously as non-existent."); + } + my @check_rel2 = qw/ISA/; # There should only be very few valid relationship types. + foreach (@check_rel2) { + ($success, $msg, $existingURI) = $os->relationshipExists(term => $_, ontology => 'service'); is($success, 1) or diag("Relationship '$_' reported erroneously as non-existent."); } my $invalid_rel = "HA"; - ($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel); + ($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel, ontology => 'service'); + is($success, 0) + or diag("Relationship '$invalid_rel' reported erroneously as existent."); + ($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel, ontology => 'object'); is($success, 0) or diag("Relationship '$invalid_rel' reported erroneously as existent."); } From mwilkinson at pub.open-bio.org Mon Sep 26 23:28:44 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon, 26 Sep 2005 19:28:44 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509262328.j8QNSie2019563@pub.open-bio.org> mwilkinson Mon Sep 26 19:28:44 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv19544/MOBY Modified Files: Central.pm Log Message: retrieveNamespaces pod documentation updated moby-live/Perl/MOBY Central.pm,1.217,1.218 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.217 retrieving revision 1.218 diff -u -r1.217 -r1.218 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/26 23:26:00 1.217 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/26 23:28:44 1.218 @@ -2786,6 +2786,8 @@ + email at address.here + authority.uri.here ... ... From kawas at pub.open-bio.org Tue Sep 27 01:26:47 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Mon, 26 Sep 2005 21:26:47 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509270126.j8R1QlAL020096@pub.open-bio.org> kawas Mon Sep 26 21:26:47 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv20067 Modified Files: OntologyServer.pm Central.pm Log Message: committing the actual uncommentted changes made as per Martins' request moby-live/Perl/MOBY OntologyServer.pm,1.84,1.85 Central.pm,1.218,1.219 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.84 retrieving revision 1.85 diff -u -r1.84 -r1.85 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/20 21:16:34 1.84 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/27 01:26:47 1.85 @@ -924,8 +924,8 @@ my %response; foreach (@$types) { - $response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}]; #COMMENT/REMOVE - #$response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}, $_->{contact_email}, $_->{authority}]; #UNCOMMENT + #$response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}]; #COMMENT/REMOVE + $response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}, $_->{contact_email}, $_->{authority}]; #UNCOMMENT } return \%response; } =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.218 retrieving revision 1.219 diff -u -r1.218 -r1.219 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/26 23:28:44 1.218 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/27 01:26:47 1.219 @@ -2617,14 +2617,14 @@ my $OS = MOBY::OntologyServer->new( ontology => 'service' ); my %types = %{ $OS->retrieveAllServiceTypes() }; my $types = "\n"; - while ( my ( $serv, $descr ) = each %types ) { #COMMENT/REMOVE -# while ( my ( $serv, $descr, $contact, $auth ) = each %types ) { #UNCOMMENT +# while ( my ( $serv, $descr ) = each %types ) { #COMMENT/REMOVE + while ( my ( $serv, $descr, $contact, $auth ) = each %types ) { #UNCOMMENT my ($desc, $lsid) = @$descr; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } - $types .="\n\n\n"; #COMMENT/REMOVE -# $types .="\n\n$contact\n$auth\n\n"; #UNCOMMENT +# $types .="\n\n\n"; #COMMENT/REMOVE + $types .="\n\n$contact\n$auth\n\n"; #UNCOMMENT } $types .= "\n"; return $types; From mwilkinson at pub.open-bio.org Tue Sep 27 14:44:34 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 27 Sep 2005 10:44:34 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509271444.j8REiYtu023350@pub.open-bio.org> mwilkinson Tue Sep 27 10:44:34 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv23327/MOBY Modified Files: Central.pm OntologyServer.pm Log Message: well, Eddie, that was ALMOST correct :-) moby-live/Perl/MOBY Central.pm,1.219,1.220 OntologyServer.pm,1.85,1.86 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.219 retrieving revision 1.220 diff -u -r1.219 -r1.220 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/27 01:26:47 1.219 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/27 14:44:34 1.220 @@ -2617,13 +2617,11 @@ my $OS = MOBY::OntologyServer->new( ontology => 'service' ); my %types = %{ $OS->retrieveAllServiceTypes() }; my $types = "\n"; -# while ( my ( $serv, $descr ) = each %types ) { #COMMENT/REMOVE - while ( my ( $serv, $descr, $contact, $auth ) = each %types ) { #UNCOMMENT - my ($desc, $lsid) = @$descr; + while ( my ( $serv, $descr ) = each %types ) { #UNCOMMENT + my ($desc, $lsid, $contact, $auth) = @$descr; if ( $desc =~ /[^\]]+))\]\]>/ ) { $desc = $1; } -# $types .="\n\n\n"; #COMMENT/REMOVE $types .="\n\n$contact\n$auth\n\n"; #UNCOMMENT } $types .= "\n"; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.85 retrieving revision 1.86 diff -u -r1.85 -r1.86 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/27 01:26:47 1.85 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/27 14:44:34 1.86 @@ -924,7 +924,6 @@ my %response; foreach (@$types) { - #$response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}]; #COMMENT/REMOVE $response{ $_->{service_type} } = [$_->{description}, $_->{service_lsid}, $_->{contact_email}, $_->{authority}]; #UNCOMMENT } return \%response; From mwilkinson at pub.open-bio.org Tue Sep 27 16:19:21 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 27 Sep 2005 12:19:21 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509271619.j8RGJLQ3026218@pub.open-bio.org> mwilkinson Tue Sep 27 12:19:21 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv26197/MOBY Modified Files: Central.pm Log Message: added two new methods to MOBY Client Central to extract the additional details from namespace and service retrieval moby-live/Perl/MOBY Central.pm,1.220,1.221 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.220 retrieving revision 1.221 diff -u -r1.220 -r1.221 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/27 14:44:34 1.220 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2005/09/27 16:19:21 1.221 @@ -2605,6 +2605,8 @@ + your at email.here + authority.uri.here ... ... From mwilkinson at pub.open-bio.org Tue Sep 27 16:19:21 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 27 Sep 2005 12:19:21 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509271619.j8RGJLDY026237@pub.open-bio.org> mwilkinson Tue Sep 27 12:19:21 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv26197/MOBY/Client Modified Files: Central.pm Log Message: added two new methods to MOBY Client Central to extract the additional details from namespace and service retrieval moby-live/Perl/MOBY/Client Central.pm,1.124,1.125 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.124 retrieving revision 1.125 diff -u -r1.124 -r1.125 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/09/16 17:01:10 1.124 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/09/27 16:19:21 1.125 @@ -1236,7 +1236,6 @@ " . ( $SI->XML ) . " "; -# my $return = $self->SOAP_connection($reg)->call(retrieveService => ($message))->paramsall; my ($return) = $self->_call( $reg, 'retrieveService', $message ); my $parser = XML::LibXML->new(); my $doc = $parser->parse_string($return); @@ -1292,7 +1291,7 @@ =head2 retrieveServiceNames - Usage : $names = $MOBY->retrieveServiceNames([$reg_name]) + Usage : $names = $MOBY->retrieveServiceNames(%args) Function : get a (redundant) list of all registered service names (N.B. NOT service types!) Returns : hashref to the following hash @@ -1367,7 +1366,7 @@ =head2 retrieveServiceTypes - Usage : $types = $MOBY->retrieveServiceTypes([$reg_name]) + Usage : $types = $MOBY->retrieveServiceTypes(%args) Function : get the list of all registered service types Returns : hashref of $types{$type} = $definition Args : registry => $reg_name: name of registry you wish to retrieve from (optional) @@ -1414,6 +1413,76 @@ return \%servicetypes; } + +=head2 retrieveServiceTypesFull + + Usage : $types = $MOBY->retrieveServiceTypesFull(%args) + Function : get all details of all service types + Returns : hashref of $types{$type} = {definition => "definition", + authURI => "authority.uri.here", + contactEmail => "email at addy.here"} + Args : registry => $reg_name: name of registry you wish to retrieve from (optional) + as_lsid => $boolean: return the $type as its corresponding LSID (defualt off) + +=cut + + +sub retrieveServiceTypesFull { + my ($self, %args) = shift; + my $reg = $args{registry}; + my $as_lsid = $args{as_lsid}; + + $reg = $reg ? $reg : $self->default_MOBY_servername; + return undef unless ( $self->Connection($reg) ); + +# my $return = $self->SOAP_connection($reg)->call('retrieveServiceTypes' => (@_))->paramsall; + my ($return) = $self->_call( $reg, 'retrieveServiceTypes', "" ); + my $parser = XML::LibXML->new(); + my $doc = $parser->parse_string($return); + my $root = $doc->getDocumentElement; + my $types = $root->childNodes; + my %servicetypes; + for ( my $x = 1 ; $x <= $types->size() ; $x++ ) { + next unless $types->get_node($x)->nodeType == ELEMENT_NODE; + my $type = $types->get_node($x)->getAttributeNode('name')->getValue; + my $lsid = $types->get_node($x)->getAttributeNode('lsid'); + if ($lsid){ + $lsid = $lsid->getValue; + } else { + $lsid = $type; + } + my ($desc, $auth, $email); + for + my $elem ( $types->get_node($x)->getElementsByTagName('Description') ) + { + $desc = $elem->firstChild->toString; + if ( $desc =~ /[^\]]+))\]\]>/ ) { + $desc = $1; + } + } + for + my $elem ( $types->get_node($x)->getElementsByTagName('authURI') ) + { + $auth = $elem->firstChild->toString; + if ( $auth =~ /[^\]]+))\]\]>/ ) { + $auth = $1; + } + } + for + my $elem ( $types->get_node($x)->getElementsByTagName('contactEmail') ) + { + $emai = $elem->firstChild->toString; + if ( $email =~ /[^\]]+))\]\]>/ ) { + $email = $1; + } + } + $desc =~ s/[^\]]+))\]\]>/$1/gs; # somehow these CDATA elements are nested sometimes??? + $servicetypes{$as_lsid?$lsid:$type} = {Description => $desc, authURI => $auth, contactEmail => $email}; + } + return \%servicetypes; +} + + =head2 retrieveObjectNames Usage : $names = $MOBY->retrieveObjectNames([$reg_name]) @@ -1463,7 +1532,7 @@ =head2 retrieveNamespaces - Usage : $ns = $MOBY->retrieveNamespaces([$reg_name]) + Usage : $ns = $MOBY->retrieveNamespaces(%args) Function : get the list of all registered Namespace types Returns : hashref of hash: $ns{$namespace} = $definition @@ -1511,6 +1580,78 @@ return \%namespaces; } +=head2 retrieveNamespacesFull + + Usage : $ns = $MOBY->retrieveNamespaces(%args) + Function : get all details about all namespaces + Returns : hashref of hash: + $ns{$namespace} = {Definition => $definition, + authURI => $authority, + contactEmail => $email} + Args : registry => $reg_name: name of registry you wish to retrieve from (optional) + as_lsid => $boolean: retrieve $namespace as its corresponding LSID (default off) + +=cut + +sub retrieveNamespaces { + my ($self, %args) = shift; + my $reg = $args{registry}; + $reg = $reg ? $reg : $self->default_MOBY_servername; + return undef unless ( $self->Connection($reg) ); + my $as_lsid = $args{as_lsid}; + + my ($return) = $self->_call( $reg, 'retrieveNamespaces', "" ); + my $parser = XML::LibXML->new(); + my $doc = $parser->parse_string($return); + my $root = $doc->getDocumentElement; + my $namesp = $root->childNodes; + my %namespaces; + for ( my $x = 1 ; $x <= $namesp->size() ; $x++ ) { + next unless $namesp->get_node($x)->nodeType == ELEMENT_NODE; + my $ns = $namesp->get_node($x)->getAttributeNode('name')->getValue; + my $lsid = $namesp->get_node($x)->getAttributeNode('lsid'); + if ($lsid){ + $lsid = $lsid->getValue; + } else { + $lsid = $ns; + } + my ($desc, $auth, $email); + for my $elem ( + $namesp->get_node($x)->getElementsByTagName('Description') ) + { + $desc = $elem->firstChild; + $desc = $desc ? $desc->toString : ""; + $desc ||=""; + if ( $desc =~ /[^\]]+))\]\]>/ ) { + $desc = $1; + } + } + for my $elem ( + $namesp->get_node($x)->getElementsByTagName('authURI') ) + { + $auth = $elem->firstChild; + $auth = $auth ? $auth->toString : ""; + $auth ||=""; + if ( $auth =~ /[^\]]+))\]\]>/ ) { + $auth = $1; + } + } + for my $elem ( + $namesp->get_node($x)->getElementsByTagName('contactEmail') ) + { + $email = $elem->firstChild; + $email = $email ? $email->toString : ""; + $email ||=""; + if ( $email =~ /[^\]]+))\]\]>/ ) { + $email = $1; + } + } + $namespaces{$as_lsid?$lsid:$ns} = {Description => $desc, authURI => $auth, contactEmail => $email}; + } + return \%namespaces; +} + + =head2 retrieveObject Usage : $objects = $MOBY->retrieveObjectNames(%args) From mwilkinson at pub.open-bio.org Tue Sep 27 16:21:04 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Tue, 27 Sep 2005 12:21:04 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509271621.j8RGL4XV026334@pub.open-bio.org> mwilkinson Tue Sep 27 12:21:04 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv26315/MOBY/Client Modified Files: Central.pm Log Message: added two new methods to MOBY Client Central to extract the additional details from namespace and service retrieval moby-live/Perl/MOBY/Client Central.pm,1.125,1.126 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.125 retrieving revision 1.126 diff -u -r1.125 -r1.126 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/09/27 16:19:21 1.125 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2005/09/27 16:21:04 1.126 @@ -1471,7 +1471,7 @@ for my $elem ( $types->get_node($x)->getElementsByTagName('contactEmail') ) { - $emai = $elem->firstChild->toString; + $email = $elem->firstChild->toString; if ( $email =~ /[^\]]+))\]\]>/ ) { $email = $1; } @@ -1593,7 +1593,7 @@ =cut -sub retrieveNamespaces { +sub retrieveNamespacesFull { my ($self, %args) = shift; my $reg = $args{registry}; $reg = $reg ? $reg : $self->default_MOBY_servername; From fgibbons at pub.open-bio.org Wed Sep 28 00:24:26 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 27 Sep 2005 20:24:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509280024.j8S0OQx5027540@pub.open-bio.org> fgibbons Tue Sep 27 20:24:26 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory pub.open-bio.org:/tmp/cvs-serv27515 Modified Files: index_API.html Log Message: - Added a URL. moby-live/Docs/MOBY-S_API index_API.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/index_API.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/index_API.html 2005/08/25 16:03:20 1.2 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/index_API.html 2005/09/28 00:24:26 1.3 @@ -62,8 +62,8 @@ developers' mailing list. Among them are:

            +You can join the MOBY-S community by subscribing to the mailing list. + +You can also report a bug or request a new feature + \ No newline at end of file From fgibbons at pub.open-bio.org Wed Sep 28 00:24:26 2005 From: fgibbons at pub.open-bio.org (Frank Gibbons) Date: Tue, 27 Sep 2005 20:24:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509280024.j8S0OQnN027567@pub.open-bio.org> fgibbons Tue Sep 27 20:24:26 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl In directory pub.open-bio.org:/tmp/cvs-serv27515/Perl Modified Files: ConstructingYourService.html RegisterAnObject.html RegisterNamespace.html Log Message: - Added a URL. moby-live/Docs/MOBY-S_API/Perl ConstructingYourService.html,1.2,1.3 RegisterAnObject.html,1.1,1.2 RegisterNamespace.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html 2005/08/25 16:03:20 1.2 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/ConstructingYourService.html 2005/09/28 00:24:26 1.3 @@ -12,23 +12,27 @@ MOBY-S Compliant Services First you need to check the following:
              -
            • Do the object type(s) that your service will consume already -exist in the Object Ontology? If not, Do the object type(s) that your service will consume already +exist in the + +Object Ontology? If not, learn how to design your own MOBY objects
            • -
            • Do the object type(s) that your service will produce already -exist in the Object Ontology? If not, then you need to Do the object type(s) that your service will produce already +exist in the +Object Ontology? If not, then you need to register your objects in the MOBY-S object/class ontology
            • Does an appropriate service type term already exist in the -Service Ontology? You need to Service Ontology? You need to register your new service type in the MOBY-S service ontology.
            • -
            • Do the Namespaces that you are going to use in your objects -already exist in the Service Ontology? Do the namespaces that you are going to use in your objects +already exist in the +Namespace Ontology? Register your namespace, if it doesn't already exist.
            • =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterAnObject.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterAnObject.html 2005/08/25 14:02:54 1.1 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterAnObject.html 2005/09/28 00:24:26 1.2 @@ -10,6 +10,8 @@

              Using the Perl API to register an object

              +MOBY already has a +rather extensive ontology of data/object types. Still, if you can't find what you need, you have to create your own. The signature for the registerObject method is as follows:
               my $REG = $MOBY->registerObject(
              
              ===================================================================
              RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterNamespace.html,v
              retrieving revision 1.1
              retrieving revision 1.2
              diff -u -r1.1 -r1.2
              --- /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterNamespace.html	2005/08/25 14:03:25	1.1
              +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/Perl/RegisterNamespace.html	2005/09/28 00:24:26	1.2
              @@ -18,7 +18,10 @@
               that the ID referrs to.  For example, gi numbers always
               represent Genbank records, and identifiers in the format GO::0003346
               always represent Gene Ontology Terms.  As such, much of
              -MOBY-S is built to take advantage of this predeictability.  

              +MOBY-S is built to take advantage of this predeictability. (An + +up-to-date list of currently available namespaces, is available here.) +

              In MOBY-S, service providers will often define their interfaces in terms of Namespaces - i.e. they are saying "I know how to do something From mwilkinson at pub.open-bio.org Wed Sep 28 22:05:59 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 28 Sep 2005 18:05:59 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509282205.j8SM5xCD031130@pub.open-bio.org> mwilkinson Wed Sep 28 18:05:58 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory pub.open-bio.org:/tmp/cvs-serv31107 Modified Files: CentralRegistry.html XMLPayloads.html Log Message: updating the docs with new features added yesterday v.v. retreival of namespaces and service types. Also a couple of doc errors fixed. moby-live/Docs/MOBY-S_API CentralRegistry.html,1.2,1.3 XMLPayloads.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html 2005/08/25 16:03:20 1.2 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html 2005/09/28 22:05:58 1.3 @@ -72,13 +72,13 @@ retrieveServiceTypes - Retrieve the service ontology, showing all registered service types. +Retrieve the definitions and registration details of all registered service types. retrieveObjectNames - Retrieve the object ontology, showing all registered object types. +Retrieve the object ontology, showing all registered object types. @@ -98,7 +98,7 @@ retrieveObjectSchema - Retrieve an XML schema representation of a particular object class. + Retrieve an XML schema representation of a particular object class. This is currently not implemented since it appears to be impossible to represent MOBY Objects in XML Schema due to limitations of XML Schema =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2005/08/25 16:03:20 1.2 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/XMLPayloads.html 2005/09/28 22:05:58 1.3 @@ -221,7 +221,16 @@ <Resource name="Namespace" url="...Y..."/> </resourceURLs>

              +

              Notes

              +
                + +
              • Finds the URL from which the RDF of a MOBY Ontology +can be retrieved by HTTP GET. There are five possible ontology names: +"Service", "Object", "Namespace", "ServiceInstance", or "Full" (Full +retrieves all of the ontologies)
              • + +

              retrieveServiceNames

              Input XML

              @@ -235,16 +244,16 @@ ... </serviceNames> -

              Notes

                - -
              • Finds the URL from which the RDF of a MOBY Ontology -can be retrieved by HTTP GET. There are five possible ontology names: -"Service", "Object", "Namespace", "ServiceInstance", or "Full" (Full -retrieves all of the ontologies)
              • - +
              • Retrieves minimal information about all registered MOBY services
              • +
                  +
                • serviceName +
                • authority +
                • service instance LSID
                +
              +

              retrieveServiceTypes

              @@ -256,6 +265,8 @@ <serviceTypes> <serviceType name="serviceName" lsid='urn:lsid:authority.uri:servicetype:id'> <Description><![CDATA[free text description here]]></Description> + <contactEmail>email at address here</contactEmail> + <authURI>authority.uri.here</authURI> </serviceType> ... </serviceTypes> @@ -263,7 +274,7 @@

              Notes

                -
              • Gets a full dump of the Service Type ontology (excluding +
              • Gets a full dump of the Service Type ontology as MOBY XML (excluding relationships)
              • A new API call will be created at a later date to retrieve the @@ -343,6 +354,8 @@ <Namespaces> <Namespace name="namespace" lsid='urn:lsid:authority.uri:namespace:id'> <Description><![CDATA[free text description here]]></Description> + <contactEmail>email at address here</contactEmail> + <authURI>authority.uri.here</authURI> </Namespace> ... </Namespaces> From mwilkinson at pub.open-bio.org Wed Sep 28 22:26:21 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 28 Sep 2005 18:26:21 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509282226.j8SMQLsa031220@pub.open-bio.org> mwilkinson Wed Sep 28 18:26:21 EDT 2005 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory pub.open-bio.org:/tmp/cvs-serv31201 Modified Files: CentralRegistry.html Log Message: updating the docs with new features added yesterday v.v. retreival of namespaces and service types. Also a couple of doc errors fixed. moby-live/Docs/MOBY-S_API CentralRegistry.html,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html 2005/09/28 22:05:58 1.3 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/CentralRegistry.html 2005/09/28 22:26:21 1.4 @@ -70,15 +70,15 @@ -retrieveServiceTypes +retrieveServiceTypes Retrieve the definitions and registration details of all registered service types. -retrieveObjectNames +retrieveObjectNames -Retrieve the object ontology, showing all registered object types. +Retrieve the definitions and registration details of all registered object types. From kawas at pub.open-bio.org Thu Sep 29 20:14:12 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Thu, 29 Sep 2005 16:14:12 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509292014.j8TKECEq002917@pub.open-bio.org> kawas Thu Sep 29 16:14:11 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util In directory pub.open-bio.org:/tmp/cvs-serv2892/org/biomoby/registry/rdfagent/util Modified Files: Report.java Log Message: Handling the error stream, just in case, so that the system call doesnt hang. moby-live/Java/src/main/org/biomoby/registry/rdfagent/util Report.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java 2005/09/12 18:22:10 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Report.java 2005/09/29 20:14:11 1.8 @@ -12,10 +12,13 @@ * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ +import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; import java.util.ArrayList; import org.biomoby.registry.rdfagent.verifier.Communicator; @@ -101,6 +104,13 @@ "chmod +x _script_.sh"); p.waitFor(); p = Runtime.getRuntime().exec("./_script_.sh"); + InputStream stderr = p.getErrorStream(); + InputStreamReader isr = new InputStreamReader(stderr); + BufferedReader br = new BufferedReader(isr); + String line = null; + while ((line = br.readLine()) != null) { + + } p.waitFor(); Log.info("_script_.sh has " + ((file.delete()) ? "" : "not ") + "been deleted" From kawas at pub.open-bio.org Fri Sep 30 14:44:58 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri, 30 Sep 2005 10:44:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509301444.j8UEiwcf006386@pub.open-bio.org> kawas Fri Sep 30 10:44:58 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared In directory pub.open-bio.org:/tmp/cvs-serv6357/org/biomoby/client/ui/graphical/applets/shared Modified Files: Construct.java MobyTree.java Log Message: modified the code so that an arbitrary tree can be created using any rdf document and a property to base the tree on. This was done mainly for a student project that will create web forms that pop up these trees based on rdf. moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared Construct.java,1.2,1.3 MobyTree.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/Construct.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/Construct.java 2005/08/29 22:59:35 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/Construct.java 2005/09/30 14:44:58 1.3 @@ -1,15 +1,11 @@ package org.biomoby.client.ui.graphical.applets.shared; -import java.io.ByteArrayInputStream; -import java.io.FileInputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; -import org.biomoby.client.ui.graphical.servlet.jresources.RESOURCE; - import com.hp.hpl.jena.mem.ModelMem; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.Statement; @@ -120,4 +116,72 @@ return homes; } + + /** + * + * PRE: none.

                + * POST: A Hashmap containing object names as keys and their relationships,

                + * in an array, as the value. + * @param property the property to build the tree from RDF + * @return returns a hashmap containing the object name as the key + * and an arraylist of children as the value. + */ + public HashMap createHomes(String property) { + HashMap homes = new HashMap(); // (key=parent,val=household) + try { + // create an empty model + Model model = new ModelMem(); + + InputStream in = new URL(url).openStream(); + + // read the RDF/XML data + model.read(new InputStreamReader(in), ""); + StmtIterator iter; + Statement stmt; + + iter = model.listStatements(); + while (iter.hasNext()) { + stmt = (Statement) iter.next(); + + String sub = stmt.getSubject().getURI(); + String obj = stmt.getObject().toString(); + if (sub != null) + sub = sub.substring(sub.indexOf("#") + 1, sub.length()); + if (obj!= null) + obj = obj.substring(obj.indexOf("#") + 1, obj.length()); + + if (stmt.getPredicate().getURI().indexOf(property) > 0) { + //System.out.println(obj); + // we have the relationship that we want in the tree + if (homes.containsKey(obj)) { + // hash contains the home -> get the home and add child to household + Household h = (Household)homes.get(obj); + ArrayList ch = h.getChildren(); + ch.add(sub); + h.setChildren(ch); + if (DEBUG) { + System.out.println(h.toString()); + } + homes.put(obj,h); + } else { + // hash doesn't have the parent, so add the parent and child to a new household + ArrayList ch = new ArrayList(); + ch.add(sub); // add the child + Household h = new Household(obj, ch); + if (DEBUG) { + //System.out.println("New Parent: " + obj + " child: " + sub); + System.out.println(h.toString()); + } + homes.put(obj,h); + } + } // hashmap is created + + } + + } catch (Exception e) { + System.err.println("Failed: " + e.getMessage()+"\n" + e.getStackTrace()); + } + + return homes; + } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java 2005/06/02 15:48:54 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/shared/MobyTree.java 2005/09/30 14:44:58 1.3 @@ -67,6 +67,29 @@ JScrollPane scrollPane = new JScrollPane(tree); add(scrollPane); } + + /** + * A moby tree is constructed with the root node labeled as 'name'

                + * and the material for the tree taken from the RDF located at

                + * the url rdf. The tree is created by looking for the property property

                + * @param canEdit - if true then nodes in tree can be edited, otherwise they cannot. + * @param rdf - the url of the RDF describing Moby Objects, Services, Service Types, and Namespaces + * @param name - the name of the root node in the tree. + * @param property - the property to parse the rdf document and base a tree on + */ + public MobyTree(boolean canEdit, String rdf, String name, String property) { + + // create the layout + super(new GridLayout(1, 0)); + this.canEdit = canEdit; + this.rdf = rdf; + this.name = name; + reload(canEdit, name, property); + + + JScrollPane scrollPane = new JScrollPane(tree); + add(scrollPane); + } private void reload(boolean canEdit, String name) { // hashmap contains all the children of the root object @@ -82,6 +105,23 @@ tree.setShowsRootHandles(true); } + + /* + * + * create a tree based on property instead of subClassOf + */ + private void reload(boolean canEdit, String name, String property) { + // hashmap contains all the children of the root object + this.hashmap = new Construct(rdf).createHomes(property); + rootNode = new DefaultMutableTreeNode(name); + treeModel = new DefaultTreeModel(rootNode); + treeModel.addTreeModelListener(new MobyTreeModelListener()); + tree = new JTree(treeModel); + tree.setEditable(canEdit); + tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); + tree.setShowsRootHandles(true); + + } /** * PRE: None.

                From kawas at pub.open-bio.org Fri Sep 30 14:45:56 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri, 30 Sep 2005 10:45:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509301445.j8UEjum8006444@pub.open-bio.org> kawas Fri Sep 30 10:45:56 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/objectCreationTool In directory pub.open-bio.org:/tmp/cvs-serv6419/org/biomoby/client/ui/graphical/applets/objectCreationTool Modified Files: retrieveObjectXML.cgi Log Message: corrected the call to mobycentral that was updated recently. moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/objectCreationTool retrieveObjectXML.cgi,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/objectCreationTool/retrieveObjectXML.cgi,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/objectCreationTool/retrieveObjectXML.cgi 2005/07/19 15:36:24 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/applets/objectCreationTool/retrieveObjectXML.cgi 2005/09/30 14:45:56 1.3 @@ -14,7 +14,7 @@ my $name; my $cgi = CGI->new(); $name = $cgi->param( 'name' ) or die; - $DEFS = $Central->retrieveObjectDefinition($name); + $DEFS = $Central->retrieveObjectDefinition(objectType => $name); print "Content-type: text/plain\n\n"; my $output = $DEFS->{'XML'}; $output =~ s/retrieveObjectDefinition/objectDetails/g; From kawas at pub.open-bio.org Fri Sep 30 14:48:22 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri, 30 Sep 2005 10:48:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509301448.j8UEmMfD006514@pub.open-bio.org> kawas Fri Sep 30 10:48:22 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms In directory pub.open-bio.org:/tmp/cvs-serv6485/org/biomoby/client/ui/graphical/servlet/forms Modified Files: GetSignatureRDFResponse.java GetSignatureRDFForm.java Log Message: *modified the domain to be portless since some people dont like 8090 etc moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms GetSignatureRDFResponse.java,1.3,1.4 GetSignatureRDFForm.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFResponse.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFResponse.java 2005/07/19 15:28:28 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFResponse.java 2005/09/30 14:48:22 1.4 @@ -37,18 +37,18 @@ final private String newline = System.getProperty("line.separator"); - final static private String error = "\r\n" - + "\r\n" - + "\r\n" - + "Please Try Again\r\n" - + "\r\n" - + "\r\n" - + "\r\n" - + "

                Unable to update your information

                \r\n" - + "
                \r\n" - + "

                Make sure that you specify a valid signature url! This field looks like the following: http://myAuthority.domain/path/to/rdf/for/service. Also make sure that you have specified the right case-sensitive service name, if applicable.

                \r\n" - + "

                Back

                \r\n" - + "
                \r\n" + "\r\n" + ""; + final static private String error = "" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + "" + + "Please Try Again" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + "" + + "" + System.getProperty("line.separator") + "" + + "

                Unable to update your information

                " + System.getProperty("line.separator") + "" + + "
                " + System.getProperty("line.separator") + "" + + "

                Make sure that you specify a valid signature url! This field looks like the following: http://myAuthority.domain/path/to/rdf/for/service. Also make sure that you have specified the right case-sensitive service name, if applicable.

                " + System.getProperty("line.separator") + "" + + "

                Back

                " + System.getProperty("line.separator") + "" + + "
                " + System.getProperty("line.separator") + "" + "" + System.getProperty("line.separator") + "" + ""; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFForm.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFForm.java 2005/07/19 15:28:28 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFForm.java 2005/09/30 14:48:22 1.4 @@ -34,7 +34,7 @@ // some useful variables private final String newline = System.getProperty("line.separator"); - private static final String DOMAIN = "mobycentral.icapture.ubc.ca:8090"; + private static final String DOMAIN = "mobycentral.icapture.ubc.ca"; /* (non-Javadoc) * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) @@ -50,6 +50,7 @@ String[] domains = null; // initialize central try { + //TODO - enter the endpoint here central = new CentralImpl(); domains = central.getProviders(); } catch (MobyException e) { From kawas at pub.open-bio.org Fri Sep 30 14:50:40 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri, 30 Sep 2005 10:50:40 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509301450.j8UEoeNM006580@pub.open-bio.org> kawas Fri Sep 30 10:50:40 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv6551/org/biomoby/client/ui/graphical/servlet/lsid/authority Modified Files: LSIDAuthorityData.java LSIDDataLookup.java Log Message: modified the get data logic. moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority LSIDAuthorityData.java,1.2,1.3 LSIDDataLookup.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDAuthorityData.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDAuthorityData.java 2005/08/30 23:30:58 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDAuthorityData.java 2005/09/30 14:50:40 1.3 @@ -47,19 +47,26 @@ // "No data exists for the given lsid"); LSID lsid = req.getLsid(); if (lookup.isValidDataType(lsid)) { - String datatype = lsid.getObject(); - // build the schema - Builder builder = new Builder(); - Element root = builder.buildSchema(datatype); - // create a jDom document - Document doc = new Document(root); - XMLOutputter fmt = new XMLOutputter(); - Format format = Format.getPrettyFormat(); - fmt.setFormat(format); - // convert document to string - String schema = fmt.outputString(doc); - // return an input stream - return new ByteArrayInputStream(schema.getBytes()); + + int type = lookup.dataLsidType(lsid); + if (type == LSIDDataLookup.OBJECT_CLASS) { + String datatype = lsid.getObject(); + // build the schema + Builder builder = new Builder(); + Element root = builder.buildSchema(datatype); + // create a jDom document + Document doc = new Document(root); + XMLOutputter fmt = new XMLOutputter(); + Format format = Format.getPrettyFormat(); + fmt.setFormat(format); + // convert document to string + String schema = fmt.outputString(doc); + // return an input stream + return new ByteArrayInputStream(schema.getBytes()); + } + if (type == LSIDDataLookup.SERVICE_INSTANCE) { + + } } throw new LSIDServerException(LSIDServerException.NO_DATA_AVAILABLE, "No data exists for the given lsid"); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java 2005/08/30 23:30:58 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java 2005/09/30 14:50:40 1.4 @@ -65,12 +65,34 @@ } + /** + * + * @param lsid an lsid to check whether we have 'data' on it or not + * @return true if getData has actual data under the namespace of the lsid. False otherwise. + */ public boolean isValidDataType (LSID lsid) { String ns = lsid.getNamespace(); - if (ns.equalsIgnoreCase(mobyobject.getProperty("lsid_namespace"))) + if (ns.equalsIgnoreCase(mobyobject.getProperty("lsid_namespace")) || ns.equalsIgnoreCase(mobycentral.getProperty("lsid_namespace"))) return true; return false; } + + + public int dataLsidType(LSID lsid) { + String ns = lsid.getNamespace(); + String id = lsid.getObject(); + String ver = lsid.getRevision(); + if (ver != null || (ver != null && ver.length() != 0)) + return UNKNOWN; + if (ns.equalsIgnoreCase(mobyobject.getProperty("lsid_namespace"))) { + return LSIDDataLookup.OBJECT_CLASS; + } + if (ns.equalsIgnoreCase(mobycentral.getProperty("lsid_namespace"))) { + return LSIDDataLookup.SERVICE_INSTANCE; + } + return UNKNOWN; + } + public int lsidType(LSID lsid) throws LSIDServerException { String ns = lsid.getNamespace(); String id = lsid.getObject(); From kawas at pub.open-bio.org Fri Sep 30 14:52:55 2005 From: kawas at pub.open-bio.org (Eddie Kawas) Date: Fri, 30 Sep 2005 10:52:55 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509301452.j8UEqttV006638@pub.open-bio.org> kawas Fri Sep 30 10:52:54 EDT 2005 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder In directory pub.open-bio.org:/tmp/cvs-serv6613/org/biomoby/client/rdf/builder Modified Files: ServiceInstanceRDF.java Log Message: modified the lsid authority domain to be hard coded to biomoby.org moby-live/Java/src/main/org/biomoby/client/rdf/builder ServiceInstanceRDF.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2005/08/29 20:22:32 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2005/09/30 14:52:54 1.8 @@ -39,9 +39,14 @@ */ /** - * @author Eddie Kawas

                This class was created to present a way to retrieve a - * service instances' RDF using just a service name and authority.

                For - * questions, comments, or bugs

                email me at edward.kawas at gmail.com + * @author Eddie Kawas + *

                + * This class was created to present a way to retrieve a service + * instances' RDF using just a service name and authority. + *

                + * For questions, comments, or bugs + *

                + * email me at edward.kawas at gmail.com */ public class ServiceInstanceRDF { @@ -79,10 +84,13 @@ /** * - * PRE:name is either a valid name or null

                POST:If - * authorURI is a valid authority, then a RDF containing all of the service - * instances will be returned. If authorURI and name are valid then a single - * RDF containing just the service instance identified by name is returned.

                + * PRE: name is either a valid name or null + *

                + * POST: If authorURI is a valid authority, then a RDF containing all + * of the service instances will be returned. If authorURI and name are + * valid then a single RDF containing just the service instance identified + * by name is returned. + *

                * * @param authorURI - * the authority to query @@ -108,8 +116,11 @@ /** * * method that retrieves the RDF describing a specific service instance - * based on the parameters domain, serviceName, url and uri.

                PRE:None. - *

                POST:The RDF describing the service with parameters domain, + * based on the parameters domain, serviceName, url and uri. + *

                + * PRE: None. + *

                + * POST: The RDF describing the service with parameters domain, * serviceName, url and uri is created. * * @param domain - @@ -282,11 +293,23 @@ .getCategory(), "en")); subject.addProperty(DC.source, model.createTypedLiteral(services[i] .getURL())); - subject.addProperty(DC.identifier, model - .createTypedLiteral("urn:lsid:" - + MobyProperties.SERVICE_INSTANCE_PROPERTIES().getProperty("lsid_authority") +":" - + MobyProperties.SERVICE_INSTANCE_PROPERTIES().getProperty("lsid_namespace") +":"+ services[i].getAuthority() - + "," + services[i].getName())); + subject + .addProperty( + DC.identifier, + model + .createTypedLiteral("urn:lsid:" + + "biomoby.org" + + ":" + + (MobyProperties + .SERVICE_INSTANCE_PROPERTIES() + .getProperty( + "lsid_namespace") == null ? "serviceinstance" + : MobyProperties + .SERVICE_INSTANCE_PROPERTIES() + .getProperty( + "lsid_namespace")) + + ":" + services[i].getAuthority() + + "," + services[i].getName())); subject.addProperty(Predicates.performs_task, model .createResource(SRV + services[i].getType())); subject.addProperty(Predicates.SignatureURL, model @@ -375,8 +398,7 @@ .getDefaultValue())); _li.addProperty(Predicates.datatype, model .createTypedLiteral(data.getDataType())); - _li.addProperty(RDF.type, - Predicates.Secondary); + _li.addProperty(RDF.type, Predicates.Secondary); if (data.getDataType().equals("Integer")) { _li .addProperty(Predicates.min, model @@ -476,7 +498,7 @@ return stream.getOutput(); } - + /* * convenience method that adds a resource to a model */ @@ -519,9 +541,12 @@ /** * - * PRE:None

                POST:If a service instance exists such that - * it has a name of name and an authoring URI of uri true is returned, - * otherwise false is returned.

                + * PRE: None + *

                + * POST: If a service instance exists such that it has a name of name + * and an authoring URI of uri true is returned, otherwise false is + * returned. + *

                * * @param uri - * the authors uri @@ -554,10 +579,13 @@ /** * - * Usage: ServiceInstanceRDF authorityURI [serviceName]

                - * authorityURI: is the authortitys' domain to query

                - * serviceName:optional argument that identifies a specific service - * instance

                + * Usage: ServiceInstanceRDF authorityURI [serviceName] + *

                + * authorityURI: is the authortitys' domain to query + *

                + * serviceName: optional argument that identifies a specific service + * instance + *

                * * @throws LSIDException */ @@ -588,4 +616,4 @@ public String getOutput() { return sb.toString(); } -} +} \ No newline at end of file From mwilkinson at pub.open-bio.org Fri Sep 30 23:08:36 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Fri, 30 Sep 2005 19:08:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509302308.j8UN8apA008098@pub.open-bio.org> mwilkinson Fri Sep 30 19:08:35 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv8079/MOBY Modified Files: OntologyServer.pm Log Message: OntologyServer was returning NCBI_Acc as the namespace if you passed it a null query. Yuck moby-live/Perl/MOBY OntologyServer.pm,1.86,1.87 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.86 retrieving revision 1.87 diff -u -r1.86 -r1.87 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/27 14:44:34 1.86 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/30 23:08:35 1.87 @@ -191,6 +191,7 @@ $term =~ s/^moby://; # if the term is namespaced, then remove that my $sth; return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); + return (0, undef, undef) unless defined $term; my $result; @@ -653,6 +654,8 @@ { return ( 1, "external ontology", $term ); } + return (0, undef, undef) unless defined $term; + my $result; $result = $adaptor->query_service(type => $term); my $row = shift(@$result); @@ -783,6 +786,7 @@ return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'namespace' ); my $term = $args{term}; + return (0, undef, undef) unless defined $term; $term =~ s/^moby://; # if the term is namespaced, then remove that if ( $term =~ /^urn:lsid/ && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) From mwilkinson at pub.open-bio.org Fri Sep 30 23:14:13 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Fri, 30 Sep 2005 19:14:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509302314.j8UNED1p008168@pub.open-bio.org> mwilkinson Fri Sep 30 19:14:12 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv8149/MOBY Modified Files: OntologyServer.pm Log Message: OntologyServer was returning NCBI_Acc as the namespace if you passed it a null query. Yuck moby-live/Perl/MOBY OntologyServer.pm,1.87,1.88 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.87 retrieving revision 1.88 diff -u -r1.87 -r1.88 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/30 23:08:35 1.87 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/09/30 23:14:12 1.88 @@ -191,7 +191,7 @@ $term =~ s/^moby://; # if the term is namespaced, then remove that my $sth; return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' ); - return (0, undef, undef) unless defined $term; + return (0, undef, undef) unless $term; my $result; @@ -654,7 +654,7 @@ { return ( 1, "external ontology", $term ); } - return (0, undef, undef) unless defined $term; + return (0, undef, undef) unless $term; my $result; $result = $adaptor->query_service(type => $term); @@ -786,7 +786,7 @@ return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'namespace' ); my $term = $args{term}; - return (0, undef, undef) unless defined $term; + return (0, undef, undef) unless $term; $term =~ s/^moby://; # if the term is namespaced, then remove that if ( $term =~ /^urn:lsid/ && !( $term =~ /^urn:lsid:biomoby.org:namespacetype/ ) ) From mwilkinson at pub.open-bio.org Fri Sep 30 23:23:13 2005 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Fri, 30 Sep 2005 19:23:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200509302323.j8UNNDR8008272@pub.open-bio.org> mwilkinson Fri Sep 30 19:23:13 EDT 2005 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv8253/MOBY Modified Files: CommonSubs.pm Log Message: the behaviour of getNodeContentsWithArticle were not as advertised in the documentation. They should be now. Text content of the outermost MOBY object node can be extracted if you pass it either the that node, or the Simple article containing that node. moby-live/Perl/MOBY CommonSubs.pm,1.69,1.70 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.69 retrieving revision 1.70 diff -u -r1.69 -r1.70 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/09/21 19:05:14 1.69 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2005/09/30 23:23:13 1.70 @@ -972,6 +972,13 @@ my @contents; return () unless ( (ref( $node ) =~ /XML\:\:LibXML/) && $element); + + my $nodes = $node->getElementsByTagName( $element ); + unless ( $nodes->get_node( 1 ) ) { + $nodes = $node->getElementsByTagName("moby:$element"); + } + $node = $nodes->get_node(1); # this routine should only ever be called if there is only one possible answer, so this is safe + unless ($articleName){ # the request is for root node if no articleName my $resp; foreach my $child($node->childNodes){ @@ -983,11 +990,6 @@ return @contents; } - my $nodes = $node->getElementsByTagName( $element ); - unless ( $nodes->get_node( 1 ) ) { - $nodes = $node->getElementsByTagName("moby:$element"); - } - # if there is an articleName, then get that specific node for ( 1 .. $nodes->size() ) { my $child = $nodes->get_node( $_ );