From senger at dev.open-bio.org Mon Oct 2 13:55:33 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:55:33 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021755.k92HtXrK025557@dev.open-bio.org> senger Mon Oct 2 13:55:32 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/meta In directory dev.open-bio.org:/tmp/cvs-serv25539/meta Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/meta added to the repository moby-live/Java/src/main/org/biomoby/registry/meta - New directory From senger at dev.open-bio.org Mon Oct 2 13:57:49 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:57:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021757.k92HvndN025613@dev.open-bio.org> senger Mon Oct 2 13:57:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv25596/docs Modified Files: ChangeLog Dashboard-dev.html Log Message: selectable registries in Dashboard moby-live/Java/docs ChangeLog,1.71,1.72 Dashboard-dev.html,1.2,1.3 From senger at dev.open-bio.org Mon Oct 2 13:57:49 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:57:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021757.k92Hvn5n025644@dev.open-bio.org> senger Mon Oct 2 13:57:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOBY/Cache In directory dev.open-bio.org:/tmp/cvs-serv25596/src/Perl/MOBY/Cache Modified Files: Registries.pm Log Message: selectable registries in Dashboard moby-live/Java/src/Perl/MOBY/Cache Registries.pm,1.2,1.3 From senger at dev.open-bio.org Mon Oct 2 13:57:49 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:57:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021757.k92HvnjV025701@dev.open-bio.org> senger Mon Oct 2 13:57:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/meta In directory dev.open-bio.org:/tmp/cvs-serv25596/src/main/org/biomoby/registry/meta Added Files: ExampleList.java Registries.java RegistriesList.java Registry.java Log Message: selectable registries in Dashboard moby-live/Java/src/main/org/biomoby/registry/meta ExampleList.java,NONE,1.1 Registries.java,NONE,1.1 RegistriesList.java,NONE,1.1 Registry.java,NONE,1.1 From senger at dev.open-bio.org Mon Oct 2 13:57:49 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:57:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021757.k92Hvnce025664@dev.open-bio.org> senger Mon Oct 2 13:57:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services In directory dev.open-bio.org:/tmp/cvs-serv25596/src/config/dashboard/META-INF/services Added Files: org.biomoby.registry.meta.Registries Log Message: selectable registries in Dashboard moby-live/Java/src/config/dashboard/META-INF/services org.biomoby.registry.meta.Registries,NONE,1.1 From senger at dev.open-bio.org Mon Oct 2 13:57:49 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:57:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021757.k92HvnIW025685@dev.open-bio.org> senger Mon Oct 2 13:57:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard In directory dev.open-bio.org:/tmp/cvs-serv25596/src/config/dashboard/org/biomoby/service/dashboard Modified Files: dashboard.txt Log Message: selectable registries in Dashboard moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard dashboard.txt,1.3,1.4 From senger at dev.open-bio.org Mon Oct 2 13:57:49 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:57:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021757.k92HvneC025722@dev.open-bio.org> senger Mon Oct 2 13:57:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory dev.open-bio.org:/tmp/cvs-serv25596/src/main/org/biomoby/service/dashboard Modified Files: Dashboard.java DashboardProperties.java RegistryPanel.java Log Message: selectable registries in Dashboard moby-live/Java/src/main/org/biomoby/service/dashboard Dashboard.java,1.29,1.30 DashboardProperties.java,1.24,1.25 RegistryPanel.java,1.27,1.28 From senger at dev.open-bio.org Mon Oct 2 13:57:49 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:57:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021757.k92HvnXo025627@dev.open-bio.org> senger Mon Oct 2 13:57:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs/images In directory dev.open-bio.org:/tmp/cvs-serv25596/docs/images Added Files: regs-after.png regs-before.png Log Message: selectable registries in Dashboard moby-live/Java/docs/images regs-after.png,NONE,1.1 regs-before.png,NONE,1.1 From senger at dev.open-bio.org Mon Oct 2 13:57:49 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:57:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021757.k92HvneZ025739@dev.open-bio.org> senger Mon Oct 2 13:57:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/help In directory dev.open-bio.org:/tmp/cvs-serv25596/src/main/org/biomoby/service/dashboard/help Modified Files: RegistryPanel.html Log Message: selectable registries in Dashboard moby-live/Java/src/main/org/biomoby/service/dashboard/help RegistryPanel.html,1.2,1.3 From kawas at dev.open-bio.org Mon Oct 2 14:21:41 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 2 Oct 2006 14:21:41 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021821.k92ILfVM026790@dev.open-bio.org> kawas Mon Oct 2 14:21:41 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv26758/Java/docs Modified Files: RDFAgent.html Log Message: modified the user documentation for the agent moby-live/Java/docs RDFAgent.html,1.3,1.4 From senger at dev.open-bio.org Mon Oct 2 17:12:45 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 17:12:45 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022112.k92LCj61027241@dev.open-bio.org> senger Mon Oct 2 17:12:45 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv27224/docs Modified Files: ChangeLog Dashboard.html Log Message: call rdf agent from dashboard moby-live/Java/docs ChangeLog,1.72,1.73 Dashboard.html,1.6,1.7 From senger at dev.open-bio.org Mon Oct 2 17:12:45 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 17:12:45 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022112.k92LCjeh027257@dev.open-bio.org> senger Mon Oct 2 17:12:45 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory dev.open-bio.org:/tmp/cvs-serv27224/src/main/org/biomoby/service/dashboard Modified Files: RegistrationPanel.java RegistrationServiceSubPanel.java Log Message: call rdf agent from dashboard moby-live/Java/src/main/org/biomoby/service/dashboard RegistrationPanel.java,1.20,1.21 RegistrationServiceSubPanel.java,1.11,1.12 From senger at dev.open-bio.org Mon Oct 2 17:12:45 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 17:12:45 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022112.k92LCjcs027286@dev.open-bio.org> senger Mon Oct 2 17:12:45 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory dev.open-bio.org:/tmp/cvs-serv27224/src/main/org/biomoby/service/dashboard/images Added Files: smallAgent.gif smallAgent_dis.gif Log Message: call rdf agent from dashboard moby-live/Java/src/main/org/biomoby/service/dashboard/images smallAgent.gif,NONE,1.1 smallAgent_dis.gif,NONE,1.1 From senger at dev.open-bio.org Mon Oct 2 17:12:45 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 17:12:45 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022112.k92LCjk7027272@dev.open-bio.org> senger Mon Oct 2 17:12:45 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/help In directory dev.open-bio.org:/tmp/cvs-serv27224/src/main/org/biomoby/service/dashboard/help Modified Files: RegistrationPanel.html Log Message: call rdf agent from dashboard moby-live/Java/src/main/org/biomoby/service/dashboard/help RegistrationPanel.html,1.3,1.4 From kawas at dev.open-bio.org Mon Oct 2 17:42:35 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 2 Oct 2006 17:42:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022142.k92LgZc2027445@dev.open-bio.org> kawas Mon Oct 2 17:42:35 EDT 2006 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv27413 Modified Files: Central.pm Log Message: made the call to system() array based moby-live/Perl/MOBY Central.pm,1.256,1.257 From mwilkinson at dev.open-bio.org Mon Oct 2 19:08:08 2006 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Mon, 2 Oct 2006 19:08:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022308.k92N88Ug028401@dev.open-bio.org> mwilkinson Mon Oct 2 19:08:08 EDT 2006 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv28385/MOBY/Client Modified Files: SimpleArticle.pm Log Message: nasty bug in MOBY::Client::SimpleArticle. It was shifting the namespace encapsulated array ref, instead of shifting a copied list. Probably shouldn't shift anyway, but... it wont destroy the namespace now just by looking at it moby-live/Perl/MOBY/Client SimpleArticle.pm,1.14,1.15 From kawas at dev.open-bio.org Mon Oct 2 19:19:26 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 2 Oct 2006 19:19:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022319.k92NJQer031181@dev.open-bio.org> kawas Mon Oct 2 19:19:26 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv31150/Java/docs Added Files: ConfigureRDFAgent.html Log Message: unfinished documentation on setting up your own RDF agent. moby-live/Java/docs ConfigureRDFAgent.html,NONE,1.1 From kawas at dev.open-bio.org Mon Oct 2 19:20:07 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 2 Oct 2006 19:20:07 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022320.k92NK7TR031281@dev.open-bio.org> kawas Mon Oct 2 19:20:07 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv31249/Java/docs Modified Files: RDFAgent.html Log Message: moby-live/Java/docs RDFAgent.html,1.4,1.5 From mwilkinson at dev.open-bio.org Mon Oct 2 19:31:20 2006 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Mon, 2 Oct 2006 19:31:20 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022331.k92NVKl3031435@dev.open-bio.org> mwilkinson Mon Oct 2 19:31:20 EDT 2006 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv31419/MOBY/Client Modified Files: SimpleArticle.pm Log Message: decided it was better not to shift at all moby-live/Perl/MOBY/Client SimpleArticle.pm,1.15,1.16 From kawas at dev.open-bio.org Wed Oct 4 14:43:11 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Wed, 4 Oct 2006 14:43:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610041843.k94IhBW0009439@dev.open-bio.org> kawas Wed Oct 4 14:43:11 EDT 2006 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv9407 Modified Files: Central.pm Log Message: added some return values for the agent moby-live/Perl/MOBY Central.pm,1.257,1.258 From kawas at dev.open-bio.org Wed Oct 4 14:43:53 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Wed, 4 Oct 2006 14:43:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610041843.k94Ihr7v009495@dev.open-bio.org> kawas Wed Oct 4 14:43:53 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier In directory dev.open-bio.org:/tmp/cvs-serv9462/Java/src/main/org/biomoby/registry/rdfagent/verifier Modified Files: Processor.java Main.java Log Message: added some return values for the agent when invoked via the -url option moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier Processor.java,1.27,1.28 Main.java,1.18,1.19 From kawas at dev.open-bio.org Wed Oct 4 15:46:18 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Wed, 4 Oct 2006 15:46:18 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610041946.k94JkIn4009859@dev.open-bio.org> kawas Wed Oct 4 15:46:18 EDT 2006 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv9827 Modified Files: Central.pm Log Message: agent called a different way without shell scripts. moby-live/Perl/MOBY Central.pm,1.258,1.259 From kawas at dev.open-bio.org Thu Oct 5 11:17:34 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 5 Oct 2006 11:17:34 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610051517.k95FHYJI012473@dev.open-bio.org> kawas Thu Oct 5 11:17:33 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv12440/Java/docs Modified Files: ConfigureRDFAgent.html Log Message: moby-live/Java/docs ConfigureRDFAgent.html,1.1,1.2 From kawas at dev.open-bio.org Thu Oct 5 11:18:13 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 5 Oct 2006 11:18:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610051518.k95FIDgH012510@dev.open-bio.org> kawas Thu Oct 5 11:18:13 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv12478/Java/docs Modified Files: RDFAgent.html Log Message: moby-live/Java/docs RDFAgent.html,1.5,1.6 From kawas at dev.open-bio.org Thu Oct 5 11:32:47 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 5 Oct 2006 11:32:47 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610051532.k95FWl6a012550@dev.open-bio.org> kawas Thu Oct 5 11:32:47 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv12518/Java/docs Modified Files: ConfigureRDFAgent.html Log Message: moby-live/Java/docs ConfigureRDFAgent.html,1.2,1.3 From kawas at dev.open-bio.org Fri Oct 6 12:39:20 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 6 Oct 2006 12:39:20 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610061639.k96GdKBa016254@dev.open-bio.org> kawas Fri Oct 6 12:39:20 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util In directory dev.open-bio.org:/tmp/cvs-serv16222/Java/src/main/org/biomoby/registry/rdfagent/util Modified Files: SignatureURLConnection.java Log Message: moby-live/Java/src/main/org/biomoby/registry/rdfagent/util SignatureURLConnection.java,1.13,1.14 From kawas at dev.open-bio.org Fri Oct 6 13:42:57 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 6 Oct 2006 13:42:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610061742.k96HgvIn016380@dev.open-bio.org> kawas Fri Oct 6 13:42:57 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier In directory dev.open-bio.org:/tmp/cvs-serv16348/Java/src/main/org/biomoby/registry/rdfagent/verifier Modified Files: Processor.java Log Message: moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier Processor.java,1.28,1.29 From kawas at dev.open-bio.org Fri Oct 6 13:47:33 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 6 Oct 2006 13:47:33 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610061747.k96HlXXk016567@dev.open-bio.org> kawas Fri Oct 6 13:47:33 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier In directory dev.open-bio.org:/tmp/cvs-serv16535/Java/src/main/org/biomoby/registry/rdfagent/verifier Modified Files: Processor.java Log Message: moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier Processor.java,1.29,1.30 From kawas at dev.open-bio.org Fri Oct 6 13:51:50 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 6 Oct 2006 13:51:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610061751.k96Hpovl016643@dev.open-bio.org> kawas Fri Oct 6 13:51:50 EDT 2006 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv16611 Modified Files: Central.pm Log Message: added a more precise message when the agent is called on a url that used to exist but no longer does. moby-live/Perl/MOBY Central.pm,1.259,1.260 From kawas at dev.open-bio.org Fri Oct 6 17:38:06 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 6 Oct 2006 17:38:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610062138.k96Lc5ko016953@dev.open-bio.org> kawas Fri Oct 6 17:38:05 EDT 2006 Update of /home/repository/moby/jars-archive/current In directory dev.open-bio.org:/tmp/cvs-serv16922 Added Files: castor-0.9.5.jar Log Message: jars-archive/current castor-0.9.5.jar,NONE,1.1 From kawas at dev.open-bio.org Fri Oct 6 17:39:01 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 6 Oct 2006 17:39:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610062139.k96Ld17b017033@dev.open-bio.org> kawas Fri Oct 6 17:39:01 EDT 2006 Update of /home/repository/moby/jars-archive/current In directory dev.open-bio.org:/tmp/cvs-serv17002 Added Files: dnsjava-1.3.2.jar Log Message: jars-archive/current dnsjava-1.3.2.jar,NONE,1.1 From kawas at dev.open-bio.org Mon Oct 9 14:55:09 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 9 Oct 2006 14:55:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610091855.k99It9Ni020067@dev.open-bio.org> kawas Mon Oct 9 14:55:09 EDT 2006 Update of /home/repository/moby/moby-live/Java/xmls In directory dev.open-bio.org:/tmp/cvs-serv20032/Java/xmls Modified Files: libraries.xml Log Message: moby-live/Java/xmls libraries.xml,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/libraries.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Java/xmls/libraries.xml 2006/08/28 13:42:10 1.13 +++ /home/repository/moby/moby-live/Java/xmls/libraries.xml 2006/10/09 18:55:09 1.14 @@ -34,6 +34,10 @@ + + + + @@ -69,6 +73,9 @@ + + + @@ -151,6 +158,9 @@ + + + From kawas at dev.open-bio.org Tue Oct 10 10:02:12 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 10:02:12 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610101402.k9AE2CNQ022911@dev.open-bio.org> kawas Tue Oct 10 10:02:12 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory dev.open-bio.org:/tmp/cvs-serv22876/Java/docs/taverna/guide Modified Files: index.html Log Message: moby-live/Java/docs/taverna/guide index.html,1.12,1.13 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2006/08/21 19:47:17 1.12 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2006/10/10 14:02:12 1.13 @@ -2,37 +2,39 @@ "http://www.w3.org/TR/html4/loose.dtd"> + The 'new' BioMoby plugin For Taverna -

How to use the BioMoby plugin in Taverna (Updated September 2006)

+

How to use the BioMoby plugin in Taverna (Updated October 2006)

Table of Contents

-
Introduction
-
-
-
-New Features
-
-
-
-Tutorial
  • Creating a BioMoby Scavenger
  • -
  • Creating a workflow
  • -
  • Obtaining information on a Moby Datatype
  • -
  • Obtaining information on a Moby Service
  • -
  • Using secondary parameters
  • -
  • Obtaining the 'data' from a Moby service
  • -
    -What's Next - - -FAQ - - -Comments / Questions
    + +
      +
    1. Creating a BioMoby Scavenger
    2. +
    3. Creating a workflow
    4. +
    5. Obtaining information on a Moby Datatype
    6. +
    7. Obtaining information on a Moby Service
    8. +
    9. Using secondary parameters
    10. +
    11. Obtaining the 'data' from a Moby service
    12. +
      +
    +

    Introduction

    @@ -206,10 +208,10 @@
    • Find Services that Consume NCBI_BLAST_Text('blast') - brief search:
    • -
      Searches for all services that consume NCBI_BLAST_Text
      +
      Searches for all services that consume NCBI_BLAST_Text
    • Find Services that Consume NCBI_BLAST_Text('blast') - semantic search
    • -
      Searches for all services that either consume NCBI_BLAST_Text
      +	          
      Searches for all services that either consume NCBI_BLAST_Text
       or it parent datatype.
       For more infomation on this behaviour, click here.
    @@ -295,15 +297,15 @@
    There are 3 different types of output ports that Moby services utilize and 2 different types of input ports (excluding the legacy ports
    'input' and 'output'.
    -
    +        
             Moby Service Output ----Connects to ---> Moby Service Input
            	
    -     	    1  Simple				   Simple
    - 2 Simple Collection
    - 3 Collection Simple
    - 4 Collection Collection
    - 5 CollectionAsSimples Simples
    - 6 CollectionAsSimples Collection
    + 1 Simple Simple + 2 Simple Collection + 3 Collection Simple + 4 Collection Collection + 5 CollectionAsSimples Simples + 6 CollectionAsSimples Collection
    A Simple is a datatype that is not contained within a collection, i.e. do not have a name that contains '(Collection -'.
    A CollectionAsSimples is an output port that contains a Taverna style List of the individuals in a Moby Collection.
    @@ -325,7 +327,7 @@
  • Why do some services have have '_ANON_' or 'Collection - MobyCollection' in there name?

    These are names automatically generated for services that incorrectly registered with a Mobycentral registry.
    - You should attempt to contact the service provider so that they may fix this service.
    + You should attempt to contact the service provider so that they may fix and proplerly register these services.

  • If all I want to do is run a Moby service, do I have to specify article names?
    @@ -346,8 +348,7 @@ email

    If you have any suggestions regarding new features or you would like to report a bug,
    please let me know.

    -

     

    -

     

    +
  • From kawas at dev.open-bio.org Tue Oct 10 12:59:10 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 12:59:10 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610101659.k9AGxA5O023206@dev.open-bio.org> kawas Tue Oct 10 12:59:10 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory dev.open-bio.org:/tmp/cvs-serv23175/Java/docs/taverna/guide Added Files: favicon.ico animated_favicon1.gif Log Message: moby-live/Java/docs/taverna/guide favicon.ico,NONE,1.1 animated_favicon1.gif,NONE,1.1 From kawas at dev.open-bio.org Tue Oct 10 13:01:27 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 13:01:27 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610101701.k9AH1Rm1023251@dev.open-bio.org> kawas Tue Oct 10 13:01:26 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory dev.open-bio.org:/tmp/cvs-serv23216/Java/docs/taverna/guide Modified Files: index.html Log Message: moby-live/Java/docs/taverna/guide index.html,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2006/10/10 14:02:12 1.13 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2006/10/10 17:01:26 1.14 @@ -3,6 +3,8 @@ + + The 'new' BioMoby plugin For Taverna From kawas at dev.open-bio.org Tue Oct 10 14:51:50 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 14:51:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610101851.k9AIporj024682@dev.open-bio.org> kawas Tue Oct 10 14:51:50 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv24651/Java/docs Added Files: RegistryServlets.html Log Message: unfinished guide for installing the servlets required to host a registry. moby-live/Java/docs RegistryServlets.html,NONE,1.1 From kawas at dev.open-bio.org Tue Oct 10 21:54:50 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 21:54:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610110154.k9B1sowp025328@dev.open-bio.org> kawas Tue Oct 10 21:54:50 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties In directory dev.open-bio.org:/tmp/cvs-serv25229/Java/src/main/org/biomoby/registry/properties Modified Files: WindowsNT.java Windows.java UNIX.java RegistryOS.java MobyProperties.java MobyCentralConfig.java Log Message: moby-live/Java/src/main/org/biomoby/registry/properties WindowsNT.java,1.2,1.3 Windows.java,1.1,1.2 UNIX.java,1.1,1.2 RegistryOS.java,1.1,1.2 MobyProperties.java,1.4,1.5 MobyCentralConfig.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/WindowsNT.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/registry/properties/WindowsNT.java 2006/04/20 15:10:44 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/WindowsNT.java 2006/10/11 01:54:50 1.3 @@ -12,6 +12,7 @@ * * @author Eddie created Nov 28, 2005 */ + at SuppressWarnings("unchecked") public class WindowsNT implements Environment { /** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/Windows.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/registry/properties/Windows.java 2005/11/29 23:06:24 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/Windows.java 2006/10/11 01:54:50 1.2 @@ -12,6 +12,7 @@ * * @author Eddie created Nov 28, 2005 */ + at SuppressWarnings("unchecked") public class Windows implements Environment { /** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/UNIX.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/registry/properties/UNIX.java 2005/11/29 23:06:24 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/UNIX.java 2006/10/11 01:54:50 1.2 @@ -12,6 +12,7 @@ * * @author Eddie created Nov 28, 2005 */ + at SuppressWarnings("unchecked") public class UNIX implements Environment { /** * the singleton =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/RegistryOS.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/registry/properties/RegistryOS.java 2005/11/29 23:06:24 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/RegistryOS.java 2006/10/11 01:54:50 1.2 @@ -48,6 +48,7 @@ * * @author Eddie created Nov 28, 2005 */ + at SuppressWarnings("unchecked") public class RegistryOS { // factory pattern private static java.util.HashMap storage = new java.util.HashMap(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/MobyProperties.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/registry/properties/MobyProperties.java 2006/01/03 19:25:59 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/MobyProperties.java 2006/10/11 01:54:50 1.5 @@ -42,6 +42,7 @@ *

    For questions, comments, or bugs *

    email me at edward.kawas at gmail.com */ + at SuppressWarnings("unchecked") public class MobyProperties { private static Properties properties = new Properties(); @@ -53,15 +54,17 @@ * @return A Properties object with either the properties obtained from the environment or an empty map. */ public final static Properties PROPERTIES() { - Map map = RegistryOS.getEnv(); - // + Map map = new HashMap(); + // if (System.getProperty("MOBY_CENTRAL_CONFIG") != null && !System.getProperty("MOBY_CENTRAL_CONFIG").equals("")) map.put("MOBY_CENTRAL_CONFIG" , System.getProperty("MOBY_CENTRAL_CONFIG")); if (System.getProperty("MOBY_SERVER") != null && !System.getProperty("MOBY_SERVER").equals("")) map.put("MOBY_SERVER" , System.getProperty("MOBY_SERVER")); if (System.getProperty("MOBY_URI") != null && !System.getProperty("MOBY_URI").equals("")) map.put("MOBY_URI" , System.getProperty("MOBY_URI")); - properties.putAll(map); + // did we fail to populate the map? + if (map.isEmpty()) + properties.putAll(RegistryOS.getEnv()); return properties; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/MobyCentralConfig.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/registry/properties/MobyCentralConfig.java 2005/12/02 20:40:18 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/MobyCentralConfig.java 2006/10/11 01:54:50 1.5 @@ -15,6 +15,9 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.biomoby.shared.MobyException; /** @@ -25,12 +28,15 @@ *

    For questions, comments, or bugs *

    email me at edward.kawas at gmail.com */ + at SuppressWarnings("unchecked") public class MobyCentralConfig { - private final static String location = MobyProperties.PROPERTIES().getProperty("MOBY_CENTRAL_CONFIG"); //use the environment variables you set with your own registry + private static Log log = LogFactory.getLog(MobyCentralConfig.class); + + private final static String location = getLocation(); private final static String regexp = "^(\\w+)\\s*=\\s*(.*)$"; - + /** * A method that retrieves the mySQL connection details for the database mobycentral. *

    PRE: The property config is specified and configured correctly in the file biomoby.properties. @@ -45,7 +51,19 @@ return map; } - /** + private static String getLocation() { + if (System.getProperty("MOBY_CENTRAL_CONFIG")==null) { + log.debug("getting MOBY_CENTRAL_CONFIG using MobyProperties()"); + return MobyProperties.PROPERTIES().getProperty("MOBY_CENTRAL_CONFIG"); + } + else { + // use the environment variables you set with your own registry + log.debug("getting MOBY_CENTRAL_CONFIG using System.getProperty()"); + return System.getProperty("MOBY_CENTRAL_CONFIG"); + } + } + + /** * A method that retrieves the mySQL connection details for the database mobynamespace. *

    PRE: The property config is specified and configured correctly in the file biomoby.properties. *

    POST: Map consists of the mySQL connection information for the database mobynamespace or MobyException is thrown. @@ -105,9 +123,8 @@ throws MobyException { if (location == null) throw new MobyException( - "Error - " - + location - + " environment variable found. Make sure that MOBY_CENTRAL_CONFIG is set correctly in the environment"); + "Error - MOBY_CENTRAL_CONFIG == null;" + + " Make sure that MOBY_CENTRAL_CONFIG is set correctly in the environment"); File file = new File(location); BufferedReader br = null; try { From kawas at dev.open-bio.org Tue Oct 10 21:54:50 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 21:54:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610110154.k9B1sox4025288@dev.open-bio.org> kawas Tue Oct 10 21:54:50 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms In directory dev.open-bio.org:/tmp/cvs-serv25229/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms Modified Files: Lsid_resolver.java CallableServicesServlet.java GetSignatureRDFResponse.java GetSignatureRDFForm.java RDFAgentValidator.java LSID_ResolverClient.java LSIDComplete.java Added Files: GetServiceRDF.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms GetServiceRDF.java,NONE,1.1 Lsid_resolver.java,1.3,1.4 CallableServicesServlet.java,1.2,1.3 GetSignatureRDFResponse.java,1.8,1.9 GetSignatureRDFForm.java,1.4,1.5 RDFAgentValidator.java,1.2,1.3 LSID_ResolverClient.java,1.1,1.2 LSIDComplete.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/Lsid_resolver.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/Lsid_resolver.java 2006/05/24 18:48:31 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/Lsid_resolver.java 2006/10/11 01:54:50 1.4 @@ -93,21 +93,21 @@ String str = resolveLSID(lsid_to_use, "soap"); return str; } catch (MobyException e) { - e.printStackTrace(); + log.debug("Couldn't resolve " + lsid_to_use + " to metadata using SOAP."); } try { String str = resolveLSID(lsid_to_use, "http"); return str; } catch (MobyException e) { - e.printStackTrace(); + log.debug("Couldn't resolve " + lsid_to_use + " to metadata using HTTP."); } try { String str = resolveLSID(lsid_to_use, "ftp"); return str; } catch (MobyException e) { - e.printStackTrace(); + log.debug("Couldn't resolve " + lsid_to_use + " to metadata using FTP."); } - return "Couldn't resolve your lsid. I tried the protocols SOAP, HTTP, and FTP. If we are missing one, let us know."; + return "Couldn't resolve your lsid to metadata (perhaps there is none?). I tried the protocols SOAP, HTTP, and FTP. If we are missing one, let us know."; } /** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/CallableServicesServlet.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/forms/CallableServicesServlet.java 2006/08/30 23:15:17 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/CallableServicesServlet.java 2006/10/11 01:54:50 1.3 @@ -18,16 +18,18 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.discovery.tools.DiscoverSingleton; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.biomoby.client.CentralImpl; +import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; import org.biomoby.client.ui.graphical.servlet.utilities.ServiceTester; import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; /** - * @author Eddie Kawas - * This class was created to call out to all registered services and see which ones are alive. + * @author Eddie Kawas This class was created to call out to all registered + * services and see which ones are alive. */ public class CallableServicesServlet extends HttpServlet { @@ -45,13 +47,27 @@ public void init(ServletConfig arg0) throws ServletException { super.init(arg0); + + ContextLoader cLoader = null; + try { + cLoader = (ContextLoader) DiscoverSingleton.find(Class + .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( + (String) ContextLoader.class.getCanonicalName()).getName()); + log + .warn((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" + : "ContextLoader has loaded successfully.")); + } catch (Exception e) { + log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" + + System.getProperty("line.separator") + e.getStackTrace()); + } + log.info("initializing CallableServiceServlet"); scheduler = new ServiceTesterRunner(); Timer timer = new Timer(); Calendar calendar = Calendar.getInstance(); Date time = calendar.getTime(); log.info("Scheduling on going task."); - timer.scheduleAtFixedRate(scheduler, time, 1000 * 60 * 60 ); + timer.scheduleAtFixedRate(scheduler, time, 1000 * 60 * 60); } /* @@ -156,7 +172,11 @@ public ServiceTesterRunner() { try { // TODO make this generic so that others can use it - t = new ServiceTester(CentralImpl.DEFAULT_ENDPOINT, CentralImpl.DEFAULT_NAMESPACE); + t = new ServiceTester( + System.getProperty("MOBY_SERVER") == null ? CentralImpl.DEFAULT_ENDPOINT + : System.getProperty("MOBY_SERVER"), + System.getProperty("MOBY_URI") == null ? CentralImpl.DEFAULT_NAMESPACE + : System.getProperty("MOBY_URI")); } catch (MobyException e) { log.error("Couldn't instantiate a ServiceTester object", e); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFResponse.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/client/ui/graphical/servlet/forms/GetSignatureRDFResponse.java 2006/08/30 16:55:02 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFResponse.java 2006/10/11 01:54:50 1.9 @@ -1,20 +1,27 @@ package org.biomoby.client.ui.graphical.servlet.forms; -import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.MalformedURLException; import java.net.URL; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Properties; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.sql.DataSource; +import org.apache.commons.dbcp.BasicDataSource; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.biomoby.client.rdf.builder.ServiceInstanceRDF; +import org.biomoby.registry.properties.MobyProperties; + +import java.sql.Connection; /* * Created on Jan 14, 2005

    @@ -38,7 +45,9 @@ final private String newline = System.getProperty("line.separator"); - final static private String error = "" + System.getProperty("line.separator") + "" + private String SERVER_NAME = ""; + final static private String getErrorString() { + return "" + System.getProperty("line.separator") + "" + "" + System.getProperty("line.separator") + "" + "" + System.getProperty("line.separator") + "" + "Please Try Again" + System.getProperty("line.separator") + "" @@ -48,11 +57,13 @@ + "

    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") + "" + + "

    Back

    " + System.getProperty("line.separator") + "" + "
    " + System.getProperty("line.separator") + "" + "" + System.getProperty("line.separator") + "" + ""; + } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + SERVER_NAME = request.getServerName(); String domain = filter(request.getParameter("domain")); String serviceName = filter(request.getParameter("serviceName")); String sigURL = filter(request.getParameter("sigURL")); @@ -71,7 +82,7 @@ if (sigURL.equals("") || !isValidSig(sigURL)) { response.setContentType("text/html"); PrintWriter out = response.getWriter(); - out.println(error); + out.println(getErrorString()); return; } @@ -81,7 +92,7 @@ // update failed response.setContentType("text/html"); PrintWriter out = response.getWriter(); - out.println(error); + out.println(getErrorString()); return; } /*get the rdf*/ @@ -104,31 +115,112 @@ return; } - /* - * TODO you need place the updateSignatureURL in the cgi-bin directory - */ private boolean updateMobyCentralDatabase(String domain, String sigURL, String name) throws MalformedURLException { String con; if (name.equals("")) { - log.info("empty name"); - con = "http://mobycentral.icapture.ubc.ca/cgi-bin/updateSignatureURL.cgi?authURI=" - + domain + "&URL=" + sigURL; + log.info("Updating all services for " + domain + "."); + String sql = "select authority_id from authority where authority_uri=?"; + String updateSQL = "update service_instance set signatureURL = ? where authority_id=?"; + int authID = -1; + PreparedStatement preparedStatement = null; + try { + preparedStatement = getConnection().prepareStatement(sql); + preparedStatement.setString(1,domain); + ResultSet results = preparedStatement.executeQuery(); + if (results.next()) + authID = results.getInt(1); + else { + // clean up and return + if (preparedStatement != null) + preparedStatement.close(); + return false; + } + } catch (SQLException e) { + log.error(e.getLocalizedMessage()); + return false; + } finally { + try { + if (preparedStatement != null) + preparedStatement.close(); + } catch (SQLException e) { + return false; + } + } + + preparedStatement = null; + int updatedRowCount = -1; + try { + preparedStatement = getConnection().prepareStatement(updateSQL); + preparedStatement.setString(1,sigURL); + preparedStatement.setInt(2, authID); + updatedRowCount = preparedStatement.executeUpdate(); + return updatedRowCount > -1; + } catch (SQLException e) { + log.error(e.getLocalizedMessage()); + return updatedRowCount > -1; + } finally { + try { + if (preparedStatement != null) + preparedStatement.close(); + } catch (SQLException e) { + return updatedRowCount > -1; + } + } } else { - con = "http://mobycentral.icapture.ubc.ca/cgi-bin/updateSignatureURL.cgi?authURI=" - + domain + "&URL=" + sigURL + "&serviceName=" + name; + // update 1 service + log.info("Updating the service, " + name+ ", for " + domain + "."); + String sql = "select authority_id from authority where authority_uri=?"; + String updateSQL = "update service_instance set signatureURL = ? where authority_id= ? and servicename= ?"; + int authID = -1; + PreparedStatement preparedStatement = null; + try { + preparedStatement = getConnection().prepareStatement(sql); + preparedStatement.setString(1,domain); + ResultSet results = preparedStatement.executeQuery(); + if (results.next()) + authID = results.getInt(1); + else { + // clean up and return + if (preparedStatement != null) + preparedStatement.close(); + return false; + } + } catch (SQLException e) { + log.error(e.getLocalizedMessage()); + return false; + } finally { + try { + if (preparedStatement != null) + preparedStatement.close(); + } catch (SQLException e) { + return false; + } + } + + preparedStatement = null; + int updatedRowCount = -1; + try { + preparedStatement = getConnection().prepareStatement(updateSQL); + preparedStatement.setString(1,sigURL); + preparedStatement.setInt(2, authID); + preparedStatement.setString(3,name); + updatedRowCount = preparedStatement.executeUpdate(); + return updatedRowCount == 1; + } catch (SQLException e) { + log.error(e.getLocalizedMessage()); + return updatedRowCount == 1; + } finally { + try { + if (preparedStatement != null) + preparedStatement.close(); + } catch (SQLException e) { + return updatedRowCount == 1; + } + } + } - URL url = new URL(con); - try { - BufferedReader in = new BufferedReader(new InputStreamReader(url - .openStream())); - if (in.readLine().equals("good")) { - return true; - } - } catch (IOException ex) {} - return false; - } /** @@ -138,19 +230,55 @@ * @return */ private boolean isValidSig(String sigURL) { - /*final String URL = "(^(http:\\/\\/www\\.|HTTP:\\/\\/www\\.|http:\\/\\/|HTTP:\\/\\/)[\\w]+\\.[\\w].*(\\/\\w+(\\.{1}\\w+)*)$)"; - Pattern p = Pattern.compile(URL); - Matcher m = p.matcher(sigURL); - return m.matches();*/ + try { URL url = new URL(sigURL); return true; } catch (MalformedURLException e) { - return false; } } + private Connection connection = null; + private DataSource datasource = null; + private Properties props = MobyProperties.SERVICE_INSTANCE_PROPERTIES();; + + private Connection getConnection() { + if (this.datasource == null) { + // get certain properties from mobycentral.config + String serverName = props.get("url") + ":" + props.get("port");// localhost:3306"; + String mydatabase = (String) props.get("dbname");// "mobyobject"; + String url = "jdbc:mysql://" + serverName + "/" + mydatabase; + String username = (String) props.get("username");// "moby_external"; + String password = (String) props.get("password");// ""; + DataSource datasource = setupDataSource(url, username, password); + this.datasource = datasource; + } + try { + return this.datasource.getConnection(); + } catch (SQLException e) { + log.error("Error getting connection to db..." + newline + e); + return null; + } + + } + + private DataSource setupDataSource(String connectURI, String user, String pass) { + BasicDataSource ds = new BasicDataSource(); + try { + ds.setLoginTimeout(30); + } catch (SQLException e) { + log.equals("Couldn't set login timeout " + e.getLocalizedMessage()); + } + ds.setMaxWait(1000 * 60*5); + ds.setTimeBetweenEvictionRunsMillis(1000 * 60 * 5); + ds.setDriverClassName("com.mysql.jdbc.Driver"); + ds.setUsername(user); + ds.setPassword(pass); + ds.setUrl(connectURI); + return ds; + } + private static String filter(String input) { if (input == null) return null; @@ -172,4 +300,9 @@ } return (filtered.toString()); } + + public static void main(String[] args) throws MalformedURLException { + GetSignatureRDFResponse g = new GetSignatureRDFResponse(); + System.out.println(g.updateMobyCentralDatabase("blah.blah.bah", "http://www.eddie.com/signatureURLs","Echo_test2")); + } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFForm.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/ui/graphical/servlet/forms/GetSignatureRDFForm.java 2005/09/30 14:48:22 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFForm.java 2006/10/11 01:54:50 1.5 @@ -7,178 +7,225 @@ import java.io.IOException; import java.io.PrintWriter; import java.util.Arrays; +import java.util.Map; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.discovery.tools.DiscoverSingleton; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.biomoby.client.CentralImpl; +import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; +import org.biomoby.registry.properties.RegistryOS; import org.biomoby.shared.Central; import org.biomoby.shared.MobyException; +import org.biomoby.shared.Utils; /** * @author Eddie Kawas - *

    Created for - *

    This class was created to ... - *

    For questions, comments, or bugs - *

    email me at edward.kawas at gmail.com + *

    + * Created for + *

    + * This class was created to ... + *

    + * For questions, comments, or bugs + *

    + * email me at edward.kawas at gmail.com */ public class GetSignatureRDFForm extends HttpServlet { - /** - * - */ - private static final long serialVersionUID = 1L; - - // some useful variables - private final String newline = System.getProperty("line.separator"); - - 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) - */ - protected void doGet(HttpServletRequest request, - HttpServletResponse response) throws ServletException, IOException { - // set the content type - response.setContentType("text/html"); - PrintWriter out = response.getWriter(); - - // get a list of domains - Central central = null; - String[] domains = null; - // initialize central - try { - //TODO - enter the endpoint here - central = new CentralImpl(); - domains = central.getProviders(); - } catch (MobyException e) { - out.println("Please try again later."); - return; - } - // sort the array - Arrays.sort(domains); - StringBuffer sb = new StringBuffer(""); - for (int x = 0; x < domains.length; x++) { - sb.append("\t\t" + newline); - } - - String page = "" - + newline - + "" - + newline - + "" - + newline - + " Retrieve Your RDF Document" - + newline - + "" - + newline - + "" - + newline - + "" - + newline - + "

    Retrieve an Updated RDF Document
    " - + newline - + "for your MOBY Service Instance(s)

    " - + newline - + "

     

    " - + newline - + "

    This form will allow you to retrieve an updated version of the RDF
    " - + newline - + " document for MOBY Service Instances that you have created. In
    " - + newline - + "addition, you will be able to update the signature url field for your service instance.

    " - + newline - + "
    " - + newline - + "

    Your Domain:" - + newline - + " " - + newline - + " *required
    " - + newline - + " This field is required!

    " - + newline - + "


    " - + newline - + " Service Instance Name:" - + newline - + " " - + newline - + " *optional*
    " - + newline - + " If this field is left blank then an RDF document containing" - + newline - + " all of the
    " - + newline - + " service instances created by the selected domain will be returned.

    " - + newline - + "


    " - + newline - + " Your Signature URL:" - + newline - + " " - + newline - + " *required
    " - + newline - + " This field indicates the URL from which the RDF that you are about " - + newline - + "to receive can be retrieved at a later date (i.e. the place where you" - + newline - + "are going to save the output of this script)

    " - + newline + "
     
    " + newline - + "

    " + newline + "

    " - + newline + "
    " + newline + "" + newline - + "" + newline; - - out.println(page); - return; - } - - /* (non-Javadoc) - * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) - */ - protected void doPost(HttpServletRequest arg0, HttpServletResponse arg1) - throws ServletException, IOException { - doGet(arg0, arg1); - } - - public static void main(String[] args) { - Central central = null; - String[] domains = null; - // initialize central - try { - central = new CentralImpl(); - domains = central.getProviders(); - } catch (MobyException e) { - e.printStackTrace(); - return; - } - // sort the array - Arrays.sort(domains); - StringBuffer sb = new StringBuffer(""); - for (int x = 0; x < domains.length; x++) { - sb.append("\t\t\n"); - } - System.out.println(sb.toString()); - } + private static Log log = LogFactory.getLog(GetSignatureRDFForm.class); + + /** + * + */ + private static final long serialVersionUID = 1L; + + // some useful variables + private final String newline = System.getProperty("line.separator"); + + private static String DOMAIN = "mobycentral.icapture.ubc.ca:8090/moby/"; + + /* + * (non-Javadoc) + * + * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, + * javax.servlet.http.HttpServletResponse) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + DOMAIN = request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + + "/"; + + // set the content type + response.setContentType("text/html"); + PrintWriter out = response.getWriter(); + + // get a list of domains + Central central = null; + String[] domains = null; + // initialize central + try { + String registryURL = null; + String registryNamespace = null; + + // are they set in the system? + registryURL = System.getProperty("MOBY_SERVER"); + registryNamespace = System.getProperty("MOBY_URI"); + + // if we didnt set them check the environment + if (registryURL == null) { + Map map = RegistryOS.getEnv(); + if (!map.isEmpty()) { + registryURL = (String) map.get("MOBY_SERVER"); + registryNamespace = (String) map.get("MOBY_URI"); + } + } + + log.info("Retrieving providers from URL: " + + (registryURL == null ? CentralImpl.DEFAULT_ENDPOINT : registryURL) + + " URI: " + + (registryNamespace == null ? CentralImpl.DEFAULT_NAMESPACE + : registryNamespace)); + if (registryURL == null) { + // use default registry, since we dont have a local one + central = new CentralImpl(); + } else if (registryNamespace == null) { + // use default namespace since one isnt defined + central = new CentralImpl(registryURL); + } else { + // use defined url and namespacce + central = new CentralImpl(registryURL, registryNamespace); + } + domains = central.getProviders(); + } catch (MobyException e) { + out.println("Please try again later."); + log.error(Utils.format(newline+"There was a problem extracting all of the providers:"+newline+e.getLocalizedMessage(), 3), e); + return; + } + // sort the array + Arrays.sort(domains); + StringBuffer sb = new StringBuffer(""); + for (int x = 0; x < domains.length; x++) { + sb.append("\t\t" + newline); + } + + String page = "" + + newline + + "" + + newline + + "" + + newline + + " Retrieve Your RDF Document" + + newline + + "" + + newline + + "" + + newline + + "" + + newline + + "

    Retrieve an Updated RDF Document
    " + + newline + + "for your MOBY Service Instance(s)

    " + + newline + + "

     

    " + + newline + + "

    This form will allow you to retrieve an updated version of the RDF
    " + + newline + + " document for MOBY Service Instances that you have created. In
    " + + newline + + "addition, you will be able to update the signature url field for your service instance.

    " + + newline + + "
    " + + newline + + "

    Your Domain:" + + newline + + " " + + newline + + " *required
    " + + newline + + " This field is required!

    " + + newline + + "


    " + + newline + + " Service Instance Name:" + + newline + + " " + + newline + + " *optional*
    " + + newline + + " If this field is left blank then an RDF document containing" + + newline + + " all of the
    " + + newline + + " service instances created by the selected domain will be returned.

    " + + newline + + "


    " + + newline + + " Your Signature URL:" + + newline + + " " + + newline + + " *required
    " + + newline + + " This field indicates the URL from which the RDF that you are about " + + newline + "to receive can be retrieved at a later date (i.e. the place where you" + + newline + "are going to save the output of this script)

    " + + newline + "
     
    " + newline + + "

    " + newline + "

    " + newline + + "
    " + newline + "" + newline + "" + newline; + + out.println(page); + return; + } + + @Override + public void init() throws ServletException { + super.init(); + ContextLoader cLoader = null; + try { + cLoader = (ContextLoader) DiscoverSingleton.find(Class + .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( + (String) ContextLoader.class.getCanonicalName()).getName()); + log + .info((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" + : "ContextLoader has loaded successfully.")); + } catch (Exception e) { + log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" + + System.getProperty("line.separator") + e.getMessage()); + } + } + + /* + * (non-Javadoc) + * + * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, + * javax.servlet.http.HttpServletResponse) + */ + protected void doPost(HttpServletRequest arg0, HttpServletResponse arg1) + throws ServletException, IOException { + doGet(arg0, arg1); + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/RDFAgentValidator.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/forms/RDFAgentValidator.java 2006/05/24 18:48:31 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/RDFAgentValidator.java 2006/10/11 01:54:50 1.3 @@ -7,17 +7,16 @@ import java.net.URLDecoder; import java.util.Properties; -import javax.naming.Context; -import javax.naming.InitialContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.discovery.tools.DiscoverSingleton; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; import org.biomoby.registry.properties.MobyProperties; -import org.biomoby.registry.rdfagent.verifier.Main; /* * Created on Jan 14, 2005

    @@ -46,44 +45,17 @@ public final void init() throws ServletException { // super.init(); - // try to load environment variables set in context.xml + ContextLoader cLoader = null; try { - Context c = new InitialContext(); - - try { - String MOBY_CENTRAL_CONFIG = null; - MOBY_CENTRAL_CONFIG = (String) c.lookup("java:comp/env/MOBY_CENTRAL_CONFIG"); - if (MOBY_CENTRAL_CONFIG != null && !MOBY_CENTRAL_CONFIG.equals("")) { - // set MOBY_CENTRAL_CONFIG - log.info("init(setting MOBY_CENTRAL_CONFIG)"); - System.setProperty("MOBY_CENTRAL_CONFIG", MOBY_CENTRAL_CONFIG); - } - - } catch (Exception ex) { - } - try { - String MOBY_SERVER = null; - MOBY_SERVER = (String) c.lookup("java:comp/env/MOBY_SERVER"); - if (MOBY_SERVER != null && !MOBY_SERVER.equals("")) { - // set MOBY_SERVER - log.info("init(setting MOBY_SERVER)"); - System.setProperty("MOBY_SERVER", MOBY_SERVER); - } - } catch (Exception ex) { - } - - try { - String MOBY_URI = null; - MOBY_URI = (String) c.lookup("java:comp/env/MOBY_URI"); - if (MOBY_URI != null && !MOBY_URI.equals("")) { - // set MOBY_URI - log.info("init(setting MOBY_URI)"); - System.setProperty("MOBY_URI", MOBY_URI); - } - } catch (Exception ex) { - } - + cLoader = (ContextLoader) DiscoverSingleton.find(Class + .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( + (String) ContextLoader.class.getCanonicalName()).getName()); + log + .warn((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" + : "ContextLoader has loaded successfully.")); } catch (Exception e) { + log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" + + System.getProperty("line.separator") + e.getStackTrace()); } } @@ -122,8 +94,8 @@ return; } Process p; - - String[] com = new String[] { rdfagent, "-test", url }; + //TODO may need to place JAVA_HOME in the mobycentral part of the config files. + String[] com = new String[] { "java","-DRDFagent.home="+rdfagent,"-jar", rdfagent+"/RDFagent.jar", "-test", url }; p = Runtime.getRuntime().exec(com); BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream())); StringBuffer sb = new StringBuffer(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/LSID_ResolverClient.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/servlet/forms/LSID_ResolverClient.java 2006/08/30 17:11:25 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/LSID_ResolverClient.java 2006/10/11 01:54:50 1.2 @@ -108,19 +108,19 @@ String str = resolveLSID(lsid_to_use, "soap"); return str; } catch (MobyException e) { - log.error(e); + log.debug("Couldn't resolve " + lsid_to_use + " to metadata using SOAP."); } try { String str = resolveLSID(lsid_to_use, "http"); return str; } catch (MobyException e) { - log.error(e); + log.debug("Couldn't resolve " + lsid_to_use + " to metadata using HTTP."); } try { String str = resolveLSID(lsid_to_use, "ftp"); return str; } catch (MobyException e) { - log.error(e); + log.debug("Couldn't resolve " + lsid_to_use + " to metadata using FTP."); } return "Couldn't resolve your lsid. I tried the protocols SOAP, HTTP, and FTP. If we are missing one, let us know."; } @@ -131,19 +131,19 @@ String str = resolveLSID2Data(lsid_to_use, "soap"); return str; } catch (MobyException e) { - log.error(e); + log.debug("Couldn't resolve " + lsid_to_use + " to data using SOAP."); } try { String str = resolveLSID2Data(lsid_to_use, "http"); return str; } catch (MobyException e) { - log.error(e); + log.debug("Couldn't resolve " + lsid_to_use + " to data using HTTP."); } try { String str = resolveLSID2Data(lsid_to_use, "ftp"); return str; } catch (MobyException e) { - log.error(e); + log.debug("Couldn't resolve " + lsid_to_use + " to data using FTP."); } return "Couldn't resolve your lsid to Data."; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/LSIDComplete.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/servlet/forms/LSIDComplete.java 2006/08/30 17:11:25 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/LSIDComplete.java 2006/10/11 01:54:50 1.2 @@ -21,8 +21,10 @@ import javax.sql.DataSource; import org.apache.commons.dbcp.BasicDataSource; +import org.apache.commons.discovery.tools.DiscoverSingleton; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; import org.biomoby.registry.properties.MobyProperties; /* @@ -33,6 +35,7 @@ /** * @author Eddie Kawas */ + at SuppressWarnings("unchecked") public class LSIDComplete extends HttpServlet { /** @@ -45,14 +48,33 @@ final private String newline = System.getProperty("line.separator"); private Map datas = Collections.synchronizedMap(new HashMap()); + public void init() throws ServletException { super.init(); + + + ContextLoader cLoader = null; + try { + cLoader = (ContextLoader) DiscoverSingleton.find(Class + .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( + (String) ContextLoader.class.getCanonicalName()).getName()); + log + .warn((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" + : "ContextLoader has loaded successfully.")); + } catch (Exception e) { + log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" + + System.getProperty("line.separator") + e.getStackTrace()); + } + log.debug("Initializing the Timer that will invoke the StatWriter"); Timer timer = new Timer(); timer.scheduleAtFixedRate(new StatWriter(this), new java.util.Date(), 1000 * 60 * 60); } + // an array of properties objects created initialized once for more efficient running + private Properties[] properties = new Properties[]{null,null, null, null}; + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String lsid = filter(request.getParameter("lsid")); @@ -74,20 +96,24 @@ String object = parts[4]; Properties p = null; // check if the 3rd component is biomoby.org - if (parts[2].equalsIgnoreCase("biomoby.org") + if ((parts[2].equalsIgnoreCase("biomoby.org") || parts[2].equalsIgnoreCase(request.getServerName())) && parts[0].equalsIgnoreCase("urn") && parts[1].equalsIgnoreCase("lsid")) { // check if they are typing in // namespacetype if (parts[3].equals("namespacetype")) { - p = MobyProperties.NAMESPACE_PROPERTIES(); + if (properties[0] == null) + properties[0] = MobyProperties.NAMESPACE_PROPERTIES(); + p = properties[0]; String lsids = getLSIDs(p, object, "namespace"); if (!lsids.equals("")) lsid = lsids; } // objectclass else if (parts[3].equals("objectclass")) { - p = MobyProperties.OBJECT_PROPERTIES(); + if (properties[1] == null) + properties[1] = MobyProperties.OBJECT_PROPERTIES(); + p = properties[1]; String lsids = getLSIDs(p, object, "object"); if (!lsids.equals("")) { lsid = lsids; @@ -96,7 +122,9 @@ } // servicetype else if (parts[3].equals("servicetype")) { - p = MobyProperties.SERVICE_PROPERTIES(); + if (properties[2] == null) + properties[2] = MobyProperties.SERVICE_PROPERTIES(); + p = properties[2]; String lsids = getLSIDs(p, object, "service"); if (!lsids.equals("")) lsid = lsids; @@ -104,7 +132,9 @@ // serviceinstance else if (parts[3].equals("serviceinstance")) { // weird case, because object is authURI,servicename - p = MobyProperties.SERVICE_INSTANCE_PROPERTIES(); + if (properties[3] == null) + properties[3] = MobyProperties.SERVICE_INSTANCE_PROPERTIES(); + p = properties[3]; String lsids = getLSIDs(p, object, "service_instance"); if (!lsids.equals("")) lsid = lsids; From kawas at dev.open-bio.org Tue Oct 10 21:54:50 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 21:54:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610110154.k9B1soIP025350@dev.open-bio.org> kawas Tue Oct 10 21:54:50 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities In directory dev.open-bio.org:/tmp/cvs-serv25229/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities Modified Files: ServiceTester.java Added Files: ContextLoader.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities ContextLoader.java,NONE,1.1 ServiceTester.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ServiceTester.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/utilities/ServiceTester.java 2006/08/30 23:15:17 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ServiceTester.java 2006/10/11 01:54:50 1.4 @@ -126,6 +126,7 @@ } } log.info("service testing complete."); + setResultMap(theMap); return theMap; } @@ -272,10 +273,8 @@ try { output = doCall(s.getName(), new Object[] { "" - + "" + " \r\n" + "" - + " " + - // "" + - " " + "" + " " + "" + + "" + " " + "" + + " " + "" + "" + "" }, impl.getRegistryEndpoint()); // log.info(output); } catch (MobyException e) { From kawas at dev.open-bio.org Tue Oct 10 21:54:51 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 21:54:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610110154.k9B1spu6025458@dev.open-bio.org> kawas Tue Oct 10 21:54:51 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources In directory dev.open-bio.org:/tmp/cvs-serv25229/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources Modified Files: RESOURCE.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources RESOURCE.java,1.22,1.23 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java 2006/09/15 21:50:21 1.22 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java 2006/10/11 01:54:51 1.23 @@ -14,8 +14,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.naming.Context; -import javax.naming.InitialContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; @@ -24,18 +22,15 @@ import org.apache.commons.discovery.tools.DiscoverSingleton; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.biomoby.client.CentralDigestImpl; import org.biomoby.client.CentralImpl; import org.biomoby.client.rdf.builder.ServiceInstanceRDF; import org.biomoby.client.rdf.vocabulary.DC_PROTEGE; import org.biomoby.client.rdf.vocabulary.Predicates; +import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; import org.biomoby.registry.definitions.types.JNamespacesSqlImpl; import org.biomoby.registry.definitions.types.JObjectsSqlImpl; import org.biomoby.registry.definitions.types.JServicesSqlImpl; -import org.biomoby.shared.Central; -import org.biomoby.shared.CentralDigest; import org.biomoby.shared.MobyException; -import org.biomoby.shared.MobyResourceRef; import org.biomoby.shared.MobyService; import org.w3c.rdf.model.ModelException; @@ -94,189 +89,44 @@ * the following used to be final, but on error, i would like to ensure that * i dont waste time trying to perform caching operations */ - private static boolean isCachableServiceInstances; + private static boolean isCachableServiceInstances = false; - private static boolean isCachableNamespaces; + private static boolean isCachableNamespaces = false; - private static boolean isCachableServiceTypes; + private static boolean isCachableServiceTypes = false; - private static boolean isCachableObjects; - - /* the individual caching classes */ - private static RDFCache ServiceInstanceCache = null; - - private static RDFCache ServiceTypesCache = null; - - private static RDFCache ObjectsCache = null; - - private static RDFCache NamespaceCache = null; + private static boolean isCachableObjects = false; private static boolean RUN_MAIN = false; - + private static ContextLoader cLoader = null; + static { - boolean __success = false; - log.info("init(setting environment variables)"); try { - Object className; - Context c = new InitialContext(); - try { - log.info("Checking for caching classes ..."); - className = c.lookup("java:comp/env/ServiceInstancesCachingClass"); - if (className != null && className instanceof String) { - try { - ServiceInstanceCache = (RDFCache) DiscoverSingleton.find(Class.forName((String) className), Class.forName((String) className).getName()); - log.info((ServiceInstanceCache == null ? "Caching of service instances not enabled." - : "Caching of service instances enabled.")); - } catch (Exception e) { - ServiceInstanceCache = null; - log.info("Caching of service instances not enabled\n" + e); - } - } - } catch (Exception e) { - log - .info("Caching of service instances not enabled. Caching file was not specified.\n" - + e); - } - try { - className = c.lookup("java:comp/env/ServiceTypesCachingClass"); - if (className != null && className instanceof String) { - try { - ServiceTypesCache = (RDFCache) DiscoverSingleton.find(Class.forName((String) className), Class.forName((String) className).getName()); - log - .info((ServiceTypesCache == null ? "Caching of service types not enabled." - : "Caching of service types enabled.")); - } catch (Exception e) { - ServiceTypesCache = null; - log.info("Caching of service types not enabled\n" + e); - } - } - } catch (Exception e) { - log.info("Caching of service types not enabled. Caching file was not specified.\n" - + e); - } - try { - className = c.lookup("java:comp/env/ObjectsCachingClass"); - if (className != null && className instanceof String) { - try { - ObjectsCache = (RDFCache) DiscoverSingleton.find(Class.forName((String) className), Class.forName((String) className).getName()); - log.info((ObjectsCache == null ? "Caching of datatypes not enabled." - : "Caching of datatypes enabled.")); - } catch (Exception e) { - ObjectsCache = null; - log.info("Caching of datatypes not enabled\n" + e); - } - } - } catch (Exception e) { - log.info("Caching of datatypes not enabled. Caching file was not specified.\n" + e); - } - try { - className = c.lookup("java:comp/env/NamespacesCachingClass"); - if (className != null && className instanceof String) { - try { - NamespaceCache = (RDFCache) DiscoverSingleton.find(Class.forName((String) className), Class.forName((String) className).getName()); - log.info((NamespaceCache == null ? "Caching of namespaces not enabled." - : "Caching of namespaces enabled.")); - } catch (Exception e) { - NamespaceCache = null; - log.info("Caching of namespaces not enabled\n" + e); - } - } - } catch (Exception e) { - log.info("Caching of service types not enabled. Caching file was not specified.\n" - + e); - } + cLoader = (ContextLoader) DiscoverSingleton.find(Class + .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( + (String) ContextLoader.class.getCanonicalName()).getName()); + log + .info((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" + : "ContextLoader has loaded successfully.")); } catch (Exception e) { - log.info("Caching is not enabled for any ontology.\n" + e); + log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" + + System.getProperty("line.separator") + e.getMessage()); } - // caching variables - isCachableNamespaces = (NamespaceCache == null ? false : true); - isCachableServiceTypes = (ServiceTypesCache == null ? false : true); - isCachableObjects = (ObjectsCache == null ? false : true); - isCachableServiceInstances = (ServiceInstanceCache == null ? false : true); - - - log.info("getting mobycentral registry properties ..."); - try { - Context c = new InitialContext(); - try { - String MOBY_CENTRAL_CONFIG = null; - MOBY_CENTRAL_CONFIG = (String) c.lookup("java:comp/env/MOBY_CENTRAL_CONFIG"); - if (MOBY_CENTRAL_CONFIG != null && !MOBY_CENTRAL_CONFIG.equals("")) { - // set MOBY_CENTRAL_CONFIG - log.info("init(setting MOBY_CENTRAL_CONFIG)"); - System.setProperty("MOBY_CENTRAL_CONFIG", MOBY_CENTRAL_CONFIG); - } - } catch (Exception ex) { - } - try { - String MOBY_SERVER = null; - MOBY_SERVER = (String) c.lookup("java:comp/env/MOBY_SERVER"); - if (MOBY_SERVER != null && !MOBY_SERVER.equals("")) { - // set MOBY_SERVER - log.info("init(setting MOBY_SERVER)"); - System.setProperty("MOBY_SERVER", MOBY_SERVER); - if (!__success) - try { - Central central = new CentralImpl(MOBY_SERVER); - MobyResourceRef[] refs = central.getResourceRefs(); - for (int i = 0; i < refs.length; i++) { - String url = refs[i].getResourceLocation().toExternalForm(); - if (url.lastIndexOf("#") < 0) - url = url + "#"; - URI_MAP.put(refs[i].getResourceName(), url); - } - __success = true; - } catch (Exception ex) { - - } - } - } catch (Exception ex) { - } - - try { - String MOBY_URI = null; - MOBY_URI = (String) c.lookup("java:comp/env/MOBY_URI"); - if (MOBY_URI != null && !MOBY_URI.equals("")) { - // set MOBY_URI - log.info("init(setting MOBY_URI)"); - System.setProperty("MOBY_URI", MOBY_URI); - } - } catch (Exception ex) { - } - } catch (Exception ex) { + // attempt to load caching classes + if (cLoader != null) { + isCachableNamespaces = (cLoader.getNamespaceCache() == null ? false : true); + isCachableServiceTypes = (cLoader.getServiceTypesCache() == null ? false : true); + isCachableObjects = (cLoader.getObjectsCache() == null ? false : true); + isCachableServiceInstances = (cLoader.getServiceInstanceCache() == null ? false : true); } - if (!__success) - try { - // default to mobycentral - log.warn("Defaulting to default mobycentral."); - Central central = new CentralImpl(); - MobyResourceRef[] refs = central.getResourceRefs(); - for (int i = 0; i < refs.length; i++) { - String url = refs[i].getResourceLocation().toExternalForm(); - if (url.lastIndexOf("#") < 0) - url = url + "#"; - URI_MAP.put(refs[i].getResourceName(), url); - } - } catch (Exception ex) { - // some defaults if nothing else works - URI_MAP.put("Object", "http://biomoby.org/RESOURCES/MOBY-S/Objects#"); - - URI_MAP.put("Service", "http://biomoby.org/RESOURCES/MOBY-S/Services#"); - - URI_MAP.put("Namespace", "http://biomoby.org/RESOURCES/MOBY-S/Namespaces#"); - - URI_MAP.put("ServiceInstance", - "http://biomoby.org/RESOURCES/MOBY-S/ServiceInstances#"); - } - - OBJ = (String) URI_MAP.get("Object"); - SRV = (String) URI_MAP.get("Service"); - NS = (String) URI_MAP.get("Namespace"); + OBJ = (String) cLoader.getURI_MAP().get("Object"); + SRV = (String) cLoader.getURI_MAP().get("Service"); + NS = (String) cLoader.getURI_MAP().get("Namespace"); PRED = "http://biomoby.org/RESOURCES/MOBY-S/Predicates#"; - SI = (String) URI_MAP.get("ServiceInstance"); + SI = (String) cLoader.getURI_MAP().get("ServiceInstance"); } /* @@ -292,11 +142,11 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); String path = request.getPathInfo(); - if (path == null ) { + if (path == null) { out .println(" not MOBY-S

    not MOBY-S

    "); return; - } + } Pattern p = Pattern.compile("/MOBY\\-S/(\\S+)"); Matcher m = p.matcher(path); if (!m.matches()) { @@ -317,7 +167,7 @@ } catch (MobyException e) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Could not get Objects"); - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); return; } if (model == null) { @@ -337,7 +187,7 @@ } catch (MobyException e) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Could not get Namespaces"); - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); return; } if (model == null) { @@ -357,7 +207,7 @@ } catch (MobyException e) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Could not get Services"); - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); return; } if (model == null) { @@ -377,8 +227,8 @@ response.setHeader("Content-Disposition", "attachment;filename=ServiceInstances"); if (isCachableServiceInstances) { - if (ServiceInstanceCache.isCachedMostRecent()) { - out.write(ServiceInstanceCache.getCachedRDF()); + if (cLoader.getServiceInstanceCache().isCachedMostRecent()) { + out.write(cLoader.getServiceInstanceCache().getCachedRDF()); return; } else { try { @@ -401,9 +251,9 @@ writer.setProperty("showXmlDeclaration", "false"); writer.setProperty("tab", "5"); writer.write(model, stream, null); - if (!ServiceInstanceCache.isCachedMostRecent()) - ServiceInstanceCache.cacheRDF(stream.getOutput(), - ServiceInstanceCache.getLatestCriteria()); + if (!cLoader.getServiceInstanceCache().isCachedMostRecent()) + cLoader.getServiceInstanceCache().cacheRDF(stream.getOutput(), + cLoader.getServiceInstanceCache().getLatestCriteria()); stream = null; // now output the RDF writer = model.getWriter("RDF/XML-ABBREV"); @@ -417,7 +267,7 @@ } catch (Exception e) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Could not get ServiceInstances"); - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); return; } if (model == null) { @@ -448,7 +298,7 @@ model = getAll(model); } catch (Exception e) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Could not get All"); - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); return; } if (model == null) { @@ -492,7 +342,7 @@ try { model = getServiceInstances(model); } catch (ModelException e) { - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); return null; } return model; @@ -513,7 +363,7 @@ createNsMap(model); } - CentralDigest central = null; + CentralImpl central = null; MobyService[] services = null; try { String registryURL; @@ -524,26 +374,26 @@ log.info("System vars: " + registryURL + ", " + registryNamespace); if (registryURL == null) { // use default registry, since we dont have a local one - central = new CentralDigestImpl(); + central = new CentralImpl(); } else if (registryNamespace == null) { // use default namespace since one isnt defined - central = new CentralDigestImpl(registryURL); + central = new CentralImpl(registryURL); } else { // use defined url and namespacce - central = new CentralDigestImpl(registryURL, registryNamespace); + central = new CentralImpl(registryURL, registryNamespace); } } else { // use default registry since we cant determine if local one // exists - central = new CentralDigestImpl(); + central = new CentralImpl(); } - services = central.getServices(); + services = central.findService(new MobyService("")); } catch (MobyException e) { - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); } if (central == null || services == null) throw new MobyException( - "Could not retrieve useful information from CentralDigestImpl().getServices(String)"); + "Could not retrieve useful information from CentralImpl().findService(String)"); return ServiceInstanceRDF.createRDFModel(model, services, true); } @@ -762,7 +612,7 @@ } /* - * + * */ private final Resource _addClassResource(Model model, String uri, String label, String lsid, String def, String authority, String email) { @@ -788,19 +638,19 @@ try { return new JObjectsSqlImpl().getFullObjectsAsArray(); } catch (Exception e) { - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); } } else if (type.equalsIgnoreCase("services")) { try { return new JServicesSqlImpl().getFullServicesAsArray(); } catch (Exception e) { - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); } } else if (type.equalsIgnoreCase("namespaces")) { try { return new JNamespacesSqlImpl().getFullNamespacesAsArray(); } catch (Exception e) { - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); } } return null; @@ -858,7 +708,7 @@ try { model = getServiceInstances(model); } catch (Exception e) { - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); return ""; } RDFWriter writer = model.getWriter("RDF/XML-ABBREV"); From kawas at dev.open-bio.org Tue Oct 10 21:54:51 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 21:54:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610110154.k9B1spOL025410@dev.open-bio.org> kawas Tue Oct 10 21:54:51 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/definitions/types In directory dev.open-bio.org:/tmp/cvs-serv25229/Java/src/main/org/biomoby/registry/definitions/types Modified Files: JServicesSqlImpl.java JObjectsSqlImpl.java JNamespacesSqlImpl.java Log Message: moby-live/Java/src/main/org/biomoby/registry/definitions/types JServicesSqlImpl.java,1.4,1.5 JObjectsSqlImpl.java,1.3,1.4 JNamespacesSqlImpl.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/definitions/types/JServicesSqlImpl.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/registry/definitions/types/JServicesSqlImpl.java 2006/07/19 23:13:48 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/definitions/types/JServicesSqlImpl.java 2006/10/11 01:54:51 1.5 @@ -20,6 +20,7 @@ *

    * email me at edward.kawas at gmail.com */ + at SuppressWarnings("unchecked") public final class JServicesSqlImpl implements JServiceI { private static final String sql = "SELECT ot1.service_type, rt.relationship_type, ot2.service_type, ot1.description " + "FROM service as ot1, service_term2term as rt, service as ot2 " @@ -53,12 +54,6 @@ String username = (String) map.get("username");// "moby_external"; String password = (String) map.get("password");// ""; - /* - * String serverName = "mobycentral.icapture.ubc.ca:3306"; String - * mydatabase = "mobyservice"; String url = "jdbc:mysql://" + - * serverName + "/" + mydatabase; String username = "moby_external"; - * String password = ""; - */ this.connection = DriverManager.getConnection(url, username, password); } catch (ClassNotFoundException e) { throw new MobyException( =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/definitions/types/JObjectsSqlImpl.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/registry/definitions/types/JObjectsSqlImpl.java 2006/03/23 15:16:56 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/definitions/types/JObjectsSqlImpl.java 2006/10/11 01:54:51 1.4 @@ -20,6 +20,7 @@ *

    * email me at edward.kawas at gmail.com */ + at SuppressWarnings("unchecked") public final class JObjectsSqlImpl implements JObjectsI { private static final String sql = "SELECT ot1.object_type, rt.relationship_type, ot2.object_type, rt.object2_articlename, ot1.description " + "FROM object as ot1, object_term2term as rt, object as ot2 " @@ -51,21 +52,11 @@ Map map = MobyCentralConfig.getMobyObject(); // Create a connection to the database String serverName = map.get("url") + ":" + map.get("port");// localhost:3306"; - // //TODO - // - make - // this a - // property String mydatabase = (String) map.get("dbname");// "mobyobject"; String url = "jdbc:mysql://" + serverName + "/" + mydatabase; String username = (String) map.get("username");// "moby_external"; String password = (String) map.get("password");// ""; - /* - * String serverName = "mobycentral.icapture.ubc.ca:3306"; String - * mydatabase = "mobyobject"; String url = "jdbc:mysql://" + - * serverName + "/" + mydatabase; String username = "moby_external"; - * String password = ""; - */ this.connection = DriverManager.getConnection(url, username, password); } catch (ClassNotFoundException e) { throw new MobyException( =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/definitions/types/JNamespacesSqlImpl.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/registry/definitions/types/JNamespacesSqlImpl.java 2006/03/15 16:22:37 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/definitions/types/JNamespacesSqlImpl.java 2006/10/11 01:54:51 1.5 @@ -20,6 +20,7 @@ *

    * email me at edward.kawas at gmail.com */ + at SuppressWarnings("unchecked") public final class JNamespacesSqlImpl implements JNamespaceI { private static final String sql = "SELECT namespace_type, description FROM namespace ORDER BY namespace_type asc"; From kawas at dev.open-bio.org Tue Oct 10 21:54:51 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 21:54:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610110154.k9B1spgS025380@dev.open-bio.org> kawas Tue Oct 10 21:54:50 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority In directory dev.open-bio.org:/tmp/cvs-serv25229/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority Modified Files: LSIDDataLookup.java Test.java MobyAuthority.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority LSIDDataLookup.java,1.12,1.13 Test.java,1.4,1.5 MobyAuthority.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java 2006/05/24 18:48:31 1.12 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java 2006/10/11 01:54:50 1.13 @@ -108,7 +108,7 @@ int result = UNKNOWN; String authority = lsid.getAuthority().getAuthority(); - log.info("lsidType: " + ns + " " + id + " " + ver + " " + authority); + log.debug("lsidType: " + ns + " " + id + " " + ver + " " + authority); if (ns.equalsIgnoreCase(mobynamespace.getProperty("lsid_namespace"))) { if (!authority.equals(mobynamespace.getProperty("lsid_authority"))) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/Test.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/ui/graphical/servlet/lsid/authority/Test.java 2005/12/02 20:40:18 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/Test.java 2006/10/11 01:54:50 1.5 @@ -34,7 +34,8 @@ */ public static void main(String[] args) throws LSIDException { //String lsid_to_use = "urn:lsid:ncbi.nlm.nih.gov.lsid.biopathways.org:genbank_gi:30350027"; - String lsid_to_use = "urn:lsid:biomoby.org:serviceinstance:www.illuminae.com,getSHound3DNeighboursFromGi"; + // TODO insert your LSID here + String lsid_to_use = "urn:lsid:localhost:serviceinstance:test.test.test,breakString:2006-09-19T20-08-36Z"; LSID lsid = new LSID(lsid_to_use); LSIDResolver resolver = new LSIDResolver(lsid); resolver.setUseLocalCache(false); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/MobyAuthority.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/ui/graphical/servlet/lsid/authority/MobyAuthority.java 2006/09/15 18:28:23 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/MobyAuthority.java 2006/10/11 01:54:50 1.8 @@ -1,12 +1,12 @@ package org.biomoby.client.ui.graphical.servlet.lsid.authority; import java.net.URL; -import java.util.Properties; - -import javax.naming.Context; -import javax.naming.InitialContext; +import org.apache.commons.discovery.tools.DiscoverSingleton; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.biomoby.client.CentralImpl; +import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; import org.biomoby.shared.MobyService; import com.ibm.lsid.ExpiringResponse; @@ -39,10 +39,13 @@ * email me at edward.kawas at gmail.com */ public class MobyAuthority extends SimpleAuthority { - private LSIDDataLookup lookup = null; + private Log log = LogFactory.getLog(this.getClass()); - private Properties properties = new Properties(); + private LSIDDataLookup lookup = null; + // NOTE: This class assumes that you have set system properties for + // lsid_domain and lsid_port - if they are not set, then exceptions are + // thrown public LSIDMetadataPort[] getMetadataLocations(LSID lsid, String url) { if (lookup == null) @@ -57,16 +60,18 @@ } if (lsType == LSIDDataLookup.UNKNOWN) return null; - + return new LSIDMetadataPort[] { new SOAPLocation("BioMOBYMetadataSOAPPort", "http://" - + properties.getProperty("lsid_domain") + ":" - + properties.getProperty("lsid_port") + "/authority/metadata"), - new HTTPLocation("BioMOBYMetadataHTTPPort", properties.getProperty("lsid_domain"), - Integer.parseInt(properties.getProperty("lsid_port")), - "/authority/metadata") }; + + System.getProperty("lsid_domain") + ":" + System.getProperty("lsid_port") + + "/authority/metadata"), + new HTTPLocation("BioMOBYMetadataHTTPPort", System.getProperty("lsid_domain"), + Integer.parseInt(System.getProperty("lsid_port")), "/authority/metadata") }; } + // NOTE: This class assumes that you have set system properties for + // lsid_domain and lsid_port - if they are not set, then exceptions are + // thrown public LSIDDataPort[] getDataLocations(LSID lsid, String url) { if (lookup == null) @@ -78,10 +83,10 @@ return new LSIDDataPort[] { new SOAPLocation("BioMOBYDataSOAPPort", "http://" - + properties.getProperty("lsid_domain") + ":" - + properties.getProperty("lsid_port") + "/authority/data"), - new HTTPLocation("BioMOBYDataHTTPPort", properties.getProperty("lsid_domain"), - Integer.parseInt(properties.getProperty("lsid_port")), "/authority/data") }; + + System.getProperty("lsid_domain") + ":" + System.getProperty("lsid_port") + + "/authority/data"), + new HTTPLocation("BioMOBYDataHTTPPort", System.getProperty("lsid_domain"), Integer + .parseInt(System.getProperty("lsid_port")), "/authority/data") }; } /* @@ -149,57 +154,17 @@ */ public void initService(LSIDServiceConfig config) throws LSIDServerException { lookup = new LSIDDataLookup(); + ContextLoader cLoader = null; try { - - Context c = new InitialContext(); - try { - String LSID_SERVER = (String) c.lookup("java:comp/env/LSID_SERVER"); - - if (LSID_SERVER != null && !LSID_SERVER.equals("")) { - properties.setProperty("lsid_domain", LSID_SERVER); - } - } catch (Exception ex) { - System.err.println(ex.getLocalizedMessage()); - } - - try { - String LSID_PORT = (String) c.lookup("java:comp/env/LSID_PORT"); - if (LSID_PORT != null && !LSID_PORT.equals("")) { - properties.setProperty("lsid_port", LSID_PORT); - } - } catch (Exception ex) { - System.err.println(ex.getLocalizedMessage()); - } - try { - String CONFIG = (String) c.lookup("java:comp/env/MOBY_CENTRAL_CONFIG"); - if (CONFIG != null && !CONFIG.equals("")) { - System.setProperty("MOBY_CENTRAL_CONFIG", CONFIG); - properties.setProperty("MOBY_CENTRAL_CONFIG", CONFIG); - } - } catch (Exception ex) { - System.err.println(ex.getLocalizedMessage()); - } - try { - String CONFIG = (String) c.lookup("java:comp/env/MOBY_SERVER"); - if (CONFIG != null && !CONFIG.equals("")) { - properties.setProperty("MOBY_SERVER", CONFIG); - System.setProperty("MOBY_SERVER", CONFIG); - } - } catch (Exception ex) { - System.err.println(ex.getLocalizedMessage()); - } - try { - String CONFIG = (String) c.lookup("java:comp/env/MOBY_URI"); - if (CONFIG != null && !CONFIG.equals("")) { - System.setProperty("MOBY_URI", CONFIG); - properties.setProperty("MOBY_URI", CONFIG); - } - } catch (Exception ex) { - System.err.println(ex.getLocalizedMessage()); - } - + cLoader = (ContextLoader) DiscoverSingleton.find(Class + .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( + (String) ContextLoader.class.getCanonicalName()).getName()); + log + .info((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" + : "ContextLoader has loaded successfully.")); } catch (Exception e) { - System.err.println(e.getLocalizedMessage()); + log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" + + System.getProperty("line.separator") + e.getStackTrace()); } } } \ No newline at end of file From kawas at dev.open-bio.org Tue Oct 10 21:54:51 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 21:54:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610110154.k9B1spNL025436@dev.open-bio.org> kawas Tue Oct 10 21:54:51 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder In directory dev.open-bio.org:/tmp/cvs-serv25229/Java/src/main/org/biomoby/client/rdf/builder Modified Files: ServiceInstanceRDF.java RDFConfigure.java Log Message: moby-live/Java/src/main/org/biomoby/client/rdf/builder ServiceInstanceRDF.java,1.30,1.31 RDFConfigure.java,1.21,1.22 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2006/08/30 16:55:02 1.30 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2006/10/11 01:54:51 1.31 @@ -9,19 +9,14 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; -import java.util.Properties; - -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; +import org.apache.commons.discovery.tools.DiscoverSingleton; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.biomoby.client.CentralImpl; import org.biomoby.client.rdf.vocabulary.DC_PROTEGE; import org.biomoby.client.rdf.vocabulary.FetaVocabulary; - -import org.biomoby.registry.properties.MobyProperties; +import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; import org.biomoby.registry.properties.RegistryOS; import org.biomoby.shared.Central; import org.biomoby.shared.MobyData; @@ -29,7 +24,6 @@ import org.biomoby.shared.MobyNamespace; import org.biomoby.shared.MobyPrimaryDataSet; import org.biomoby.shared.MobyPrimaryDataSimple; -import org.biomoby.shared.MobyResourceRef; import org.biomoby.shared.MobySecondaryData; import org.biomoby.shared.MobyService; import org.biomoby.shared.data.MobyDataSecondaryInstance; @@ -79,92 +73,42 @@ private static final String DCP = DC_PROTEGE.getURI(); - private static final String OBJ;// = - - // "http://biomoby.org/RESOURCES/MOBY-S/Objects#"; - - private static final String SRV;// = - - // "http://biomoby.org/RESOURCES/MOBY-S/Services#"; - - private static final String NS;// = - - // "http://biomoby.org/RESOURCES/MOBY-S/Namespaces#"; - - private static final String MP;// = - - // "http://biomoby.org/RESOURCES/MOBY-S/Predicates#"; - - private static final String SI;// = - // "http://biomoby.org/RESOURCES/MOBY-S/ServiceInstances#"; + private static final String OBJ; + private static final String SRV; + private static final String NS; + private static final String MP; + private static final String SI; + + private static final String SERVER; static { - boolean __success = false; - // attempt 1 - servlet context - Context c; + ContextLoader cLoader = null; try { - c = new InitialContext(); - String MOBY_SERVER = (String) c.lookup("java:comp/env/MOBY_SERVER"); - if (MOBY_SERVER != null && !MOBY_SERVER.equals("")) { - System.setProperty("MOBY_SERVER", MOBY_SERVER); - try { - Central central = new CentralImpl(MOBY_SERVER); - MobyResourceRef[] refs = central.getResourceRefs(); - for (int i = 0; i < refs.length; i++) { - String url = refs[i].getResourceLocation().toExternalForm(); - if (url.lastIndexOf("#") < 0) - url = url + "#"; - URI_MAP.put(refs[i].getResourceName(), url); - } - } catch (Exception ex) { + cLoader = (ContextLoader) DiscoverSingleton.find(Class + .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( + (String) ContextLoader.class.getCanonicalName()).getName()); + log + .info((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" + : "ContextLoader has loaded successfully.")); + } catch (Exception e) { + log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" + + System.getProperty("line.separator") + e.getMessage()); + } + + log.info("Setting RDF ResourceLocations (RDFConfigure) for current registry..."); - } - __success = true; - } - String MOBY_URI = (String) c.lookup("java:comp/env/MOBY_URI"); - if (MOBY_URI != null && !MOBY_URI.equals("")) { - System.setProperty("MOBY_URI", MOBY_URI); - __success = true; - } - } catch (NamingException e) { + + OBJ = (String) cLoader.getURI_MAP().get("Object"); - // e.printStackTrace(); - } + SRV = (String) cLoader.getURI_MAP().get("Service"); - // attempt 2 - environment variables - if (!__success) { - // maybe try for environment variables - Properties p = MobyProperties.PROPERTIES(); - String MOBY_SERVER = (String) p.get("MOBY_SERVER"); - if (MOBY_SERVER != null && !MOBY_SERVER.equals("")) { - System.setProperty("MOBY_SERVER", MOBY_SERVER); - try { - Central central = new CentralImpl(MOBY_SERVER); - MobyResourceRef[] refs = central.getResourceRefs(); - for (int i = 0; i < refs.length; i++) { - String url = refs[i].getResourceLocation().toExternalForm(); - if (url.lastIndexOf("#") < 0) - url = url + "#"; - URI_MAP.put(refs[i].getResourceName(), url); - } - } catch (Exception ex) { + NS = (String) cLoader.getURI_MAP().get("Namespace"); - } - } - String MOBY_URI = (String) p.get("MOBY_URI"); - if (MOBY_URI != null && !MOBY_URI.equals("")) { - System.setProperty("MOBY_URI", MOBY_URI); - } - } - OBJ = (URI_MAP.get("Object") != null ? (String) URI_MAP.get("Object") - : "http://biomoby.org/RESOURCES/MOBY-S/Objects#"); - SRV = (URI_MAP.get("Service") != null ? (String) URI_MAP.get("Service") - : "http://biomoby.org/RESOURCES/MOBY-S/Services#"); - NS = (URI_MAP.get("Namespace") != null ? (String) URI_MAP.get("Namespace") - : "http://biomoby.org/RESOURCES/MOBY-S/Namespaces#"); MP = "http://biomoby.org/RESOURCES/MOBY-S/Predicates#"; - SI = (URI_MAP.get("ServiceInstance") != null ? (String) URI_MAP.get("ServiceInstance") - : "http://biomoby.org/RESOURCES/MOBY-S/ServiceInstances#"); + + SI = (String) cLoader.getURI_MAP().get("ServiceInstance"); + + SERVER = cLoader.getFULL_SERVER_URL(); } /** @@ -274,7 +218,7 @@ try { central = new CentralImpl(url, uri); } catch (MobyException e) { - System.err.println("Could not connect to " + url + " in findService."); + log.error("Could not connect to " + url + " in findService."); return empty; } // set up the query service @@ -284,7 +228,7 @@ try { services = central.findService(service); } catch (MobyException e1) { - System.err.println("Could not find service:\n" + e1.getMessage()); + log.error("Could not find service:\n" + e1.getMessage()); return empty; } // only one service should be returned! @@ -304,7 +248,7 @@ try { central = new CentralImpl(url, uri); } catch (MobyException e) { - System.err.println("Could not connect to " + url + " in findService."); + log.error("Could not connect to " + url + " in findService."); return empty; } // set up the query service @@ -314,7 +258,7 @@ try { services = central.findService(service); } catch (MobyException e1) { - System.err.println("Could not find service:\n" + e1.getMessage()); + log.error("Could not find service:\n" + e1.getMessage()); return empty; } // get the rdf @@ -358,7 +302,7 @@ try { central = new CentralImpl(url, uri); } catch (MobyException e) { - System.err.println("Could not connect to " + url + " in findService."); + log.error("Could not connect to " + url + " in findService."); return empty; } // set up the query service @@ -368,7 +312,7 @@ try { services = central.findService(service); } catch (MobyException e1) { - System.err.println("Could not find service:\n" + e1.getMessage()); + log.error("Could not find service:\n" + e1.getMessage()); return empty; } // only one service should be returned! @@ -388,7 +332,7 @@ try { central = new CentralImpl(url, uri); } catch (MobyException e) { - System.err.println("Could not connect to " + url + " in findService."); + log.error("Could not connect to " + url + " in findService."); return empty; } // set up the query service @@ -398,7 +342,7 @@ try { services = central.findService(service); } catch (MobyException e1) { - System.err.println("Could not find service:\n" + e1.getMessage()); + log.error("Could not find service:\n" + e1.getMessage()); return empty; } // get the rdf @@ -421,50 +365,13 @@ // initialize central try { if (!useTestMachine) { - String registryURL = null; - String registryNamespace = null; - Map map = RegistryOS.getEnv(); - if (!map.isEmpty()) { - registryURL = (String) map.get("MOBY_SERVER"); - if (registryURL == null) - registryURL = System.getProperty("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryNamespace == null) - registryNamespace = System.getProperty("MOBY_URI"); - log.info("Using URL: " + registryURL + " URI: " + registryNamespace); - if (registryURL == null) { - // use default registry, since we dont have a local one - central = new CentralImpl(); - } else if (registryNamespace == null) { - // use default namespace since one isnt defined - central = new CentralImpl(registryURL); - } else { - // use defined url and namespacce - central = new CentralImpl(registryURL, registryNamespace); - } - } else { - // perhaps the System propery was set earlier. - if (registryURL == null) - registryURL = System.getProperty("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryNamespace == null) - registryNamespace = System.getProperty("MOBY_URI"); - - // use the default central if we have no other choice - if (registryURL != null) - if (registryNamespace != null) - central = new CentralImpl(registryURL, registryNamespace); - else - central = new CentralImpl(registryURL); - else - central = new CentralImpl(); - } + central = getCentralImpl(); } else { // use test machine no longer supported return empty; } } catch (MobyException e) { - System.err.println("error in getAllServices 1:\n" + e.getMessage()); + log.error("error in getAllServices 1:\n" + e.getMessage()); return empty; } // set up the query service @@ -474,7 +381,7 @@ try { services = central.findService(service); } catch (MobyException e1) { - System.err.println("error in getAllServices 2:\n" + e1.getMessage()); + log.error("error in getAllServices 2:\n" + e1.getMessage()); return empty; } // should have >= 1 service returned @@ -487,6 +394,42 @@ return str; } + /** + * @return + * @throws MobyException + */ + private static Central getCentralImpl() throws MobyException { + Central central; + String registryURL = null; + String registryNamespace = null; + + // are they set in the system? + registryURL = System.getProperty("MOBY_SERVER"); + registryNamespace = System.getProperty("MOBY_URI"); + + // if we didnt set them check the environment + if (registryURL == null) { + Map map = RegistryOS.getEnv(); + if (!map.isEmpty()) { + registryURL = (String) map.get("MOBY_SERVER"); + registryNamespace = (String) map.get("MOBY_URI"); + } + } + + log.info("Using URL: " + (registryURL == null ? CentralImpl.DEFAULT_ENDPOINT : registryURL) + " URI: " + (registryNamespace == null ? CentralImpl.DEFAULT_NAMESPACE: registryNamespace)); + if (registryURL == null) { + // use default registry, since we dont have a local one + central = new CentralImpl(); + } else if (registryNamespace == null) { + // use default namespace since one isnt defined + central = new CentralImpl(registryURL); + } else { + // use defined url and namespacce + central = new CentralImpl(registryURL, registryNamespace); + } + return central; + } + /* * a method that retrieves all of the service instances based on an @@ -500,50 +443,13 @@ // initialize central try { if (!useTestMachine) { - String registryURL = null; - String registryNamespace = null; - Map map = RegistryOS.getEnv(); - if (!map.isEmpty()) { - registryURL = (String) map.get("MOBY_SERVER"); - if (registryURL == null) - registryURL = System.getProperty("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryNamespace == null) - registryNamespace = System.getProperty("MOBY_URI"); - log.info("Using URL: " + registryURL + " URI: " + registryNamespace); - if (registryURL == null) { - // use default registry, since we dont have a local one - central = new CentralImpl(); - } else if (registryNamespace == null) { - // use default namespace since one isnt defined - central = new CentralImpl(registryURL); - } else { - // use defined url and namespacce - central = new CentralImpl(registryURL, registryNamespace); - } - } else { - // perhaps the System propery was set earlier. - if (registryURL == null) - registryURL = System.getProperty("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryNamespace == null) - registryNamespace = System.getProperty("MOBY_URI"); - - // use the default central if we have no other choice - if (registryURL != null) - if (registryNamespace != null) - central = new CentralImpl(registryURL, registryNamespace); - else - central = new CentralImpl(registryURL); - else - central = new CentralImpl(); - } + central = getCentralImpl(); } else { // use test machine no longer supported return empty; } } catch (MobyException e) { - System.err.println("error in getAllServices 1:\n" + e.getMessage()); + log.error("error in getAllServices 1:\n" + e.getMessage()); return empty; } // set up the query service @@ -553,7 +459,7 @@ try { services = central.findService(service); } catch (MobyException e1) { - System.err.println("error in getAllServices 2:\n" + e1.getMessage()); + log.error("error in getAllServices 2:\n" + e1.getMessage()); return empty; } // should have >= 1 service returned @@ -578,50 +484,13 @@ // initialize central try { if (!useTestMachine) { - String registryURL = null; - String registryNamespace = null; - Map map = RegistryOS.getEnv(); - if (!map.isEmpty()) { - registryURL = (String) map.get("MOBY_SERVER"); - if (registryURL == null) - registryURL = System.getProperty("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryNamespace == null) - registryNamespace = System.getProperty("MOBY_URI"); - log.info("Using URL: " + registryURL + " URI: " + registryNamespace); - if (registryURL == null) { - // use default registry, since we dont have a local one - central = new CentralImpl(); - } else if (registryNamespace == null) { - // use default namespace since one isnt defined - central = new CentralImpl(registryURL); - } else { - // use defined url and namespacce - central = new CentralImpl(registryURL, registryNamespace); - } - } else { - // use default registry since we cant determine if local one - // exists - if (registryURL == null) - registryURL = System.getProperty("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryNamespace == null) - registryNamespace = System.getProperty("MOBY_URI"); - - if (registryURL != null) - if (registryNamespace != null) - central = new CentralImpl(registryURL, registryNamespace); - else - central = new CentralImpl(registryURL); - else - central = new CentralImpl(); - } + central = getCentralImpl(); } else { // use test machine no longer supported return empty; } } catch (MobyException e) { - System.err.println("error in getService 1:\n" + e.getMessage()); + log.error("error in getService 1:\n" + e.getMessage()); return empty; } // set up the query service @@ -631,7 +500,7 @@ try { services = central.findService(service); } catch (MobyException e1) { - System.err.println("error in getService 2:\n" + e1.getMessage()); + log.error("error in getService 2:\n" + e1.getMessage()); return empty; } // only one service should be returned! @@ -657,50 +526,13 @@ // initialize central try { if (!useTestMachine) { - String registryURL = null; - String registryNamespace = null; - Map map = RegistryOS.getEnv(); - if (!map.isEmpty()) { - registryURL = (String) map.get("MOBY_SERVER"); - if (registryURL == null) - registryURL = System.getProperty("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryNamespace == null) - registryNamespace = System.getProperty("MOBY_URI"); - log.info("Using URL: " + registryURL + " URI: " + registryNamespace); - if (registryURL == null) { - // use default registry, since we dont have a local one - central = new CentralImpl(); - } else if (registryNamespace == null) { - // use default namespace since one isnt defined - central = new CentralImpl(registryURL); - } else { - // use defined url and namespacce - central = new CentralImpl(registryURL, registryNamespace); - } - } else { - // use default registry since we cant determine if local one - // exists - if (registryURL == null) - registryURL = System.getProperty("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryNamespace == null) - registryNamespace = System.getProperty("MOBY_URI"); - - if (registryURL != null) - if (registryNamespace != null) - central = new CentralImpl(registryURL, registryNamespace); - else - central = new CentralImpl(registryURL); - else - central = new CentralImpl(); - } + central = getCentralImpl(); } else { // use test machine no longer supported return empty; } } catch (MobyException e) { - System.err.println("error in getService 1:\n" + e.getMessage()); + log.error("error in getService 1:\n" + e.getMessage()); return empty; } // set up the query service @@ -710,7 +542,7 @@ try { services = central.findService(service); } catch (MobyException e1) { - System.err.println("error in getService 2:\n" + e1.getMessage()); + log.error("error in getService 2:\n" + e1.getMessage()); return empty; } // only one service should be returned! @@ -794,9 +626,10 @@ { // add meta information on whether or not this service is // callable (i.e. times out or not) + if (useLSIDs) try { URL _url_ = new URL( - "http://mobycentral.icapture.ubc.ca:8090/servlets/ValidateService?authority=" + SERVER + "ValidateService?authority=" + services[i].getAuthority() + "&service=" + services[i].getName()); BufferedReader in = new BufferedReader( @@ -1016,7 +849,7 @@ // should not be here, but ... } else { // ERROR - System.err.println("Secondary input was not of known subtype (Secondary)"); + log.error("Secondary input was not of known subtype (Secondary)"); return null; } } @@ -1170,28 +1003,7 @@ MobyService[] services = null; // initialize central try { - String registryURL; - String registryNamespace; - Map map = RegistryOS.getEnv(); - if (!map.isEmpty()) { - registryURL = (String) map.get("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - log.info("Using URL: " + registryURL + " URI: " + registryNamespace); - if (registryURL == null) { - // use default registry, since we dont have a local one - central = new CentralImpl(); - } else if (registryNamespace == null) { - // use default namespace since one isnt defined - central = new CentralImpl(registryURL); - } else { - // use defined url and namespacce - central = new CentralImpl(registryURL, registryNamespace); - } - } else { - // use default registry since we cant determine if local one - // exists - central = new CentralImpl(); - } + central = getCentralImpl(); } catch (MobyException e) { return false; } @@ -1213,28 +1025,7 @@ MobyService[] services = null; // initialize central try { - String registryURL; - String registryNamespace; - Map map = RegistryOS.getEnv(); - if (!map.isEmpty()) { - registryURL = (String) map.get("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - log.info("Using URL: " + registryURL + " URI: " + registryNamespace); - if (registryURL == null) { - // use default registry, since we dont have a local one - central = new CentralImpl(); - } else if (registryNamespace == null) { - // use default namespace since one isnt defined - central = new CentralImpl(registryURL); - } else { - // use defined url and namespacce - central = new CentralImpl(registryURL, registryNamespace); - } - } else { - // use default registry since we cant determine if local one - // exists - central = new CentralImpl(); - } + central = getCentralImpl(); } catch (MobyException e) { return false; } @@ -1262,32 +1053,7 @@ MobyService[] services = null; // initialize central try { - String registryURL; - String registryNamespace; - Map map = RegistryOS.getEnv(); - if (!map.isEmpty()) { - registryURL = (String) map.get("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryURL == null) { - // use default registry, since we dont have a local one - central = new CentralImpl(); - } else if (registryNamespace == null) { - // use default namespace since one isnt defined - central = new CentralImpl(registryURL); - } else { - // use defined url and namespacce - central = new CentralImpl(registryURL, registryNamespace); - } - log.info("Using URL: " - + (registryURL == null ? CentralImpl.DEFAULT_ENDPOINT : registryURL) - + " URI: " - + (registryNamespace == null ? CentralImpl.DEFAULT_NAMESPACE - : registryNamespace)); - } else { - // use default registry since we cant determine if local one - // exists - central = new CentralImpl(); - } + central = getCentralImpl(); } catch (MobyException e) { return ""; } @@ -1324,7 +1090,7 @@ // false)); // log.info(findService("bioinfo.icapture.ubc.ca","MOBYSHoundGetGenBankGFF", // false)); - log.info(findService("genome.imim.es", null, false)); + log.info(findService("blah.blah.blah", "Echo_test", "http://bioinfo.icapture.ubc.ca/cgi-bin/mobycentral/MOBY-Central.pl", "http://bioinfo.icapture.ubc.ca/MOBY/Central", false)); // log.info(findService("", "", false)); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/RDFConfigure.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/RDFConfigure.java 2006/08/28 13:50:13 1.21 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/RDFConfigure.java 2006/10/11 01:54:51 1.22 @@ -5,19 +5,15 @@ import java.io.IOException; import java.io.OutputStream; import java.net.URL; -import java.util.HashMap; import java.util.Map; -import java.util.Properties; -import javax.naming.Context; -import javax.naming.InitialContext; - -import org.biomoby.client.CentralImpl; +import org.apache.commons.discovery.tools.DiscoverSingleton; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.biomoby.client.rdf.vocabulary.DC_PROTEGE; import org.biomoby.client.rdf.vocabulary.Predicates; -import org.biomoby.registry.properties.MobyProperties; -import org.biomoby.shared.Central; -import org.biomoby.shared.MobyResourceRef; +import org.biomoby.client.ui.graphical.servlet.jresources.RESOURCE; +import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; @@ -54,84 +50,53 @@ */ @SuppressWarnings("unchecked") public class RDFConfigure { + private static Log log = LogFactory.getLog(RESOURCE.class); + + final private static String newline = System.getProperty("line.separator"); + final public static String URI_OBJECT; + + final public static String URI_SERVICE; + + final public static String URI_NAMESPACE; + + final public static String URI_PREDICATE; + + final public static String URI_ServiceINSTANCE; /* * Some constants for use in the rdfs */ - private static Map URI_MAP = new HashMap(); + static { - boolean __success = false; - // attempt 1 - servlet context + ContextLoader cLoader = null; try { - Context c = new InitialContext(); - String MOBY_SERVER = (String) c.lookup("java:comp/env/MOBY_SERVER"); - if (MOBY_SERVER != null && !MOBY_SERVER.equals("")) { - Central central = new CentralImpl(MOBY_SERVER); - MobyResourceRef[] refs = central.getResourceRefs(); - for (int i = 0; i < refs.length; i++) { - String url = refs[i].getResourceLocation().toExternalForm(); - if (url.lastIndexOf("#") < 0) - url = url + "#"; - URI_MAP.put(refs[i].getResourceName(), url); - } - __success = true; - } - + cLoader = (ContextLoader) DiscoverSingleton.find(Class + .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( + (String) ContextLoader.class.getCanonicalName()).getName()); + log + .info((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" + : "ContextLoader has loaded successfully.")); } catch (Exception e) { - e.printStackTrace(); + log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" + + System.getProperty("line.separator") + e.getMessage()); } - // attempt 2 - environment variables - if (!__success) { - // maybe try for environment variables - Properties p = MobyProperties.PROPERTIES(); - String MOBY_SERVER = (String) p.get("MOBY_SERVER"); - try { - if (MOBY_SERVER != null && !MOBY_SERVER.equals("")) { - Central central = new CentralImpl(MOBY_SERVER); - MobyResourceRef[] refs = central.getResourceRefs(); - for (int i = 0; i < refs.length; i++) { - String url = refs[i].getResourceLocation().toExternalForm(); - if (url.lastIndexOf("#") < 0) - url = url + "#"; - URI_MAP.put(refs[i].getResourceName(), url); - } - __success = true; - } - } catch (Exception ex) { - // die here? - ex.printStackTrace(); - } - } - // attempt 3 - default to mobycentral - if (!__success) { - // default to mobycentral - try { - Central central = new CentralImpl(); - MobyResourceRef[] refs = central.getResourceRefs(); - for (int i = 0; i < refs.length; i++) { - String url = refs[i].getResourceLocation().toExternalForm(); - if (url.lastIndexOf("#") < 0) - url = url + "#"; - URI_MAP.put(refs[i].getResourceName(), url); - } - __success = true; - } catch (Exception ex) { - // die here? - ex.printStackTrace(); - } - } - } + + log.info("Setting RDF ResourceLocations (RDFConfigure) for current registry..."); - final public static String URI_OBJECT = (String) URI_MAP.get("Object"); // "http://biomoby.org/RESOURCES/MOBY-S/Objects#"; + + URI_OBJECT = (String) cLoader.getURI_MAP().get("Object"); - final public static String URI_SERVICE = (String) URI_MAP.get("Service"); // "http://biomoby.org/RESOURCES/MOBY-S/Services#"; + URI_SERVICE = (String) cLoader.getURI_MAP().get("Service"); - final public static String URI_NAMESPACE = (String) URI_MAP.get("Namespace"); // "http://biomoby.org/RESOURCES/MOBY-S/Namespaces#"; + URI_NAMESPACE = (String) cLoader.getURI_MAP().get("Namespace"); - final public static String URI_PREDICATE = "http://biomoby.org/RESOURCES/MOBY-S/Predicates#"; + URI_PREDICATE = "http://biomoby.org/RESOURCES/MOBY-S/Predicates#"; + + URI_ServiceINSTANCE = (String) cLoader.getURI_MAP().get("ServiceInstance"); + } - final public static String URI_ServiceINSTANCE = (String) URI_MAP.get("ServiceInstance"); // "http://biomoby.org/RESOURCES/MOBY-S/ServiceInstances#"; + private Model model = null; From kawas at dev.open-bio.org Tue Oct 10 21:55:44 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 21:55:44 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610110155.k9B1thpg025500@dev.open-bio.org> kawas Tue Oct 10 21:55:43 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jTypes In directory dev.open-bio.org:/tmp/cvs-serv25465/Java/src/main/org/biomoby/client/ui/graphical/servlet/jTypes Modified Files: Types.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jTypes Types.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jTypes/Types.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/ui/graphical/servlet/jTypes/Types.java 2006/05/24 18:48:31 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jTypes/Types.java 2006/10/11 01:55:43 1.7 @@ -5,8 +5,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.naming.Context; -import javax.naming.InitialContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; @@ -32,46 +30,7 @@ * @see javax.servlet.GenericServlet#init() */ public final void init() throws ServletException { - // super.init(); - // try to load environment variables set in context.xml - try { - Context c = new InitialContext(); - - try { - String MOBY_CENTRAL_CONFIG = null; - MOBY_CENTRAL_CONFIG = (String) c.lookup("java:comp/env/MOBY_CENTRAL_CONFIG"); - if (MOBY_CENTRAL_CONFIG != null && !MOBY_CENTRAL_CONFIG.equals("")) { - // set MOBY_CENTRAL_CONFIG - log.info("init(setting MOBY_CENTRAL_CONFIG)"); - System.setProperty("MOBY_CENTRAL_CONFIG", MOBY_CENTRAL_CONFIG); - } - - } catch (Exception ex) { - } - try { - String MOBY_SERVER = null; - MOBY_SERVER = (String) c.lookup("java:comp/env/MOBY_SERVER"); - if (MOBY_SERVER != null && !MOBY_SERVER.equals("")) { - // set MOBY_SERVER - log.info("init(setting MOBY_SERVER)"); - System.setProperty("MOBY_SERVER", MOBY_SERVER); - } - } catch (Exception ex) { - } - - try { - String MOBY_URI = null; - MOBY_URI = (String) c.lookup("java:comp/env/MOBY_URI"); - if (MOBY_URI != null && !MOBY_URI.equals("")) { - // set MOBY_URI - log.info("init(setting MOBY_URI)"); - System.setProperty("MOBY_URI", MOBY_URI); - } - } catch (Exception ex) { - } - - } catch (Exception e) { - } + } /* (non-Javadoc) @@ -87,7 +46,7 @@ Pattern p ; Matcher m ; if (path == null) { - response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Please specify which definitions you are looking for (Objects, Services, or Namespaces)."); + response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Please specify which definitions you are looking for (i.e., Objects, Services, or Namespaces)."); return; } p = Pattern.compile("/Services\\S*"); From kawas at dev.open-bio.org Wed Oct 11 16:39:32 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Wed, 11 Oct 2006 16:39:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610112039.k9BKdWVK027958@dev.open-bio.org> kawas Wed Oct 11 16:39:31 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv27923/Java/docs Modified Files: RegistryServlets.html Log Message: Added some configuration information. moby-live/Java/docs RegistryServlets.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/RegistryServlets.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/RegistryServlets.html 2006/10/10 18:51:50 1.1 +++ /home/repository/moby/moby-live/Java/docs/RegistryServlets.html 2006/10/11 20:39:31 1.2 @@ -4,6 +4,11 @@ Registry Servlets +

    BioMOBY Registry Servlets

    @@ -15,7 +20,7 @@
  • Types 'script' - a servlet that is used to generate textual dumps for the Object, Namespace and Service Type ontologies.
  • LSID Authority Servlet - a servlet that is used to resolve biomoby.org*, LSIDs to metadata.
  • Service Tester Servlet - a servlet that periodically 'pings' the services contained in the registry to determine whether or not the services URL are resolvable.
  • -
  • RDFAgent Validator - a servlet that can be used to test whether your installation of the agent was successful, or to test an RDF document that describes your services for syntatical errors.
  • +
  • RDFAgent Validator - a servlet that can be used to test whether your installation of the agent was successful, or to test an RDF document that describes your services for syntactical errors.
  • LSID client web applications that can be used to resolve LSIDs. One of these applications uses AJAX and provides auto complete functionality.
  • @@ -41,8 +46,13 @@

    Installing the Servlets

    Installing the servlets is extremely straight-forward and quite easy.

      -
    1. Download the installation file from ...
    2. -
    3. Run the installer, making sure to follow the on screen prompts.
    4. +
    5. Download the installation file from http://bioinfo.icapture.ubc.ca/ekawas/servlets/install.jar
      +
      +
    6. +
    7. From the command line, enter the following command
      +
      java -jar install.jar
      +

      A GUI should result that will guide you through the installation process.

      +
    8. Your done! Now all you have to do is configure your newly installed servlets.
    @@ -55,7 +65,15 @@
  • The exact location of the mobycentral.config (confused? refer here)
  • Your JAVA J2EE servers complete address
  • -

    Once you have those values, you will have to modify the servlets configuration file that is located at /path/to/tomcat/webapps/authority/META-INF/context.xml

    +
    +

    How to Configure

    + +
    +

    Once you have those values, you will have to modify the servlets configuration file that is located at /path/to/tomcat/webapps/authority/META-INF/context.xml

    The file context.xml is written in XML and contains numerous entries that look like this:

     	
    @@ -115,12 +133,14 @@
             suffix
             The file name suffix 
           
    -      
    -        For a more precise explanation of how to configure this aspect of the servlets, please refer to http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html
    -      
         
    +    
    +
    +

    For a more precise explanation of how to configure this aspect of the servlets, please refer to
    http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html

    +
    +

    Once you have modified these parameters in this file, you may close the file.

    -

    Next, you will have to open the file mobycentral.config and add or modify a couple of configuration parameters:

    +

    Next, you will have to open the file mobycentral.config and add or modify a couple of configuration parameters:

  • To the [mobycentral] section of this file, please ensure that the following parameters are set:
  • @@ -164,7 +184,7 @@

     

    -
  • To the [mobynamespace] section of this file, please ensure that the following parameters are set:
  • +
  • To the [mobynamespace] section of this file, please ensure that the following parameters are set:
  • @@ -183,7 +203,7 @@
    lsid_authority

     

    -
  • To the [mobyservice] section of this file, please ensure that the following parameters are set:
  • +
  • To the [mobyservice] section of this file, please ensure that the following parameters are set:
  • @@ -201,16 +221,50 @@

    This value is most likely: http://yourDomain:yourPort/authority/RESOURCES/MOBY-S/ServiceTypes

    lsid_authority
    -

    Once these values have been added or modified, make sure to save the configuration files and restart the server. Your changes should be reflected in your registry.

    +

     

    +

    To enable the LSID authority servlets, you will have to perform up to 2 more tasks:

    +
      +
    • Create a DNS record for your domain
    • +
    • Add ProxyPass directives to your Apache servers' configuration file (optional)
    • +
    +

    Setting up DNS (excerpt)

    +
    +

    All that you - or your system administrator - must do, is to add a service record for the machine that will run the authority.

    +

    Suppose the machine is authority.company.net and that it will serve as the authority named company.net. Further suppose that the service will be on port 8080. The record that must be added should go into the master zone file for company.net's DNS server (perhaps a file named /var/named/company.net.zone on company.net):

    +
    _lsid._tcp      IN      SRV     1       0       8080    authority.company.net.
    +

    If the authority name is supposed to be authority.company.net rather than company.net, the record in company.net's zone file should look like:

    +
    _lsid._tcp.authority    IN      SRV     1       0       8080    authority.company.net. 
    +
    +
    +

    Enabling ProxyPass Apache Directives

    +
    +

    For those of you that are running Tomcat on a non-standard port, you may find that users of your registry cannot access those ports due to firewall restrictions. One way around this is to set up ProxyPass directives in your web server.

    +

    Before you begin, it is highly recommended that you backup any files mentioned here that you will be updating.

    +

    Open up your Apache servers httpd.conf file and make sure that following line is uncommented:

    +
    LoadModule proxy_module modules/mod_proxy.so 
    +

    Then add the following to the bottom of the file

    +
    +ProxyPass /authority http://localhost:8080/authority
    +ProxyPass /authority/ http://localhost:8080/authority/
    +ProxyPass authority http://localhost:8080/authority
    +ProxyPass authority/ http://localhost:8080/authority/ 
    + Now requests made to localhost/authority will be sent to localhost:8080/authority and your users should not have any problems accessing the URLs.
    +
    +

    Once these values have been added or modified, make sure to save the configuration files and restart the server. Your changes should be reflected in your registry.

    Testing Your Servlets

    -

    +

    Once you have installed and configured the servlets, you can determine if the install was successful by attempting to resolve the following URL:

    +
    +

    http://your.domain.com:your_port/authority/moby.jsp

    +
    +

    where your.domain.com is the domain name of the server that the servlets were installed on and your_port is the server port.

    +

    The resulting page will outline those servlets that are included in this distribution and will provide you with links to test them.


    - Edward A Kawas
    + Edward A Kawas
    From kawas at dev.open-bio.org Wed Oct 11 21:55:20 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Wed, 11 Oct 2006 21:55:20 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610120155.k9C1tKjF029640@dev.open-bio.org> kawas Wed Oct 11 21:55:20 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities In directory dev.open-bio.org:/tmp/cvs-serv29605/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities Modified Files: ServiceTester.java Log Message: services with urls that were 'localhost' caused the tester to perform inadequately ;-) moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities ServiceTester.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ServiceTester.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/ui/graphical/servlet/utilities/ServiceTester.java 2006/10/11 01:54:50 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ServiceTester.java 2006/10/12 01:55:20 1.5 @@ -94,16 +94,21 @@ // avoid indexing errors (we checked the length before entering loop) if (i >= services.length) break; - MobyService service = services[i]; + MobyService service = services[i++]; String authority = service.getAuthority(); String name = service.getName(); if (service.getURL().toLowerCase().startsWith("http://localhost") || service.getURL().toLowerCase().startsWith("http://127.0.0.1")) { - continue; + Map list = null; + if (theMap.containsKey(authority)) + list = (Map) theMap.get(authority); + else + list = Collections.synchronizedMap(new HashMap()); + list.put(name, new Boolean(false)); + theMap.put(authority, list); } testers[j] = new TesterThread(service); testers[j].start(); - i++; } } else { // should in theory have no more services to test ... @@ -314,4 +319,10 @@ public void setNumThreads(int numThreads) { this.numThreads = numThreads; } + public static void main(String[] args) throws MobyException { + ServiceTester s = new ServiceTester("http://localhost/cgi-bin/MOBY-Central.pl","http://localhost/MOBY/Central"); + s.testServices(s.getServices()); + System.out.println(s.getResults()); + + } } From kawas at dev.open-bio.org Thu Oct 12 10:01:15 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 12 Oct 2006 10:01:15 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610121401.k9CE1FXd008836@dev.open-bio.org> kawas Thu Oct 12 10:01:14 EDT 2006 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv8801 Modified Files: Central.pm Log Message: updated an address moby-live/Perl/MOBY Central.pm,1.260,1.261 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.260 retrieving revision 1.261 diff -u -r1.260 -r1.261 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2006/10/06 17:51:50 1.260 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2006/10/12 14:01:14 1.261 @@ -1439,7 +1439,7 @@ sub _getServiceInstanceRDF { my ( %args ) = @_; my $browser = LWP::UserAgent->new; - my $url = URI->new( 'http://mobycentral.icapture.ubc.ca/servlets/RDFGenerator' ); + my $url = URI->new( 'http://mobycentral.icapture.ubc.ca/authority/RDFGenerator' ); # makes an object representing the URL $url->query_form( # And here the form data pairs: 'name' => $args{name}, From kawas at dev.open-bio.org Thu Oct 12 12:57:14 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 12 Oct 2006 12:57:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610121657.k9CGvEeZ009629@dev.open-bio.org> kawas Thu Oct 12 12:57:14 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder In directory dev.open-bio.org:/tmp/cvs-serv9593/Java/src/main/org/biomoby/client/rdf/builder Modified Files: ServiceInstanceRDF.java Log Message: update that sets isAlive to true if information is not available at the time of RDF creation moby-live/Java/src/main/org/biomoby/client/rdf/builder ServiceInstanceRDF.java,1.31,1.32 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2006/10/11 01:54:51 1.31 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2006/10/12 16:57:14 1.32 @@ -639,13 +639,22 @@ in.close(); if (inputLine != null) { inputLine = inputLine.trim(); - if (!inputLine.equals("")) { + if (!inputLine.equals("") && (inputLine.equals("true") || inputLine.equals("false"))) { subject.addProperty(model.createProperty(FetaVocabulary.getURI() + "isAlive"), Boolean.valueOf(inputLine)); + } else { + // defaults to true + subject.addProperty(model.createProperty(FetaVocabulary.getURI() + + "isAlive"), true); } + } else { + subject.addProperty(model.createProperty(FetaVocabulary.getURI() + + "isAlive"), true); } } catch (Exception e) { + subject.addProperty(model.createProperty(FetaVocabulary.getURI() + + "isAlive"), true); } } // create the organization node From senger at dev.open-bio.org Fri Oct 13 17:47:09 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:47:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132147.k9DLl9Pr019506@dev.open-bio.org> senger Fri Oct 13 17:47:09 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY In directory dev.open-bio.org:/tmp/cvs-serv19488/MOSES/MOBY Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY added to the repository moby-live/Java/src/Perl/MOSES/MOBY - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 17:46:58 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:46:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132146.k9DLkwu7019467@dev.open-bio.org> senger Fri Oct 13 17:46:58 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES In directory dev.open-bio.org:/tmp/cvs-serv19449/MOSES Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/MOSES added to the repository moby-live/Java/src/Perl/MOSES - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 17:48:30 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:48:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132148.k9DLmUCW019545@dev.open-bio.org> senger Fri Oct 13 17:48:29 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Cache In directory dev.open-bio.org:/tmp/cvs-serv19527/MOSES/MOBY/Cache Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Cache added to the repository moby-live/Java/src/Perl/MOSES/MOBY/Cache - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Cache/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Cache/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Cache/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 17:48:30 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:48:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132148.k9DLmUQe019562@dev.open-bio.org> senger Fri Oct 13 17:48:30 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Data In directory dev.open-bio.org:/tmp/cvs-serv19527/MOSES/MOBY/Data Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Data added to the repository moby-live/Java/src/Perl/MOSES/MOBY/Data - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Data/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Data/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Data/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 17:48:30 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:48:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132148.k9DLmUlT019600@dev.open-bio.org> senger Fri Oct 13 17:48:30 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators In directory dev.open-bio.org:/tmp/cvs-serv19527/MOSES/MOBY/Generators Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators added to the repository moby-live/Java/src/Perl/MOSES/MOBY/Generators - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 17:48:30 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:48:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132148.k9DLmUIQ019581@dev.open-bio.org> senger Fri Oct 13 17:48:30 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Def In directory dev.open-bio.org:/tmp/cvs-serv19527/MOSES/MOBY/Def Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Def added to the repository moby-live/Java/src/Perl/MOSES/MOBY/Def - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Def/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Def/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Def/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 17:48:30 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:48:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132148.k9DLmU1c019623@dev.open-bio.org> senger Fri Oct 13 17:48:30 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Service In directory dev.open-bio.org:/tmp/cvs-serv19527/MOSES/MOBY/Service Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Service added to the repository moby-live/Java/src/Perl/MOSES/MOBY/Service - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Service/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Service/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Service/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 17:50:06 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:50:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132150.k9DLo6m4019668@dev.open-bio.org> senger Fri Oct 13 17:50:05 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/templates In directory dev.open-bio.org:/tmp/cvs-serv19650/MOSES/MOBY/Generators/templates Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/templates added to the repository moby-live/Java/src/Perl/MOSES/MOBY/Generators/templates - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/templates/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/templates/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/templates/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 17:51:16 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:51:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132151.k9DLpGZE019704@dev.open-bio.org> senger Fri Oct 13 17:51:16 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY In directory dev.open-bio.org:/tmp/cvs-serv19689/MOSES/MOBY Added Files: Base.pm Config.pm Package.pm Parser.pm ServiceException.pm Tags.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOSES/MOBY Base.pm,NONE,1.1 Config.pm,NONE,1.1 Package.pm,NONE,1.1 Parser.pm,NONE,1.1 ServiceException.pm,NONE,1.1 Tags.pm,NONE,1.1 From senger at dev.open-bio.org Fri Oct 13 17:51:16 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:51:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132151.k9DLpGhG019718@dev.open-bio.org> senger Fri Oct 13 17:51:16 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Cache In directory dev.open-bio.org:/tmp/cvs-serv19689/MOSES/MOBY/Cache Added Files: Central.pm Registries.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOSES/MOBY/Cache Central.pm,NONE,1.1 Registries.pm,NONE,1.1 From senger at dev.open-bio.org Fri Oct 13 17:51:17 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:51:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132151.k9DLpHgn019786@dev.open-bio.org> senger Fri Oct 13 17:51:17 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/templates In directory dev.open-bio.org:/tmp/cvs-serv19689/MOSES/MOBY/Generators/templates Added Files: datatype.tt service-base.tt service.tt Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOSES/MOBY/Generators/templates datatype.tt,NONE,1.1 service-base.tt,NONE,1.1 service.tt,NONE,1.1 From senger at dev.open-bio.org Fri Oct 13 17:51:16 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:51:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132151.k9DLpG2B019752@dev.open-bio.org> senger Fri Oct 13 17:51:16 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Def In directory dev.open-bio.org:/tmp/cvs-serv19689/MOSES/MOBY/Def Added Files: Data.pm DataType.pm Namespace.pm Relationship.pm Service.pm ServiceType.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOSES/MOBY/Def Data.pm,NONE,1.1 DataType.pm,NONE,1.1 Namespace.pm,NONE,1.1 Relationship.pm,NONE,1.1 Service.pm,NONE,1.1 ServiceType.pm,NONE,1.1 From senger at dev.open-bio.org Fri Oct 13 17:51:17 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:51:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132151.k9DLpHM3019806@dev.open-bio.org> senger Fri Oct 13 17:51:17 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Service In directory dev.open-bio.org:/tmp/cvs-serv19689/MOSES/MOBY/Service Added Files: ServiceBase.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOSES/MOBY/Service ServiceBase.pm,NONE,1.1 From senger at dev.open-bio.org Fri Oct 13 17:51:16 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:51:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132151.k9DLpGWA019734@dev.open-bio.org> senger Fri Oct 13 17:51:16 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Data In directory dev.open-bio.org:/tmp/cvs-serv19689/MOSES/MOBY/Data Added Files: Boolean.pm DateTime.pm Float.pm Integer.pm Object.pm ProvisionInformation.pm String.pm Xref.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOSES/MOBY/Data Boolean.pm,NONE,1.1 DateTime.pm,NONE,1.1 Float.pm,NONE,1.1 Integer.pm,NONE,1.1 Object.pm,NONE,1.1 ProvisionInformation.pm,NONE,1.1 String.pm,NONE,1.1 Xref.pm,NONE,1.1 From senger at dev.open-bio.org Fri Oct 13 17:51:17 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:51:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132151.k9DLpHlp019772@dev.open-bio.org> senger Fri Oct 13 17:51:16 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators In directory dev.open-bio.org:/tmp/cvs-serv19689/MOSES/MOBY/Generators Added Files: GenServices.pm GenTypes.pm Utils.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOSES/MOBY/Generators GenServices.pm,NONE,1.1 GenTypes.pm,NONE,1.1 Utils.pm,NONE,1.1 From senger at dev.open-bio.org Fri Oct 13 18:07:56 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:07:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132207.k9DM7uxg019879@dev.open-bio.org> senger Fri Oct 13 18:07:56 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv19857/MOBY Removed Files: Base.pm Config.pm Package.pm Parser.pm ServiceException.pm Tags.pm notes Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOBY Base.pm,1.20,NONE Config.pm,1.4,NONE Package.pm,1.8,NONE Parser.pm,1.23,NONE ServiceException.pm,1.4,NONE Tags.pm,1.3,NONE notes,1.22,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/RCS/Base.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/RCS/Config.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/RCS/Package.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/RCS/Parser.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/RCS/ServiceException.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/RCS/Tags.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/RCS/notes,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 18:07:56 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:07:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132207.k9DM7uuT019919@dev.open-bio.org> senger Fri Oct 13 18:07:56 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data In directory dev.open-bio.org:/tmp/cvs-serv19857/MOBY/Data Removed Files: Boolean.pm DateTime.pm Float.pm Integer.pm Object.pm ProvisionInformation.pm String.pm Xref.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOBY/Data Boolean.pm,1.2,NONE DateTime.pm,1.1,NONE Float.pm,1.1,NONE Integer.pm,1.1,NONE Object.pm,1.8,NONE ProvisionInformation.pm,1.3,NONE String.pm,1.1,NONE Xref.pm,1.3,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data/RCS/Boolean.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data/RCS/DateTime.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data/RCS/Float.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data/RCS/Integer.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data/RCS/Object.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data/RCS/ProvisionInformation.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data/RCS/String.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data/RCS/Xref.pm,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 18:07:57 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:07:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132207.k9DM7v0T020006@dev.open-bio.org> senger Fri Oct 13 18:07:57 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOBY/Service In directory dev.open-bio.org:/tmp/cvs-serv19857/MOBY/Service Removed Files: ServiceBase.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOBY/Service ServiceBase.pm,1.6,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Service/RCS/ServiceBase.pm,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 18:07:56 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:07:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132207.k9DM7udI019939@dev.open-bio.org> senger Fri Oct 13 18:07:56 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOBY/Def In directory dev.open-bio.org:/tmp/cvs-serv19857/MOBY/Def Removed Files: Data.pm DataType.pm Namespace.pm Relationship.pm Service.pm ServiceType.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOBY/Def Data.pm,1.5,NONE DataType.pm,1.8,NONE Namespace.pm,1.3,NONE Relationship.pm,1.4,NONE Service.pm,1.4,NONE ServiceType.pm,1.3,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Def/RCS/Data.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Def/RCS/DataType.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Def/RCS/Namespace.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Def/RCS/Relationship.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Def/RCS/Service.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Def/RCS/ServiceType.pm,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 18:07:57 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:07:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132207.k9DM7vN1019979@dev.open-bio.org> senger Fri Oct 13 18:07:57 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOBY/Generators/templates In directory dev.open-bio.org:/tmp/cvs-serv19857/MOBY/Generators/templates Removed Files: datatype.tt service-base.tt service.tt Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOBY/Generators/templates datatype.tt,1.4,NONE service-base.tt,1.10,NONE service.tt,1.17,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Generators/templates/RCS/datatype.tt,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Generators/templates/RCS/service-base.tt,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Generators/templates/RCS/service.tt,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 18:07:56 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:07:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132207.k9DM7uGg019895@dev.open-bio.org> senger Fri Oct 13 18:07:56 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOBY/Cache In directory dev.open-bio.org:/tmp/cvs-serv19857/MOBY/Cache Removed Files: Central.pm Registries.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOBY/Cache Central.pm,1.19,NONE Registries.pm,1.3,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Cache/RCS/Central.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Cache/RCS/Registries.pm,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 18:07:57 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:07:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132207.k9DM7vdw019960@dev.open-bio.org> senger Fri Oct 13 18:07:56 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOBY/Generators In directory dev.open-bio.org:/tmp/cvs-serv19857/MOBY/Generators Removed Files: GenServices.pm GenTypes.pm Utils.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOBY/Generators GenServices.pm,1.17,NONE GenTypes.pm,1.15,NONE Utils.pm,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Generators/RCS/GenServices.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Generators/RCS/GenTypes.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Generators/RCS/Utils.pm,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 18:08:22 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:08:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132208.k9DM8MQk020046@dev.open-bio.org> senger Fri Oct 13 18:08:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl In directory dev.open-bio.org:/tmp/cvs-serv20031 Added Files: notes Log Message: new module names for Perl Moses moby-live/Java/src/Perl notes,NONE,1.1 From senger at dev.open-bio.org Fri Oct 13 18:08:39 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:08:39 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132208.k9DM8dhZ020118@dev.open-bio.org> senger Fri Oct 13 18:08:39 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/scripts In directory dev.open-bio.org:/tmp/cvs-serv20067 Modified Files: config-status.pl generate-datatypes.pl generate-services.pl install.pl known-registries.pl local-cache.pl testing-parser.pl testing-service.pl universal-testing.pl Log Message: new module names for Perl Moses moby-live/Java/src/scripts config-status.pl,1.8,1.9 generate-datatypes.pl,1.5,1.6 generate-services.pl,1.6,1.7 install.pl,1.4,1.5 known-registries.pl,1.1,1.2 local-cache.pl,1.4,1.5 testing-parser.pl,1.3,1.4 testing-service.pl,1.6,1.7 universal-testing.pl,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/config-status.pl,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/scripts/config-status.pl 2006/07/26 17:57:56 1.8 +++ /home/repository/moby/moby-live/Java/src/scripts/config-status.pl 2006/10/13 22:08:39 1.9 @@ -29,9 +29,9 @@ # ----------------------------------------------------------- use FindBin qw( $Bin ); -use lib "$Bin/../Perl"; # assuming: Perl/MOBY/... +use lib "$Bin/../Perl"; # assuming: Perl/MOSES/... -use MOBY::Base; +use MOSES::MOBY::Base; use strict; $LOG->level ('INFO') if $opt_v; @@ -40,20 +40,20 @@ sub say { print @_, "\n"; } -say "Perl-MoSeS VERSION: $MOBY::Base::VERSION\n"; +say "Perl-MoSeS VERSION: $MOSES::MOBY::Base::VERSION\n"; say 'Configuration'; say '-------------'; -say "Default configuration file: $MOBY::Config::DEFAULT_CONFIG_FILE"; -say "Environment variable $MOBY::Config::ENV_CONFIG_DIR" . - ( exists $ENV{$MOBY::Config::ENV_CONFIG_DIR} ? ": $ENV{$MOBY::Config::ENV_CONFIG_DIR}" : ' is not set'); +say "Default configuration file: $MOSES::MOBY::Config::DEFAULT_CONFIG_FILE"; +say "Environment variable $MOSES::MOBY::Config::ENV_CONFIG_DIR" . + ( exists $ENV{$MOSES::MOBY::Config::ENV_CONFIG_DIR} ? ": $ENV{$MOSES::MOBY::Config::ENV_CONFIG_DIR}" : ' is not set'); say 'Successfully read configuration files:'; -foreach my $file (MOBY::Config->ok_files) { +foreach my $file (MOSES::MOBY::Config->ok_files) { say "\t$file"; } -my %failed = MOBY::Config->failed_files; +my %failed = MOSES::MOBY::Config->failed_files; if (keys %failed > 0) { say 'Failed configuration files:'; foreach my $file (sort keys %failed) { @@ -63,8 +63,8 @@ } say 'All configuration parameters:'; -foreach my $name (sort MOBY::Config->param()) { - say "\t$name => " . MOBY::Config->param ($name); +foreach my $name (sort MOSES::MOBY::Config->param()) { + say "\t$name => " . MOSES::MOBY::Config->param ($name); } say 'All imported names (equivalent to parameters above): '; @@ -85,7 +85,7 @@ say 'Logging'; say '-------'; -my $logger_name = $MOBY::Base::LOGGER_NAME; +my $logger_name = $MOSES::MOBY::Base::LOGGER_NAME; my $logger = Log::Log4perl->get_logger ($logger_name); say "Logger name (use it in the configuration file): $logger_name"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/generate-datatypes.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/scripts/generate-datatypes.pl 2006/07/08 03:52:17 1.5 +++ /home/repository/moby/moby-live/Java/src/scripts/generate-datatypes.pl 2006/10/13 22:08:39 1.6 @@ -34,19 +34,19 @@ # ----------------------------------------------------------- use FindBin qw( $Bin ); -use lib "$Bin/../Perl"; # assuming: Perl/MOBY/... +use lib "$Bin/../Perl"; # assuming: Perl/MOSES/... # scripts/generate-datatypes.pl use strict; -use MOBY::Base; -use MOBY::Generators::GenTypes; +use MOSES::MOBY::Base; +use MOSES::MOBY::Generators::GenTypes; $LOG->level ('INFO') if $opt_v; $LOG->level ('DEBUG') if $opt_d; sub say { print @_, "\n"; } -my $generator = new MOBY::Generators::GenTypes; +my $generator = new MOSES::MOBY::Generators::GenTypes; if (@ARGV) { say 'Generating ' . (@ARGV+0) . '+ data types.'; if ($opt_s) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/generate-services.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/scripts/generate-services.pl 2006/07/30 12:56:56 1.6 +++ /home/repository/moby/moby-live/Java/src/scripts/generate-services.pl 2006/10/13 22:08:39 1.7 @@ -50,12 +50,12 @@ # ----------------------------------------------------------- use FindBin qw( $Bin ); -use lib "$Bin/../Perl"; # assuming: Perl/MOBY/... +use lib "$Bin/../Perl"; # assuming: Perl/MOSES/... # scripts/generate-services.pl use strict; -use MOBY::Base; -use MOBY::Generators::GenServices; +use MOSES::MOBY::Base; +use MOSES::MOBY::Generators::GenServices; $LOG->level ('INFO') if $opt_v; $LOG->level ('DEBUG') if $opt_d; @@ -63,7 +63,7 @@ sub say { print @_, "\n"; } -my $generator = new MOBY::Generators::GenServices; +my $generator = new MOSES::MOBY::Generators::GenServices; if ($opt_a) { say 'Generating all services.'; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/install.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/scripts/install.pl 2006/07/30 12:56:56 1.4 +++ /home/repository/moby/moby-live/Java/src/scripts/install.pl 2006/10/13 22:08:39 1.5 @@ -72,13 +72,13 @@ } use FindBin qw( $Bin ); -use lib "$Bin/../Perl"; # assuming: Perl/MOBY/... +use lib "$Bin/../Perl"; # assuming: Perl/MOSES/... # scripts/install.pl use File::Spec; use IO::Prompt; -use MOBY::Base; -use MOBY::Cache::Central; -use MOBY::Cache::Registries; +use MOSES::MOBY::Base; +use MOSES::MOBY::Cache::Central; +use MOSES::MOBY::Cache::Registries; use English qw( -no_match_vars ) ; use strict; @@ -104,8 +104,8 @@ # what registry to use sub prompt_for_registry { - my $cache = new MOBY::Cache::Central; - my @regs = MOBY::Cache::Registries->list; + my $cache = new MOSES::MOBY::Cache::Central; + my @regs = MOSES::MOBY::Cache::Registries->list; my $registry = prompt ("What registry to use? [default] ", -m => [@regs]); $registry ||= 'default'; @@ -214,7 +214,7 @@ if ('y' eq prompt ('Should I try to fill or update the local cache [y]? ', -ynd=>'y')) { $registry = prompt_for_registry; my $details = - MOBY::Cache::Registries->get ($registry); + MOSES::MOBY::Cache::Registries->get ($registry); if ($details) { my $endpoint = $details->{endpoint}; my $uri = $details->{namespace}; @@ -239,8 +239,8 @@ # configuration file (will be found and used, or created) my $config_file = File::Spec->catfile - ($ENV{$MOBY::Config::ENV_CONFIG_DIR} || $pmoses_home, - $MOBY::Config::DEFAULT_CONFIG_FILE); + ($ENV{$MOSES::MOBY::Config::ENV_CONFIG_DIR} || $pmoses_home, + $MOSES::MOBY::Config::DEFAULT_CONFIG_FILE); if (-e $config_file and ! $opt_F) { say "Configuration file $config_file exists."; say "It will be used and not overwritten unless you start 'install.pl -F'.\n"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/known-registries.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/scripts/known-registries.pl 2006/07/27 17:16:07 1.1 +++ /home/repository/moby/moby-live/Java/src/scripts/known-registries.pl 2006/10/13 22:08:39 1.2 @@ -7,16 +7,16 @@ # ----------------------------------------------------------- use FindBin qw( $Bin ); -use lib "$Bin/../Perl"; # assuming: Perl/MOBY/... +use lib "$Bin/../Perl"; # assuming: Perl/MOSES/... # scripts/install.pl -use MOBY::Cache::Registries; +use MOSES::MOBY::Cache::Registries; use Data::Dumper; use strict; sub say { print @_, "\n"; } -say join (", ", MOBY::Cache::Registries->list); -say (Data::Dumper->Dump ( [ MOBY::Cache::Registries->all ], ['Registries'])); +say join (", ", MOSES::MOBY::Cache::Registries->list); +say (Data::Dumper->Dump ( [ MOSES::MOBY::Cache::Registries->all ], ['Registries'])); __END__ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/local-cache.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/scripts/local-cache.pl 2006/07/27 17:16:07 1.4 +++ /home/repository/moby/moby-live/Java/src/scripts/local-cache.pl 2006/10/13 22:08:39 1.5 @@ -58,28 +58,28 @@ # ----------------------------------------------------------- use FindBin qw( $Bin ); -use lib "$Bin/../Perl"; # assuming: Perl/MOBY/... +use lib "$Bin/../Perl"; # assuming: Perl/MOSES/... # scripts/config-status.pl use strict; -use MOBY::Base; -use MOBY::Cache::Central; -use MOBY::Cache::Registries; +use MOSES::MOBY::Base; +use MOSES::MOBY::Cache::Central; +use MOSES::MOBY::Cache::Registries; $LOG->level ('INFO') if $opt_v; $LOG->level ('DEBUG') if $opt_d; sub say { print @_, "\n"; } -my $cache = new MOBY::Cache::Central; +my $cache = new MOSES::MOBY::Cache::Central; # --- get info if ($opt_i) { say 'Currently used registry: ' . $cache->registry; - say "(it can be changed in $MOBY::Config::DEFAULT_CONFIG_FILE)\n"; + say "(it can be changed in $MOSES::MOBY::Config::DEFAULT_CONFIG_FILE)\n"; my $details = - MOBY::Cache::Registries->get ($cache->registry) || - MOBY::Cache::Registries->get ('default'); + MOSES::MOBY::Cache::Registries->get ($cache->registry) || + MOSES::MOBY::Cache::Registries->get ('default'); foreach my $key (sort keys %{ $details }) { printf " %-12s: %-s\n", $key, $details->{$key}; } @@ -89,9 +89,9 @@ printf "%-13s %+13s %+13s %+10s\n", 'Registry', 'Data types', 'Authorities', 'Services'; - foreach my $reg (MOBY::Cache::Registries->list) { + foreach my $reg (MOSES::MOBY::Cache::Registries->list) { next unless $cache->cache_exists ($reg); - my $new_cache = new MOBY::Cache::Central ( registry => $reg ); + my $new_cache = new MOSES::MOBY::Cache::Central ( registry => $reg ); my $datatypes_count = $new_cache->get_datatype_names; my %authorities = $new_cache->get_service_names; my $services_count = 0; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/testing-parser.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/scripts/testing-parser.pl 2006/07/08 13:52:12 1.3 +++ /home/repository/moby/moby-live/Java/src/scripts/testing-parser.pl 2006/10/13 22:08:39 1.4 @@ -42,12 +42,12 @@ # ----------------------------------------------------------- use FindBin qw( $Bin ); -use lib "$Bin/../Perl"; # assuming: Perl/MOBY/... +use lib "$Bin/../Perl"; # assuming: Perl/MOSES/... # scripts/testing-parser.pl use strict; -use MOBY::Base; -use MOBY::Parser; +use MOSES::MOBY::Base; +use MOSES::MOBY::Parser; $LOG->level ('INFO') if $opt_v; $LOG->level ('DEBUG') if $opt_d; @@ -57,7 +57,7 @@ my ($input_name, $known_type) = split (/\s*:\s*/, $opt_b, 2); push (@parser_args, ( lowestKnownDataTypes => { $input_name => $known_type })); } -my $parser = new MOBY::Parser (@parser_args); +my $parser = new MOSES::MOBY::Parser (@parser_args); my $package = $parser->parse ( method => 'file', data => $ARGV[0] ); print $package unless $opt_n; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/testing-service.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/scripts/testing-service.pl 2006/07/31 15:23:57 1.6 +++ /home/repository/moby/moby-live/Java/src/scripts/testing-service.pl 2006/10/13 22:08:39 1.7 @@ -62,7 +62,7 @@ require lib ; lib->import ("$FindBin::Bin/../Perl/services"); require lib ; lib->import ("$FindBin::Bin/../Perl/generated"); unshift (@INC, $opt_l) if $opt_l; - eval "use MOBY::Base; 1;"; + eval "use MOSES::MOBY::Base; 1;"; $LOG->level ('INFO') if $opt_v; $LOG->level ('DEBUG') if $opt_d; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/universal-testing.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/scripts/universal-testing.pl 2006/07/26 17:57:56 1.2 +++ /home/repository/moby/moby-live/Java/src/scripts/universal-testing.pl 2006/10/13 22:08:39 1.3 @@ -36,13 +36,13 @@ use Carp; use FindBin qw( $Bin ); -use lib "$Bin/../Perl"; # assuming: Perl/MOBY/... +use lib "$Bin/../Perl"; # assuming: Perl/MOSES/... # scripts/universal-testing.pl use strict; -use MOBY::Base; -use MOBY::Cache::Central; -use MOBY::Generators::GenServices; +use MOSES::MOBY::Base; +use MOSES::MOBY::Cache::Central; +use MOSES::MOBY::Generators::GenServices; use File::Spec; $LOG->level ('INFO') if $opt_v; @@ -50,7 +50,7 @@ sub say { print @_, "\n"; } -my $cache = new MOBY::Cache::Central; +my $cache = new MOSES::MOBY::Cache::Central; my $tmpdir = File::Spec->tmpdir(); # create an empty XML input @@ -69,10 +69,10 @@ # service generator my $outdir = File::Spec->catfile ($tmpdir, 'generated-services'); -MOBY::Config->param ('generators.impl.outdir', $outdir); -MOBY::Config->param ('generators.impl.package.prefix', 'Testing'); +MOSES::MOBY::Config->param ('generators.impl.outdir', $outdir); +MOSES::MOBY::Config->param ('generators.impl.package.prefix', 'Testing'); unshift (@INC, $MOBYCFG::GENERATORS_IMPL_OUTDIR); -my $generator = new MOBY::Generators::GenServices; +my $generator = new MOSES::MOBY::Generators::GenServices; # outputs my $outputs = File::Spec->catfile ($tmpdir, 'generated-outputs'); From senger at dev.open-bio.org Sat Oct 14 12:55:13 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Sat, 14 Oct 2006 12:55:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610141655.k9EGtDSR021540@dev.open-bio.org> senger Sat Oct 14 12:55:12 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs/images In directory dev.open-bio.org:/tmp/cvs-serv21513 Modified Files: PerlMoses-architecture-small.jpg PerlMoses-architecture.jpg PerlMoses-architecture.ppt Log Message: moby-live/Java/docs/images PerlMoses-architecture-small.jpg,1.1,1.2 PerlMoses-architecture.jpg,1.1,1.2 PerlMoses-architecture.ppt,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture-small.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture-small.jpg 2006/07/30 22:41:27 1.1 and /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture-small.jpg 2006/10/14 16:55:12 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture-small.jpg: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture.jpg 2006/07/30 22:41:27 1.1 and /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture.jpg 2006/10/14 16:55:12 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture.jpg: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture.ppt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture.ppt 2006/07/30 22:41:27 1.1 and /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture.ppt 2006/10/14 16:55:12 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture.ppt: diff failed From senger at dev.open-bio.org Sat Oct 14 14:37:38 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Sat, 14 Oct 2006 14:37:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610141837.k9EIbcxf021667@dev.open-bio.org> senger Sat Oct 14 14:37:38 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/samples In directory dev.open-bio.org:/tmp/cvs-serv21649/samples Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/samples added to the repository moby-live/Java/src/Perl/samples - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/samples/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/samples/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/samples/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Sat Oct 14 14:37:53 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Sat, 14 Oct 2006 14:37:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610141837.k9EIbrtj021706@dev.open-bio.org> senger Sat Oct 14 14:37:53 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/samples/Service In directory dev.open-bio.org:/tmp/cvs-serv21688/samples/Service Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/samples/Service added to the repository moby-live/Java/src/Perl/samples/Service - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/samples/Service/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/samples/Service/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/samples/Service/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Sat Oct 14 14:38:36 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Sat, 14 Oct 2006 14:38:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610141838.k9EIcaPg021756@dev.open-bio.org> senger Sat Oct 14 14:38:36 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/samples/Service In directory dev.open-bio.org:/tmp/cvs-serv21727/samples/Service Added Files: HelloBiomobyWorld.pm Mabuhay.pm Log Message: samples added moby-live/Java/src/Perl/samples/Service HelloBiomobyWorld.pm,NONE,1.1 Mabuhay.pm,NONE,1.1 From senger at dev.open-bio.org Sat Oct 14 14:38:36 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Sat, 14 Oct 2006 14:38:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610141838.k9EIca4i021742@dev.open-bio.org> senger Sat Oct 14 14:38:36 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/samples In directory dev.open-bio.org:/tmp/cvs-serv21727/samples Added Files: SERVICES_TABLE Log Message: samples added moby-live/Java/src/Perl/samples SERVICES_TABLE,NONE,1.1 From senger at dev.open-bio.org Sat Oct 14 16:46:34 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Sat, 14 Oct 2006 16:46:34 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610142046.k9EKkYaS021913@dev.open-bio.org> senger Sat Oct 14 16:46:33 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/samples/Service In directory dev.open-bio.org:/tmp/cvs-serv21894/samples/Service Modified Files: Mabuhay.pm Log Message: moby-live/Java/src/Perl/samples/Service Mabuhay.pm,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Perl/samples/Service/Mabuhay.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Perl/samples/Service/Mabuhay.pm 2006/10/14 18:38:36 1.1 +++ /home/repository/moby/moby-live/Java/src/Perl/samples/Service/Mabuhay.pm 2006/10/14 20:46:33 1.2 @@ -51,6 +51,7 @@ sub process_it { my ($self, $request, $response, $context) = @_; + # read (some) input data # (use eval to protect against missing data) my $language = eval { $request->language }; @@ -81,7 +82,7 @@ foreach my $idx (0 .. $#result_hellos) { $response->add_hello (new MOSES::MOBY::Data::simple_key_value_pair ( key => $self->as_uni_string ($result_langs[$idx]), - value => $self->as_uni_string ($result_hellos[$idx]) + value => $self->as_uni_string ($result_hellos[$idx]), )); } From senger at dev.open-bio.org Sat Oct 14 16:46:55 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Sat, 14 Oct 2006 16:46:55 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610142046.k9EKktsZ021961@dev.open-bio.org> senger Sat Oct 14 16:46:55 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv21934 Modified Files: Dashboard-NOTES.txt Perl-ChangeLog PerlMoses.html Log Message: moby-live/Java/docs Dashboard-NOTES.txt,1.13,1.14 Perl-ChangeLog,1.1,1.2 PerlMoses.html,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/Dashboard-NOTES.txt,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Java/docs/Dashboard-NOTES.txt 2006/07/28 10:41:43 1.13 +++ /home/repository/moby/moby-live/Java/docs/Dashboard-NOTES.txt 2006/10/14 20:46:55 1.14 @@ -43,12 +43,6 @@ * ParemetersTable: - Float field is not verified for non-numeric chars -* to share preferences for contact-email and authority across all - biomoby entities - -* DataTypeTreeTable - - should check for cyclic definition in data types? - * Service Input Data - should deal also with input Collections - and (perhaps?) to allow entering a more specific data type =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/Perl-ChangeLog,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/Perl-ChangeLog 2006/08/01 08:44:32 1.1 +++ /home/repository/moby/moby-live/Java/docs/Perl-ChangeLog 2006/10/14 20:46:55 1.2 @@ -1,5 +1,9 @@ +2006-10-13 Martin Senger + + * BIG change: All modules were renamed from MOBY::* to + MOSES::MOBY::* (in order not to conflict with the old BioMoby Perl + implementtaion (that uses modules named MOBY::*) + 2006-08-01 Martin Senger * Released - - =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/PerlMoses.html,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/docs/PerlMoses.html 2006/08/01 14:58:51 1.8 +++ /home/repository/moby/moby-live/Java/docs/PerlMoses.html 2006/10/14 20:46:55 1.9 @@ -181,6 +181,7 @@ data/my-input.xml
    + An output (the same with any input data) is nothing really exciting: @@ -607,22 +608,22 @@
    Each BioMoby data type, as registerd in a BioMoby registry, is represented by a Perl object -MOBY::Data::<moby-data-type-name>. For example, a +MOSES::MOBY::Data::<moby-data-type-name>. For example, a GenericSequence object looks like this:
     #-----------------------------------------------------------------
    -# MOBY::Data::GenericSequence
    +# MOSES::MOBY::Data::GenericSequence
     # Generated: 30-Jul-2006 14:55:09 BST
     # Contact: Martin Senger <martin.senger at gmail.com> or
     #          Edward Kawas <edward.kawas at gmail.com>
     #-----------------------------------------------------------------
    -package MOBY::Data::GenericSequence;
    +package MOSES::MOBY::Data::GenericSequence;
     no strict;
     use vars qw( @ISA );
    - at ISA = qw( MOBY::Data::VirtualSequence );
    + at ISA = qw( MOSES::MOBY::Data::VirtualSequence );
     use strict;
    -use MOBY::Data::Object;
    +use MOSES::MOBY::Data::Object;
     
     #-----------------------------------------------------------------
     # accessible attributes
    @@ -630,7 +631,7 @@
     {
         my %_allowed =
             (
    -         'SequenceString' => {type => 'MOBY::Data::String'},
    +         'SequenceString' => {type => 'MOSES::MOBY::Data::String'},
              );
     
         sub _accessible {
    @@ -721,11 +722,11 @@
     # This is a mandatory section - but you can still choose one of
     # the two options (keep one and commented out the other):
     #-----------------------------------------------------------------
    -use MOBY::Base;
    +use MOSES::MOBY::Base;
     # --- (1) this option loads dynamically everything
     BEGIN {
    -    use MOBY::Generators::GenServices;
    -    new MOBY::Generators::GenServices->load
    +    use MOSES::MOBY::Generators::GenServices;
    +    new MOSES::MOBY::Generators::GenServices->load
     	(authority     => 'samples.jmoby.net',
     	 service_names => ['Mabuhay']);
     }
    @@ -741,8 +742,8 @@
     # (this to stay here with any of the options above)
     use vars qw( @ISA );
     @ISA = qw( net::jmoby::samples::MabuhayBase );
    -use MOBY::Package;
    -use MOBY::ServiceException;
    +use MOSES::MOBY::Package;
    +use MOSES::MOBY::ServiceException;
     use strict;
     
    @@ -771,7 +772,7 @@ # EDIT: PUT REAL VALUES INTO THE RESPONSE # fill the response foreach my $elem (0..2) { - my $hello = new MOBY::Data::simple_key_value_pair + my $hello = new MOSES::MOBY::Data::simple_key_value_pair ( value => "this is a 'value $elem'", # TO BE EDITED key => "this is a 'key $elem'", # TO BE EDITED @@ -867,7 +868,7 @@
    config-status.pl
    This script does not do much but gives you overview of your configuration and installation. You can run it to find how -will Perl Moses behaves when used. For example: +Perl Moses will behave when used. For example:
     Perl-MoSeS VERSION: 0.8
    @@ -950,13 +951,13 @@
            
     2006/07/30 23:00:33 (492) INFO> [[undef]] GenTypes.pm:125 - Data types will be generated into:
            '/home/senger/moby-live/Java/src/scripts/../Perl/generated'
    -2006/07/30 23:00:33 (493) DEBUG> [[undef]] GenTypes.pm:149 - MOBY::Data::BasicGFFSequenceFeature will be generated
    -2006/07/30 23:00:33 (665) DEBUG> [[undef]] GenTypes.pm:149 - MOBY::Data::DNASequence will be generated
    -2006/07/30 23:00:33 (669) DEBUG> [[undef]] GenTypes.pm:149 - MOBY::Data::DNASequenceWithGFFFeatures will be generated
    -2006/07/30 23:00:33 (673) DEBUG> [[undef]] GenTypes.pm:149 - MOBY::Data::GenericSequence will be generated
    -2006/07/30 23:00:33 (676) DEBUG> [[undef]] GenTypes.pm:149 - MOBY::Data::NucleotideSequence will be generated
    -2006/07/30 23:00:33 (680) DEBUG> [[undef]] GenTypes.pm:149 - MOBY::Data::VirtualSequence will be generated
    -2006/07/30 23:00:33 (684) DEBUG> [[undef]] GenTypes.pm:149 - MOBY::Data::multi_key_value_pair will be generated
    +2006/07/30 23:00:33 (493) DEBUG> [[undef]] GenTypes.pm:149 - MOSES::MOBY::Data::BasicGFFSequenceFeature will be generated +2006/07/30 23:00:33 (665) DEBUG> [[undef]] GenTypes.pm:149 - MOSES::MOBY::Data::DNASequence will be generated +2006/07/30 23:00:33 (669) DEBUG> [[undef]] GenTypes.pm:149 - MOSES::MOBY::Data::DNASequenceWithGFFFeatures will be generated +2006/07/30 23:00:33 (673) DEBUG> [[undef]] GenTypes.pm:149 - MOSES::MOBY::Data::GenericSequence will be generated +2006/07/30 23:00:33 (676) DEBUG> [[undef]] GenTypes.pm:149 - MOSES::MOBY::Data::NucleotideSequence will be generated +2006/07/30 23:00:33 (680) DEBUG> [[undef]] GenTypes.pm:149 - MOSES::MOBY::Data::VirtualSequence will be generated +2006/07/30 23:00:33 (684) DEBUG> [[undef]] GenTypes.pm:149 - MOSES::MOBY::Data::multi_key_value_pair will be generated
    An obvious question is "where are the data types generated to"?

    @@ -997,14 +998,14 @@ senger at sherekhan:~/jMoby/src/Perl$ ../scripts/generate-datatypes.pl Generating all data types. Done. -senger at sherekhan:~/jMoby/src/Perl$ for n in generated/MOBY/Data/*.pm ; do perl -c $n ; done -generated/MOBY/Data/ABI_Encoded.pm syntax OK -generated/MOBY/Data/Ace_Text.pm syntax OK -generated/MOBY/Data/Alignment.pm syntax OK +senger at sherekhan:~/jMoby/src/Perl$ for n in generated/MOSES/MOBY/Data/*.pm ; do perl -c $n ; done +generated/MOSES/MOBY/Data/ABI_Encoded.pm syntax OK +generated/MOSES/MOBY/Data/Ace_Text.pm syntax OK +generated/MOSES/MOBY/Data/Alignment.pm syntax OK ... -generated/MOBY/Data/WU_BLAST_Text.pm syntax OK -generated/MOBY/Data/xdom_flatfile.pm syntax OK -generated/MOBY/Data/zPDB.pm syntax OK +generated/MOSES/MOBY/Data/WU_BLAST_Text.pm syntax OK +generated/MOSES/MOBY/Data/xdom_flatfile.pm syntax OK +generated/MOSES/MOBY/Data/zPDB.pm syntax OK senger at sherekhan:~/jMoby/src/Perl$ @@ -1016,7 +1017,7 @@ script).

    Usually, you generate code for one or only several -services. And because all services belong to some authority you need +services. And because each service belongs to an authority you need to tell both:

    @@ -1111,7 +1112,7 @@
       
    known-registries.pl
    The Perl Moses has a hard-coded list of known BioMoby registries. New entries can be added - check the comments in -MOBY::Cache::Registries. Each registry has an abbreviation (a +MOSES::MOBY::Cache::Registries. Each registry has an abbreviation (a synonym) that can be used in Perl Moses configuration - it is easier and less error-prone than using the long registry's endpoint. This script can tell you which registry has which synonym (and few other @@ -1121,7 +1122,7 @@ ../scripts/known-registries.pl
    In the time of writing this documentation, the response was -(note hat one of the registry is labelled as the "default" one): +(note that one of the registries is labeled as the "default" one):
     IRRI, MIPS, default, iCAPTURE, testing
    @@ -1161,7 +1162,7 @@
            }
     };

    - This script does not have any options. + This script does not have any options (nor the help).

    local-cache.pl @@ -1176,15 +1177,15 @@
    ../scripts/local-cache.pl -t DNASequence
    --> MOBY::Def::DataType=HASH(0x86026b8)
    +-> MOSES::MOBY::Def::DataType=HASH(0x86026b8)
        'authority' => 'www.illuminae.com'
        'children' => ARRAY(0x86028b0)
             empty array
        'description' => 'Lightweight representation a DNA sequence'
        'email' => 'markw at illuminae.com'
        'lsid' => 'urn:lsid:biomoby.org:objectclass:DNASequence:2001-09-21T16-00-00Z'
    -   'module_name' => 'MOBY::Data::DNASequence'
    -   'module_parent' => 'MOBY::Data::NucleotideSequence'
    +   'module_name' => 'MOSES::MOBY::Data::DNASequence'
    +   'module_parent' => 'MOSES::MOBY::Data::NucleotideSequence'
        'name' => 'DNASequence'
        'parent' => 'NucleotideSequence'
     
    @@ -1196,16 +1197,16 @@
     All children of 'DNASequence':
    --> MOBY::Def::Relationship=HASH(0x860e608)
    +-> MOSES::MOBY::Def::Relationship=HASH(0x860e608)
        'datatype' => 'String'
        'memberName' => 'SequenceString'
    -   'module_datatype' => 'MOBY::Data::String'
    +   'module_datatype' => 'MOSES::MOBY::Data::String'
        'original_memberName' => 'SequenceString'
        'relationship' => 'HASA'
    --> MOBY::Def::Relationship=HASH(0x863a3bc)
    +-> MOSES::MOBY::Def::Relationship=HASH(0x863a3bc)
        'datatype' => 'Integer'
        'memberName' => 'Length'
    -   'module_datatype' => 'MOBY::Data::Integer'
    +   'module_datatype' => 'MOSES::MOBY::Data::Integer'
        'original_memberName' => 'Length'
        'relationship' => 'HASA'
     
    @@ -1299,8 +1300,8 @@ XML. It always takes an XML file name as a parameter:
    -../scripts/testing-parser.pl jMoby/data/parser-test-input2.xml
    -../scripts/testing-parser.pl -r jMoby/data/parser-test-input2.xml
    +../scripts/testing-parser.pl ~/jMoby/data/parser-test-input2.xml +../scripts/testing-parser.pl -r ~/jMoby/data/parser-test-input2.xml An interesting is the -b parameter. It has the form:
    @@ -1347,9 +1348,9 @@
     
            
    • A mandatory package name - a full package -name of a called service. +name of the called service.
    • Option -l location can be used to -specify a directory where is called service stored. Default is +specify a directory where is the called service stored. Default is src/Perl/services.
    • Options -v and -d make also sense in this mode (but not in the other one). @@ -1358,10 +1359,9 @@
      ../scripts/testing-service.pl -d Service::HelloBiomobyWorld
      - The output of this call was already shown -in the documentation (even though it was an example of the full, -SOAP-based call). Therefore, just look what debug messages were logged -(notice the -d option used): + The output of this call was already shown +in this documentation. Therefore, just look what debug messages were +logged (notice the -d option used):
       2006/07/31 02:19:37 (561) INFO> [23856] HelloBiomobyWorldBase.pm:92 - *** REQUEST START ***
      @@ -1379,7 +1379,7 @@
       
              
      • A mandatory service name (not a package -name) of a called service. +name) of the called service.
      • A mandatory endpoint -e endpoint defining where is the service located. Actually, presence of this parameter decides which mode is used. @@ -1389,6 +1389,16 @@
         ../scripts/testing-service.pl \
                -e http://localhost/cgi-bin/MobyServer.cgi HelloBiomobyWorld
        +

        + + There are also few other behavioral differences between these +two modes: If an input parsing error occurs (e.g. when an input has an +unknown article name), it is reported directly to the standard error +in the testing mode, but in a real mode it is properly included in the +response as an exception. Or (and only if the logging is set to record +debug messages), in testing mode the full input raw (not yet parsed) +are logged, whereas in the real mode only the first 1000 characters +are logged.

        universal-testing.pl @@ -1525,7 +1535,7 @@ Perl Moses stores configuration in a file named moby-services.cfg. The file name is hard-coded (and -cannot be changed without changing the MOBY::Config module), +cannot be changed without changing the MOSES::MOBY::Config module), but its location can be set using an environment variable BIOMOBY_CFG_DIR. Perl Moses looks for its configuration place in the following places, in this order: @@ -1547,7 +1557,7 @@ it anyway.

        The Perl Moses internally uses Config::Simple CPAN module, -but wraps it into its own MOBY::Config. This allows expansion +but wraps it into its own MOSES::MOBY::Config. This allows expansion later, or even changing the underlying configuration system. The Config::Simple is simple (thus the name, and thus we selected it) but has few drawbacks that may be worth to work on later.

        @@ -1720,16 +1730,16 @@ You can also change or add parameters during the run-time. For example, the script universal-testing.pl needs to overwrite existing parameters because it wants to create everything in a -separate space, in temporary directory, and within a 'Testing' +separate space, in a temporary directory, and within the 'Testing' package. Because the generators read from the configuration files, it is necessary to change it there:

         my $outdir = File::Spec->catfile ($tmpdir, 'generated-services');
        -MOBY::Config->param ('generators.impl.outdir', $outdir);
        -MOBY::Config->param ('generators.impl.package.prefix', 'Testing');
        +MOSES::MOBY::Config->param ('generators.impl.outdir', $outdir);
        +MOSES::MOBY::Config->param ('generators.impl.package.prefix', 'Testing');
         unshift (@INC, $MOBYCFG::GENERATORS_IMPL_OUTDIR);
        -my $generator = new MOBY::Generators::GenServices;
        +my $generator = new MOSES::MOBY::Generators::GenServices;
         
        More about how to communicate pragmatically with the configuration can @@ -1752,10 +1762,10 @@ How does it work in Perl Moses?

        The logging is available from the moment when Perl Moses knows about -the MOBY::Base module. All generated service implementations -inherit from this class, so all of them has immediate access to the -logging system. By default, the MOBY::Base creates a -logger named $LOG. Which means that in your service +the MOSES::MOBY::Base module. All generated service implementations +inherit from this class, so all of them have immediate access to the +logging system. By default, the MOSES::MOBY::Base creates a +logger in a variable $LOG. Which means that in your service implementation you can log events in five different log levels:

        @@ -1772,7 +1782,7 @@
         You can create your own logger. Which may be good if you wish to have,
         for example, a different logging level for a particular service, or
         for a part of it (an example of such situation is in
        -MOBY::Parser.pm where the parser creates its own
        +MOSES::MOBY::Parser.pm where the parser creates its own
         $PLOG logger). Here is what you need to do:
         
         
        @@ -1794,14 +1804,14 @@
         
           If Perl Moses cannot find a log4perl.properties file, and
         if there are no logging options in moby-services.cfg, it
        -assumes some defaults (check them in MOBY::Base, in its BEGIN
        +assumes some defaults (check them in MOSES::MOBY::Base, in its BEGIN
         section, if you need-to-know). 

        The better way is to use log4perl.properties file. The file name can be actually different - it is specified by an option log.config in the moby-services.cfg configuration file. This is what PerlMoses installation creates there (of course, -with your own path): +using your own path):

         [log]
        @@ -1844,7 +1854,7 @@
         To change the log level to DEBUG, replace INFo by DEBUG in the first
         line. 

        -The message format (in Perl Moses default way) means: +The message format (unless you change the Perl Moses default way) means:

         %d                  (%r ) %p   > [%x   ] %F{1}               :%L - %m      %n
        @@ -2037,11 +2047,11 @@
         # This is a mandatory section - but you can still choose one of
         # the two options (keep one and commented out the other):
         #-----------------------------------------------------------------
        -use MOBY::Base;
        +use MOSES::MOBY::Base;
         # --- (1) this option loads dynamically everything
         BEGIN {
        -    use MOBY::Generators::GenServices;
        -    new MOBY::Generators::GenServices->load
        +    use MOSES::MOBY::Generators::GenServices;
        +    new MOSES::MOBY::Generators::GenServices->load
                 (authority     => 'samples.jmoby.net',
                  service_names => ['Mabuhay']);
         }
        @@ -2062,13 +2072,13 @@
         called jobs). Your service implementation has to implement
         method process_it that is called for every individual job
         contained within every incoming request. The MOBY/Service/ServiceBase
        +href="MOSES/MOBY/Service/ServiceBase.html"> -->MOSES/MOBY/Service/ServiceBase
         has details about this method (what parameters it gets, how to deal
         with exceptions, etc.). 

        -In the beginning of the generated process_it method is code -that tells you what methods are available for reading inputs, and at -the end of the same method is the code showing how to fill the +In the beginning of the generated process_it method is the +code that tells you what methods are available for reading inputs, and +at the end of the same method is the code showing how to fill the response. Feel free to remove the code, extend it, fill it, turn it upside-down, whatever. This is, after all, your implementation. And Perl Moses generator is clever enough not to overwrite the code once @@ -2077,21 +2087,32 @@

        Perhaps the best way how to close this section is to show a full -implementation of (so often mentioned) service Mabuhay: +implementation of (so often mentioned) service Mabuhay (the code +is also available in jMoby/src/Perl/samples):

         sub process_it {
             my ($self, $request, $response, $context) = @_;
         
        +    # read (some) input data
        +    # (use eval to protect against missing data)
        +    my $language = eval { $request->language };
        +    my $regex = eval { $language->regex->value };
        +    my $ignore_cases = eval { $language->case_insensitive->value };
        +
        +    # set an exception if data are not complete
        +    unless ($language and $regex) {
        +	$response->record_error ( { code => INPUTS_INVALID,
        +				    msg  => 'Input regular expression is missing.' } );
        +	return;
        +    }
         
        -    my $regex = $request->language->regex->value;
        -    my $ignore_cases = $request->language->case_insensitive->value;
        -
        +    # creating an answer (this is the "business logic" of this service)
             my @result_hellos = ();
             my @result_langs = ();
             open HELLO, $MOBYCFG::MABUHAY_RESOURCE_FILE
        -	or $self->throw ('Mabuhay resource file not found.');
        -    while () {
        +        or $self->throw ('Mabuhay resource file not found.');
        +    while (<HELLO>) {
         	chomp;
         	my ($lang, $hello) = split (/\t+/, $_, 2);
         	if ( $ignore_cases ? 
        @@ -2104,7 +2125,7 @@
             close HELLO;
         
             foreach my $idx (0 .. $#result_hellos) {
        -	$response->add_hello (new MOBY::Data::simple_key_value_pair
        +	$response->add_hello (new MOSES::MOBY::Data::simple_key_value_pair
         			      ( key   => $self->as_uni_string ($result_langs[$idx]),
         				value => $self->as_uni_string ($result_hellos[$idx])
         				));
        @@ -2112,6 +2133,119 @@
         }
         
        +When you go through the code above you notice how to do basic things +that almost every service has to do. Which are: + +
        +
        Reading input data: +
        The possible methods were already pre-generated for you so you +know what methods to use. But you should always check if the data are +really there (the clients can send you rubbish, of course).

        + + What was not pre-generated are the methods accessing +ID and NAMESPACE. Their names are, not surprisingly, +id and namespace. For example, the Mabuhay input is +named language (as seen in the code above), so you can call: + +

        +$language->id;
        +$language->namespace;
        + + The question is what to do if input (or anything else) is not +complete or valid. This brings us to...

        + +

        Reporting exceptions: +
        One option is to throw an exception: + +
        +open HELLO, $MOBYCFG::MABUHAY_RESOURCE_FILE
        +     or $self->throw ('Mabuhay resource file not found.');
        + + This immediately stops the processing of the input request +(ignoring all remaining jobs if they are some still there), the text +of the error message is put into the response as an exception with the +code 600 ("INTERNAL_PROCESSING_ERROR"), the same message is logged as +an error, and the response is sent back to the client.

        + + Note, however, that the response may already contain some +outputs from the previously processed jobs. If you do not like it, you +can remove it (find them in the $context parameter).

        + + Another, less drastic, option is to record an +exception (and, usually, return): + +

        +$response->record_error ( { code => INPUTS_INVALID,
        +			    msg  => 'Input regular expression is missing.' } );
        + + This creates an exception in the response - you choose what +code to use -, and it does not prevent processing of the remaining (if +any) jobs.

        + + In addition to using an eval{} block to handle +exceptions (as shown above), you can also use a +try-catch-finally block structure if Error.pm has +been installed in your system. See documentation of +MOSES::MOBY::Base for details and examples.

        + + +

        Creating output data: +
        Again, methods for creating response were pre-generated, so you +have hints how to use them (they slightly differ for simple and +collection outputs; but hopefully in a logical way).

        + + Again here you can also set the ID and +NAMESPACE. For example, the code above can be extended so the +MOSES::MOBY::Data::simple_key_value_pair data type will have +also an ID and NAMESPACE: + +

        +$response->add_hello (new MOSES::MOBY::Data::simple_key_value_pair
        +                      ( key   => $self->as_uni_string ($result_langs[$idx]),
        +			value => $self->as_uni_string ($result_hellos[$idx]),
        +			id    => 'this is an ID',
        +                        namespace => 'this is a NAMESPACE'
        +	              ));
        + +
        Creating and adding cross-references: +
        Each output object can have attached zero or more +cross-references. See documentation of +MOSES::MOBY::Data::Xref. For example, in the +HelloBioMobyWorld service one can add two cross-references: + +
        +# create a simple cross-reference
        + my $simple_xref = new MOSES::MOBY::Data::Xref
        +    ( id        => 'At263644',
        +      namespace => 'TIGR'
        +    );
        +
        + # create an advanced cross-reference
        + my $advanced_xref = new MOSES::MOBY::Data::Xref
        +    ( id           => 'X112345',
        +      namespace    => 'EMBL',
        +      service      => 'getEMBLRecord',
        +      authority    => 'www.illuminae.com',
        +      evidenceCode => 'IEA',
        +      xrefType     => 'transform'
        +    );
        +
        +# add them to the output object (which has an article name 'greeting')
        +$response->greeting->add_xrefs ($simple_xref);
        +$response->greeting->add_xrefs ($advanced_xref);
        +
        + +
        Creating a service note: +
        Just use the method serviceNotes on the $context +parameter: + +
        +$context->serviceNotes ("This is my note...");
        +

        + + +

        +

        MOBY/Base

        -
        MOBY/Package
        -
        MOBY/Service/ServiceBase
        -
        MOBY/Config
        -
        MOBY/Parser (also a part of +
        MOSES/MOBY/Base
        +
        MOSES/MOBY/Package
        +
        MOSES/MOBY/Service/ServiceBase
        +
        MOSES/MOBY/Config
        +
        MOSES/MOBY/Parser (also a part of the core but you will rarely use it directly)

        BioMoby data containers:
        -
        MOBY/Data/Object
        -
        MOBY/Data/String
        -
        MOBY/Data/Boolean
        -
        MOBY/Data/DateTime
        -
        MOBY/Data/Float
        -
        MOBY/Data/Integer
        -
        MOBY/Data/ProvisionInformation
        -
        MOBY/Data/Xref
        -
        MOBY/ServiceException
        +
        MOSES/MOBY/Data/Object
        +
        MOSES/MOBY/Data/String
        +
        MOSES/MOBY/Data/Boolean
        +
        MOSES/MOBY/Data/DateTime
        +
        MOSES/MOBY/Data/Float
        +
        MOSES/MOBY/Data/Integer
        +
        MOSES/MOBY/Data/ProvisionInformation
        +
        MOSES/MOBY/Data/Xref
        +
        MOSES/MOBY/ServiceException

        Access to the local cache, and BioMoby data definitions:
        -
        MOBY/Cache/Central
        -
        MOBY/Cache/Registries
        +
        MOSES/MOBY/Cache/Central
        +
        MOSES/MOBY/Cache/Registries

        -

        MOBY/Def/Data
        -
        MOBY/Def/DataType
        -
        MOBY/Def/Namespace
        -
        MOBY/Def/Relationship
        -
        MOBY/Def/Service
        -
        MOBY/Def/ServiceType
        +
        MOSES/MOBY/Def/Data
        +
        MOSES/MOBY/Def/DataType
        +
        MOSES/MOBY/Def/Namespace
        +
        MOSES/MOBY/Def/Relationship
        +
        MOSES/MOBY/Def/Service
        +
        MOSES/MOBY/Def/ServiceType

        Perl Moses code generators:
        -
        MOBY/Generators/GenServices
        -
        MOBY/Generators/GenTypes
        -
        MOBY/Generators/Utils
        +
        MOSES/MOBY/Generators/GenServices
        +
        MOSES/MOBY/Generators/GenTypes
        +
        MOSES/MOBY/Generators/Utils

        ...and the rest
        -
        MOBY/Tags
        +
        MOSES/MOBY/Tags
        @@ -2310,7 +2444,7 @@ about them.

        And there are features (and known) bugs that should or could be -implemented (or fixed). Here are those we am aware of (B = bug, N = not yet implemented, F = potential future feature):

        @@ -2327,7 +2461,7 @@ it expands hints how to write your own service implementation.

      • (N) The generated service -implementation could have better Perl documentation listing all +implementation could have a better Perl documentation, listing all available methods for inputs and outputs (the methods are already shown in the code, but having them also in the POD would help).

        @@ -2371,7 +2505,7 @@

        Martin Senger
        -Last modified: Tue Aug 1 15:56:36 2006 +Last modified: Sat Oct 14 21:42:54 2006
        From senger at dev.open-bio.org Sat Oct 14 17:28:09 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Sat, 14 Oct 2006 17:28:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610142128.k9ELS9Ii022025@dev.open-bio.org> senger Sat Oct 14 17:28:09 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl In directory dev.open-bio.org:/tmp/cvs-serv22006 Modified Files: notes Log Message: moby-live/Java/src/Perl notes,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Perl/notes,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Perl/notes 2006/10/13 22:08:22 1.1 +++ /home/repository/moby/moby-live/Java/src/Perl/notes 2006/10/14 21:28:09 1.2 @@ -1,6 +1,3 @@ -Example of the full Mabuhay should also show how to deal with errrors. ---- - Perl documentation: =================== From kawas at dev.open-bio.org Mon Oct 16 13:23:16 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 16 Oct 2006 13:23:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610161723.k9GHNG8P016551@dev.open-bio.org> kawas Mon Oct 16 13:23:16 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources In directory dev.open-bio.org:/tmp/cvs-serv16466/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources Modified Files: RESOURCE.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources RESOURCE.java,1.23,1.24 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java 2006/10/11 01:54:51 1.23 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java 2006/10/16 17:23:16 1.24 @@ -125,7 +125,7 @@ OBJ = (String) cLoader.getURI_MAP().get("Object"); SRV = (String) cLoader.getURI_MAP().get("Service"); NS = (String) cLoader.getURI_MAP().get("Namespace"); - PRED = "http://biomoby.org/RESOURCES/MOBY-S/Predicates#"; + PRED = "http://biomoby.org/authority/RESOURCES/MOBY-S/Predicates#"; SI = (String) cLoader.getURI_MAP().get("ServiceInstance"); } @@ -143,6 +143,7 @@ PrintWriter out = response.getWriter(); String path = request.getPathInfo(); if (path == null) { + response.setContentType("text/html"); out .println(" not MOBY-S

        not MOBY-S

        "); return; @@ -150,6 +151,7 @@ Pattern p = Pattern.compile("/MOBY\\-S/(\\S+)"); Matcher m = p.matcher(path); if (!m.matches()) { + response.setContentType("text/html"); out .println(" not MOBY-S

        not MOBY-S

        "); return; From kawas at dev.open-bio.org Mon Oct 16 13:23:16 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 16 Oct 2006 13:23:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610161723.k9GHNG4t016529@dev.open-bio.org> kawas Mon Oct 16 13:23:16 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities In directory dev.open-bio.org:/tmp/cvs-serv16466/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities Modified Files: ContextLoader.java ServiceTester.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities ContextLoader.java,1.1,1.2 ServiceTester.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ContextLoader.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/servlet/utilities/ContextLoader.java 2006/10/11 01:54:50 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ContextLoader.java 2006/10/16 17:23:16 1.2 @@ -275,14 +275,15 @@ } } catch (Exception ex) { // some defaults if nothing else works - URI_MAP.put("Object", "http://biomoby.org/RESOURCES/MOBY-S/Objects#"); + log.warn("Using hard-coded URIs for Objects, Service, Namespace and Serviceinstances."); + URI_MAP.put("Object", "http://biomoby.org/authority/RESOURCES/MOBY-S/Objects#"); - URI_MAP.put("Service", "http://biomoby.org/RESOURCES/MOBY-S/Services#"); + URI_MAP.put("Service", "http://biomoby.org/authority/RESOURCES/MOBY-S/Services#"); - URI_MAP.put("Namespace", "http://biomoby.org/RESOURCES/MOBY-S/Namespaces#"); + URI_MAP.put("Namespace", "http://biomoby.org/authority/RESOURCES/MOBY-S/Namespaces#"); URI_MAP.put("ServiceInstance", - "http://biomoby.org/RESOURCES/MOBY-S/ServiceInstances#"); + "http://biomoby.org/authority/RESOURCES/MOBY-S/ServiceInstances#"); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ServiceTester.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/ui/graphical/servlet/utilities/ServiceTester.java 2006/10/12 01:55:20 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ServiceTester.java 2006/10/16 17:23:16 1.6 @@ -1,5 +1,6 @@ package org.biomoby.client.ui.graphical.servlet.utilities; +import java.text.DecimalFormat; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; @@ -15,6 +16,7 @@ import org.biomoby.shared.Central; import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; +import org.biomoby.shared.Utils; import org.tulsoft.tools.soap.axis.AxisUtils; public class ServiceTester { @@ -153,6 +155,41 @@ log.info("getting results complete"); return sb.toString(); } + + public String getStats() { + StringBuffer sb = new StringBuffer(); + Map map = getResultMap(); + int num_bad_authorities = 0; + int total_alive = 0; + int total_dead = 0; + + sb.append("There are " + map.keySet().size() + " service providers, with at least one registered service, registered with this registry." + newline); + for (Iterator it = map.keySet().iterator(); it.hasNext();) { + String key = (String) it.next(); + Map list = (Map) map.get(key); + boolean hasGoodService = false; + // dive into this authoritys' services + for (Iterator listIt = list.keySet().iterator(); listIt.hasNext();) { + String servicename = (String) listIt.next(); + Boolean contents = (Boolean) list.get(servicename); + if (contents.booleanValue()) { + total_alive++; + hasGoodService = true; + } else { + total_dead++; + } + } + // increment authority counts + if (!hasGoodService) + num_bad_authorities++; + } + DecimalFormat df = new DecimalFormat("####.00"); + sb.append("\tOf these service providers, there are " + num_bad_authorities + " that don't have at least one working service."+newline); + sb.append("There are "+total_alive+" services that are reachable in there current state."+newline); + sb.append("There are "+total_dead+" services that are not reachable."+newline); + sb.append(newline + "\tThat represents approximately " + df.format(((float)total_alive/(float)(total_dead+total_alive))*100) + "% in terms of alive services." ); + return Utils.format(sb.toString(), 4); + } public String getServiceInformationByAuthority(String authority) { StringBuffer sb = new StringBuffer(); @@ -319,10 +356,4 @@ public void setNumThreads(int numThreads) { this.numThreads = numThreads; } - public static void main(String[] args) throws MobyException { - ServiceTester s = new ServiceTester("http://localhost/cgi-bin/MOBY-Central.pl","http://localhost/MOBY/Central"); - s.testServices(s.getServices()); - System.out.println(s.getResults()); - - } } From kawas at dev.open-bio.org Mon Oct 16 13:23:16 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 16 Oct 2006 13:23:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610161723.k9GHNGK1016505@dev.open-bio.org> kawas Mon Oct 16 13:23:15 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms In directory dev.open-bio.org:/tmp/cvs-serv16466/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms Modified Files: CallableServicesServlet.java RDFAgentValidator.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms CallableServicesServlet.java,1.3,1.4 RDFAgentValidator.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/CallableServicesServlet.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/CallableServicesServlet.java 2006/10/11 01:54:50 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/CallableServicesServlet.java 2006/10/16 17:23:15 1.4 @@ -82,7 +82,26 @@ String authority = filter(request.getParameter("authority")); String servicename = filter(request.getParameter("service")); - + String getStats = filter(request.getParameter("getStats")); + if (getStats != null) { + response.setContentType("text/plain"); + if (scheduler == null || scheduler.getServiceTester() == null) { + PrintWriter out = response.getWriter(); + out.print("Sorry, there are no stats available at the moment. Please try again in a few minutes(x0011)."); + return; + } else { + if (scheduler.getServiceTester().getResultMap() == null + || scheduler.getServiceTester().getResultMap().isEmpty()) { + PrintWriter out = response.getWriter(); + out.print("Sorry, there are no stats available at the moment. Please try again in a few minutes(x0012)."); + return; + } + PrintWriter out = response.getWriter(); + out.print(scheduler.getServiceTester().getStats()); + return; + } + } + if (scheduler == null) { response .sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/RDFAgentValidator.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/RDFAgentValidator.java 2006/10/11 01:54:50 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/RDFAgentValidator.java 2006/10/16 17:23:15 1.4 @@ -72,16 +72,17 @@ url = url.trim(); url = URLDecoder.decode(url, "UTF-8"); - String pre = "\n" - + "\n" - + "\n" - + "\n" - + "RDF Agent Validator Output\n" - + "\n" - + "\n" - + "\n " + url + "

        ";
        +		String pre = ""
        +				+ ""
        +				+ ""
        +				+ ""
        +				+ ""
        +				+ "RDF Agent Validator Output"
        +				+ ""
        +				+ ""
        +				+ " " + url + "

        ";
         
        -		String post = "
        \n" + ""; + String post = "
        " + ""; Properties prop = MobyProperties.SERVICE_INSTANCE_PROPERTIES(); String rdfagent = (String) prop.get("rdfagent"); From kawas at dev.open-bio.org Mon Oct 16 13:39:49 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 16 Oct 2006 13:39:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610161739.k9GHdnrq016916@dev.open-bio.org> kawas Mon Oct 16 13:39:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY In directory dev.open-bio.org:/tmp/cvs-serv16881/Java/src/Perl/MOSES/MOBY Modified Files: Parser.pm Log Message: moby-live/Java/src/Perl/MOSES/MOBY Parser.pm,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Parser.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Parser.pm 2006/10/13 21:51:16 1.1 +++ /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Parser.pm 2006/10/16 17:39:49 1.2 @@ -649,7 +649,7 @@ $actor->$methodName($parameter); } }; - if ($@) { + if ($@ and ($insubstitution == 0)) { $PLOG->error("Method '$methodName' was not found in the object ". $actor->mobyname); $self->error( "Method '$methodName' was not found in the object " . $actor->mobyname); } From kawas at dev.open-bio.org Mon Oct 16 14:07:15 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 16 Oct 2006 14:07:15 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610161807.k9GI7FlU017130@dev.open-bio.org> kawas Mon Oct 16 14:07:15 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/scripts In directory dev.open-bio.org:/tmp/cvs-serv17095/Java/src/scripts Modified Files: install.pl Log Message: added the module Unicode::String to the list of required modules. Every time (2 to be exact ;-) that i ran the install on a linux machine, the installer failed after it reported that I had all the correct modules installed. It seems that Unicode::String was always missing. moby-live/Java/src/scripts install.pl,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/install.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/scripts/install.pl 2006/10/13 22:08:39 1.5 +++ /home/repository/moby/moby-live/Java/src/scripts/install.pl 2006/10/16 18:07:15 1.6 @@ -60,6 +60,7 @@ Config::Simple IO::Scalar IO::Prompt + Unicode::String ) ) { check_module ($module); } From kawas at dev.open-bio.org Mon Oct 16 14:37:14 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 16 Oct 2006 14:37:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610161837.k9GIbEjG017325@dev.open-bio.org> kawas Mon Oct 16 14:37:14 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY In directory dev.open-bio.org:/tmp/cvs-serv17290/Java/src/Perl/MOSES/MOBY Modified Files: Parser.pm Log Message: moby-live/Java/src/Perl/MOSES/MOBY Parser.pm,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Parser.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Parser.pm 2006/10/16 17:39:49 1.2 +++ /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Parser.pm 2006/10/16 18:37:14 1.3 @@ -649,7 +649,7 @@ $actor->$methodName($parameter); } }; - if ($@ and ($insubstitution == 0)) { + if ($@ and not $insubstitution) { $PLOG->error("Method '$methodName' was not found in the object ". $actor->mobyname); $self->error( "Method '$methodName' was not found in the object " . $actor->mobyname); } From kawas at dev.open-bio.org Tue Oct 17 09:42:54 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 17 Oct 2006 09:42:54 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610171342.k9HDgsb4019946@dev.open-bio.org> kawas Tue Oct 17 09:42:53 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv19911/Java/docs Modified Files: RegistryServlets.html Log Message: added a blurb on the rdf_generator property in the [mobycentral] section moby-live/Java/docs RegistryServlets.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/RegistryServlets.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/docs/RegistryServlets.html 2006/10/11 20:39:31 1.2 +++ /home/repository/moby/moby-live/Java/docs/RegistryServlets.html 2006/10/17 13:42:53 1.3 @@ -163,6 +163,10 @@

        The URL that would return the RDF describing all ontologies in your registry.

        This value is most likely: http://yourDomain:yourPort/authority/RESOURCES/MOBY-S/FULL

        + + rdf_generator +

        The location of the RDFGenerator included with the Registry Servlet that you are currently installing, i.e.
        http://your.domain/authority/RDFGenerator

        +

         

      • To the [mobyobject] section of this file, please ensure that the following parameters are set:
      • From kawas at dev.open-bio.org Tue Oct 17 10:00:53 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 17 Oct 2006 10:00:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610171400.k9HE0rVk020012@dev.open-bio.org> kawas Tue Oct 17 10:00:53 EDT 2006 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv19977 Modified Files: Central.pm Log Message: added code that removes the hard coded URL from this module and replaces it with a property that is obtained from mobycentral.config. The property and value are: rdf_generator = http://mobycentral.icapture.ubc.ca/authority/RDFGenerator However, if you have a custom registry and you have installed the 'registry servlets', then use your own url as per the configuration documentation for the servlets. moby-live/Perl/MOBY Central.pm,1.261,1.262 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.261 retrieving revision 1.262 diff -u -r1.261 -r1.262 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2006/10/12 14:01:14 1.261 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2006/10/17 14:00:53 1.262 @@ -1439,7 +1439,9 @@ sub _getServiceInstanceRDF { my ( %args ) = @_; my $browser = LWP::UserAgent->new; - my $url = URI->new( 'http://mobycentral.icapture.ubc.ca/authority/RDFGenerator' ); + my $conf = MOBY::Config->new(); + return "" unless $conf->{mobycentral}->{rdf_generator}; + my $url = URI->new( $conf->{mobycentral}->{rdf_generator} ); # makes an object representing the URL $url->query_form( # And here the form data pairs: 'name' => $args{name}, @@ -1447,7 +1449,6 @@ 'url' => $args{url}, 'uri' => $args{uri} ); - my $response = $browser->get($url); if ($response) { my $rdfXML = $response->content; From kawas at dev.open-bio.org Tue Oct 17 10:02:05 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 17 Oct 2006 10:02:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610171402.k9HE25dq020092@dev.open-bio.org> kawas Tue Oct 17 10:02:05 EDT 2006 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory dev.open-bio.org:/tmp/cvs-serv20037/MOBY-S_API Modified Files: InstallingLocalMOBYCentral.html Log Message: updated to include new servlets, as well as the updated [mobycentral] section of mobycentral.config moby-live/Docs/MOBY-S_API InstallingLocalMOBYCentral.html,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/InstallingLocalMOBYCentral.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/InstallingLocalMOBYCentral.html 2006/02/26 17:57:18 1.5 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/InstallingLocalMOBYCentral.html 2006/10/17 14:02:05 1.6 @@ -183,8 +183,7 @@
            $> cvs -d :pserver:cvs at cvs.open-bio.org:/home/repository/moby login 
            $> cvs -d :pserver:cvs at cvs.open-bio.org:/home/repository/moby checkout moby-live 
            $> cvs update -dP 
        - (the 'P' flag for the update will clean-up your checkout and get rid of unused directories) -
      • + (the 'P' flag for the update will clean-up your checkout and get rid of unused directories)
      • Install BioMOBY Perl code
      •     $> cd ~/moby-live/Perl 
        To install in default path for Perl modules (root privileges required): @@ -248,8 +247,7 @@
            root $> rcmysql start 
      • If this is the first time mysql is started you will receive a warning not to forget to create a root password for mysql. - Do so if you haven't done so already. -
      • + Do so if you haven't done so already.
      • Create a mobycentral.config file and make the following entries (note that a template mobycentral.config file exists in the moby-live/Database folder of your CVS checkout):
        @@ -263,6 +261,7 @@
             lsid_namespace = serviceinstance
             resourceURL = http://your.host.name/RESOURCES/MOBY-S/ServiceInstances
             allResources = http://your.host.name/RESOURCES/MOBY-S/FULL
        +    rdf_generator = http://mobycentral.icapture.ubc.ca/authority/RDFGenerator
          
             [mobyobject]
             username = mysql_username
        @@ -314,8 +313,7 @@
              
      • If you have come this far and the stuff above was configured correctly, you can use the
            ~/moby-live/Perl/scripts/CloneCentralDatabases.pl 
        script. This will create the databases, set privileges, fetch all data from THE central BioMOBY Central - and load it into your local central. -
      • + and load it into your local central.
      • If you prefer to configure your BioMOBY Central databases manually, proceed with the next steps.
        • If you are going to bootstrap the databases with only the most primitive information, then simply run the @@ -360,8 +358,7 @@
        • In case you mess up your central during debugging you can simply nuke your databases and start with a fresh BioMOBY Central clone using the
              ~/moby-live/Perl/scripts/CloneCentralDatabases.pl 
          - script. -
        • + script.
        @@ -372,8 +369,7 @@ Taverna uses your BioMOBY Central endpoint to request the URLs for the RDF files, which are dynamically generated by the servlets. Hence, using your local central with Taverna is a two step process that requires both a working BioMOBY Central CGI script at your BioMOBY Central endpoint - and several servlets to generate RDF files. - + and several servlets to generate RDF files.
      • Install Tomcat if necessary.
      • Get root privileges:
            $> su 
        @@ -392,27 +388,23 @@
      • To make the RDF files accessible using the same port your webserver is using, you can not use Tomcat standalone, but should configure Apache as frontend for Tomcat instead. - This requires a module for Apache like for example mod_jk. Install mod_jk if necessary. -
      • + This requires a module for Apache like for example mod_jk. Install mod_jk if necessary.
      • Configure Tomcat to work with Apache:
        $CATALINA_HOME is used to refer to the directory into which you have installed Tomcat 5.
        • Create a workers.properties file in the $CATALINA_HOME/conf/jk/ dir. - There should be an example workers.properties file in the $CATALINA_HOME/conf/ dir. -
        • + There should be an example workers.properties file in the $CATALINA_HOME/conf/ dir.
        • Open your workers.properties file and change the path for workers.tomcat_home and workers.java_home according to your setup. - And set the ps (path separator) for your OS. -
        • + And set the ps (path separator) for your OS.
        • Edit $CATALINA_HOME/conf/server.xml and append:
               <Listener className="org.apache.jk.config.ApacheConfig"
                   modJk="/usr/lib/apache2/mod_jk.so"
                   workersConfig="$CATALINA_HOME/conf/jk/workers.properties" /> 
          to the <Server> section. - Change the modJk and workersConfig path according to your setup. -
        • + Change the modJk and workersConfig path according to your setup.
      • Configure Apache 2 to work with Tomcat:
        @@ -451,66 +443,18 @@
    • Download the servlets installer from:
      - http://bioinfo.icapture.ubc.ca/ekawas/servlets/install.jar -
    • + http://bioinfo.icapture.ubc.ca/ekawas/servlets/install.jar
    • Install the servlets:
          for Sun's java $> java -jar install.jar 
          for IBM's java $> java install.jar 
      - You should get a graphical interface that will guide you through the installation process... -
    • -
    • Configure the servlets in Tomcat.
      - Ensure that the following environment variables are available to Tomcat: -
          MOBY_CENTRAL_CONFIG - the path to your mobycentral.config file created above 
      -
          MOBY_SERVER - the endpoint of your local registry (see below, Configure your clients)
      -
          MOBY_URI - the namespace of your local registry (see below, Configure your clients)
      -

      - And if you installed the servlets outside the the default webapps folder, make sure Tomcat knows where to find them. - The easiest way to do this is to make the following three config files in $CATALINA_HOME/conf/Catalina/localhost/ : -

      -      <?xml version='1.0' encoding='utf-8'?>
      -      <!-- Example authority.xml file -->
      -      <Context docBase="/path/to/your/webapps/authority" path="/authority">
      -	      <Environment name="MOBY_CENTRAL_CONFIG" 
      -                          value="/path/to/your/mobycentral.config" 
      -                          type="java.lang.String"/>
      -	      <Environment name="MOBY_SERVER" 
      -                          value="http://your.host.name/biomoby/central/cgi-bin/MOBY-Central.pl" 
      -                          type="java.lang.String"/>
      -	      <Environment name="MOBY_URI" 
      -                          value="http://your.host.name/MOBY/Central" 
      -                          type="java.lang.String"/>
      -      </Context>
      -      
      -
      -      <?xml version='1.0' encoding='utf-8'?>
      -      <!-- Example RESOURCES.xml file -->
      -      <Context docBase="/path/to/your/webapps/RESOURCES" path="/RESOURCES">
      -	      <Environment name="MOBY_CENTRAL_CONFIG" 
      -                          value="/path/to/your/mobycentral.config" 
      -                          type="java.lang.String"/>
      -	      <Environment name="MOBY_SERVER" 
      -                          value="http://your.host.name/biomoby/central/cgi-bin/MOBY-Central.pl" 
      -                          type="java.lang.String"/>
      -	      <Environment name="MOBY_URI" 
      -                          value="http://your.host.name/MOBY/Central" 
      -                          type="java.lang.String"/>
      -      </Context>
      -      
      -
      -      <?xml version='1.0' encoding='utf-8'?>
      -      <!-- Example types.xml file -->
      -      <Context docBase="/path/to/your/webapps/types" path="/types">
      -	      <Environment name="MOBY_CENTRAL_CONFIG" 
      -                          value="/path/to/your/mobycentral.config" 
      -                          type="java.lang.String"/>
      -	      <Environment name="MOBY_SERVER" 
      -                          value="http://your.host.name/biomoby/central/cgi-bin/MOBY-Central.pl" 
      -                          type="java.lang.String"/>
      -	      <Environment name="MOBY_URI" 
      -                          value="http://your.host.name/MOBY/Central" 
      -                          type="java.lang.String"/>
      -      </Context>
      -      
      + You should get a graphical interface that will guide you through the installation process...
    • +
    • Configure the servlets in Tomcat.
      +
      +
        +
      • Configuration details can be found here.
        +
        +
      • +
    • restart Tomcat as root:
          root $> rctomcat restart 
      @@ -522,14 +466,12 @@
      • Copy the
            ~/moby-live/Perl/scripts/OntologyServer.cgi 
        - CGI script into your webserver cgi-bin folder. -
      • + CGI script into your webserver cgi-bin folder.
      • You will now have to edit the MOBY::Client::OntologyServer.pm module manually (sorry!). This module was hardcoded to point to the OntologyServer.cgi at THE central BioMOBY Central. You will have to change the line that reads
            host => ["http://mobycentral.icapture.ubc.ca/cgi-bin/OntologyServer.cgi",'read/write'] 
        - to point to the URL of your OntologyServer.cgi that you just set up. -
      • + to point to the URL of your OntologyServer.cgi that you just set up.
    • @@ -146,6 +147,7 @@ &samplesBuild; &mosesBuild; &dashboardBuild; + &seahawkBuild; From gordonp at dev.open-bio.org Tue Oct 24 22:33:22 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XMeZ010012@dev.open-bio.org> gordonp Tue Oct 24 22:33:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv9957/docs Modified Files: ChangeLog Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/docs ChangeLog,1.73,1.74 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2006/10/02 21:12:45 1.73 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2006/10/25 02:33:22 1.74 @@ -1,6 +1,12 @@ +2006-10-24 Paul Gordon + + * Added Seahawk (MOBY-S client) code to CVS + + * Added MobyServlet code + 2006-10-02 Martin Senger - * Added to Dasboard: 'Call RDF Agent' button + * Added to Dashboard: 'Call RDF Agent' button * Added to Dashboard: list of well-known registries From gordonp at dev.open-bio.org Tue Oct 24 22:33:22 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XM0q010026@dev.open-bio.org> gordonp Tue Oct 24 22:33:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Clients In directory dev.open-bio.org:/tmp/cvs-serv9957/src/Clients Added Files: ServletTester.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/Clients ServletTester.java,NONE,1.1 From gordonp at dev.open-bio.org Tue Oct 24 22:33:22 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XMum010056@dev.open-bio.org> gordonp Tue Oct 24 22:33:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/ca/ucalgary/seahawk/gui/test Added Files: MobyContentGUITestCase.java SeahawkTestCase.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test MobyContentGUITestCase.java,NONE,1.1 SeahawkTestCase.java,NONE,1.1 From gordonp at dev.open-bio.org Tue Oct 24 22:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNx3010134@dev.open-bio.org> gordonp Tue Oct 24 22:33:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/test In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/ca/ucalgary/seahawk/services/test Added Files: MobyRequestTestCase.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/ca/ucalgary/seahawk/services/test MobyRequestTestCase.java,NONE,1.1 From gordonp at dev.open-bio.org Tue Oct 24 22:33:22 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XM2B010076@dev.open-bio.org> gordonp Tue Oct 24 22:33:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/ca/ucalgary/seahawk/resources Added Files: MobyContentGUIHelp.html moby2HTML.xsl mobyBuilderRules.xml Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/ca/ucalgary/seahawk/resources MobyContentGUIHelp.html,NONE,1.1 moby2HTML.xsl,NONE,1.1 mobyBuilderRules.xml,NONE,1.1 From gordonp at dev.open-bio.org Tue Oct 24 22:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XMkT010114@dev.open-bio.org> gordonp Tue Oct 24 22:33:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/ca/ucalgary/seahawk/services Added Files: MobyClient.java MobyComplexBuilder.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyClient.java,NONE,1.1 MobyComplexBuilder.java,NONE,1.1 From gordonp at dev.open-bio.org Tue Oct 24 22:33:22 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XMvU010042@dev.open-bio.org> gordonp Tue Oct 24 22:33:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/ca/ucalgary/seahawk/gui Added Files: MobyContentClipboard.java MobyContentGUI.java MobyContentHelpPane.java MobyContentPane.java MobySaveDialog.java MobySecondaryInputGUI.java MobyServicesGUI.java MobyShimmer.java SeahawkSplasher.java SplashWindow.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyContentClipboard.java,NONE,1.1 MobyContentGUI.java,NONE,1.1 MobyContentHelpPane.java,NONE,1.1 MobyContentPane.java,NONE,1.1 MobySaveDialog.java,NONE,1.1 MobySecondaryInputGUI.java,NONE,1.1 MobyServicesGUI.java,NONE,1.1 MobyShimmer.java,NONE,1.1 SeahawkSplasher.java,NONE,1.1 SplashWindow.java,NONE,1.1 From gordonp at dev.open-bio.org Tue Oct 24 22:33:22 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XMfN010096@dev.open-bio.org> gordonp Tue Oct 24 22:33:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/images In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/ca/ucalgary/seahawk/resources/images Added Files: back.gif back_d.gif bookmarks.gif bookmarks_d.gif clipboard.gif document.gif failed.gif forward.gif forward_d.gif help.gif help_tab.gif hourglass.gif print.gif print_d.gif save.gif save_d.gif seahawk_splash.jpg Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/ca/ucalgary/seahawk/resources/images back.gif,NONE,1.1 back_d.gif,NONE,1.1 bookmarks.gif,NONE,1.1 bookmarks_d.gif,NONE,1.1 clipboard.gif,NONE,1.1 document.gif,NONE,1.1 failed.gif,NONE,1.1 forward.gif,NONE,1.1 forward_d.gif,NONE,1.1 help.gif,NONE,1.1 help_tab.gif,NONE,1.1 hourglass.gif,NONE,1.1 print.gif,NONE,1.1 print_d.gif,NONE,1.1 save.gif,NONE,1.1 save_d.gif,NONE,1.1 seahawk_splash.jpg,NONE,1.1 From gordonp at dev.open-bio.org Tue Oct 24 22:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNNl010150@dev.open-bio.org> gordonp Tue Oct 24 22:33:23 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/ca/ucalgary/seahawk/util Added Files: BrowserLauncher.java DescriptiveFileFilter.java DynamicJPopupMenu.java MobyUtils.java NamespaceContextImpl.java PrintableJEditorPane.java Sequence.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/ca/ucalgary/seahawk/util BrowserLauncher.java,NONE,1.1 DescriptiveFileFilter.java,NONE,1.1 DynamicJPopupMenu.java,NONE,1.1 MobyUtils.java,NONE,1.1 NamespaceContextImpl.java,NONE,1.1 PrintableJEditorPane.java,NONE,1.1 Sequence.java,NONE,1.1 From gordonp at dev.open-bio.org Tue Oct 24 22:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNVl010216@dev.open-bio.org> gordonp Tue Oct 24 22:33:23 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/org/biomoby/service Added Files: MobyServlet.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/org/biomoby/service MobyServlet.java,NONE,1.1 From gordonp at dev.open-bio.org Tue Oct 24 22:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNmX010174@dev.open-bio.org> gordonp Tue Oct 24 22:33:23 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/org/biomoby/client Modified Files: MobyRequest.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/org/biomoby/client MobyRequest.java,1.19,1.20 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java 2006/09/22 22:59:09 1.19 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java 2006/10/25 02:33:23 1.20 @@ -477,7 +477,7 @@ * * @return The root element of the MOBY response DOM */ - protected Element decodeSOAPMessage(Element n, StringBuffer contentsXMLOutput, String inputXML) throws SOAPException, MobyException{ + public Element decodeSOAPMessage(Element n, StringBuffer contentsXMLOutput, String inputXML) throws SOAPException, MobyException{ if(n == null){ throw new SOAPException("SOAP Message given to decode is null"); } From gordonp at dev.open-bio.org Tue Oct 24 22:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNZv010262@dev.open-bio.org> gordonp Tue Oct 24 22:33:23 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/org/biomoby/shared/extended Modified Files: ServiceInstanceParser.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/org/biomoby/shared/extended ServiceInstanceParser.java,1.17,1.18 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceInstanceParser.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceInstanceParser.java 2006/07/13 18:35:01 1.17 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceInstanceParser.java 2006/10/25 02:33:23 1.18 @@ -293,6 +293,12 @@ .getObject().toString(); service.setDescription(description); } + // see if the service is working + if (resource.hasProperty(FetaVocabulary.isAlive)) { + String bool = resource.getProperty(FetaVocabulary.isAlive) + .getObject().toString(); + service.setStatus(MobyService.ALIVE, "true".equals(bool)); + } // process in/outputs StmtIterator arguements = resource.listProperties(FetaVocabulary.hasOperation); From gordonp at dev.open-bio.org Tue Oct 24 22:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNZC010198@dev.open-bio.org> gordonp Tue Oct 24 22:33:23 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/org/biomoby/client/rdf/builder Modified Files: ServiceInstanceRDF.java Added Files: FilteredStream.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/org/biomoby/client/rdf/builder FilteredStream.java,NONE,1.1 ServiceInstanceRDF.java,1.32,1.33 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2006/10/12 16:57:14 1.32 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2006/10/25 02:33:23 1.33 @@ -1103,27 +1103,3 @@ // log.info(findService("", "", false)); } } - -class FilteredStream extends FilterOutputStream { - StringBuffer sb = null; - - public FilteredStream(OutputStream aStream) { - super(aStream); - sb = new StringBuffer("" - + System.getProperty("line.separator")); - } - - public void write(byte b[]) throws IOException { - String aString = new String(b); - sb.append(aString); - } - - public void write(byte b[], int off, int len) throws IOException { - String aString = new String(b, off, len); - sb.append(aString); - } - - public String getOutput() { - return sb.toString(); - } -} \ No newline at end of file From gordonp at dev.open-bio.org Tue Oct 24 22:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNHZ010310@dev.open-bio.org> gordonp Tue Oct 24 22:33:23 EDT 2006 Update of /home/repository/moby/moby-live/Java/xmls In directory dev.open-bio.org:/tmp/cvs-serv9957/xmls Modified Files: libraries.xml Added Files: seahawkBuild.xml Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/xmls seahawkBuild.xml,NONE,1.1 libraries.xml,1.14,1.15 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/libraries.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- /home/repository/moby/moby-live/Java/xmls/libraries.xml 2006/10/09 18:55:09 1.14 +++ /home/repository/moby/moby-live/Java/xmls/libraries.xml 2006/10/25 02:33:23 1.15 @@ -48,6 +48,7 @@ + @@ -102,6 +103,7 @@ + @@ -180,6 +182,7 @@ + From gordonp at dev.open-bio.org Tue Oct 24 22:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNWj010240@dev.open-bio.org> gordonp Tue Oct 24 22:33:23 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/org/biomoby/shared Modified Files: MobyService.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/org/biomoby/shared MobyService.java,1.12,1.13 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2006/07/07 04:12:40 1.12 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2006/10/25 02:33:23 1.13 @@ -53,6 +53,14 @@ protected String lsid = null; protected MobyServiceType serviceType = new MobyServiceType(); + public static final int UNCHECKED = 0; + public static final int DEAD= 1; + public static final int ALIVE = 2; // Can connect to the service endpoint + public static final int PINGED = 4; // Responds to a blank MOBY request + public static final int TESTED = 8; // Gives a valid answer to a valid test input provided by the service + protected int serviceStatus = UNCHECKED; + protected int statusChecks = UNCHECKED; + // the elements of these Vectors are of type MobyData protected Vector primaryInputs = new Vector(); protected Vector secondaryInputs = new Vector(); @@ -99,6 +107,32 @@ return name + "/" + authority; } + /** + * @param statusCode should be one of ALIVE, PINGED, TESTED + * @param mode whether the service passed the requirement or not + */ + public void setStatus(int statusCode, boolean mode){ + if(mode){ + serviceStatus |= statusCode; + } + statusChecks |= statusCode; + } + + /** + * @return bit-wise combination of ALIVE, PINGED, TESTED states for the service, or DEAD if no tests passed, or UNCHECKED if no tests have been run + */ + public int getStatus(){ + if((statusChecks & serviceStatus) != 0){ //some status test passed + return serviceStatus; + } + else if(statusChecks == UNCHECKED){ + return UNCHECKED; + } + else{ + return DEAD; // failed every test thrown at it so far + } + } + public String getName() { return name; } From gordonp at dev.open-bio.org Tue Oct 24 22:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNme010288@dev.open-bio.org> gordonp Tue Oct 24 22:33:23 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/org/biomoby/shared/parser Modified Files: JDOMUtils.java ServiceException.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/org/biomoby/shared/parser JDOMUtils.java,1.1,1.2 ServiceException.java,1.9,1.10 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/JDOMUtils.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/JDOMUtils.java 2006/07/07 04:12:40 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/JDOMUtils.java 2006/10/25 02:33:23 1.2 @@ -5,8 +5,87 @@ import org.jdom.Element; import org.jdom.Namespace; +import java.util.Iterator; +import java.util.Vector; + public class JDOMUtils{ /************************************************************************** + * + *************************************************************************/ + public static Element toXMLElement(ServiceException se) { + Element elem = MobyPackage.getXMLElement (MobyTags.MOBYEXCEPTION); + MobyPackage.setXMLAttribute (elem, MobyTags.SEVERITY, se.getSeverityAsString()); + if (se.getJobId() != null) + MobyPackage.setXMLAttribute (elem, MobyTags.REFQUERYID, se.getJobId()); + if (se.getDataName() != null) + MobyPackage.setXMLAttribute (elem, MobyTags.REFELEMENT, se.getDataName()); + Element elemCode = MobyPackage.getXMLElement (MobyTags.EXCEPTIONCODE); + elemCode.setText (""+se.getErrorCode()); + elem.addContent (elemCode); + String desc = se.getMessage(); + if (desc != null) { + Element elemDesc = MobyPackage.getXMLElement (MobyTags.EXCEPTIONMESSAGE); + elemDesc.setText (desc); + elem.addContent (elemDesc); + } + return elem; + } + + /************************************************************************** + * Extract all exceptions from a serviceNotes XML + * element. This is a convenient method that can be used when + * dealing with an XML response from a service without parsing the + * whole response to a {@link MobyPackage}.

      + * + * @param serviceNotes a piece of XML + * <serviceNotes>...</serviceNotes> + * + * @return an array, potentially an empty array, of all exceptions + * extracted from the 'serviceNotes' + *************************************************************************/ + public static ServiceException[] extractExceptions (Element serviceNotes) { + if (serviceNotes == null) + return new ServiceException[] {}; + + Vector v = new Vector(); + for (Iterator it = + serviceNotes.getChildren (MobyTags.MOBYEXCEPTION).iterator(); + it.hasNext(); ) { + ServiceException ex = extractException ((Element)it.next()); + if (ex != null) + v.addElement (ex); + } + for (Iterator it = + serviceNotes.getChildren (MobyTags.MOBYEXCEPTION, JDOMUtils.MOBY_NS).iterator(); + it.hasNext(); ) { + ServiceException ex = extractException ((Element)it.next()); + if (ex != null) + v.addElement (ex); + } + ServiceException[] result = new ServiceException [v.size()]; + v.copyInto (result); + return result; + } + + /************************************************************************** + * Extract one exception from an XML element 'mobyException'. + *************************************************************************/ + protected static ServiceException extractException (Element elem) { + ServiceException ex = new ServiceException(); + String severity = elem.getAttributeValue (MobyTags.SEVERITY); + if (severity == null) + severity = elem.getAttributeValue (MobyTags.SEVERITY, JDOMUtils.MOBY_NS); + ex.setSeverity (severity); + String codeStr = JDOMUtils.getChildText (elem, MobyTags.EXCEPTIONCODE); + try { + ex.setErrorCode (new Integer (codeStr).intValue()); + } catch (Exception e) { + } + ex.setMessage (JDOMUtils.getChildText (elem, MobyTags.EXCEPTIONMESSAGE)); + return ex; + } + + /************************************************************************** * Turns a PIB Object into a JDOM representation. *************************************************************************/ public static Element toXMLElement(MobyProvisionInfo mpi) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/ServiceException.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/ServiceException.java 2006/07/07 04:12:40 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/ServiceException.java 2006/10/25 02:33:23 1.10 @@ -492,7 +492,7 @@ xml.append(""+code+""); if(getMessage() != null){ - xml.append(" "+getMessage()); + xml.append(" "+getMessage()+""); } xml.append(" "); From gordonp at dev.open-bio.org Wed Oct 25 09:54:50 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 09:54:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610251354.k9PDsotR012235@dev.open-bio.org> gordonp Wed Oct 25 09:54:50 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv12196 Modified Files: MobyContentGUI.java SplashWindow.java Log Message: Fixed javadoc errors moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyContentGUI.java,1.1,1.2 SplashWindow.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2006/10/25 13:54:50 1.2 @@ -444,9 +444,6 @@ /** * Displays the choice to the user to open a file or URL. * Choice callback will call either showFileDialog or showWebDialog. - * - * @param x the x coordinate at which to show the popup menu choices - * @param y the y coordinate at which to show the popup menu choices */ public void openDocument(){ JPopupMenu fileOrWeb = new JPopupMenu(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/SplashWindow.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/SplashWindow.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/SplashWindow.java 2006/10/25 13:54:50 1.2 @@ -416,7 +416,7 @@ /** * Invokes the init method of the JApplet class provided by name. - * @param args the applet that was actually launched + * @param applet the applet that was actually launched */ public static void invokeInit(String className, javax.swing.JApplet applet) { From gordonp at dev.open-bio.org Wed Oct 25 09:54:50 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 09:54:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610251354.k9PDsooF012259@dev.open-bio.org> gordonp Wed Oct 25 09:54:50 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test In directory dev.open-bio.org:/tmp/cvs-serv12196/test Modified Files: MobyContentGUITestCase.java SeahawkTestCase.java Log Message: Fixed javadoc errors moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test MobyContentGUITestCase.java,1.1,1.2 SeahawkTestCase.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/MobyContentGUITestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/MobyContentGUITestCase.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/MobyContentGUITestCase.java 2006/10/25 13:54:50 1.2 @@ -258,7 +258,7 @@ } /** - * @returns a test suite for all the test methods of this test case. + * @return a test suite for all the test methods of this test case. */ public static Test suite() { // Reflection is used here to add all =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/SeahawkTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/SeahawkTestCase.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/SeahawkTestCase.java 2006/10/25 13:54:50 1.2 @@ -917,7 +917,7 @@ } /** - * @returns a test suite for all the test methods of this test case. + * @return a test suite for all the test methods of this test case. */ public static Test suite() { From kawas at dev.open-bio.org Wed Oct 25 15:32:54 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Wed, 25 Oct 2006 15:32:54 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610251932.k9PJWsJF014148@dev.open-bio.org> kawas Wed Oct 25 15:32:54 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms In directory dev.open-bio.org:/tmp/cvs-serv14113/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms Modified Files: CallableServicesServlet.java Log Message: made service testing code more modular and fixed a thread (cleanup) issue moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms CallableServicesServlet.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/CallableServicesServlet.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/ui/graphical/servlet/forms/CallableServicesServlet.java 2006/10/18 22:31:06 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/CallableServicesServlet.java 2006/10/25 19:32:54 1.6 @@ -6,11 +6,6 @@ import java.io.IOException; import java.io.PrintWriter; -import java.util.Calendar; -import java.util.Date; -import java.util.Map; -import java.util.Timer; -import java.util.TimerTask; import javax.servlet.ServletConfig; import javax.servlet.ServletException; @@ -18,14 +13,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.commons.discovery.tools.DiscoverSingleton; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.biomoby.client.CentralImpl; -import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; -import org.biomoby.client.ui.graphical.servlet.utilities.ServiceTester; -import org.biomoby.shared.MobyException; -import org.biomoby.shared.MobyService; +import org.biomoby.client.ui.graphical.servlet.utilities.ServiceTesterRunner; /** * @author Eddie Kawas This class was created to call out to all registered @@ -43,31 +33,10 @@ // some useful variables private final String newline = System.getProperty("line.separator"); - ServiceTesterRunner scheduler = null; + - public void init(ServletConfig arg0) throws ServletException { - super.init(arg0); - - ContextLoader cLoader = null; - try { - cLoader = (ContextLoader) DiscoverSingleton.find(Class - .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( - (String) ContextLoader.class.getCanonicalName()).getName()); - log - .warn((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" - : "ContextLoader has loaded successfully.")); - } catch (Exception e) { - log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" - + System.getProperty("line.separator") + e.getStackTrace()); - } - - log.info("initializing CallableServiceServlet"); - scheduler = new ServiceTesterRunner(); - Timer timer = new Timer(); - Calendar calendar = Calendar.getInstance(); - Date time = calendar.getTime(); - log.info("Scheduling on going task."); - timer.scheduleAtFixedRate(scheduler, time, 1000 * 60 * 60); + public void init(ServletConfig conf) throws ServletException { + super.init(conf); } /* @@ -79,7 +48,9 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // set the content type - + + ServiceTesterRunner scheduler = (ServiceTesterRunner) getServletContext().getAttribute("tester"); + String authority = filter(request.getParameter("authority")); String servicename = filter(request.getParameter("service")); String getStats = filter(request.getParameter("getStats")); @@ -163,11 +134,6 @@ } - public void init() throws ServletException { - super.init(); - - } - private static String filter(String input) { if (input == null) return null; @@ -201,63 +167,5 @@ doGet(arg0, arg1); } - public final class ServiceTesterRunner extends TimerTask { - /* - * - */ - - protected ServiceTester t = null; - - public ServiceTesterRunner() { - try { - t = new ServiceTester( - System.getProperty("MOBY_SERVER") == null ? CentralImpl.DEFAULT_ENDPOINT - : System.getProperty("MOBY_SERVER"), - System.getProperty("MOBY_URI") == null ? CentralImpl.DEFAULT_NAMESPACE - : System.getProperty("MOBY_URI")); - } catch (MobyException e) { - log.error("Couldn't instantiate a ServiceTester object", e); - } - // run(); - } - - /* - * Implements TimerTask's abstract run method. - */ - public void run() { - if (t == null) { - try { - t = new ServiceTester( - System.getProperty("MOBY_SERVER") == null ? CentralImpl.DEFAULT_ENDPOINT - : System.getProperty("MOBY_SERVER"), - System.getProperty("MOBY_URI") == null ? CentralImpl.DEFAULT_NAMESPACE - : System.getProperty("MOBY_URI")); - } catch (MobyException e) { - log.error("Couldn't instantiate a ServiceTester object", e); - return; - } - } - // implement this method to contain whatever it is you want to do - log.info("re-querying services..."); - MobyService[] services = t.getServices(); - if (services != null && services.length > 0) { - Map map = t.testServices(services); - if (map != null && !map.isEmpty()) - t.setResultMap(map); - } - services = null; - log.info("service checking complete!"); - // log stats every hour - t.logStats(); - } - - public ServiceTester getServiceTester() { - return t; - } - - // expressed in milliseconds - private final static long ONCE_PER_DAY = 1000 * 60 * 60 * 24; - - } } From kawas at dev.open-bio.org Wed Oct 25 15:32:54 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Wed, 25 Oct 2006 15:32:54 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610251932.k9PJWspu014168@dev.open-bio.org> kawas Wed Oct 25 15:32:54 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities In directory dev.open-bio.org:/tmp/cvs-serv14113/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities Modified Files: ServiceTester.java Added Files: ServiceTesterRunner.java RegistryContextListener.java Log Message: made service testing code more modular and fixed a thread (cleanup) issue moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities ServiceTesterRunner.java,NONE,1.1 RegistryContextListener.java,NONE,1.1 ServiceTester.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ServiceTester.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/client/ui/graphical/servlet/utilities/ServiceTester.java 2006/10/18 22:27:56 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ServiceTester.java 2006/10/25 19:32:54 1.9 @@ -5,6 +5,7 @@ import java.io.IOException; import java.text.DecimalFormat; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -28,7 +29,9 @@ public class ServiceTester { - private Central central = null; + private String url = null; + + private String uri = null; private Map results = null; @@ -40,13 +43,19 @@ private Log log = LogFactory.getLog(this.getClass()); public ServiceTester() throws MobyException { - central = new CentralImpl(); + // default here + this.url = CentralImpl.DEFAULT_ENDPOINT; + this.uri = CentralImpl.DEFAULT_NAMESPACE; + results = new TreeMap(); } @SuppressWarnings("unchecked") public ServiceTester(String url, String uri) throws MobyException { - central = new CentralImpl(url, uri); + // use default if necessary + this.url = url == null || url.trim().equals("") ? CentralImpl.DEFAULT_ENDPOINT : url; + this.uri = uri == null || uri.trim().equals("") ? CentralImpl.DEFAULT_NAMESPACE : uri; + results = Collections.synchronizedMap(new TreeMap()); } @@ -55,9 +64,10 @@ MobyService template = new MobyService(); try { + Central central = new CentralImpl(url, uri); services = central.findService(template); } catch (MobyException e) { - + log.error("Couldn't query Moby Central ..." + newline + Utils.format(e, 3)); } if (services == null) return new MobyService[] {}; @@ -245,63 +255,41 @@ if (DIRECTORY == null) { try { Context c = new InitialContext(); - DIRECTORY = (String)c.lookup("java:comp/env/CACHE_PATH"); + DIRECTORY = (String) c.lookup("java:comp/env/CACHE_PATH"); } catch (Exception e) { // default to the the user directory DIRECTORY = System.getProperty("user.dir"); } } - BufferedWriter out = new BufferedWriter(new FileWriter(DIRECTORY +"/" + "CallableStatsLog.txt", true)); - out.write(sb.toString()+newline); - out.close(); - } catch (IOException e) { - } - - // would like if this wrote to a different file + BufferedWriter out = new BufferedWriter(new FileWriter(DIRECTORY + "/" + + "CallableStatsLog.txt", true)); + out.write(sb.toString() + newline); + out.close(); + } catch (IOException e) { + } + + // would like if this wrote to a different file Logger.getLogger("CallableStats").info("###" + sb.toString() + "###"); } private String DIRECTORY = null; + public String getDeadServicesByAuthority() { StringBuffer sb = new StringBuffer(); sb.append("The following are services, sorted by Service Provider, have been identified" - + " as \"dead\" by the MOBY Service Testing agent." - + newline - + newline + + " as \"dead\" by the MOBY Service Testing agent." + newline + newline + "A \"dead\" service is one that does not respond correctly to a MOBY " - + "\"ping\"; where a correct \"ping\" request/response is:" - + newline - + newline - + "REQUEST" - + newline - + newline - + " " - + newline - + " " - + newline - + " " - + newline - + newline - + "RESPONSE" - + newline - + newline - + " " - + newline - + " " - + newline - + " " - + newline - + newline - + "The status of all services is tested hourly, and is recorded in the " - + newline - + "LSID metadata for each service as a boolean value in the RDF tag" - + newline - + " \"isAlive\", which may be used by client software to filter-out" - + newline - + " non-functional services." - + newline); - + + "\"ping\"; where a correct \"ping\" request/response is:" + newline + newline + + "REQUEST" + newline + newline + " " + newline + + " " + newline + " " + newline + + newline + "RESPONSE" + newline + newline + " " + newline + + " " + newline + " " + newline + + newline + "The status of all services is tested hourly, and is recorded in the " + + newline + "LSID metadata for each service as a boolean value in the RDF tag" + + newline + " \"isAlive\", which may be used by client software to filter-out" + + newline + " non-functional services." + newline); + Map map = getResultMap(); for (Iterator it = map.keySet().iterator(); it.hasNext();) { @@ -353,6 +341,7 @@ MobyService s = new MobyService(servicename); s.setAuthority(authority); try { + Central central = new CentralImpl(url, uri); if (central.findService(s).length > 0) return true; } catch (MobyException e) { @@ -365,6 +354,7 @@ MobyService s = new MobyService(servicename); s.setAuthority(authority); try { + Central central = new CentralImpl(url, uri); if (central.findService(s).length > 0) return true; } catch (MobyException e) { @@ -491,4 +481,19 @@ this.numThreads = numThreads; } + public String toString() { + return "ServiceTester(" + + newline + + "\t\t" + + url + + "," + + newline + + "\t\t" + + uri + + ")" + + newline + + " @ " + + new Date().toString(); + } + } From kawas at dev.open-bio.org Wed Oct 25 18:39:12 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Wed, 25 Oct 2006 18:39:12 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610252239.k9PMdCCs014400@dev.open-bio.org> kawas Wed Oct 25 18:39:12 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority In directory dev.open-bio.org:/tmp/cvs-serv14365/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority Modified Files: LSIDDataLookup.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority LSIDDataLookup.java,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java 2006/10/11 01:54:50 1.13 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java 2006/10/25 22:39:12 1.14 @@ -183,7 +183,7 @@ } else return UNKNOWN; - log.info(lsid.getObject() + " " + mobycentral.getProperty("lsid_namespace") + " " + ns); + log.info(lsid.getObject() + " " + ns); return result; } From gordonp at dev.open-bio.org Wed Oct 25 20:28:58 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:28:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260028.k9Q0Sw3d014750@dev.open-bio.org> gordonp Wed Oct 25 20:28:58 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended In directory dev.open-bio.org:/tmp/cvs-serv14715/src/main/org/biomoby/shared/extended Modified Files: ServiceInstanceParser.java Log Message: Simple javadoc fix moby-live/Java/src/main/org/biomoby/shared/extended ServiceInstanceParser.java,1.18,1.19 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceInstanceParser.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceInstanceParser.java 2006/10/25 02:33:23 1.18 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceInstanceParser.java 2006/10/26 00:28:58 1.19 @@ -187,7 +187,7 @@ } - /* + /** * @param list the list to put the services in @param model the model to use */ private boolean processModel(ArrayList list, Model model) { From gordonp at dev.open-bio.org Wed Oct 25 20:30:27 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:30:27 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260030.k9Q0URKC014834@dev.open-bio.org> gordonp Wed Oct 25 20:30:27 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv14799/src/main/org/biomoby/shared/data Modified Files: MobyDataComposite.java Log Message: Fixed varargs c-tor logic moby-live/Java/src/main/org/biomoby/shared/data MobyDataComposite.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.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/data/MobyDataComposite.java 2006/07/07 04:12:40 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java 2006/10/26 00:30:27 1.8 @@ -89,6 +89,12 @@ */ public MobyDataComposite(MobyDataType type, MobyNamespace namespace, String id, Object... memberStrings) throws IllegalArgumentException, MobyException{ super(namespace.getName(), id); + + if(type == null){ + throw new IllegalArgumentException("MOBY data type given in composite object " + + "constructor was null (not in the ontology?)"); + } + setDataType(type); members = new ConcurrentHashMap(); @@ -111,7 +117,8 @@ // which will be the basis for the member. else{ put(children[0].getName(), - MobyDataObject.createInstanceFromString(children[0].getName(), memberStrings[0].toString())); + MobyDataObject.createInstanceFromString(children[0].getDataTypeName(), + memberStrings[0].toString())); } return; } @@ -124,7 +131,7 @@ } String name = (String) arg1; - Object arg2 = memberStrings[i++]; + Object arg2 = memberStrings[++i]; for(int j = 0; i < memberStrings.length && j < children.length; j++){ MobyRelationship relationship = children[j]; From gordonp at dev.open-bio.org Wed Oct 25 20:31:21 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:31:21 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260031.k9Q0VL8C014877@dev.open-bio.org> gordonp Wed Oct 25 20:31:21 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv14842/src/main/org/biomoby/shared/data Modified Files: MobyDataObject.java Log Message: Fixed issue related to article names causing cached service lookups to fail match moby-live/Java/src/main/org/biomoby/shared/data MobyDataObject.java,1.9,1.10 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java 2006/07/07 04:12:40 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java 2006/10/26 00:31:21 1.10 @@ -562,7 +562,28 @@ return "<" + getDataType().getName() +" " + getAttrXML() + "/>"; } else{ - return super.toXML(); + // Override super because article name is not actually important to us + // but will cause cache misses for MOBY Central calls since the xml + // is used as a key in the call cache. + StringBuffer buf = new StringBuffer(); + buf.append ("\n"); + buf.append (""); + if (getDataType() != null) buf.append (getDataType().getName()); + buf.append ("\n"); + if (namespaces.size() > 0) { + for (java.util.Enumeration en = namespaces.elements(); en.hasMoreElements(); ) { + MobyNamespace ns = (MobyNamespace)en.nextElement(); + if(ns != null){ + buf.append (""); + buf.append ( ns.getName() ); + buf.append (""); + } + } + } + buf.append (""); + buf.append ("\n"); + return buf.toString(); + //return super.toXML(); } } From gordonp at dev.open-bio.org Wed Oct 25 20:32:20 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:32:20 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260032.k9Q0WKPw014924@dev.open-bio.org> gordonp Wed Oct 25 20:32:20 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv14885/src/main/org/biomoby/shared/data Modified Files: MobyContentInstance.java MobyDataUtils.java Log Message: Became more lenient in namespace resoltion (moby-s allowed, but give warnings) moby-live/Java/src/main/org/biomoby/shared/data MobyContentInstance.java,1.4,1.5 MobyDataUtils.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyContentInstance.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/MobyContentInstance.java 2006/09/22 23:01:04 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyContentInstance.java 2006/10/26 00:32:20 1.5 @@ -87,10 +87,18 @@ ") was not " + MobyTags.MOBYCONTENT); } if(!MobyPrefixResolver.MOBY_XML_NAMESPACE.equals(objectTag.getNamespaceURI())){ - throw new MobyException("The content element's namespace (" + - objectTag.getNamespaceURI() + - ") did not have the MOBY namespace " + - MobyPrefixResolver.MOBY_XML_NAMESPACE); + if(!MobyPrefixResolver.MOBY_XML_NAMESPACE_INVALID.equals(objectTag.getNamespaceURI())){ + throw new MobyException("The content element's namespace (" + + objectTag.getNamespaceURI() + + ") did not have the MOBY namespace " + + MobyPrefixResolver.MOBY_XML_NAMESPACE); + } + else{ + System.err.println("Invalid namespace used for content element (was " + + objectTag.getNamespaceURI() + + ", but should be " + MobyPrefixResolver.MOBY_XML_NAMESPACE + + ", proceeding anyway"); + } } members = new HashMap(); @@ -100,11 +108,12 @@ NodeList mobyData = MobyPrefixResolver.getChildElements(objectTag, MobyTags.MOBYDATA); - if(mobyData.getLength() == 0){ - throw new MobyException("The document's " + MobyTags.MOBYCONTENT + - " element does not have a " + MobyTags.MOBYDATA + - " child. It must have one or more according to the MOBY API"); - } + // The case below is no longer true: an empty content block is a "ping" request as per mailing list 2006-08 +// if(mobyData.getLength() == 0){ +// throw new MobyException("The document's " + MobyTags.MOBYCONTENT + +// " element does not have a " + MobyTags.MOBYDATA + +// " child. It must have one or more according to the MOBY API"); +// } // Now back to the main data for(int i = 0; i < mobyData.getLength(); i++){ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataUtils.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/data/MobyDataUtils.java 2006/07/07 04:12:40 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataUtils.java 2006/10/26 00:32:20 1.4 @@ -57,14 +57,25 @@ doc_root.getLocalName() + ") was not " + MobyTags.MOBY); } + NodeList envelope = null; if(!MobyPrefixResolver.MOBY_XML_NAMESPACE.equals(doc_root.getNamespaceURI())){ - throw new MobyException("The XML document's root element namespace (" + - doc_root.getNamespaceURI() + - ") is not the MOBY namespace " + - MobyPrefixResolver.MOBY_XML_NAMESPACE); + if(!MobyPrefixResolver.MOBY_XML_NAMESPACE_INVALID.equals(doc_root.getNamespaceURI())){ + throw new MobyException("The XML document's root element namespace (" + + doc_root.getNamespaceURI() + + ") is not the MOBY namespace " + + MobyPrefixResolver.MOBY_XML_NAMESPACE); + } + System.err.println("Invalid namespace used for root element (was " + doc_root.getNamespaceURI() + + ", but should be " + MobyPrefixResolver.MOBY_XML_NAMESPACE + + ", proceeding anyway"); + envelope = doc_root.getElementsByTagNameNS(MobyPrefixResolver.MOBY_XML_NAMESPACE_INVALID, + MobyTags.MOBYCONTENT); + } + else{ + envelope = doc_root.getElementsByTagNameNS(MobyPrefixResolver.MOBY_XML_NAMESPACE, + MobyTags.MOBYCONTENT); } - NodeList envelope = doc_root.getElementsByTagNameNS(MobyPrefixResolver.MOBY_XML_NAMESPACE, - MobyTags.MOBYCONTENT); + if(envelope.getLength() == 0){ throw new MobyException("The document's " + MobyTags.MOBY + " element does not contain a " + From gordonp at dev.open-bio.org Wed Oct 25 20:33:36 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:33:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260033.k9Q0Xa4f014967@dev.open-bio.org> gordonp Wed Oct 25 20:33:35 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv14932/src/main/org/biomoby/shared Modified Files: MobyService.java Log Message: Added method to grab metadata-filled-in service instances moby-live/Java/src/main/org/biomoby/shared MobyService.java,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2006/10/25 02:33:23 1.13 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2006/10/26 00:33:35 1.14 @@ -10,6 +10,7 @@ import java.util.Comparator; import java.util.Enumeration; import java.util.Vector; +import org.biomoby.shared.extended.ServiceInstanceParser; /** * A container representing a service. But do not be too excited - @@ -60,6 +61,10 @@ public static final int TESTED = 8; // Gives a valid answer to a valid test input provided by the service protected int serviceStatus = UNCHECKED; protected int statusChecks = UNCHECKED; + + // We need both, because you can't synchrinize on a null array + protected static MobyService[] uninitializedServices = new MobyService[0]; + protected static MobyService[] services = uninitializedServices; // the elements of these Vectors are of type MobyData protected Vector primaryInputs = new Vector(); @@ -438,4 +443,35 @@ this.serviceType = (serviceType == null ? new MobyServiceType() : serviceType); } + public static MobyService getService(String name, String authority){ + if(name == null || authority == null){ + return null; + } + + // This method has not been called yet in the JVM, populate the datatypes + synchronized (services){ + if(services == uninitializedServices){ + try{ + ServiceInstanceParser p = new ServiceInstanceParser("http://biomoby.org/RESOURCES/MOBY-S/ServiceInstances"); + services = p.getMobyServicesFromRDF(); + } + catch(Exception e){ + System.err.println("Cannot parse MOBY Service Instance Database: " + e); + e.printStackTrace(); + return null; + } + } + } + + // Perform a linear search for the corresponding namespace and authority + for(int i = 0; i < services.length; i++){ + if(name.equals(services[i].getName()) && + authority.equals(services[i].getAuthority())){ + return services[i]; + } + } + + // Wasn't found if we got to here + return null; + } } From gordonp at dev.open-bio.org Wed Oct 25 20:34:13 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:34:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260034.k9Q0YDUf015012@dev.open-bio.org> gordonp Wed Oct 25 20:34:13 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv14977/src/main/org/biomoby/shared Modified Files: MobyPrefixResolver.java Log Message: Became more lenient in namespace resolution (moby-s allowed, but give warnings) moby-live/Java/src/main/org/biomoby/shared MobyPrefixResolver.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrefixResolver.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/shared/MobyPrefixResolver.java 2006/07/07 04:12:40 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrefixResolver.java 2006/10/26 00:34:13 1.6 @@ -22,6 +22,7 @@ public class MobyPrefixResolver implements PrefixResolver{ public static final String MOBY_XML_NAMESPACE = "http://www.biomoby.org/moby"; + public static final String MOBY_XML_NAMESPACE_INVALID = "http://www.biomoby.org/moby-s"; public static final String MOBY_XML_PREFIX = "moby"; public static final String MOBY_TRANSPORT_NAMESPACE = "http://biomoby.org/"; public static final String MOBY_TRANSPORT_PREFIX = "mobyt"; From gordonp at dev.open-bio.org Wed Oct 25 20:35:20 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:35:20 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260035.k9Q0ZKQF015055@dev.open-bio.org> gordonp Wed Oct 25 20:35:19 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util In directory dev.open-bio.org:/tmp/cvs-serv15020/src/main/ca/ucalgary/seahawk/util Modified Files: MobyUtils.java Log Message: Made single words into keywords by default moby-live/Java/src/main/ca/ucalgary/seahawk/util MobyUtils.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2006/10/26 00:35:19 1.2 @@ -31,7 +31,13 @@ // Can always use the data as a string objects.add(new MobyDataString(objectName, data)); - + // If it's a single word, give keyword options + if(data.trim().matches("^[A-Za-z0-9_-]{3,}$")){ + objects.add(new MobyDataComposite("Global_Keyword", + "dummy_name", + "seahawk_namespace", + data.trim())); + } // See if it's sequence MobyDataComposite mdc = createMobySequence(data, "user-selection"); From gordonp at dev.open-bio.org Wed Oct 25 20:36:16 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:36:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260036.k9Q0aGAo015098@dev.open-bio.org> gordonp Wed Oct 25 20:36:15 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv15063/src/main/ca/ucalgary/seahawk/services Modified Files: MobyClient.java Log Message: Got rid of redundant service lookup code moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyClient.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2006/10/26 00:36:15 1.2 @@ -622,23 +622,51 @@ return (MobyDataObject[]) objectVector.toArray(new MobyDataObject[objectVector.size()]); } + public void setRequiredServiceLevel(int level){ + serviceLevel = level; + System.err.println("Service level is now set to " + serviceLevel); + } + + public MobyDataServiceAssocInstance getServices(MobyDataObjectSet mdos) throws MobyException{ + return (getServices(new MobyDataObjectSet[]{mdos}))[0]; + } + + public MobyDataServiceAssocInstance getServices(MobyDataObject mdo) throws MobyException{ + return (getServices(new MobyDataObject[]{mdo}))[0]; + } + + public MobyDataServiceAssocInstance[] getServices(MobyDataObjectSet[] mdoss) throws MobyException{ + return getServices((MobyPrimaryData[]) mdoss); + } + public MobyDataServiceAssocInstance[] getServices(MobyDataObject[] mdos) throws MobyException{ + return getServices((MobyPrimaryData[]) mdos); + } + + protected MobyDataServiceAssocInstance[] getServices(MobyPrimaryData[] mdos) throws MobyException{ MobyDataServiceAssocInstance[] mobyDataServiceAssocInstances = new MobyDataServiceAssocInstance[mdos.length]; for(int i = 0; i < mdos.length; i++){ MobyService templateServices = new MobyService(""); templateServices.addInput(mdos[i]); - //System.out.println("find services: "); MobyService[] mService = c.findService(templateServices); Vector filteredServices = new Vector(); // Let's make sure all of the services have their service type properly instantiated // for ontology checks later on for(int j = 0; j < mService.length; j++){ + MobyService service = MobyService.getService(mService[j].getName(), mService[j].getAuthority()); + if(service != null){ + mService[j] = service; + } + mService[j].setServiceType(MobyServiceType.getServiceType(mService[j].getServiceType().getName())); - if(serviceLevel != MobyService.UNCHECKED && - ((mService[j].getStatus() & serviceLevel) >= serviceLevel)){ - filteredServices.add(mService[j]); + if(serviceLevel != MobyService.UNCHECKED){ + int serviceStatus = mService[j].getStatus(); + //System.err.println("Service " + mService[j].getName() + " has status " + serviceStatus); + if((serviceStatus & serviceLevel) >= serviceLevel){ + filteredServices.add(mService[j]); + } } } @@ -646,7 +674,16 @@ mService = (MobyService []) filteredServices.toArray(new MobyService[filteredServices.size()]); } - mobyDataServiceAssocInstances[i] = new MobyDataObjectSAI(mdos[i], mService); + if(mdos[i] instanceof MobyDataObject){ + mobyDataServiceAssocInstances[i] = new MobyDataObjectSAI((MobyDataObject) mdos[i], mService); + } + else if(mdos[i] instanceof MobyDataObjectSet){ + mobyDataServiceAssocInstances[i] = new MobyDataObjectSetSAI((MobyDataObjectSet) mdos[i], mService); + } + else{ + logger.warn("MobyClient could not handle service-associating an instance of " + mdos[i].getClass()); + System.err.println("MobyClient could not handle service-associating an instance of " + mdos[i].getClass()); + } } return mobyDataServiceAssocInstances; } From gordonp at dev.open-bio.org Wed Oct 25 20:37:29 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:37:29 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260037.k9Q0bTsE015141@dev.open-bio.org> gordonp Wed Oct 25 20:37:28 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv15106/src/main/ca/ucalgary/seahawk/gui Modified Files: MobyContentGUI.java Log Message: Added caching of service instances (mainly to filter for alive ones), put caching of this and object hierarchy into threads on startup moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyContentGUI.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2006/10/25 13:54:50 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2006/10/26 00:37:28 1.3 @@ -857,10 +857,17 @@ // "error"); // } + // The following command will cache all data type definitions for this session + new Thread(){ + public void run(){org.biomoby.shared.MobyDataType.getDataType("Object");} + }.start(); + // And the service definitions + new Thread(){ + public void run(){org.biomoby.shared.MobyService.getService("","");} + }.start(); + MobyContentGUI gui = ca.ucalgary.seahawk.util.MobyUtils.getMobyContentGUI(new JLabel()); gui.setDefaultCloseOperation(defaultCloseOperation); - // The following command will cache all data type definitions for this session - Object dataType = org.biomoby.shared.MobyDataType.getDataType("Object"); gui.setVisible(true); if(argv.length != 0){ From gordonp at dev.open-bio.org Wed Oct 25 21:31:25 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 21:31:25 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260131.k9Q1VPim015249@dev.open-bio.org> gordonp Wed Oct 25 21:31:25 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv15214/src/main/ca/ucalgary/seahawk/gui Modified Files: MobyServicesGUI.java Log Message: Got rid of redundant code moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyServicesGUI.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/10/26 01:31:25 1.2 @@ -53,6 +53,7 @@ public MobyServicesGUI() throws Exception{ mobyClient = new MobyClient(); + mobyClient.setRequiredServiceLevel(MobyService.ALIVE); mobyRequest = new MobyRequest(mobyClient.getMobyCentralImpl()); waitItem = new JMenuItem("Building data list, please wait..."); @@ -529,61 +530,76 @@ addClipboardItem(submenu, mobyData); submenu.add(getWaitItem(submenu)); - MobyService[] foundServices = null; +// MobyService[] foundServices = null; +// try{ +// mobyData.setXmlMode(MobyDataInstance.CENTRAL_XML_MODE); +// //logger.debug("Querying central with: " + mobyData.toXML()); +// MobyService templateService = new MobyService(""); +// if(!(mobyData instanceof MobyData)){ +// logger.warn("MobyDataInstance implementer " + mobyData.getClass() + +// " cannot be used to find services, it does not " + +// "inherit from MobyData as Central requires"); +// } +// templateService.addInput((MobyData) mobyData); +// foundServices = mobyClient.getMobyCentralImpl().findService(templateService); +// } +// catch(Exception mobye){ +// logger.error("Could not retrieve list of MobyServices from initialized MobyClient using the " + +// "MOBY data " + mobyData);mobye.printStackTrace(); +// synchronized(popupList){ +// popupList.setVisible(false); +// popupList.remove(waitItem); +// if(submenu.isPopupMenuVisible()){ +// submenu.setPopupMenuVisible(false); +// submenu.remove(getWaitItem(submenu)); +// submenu.setPopupMenuVisible(true); +// } +// else{ +// submenu.remove(getWaitItem(submenu)); +// } +// popupList.setVisible(true); +// } +// return; +// } +// if(foundServices == null || foundServices.length == 0){ +// popupList.setVisible(false); +// return; +// } + +// // Let's make sure all of the services have their service type properly instantiated +// // for ontology checks later on +// for(int j = 0; j < foundServices.length; j++){ +// foundServices[j].setServiceType(MobyServiceType.getServiceType(foundServices[j].getServiceType().getName())); +// } + + MobyDataServiceAssocInstance serviceAssocObject = null; +// //Services for only the one piece of data try{ - mobyData.setXmlMode(MobyDataInstance.CENTRAL_XML_MODE); - //logger.debug("Querying central with: " + mobyData.toXML()); - MobyService templateService = new MobyService(""); - if(!(mobyData instanceof MobyData)){ - logger.warn("MobyDataInstance implementer " + mobyData.getClass() + - " cannot be used to find services, it does not " + - "inherit from MobyData as Central requires"); + if(mobyData instanceof MobyDataObjectSet){ + serviceAssocObject = mobyClient.getServices((MobyDataObjectSet) mobyData); } - templateService.addInput((MobyData) mobyData); - foundServices = mobyClient.getMobyCentralImpl().findService(templateService); - } - catch(Exception mobye){ - logger.error("Could not retrieve list of MobyServices from initialized MobyClient using the " + - "MOBY data " + mobyData);mobye.printStackTrace(); - synchronized(popupList){ - popupList.setVisible(false); - popupList.remove(waitItem); - if(submenu.isPopupMenuVisible()){ - submenu.setPopupMenuVisible(false); - submenu.remove(getWaitItem(submenu)); - submenu.setPopupMenuVisible(true); - } - else{ - submenu.remove(getWaitItem(submenu)); - } - popupList.setVisible(true); + else if(mobyData instanceof MobyDataObject){ + serviceAssocObject = mobyClient.getServices((MobyDataObject) mobyData); } - return; - } - if(foundServices == null || foundServices.length == 0){ + else{ + logger.warn("Service options for objects other than MobyDataObject " + + "and MobyDataObjectSet are not yet supported."); + return; + } + } catch(Exception mobye){ + logger.error("Could not retrieve list of MobyServices from initialized MobyClient using the " + + "MOBY data " + mobyData); + mobye.printStackTrace(); popupList.setVisible(false); return; } - // Let's make sure all of the services have their service type properly instatiated - // for ontology checks later on - for(int j = 0; j < foundServices.length; j++){ - foundServices[j].setServiceType(MobyServiceType.getServiceType(foundServices[j].getServiceType().getName())); + if(serviceAssocObject == null || serviceAssocObject.getServices() == null || + serviceAssocObject.getServices().length == 0){ + popupList.setVisible(false); + return; } - MobyDataServiceAssocInstance serviceAssocObject = null; - //Services for only the one piece of data - if(mobyData instanceof MobyDataObjectSet){ - serviceAssocObject = new MobyDataObjectSetSAI((MobyDataObjectSet) mobyData, foundServices); - } - else if(mobyData instanceof MobyDataObject){ - serviceAssocObject = new MobyDataObjectSAI((MobyDataObject) mobyData, foundServices); - } - else{ - logger.warn("Service options for objects other than MobyDataObject " + - "and MobyDataObjectSet are not yet supported."); - return; - } addServicesToSubMenu(submenu, serviceAssocObject, handler); } From gordonp at dev.open-bio.org Wed Oct 25 21:32:06 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 21:32:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260132.k9Q1W6R2015292@dev.open-bio.org> gordonp Wed Oct 25 21:32:06 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources In directory dev.open-bio.org:/tmp/cvs-serv15257/src/main/ca/ucalgary/seahawk/resources Modified Files: moby2HTML.xsl Log Message: Became more lenient with moby-s namespace for tags moby-live/Java/src/main/ca/ucalgary/seahawk/resources moby2HTML.xsl,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/moby2HTML.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/moby2HTML.xsl 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/moby2HTML.xsl 2006/10/26 01:32:06 1.2 @@ -31,7 +31,8 @@ + xmlns:moby="http://www.biomoby.org/moby" + xmlns:mobys="http://www.biomoby.org/moby-s"> - + - -

      MOBY Data from + +

      MOBY Data from

      - + - +

      The MOBY data is:

      @@ -84,7 +85,7 @@ - + @@ -93,9 +94,9 @@ - +

      - + @@ -109,7 +110,7 @@

      - + @@ -136,7 +137,7 @@ - + @@ -162,7 +163,7 @@ - + @@ -170,17 +171,17 @@ - +
      - + @@ -207,24 +208,24 @@ - + - +
      Xref:
      - - ID : () - + + ID : () + - + - ID : ():
      - + ID : ():
      +
      - - :
      + + :
      @@ -241,7 +242,7 @@
      MOBY Data for query - +
      + (ID :) @@ -253,11 +254,11 @@ - + - Collection of data elements:
      + Collection of data elements:
        - +
      From gordonp at dev.open-bio.org Wed Oct 25 21:32:06 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 21:32:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260132.k9Q1W6EU015312@dev.open-bio.org> gordonp Wed Oct 25 21:32:06 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv15257/src/main/ca/ucalgary/seahawk/services Modified Files: MobyClient.java Log Message: Became more lenient with moby-s namespace for tags moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyClient.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2006/10/26 00:36:15 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2006/10/26 01:32:06 1.3 @@ -624,7 +624,6 @@ public void setRequiredServiceLevel(int level){ serviceLevel = level; - System.err.println("Service level is now set to " + serviceLevel); } public MobyDataServiceAssocInstance getServices(MobyDataObjectSet mdos) throws MobyException{ From gordonp at dev.open-bio.org Wed Oct 25 21:32:06 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 21:32:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260132.k9Q1W6vd015374@dev.open-bio.org> gordonp Wed Oct 25 21:32:06 EDT 2006 Update of /home/repository/moby/moby-live/Java/xmls In directory dev.open-bio.org:/tmp/cvs-serv15257/xmls Modified Files: seahawkBuild.xml Log Message: Became more lenient with moby-s namespace for tags moby-live/Java/xmls seahawkBuild.xml,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/seahawkBuild.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/xmls/seahawkBuild.xml 2006/10/25 02:33:23 1.1 +++ /home/repository/moby/moby-live/Java/xmls/seahawkBuild.xml 2006/10/26 01:32:06 1.2 @@ -53,8 +53,8 @@ - + + From gordonp at dev.open-bio.org Wed Oct 25 21:32:06 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 21:32:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260132.k9Q1W68D015356@dev.open-bio.org> gordonp Wed Oct 25 21:32:06 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv15257/src/main/org/biomoby/shared/data Modified Files: MobyContentInstance.java Log Message: Became more lenient with moby-s namespace for tags moby-live/Java/src/main/org/biomoby/shared/data MobyContentInstance.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyContentInstance.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/shared/data/MobyContentInstance.java 2006/10/26 00:32:20 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyContentInstance.java 2006/10/26 01:32:06 1.6 @@ -190,6 +190,9 @@ MobyDataJob job = new MobyDataJob(); groupID = dataGroupTag.getAttributeNS(MobyPrefixResolver.MOBY_XML_NAMESPACE, MobyTags.QUERYID); + if(groupID == null){ + groupID = dataGroupTag.getAttributeNS(MobyPrefixResolver.MOBY_XML_NAMESPACE_INVALID, MobyTags.QUERYID); + } if(groupID == null || groupID.length() == 0){ groupID = dataGroupTag.getAttributeNS("", MobyTags.QUERYID); } From gordonp at dev.open-bio.org Wed Oct 25 21:32:06 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 21:32:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260132.k9Q1W6Hp015334@dev.open-bio.org> gordonp Wed Oct 25 21:32:06 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv15257/src/main/org/biomoby/shared Modified Files: MobyPrefixResolver.java Log Message: Became more lenient with moby-s namespace for tags moby-live/Java/src/main/org/biomoby/shared MobyPrefixResolver.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrefixResolver.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/MobyPrefixResolver.java 2006/10/26 00:34:13 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrefixResolver.java 2006/10/26 01:32:06 1.7 @@ -51,6 +51,9 @@ public static String getAttr(org.w3c.dom.Element e, String attrName){ String value = e.getAttributeNS(MOBY_XML_NAMESPACE, attrName); if(value == null || "".equals(value)){ + value = e.getAttributeNS(MOBY_XML_NAMESPACE_INVALID, attrName); + } + if(value == null || "".equals(value)){ value = e.getAttributeNS(null, attrName); } return value; @@ -95,7 +98,8 @@ } // Make sure it's in the MOBY namespace, or no namespace at all String uri = child.getNamespaceURI(); - if(uri != null && uri.length() != 0 && !uri.equals(MOBY_XML_NAMESPACE)){ + if(uri != null && uri.length() != 0 && !uri.equals(MOBY_XML_NAMESPACE) && + !uri.equals(MOBY_XML_NAMESPACE_INVALID)){ continue; } From gordonp at dev.open-bio.org Wed Oct 25 21:40:43 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 21:40:43 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260140.k9Q1eh4Y015423@dev.open-bio.org> gordonp Wed Oct 25 21:40:43 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv15388 Modified Files: Seahawk.html Log Message: Updated docs to reflect fact that Seahawk is now completely in the jMOBY CVS moby-live/Java/docs Seahawk.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/Seahawk.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/docs/Seahawk.html 2006/08/01 16:00:49 1.2 +++ /home/repository/moby/moby-live/Java/docs/Seahawk.html 2006/10/26 01:40:43 1.3 @@ -50,7 +50,7 @@

      How do I launch it?

      -

      The applet can be launched from the following Web site: http://moby.ucalgary.ca/seahawk/

      +

      The applet can be launched from the following Web site: http://moby.ucalgary.ca/seahawk/. If you are a programmer, you can run it with a checked out version of the jMOBY CVS: ./build.sh seahawk/tt>

      @@ -69,7 +69,7 @@

      The jar (Java archive) file containing all of the required classes (including those from Axis, Jena, Xalan, Xerces, etc.) is available - here. Note that this JAR + here. Note that this JAR is signed by the University of Calgary Bioinformatics Lab. This jar file can be used as an application with the command:

      java -jar seahawk.jar
      @@ -79,8 +79,8 @@

      Or it can be launched from within another Java application with the following code (and assuming seahawk.jar is in the classpath):

      -import ca.ucalgary.bluejay.util.MobyUtils;
      -import ca.ucalgary.bluejay.gui.MobyContentGUI;
      +import ca.ucalgary.seahawk.util.MobyUtils;
      +import ca.ucalgary.seahawk.gui.MobyContentGUI;
       
       // the rest of your application code goes here...
       
      @@ -108,7 +108,7 @@
         There are 4 main mechanisms for creating Moby Data Instances in Seahawk:
       
      1. When a Moby XML file is loaded, the resulting (customizable) HTML display contains XPointer-based hyperlinks to parts of the original XML file.
      2. -
      3. Highlighted text is automatically turned into a Moby String Object by ca.ucalgary.bluejay.gui.MobyContentGUI, and +
      4. Highlighted text is automatically turned into a Moby String Object by ca.ucalgary.seahawk.gui.MobyContentGUI, and this same class will create a MOBY DNASequence, RNASequence or AASequence if 95% of the characters are valid for that sequence type.
      5. Highlighted text is tested against a set of regular expression rules
      6. Programmatically selected XML document nodes (e.g. when genes are clicked in Bluejay) are tested against a set of XPath rules
      7. From gordonp at dev.open-bio.org Fri Oct 27 16:00:35 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 27 Oct 2006 16:00:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610272000.k9RK0ZWA023723@dev.open-bio.org> gordonp Fri Oct 27 16:00:35 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util In directory dev.open-bio.org:/tmp/cvs-serv23670/src/main/ca/ucalgary/seahawk/util Modified Files: MobyUtils.java Log Message: Improvements to popup-menu hierarchy when there are many, many service options moby-live/Java/src/main/ca/ucalgary/seahawk/util MobyUtils.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2006/10/26 00:35:19 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2006/10/27 20:00:35 1.3 @@ -5,12 +5,13 @@ import org.biomoby.shared.data.*; import org.biomoby.shared.MobyDataType; +import org.biomoby.shared.MobyNamespace; import java.util.Vector; import javax.swing.JLabel; public class MobyUtils{ - public static final int MAX_OBJ_NAME_LEN = 18; + public static final int MAX_OBJ_NAME_LEN = 12; private static MobyContentGUI mobyContentGUI = null; private static MobyServicesGUI mobyServicesGUI = null; @@ -29,13 +30,15 @@ } // Can always use the data as a string - objects.add(new MobyDataString(objectName, data)); + MobyDataString strObject = new MobyDataString(objectName, data); + strObject.setPrimaryNamespace(new MobyNamespace("seahawk")); + objects.add(strObject); // If it's a single word, give keyword options if(data.trim().matches("^[A-Za-z0-9_-]{3,}$")){ objects.add(new MobyDataComposite("Global_Keyword", "dummy_name", - "seahawk_namespace", + "seahawk", data.trim())); } @@ -113,19 +116,19 @@ if(Sequence.isDNA(sequenceData)){ sequence = new MobyDataComposite("DNASequence", "dummy_name", - "seahawk_namespace", + "seahawk", id); } else if(Sequence.isRNA(sequenceData)){ sequence = new MobyDataComposite("RNASequence", "dummy_name", - "seahawk_namespace", + "seahawk", id); } else if(Sequence.isProtein(sequenceData)){ sequence = new MobyDataComposite("AminoAcidSequence", "dummy_name", - "seahawk_namespace", + "seahawk", id); } // Not a recognized type of sequence From gordonp at dev.open-bio.org Fri Oct 27 16:00:35 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 27 Oct 2006 16:00:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610272000.k9RK0Z6X023705@dev.open-bio.org> gordonp Fri Oct 27 16:00:35 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv23670/src/main/ca/ucalgary/seahawk/gui Modified Files: MobyServicesGUI.java Log Message: Improvements to popup-menu hierarchy when there are many, many service options moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyServicesGUI.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/10/26 01:31:25 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/10/27 20:00:35 1.3 @@ -22,7 +22,7 @@ public final static String SERVICE_SUBMENU_NAME = "seahawkPopupSubMenuName"; // After this many, subdivide the services for an object into sublists based of service ontology - public final static int MAX_SERVICES_PER_SUBMENU = 7; + public final static int MAX_SERVICES_PER_SUBMENU = 20; public final static int MAX_SERVICE_DESC_LEN = 100; public final static String CLIPBOARD_CMD = "clipboard"; /** Always spring MOBY response in a new window if this modifier is present for a click */ @@ -530,48 +530,6 @@ addClipboardItem(submenu, mobyData); submenu.add(getWaitItem(submenu)); -// MobyService[] foundServices = null; -// try{ -// mobyData.setXmlMode(MobyDataInstance.CENTRAL_XML_MODE); -// //logger.debug("Querying central with: " + mobyData.toXML()); -// MobyService templateService = new MobyService(""); -// if(!(mobyData instanceof MobyData)){ -// logger.warn("MobyDataInstance implementer " + mobyData.getClass() + -// " cannot be used to find services, it does not " + -// "inherit from MobyData as Central requires"); -// } -// templateService.addInput((MobyData) mobyData); -// foundServices = mobyClient.getMobyCentralImpl().findService(templateService); -// } -// catch(Exception mobye){ -// logger.error("Could not retrieve list of MobyServices from initialized MobyClient using the " + -// "MOBY data " + mobyData);mobye.printStackTrace(); -// synchronized(popupList){ -// popupList.setVisible(false); -// popupList.remove(waitItem); -// if(submenu.isPopupMenuVisible()){ -// submenu.setPopupMenuVisible(false); -// submenu.remove(getWaitItem(submenu)); -// submenu.setPopupMenuVisible(true); -// } -// else{ -// submenu.remove(getWaitItem(submenu)); -// } -// popupList.setVisible(true); -// } -// return; -// } -// if(foundServices == null || foundServices.length == 0){ -// popupList.setVisible(false); -// return; -// } - -// // Let's make sure all of the services have their service type properly instantiated -// // for ontology checks later on -// for(int j = 0; j < foundServices.length; j++){ -// foundServices[j].setServiceType(MobyServiceType.getServiceType(foundServices[j].getServiceType().getName())); -// } - MobyDataServiceAssocInstance serviceAssocObject = null; // //Services for only the one piece of data try{ @@ -725,6 +683,140 @@ if(ontologyDepth >= maxOntologyDepth){ // TO DO: for now, a long list will appear instead //System.err.println("In TODO big sublist ("+ontologyDepth+">="+maxOntologyDepth+")"); + // Recursively call this method for each type in the ontology at the given depth + + // Make smaller lists based on returned data ontology + MobyDataType[][] outputLineages = new MobyDataType[unsortedServices.length][]; + int maxDataOntologyDepth = 0; + for(int i = 0; i < unsortedServices.length; i++){ + MobyData[] output = unsortedServices[i].getPrimaryOutputs(); + + MobyDataType outputType = null; + if(output != null && output.length != 0 && output[0] instanceof MobyPrimaryData){ + outputType = MobyDataType.getDataType(((MobyPrimaryData) output[0]).getDataType().getName()); + } + if(outputType == null){ + logger.warn("No output data type (ontology) was associated with service " + + unsortedServices[i] + ", cannot add to the hierarchical service " + + "menus (skipping)"); + continue; + } + outputLineages[i] = outputType.getLineage(); + if(outputLineages[i] == null){ + logger.debug("No output data type lineage (ontology position) was associated with service type " + + outputType + ", cannot add to the hierarchical service " + + "menus (skipping)"); + } + else if(outputLineages[i].length > maxOntologyDepth){ + maxDataOntologyDepth = outputLineages[i].length; + } + logger.debug("Data lineage for " + unsortedServices[i].getName() + + "had length " + outputLineages[i].length); + } + + String commonDataAncestorDesc = ""; + int dataOntologyDepth = 0; + breadth_first_data_search: for(; dataOntologyDepth < maxDataOntologyDepth; dataOntologyDepth++){ + MobyDataType commonOutputType = null; + for(int i = 0; i < outputLineages.length; i++){ + if(outputLineages[i] == null || outputLineages[i].length <= dataOntologyDepth){ + continue; + } + + // Not yet set + if(commonOutputType == null){ + commonOutputType = outputLineages[i][dataOntologyDepth]; + commonAncestorDesc += outputLineages[i][dataOntologyDepth] + " > "; + } + // Difference in lineages found, need to split the menu here... + else if(!commonOutputType.equals(outputLineages[i][dataOntologyDepth])){ + break breadth_first_data_search; // labelled break + } + } + } + //System.err.println("common ontology depth is " + dataOntologyDepth); + + if(dataOntologyDepth >= maxDataOntologyDepth){ + // Must separate by name + sortServicesByName(unsortedServices); + for(int j = 0; j < unsortedServices.length-1;j += MAX_SERVICES_PER_SUBMENU){ + MobyService[] services = null; + if(j+MAX_SERVICES_PER_SUBMENU < unsortedServices.length){ //full slot + services = new MobyService[MAX_SERVICES_PER_SUBMENU]; + System.arraycopy(unsortedServices, j, services, 0, MAX_SERVICES_PER_SUBMENU); + } + else{ + services = new MobyService[unsortedServices.length-j]; + System.arraycopy(unsortedServices, j, services, 0, unsortedServices.length-j); + } + + JMenu newMenu = addNameDivSubMenu(submenu, services); + MobyDataServiceAssocInstance newMsadi = null; + if(msadi instanceof MobyDataXref){ + newMsadi = new MobyDataXref((MobyDataObject) msadi, services[0]); + } + else if(msadi instanceof MobyDataObjectSAI){ + newMsadi = new MobyDataObjectSAI((MobyDataObject) msadi, services); + } + else if(msadi instanceof MobyDataObjectSetSAI){ + newMsadi = new MobyDataObjectSetSAI((MobyDataObjectSet) msadi, services); + } + addServicesToSubMenu(newMenu, newMsadi, handler); + } + } + + else{ + // How many submenus do we need? + Map> outputType2Services = + new TreeMap>(); + for(int i = 0; i < outputLineages.length; i++){ + if(outputLineages[i] == null){ + continue; + } + MobyDataType type = null; + // Branch + if(outputLineages[i].length > dataOntologyDepth){ + type = outputLineages[i][dataOntologyDepth]; + } + // Leaf + else if(dataOntologyDepth >= 1){ + type = outputLineages[i][outputLineages[i].length-1]; + } + // ?? rootless node? + else{ + type = new MobyDataType("Object (no details)"); + } + MobyService service = unsortedServices[i]; + // type exists already + if(outputType2Services.containsKey(type)){ + outputType2Services.get(type).add(service); + } + // otherwise first service of this type + else{ + Vector serviceItems = new Vector(); + serviceItems.add(service); + outputType2Services.put(type, serviceItems); + } + } + + for(MobyDataType type: outputType2Services.keySet()){ + + JMenu newMenu = addOutputTypeSubMenu(submenu, type); + + Vector serviceVector = outputType2Services.get(type); + MobyService[] services = serviceVector.toArray(new MobyService[serviceVector.size()]); + MobyDataServiceAssocInstance newMsadi = null; + if(msadi instanceof MobyDataXref){ + newMsadi = new MobyDataXref((MobyDataObject) msadi, services[0]); + } + else if(msadi instanceof MobyDataObjectSAI){ + newMsadi = new MobyDataObjectSAI((MobyDataObject) msadi, services); + } + else if(msadi instanceof MobyDataObjectSetSAI){ + newMsadi = new MobyDataObjectSetSAI((MobyDataObjectSet) msadi, services); + } + addServicesToSubMenu(newMenu, newMsadi, handler); + }} } else{ @@ -742,7 +834,7 @@ } // Leaf else if(ontologyDepth >= 1){ - type = serviceLineages[i][ontologyDepth-1]; + type = serviceLineages[i][serviceLineages[i].length-1]; } // ?? rootless node? else{ @@ -780,21 +872,21 @@ } addServicesToSubMenu(newMenu, newMsadi, handler); } + } - // Causes resizing based on new items - if(submenu.isPopupMenuVisible()){ - submenu.setPopupMenuVisible(false); - submenu.remove(getWaitItem(submenu)); - submenu.setPopupMenuVisible(true); - } - else{ - submenu.remove(getWaitItem(submenu)); - } - // If recursed to create more submenus, do not execute the code below, - // which would add the items to the top level submenu too. - return; + // Causes resizing based on new items + if(submenu.isPopupMenuVisible()){ + submenu.setPopupMenuVisible(false); + submenu.remove(getWaitItem(submenu)); + submenu.setPopupMenuVisible(true); } - + else{ + submenu.remove(getWaitItem(submenu)); + } + // If recursed to create more submenus, do not execute the code below, + // which would add the items to the top level submenu too. + return; + } addHandler(handler); @@ -900,6 +992,76 @@ return menu; } + protected String getNameStart(MobyService service){ + String serviceName = service.getName(); + if(serviceName.length() <= 9){ + return serviceName; + } + else{ + return serviceName.substring(0, 8)+"..."; + } + } + + public JMenu addNameDivSubMenu(JMenu parentMenu, MobyService[] services){ + if(services == null || services.length == 0){ + return null; + } + + JMenu menu = new JMenu("Service name "+getNameStart(services[0]) + "-"+ + getNameStart(services[services.length-1])+":"); + parentMenu.add(menu); + + // The following is to keep track of nested menu parents, which + // you can't do directly in Swing (see + // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4103931) + while(service2submenu.containsKey(parentMenu)){ + parentMenu = (JMenu) service2submenu.get(parentMenu); + } + + // All menus, no matter how nested, point to top submenu that corresponds to the data object + service2submenu.put(menu, parentMenu); + + return menu; + } + + public JMenu addOutputTypeSubMenu(JMenu parentMenu, MobyDataType type){ + JMenu menu = new JMenu("Result type: " + type.getName()); + + MobyDataType[] typeLineage = type.getLineage(); + String commonAncestorDesc = ""; + for(int i = 0; i < typeLineage.length; i++){ + if(typeLineage == null){ + commonAncestorDesc = "No details available"; + break; + } + commonAncestorDesc += typeLineage[i].getName() + " > "; + } + + String desc = type.getDescription(); + if(desc == null || desc.length() == 0){ + desc = type.getComment(); + } + String menuToolTip = commonAncestorDesc + desc; + if(menuToolTip.length() > MAX_SERVICE_DESC_LEN){ + // Cut down really long ancestry descs to the last part (most precise) + menuToolTip = "..." + menuToolTip.substring(menuToolTip.length()-MAX_SERVICE_DESC_LEN); + } + menu.setToolTipText(menuToolTip); + parentMenu.add(menu); + + // The following is to keep track of nested menu parents, which + // you can't do directly in Swing (see + // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4103931) + while(service2submenu.containsKey(parentMenu)){ + parentMenu = (JMenu) service2submenu.get(parentMenu); + } + + // All menus, no matter how nested, point to top submenu that corresponds to the data object + service2submenu.put(menu, parentMenu); + + return menu; + } + public JMenu createObjectSubMenu(MobyDataInstance mdi){ if(!(mdi instanceof MobyPrimaryData)){ logger.warn("Ignoring non-primary data object submitted to menu creation: " + mdi); From gordonp at dev.open-bio.org Fri Oct 27 16:11:01 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 27 Oct 2006 16:11:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610272011.k9RKB1XB023774@dev.open-bio.org> gordonp Fri Oct 27 16:11:01 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv23739/src/main/ca/ucalgary/seahawk/gui Modified Files: MobyServicesGUI.java Log Message: Improvements to popup-menu hierarchy when there are many, many service options moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyServicesGUI.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/10/27 20:00:35 1.3 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/10/27 20:11:01 1.4 @@ -22,7 +22,7 @@ public final static String SERVICE_SUBMENU_NAME = "seahawkPopupSubMenuName"; // After this many, subdivide the services for an object into sublists based of service ontology - public final static int MAX_SERVICES_PER_SUBMENU = 20; + public final static int MAX_SERVICES_PER_SUBMENU = 12; public final static int MAX_SERVICE_DESC_LEN = 100; public final static String CLIPBOARD_CMD = "clipboard"; /** Always spring MOBY response in a new window if this modifier is present for a click */ From gordonp at dev.open-bio.org Fri Oct 27 16:11:01 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 27 Oct 2006 16:11:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610272011.k9RKB1va023794@dev.open-bio.org> gordonp Fri Oct 27 16:11:01 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util In directory dev.open-bio.org:/tmp/cvs-serv23739/src/main/ca/ucalgary/seahawk/util Modified Files: MobyUtils.java Log Message: Improvements to popup-menu hierarchy when there are many, many service options moby-live/Java/src/main/ca/ucalgary/seahawk/util MobyUtils.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2006/10/27 20:00:35 1.3 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2006/10/27 20:11:01 1.4 @@ -11,7 +11,7 @@ import javax.swing.JLabel; public class MobyUtils{ - public static final int MAX_OBJ_NAME_LEN = 12; + public static final int MAX_OBJ_NAME_LEN = 18; private static MobyContentGUI mobyContentGUI = null; private static MobyServicesGUI mobyServicesGUI = null; From gordonp at dev.open-bio.org Fri Oct 27 16:55:14 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 27 Oct 2006 16:55:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610272055.k9RKtEgq023949@dev.open-bio.org> gordonp Fri Oct 27 16:55:14 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv23914/src/main/ca/ucalgary/seahawk/gui Modified Files: MobyServicesGUI.java Log Message: Handle long tooltips better now, using multiline HTML rather than truncating moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyServicesGUI.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/10/27 20:11:01 1.4 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/10/27 20:55:14 1.5 @@ -23,7 +23,7 @@ // After this many, subdivide the services for an object into sublists based of service ontology public final static int MAX_SERVICES_PER_SUBMENU = 12; - public final static int MAX_SERVICE_DESC_LEN = 100; + public final static int MAX_SERVICE_DESC_LEN = 50; public final static String CLIPBOARD_CMD = "clipboard"; /** Always spring MOBY response in a new window if this modifier is present for a click */ public final static int USE_DEFAULT_HANDLER_MASK = ActionEvent.SHIFT_MASK; @@ -928,8 +928,8 @@ String serviceDesc = service.getDescription(); String serviceAuthority = service.getAuthority(); if(serviceDesc != null && serviceDesc.length() > 0){ - if(serviceDesc.length() > MAX_SERVICE_DESC_LEN+3){ - serviceDesc = serviceDesc.substring(0, MAX_SERVICE_DESC_LEN) + "..."; + if(serviceDesc.length() > MAX_SERVICE_DESC_LEN){ + serviceDesc = htmlifyToolTipText(serviceDesc); } sdesc = serviceDesc; } @@ -974,7 +974,7 @@ String menuToolTip = commonAncestorDesc + type.getDescription(); if(menuToolTip.length() > MAX_SERVICE_DESC_LEN){ // Cut down really long ancestry descs to the last part (most precise) - menuToolTip = "..." + menuToolTip.substring(menuToolTip.length()-MAX_SERVICE_DESC_LEN); + menuToolTip = htmlifyToolTipText(menuToolTip); } menu.setToolTipText(menuToolTip); parentMenu.add(menu); @@ -1002,6 +1002,46 @@ } } + /** + * By turning the tool tip text into HTML, we can make it multiline + */ + protected String htmlifyToolTipText(String text){ + int maxLine = MAX_SERVICE_DESC_LEN; + StringBuffer result = null; + + while(true){ + result = new StringBuffer(""); + StringTokenizer st = new StringTokenizer(text, " \t\n"); + int lineCharCount = 0; + + if(st.hasMoreTokens()){ + result.append(st.nextToken()); + lineCharCount = result.length()-6; + } + while(st.hasMoreTokens()){ + String word = st.nextToken(); + if(lineCharCount != 0 && lineCharCount + word.length() >= maxLine){ + result.append("
        " + word); + lineCharCount = word.length(); + continue; + } + result.append(" " + word); + lineCharCount += word.length()+1; + + if(lineCharCount > maxLine){ //single word is bigger than preset width, redo layout + maxLine = lineCharCount; + break; + } + } + result.append(""); + if(!st.hasMoreTokens()){ //used up all the text, didn't break previous loop abnormally + break; + } + } //end layout block + + return result.toString(); + } + public JMenu addNameDivSubMenu(JMenu parentMenu, MobyService[] services){ if(services == null || services.length == 0){ return null; @@ -1044,7 +1084,7 @@ String menuToolTip = commonAncestorDesc + desc; if(menuToolTip.length() > MAX_SERVICE_DESC_LEN){ // Cut down really long ancestry descs to the last part (most precise) - menuToolTip = "..." + menuToolTip.substring(menuToolTip.length()-MAX_SERVICE_DESC_LEN); + menuToolTip = htmlifyToolTipText(menuToolTip); } menu.setToolTipText(menuToolTip); parentMenu.add(menu); From gordonp at dev.open-bio.org Sun Oct 29 10:26:55 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Sun, 29 Oct 2006 10:26:55 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200610291526.k9TFQtbw018754@dev.open-bio.org> gordonp Sun Oct 29 10:26:53 EST 2006 Update of /home/repository/moby/jars-archive/current In directory dev.open-bio.org:/tmp/cvs-serv18719 Modified Files: MobyServlet.war Log Message: Fixed manifest to have ServletTester as main-class. The mainfest got overwritten in the last update by mistake jars-archive/current MobyServlet.war,1.2,1.3 =================================================================== RCS file: /home/repository/moby/jars-archive/current/MobyServlet.war,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 Binary files /home/repository/moby/jars-archive/current/MobyServlet.war 2006/10/24 17:50:14 1.2 and /home/repository/moby/jars-archive/current/MobyServlet.war 2006/10/29 15:26:53 1.3 differ rcsdiff: /home/repository/moby/jars-archive/current/MobyServlet.war: diff failed From gordonp at dev.open-bio.org Mon Oct 30 10:49:39 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 30 Oct 2006 10:49:39 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200610301549.k9UFnde3025206@dev.open-bio.org> gordonp Mon Oct 30 10:49:38 EST 2006 Update of /home/repository/moby/jars-archive/current In directory dev.open-bio.org:/tmp/cvs-serv25171 Modified Files: MobyServlet.war Log Message: Updates to fix issue with registering services taking Collections (which didn't support data types due to a quirk in MobyPrimaryDataSet's implementation) jars-archive/current MobyServlet.war,1.3,1.4 =================================================================== RCS file: /home/repository/moby/jars-archive/current/MobyServlet.war,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 Binary files /home/repository/moby/jars-archive/current/MobyServlet.war 2006/10/29 15:26:53 1.3 and /home/repository/moby/jars-archive/current/MobyServlet.war 2006/10/30 15:49:37 1.4 differ rcsdiff: /home/repository/moby/jars-archive/current/MobyServlet.war: diff failed From gordonp at dev.open-bio.org Mon Oct 30 10:54:39 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 30 Oct 2006 10:54:39 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200610301554.k9UFsdWV025311@dev.open-bio.org> gordonp Mon Oct 30 10:54:39 EST 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv25276/main/org/biomoby/shared/data Modified Files: MobyDataObject.java Log Message: Checked for freak condition that no data type has been assigned to the object before printing moby-live/Java/src/main/org/biomoby/shared/data MobyDataObject.java,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.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/shared/data/MobyDataObject.java 2006/10/26 00:31:21 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java 2006/10/30 15:54:39 1.11 @@ -559,7 +559,15 @@ } // One-tag representation, since it doesn't have any CRIB or PIB to enclose - return "<" + getDataType().getName() +" " + getAttrXML() + "/>"; + if(getDataType() == null){ + // If the data type is null, there must be something wrong + // with fetching the ontology RDF from MOBY Central. At the very + // least, we know the thing must be an Object. + return ""; + } + else{ + return "<" + getDataType().getName() +" " + getAttrXML() + "/>"; + } } else{ // Override super because article name is not actually important to us From gordonp at dev.open-bio.org Mon Oct 30 10:55:36 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 30 Oct 2006 10:55:36 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200610301555.k9UFtaHJ025354@dev.open-bio.org> gordonp Mon Oct 30 10:55:36 EST 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv25319/main/org/biomoby/shared Modified Files: MobyPrimaryDataSet.java Log Message: Added support for declaring data type of set, even if no elements are present yet. If elements are added, the data type is changed moby-live/Java/src/main/org/biomoby/shared MobyPrimaryDataSet.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSet.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/MobyPrimaryDataSet.java 2006/07/07 04:12:40 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSet.java 2006/10/30 15:55:36 1.8 @@ -25,6 +25,7 @@ extends MobyPrimaryData { protected Vector elements = new Vector(); // elemenst are of type MobyPrimaryDataSimple + protected MobyDataType defaultDataType = new MobyDataType("Object"); /************************************************************************** * Default constructor. Other characteristics are empty - which is usually @@ -82,7 +83,7 @@ if (elements.size() > 0) return ((MobyPrimaryDataSimple)elements.firstElement()).getDataType(); else - return null; + return defaultDataType; } } @@ -92,6 +93,7 @@ * data type). *************************************************************************/ public void setDataType (MobyDataType dataType) { + defaultDataType = dataType; synchronized (elements) { for (Enumeration en = elements.elements(); en.hasMoreElements(); ) ((MobyPrimaryDataSimple)en.nextElement()).setDataType (dataType); @@ -170,6 +172,11 @@ for (Enumeration en = elements.elements(); en.hasMoreElements(); ) buf.append (((MobyPrimaryDataSimple)en.nextElement()).toXML()); } + else{ + MobyPrimaryDataSimple template = new MobyPrimaryDataSimple(); + template.setDataType(defaultDataType); + buf.append(template.toXML()); + } buf.append (""); buf.append ("\n"); return new String (buf); From gordonp at dev.open-bio.org Mon Oct 30 10:56:19 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 30 Oct 2006 10:56:19 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200610301556.k9UFuJsX025393@dev.open-bio.org> gordonp Mon Oct 30 10:56:19 EST 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util In directory dev.open-bio.org:/tmp/cvs-serv25362/main/ca/ucalgary/seahawk/util Added Files: MinJarMaker.java Log Message: Tool used to generate Seahawk standalone JAR moby-live/Java/src/main/ca/ucalgary/seahawk/util MinJarMaker.java,NONE,1.1 From gordonp at dev.open-bio.org Tue Oct 31 15:25:56 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 31 Oct 2006 15:25:56 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200610312025.k9VKPufQ029279@dev.open-bio.org> gordonp Tue Oct 31 15:25:55 EST 2006 Update of /home/repository/moby/moby-live/Java/src/Clients In directory dev.open-bio.org:/tmp/cvs-serv29244/src/Clients Modified Files: ServletTester.java Log Message: Better error reporting if the provided 'web.xml' file is not syntactically correct moby-live/Java/src/Clients ServletTester.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/ServletTester.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/ServletTester.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/ServletTester.java 2006/10/31 20:25:55 1.2 @@ -33,7 +33,7 @@ ServletTester tester = new ServletTester(); // Open the web.xml file to determine the service name and inputs/outputs. - java.net.URL webXmlURL = tester.getClass().getClassLoader().getResource("WEB-INF/web.xml"); + java.net.URL webXmlURL = tester.getClass().getClassLoader().getResource("WEB-INF/web.xml"); if(webXmlURL == null){ System.err.println("Could not find \"WEB-INF/web.xml\", aborting!"); System.exit(1); @@ -48,10 +48,18 @@ dbf.setNamespaceAware(false); DocumentBuilder docBuilder = dbf.newDocumentBuilder(); - Element docRoot = docBuilder.parse(webXmlURL.openStream()).getDocumentElement(); - if(docRoot == null || !docRoot.getNodeName().equals("web-app")){ - System.err.println("Could not find /web-app tag in " + - webXmlURL + ", aborting!"); + Element docRoot = null; + try{ + docRoot = docBuilder.parse(webXmlURL.openStream()).getDocumentElement(); + if(docRoot == null || !docRoot.getNodeName().equals("web-app")){ + System.err.println("Could not find /web-app tag in " + + webXmlURL + ", aborting!"); + System.exit(1); + } + } catch(Exception e){ + System.err.println("There appears to be a problem with the \"WEB-INF/web.xml\" file (XML syntax?)." + + "While parsing it I encountered the error: " + e); + e.printStackTrace(); System.exit(1); } Element servlet = getChildElement(docRoot, "servlet"); From gordonp at dev.open-bio.org Tue Oct 31 15:55:45 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 31 Oct 2006 15:55:45 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200610312055.k9VKtjgb029560@dev.open-bio.org> gordonp Tue Oct 31 15:55:45 EST 2006 Update of /home/repository/moby/jars-archive/current In directory dev.open-bio.org:/tmp/cvs-serv29525 Modified Files: MobyServlet.war Log Message: Better error reporting if the provided 'web.xml' file is not syntactically correctin test client jars-archive/current MobyServlet.war,1.4,1.5 =================================================================== RCS file: /home/repository/moby/jars-archive/current/MobyServlet.war,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 Binary files /home/repository/moby/jars-archive/current/MobyServlet.war 2006/10/30 15:49:37 1.4 and /home/repository/moby/jars-archive/current/MobyServlet.war 2006/10/31 20:55:44 1.5 differ rcsdiff: /home/repository/moby/jars-archive/current/MobyServlet.war: diff failed From senger at dev.open-bio.org Mon Oct 2 17:55:33 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:55:33 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021755.k92HtXrK025557@dev.open-bio.org> senger Mon Oct 2 13:55:32 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/meta In directory dev.open-bio.org:/tmp/cvs-serv25539/meta Log Message: Directory /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/meta added to the repository moby-live/Java/src/main/org/biomoby/registry/meta - New directory From senger at dev.open-bio.org Mon Oct 2 17:57:49 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:57:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021757.k92HvndN025613@dev.open-bio.org> senger Mon Oct 2 13:57:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv25596/docs Modified Files: ChangeLog Dashboard-dev.html Log Message: selectable registries in Dashboard moby-live/Java/docs ChangeLog,1.71,1.72 Dashboard-dev.html,1.2,1.3 From senger at dev.open-bio.org Mon Oct 2 17:57:49 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:57:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021757.k92Hvn5n025644@dev.open-bio.org> senger Mon Oct 2 13:57:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOBY/Cache In directory dev.open-bio.org:/tmp/cvs-serv25596/src/Perl/MOBY/Cache Modified Files: Registries.pm Log Message: selectable registries in Dashboard moby-live/Java/src/Perl/MOBY/Cache Registries.pm,1.2,1.3 From senger at dev.open-bio.org Mon Oct 2 17:57:49 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:57:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021757.k92HvnjV025701@dev.open-bio.org> senger Mon Oct 2 13:57:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/meta In directory dev.open-bio.org:/tmp/cvs-serv25596/src/main/org/biomoby/registry/meta Added Files: ExampleList.java Registries.java RegistriesList.java Registry.java Log Message: selectable registries in Dashboard moby-live/Java/src/main/org/biomoby/registry/meta ExampleList.java,NONE,1.1 Registries.java,NONE,1.1 RegistriesList.java,NONE,1.1 Registry.java,NONE,1.1 From senger at dev.open-bio.org Mon Oct 2 17:57:49 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:57:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021757.k92Hvnce025664@dev.open-bio.org> senger Mon Oct 2 13:57:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/META-INF/services In directory dev.open-bio.org:/tmp/cvs-serv25596/src/config/dashboard/META-INF/services Added Files: org.biomoby.registry.meta.Registries Log Message: selectable registries in Dashboard moby-live/Java/src/config/dashboard/META-INF/services org.biomoby.registry.meta.Registries,NONE,1.1 From senger at dev.open-bio.org Mon Oct 2 17:57:49 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:57:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021757.k92HvnIW025685@dev.open-bio.org> senger Mon Oct 2 13:57:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard In directory dev.open-bio.org:/tmp/cvs-serv25596/src/config/dashboard/org/biomoby/service/dashboard Modified Files: dashboard.txt Log Message: selectable registries in Dashboard moby-live/Java/src/config/dashboard/org/biomoby/service/dashboard dashboard.txt,1.3,1.4 From senger at dev.open-bio.org Mon Oct 2 17:57:49 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:57:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021757.k92HvneC025722@dev.open-bio.org> senger Mon Oct 2 13:57:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory dev.open-bio.org:/tmp/cvs-serv25596/src/main/org/biomoby/service/dashboard Modified Files: Dashboard.java DashboardProperties.java RegistryPanel.java Log Message: selectable registries in Dashboard moby-live/Java/src/main/org/biomoby/service/dashboard Dashboard.java,1.29,1.30 DashboardProperties.java,1.24,1.25 RegistryPanel.java,1.27,1.28 From senger at dev.open-bio.org Mon Oct 2 17:57:49 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:57:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021757.k92HvnXo025627@dev.open-bio.org> senger Mon Oct 2 13:57:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs/images In directory dev.open-bio.org:/tmp/cvs-serv25596/docs/images Added Files: regs-after.png regs-before.png Log Message: selectable registries in Dashboard moby-live/Java/docs/images regs-after.png,NONE,1.1 regs-before.png,NONE,1.1 From senger at dev.open-bio.org Mon Oct 2 17:57:49 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 13:57:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021757.k92HvneZ025739@dev.open-bio.org> senger Mon Oct 2 13:57:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/help In directory dev.open-bio.org:/tmp/cvs-serv25596/src/main/org/biomoby/service/dashboard/help Modified Files: RegistryPanel.html Log Message: selectable registries in Dashboard moby-live/Java/src/main/org/biomoby/service/dashboard/help RegistryPanel.html,1.2,1.3 From kawas at dev.open-bio.org Mon Oct 2 18:21:41 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 2 Oct 2006 14:21:41 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610021821.k92ILfVM026790@dev.open-bio.org> kawas Mon Oct 2 14:21:41 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv26758/Java/docs Modified Files: RDFAgent.html Log Message: modified the user documentation for the agent moby-live/Java/docs RDFAgent.html,1.3,1.4 From senger at dev.open-bio.org Mon Oct 2 21:12:45 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 17:12:45 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022112.k92LCj61027241@dev.open-bio.org> senger Mon Oct 2 17:12:45 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv27224/docs Modified Files: ChangeLog Dashboard.html Log Message: call rdf agent from dashboard moby-live/Java/docs ChangeLog,1.72,1.73 Dashboard.html,1.6,1.7 From senger at dev.open-bio.org Mon Oct 2 21:12:45 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 17:12:45 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022112.k92LCjeh027257@dev.open-bio.org> senger Mon Oct 2 17:12:45 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard In directory dev.open-bio.org:/tmp/cvs-serv27224/src/main/org/biomoby/service/dashboard Modified Files: RegistrationPanel.java RegistrationServiceSubPanel.java Log Message: call rdf agent from dashboard moby-live/Java/src/main/org/biomoby/service/dashboard RegistrationPanel.java,1.20,1.21 RegistrationServiceSubPanel.java,1.11,1.12 From senger at dev.open-bio.org Mon Oct 2 21:12:45 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 17:12:45 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022112.k92LCjcs027286@dev.open-bio.org> senger Mon Oct 2 17:12:45 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/images In directory dev.open-bio.org:/tmp/cvs-serv27224/src/main/org/biomoby/service/dashboard/images Added Files: smallAgent.gif smallAgent_dis.gif Log Message: call rdf agent from dashboard moby-live/Java/src/main/org/biomoby/service/dashboard/images smallAgent.gif,NONE,1.1 smallAgent_dis.gif,NONE,1.1 From senger at dev.open-bio.org Mon Oct 2 21:12:45 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Mon, 2 Oct 2006 17:12:45 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022112.k92LCjk7027272@dev.open-bio.org> senger Mon Oct 2 17:12:45 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/help In directory dev.open-bio.org:/tmp/cvs-serv27224/src/main/org/biomoby/service/dashboard/help Modified Files: RegistrationPanel.html Log Message: call rdf agent from dashboard moby-live/Java/src/main/org/biomoby/service/dashboard/help RegistrationPanel.html,1.3,1.4 From kawas at dev.open-bio.org Mon Oct 2 21:42:35 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 2 Oct 2006 17:42:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022142.k92LgZc2027445@dev.open-bio.org> kawas Mon Oct 2 17:42:35 EDT 2006 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv27413 Modified Files: Central.pm Log Message: made the call to system() array based moby-live/Perl/MOBY Central.pm,1.256,1.257 From mwilkinson at dev.open-bio.org Mon Oct 2 23:08:08 2006 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Mon, 2 Oct 2006 19:08:08 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022308.k92N88Ug028401@dev.open-bio.org> mwilkinson Mon Oct 2 19:08:08 EDT 2006 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv28385/MOBY/Client Modified Files: SimpleArticle.pm Log Message: nasty bug in MOBY::Client::SimpleArticle. It was shifting the namespace encapsulated array ref, instead of shifting a copied list. Probably shouldn't shift anyway, but... it wont destroy the namespace now just by looking at it moby-live/Perl/MOBY/Client SimpleArticle.pm,1.14,1.15 From kawas at dev.open-bio.org Mon Oct 2 23:19:26 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 2 Oct 2006 19:19:26 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022319.k92NJQer031181@dev.open-bio.org> kawas Mon Oct 2 19:19:26 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv31150/Java/docs Added Files: ConfigureRDFAgent.html Log Message: unfinished documentation on setting up your own RDF agent. moby-live/Java/docs ConfigureRDFAgent.html,NONE,1.1 From kawas at dev.open-bio.org Mon Oct 2 23:20:07 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 2 Oct 2006 19:20:07 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022320.k92NK7TR031281@dev.open-bio.org> kawas Mon Oct 2 19:20:07 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv31249/Java/docs Modified Files: RDFAgent.html Log Message: moby-live/Java/docs RDFAgent.html,1.4,1.5 From mwilkinson at dev.open-bio.org Mon Oct 2 23:31:20 2006 From: mwilkinson at dev.open-bio.org (Mark Wilkinson) Date: Mon, 2 Oct 2006 19:31:20 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610022331.k92NVKl3031435@dev.open-bio.org> mwilkinson Mon Oct 2 19:31:20 EDT 2006 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory dev.open-bio.org:/tmp/cvs-serv31419/MOBY/Client Modified Files: SimpleArticle.pm Log Message: decided it was better not to shift at all moby-live/Perl/MOBY/Client SimpleArticle.pm,1.15,1.16 From kawas at dev.open-bio.org Wed Oct 4 18:43:11 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Wed, 4 Oct 2006 14:43:11 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610041843.k94IhBW0009439@dev.open-bio.org> kawas Wed Oct 4 14:43:11 EDT 2006 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv9407 Modified Files: Central.pm Log Message: added some return values for the agent moby-live/Perl/MOBY Central.pm,1.257,1.258 From kawas at dev.open-bio.org Wed Oct 4 18:43:53 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Wed, 4 Oct 2006 14:43:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610041843.k94Ihr7v009495@dev.open-bio.org> kawas Wed Oct 4 14:43:53 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier In directory dev.open-bio.org:/tmp/cvs-serv9462/Java/src/main/org/biomoby/registry/rdfagent/verifier Modified Files: Processor.java Main.java Log Message: added some return values for the agent when invoked via the -url option moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier Processor.java,1.27,1.28 Main.java,1.18,1.19 From kawas at dev.open-bio.org Wed Oct 4 19:46:18 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Wed, 4 Oct 2006 15:46:18 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610041946.k94JkIn4009859@dev.open-bio.org> kawas Wed Oct 4 15:46:18 EDT 2006 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv9827 Modified Files: Central.pm Log Message: agent called a different way without shell scripts. moby-live/Perl/MOBY Central.pm,1.258,1.259 From kawas at dev.open-bio.org Thu Oct 5 15:17:34 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 5 Oct 2006 11:17:34 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610051517.k95FHYJI012473@dev.open-bio.org> kawas Thu Oct 5 11:17:33 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv12440/Java/docs Modified Files: ConfigureRDFAgent.html Log Message: moby-live/Java/docs ConfigureRDFAgent.html,1.1,1.2 From kawas at dev.open-bio.org Thu Oct 5 15:18:13 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 5 Oct 2006 11:18:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610051518.k95FIDgH012510@dev.open-bio.org> kawas Thu Oct 5 11:18:13 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv12478/Java/docs Modified Files: RDFAgent.html Log Message: moby-live/Java/docs RDFAgent.html,1.5,1.6 From kawas at dev.open-bio.org Thu Oct 5 15:32:47 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 5 Oct 2006 11:32:47 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610051532.k95FWl6a012550@dev.open-bio.org> kawas Thu Oct 5 11:32:47 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv12518/Java/docs Modified Files: ConfigureRDFAgent.html Log Message: moby-live/Java/docs ConfigureRDFAgent.html,1.2,1.3 From kawas at dev.open-bio.org Fri Oct 6 16:39:20 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 6 Oct 2006 12:39:20 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610061639.k96GdKBa016254@dev.open-bio.org> kawas Fri Oct 6 12:39:20 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util In directory dev.open-bio.org:/tmp/cvs-serv16222/Java/src/main/org/biomoby/registry/rdfagent/util Modified Files: SignatureURLConnection.java Log Message: moby-live/Java/src/main/org/biomoby/registry/rdfagent/util SignatureURLConnection.java,1.13,1.14 From kawas at dev.open-bio.org Fri Oct 6 17:42:57 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 6 Oct 2006 13:42:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610061742.k96HgvIn016380@dev.open-bio.org> kawas Fri Oct 6 13:42:57 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier In directory dev.open-bio.org:/tmp/cvs-serv16348/Java/src/main/org/biomoby/registry/rdfagent/verifier Modified Files: Processor.java Log Message: moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier Processor.java,1.28,1.29 From kawas at dev.open-bio.org Fri Oct 6 17:47:33 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 6 Oct 2006 13:47:33 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610061747.k96HlXXk016567@dev.open-bio.org> kawas Fri Oct 6 13:47:33 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier In directory dev.open-bio.org:/tmp/cvs-serv16535/Java/src/main/org/biomoby/registry/rdfagent/verifier Modified Files: Processor.java Log Message: moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier Processor.java,1.29,1.30 From kawas at dev.open-bio.org Fri Oct 6 17:51:50 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 6 Oct 2006 13:51:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610061751.k96Hpovl016643@dev.open-bio.org> kawas Fri Oct 6 13:51:50 EDT 2006 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv16611 Modified Files: Central.pm Log Message: added a more precise message when the agent is called on a url that used to exist but no longer does. moby-live/Perl/MOBY Central.pm,1.259,1.260 From kawas at dev.open-bio.org Fri Oct 6 21:38:06 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 6 Oct 2006 17:38:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610062138.k96Lc5ko016953@dev.open-bio.org> kawas Fri Oct 6 17:38:05 EDT 2006 Update of /home/repository/moby/jars-archive/current In directory dev.open-bio.org:/tmp/cvs-serv16922 Added Files: castor-0.9.5.jar Log Message: jars-archive/current castor-0.9.5.jar,NONE,1.1 From kawas at dev.open-bio.org Fri Oct 6 21:39:01 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Fri, 6 Oct 2006 17:39:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610062139.k96Ld17b017033@dev.open-bio.org> kawas Fri Oct 6 17:39:01 EDT 2006 Update of /home/repository/moby/jars-archive/current In directory dev.open-bio.org:/tmp/cvs-serv17002 Added Files: dnsjava-1.3.2.jar Log Message: jars-archive/current dnsjava-1.3.2.jar,NONE,1.1 From kawas at dev.open-bio.org Mon Oct 9 18:55:09 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 9 Oct 2006 14:55:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610091855.k99It9Ni020067@dev.open-bio.org> kawas Mon Oct 9 14:55:09 EDT 2006 Update of /home/repository/moby/moby-live/Java/xmls In directory dev.open-bio.org:/tmp/cvs-serv20032/Java/xmls Modified Files: libraries.xml Log Message: moby-live/Java/xmls libraries.xml,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/libraries.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Java/xmls/libraries.xml 2006/08/28 13:42:10 1.13 +++ /home/repository/moby/moby-live/Java/xmls/libraries.xml 2006/10/09 18:55:09 1.14 @@ -34,6 +34,10 @@ + + + + @@ -69,6 +73,9 @@ + + + @@ -151,6 +158,9 @@ + + + From kawas at dev.open-bio.org Tue Oct 10 14:02:12 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 10:02:12 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610101402.k9AE2CNQ022911@dev.open-bio.org> kawas Tue Oct 10 10:02:12 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory dev.open-bio.org:/tmp/cvs-serv22876/Java/docs/taverna/guide Modified Files: index.html Log Message: moby-live/Java/docs/taverna/guide index.html,1.12,1.13 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2006/08/21 19:47:17 1.12 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2006/10/10 14:02:12 1.13 @@ -2,37 +2,39 @@ "http://www.w3.org/TR/html4/loose.dtd"> + The 'new' BioMoby plugin For Taverna -

        How to use the BioMoby plugin in Taverna (Updated September 2006)

        +

        How to use the BioMoby plugin in Taverna (Updated October 2006)

        Table of Contents

        -
        Introduction
        -
        -
        -
        -New Features
        -
        -
        -
        -Tutorial
      8. Creating a BioMoby Scavenger
      9. -
      10. Creating a workflow
      11. -
      12. Obtaining information on a Moby Datatype
      13. -
      14. Obtaining information on a Moby Service
      15. -
      16. Using secondary parameters
      17. -
      18. Obtaining the 'data' from a Moby service
      19. -
        -What's Next - - -FAQ - - -Comments / Questions
        + +
          +
        1. Creating a BioMoby Scavenger
        2. +
        3. Creating a workflow
        4. +
        5. Obtaining information on a Moby Datatype
        6. +
        7. Obtaining information on a Moby Service
        8. +
        9. Using secondary parameters
        10. +
        11. Obtaining the 'data' from a Moby service
        12. +
          +
        +

        Introduction

        @@ -206,10 +208,10 @@
        • Find Services that Consume NCBI_BLAST_Text('blast') - brief search:
        • -
          Searches for all services that consume NCBI_BLAST_Text
          +
          Searches for all services that consume NCBI_BLAST_Text
        • Find Services that Consume NCBI_BLAST_Text('blast') - semantic search
        • -
          Searches for all services that either consume NCBI_BLAST_Text
          +	          
          Searches for all services that either consume NCBI_BLAST_Text
           or it parent datatype.
           For more infomation on this behaviour, click here.
        @@ -295,15 +297,15 @@
        There are 3 different types of output ports that Moby services utilize and 2 different types of input ports (excluding the legacy ports
        'input' and 'output'.
        -
        +        
                 Moby Service Output ----Connects to ---> Moby Service Input
                	
        -     	    1  Simple				   Simple
        - 2 Simple Collection
        - 3 Collection Simple
        - 4 Collection Collection
        - 5 CollectionAsSimples Simples
        - 6 CollectionAsSimples Collection
        + 1 Simple Simple + 2 Simple Collection + 3 Collection Simple + 4 Collection Collection + 5 CollectionAsSimples Simples + 6 CollectionAsSimples Collection
        A Simple is a datatype that is not contained within a collection, i.e. do not have a name that contains '(Collection -'.
        A CollectionAsSimples is an output port that contains a Taverna style List of the individuals in a Moby Collection.
        @@ -325,7 +327,7 @@
      20. Why do some services have have '_ANON_' or 'Collection - MobyCollection' in there name?

        These are names automatically generated for services that incorrectly registered with a Mobycentral registry.
        - You should attempt to contact the service provider so that they may fix this service.
        + You should attempt to contact the service provider so that they may fix and proplerly register these services.

      21. If all I want to do is run a Moby service, do I have to specify article names?
        @@ -346,8 +348,7 @@ email

        If you have any suggestions regarding new features or you would like to report a bug,
        please let me know.

        -

         

        -

         

        +
      22. From kawas at dev.open-bio.org Tue Oct 10 16:59:10 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 12:59:10 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610101659.k9AGxA5O023206@dev.open-bio.org> kawas Tue Oct 10 12:59:10 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory dev.open-bio.org:/tmp/cvs-serv23175/Java/docs/taverna/guide Added Files: favicon.ico animated_favicon1.gif Log Message: moby-live/Java/docs/taverna/guide favicon.ico,NONE,1.1 animated_favicon1.gif,NONE,1.1 From kawas at dev.open-bio.org Tue Oct 10 17:01:27 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 13:01:27 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610101701.k9AH1Rm1023251@dev.open-bio.org> kawas Tue Oct 10 13:01:26 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs/taverna/guide In directory dev.open-bio.org:/tmp/cvs-serv23216/Java/docs/taverna/guide Modified Files: index.html Log Message: moby-live/Java/docs/taverna/guide index.html,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2006/10/10 14:02:12 1.13 +++ /home/repository/moby/moby-live/Java/docs/taverna/guide/index.html 2006/10/10 17:01:26 1.14 @@ -3,6 +3,8 @@ + + The 'new' BioMoby plugin For Taverna From kawas at dev.open-bio.org Tue Oct 10 18:51:50 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 14:51:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610101851.k9AIporj024682@dev.open-bio.org> kawas Tue Oct 10 14:51:50 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv24651/Java/docs Added Files: RegistryServlets.html Log Message: unfinished guide for installing the servlets required to host a registry. moby-live/Java/docs RegistryServlets.html,NONE,1.1 From kawas at dev.open-bio.org Wed Oct 11 01:54:50 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 21:54:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610110154.k9B1sowp025328@dev.open-bio.org> kawas Tue Oct 10 21:54:50 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties In directory dev.open-bio.org:/tmp/cvs-serv25229/Java/src/main/org/biomoby/registry/properties Modified Files: WindowsNT.java Windows.java UNIX.java RegistryOS.java MobyProperties.java MobyCentralConfig.java Log Message: moby-live/Java/src/main/org/biomoby/registry/properties WindowsNT.java,1.2,1.3 Windows.java,1.1,1.2 UNIX.java,1.1,1.2 RegistryOS.java,1.1,1.2 MobyProperties.java,1.4,1.5 MobyCentralConfig.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/WindowsNT.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/registry/properties/WindowsNT.java 2006/04/20 15:10:44 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/WindowsNT.java 2006/10/11 01:54:50 1.3 @@ -12,6 +12,7 @@ * * @author Eddie created Nov 28, 2005 */ + at SuppressWarnings("unchecked") public class WindowsNT implements Environment { /** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/Windows.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/registry/properties/Windows.java 2005/11/29 23:06:24 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/Windows.java 2006/10/11 01:54:50 1.2 @@ -12,6 +12,7 @@ * * @author Eddie created Nov 28, 2005 */ + at SuppressWarnings("unchecked") public class Windows implements Environment { /** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/UNIX.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/registry/properties/UNIX.java 2005/11/29 23:06:24 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/UNIX.java 2006/10/11 01:54:50 1.2 @@ -12,6 +12,7 @@ * * @author Eddie created Nov 28, 2005 */ + at SuppressWarnings("unchecked") public class UNIX implements Environment { /** * the singleton =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/RegistryOS.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/registry/properties/RegistryOS.java 2005/11/29 23:06:24 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/RegistryOS.java 2006/10/11 01:54:50 1.2 @@ -48,6 +48,7 @@ * * @author Eddie created Nov 28, 2005 */ + at SuppressWarnings("unchecked") public class RegistryOS { // factory pattern private static java.util.HashMap storage = new java.util.HashMap(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/MobyProperties.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/registry/properties/MobyProperties.java 2006/01/03 19:25:59 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/MobyProperties.java 2006/10/11 01:54:50 1.5 @@ -42,6 +42,7 @@ *

        For questions, comments, or bugs *

        email me at edward.kawas at gmail.com */ + at SuppressWarnings("unchecked") public class MobyProperties { private static Properties properties = new Properties(); @@ -53,15 +54,17 @@ * @return A Properties object with either the properties obtained from the environment or an empty map. */ public final static Properties PROPERTIES() { - Map map = RegistryOS.getEnv(); - // + Map map = new HashMap(); + // if (System.getProperty("MOBY_CENTRAL_CONFIG") != null && !System.getProperty("MOBY_CENTRAL_CONFIG").equals("")) map.put("MOBY_CENTRAL_CONFIG" , System.getProperty("MOBY_CENTRAL_CONFIG")); if (System.getProperty("MOBY_SERVER") != null && !System.getProperty("MOBY_SERVER").equals("")) map.put("MOBY_SERVER" , System.getProperty("MOBY_SERVER")); if (System.getProperty("MOBY_URI") != null && !System.getProperty("MOBY_URI").equals("")) map.put("MOBY_URI" , System.getProperty("MOBY_URI")); - properties.putAll(map); + // did we fail to populate the map? + if (map.isEmpty()) + properties.putAll(RegistryOS.getEnv()); return properties; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/MobyCentralConfig.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/registry/properties/MobyCentralConfig.java 2005/12/02 20:40:18 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/properties/MobyCentralConfig.java 2006/10/11 01:54:50 1.5 @@ -15,6 +15,9 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.biomoby.shared.MobyException; /** @@ -25,12 +28,15 @@ *

        For questions, comments, or bugs *

        email me at edward.kawas at gmail.com */ + at SuppressWarnings("unchecked") public class MobyCentralConfig { - private final static String location = MobyProperties.PROPERTIES().getProperty("MOBY_CENTRAL_CONFIG"); //use the environment variables you set with your own registry + private static Log log = LogFactory.getLog(MobyCentralConfig.class); + + private final static String location = getLocation(); private final static String regexp = "^(\\w+)\\s*=\\s*(.*)$"; - + /** * A method that retrieves the mySQL connection details for the database mobycentral. *

        PRE: The property config is specified and configured correctly in the file biomoby.properties. @@ -45,7 +51,19 @@ return map; } - /** + private static String getLocation() { + if (System.getProperty("MOBY_CENTRAL_CONFIG")==null) { + log.debug("getting MOBY_CENTRAL_CONFIG using MobyProperties()"); + return MobyProperties.PROPERTIES().getProperty("MOBY_CENTRAL_CONFIG"); + } + else { + // use the environment variables you set with your own registry + log.debug("getting MOBY_CENTRAL_CONFIG using System.getProperty()"); + return System.getProperty("MOBY_CENTRAL_CONFIG"); + } + } + + /** * A method that retrieves the mySQL connection details for the database mobynamespace. *

        PRE: The property config is specified and configured correctly in the file biomoby.properties. *

        POST: Map consists of the mySQL connection information for the database mobynamespace or MobyException is thrown. @@ -105,9 +123,8 @@ throws MobyException { if (location == null) throw new MobyException( - "Error - " - + location - + " environment variable found. Make sure that MOBY_CENTRAL_CONFIG is set correctly in the environment"); + "Error - MOBY_CENTRAL_CONFIG == null;" + + " Make sure that MOBY_CENTRAL_CONFIG is set correctly in the environment"); File file = new File(location); BufferedReader br = null; try { From kawas at dev.open-bio.org Wed Oct 11 01:54:50 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 21:54:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610110154.k9B1sox4025288@dev.open-bio.org> kawas Tue Oct 10 21:54:50 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms In directory dev.open-bio.org:/tmp/cvs-serv25229/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms Modified Files: Lsid_resolver.java CallableServicesServlet.java GetSignatureRDFResponse.java GetSignatureRDFForm.java RDFAgentValidator.java LSID_ResolverClient.java LSIDComplete.java Added Files: GetServiceRDF.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms GetServiceRDF.java,NONE,1.1 Lsid_resolver.java,1.3,1.4 CallableServicesServlet.java,1.2,1.3 GetSignatureRDFResponse.java,1.8,1.9 GetSignatureRDFForm.java,1.4,1.5 RDFAgentValidator.java,1.2,1.3 LSID_ResolverClient.java,1.1,1.2 LSIDComplete.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/Lsid_resolver.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/Lsid_resolver.java 2006/05/24 18:48:31 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/Lsid_resolver.java 2006/10/11 01:54:50 1.4 @@ -93,21 +93,21 @@ String str = resolveLSID(lsid_to_use, "soap"); return str; } catch (MobyException e) { - e.printStackTrace(); + log.debug("Couldn't resolve " + lsid_to_use + " to metadata using SOAP."); } try { String str = resolveLSID(lsid_to_use, "http"); return str; } catch (MobyException e) { - e.printStackTrace(); + log.debug("Couldn't resolve " + lsid_to_use + " to metadata using HTTP."); } try { String str = resolveLSID(lsid_to_use, "ftp"); return str; } catch (MobyException e) { - e.printStackTrace(); + log.debug("Couldn't resolve " + lsid_to_use + " to metadata using FTP."); } - return "Couldn't resolve your lsid. I tried the protocols SOAP, HTTP, and FTP. If we are missing one, let us know."; + return "Couldn't resolve your lsid to metadata (perhaps there is none?). I tried the protocols SOAP, HTTP, and FTP. If we are missing one, let us know."; } /** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/CallableServicesServlet.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/forms/CallableServicesServlet.java 2006/08/30 23:15:17 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/CallableServicesServlet.java 2006/10/11 01:54:50 1.3 @@ -18,16 +18,18 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.discovery.tools.DiscoverSingleton; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.biomoby.client.CentralImpl; +import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; import org.biomoby.client.ui.graphical.servlet.utilities.ServiceTester; import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; /** - * @author Eddie Kawas - * This class was created to call out to all registered services and see which ones are alive. + * @author Eddie Kawas This class was created to call out to all registered + * services and see which ones are alive. */ public class CallableServicesServlet extends HttpServlet { @@ -45,13 +47,27 @@ public void init(ServletConfig arg0) throws ServletException { super.init(arg0); + + ContextLoader cLoader = null; + try { + cLoader = (ContextLoader) DiscoverSingleton.find(Class + .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( + (String) ContextLoader.class.getCanonicalName()).getName()); + log + .warn((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" + : "ContextLoader has loaded successfully.")); + } catch (Exception e) { + log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" + + System.getProperty("line.separator") + e.getStackTrace()); + } + log.info("initializing CallableServiceServlet"); scheduler = new ServiceTesterRunner(); Timer timer = new Timer(); Calendar calendar = Calendar.getInstance(); Date time = calendar.getTime(); log.info("Scheduling on going task."); - timer.scheduleAtFixedRate(scheduler, time, 1000 * 60 * 60 ); + timer.scheduleAtFixedRate(scheduler, time, 1000 * 60 * 60); } /* @@ -156,7 +172,11 @@ public ServiceTesterRunner() { try { // TODO make this generic so that others can use it - t = new ServiceTester(CentralImpl.DEFAULT_ENDPOINT, CentralImpl.DEFAULT_NAMESPACE); + t = new ServiceTester( + System.getProperty("MOBY_SERVER") == null ? CentralImpl.DEFAULT_ENDPOINT + : System.getProperty("MOBY_SERVER"), + System.getProperty("MOBY_URI") == null ? CentralImpl.DEFAULT_NAMESPACE + : System.getProperty("MOBY_URI")); } catch (MobyException e) { log.error("Couldn't instantiate a ServiceTester object", e); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFResponse.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/client/ui/graphical/servlet/forms/GetSignatureRDFResponse.java 2006/08/30 16:55:02 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFResponse.java 2006/10/11 01:54:50 1.9 @@ -1,20 +1,27 @@ package org.biomoby.client.ui.graphical.servlet.forms; -import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.MalformedURLException; import java.net.URL; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Properties; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.sql.DataSource; +import org.apache.commons.dbcp.BasicDataSource; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.biomoby.client.rdf.builder.ServiceInstanceRDF; +import org.biomoby.registry.properties.MobyProperties; + +import java.sql.Connection; /* * Created on Jan 14, 2005

        @@ -38,7 +45,9 @@ final private String newline = System.getProperty("line.separator"); - final static private String error = "" + System.getProperty("line.separator") + "" + private String SERVER_NAME = ""; + final static private String getErrorString() { + return "" + System.getProperty("line.separator") + "" + "" + System.getProperty("line.separator") + "" + "" + System.getProperty("line.separator") + "" + "Please Try Again" + System.getProperty("line.separator") + "" @@ -48,11 +57,13 @@ + "

        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") + "" + + "

        Back

        " + System.getProperty("line.separator") + "" + "
        " + System.getProperty("line.separator") + "" + "" + System.getProperty("line.separator") + "" + ""; + } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + SERVER_NAME = request.getServerName(); String domain = filter(request.getParameter("domain")); String serviceName = filter(request.getParameter("serviceName")); String sigURL = filter(request.getParameter("sigURL")); @@ -71,7 +82,7 @@ if (sigURL.equals("") || !isValidSig(sigURL)) { response.setContentType("text/html"); PrintWriter out = response.getWriter(); - out.println(error); + out.println(getErrorString()); return; } @@ -81,7 +92,7 @@ // update failed response.setContentType("text/html"); PrintWriter out = response.getWriter(); - out.println(error); + out.println(getErrorString()); return; } /*get the rdf*/ @@ -104,31 +115,112 @@ return; } - /* - * TODO you need place the updateSignatureURL in the cgi-bin directory - */ private boolean updateMobyCentralDatabase(String domain, String sigURL, String name) throws MalformedURLException { String con; if (name.equals("")) { - log.info("empty name"); - con = "http://mobycentral.icapture.ubc.ca/cgi-bin/updateSignatureURL.cgi?authURI=" - + domain + "&URL=" + sigURL; + log.info("Updating all services for " + domain + "."); + String sql = "select authority_id from authority where authority_uri=?"; + String updateSQL = "update service_instance set signatureURL = ? where authority_id=?"; + int authID = -1; + PreparedStatement preparedStatement = null; + try { + preparedStatement = getConnection().prepareStatement(sql); + preparedStatement.setString(1,domain); + ResultSet results = preparedStatement.executeQuery(); + if (results.next()) + authID = results.getInt(1); + else { + // clean up and return + if (preparedStatement != null) + preparedStatement.close(); + return false; + } + } catch (SQLException e) { + log.error(e.getLocalizedMessage()); + return false; + } finally { + try { + if (preparedStatement != null) + preparedStatement.close(); + } catch (SQLException e) { + return false; + } + } + + preparedStatement = null; + int updatedRowCount = -1; + try { + preparedStatement = getConnection().prepareStatement(updateSQL); + preparedStatement.setString(1,sigURL); + preparedStatement.setInt(2, authID); + updatedRowCount = preparedStatement.executeUpdate(); + return updatedRowCount > -1; + } catch (SQLException e) { + log.error(e.getLocalizedMessage()); + return updatedRowCount > -1; + } finally { + try { + if (preparedStatement != null) + preparedStatement.close(); + } catch (SQLException e) { + return updatedRowCount > -1; + } + } } else { - con = "http://mobycentral.icapture.ubc.ca/cgi-bin/updateSignatureURL.cgi?authURI=" - + domain + "&URL=" + sigURL + "&serviceName=" + name; + // update 1 service + log.info("Updating the service, " + name+ ", for " + domain + "."); + String sql = "select authority_id from authority where authority_uri=?"; + String updateSQL = "update service_instance set signatureURL = ? where authority_id= ? and servicename= ?"; + int authID = -1; + PreparedStatement preparedStatement = null; + try { + preparedStatement = getConnection().prepareStatement(sql); + preparedStatement.setString(1,domain); + ResultSet results = preparedStatement.executeQuery(); + if (results.next()) + authID = results.getInt(1); + else { + // clean up and return + if (preparedStatement != null) + preparedStatement.close(); + return false; + } + } catch (SQLException e) { + log.error(e.getLocalizedMessage()); + return false; + } finally { + try { + if (preparedStatement != null) + preparedStatement.close(); + } catch (SQLException e) { + return false; + } + } + + preparedStatement = null; + int updatedRowCount = -1; + try { + preparedStatement = getConnection().prepareStatement(updateSQL); + preparedStatement.setString(1,sigURL); + preparedStatement.setInt(2, authID); + preparedStatement.setString(3,name); + updatedRowCount = preparedStatement.executeUpdate(); + return updatedRowCount == 1; + } catch (SQLException e) { + log.error(e.getLocalizedMessage()); + return updatedRowCount == 1; + } finally { + try { + if (preparedStatement != null) + preparedStatement.close(); + } catch (SQLException e) { + return updatedRowCount == 1; + } + } + } - URL url = new URL(con); - try { - BufferedReader in = new BufferedReader(new InputStreamReader(url - .openStream())); - if (in.readLine().equals("good")) { - return true; - } - } catch (IOException ex) {} - return false; - } /** @@ -138,19 +230,55 @@ * @return */ private boolean isValidSig(String sigURL) { - /*final String URL = "(^(http:\\/\\/www\\.|HTTP:\\/\\/www\\.|http:\\/\\/|HTTP:\\/\\/)[\\w]+\\.[\\w].*(\\/\\w+(\\.{1}\\w+)*)$)"; - Pattern p = Pattern.compile(URL); - Matcher m = p.matcher(sigURL); - return m.matches();*/ + try { URL url = new URL(sigURL); return true; } catch (MalformedURLException e) { - return false; } } + private Connection connection = null; + private DataSource datasource = null; + private Properties props = MobyProperties.SERVICE_INSTANCE_PROPERTIES();; + + private Connection getConnection() { + if (this.datasource == null) { + // get certain properties from mobycentral.config + String serverName = props.get("url") + ":" + props.get("port");// localhost:3306"; + String mydatabase = (String) props.get("dbname");// "mobyobject"; + String url = "jdbc:mysql://" + serverName + "/" + mydatabase; + String username = (String) props.get("username");// "moby_external"; + String password = (String) props.get("password");// ""; + DataSource datasource = setupDataSource(url, username, password); + this.datasource = datasource; + } + try { + return this.datasource.getConnection(); + } catch (SQLException e) { + log.error("Error getting connection to db..." + newline + e); + return null; + } + + } + + private DataSource setupDataSource(String connectURI, String user, String pass) { + BasicDataSource ds = new BasicDataSource(); + try { + ds.setLoginTimeout(30); + } catch (SQLException e) { + log.equals("Couldn't set login timeout " + e.getLocalizedMessage()); + } + ds.setMaxWait(1000 * 60*5); + ds.setTimeBetweenEvictionRunsMillis(1000 * 60 * 5); + ds.setDriverClassName("com.mysql.jdbc.Driver"); + ds.setUsername(user); + ds.setPassword(pass); + ds.setUrl(connectURI); + return ds; + } + private static String filter(String input) { if (input == null) return null; @@ -172,4 +300,9 @@ } return (filtered.toString()); } + + public static void main(String[] args) throws MalformedURLException { + GetSignatureRDFResponse g = new GetSignatureRDFResponse(); + System.out.println(g.updateMobyCentralDatabase("blah.blah.bah", "http://www.eddie.com/signatureURLs","Echo_test2")); + } } \ No newline at end of file =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFForm.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/ui/graphical/servlet/forms/GetSignatureRDFForm.java 2005/09/30 14:48:22 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/GetSignatureRDFForm.java 2006/10/11 01:54:50 1.5 @@ -7,178 +7,225 @@ import java.io.IOException; import java.io.PrintWriter; import java.util.Arrays; +import java.util.Map; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.discovery.tools.DiscoverSingleton; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.biomoby.client.CentralImpl; +import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; +import org.biomoby.registry.properties.RegistryOS; import org.biomoby.shared.Central; import org.biomoby.shared.MobyException; +import org.biomoby.shared.Utils; /** * @author Eddie Kawas - *

        Created for - *

        This class was created to ... - *

        For questions, comments, or bugs - *

        email me at edward.kawas at gmail.com + *

        + * Created for + *

        + * This class was created to ... + *

        + * For questions, comments, or bugs + *

        + * email me at edward.kawas at gmail.com */ public class GetSignatureRDFForm extends HttpServlet { - /** - * - */ - private static final long serialVersionUID = 1L; - - // some useful variables - private final String newline = System.getProperty("line.separator"); - - 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) - */ - protected void doGet(HttpServletRequest request, - HttpServletResponse response) throws ServletException, IOException { - // set the content type - response.setContentType("text/html"); - PrintWriter out = response.getWriter(); - - // get a list of domains - Central central = null; - String[] domains = null; - // initialize central - try { - //TODO - enter the endpoint here - central = new CentralImpl(); - domains = central.getProviders(); - } catch (MobyException e) { - out.println("Please try again later."); - return; - } - // sort the array - Arrays.sort(domains); - StringBuffer sb = new StringBuffer(""); - for (int x = 0; x < domains.length; x++) { - sb.append("\t\t" + newline); - } - - String page = "" - + newline - + "" - + newline - + "" - + newline - + " Retrieve Your RDF Document" - + newline - + "" - + newline - + "" - + newline - + "" - + newline - + "

        Retrieve an Updated RDF Document
        " - + newline - + "for your MOBY Service Instance(s)

        " - + newline - + "

         

        " - + newline - + "

        This form will allow you to retrieve an updated version of the RDF
        " - + newline - + " document for MOBY Service Instances that you have created. In
        " - + newline - + "addition, you will be able to update the signature url field for your service instance.

        " - + newline - + "
        " - + newline - + "

        Your Domain:" - + newline - + " " - + newline - + " *required
        " - + newline - + " This field is required!

        " - + newline - + "


        " - + newline - + " Service Instance Name:" - + newline - + " " - + newline - + " *optional*
        " - + newline - + " If this field is left blank then an RDF document containing" - + newline - + " all of the
        " - + newline - + " service instances created by the selected domain will be returned.

        " - + newline - + "


        " - + newline - + " Your Signature URL:" - + newline - + " " - + newline - + " *required
        " - + newline - + " This field indicates the URL from which the RDF that you are about " - + newline - + "to receive can be retrieved at a later date (i.e. the place where you" - + newline - + "are going to save the output of this script)

        " - + newline + "
         
        " + newline - + "

        " + newline + "

        " - + newline + "" + newline + "" + newline - + "" + newline; - - out.println(page); - return; - } - - /* (non-Javadoc) - * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) - */ - protected void doPost(HttpServletRequest arg0, HttpServletResponse arg1) - throws ServletException, IOException { - doGet(arg0, arg1); - } - - public static void main(String[] args) { - Central central = null; - String[] domains = null; - // initialize central - try { - central = new CentralImpl(); - domains = central.getProviders(); - } catch (MobyException e) { - e.printStackTrace(); - return; - } - // sort the array - Arrays.sort(domains); - StringBuffer sb = new StringBuffer(""); - for (int x = 0; x < domains.length; x++) { - sb.append("\t\t\n"); - } - System.out.println(sb.toString()); - } + private static Log log = LogFactory.getLog(GetSignatureRDFForm.class); + + /** + * + */ + private static final long serialVersionUID = 1L; + + // some useful variables + private final String newline = System.getProperty("line.separator"); + + private static String DOMAIN = "mobycentral.icapture.ubc.ca:8090/moby/"; + + /* + * (non-Javadoc) + * + * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, + * javax.servlet.http.HttpServletResponse) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + DOMAIN = request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + + "/"; + + // set the content type + response.setContentType("text/html"); + PrintWriter out = response.getWriter(); + + // get a list of domains + Central central = null; + String[] domains = null; + // initialize central + try { + String registryURL = null; + String registryNamespace = null; + + // are they set in the system? + registryURL = System.getProperty("MOBY_SERVER"); + registryNamespace = System.getProperty("MOBY_URI"); + + // if we didnt set them check the environment + if (registryURL == null) { + Map map = RegistryOS.getEnv(); + if (!map.isEmpty()) { + registryURL = (String) map.get("MOBY_SERVER"); + registryNamespace = (String) map.get("MOBY_URI"); + } + } + + log.info("Retrieving providers from URL: " + + (registryURL == null ? CentralImpl.DEFAULT_ENDPOINT : registryURL) + + " URI: " + + (registryNamespace == null ? CentralImpl.DEFAULT_NAMESPACE + : registryNamespace)); + if (registryURL == null) { + // use default registry, since we dont have a local one + central = new CentralImpl(); + } else if (registryNamespace == null) { + // use default namespace since one isnt defined + central = new CentralImpl(registryURL); + } else { + // use defined url and namespacce + central = new CentralImpl(registryURL, registryNamespace); + } + domains = central.getProviders(); + } catch (MobyException e) { + out.println("Please try again later."); + log.error(Utils.format(newline+"There was a problem extracting all of the providers:"+newline+e.getLocalizedMessage(), 3), e); + return; + } + // sort the array + Arrays.sort(domains); + StringBuffer sb = new StringBuffer(""); + for (int x = 0; x < domains.length; x++) { + sb.append("\t\t" + newline); + } + + String page = "" + + newline + + "" + + newline + + "" + + newline + + " Retrieve Your RDF Document" + + newline + + "" + + newline + + "" + + newline + + "" + + newline + + "

        Retrieve an Updated RDF Document
        " + + newline + + "for your MOBY Service Instance(s)

        " + + newline + + "

         

        " + + newline + + "

        This form will allow you to retrieve an updated version of the RDF
        " + + newline + + " document for MOBY Service Instances that you have created. In
        " + + newline + + "addition, you will be able to update the signature url field for your service instance.

        " + + newline + + "
        " + + newline + + "

        Your Domain:" + + newline + + " " + + newline + + " *required
        " + + newline + + " This field is required!

        " + + newline + + "


        " + + newline + + " Service Instance Name:" + + newline + + " " + + newline + + " *optional*
        " + + newline + + " If this field is left blank then an RDF document containing" + + newline + + " all of the
        " + + newline + + " service instances created by the selected domain will be returned.

        " + + newline + + "


        " + + newline + + " Your Signature URL:" + + newline + + " " + + newline + + " *required
        " + + newline + + " This field indicates the URL from which the RDF that you are about " + + newline + "to receive can be retrieved at a later date (i.e. the place where you" + + newline + "are going to save the output of this script)

        " + + newline + "
         
        " + newline + + "

        " + newline + "

        " + newline + + "" + newline + "" + newline + "" + newline; + + out.println(page); + return; + } + + @Override + public void init() throws ServletException { + super.init(); + ContextLoader cLoader = null; + try { + cLoader = (ContextLoader) DiscoverSingleton.find(Class + .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( + (String) ContextLoader.class.getCanonicalName()).getName()); + log + .info((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" + : "ContextLoader has loaded successfully.")); + } catch (Exception e) { + log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" + + System.getProperty("line.separator") + e.getMessage()); + } + } + + /* + * (non-Javadoc) + * + * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, + * javax.servlet.http.HttpServletResponse) + */ + protected void doPost(HttpServletRequest arg0, HttpServletResponse arg1) + throws ServletException, IOException { + doGet(arg0, arg1); + } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/RDFAgentValidator.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/forms/RDFAgentValidator.java 2006/05/24 18:48:31 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/RDFAgentValidator.java 2006/10/11 01:54:50 1.3 @@ -7,17 +7,16 @@ import java.net.URLDecoder; import java.util.Properties; -import javax.naming.Context; -import javax.naming.InitialContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.discovery.tools.DiscoverSingleton; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; import org.biomoby.registry.properties.MobyProperties; -import org.biomoby.registry.rdfagent.verifier.Main; /* * Created on Jan 14, 2005

        @@ -46,44 +45,17 @@ public final void init() throws ServletException { // super.init(); - // try to load environment variables set in context.xml + ContextLoader cLoader = null; try { - Context c = new InitialContext(); - - try { - String MOBY_CENTRAL_CONFIG = null; - MOBY_CENTRAL_CONFIG = (String) c.lookup("java:comp/env/MOBY_CENTRAL_CONFIG"); - if (MOBY_CENTRAL_CONFIG != null && !MOBY_CENTRAL_CONFIG.equals("")) { - // set MOBY_CENTRAL_CONFIG - log.info("init(setting MOBY_CENTRAL_CONFIG)"); - System.setProperty("MOBY_CENTRAL_CONFIG", MOBY_CENTRAL_CONFIG); - } - - } catch (Exception ex) { - } - try { - String MOBY_SERVER = null; - MOBY_SERVER = (String) c.lookup("java:comp/env/MOBY_SERVER"); - if (MOBY_SERVER != null && !MOBY_SERVER.equals("")) { - // set MOBY_SERVER - log.info("init(setting MOBY_SERVER)"); - System.setProperty("MOBY_SERVER", MOBY_SERVER); - } - } catch (Exception ex) { - } - - try { - String MOBY_URI = null; - MOBY_URI = (String) c.lookup("java:comp/env/MOBY_URI"); - if (MOBY_URI != null && !MOBY_URI.equals("")) { - // set MOBY_URI - log.info("init(setting MOBY_URI)"); - System.setProperty("MOBY_URI", MOBY_URI); - } - } catch (Exception ex) { - } - + cLoader = (ContextLoader) DiscoverSingleton.find(Class + .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( + (String) ContextLoader.class.getCanonicalName()).getName()); + log + .warn((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" + : "ContextLoader has loaded successfully.")); } catch (Exception e) { + log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" + + System.getProperty("line.separator") + e.getStackTrace()); } } @@ -122,8 +94,8 @@ return; } Process p; - - String[] com = new String[] { rdfagent, "-test", url }; + //TODO may need to place JAVA_HOME in the mobycentral part of the config files. + String[] com = new String[] { "java","-DRDFagent.home="+rdfagent,"-jar", rdfagent+"/RDFagent.jar", "-test", url }; p = Runtime.getRuntime().exec(com); BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream())); StringBuffer sb = new StringBuffer(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/LSID_ResolverClient.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/servlet/forms/LSID_ResolverClient.java 2006/08/30 17:11:25 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/LSID_ResolverClient.java 2006/10/11 01:54:50 1.2 @@ -108,19 +108,19 @@ String str = resolveLSID(lsid_to_use, "soap"); return str; } catch (MobyException e) { - log.error(e); + log.debug("Couldn't resolve " + lsid_to_use + " to metadata using SOAP."); } try { String str = resolveLSID(lsid_to_use, "http"); return str; } catch (MobyException e) { - log.error(e); + log.debug("Couldn't resolve " + lsid_to_use + " to metadata using HTTP."); } try { String str = resolveLSID(lsid_to_use, "ftp"); return str; } catch (MobyException e) { - log.error(e); + log.debug("Couldn't resolve " + lsid_to_use + " to metadata using FTP."); } return "Couldn't resolve your lsid. I tried the protocols SOAP, HTTP, and FTP. If we are missing one, let us know."; } @@ -131,19 +131,19 @@ String str = resolveLSID2Data(lsid_to_use, "soap"); return str; } catch (MobyException e) { - log.error(e); + log.debug("Couldn't resolve " + lsid_to_use + " to data using SOAP."); } try { String str = resolveLSID2Data(lsid_to_use, "http"); return str; } catch (MobyException e) { - log.error(e); + log.debug("Couldn't resolve " + lsid_to_use + " to data using HTTP."); } try { String str = resolveLSID2Data(lsid_to_use, "ftp"); return str; } catch (MobyException e) { - log.error(e); + log.debug("Couldn't resolve " + lsid_to_use + " to data using FTP."); } return "Couldn't resolve your lsid to Data."; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/LSIDComplete.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/servlet/forms/LSIDComplete.java 2006/08/30 17:11:25 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/LSIDComplete.java 2006/10/11 01:54:50 1.2 @@ -21,8 +21,10 @@ import javax.sql.DataSource; import org.apache.commons.dbcp.BasicDataSource; +import org.apache.commons.discovery.tools.DiscoverSingleton; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; import org.biomoby.registry.properties.MobyProperties; /* @@ -33,6 +35,7 @@ /** * @author Eddie Kawas */ + at SuppressWarnings("unchecked") public class LSIDComplete extends HttpServlet { /** @@ -45,14 +48,33 @@ final private String newline = System.getProperty("line.separator"); private Map datas = Collections.synchronizedMap(new HashMap()); + public void init() throws ServletException { super.init(); + + + ContextLoader cLoader = null; + try { + cLoader = (ContextLoader) DiscoverSingleton.find(Class + .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( + (String) ContextLoader.class.getCanonicalName()).getName()); + log + .warn((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" + : "ContextLoader has loaded successfully.")); + } catch (Exception e) { + log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" + + System.getProperty("line.separator") + e.getStackTrace()); + } + log.debug("Initializing the Timer that will invoke the StatWriter"); Timer timer = new Timer(); timer.scheduleAtFixedRate(new StatWriter(this), new java.util.Date(), 1000 * 60 * 60); } + // an array of properties objects created initialized once for more efficient running + private Properties[] properties = new Properties[]{null,null, null, null}; + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String lsid = filter(request.getParameter("lsid")); @@ -74,20 +96,24 @@ String object = parts[4]; Properties p = null; // check if the 3rd component is biomoby.org - if (parts[2].equalsIgnoreCase("biomoby.org") + if ((parts[2].equalsIgnoreCase("biomoby.org") || parts[2].equalsIgnoreCase(request.getServerName())) && parts[0].equalsIgnoreCase("urn") && parts[1].equalsIgnoreCase("lsid")) { // check if they are typing in // namespacetype if (parts[3].equals("namespacetype")) { - p = MobyProperties.NAMESPACE_PROPERTIES(); + if (properties[0] == null) + properties[0] = MobyProperties.NAMESPACE_PROPERTIES(); + p = properties[0]; String lsids = getLSIDs(p, object, "namespace"); if (!lsids.equals("")) lsid = lsids; } // objectclass else if (parts[3].equals("objectclass")) { - p = MobyProperties.OBJECT_PROPERTIES(); + if (properties[1] == null) + properties[1] = MobyProperties.OBJECT_PROPERTIES(); + p = properties[1]; String lsids = getLSIDs(p, object, "object"); if (!lsids.equals("")) { lsid = lsids; @@ -96,7 +122,9 @@ } // servicetype else if (parts[3].equals("servicetype")) { - p = MobyProperties.SERVICE_PROPERTIES(); + if (properties[2] == null) + properties[2] = MobyProperties.SERVICE_PROPERTIES(); + p = properties[2]; String lsids = getLSIDs(p, object, "service"); if (!lsids.equals("")) lsid = lsids; @@ -104,7 +132,9 @@ // serviceinstance else if (parts[3].equals("serviceinstance")) { // weird case, because object is authURI,servicename - p = MobyProperties.SERVICE_INSTANCE_PROPERTIES(); + if (properties[3] == null) + properties[3] = MobyProperties.SERVICE_INSTANCE_PROPERTIES(); + p = properties[3]; String lsids = getLSIDs(p, object, "service_instance"); if (!lsids.equals("")) lsid = lsids; From kawas at dev.open-bio.org Wed Oct 11 01:54:50 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 21:54:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610110154.k9B1soIP025350@dev.open-bio.org> kawas Tue Oct 10 21:54:50 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities In directory dev.open-bio.org:/tmp/cvs-serv25229/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities Modified Files: ServiceTester.java Added Files: ContextLoader.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities ContextLoader.java,NONE,1.1 ServiceTester.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ServiceTester.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/utilities/ServiceTester.java 2006/08/30 23:15:17 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ServiceTester.java 2006/10/11 01:54:50 1.4 @@ -126,6 +126,7 @@ } } log.info("service testing complete."); + setResultMap(theMap); return theMap; } @@ -272,10 +273,8 @@ try { output = doCall(s.getName(), new Object[] { "" - + "" + " \r\n" + "" - + " " + - // "" + - " " + "" + " " + "" + + "" + " " + "" + + " " + "" + "" + "" }, impl.getRegistryEndpoint()); // log.info(output); } catch (MobyException e) { From kawas at dev.open-bio.org Wed Oct 11 01:54:51 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 21:54:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610110154.k9B1spu6025458@dev.open-bio.org> kawas Tue Oct 10 21:54:51 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources In directory dev.open-bio.org:/tmp/cvs-serv25229/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources Modified Files: RESOURCE.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources RESOURCE.java,1.22,1.23 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java 2006/09/15 21:50:21 1.22 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java 2006/10/11 01:54:51 1.23 @@ -14,8 +14,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.naming.Context; -import javax.naming.InitialContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; @@ -24,18 +22,15 @@ import org.apache.commons.discovery.tools.DiscoverSingleton; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.biomoby.client.CentralDigestImpl; import org.biomoby.client.CentralImpl; import org.biomoby.client.rdf.builder.ServiceInstanceRDF; import org.biomoby.client.rdf.vocabulary.DC_PROTEGE; import org.biomoby.client.rdf.vocabulary.Predicates; +import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; import org.biomoby.registry.definitions.types.JNamespacesSqlImpl; import org.biomoby.registry.definitions.types.JObjectsSqlImpl; import org.biomoby.registry.definitions.types.JServicesSqlImpl; -import org.biomoby.shared.Central; -import org.biomoby.shared.CentralDigest; import org.biomoby.shared.MobyException; -import org.biomoby.shared.MobyResourceRef; import org.biomoby.shared.MobyService; import org.w3c.rdf.model.ModelException; @@ -94,189 +89,44 @@ * the following used to be final, but on error, i would like to ensure that * i dont waste time trying to perform caching operations */ - private static boolean isCachableServiceInstances; + private static boolean isCachableServiceInstances = false; - private static boolean isCachableNamespaces; + private static boolean isCachableNamespaces = false; - private static boolean isCachableServiceTypes; + private static boolean isCachableServiceTypes = false; - private static boolean isCachableObjects; - - /* the individual caching classes */ - private static RDFCache ServiceInstanceCache = null; - - private static RDFCache ServiceTypesCache = null; - - private static RDFCache ObjectsCache = null; - - private static RDFCache NamespaceCache = null; + private static boolean isCachableObjects = false; private static boolean RUN_MAIN = false; - + private static ContextLoader cLoader = null; + static { - boolean __success = false; - log.info("init(setting environment variables)"); try { - Object className; - Context c = new InitialContext(); - try { - log.info("Checking for caching classes ..."); - className = c.lookup("java:comp/env/ServiceInstancesCachingClass"); - if (className != null && className instanceof String) { - try { - ServiceInstanceCache = (RDFCache) DiscoverSingleton.find(Class.forName((String) className), Class.forName((String) className).getName()); - log.info((ServiceInstanceCache == null ? "Caching of service instances not enabled." - : "Caching of service instances enabled.")); - } catch (Exception e) { - ServiceInstanceCache = null; - log.info("Caching of service instances not enabled\n" + e); - } - } - } catch (Exception e) { - log - .info("Caching of service instances not enabled. Caching file was not specified.\n" - + e); - } - try { - className = c.lookup("java:comp/env/ServiceTypesCachingClass"); - if (className != null && className instanceof String) { - try { - ServiceTypesCache = (RDFCache) DiscoverSingleton.find(Class.forName((String) className), Class.forName((String) className).getName()); - log - .info((ServiceTypesCache == null ? "Caching of service types not enabled." - : "Caching of service types enabled.")); - } catch (Exception e) { - ServiceTypesCache = null; - log.info("Caching of service types not enabled\n" + e); - } - } - } catch (Exception e) { - log.info("Caching of service types not enabled. Caching file was not specified.\n" - + e); - } - try { - className = c.lookup("java:comp/env/ObjectsCachingClass"); - if (className != null && className instanceof String) { - try { - ObjectsCache = (RDFCache) DiscoverSingleton.find(Class.forName((String) className), Class.forName((String) className).getName()); - log.info((ObjectsCache == null ? "Caching of datatypes not enabled." - : "Caching of datatypes enabled.")); - } catch (Exception e) { - ObjectsCache = null; - log.info("Caching of datatypes not enabled\n" + e); - } - } - } catch (Exception e) { - log.info("Caching of datatypes not enabled. Caching file was not specified.\n" + e); - } - try { - className = c.lookup("java:comp/env/NamespacesCachingClass"); - if (className != null && className instanceof String) { - try { - NamespaceCache = (RDFCache) DiscoverSingleton.find(Class.forName((String) className), Class.forName((String) className).getName()); - log.info((NamespaceCache == null ? "Caching of namespaces not enabled." - : "Caching of namespaces enabled.")); - } catch (Exception e) { - NamespaceCache = null; - log.info("Caching of namespaces not enabled\n" + e); - } - } - } catch (Exception e) { - log.info("Caching of service types not enabled. Caching file was not specified.\n" - + e); - } + cLoader = (ContextLoader) DiscoverSingleton.find(Class + .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( + (String) ContextLoader.class.getCanonicalName()).getName()); + log + .info((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" + : "ContextLoader has loaded successfully.")); } catch (Exception e) { - log.info("Caching is not enabled for any ontology.\n" + e); + log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" + + System.getProperty("line.separator") + e.getMessage()); } - // caching variables - isCachableNamespaces = (NamespaceCache == null ? false : true); - isCachableServiceTypes = (ServiceTypesCache == null ? false : true); - isCachableObjects = (ObjectsCache == null ? false : true); - isCachableServiceInstances = (ServiceInstanceCache == null ? false : true); - - - log.info("getting mobycentral registry properties ..."); - try { - Context c = new InitialContext(); - try { - String MOBY_CENTRAL_CONFIG = null; - MOBY_CENTRAL_CONFIG = (String) c.lookup("java:comp/env/MOBY_CENTRAL_CONFIG"); - if (MOBY_CENTRAL_CONFIG != null && !MOBY_CENTRAL_CONFIG.equals("")) { - // set MOBY_CENTRAL_CONFIG - log.info("init(setting MOBY_CENTRAL_CONFIG)"); - System.setProperty("MOBY_CENTRAL_CONFIG", MOBY_CENTRAL_CONFIG); - } - } catch (Exception ex) { - } - try { - String MOBY_SERVER = null; - MOBY_SERVER = (String) c.lookup("java:comp/env/MOBY_SERVER"); - if (MOBY_SERVER != null && !MOBY_SERVER.equals("")) { - // set MOBY_SERVER - log.info("init(setting MOBY_SERVER)"); - System.setProperty("MOBY_SERVER", MOBY_SERVER); - if (!__success) - try { - Central central = new CentralImpl(MOBY_SERVER); - MobyResourceRef[] refs = central.getResourceRefs(); - for (int i = 0; i < refs.length; i++) { - String url = refs[i].getResourceLocation().toExternalForm(); - if (url.lastIndexOf("#") < 0) - url = url + "#"; - URI_MAP.put(refs[i].getResourceName(), url); - } - __success = true; - } catch (Exception ex) { - - } - } - } catch (Exception ex) { - } - - try { - String MOBY_URI = null; - MOBY_URI = (String) c.lookup("java:comp/env/MOBY_URI"); - if (MOBY_URI != null && !MOBY_URI.equals("")) { - // set MOBY_URI - log.info("init(setting MOBY_URI)"); - System.setProperty("MOBY_URI", MOBY_URI); - } - } catch (Exception ex) { - } - } catch (Exception ex) { + // attempt to load caching classes + if (cLoader != null) { + isCachableNamespaces = (cLoader.getNamespaceCache() == null ? false : true); + isCachableServiceTypes = (cLoader.getServiceTypesCache() == null ? false : true); + isCachableObjects = (cLoader.getObjectsCache() == null ? false : true); + isCachableServiceInstances = (cLoader.getServiceInstanceCache() == null ? false : true); } - if (!__success) - try { - // default to mobycentral - log.warn("Defaulting to default mobycentral."); - Central central = new CentralImpl(); - MobyResourceRef[] refs = central.getResourceRefs(); - for (int i = 0; i < refs.length; i++) { - String url = refs[i].getResourceLocation().toExternalForm(); - if (url.lastIndexOf("#") < 0) - url = url + "#"; - URI_MAP.put(refs[i].getResourceName(), url); - } - } catch (Exception ex) { - // some defaults if nothing else works - URI_MAP.put("Object", "http://biomoby.org/RESOURCES/MOBY-S/Objects#"); - - URI_MAP.put("Service", "http://biomoby.org/RESOURCES/MOBY-S/Services#"); - - URI_MAP.put("Namespace", "http://biomoby.org/RESOURCES/MOBY-S/Namespaces#"); - - URI_MAP.put("ServiceInstance", - "http://biomoby.org/RESOURCES/MOBY-S/ServiceInstances#"); - } - - OBJ = (String) URI_MAP.get("Object"); - SRV = (String) URI_MAP.get("Service"); - NS = (String) URI_MAP.get("Namespace"); + OBJ = (String) cLoader.getURI_MAP().get("Object"); + SRV = (String) cLoader.getURI_MAP().get("Service"); + NS = (String) cLoader.getURI_MAP().get("Namespace"); PRED = "http://biomoby.org/RESOURCES/MOBY-S/Predicates#"; - SI = (String) URI_MAP.get("ServiceInstance"); + SI = (String) cLoader.getURI_MAP().get("ServiceInstance"); } /* @@ -292,11 +142,11 @@ throws ServletException, IOException { PrintWriter out = response.getWriter(); String path = request.getPathInfo(); - if (path == null ) { + if (path == null) { out .println(" not MOBY-S

        not MOBY-S

        "); return; - } + } Pattern p = Pattern.compile("/MOBY\\-S/(\\S+)"); Matcher m = p.matcher(path); if (!m.matches()) { @@ -317,7 +167,7 @@ } catch (MobyException e) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Could not get Objects"); - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); return; } if (model == null) { @@ -337,7 +187,7 @@ } catch (MobyException e) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Could not get Namespaces"); - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); return; } if (model == null) { @@ -357,7 +207,7 @@ } catch (MobyException e) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Could not get Services"); - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); return; } if (model == null) { @@ -377,8 +227,8 @@ response.setHeader("Content-Disposition", "attachment;filename=ServiceInstances"); if (isCachableServiceInstances) { - if (ServiceInstanceCache.isCachedMostRecent()) { - out.write(ServiceInstanceCache.getCachedRDF()); + if (cLoader.getServiceInstanceCache().isCachedMostRecent()) { + out.write(cLoader.getServiceInstanceCache().getCachedRDF()); return; } else { try { @@ -401,9 +251,9 @@ writer.setProperty("showXmlDeclaration", "false"); writer.setProperty("tab", "5"); writer.write(model, stream, null); - if (!ServiceInstanceCache.isCachedMostRecent()) - ServiceInstanceCache.cacheRDF(stream.getOutput(), - ServiceInstanceCache.getLatestCriteria()); + if (!cLoader.getServiceInstanceCache().isCachedMostRecent()) + cLoader.getServiceInstanceCache().cacheRDF(stream.getOutput(), + cLoader.getServiceInstanceCache().getLatestCriteria()); stream = null; // now output the RDF writer = model.getWriter("RDF/XML-ABBREV"); @@ -417,7 +267,7 @@ } catch (Exception e) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Could not get ServiceInstances"); - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); return; } if (model == null) { @@ -448,7 +298,7 @@ model = getAll(model); } catch (Exception e) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Could not get All"); - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); return; } if (model == null) { @@ -492,7 +342,7 @@ try { model = getServiceInstances(model); } catch (ModelException e) { - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); return null; } return model; @@ -513,7 +363,7 @@ createNsMap(model); } - CentralDigest central = null; + CentralImpl central = null; MobyService[] services = null; try { String registryURL; @@ -524,26 +374,26 @@ log.info("System vars: " + registryURL + ", " + registryNamespace); if (registryURL == null) { // use default registry, since we dont have a local one - central = new CentralDigestImpl(); + central = new CentralImpl(); } else if (registryNamespace == null) { // use default namespace since one isnt defined - central = new CentralDigestImpl(registryURL); + central = new CentralImpl(registryURL); } else { // use defined url and namespacce - central = new CentralDigestImpl(registryURL, registryNamespace); + central = new CentralImpl(registryURL, registryNamespace); } } else { // use default registry since we cant determine if local one // exists - central = new CentralDigestImpl(); + central = new CentralImpl(); } - services = central.getServices(); + services = central.findService(new MobyService("")); } catch (MobyException e) { - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); } if (central == null || services == null) throw new MobyException( - "Could not retrieve useful information from CentralDigestImpl().getServices(String)"); + "Could not retrieve useful information from CentralImpl().findService(String)"); return ServiceInstanceRDF.createRDFModel(model, services, true); } @@ -762,7 +612,7 @@ } /* - * + * */ private final Resource _addClassResource(Model model, String uri, String label, String lsid, String def, String authority, String email) { @@ -788,19 +638,19 @@ try { return new JObjectsSqlImpl().getFullObjectsAsArray(); } catch (Exception e) { - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); } } else if (type.equalsIgnoreCase("services")) { try { return new JServicesSqlImpl().getFullServicesAsArray(); } catch (Exception e) { - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); } } else if (type.equalsIgnoreCase("namespaces")) { try { return new JNamespacesSqlImpl().getFullNamespacesAsArray(); } catch (Exception e) { - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); } } return null; @@ -858,7 +708,7 @@ try { model = getServiceInstances(model); } catch (Exception e) { - e.printStackTrace(); + log.error("Exception thrown: " + e.getMessage()); return ""; } RDFWriter writer = model.getWriter("RDF/XML-ABBREV"); From kawas at dev.open-bio.org Wed Oct 11 01:54:51 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 21:54:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610110154.k9B1spOL025410@dev.open-bio.org> kawas Tue Oct 10 21:54:51 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/definitions/types In directory dev.open-bio.org:/tmp/cvs-serv25229/Java/src/main/org/biomoby/registry/definitions/types Modified Files: JServicesSqlImpl.java JObjectsSqlImpl.java JNamespacesSqlImpl.java Log Message: moby-live/Java/src/main/org/biomoby/registry/definitions/types JServicesSqlImpl.java,1.4,1.5 JObjectsSqlImpl.java,1.3,1.4 JNamespacesSqlImpl.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/definitions/types/JServicesSqlImpl.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/registry/definitions/types/JServicesSqlImpl.java 2006/07/19 23:13:48 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/definitions/types/JServicesSqlImpl.java 2006/10/11 01:54:51 1.5 @@ -20,6 +20,7 @@ *

        * email me at edward.kawas at gmail.com */ + at SuppressWarnings("unchecked") public final class JServicesSqlImpl implements JServiceI { private static final String sql = "SELECT ot1.service_type, rt.relationship_type, ot2.service_type, ot1.description " + "FROM service as ot1, service_term2term as rt, service as ot2 " @@ -53,12 +54,6 @@ String username = (String) map.get("username");// "moby_external"; String password = (String) map.get("password");// ""; - /* - * String serverName = "mobycentral.icapture.ubc.ca:3306"; String - * mydatabase = "mobyservice"; String url = "jdbc:mysql://" + - * serverName + "/" + mydatabase; String username = "moby_external"; - * String password = ""; - */ this.connection = DriverManager.getConnection(url, username, password); } catch (ClassNotFoundException e) { throw new MobyException( =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/definitions/types/JObjectsSqlImpl.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/registry/definitions/types/JObjectsSqlImpl.java 2006/03/23 15:16:56 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/definitions/types/JObjectsSqlImpl.java 2006/10/11 01:54:51 1.4 @@ -20,6 +20,7 @@ *

        * email me at edward.kawas at gmail.com */ + at SuppressWarnings("unchecked") public final class JObjectsSqlImpl implements JObjectsI { private static final String sql = "SELECT ot1.object_type, rt.relationship_type, ot2.object_type, rt.object2_articlename, ot1.description " + "FROM object as ot1, object_term2term as rt, object as ot2 " @@ -51,21 +52,11 @@ Map map = MobyCentralConfig.getMobyObject(); // Create a connection to the database String serverName = map.get("url") + ":" + map.get("port");// localhost:3306"; - // //TODO - // - make - // this a - // property String mydatabase = (String) map.get("dbname");// "mobyobject"; String url = "jdbc:mysql://" + serverName + "/" + mydatabase; String username = (String) map.get("username");// "moby_external"; String password = (String) map.get("password");// ""; - /* - * String serverName = "mobycentral.icapture.ubc.ca:3306"; String - * mydatabase = "mobyobject"; String url = "jdbc:mysql://" + - * serverName + "/" + mydatabase; String username = "moby_external"; - * String password = ""; - */ this.connection = DriverManager.getConnection(url, username, password); } catch (ClassNotFoundException e) { throw new MobyException( =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/definitions/types/JNamespacesSqlImpl.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/registry/definitions/types/JNamespacesSqlImpl.java 2006/03/15 16:22:37 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/definitions/types/JNamespacesSqlImpl.java 2006/10/11 01:54:51 1.5 @@ -20,6 +20,7 @@ *

        * email me at edward.kawas at gmail.com */ + at SuppressWarnings("unchecked") public final class JNamespacesSqlImpl implements JNamespaceI { private static final String sql = "SELECT namespace_type, description FROM namespace ORDER BY namespace_type asc"; From kawas at dev.open-bio.org Wed Oct 11 01:54:51 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 21:54:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610110154.k9B1spgS025380@dev.open-bio.org> kawas Tue Oct 10 21:54:50 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority In directory dev.open-bio.org:/tmp/cvs-serv25229/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority Modified Files: LSIDDataLookup.java Test.java MobyAuthority.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority LSIDDataLookup.java,1.12,1.13 Test.java,1.4,1.5 MobyAuthority.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java 2006/05/24 18:48:31 1.12 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java 2006/10/11 01:54:50 1.13 @@ -108,7 +108,7 @@ int result = UNKNOWN; String authority = lsid.getAuthority().getAuthority(); - log.info("lsidType: " + ns + " " + id + " " + ver + " " + authority); + log.debug("lsidType: " + ns + " " + id + " " + ver + " " + authority); if (ns.equalsIgnoreCase(mobynamespace.getProperty("lsid_namespace"))) { if (!authority.equals(mobynamespace.getProperty("lsid_authority"))) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/Test.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/ui/graphical/servlet/lsid/authority/Test.java 2005/12/02 20:40:18 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/Test.java 2006/10/11 01:54:50 1.5 @@ -34,7 +34,8 @@ */ public static void main(String[] args) throws LSIDException { //String lsid_to_use = "urn:lsid:ncbi.nlm.nih.gov.lsid.biopathways.org:genbank_gi:30350027"; - String lsid_to_use = "urn:lsid:biomoby.org:serviceinstance:www.illuminae.com,getSHound3DNeighboursFromGi"; + // TODO insert your LSID here + String lsid_to_use = "urn:lsid:localhost:serviceinstance:test.test.test,breakString:2006-09-19T20-08-36Z"; LSID lsid = new LSID(lsid_to_use); LSIDResolver resolver = new LSIDResolver(lsid); resolver.setUseLocalCache(false); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/MobyAuthority.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/ui/graphical/servlet/lsid/authority/MobyAuthority.java 2006/09/15 18:28:23 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/MobyAuthority.java 2006/10/11 01:54:50 1.8 @@ -1,12 +1,12 @@ package org.biomoby.client.ui.graphical.servlet.lsid.authority; import java.net.URL; -import java.util.Properties; - -import javax.naming.Context; -import javax.naming.InitialContext; +import org.apache.commons.discovery.tools.DiscoverSingleton; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.biomoby.client.CentralImpl; +import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; import org.biomoby.shared.MobyService; import com.ibm.lsid.ExpiringResponse; @@ -39,10 +39,13 @@ * email me at edward.kawas at gmail.com */ public class MobyAuthority extends SimpleAuthority { - private LSIDDataLookup lookup = null; + private Log log = LogFactory.getLog(this.getClass()); - private Properties properties = new Properties(); + private LSIDDataLookup lookup = null; + // NOTE: This class assumes that you have set system properties for + // lsid_domain and lsid_port - if they are not set, then exceptions are + // thrown public LSIDMetadataPort[] getMetadataLocations(LSID lsid, String url) { if (lookup == null) @@ -57,16 +60,18 @@ } if (lsType == LSIDDataLookup.UNKNOWN) return null; - + return new LSIDMetadataPort[] { new SOAPLocation("BioMOBYMetadataSOAPPort", "http://" - + properties.getProperty("lsid_domain") + ":" - + properties.getProperty("lsid_port") + "/authority/metadata"), - new HTTPLocation("BioMOBYMetadataHTTPPort", properties.getProperty("lsid_domain"), - Integer.parseInt(properties.getProperty("lsid_port")), - "/authority/metadata") }; + + System.getProperty("lsid_domain") + ":" + System.getProperty("lsid_port") + + "/authority/metadata"), + new HTTPLocation("BioMOBYMetadataHTTPPort", System.getProperty("lsid_domain"), + Integer.parseInt(System.getProperty("lsid_port")), "/authority/metadata") }; } + // NOTE: This class assumes that you have set system properties for + // lsid_domain and lsid_port - if they are not set, then exceptions are + // thrown public LSIDDataPort[] getDataLocations(LSID lsid, String url) { if (lookup == null) @@ -78,10 +83,10 @@ return new LSIDDataPort[] { new SOAPLocation("BioMOBYDataSOAPPort", "http://" - + properties.getProperty("lsid_domain") + ":" - + properties.getProperty("lsid_port") + "/authority/data"), - new HTTPLocation("BioMOBYDataHTTPPort", properties.getProperty("lsid_domain"), - Integer.parseInt(properties.getProperty("lsid_port")), "/authority/data") }; + + System.getProperty("lsid_domain") + ":" + System.getProperty("lsid_port") + + "/authority/data"), + new HTTPLocation("BioMOBYDataHTTPPort", System.getProperty("lsid_domain"), Integer + .parseInt(System.getProperty("lsid_port")), "/authority/data") }; } /* @@ -149,57 +154,17 @@ */ public void initService(LSIDServiceConfig config) throws LSIDServerException { lookup = new LSIDDataLookup(); + ContextLoader cLoader = null; try { - - Context c = new InitialContext(); - try { - String LSID_SERVER = (String) c.lookup("java:comp/env/LSID_SERVER"); - - if (LSID_SERVER != null && !LSID_SERVER.equals("")) { - properties.setProperty("lsid_domain", LSID_SERVER); - } - } catch (Exception ex) { - System.err.println(ex.getLocalizedMessage()); - } - - try { - String LSID_PORT = (String) c.lookup("java:comp/env/LSID_PORT"); - if (LSID_PORT != null && !LSID_PORT.equals("")) { - properties.setProperty("lsid_port", LSID_PORT); - } - } catch (Exception ex) { - System.err.println(ex.getLocalizedMessage()); - } - try { - String CONFIG = (String) c.lookup("java:comp/env/MOBY_CENTRAL_CONFIG"); - if (CONFIG != null && !CONFIG.equals("")) { - System.setProperty("MOBY_CENTRAL_CONFIG", CONFIG); - properties.setProperty("MOBY_CENTRAL_CONFIG", CONFIG); - } - } catch (Exception ex) { - System.err.println(ex.getLocalizedMessage()); - } - try { - String CONFIG = (String) c.lookup("java:comp/env/MOBY_SERVER"); - if (CONFIG != null && !CONFIG.equals("")) { - properties.setProperty("MOBY_SERVER", CONFIG); - System.setProperty("MOBY_SERVER", CONFIG); - } - } catch (Exception ex) { - System.err.println(ex.getLocalizedMessage()); - } - try { - String CONFIG = (String) c.lookup("java:comp/env/MOBY_URI"); - if (CONFIG != null && !CONFIG.equals("")) { - System.setProperty("MOBY_URI", CONFIG); - properties.setProperty("MOBY_URI", CONFIG); - } - } catch (Exception ex) { - System.err.println(ex.getLocalizedMessage()); - } - + cLoader = (ContextLoader) DiscoverSingleton.find(Class + .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( + (String) ContextLoader.class.getCanonicalName()).getName()); + log + .info((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" + : "ContextLoader has loaded successfully.")); } catch (Exception e) { - System.err.println(e.getLocalizedMessage()); + log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" + + System.getProperty("line.separator") + e.getStackTrace()); } } } \ No newline at end of file From kawas at dev.open-bio.org Wed Oct 11 01:54:51 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 21:54:51 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610110154.k9B1spNL025436@dev.open-bio.org> kawas Tue Oct 10 21:54:51 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder In directory dev.open-bio.org:/tmp/cvs-serv25229/Java/src/main/org/biomoby/client/rdf/builder Modified Files: ServiceInstanceRDF.java RDFConfigure.java Log Message: moby-live/Java/src/main/org/biomoby/client/rdf/builder ServiceInstanceRDF.java,1.30,1.31 RDFConfigure.java,1.21,1.22 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2006/08/30 16:55:02 1.30 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2006/10/11 01:54:51 1.31 @@ -9,19 +9,14 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; -import java.util.Properties; - -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; +import org.apache.commons.discovery.tools.DiscoverSingleton; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.biomoby.client.CentralImpl; import org.biomoby.client.rdf.vocabulary.DC_PROTEGE; import org.biomoby.client.rdf.vocabulary.FetaVocabulary; - -import org.biomoby.registry.properties.MobyProperties; +import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; import org.biomoby.registry.properties.RegistryOS; import org.biomoby.shared.Central; import org.biomoby.shared.MobyData; @@ -29,7 +24,6 @@ import org.biomoby.shared.MobyNamespace; import org.biomoby.shared.MobyPrimaryDataSet; import org.biomoby.shared.MobyPrimaryDataSimple; -import org.biomoby.shared.MobyResourceRef; import org.biomoby.shared.MobySecondaryData; import org.biomoby.shared.MobyService; import org.biomoby.shared.data.MobyDataSecondaryInstance; @@ -79,92 +73,42 @@ private static final String DCP = DC_PROTEGE.getURI(); - private static final String OBJ;// = - - // "http://biomoby.org/RESOURCES/MOBY-S/Objects#"; - - private static final String SRV;// = - - // "http://biomoby.org/RESOURCES/MOBY-S/Services#"; - - private static final String NS;// = - - // "http://biomoby.org/RESOURCES/MOBY-S/Namespaces#"; - - private static final String MP;// = - - // "http://biomoby.org/RESOURCES/MOBY-S/Predicates#"; - - private static final String SI;// = - // "http://biomoby.org/RESOURCES/MOBY-S/ServiceInstances#"; + private static final String OBJ; + private static final String SRV; + private static final String NS; + private static final String MP; + private static final String SI; + + private static final String SERVER; static { - boolean __success = false; - // attempt 1 - servlet context - Context c; + ContextLoader cLoader = null; try { - c = new InitialContext(); - String MOBY_SERVER = (String) c.lookup("java:comp/env/MOBY_SERVER"); - if (MOBY_SERVER != null && !MOBY_SERVER.equals("")) { - System.setProperty("MOBY_SERVER", MOBY_SERVER); - try { - Central central = new CentralImpl(MOBY_SERVER); - MobyResourceRef[] refs = central.getResourceRefs(); - for (int i = 0; i < refs.length; i++) { - String url = refs[i].getResourceLocation().toExternalForm(); - if (url.lastIndexOf("#") < 0) - url = url + "#"; - URI_MAP.put(refs[i].getResourceName(), url); - } - } catch (Exception ex) { + cLoader = (ContextLoader) DiscoverSingleton.find(Class + .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( + (String) ContextLoader.class.getCanonicalName()).getName()); + log + .info((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" + : "ContextLoader has loaded successfully.")); + } catch (Exception e) { + log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" + + System.getProperty("line.separator") + e.getMessage()); + } + + log.info("Setting RDF ResourceLocations (RDFConfigure) for current registry..."); - } - __success = true; - } - String MOBY_URI = (String) c.lookup("java:comp/env/MOBY_URI"); - if (MOBY_URI != null && !MOBY_URI.equals("")) { - System.setProperty("MOBY_URI", MOBY_URI); - __success = true; - } - } catch (NamingException e) { + + OBJ = (String) cLoader.getURI_MAP().get("Object"); - // e.printStackTrace(); - } + SRV = (String) cLoader.getURI_MAP().get("Service"); - // attempt 2 - environment variables - if (!__success) { - // maybe try for environment variables - Properties p = MobyProperties.PROPERTIES(); - String MOBY_SERVER = (String) p.get("MOBY_SERVER"); - if (MOBY_SERVER != null && !MOBY_SERVER.equals("")) { - System.setProperty("MOBY_SERVER", MOBY_SERVER); - try { - Central central = new CentralImpl(MOBY_SERVER); - MobyResourceRef[] refs = central.getResourceRefs(); - for (int i = 0; i < refs.length; i++) { - String url = refs[i].getResourceLocation().toExternalForm(); - if (url.lastIndexOf("#") < 0) - url = url + "#"; - URI_MAP.put(refs[i].getResourceName(), url); - } - } catch (Exception ex) { + NS = (String) cLoader.getURI_MAP().get("Namespace"); - } - } - String MOBY_URI = (String) p.get("MOBY_URI"); - if (MOBY_URI != null && !MOBY_URI.equals("")) { - System.setProperty("MOBY_URI", MOBY_URI); - } - } - OBJ = (URI_MAP.get("Object") != null ? (String) URI_MAP.get("Object") - : "http://biomoby.org/RESOURCES/MOBY-S/Objects#"); - SRV = (URI_MAP.get("Service") != null ? (String) URI_MAP.get("Service") - : "http://biomoby.org/RESOURCES/MOBY-S/Services#"); - NS = (URI_MAP.get("Namespace") != null ? (String) URI_MAP.get("Namespace") - : "http://biomoby.org/RESOURCES/MOBY-S/Namespaces#"); MP = "http://biomoby.org/RESOURCES/MOBY-S/Predicates#"; - SI = (URI_MAP.get("ServiceInstance") != null ? (String) URI_MAP.get("ServiceInstance") - : "http://biomoby.org/RESOURCES/MOBY-S/ServiceInstances#"); + + SI = (String) cLoader.getURI_MAP().get("ServiceInstance"); + + SERVER = cLoader.getFULL_SERVER_URL(); } /** @@ -274,7 +218,7 @@ try { central = new CentralImpl(url, uri); } catch (MobyException e) { - System.err.println("Could not connect to " + url + " in findService."); + log.error("Could not connect to " + url + " in findService."); return empty; } // set up the query service @@ -284,7 +228,7 @@ try { services = central.findService(service); } catch (MobyException e1) { - System.err.println("Could not find service:\n" + e1.getMessage()); + log.error("Could not find service:\n" + e1.getMessage()); return empty; } // only one service should be returned! @@ -304,7 +248,7 @@ try { central = new CentralImpl(url, uri); } catch (MobyException e) { - System.err.println("Could not connect to " + url + " in findService."); + log.error("Could not connect to " + url + " in findService."); return empty; } // set up the query service @@ -314,7 +258,7 @@ try { services = central.findService(service); } catch (MobyException e1) { - System.err.println("Could not find service:\n" + e1.getMessage()); + log.error("Could not find service:\n" + e1.getMessage()); return empty; } // get the rdf @@ -358,7 +302,7 @@ try { central = new CentralImpl(url, uri); } catch (MobyException e) { - System.err.println("Could not connect to " + url + " in findService."); + log.error("Could not connect to " + url + " in findService."); return empty; } // set up the query service @@ -368,7 +312,7 @@ try { services = central.findService(service); } catch (MobyException e1) { - System.err.println("Could not find service:\n" + e1.getMessage()); + log.error("Could not find service:\n" + e1.getMessage()); return empty; } // only one service should be returned! @@ -388,7 +332,7 @@ try { central = new CentralImpl(url, uri); } catch (MobyException e) { - System.err.println("Could not connect to " + url + " in findService."); + log.error("Could not connect to " + url + " in findService."); return empty; } // set up the query service @@ -398,7 +342,7 @@ try { services = central.findService(service); } catch (MobyException e1) { - System.err.println("Could not find service:\n" + e1.getMessage()); + log.error("Could not find service:\n" + e1.getMessage()); return empty; } // get the rdf @@ -421,50 +365,13 @@ // initialize central try { if (!useTestMachine) { - String registryURL = null; - String registryNamespace = null; - Map map = RegistryOS.getEnv(); - if (!map.isEmpty()) { - registryURL = (String) map.get("MOBY_SERVER"); - if (registryURL == null) - registryURL = System.getProperty("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryNamespace == null) - registryNamespace = System.getProperty("MOBY_URI"); - log.info("Using URL: " + registryURL + " URI: " + registryNamespace); - if (registryURL == null) { - // use default registry, since we dont have a local one - central = new CentralImpl(); - } else if (registryNamespace == null) { - // use default namespace since one isnt defined - central = new CentralImpl(registryURL); - } else { - // use defined url and namespacce - central = new CentralImpl(registryURL, registryNamespace); - } - } else { - // perhaps the System propery was set earlier. - if (registryURL == null) - registryURL = System.getProperty("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryNamespace == null) - registryNamespace = System.getProperty("MOBY_URI"); - - // use the default central if we have no other choice - if (registryURL != null) - if (registryNamespace != null) - central = new CentralImpl(registryURL, registryNamespace); - else - central = new CentralImpl(registryURL); - else - central = new CentralImpl(); - } + central = getCentralImpl(); } else { // use test machine no longer supported return empty; } } catch (MobyException e) { - System.err.println("error in getAllServices 1:\n" + e.getMessage()); + log.error("error in getAllServices 1:\n" + e.getMessage()); return empty; } // set up the query service @@ -474,7 +381,7 @@ try { services = central.findService(service); } catch (MobyException e1) { - System.err.println("error in getAllServices 2:\n" + e1.getMessage()); + log.error("error in getAllServices 2:\n" + e1.getMessage()); return empty; } // should have >= 1 service returned @@ -487,6 +394,42 @@ return str; } + /** + * @return + * @throws MobyException + */ + private static Central getCentralImpl() throws MobyException { + Central central; + String registryURL = null; + String registryNamespace = null; + + // are they set in the system? + registryURL = System.getProperty("MOBY_SERVER"); + registryNamespace = System.getProperty("MOBY_URI"); + + // if we didnt set them check the environment + if (registryURL == null) { + Map map = RegistryOS.getEnv(); + if (!map.isEmpty()) { + registryURL = (String) map.get("MOBY_SERVER"); + registryNamespace = (String) map.get("MOBY_URI"); + } + } + + log.info("Using URL: " + (registryURL == null ? CentralImpl.DEFAULT_ENDPOINT : registryURL) + " URI: " + (registryNamespace == null ? CentralImpl.DEFAULT_NAMESPACE: registryNamespace)); + if (registryURL == null) { + // use default registry, since we dont have a local one + central = new CentralImpl(); + } else if (registryNamespace == null) { + // use default namespace since one isnt defined + central = new CentralImpl(registryURL); + } else { + // use defined url and namespacce + central = new CentralImpl(registryURL, registryNamespace); + } + return central; + } + /* * a method that retrieves all of the service instances based on an @@ -500,50 +443,13 @@ // initialize central try { if (!useTestMachine) { - String registryURL = null; - String registryNamespace = null; - Map map = RegistryOS.getEnv(); - if (!map.isEmpty()) { - registryURL = (String) map.get("MOBY_SERVER"); - if (registryURL == null) - registryURL = System.getProperty("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryNamespace == null) - registryNamespace = System.getProperty("MOBY_URI"); - log.info("Using URL: " + registryURL + " URI: " + registryNamespace); - if (registryURL == null) { - // use default registry, since we dont have a local one - central = new CentralImpl(); - } else if (registryNamespace == null) { - // use default namespace since one isnt defined - central = new CentralImpl(registryURL); - } else { - // use defined url and namespacce - central = new CentralImpl(registryURL, registryNamespace); - } - } else { - // perhaps the System propery was set earlier. - if (registryURL == null) - registryURL = System.getProperty("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryNamespace == null) - registryNamespace = System.getProperty("MOBY_URI"); - - // use the default central if we have no other choice - if (registryURL != null) - if (registryNamespace != null) - central = new CentralImpl(registryURL, registryNamespace); - else - central = new CentralImpl(registryURL); - else - central = new CentralImpl(); - } + central = getCentralImpl(); } else { // use test machine no longer supported return empty; } } catch (MobyException e) { - System.err.println("error in getAllServices 1:\n" + e.getMessage()); + log.error("error in getAllServices 1:\n" + e.getMessage()); return empty; } // set up the query service @@ -553,7 +459,7 @@ try { services = central.findService(service); } catch (MobyException e1) { - System.err.println("error in getAllServices 2:\n" + e1.getMessage()); + log.error("error in getAllServices 2:\n" + e1.getMessage()); return empty; } // should have >= 1 service returned @@ -578,50 +484,13 @@ // initialize central try { if (!useTestMachine) { - String registryURL = null; - String registryNamespace = null; - Map map = RegistryOS.getEnv(); - if (!map.isEmpty()) { - registryURL = (String) map.get("MOBY_SERVER"); - if (registryURL == null) - registryURL = System.getProperty("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryNamespace == null) - registryNamespace = System.getProperty("MOBY_URI"); - log.info("Using URL: " + registryURL + " URI: " + registryNamespace); - if (registryURL == null) { - // use default registry, since we dont have a local one - central = new CentralImpl(); - } else if (registryNamespace == null) { - // use default namespace since one isnt defined - central = new CentralImpl(registryURL); - } else { - // use defined url and namespacce - central = new CentralImpl(registryURL, registryNamespace); - } - } else { - // use default registry since we cant determine if local one - // exists - if (registryURL == null) - registryURL = System.getProperty("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryNamespace == null) - registryNamespace = System.getProperty("MOBY_URI"); - - if (registryURL != null) - if (registryNamespace != null) - central = new CentralImpl(registryURL, registryNamespace); - else - central = new CentralImpl(registryURL); - else - central = new CentralImpl(); - } + central = getCentralImpl(); } else { // use test machine no longer supported return empty; } } catch (MobyException e) { - System.err.println("error in getService 1:\n" + e.getMessage()); + log.error("error in getService 1:\n" + e.getMessage()); return empty; } // set up the query service @@ -631,7 +500,7 @@ try { services = central.findService(service); } catch (MobyException e1) { - System.err.println("error in getService 2:\n" + e1.getMessage()); + log.error("error in getService 2:\n" + e1.getMessage()); return empty; } // only one service should be returned! @@ -657,50 +526,13 @@ // initialize central try { if (!useTestMachine) { - String registryURL = null; - String registryNamespace = null; - Map map = RegistryOS.getEnv(); - if (!map.isEmpty()) { - registryURL = (String) map.get("MOBY_SERVER"); - if (registryURL == null) - registryURL = System.getProperty("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryNamespace == null) - registryNamespace = System.getProperty("MOBY_URI"); - log.info("Using URL: " + registryURL + " URI: " + registryNamespace); - if (registryURL == null) { - // use default registry, since we dont have a local one - central = new CentralImpl(); - } else if (registryNamespace == null) { - // use default namespace since one isnt defined - central = new CentralImpl(registryURL); - } else { - // use defined url and namespacce - central = new CentralImpl(registryURL, registryNamespace); - } - } else { - // use default registry since we cant determine if local one - // exists - if (registryURL == null) - registryURL = System.getProperty("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryNamespace == null) - registryNamespace = System.getProperty("MOBY_URI"); - - if (registryURL != null) - if (registryNamespace != null) - central = new CentralImpl(registryURL, registryNamespace); - else - central = new CentralImpl(registryURL); - else - central = new CentralImpl(); - } + central = getCentralImpl(); } else { // use test machine no longer supported return empty; } } catch (MobyException e) { - System.err.println("error in getService 1:\n" + e.getMessage()); + log.error("error in getService 1:\n" + e.getMessage()); return empty; } // set up the query service @@ -710,7 +542,7 @@ try { services = central.findService(service); } catch (MobyException e1) { - System.err.println("error in getService 2:\n" + e1.getMessage()); + log.error("error in getService 2:\n" + e1.getMessage()); return empty; } // only one service should be returned! @@ -794,9 +626,10 @@ { // add meta information on whether or not this service is // callable (i.e. times out or not) + if (useLSIDs) try { URL _url_ = new URL( - "http://mobycentral.icapture.ubc.ca:8090/servlets/ValidateService?authority=" + SERVER + "ValidateService?authority=" + services[i].getAuthority() + "&service=" + services[i].getName()); BufferedReader in = new BufferedReader( @@ -1016,7 +849,7 @@ // should not be here, but ... } else { // ERROR - System.err.println("Secondary input was not of known subtype (Secondary)"); + log.error("Secondary input was not of known subtype (Secondary)"); return null; } } @@ -1170,28 +1003,7 @@ MobyService[] services = null; // initialize central try { - String registryURL; - String registryNamespace; - Map map = RegistryOS.getEnv(); - if (!map.isEmpty()) { - registryURL = (String) map.get("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - log.info("Using URL: " + registryURL + " URI: " + registryNamespace); - if (registryURL == null) { - // use default registry, since we dont have a local one - central = new CentralImpl(); - } else if (registryNamespace == null) { - // use default namespace since one isnt defined - central = new CentralImpl(registryURL); - } else { - // use defined url and namespacce - central = new CentralImpl(registryURL, registryNamespace); - } - } else { - // use default registry since we cant determine if local one - // exists - central = new CentralImpl(); - } + central = getCentralImpl(); } catch (MobyException e) { return false; } @@ -1213,28 +1025,7 @@ MobyService[] services = null; // initialize central try { - String registryURL; - String registryNamespace; - Map map = RegistryOS.getEnv(); - if (!map.isEmpty()) { - registryURL = (String) map.get("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - log.info("Using URL: " + registryURL + " URI: " + registryNamespace); - if (registryURL == null) { - // use default registry, since we dont have a local one - central = new CentralImpl(); - } else if (registryNamespace == null) { - // use default namespace since one isnt defined - central = new CentralImpl(registryURL); - } else { - // use defined url and namespacce - central = new CentralImpl(registryURL, registryNamespace); - } - } else { - // use default registry since we cant determine if local one - // exists - central = new CentralImpl(); - } + central = getCentralImpl(); } catch (MobyException e) { return false; } @@ -1262,32 +1053,7 @@ MobyService[] services = null; // initialize central try { - String registryURL; - String registryNamespace; - Map map = RegistryOS.getEnv(); - if (!map.isEmpty()) { - registryURL = (String) map.get("MOBY_SERVER"); - registryNamespace = (String) map.get("MOBY_URI"); - if (registryURL == null) { - // use default registry, since we dont have a local one - central = new CentralImpl(); - } else if (registryNamespace == null) { - // use default namespace since one isnt defined - central = new CentralImpl(registryURL); - } else { - // use defined url and namespacce - central = new CentralImpl(registryURL, registryNamespace); - } - log.info("Using URL: " - + (registryURL == null ? CentralImpl.DEFAULT_ENDPOINT : registryURL) - + " URI: " - + (registryNamespace == null ? CentralImpl.DEFAULT_NAMESPACE - : registryNamespace)); - } else { - // use default registry since we cant determine if local one - // exists - central = new CentralImpl(); - } + central = getCentralImpl(); } catch (MobyException e) { return ""; } @@ -1324,7 +1090,7 @@ // false)); // log.info(findService("bioinfo.icapture.ubc.ca","MOBYSHoundGetGenBankGFF", // false)); - log.info(findService("genome.imim.es", null, false)); + log.info(findService("blah.blah.blah", "Echo_test", "http://bioinfo.icapture.ubc.ca/cgi-bin/mobycentral/MOBY-Central.pl", "http://bioinfo.icapture.ubc.ca/MOBY/Central", false)); // log.info(findService("", "", false)); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/RDFConfigure.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/RDFConfigure.java 2006/08/28 13:50:13 1.21 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/RDFConfigure.java 2006/10/11 01:54:51 1.22 @@ -5,19 +5,15 @@ import java.io.IOException; import java.io.OutputStream; import java.net.URL; -import java.util.HashMap; import java.util.Map; -import java.util.Properties; -import javax.naming.Context; -import javax.naming.InitialContext; - -import org.biomoby.client.CentralImpl; +import org.apache.commons.discovery.tools.DiscoverSingleton; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.biomoby.client.rdf.vocabulary.DC_PROTEGE; import org.biomoby.client.rdf.vocabulary.Predicates; -import org.biomoby.registry.properties.MobyProperties; -import org.biomoby.shared.Central; -import org.biomoby.shared.MobyResourceRef; +import org.biomoby.client.ui.graphical.servlet.jresources.RESOURCE; +import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; @@ -54,84 +50,53 @@ */ @SuppressWarnings("unchecked") public class RDFConfigure { + private static Log log = LogFactory.getLog(RESOURCE.class); + + final private static String newline = System.getProperty("line.separator"); + final public static String URI_OBJECT; + + final public static String URI_SERVICE; + + final public static String URI_NAMESPACE; + + final public static String URI_PREDICATE; + + final public static String URI_ServiceINSTANCE; /* * Some constants for use in the rdfs */ - private static Map URI_MAP = new HashMap(); + static { - boolean __success = false; - // attempt 1 - servlet context + ContextLoader cLoader = null; try { - Context c = new InitialContext(); - String MOBY_SERVER = (String) c.lookup("java:comp/env/MOBY_SERVER"); - if (MOBY_SERVER != null && !MOBY_SERVER.equals("")) { - Central central = new CentralImpl(MOBY_SERVER); - MobyResourceRef[] refs = central.getResourceRefs(); - for (int i = 0; i < refs.length; i++) { - String url = refs[i].getResourceLocation().toExternalForm(); - if (url.lastIndexOf("#") < 0) - url = url + "#"; - URI_MAP.put(refs[i].getResourceName(), url); - } - __success = true; - } - + cLoader = (ContextLoader) DiscoverSingleton.find(Class + .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( + (String) ContextLoader.class.getCanonicalName()).getName()); + log + .info((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" + : "ContextLoader has loaded successfully.")); } catch (Exception e) { - e.printStackTrace(); + log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" + + System.getProperty("line.separator") + e.getMessage()); } - // attempt 2 - environment variables - if (!__success) { - // maybe try for environment variables - Properties p = MobyProperties.PROPERTIES(); - String MOBY_SERVER = (String) p.get("MOBY_SERVER"); - try { - if (MOBY_SERVER != null && !MOBY_SERVER.equals("")) { - Central central = new CentralImpl(MOBY_SERVER); - MobyResourceRef[] refs = central.getResourceRefs(); - for (int i = 0; i < refs.length; i++) { - String url = refs[i].getResourceLocation().toExternalForm(); - if (url.lastIndexOf("#") < 0) - url = url + "#"; - URI_MAP.put(refs[i].getResourceName(), url); - } - __success = true; - } - } catch (Exception ex) { - // die here? - ex.printStackTrace(); - } - } - // attempt 3 - default to mobycentral - if (!__success) { - // default to mobycentral - try { - Central central = new CentralImpl(); - MobyResourceRef[] refs = central.getResourceRefs(); - for (int i = 0; i < refs.length; i++) { - String url = refs[i].getResourceLocation().toExternalForm(); - if (url.lastIndexOf("#") < 0) - url = url + "#"; - URI_MAP.put(refs[i].getResourceName(), url); - } - __success = true; - } catch (Exception ex) { - // die here? - ex.printStackTrace(); - } - } - } + + log.info("Setting RDF ResourceLocations (RDFConfigure) for current registry..."); - final public static String URI_OBJECT = (String) URI_MAP.get("Object"); // "http://biomoby.org/RESOURCES/MOBY-S/Objects#"; + + URI_OBJECT = (String) cLoader.getURI_MAP().get("Object"); - final public static String URI_SERVICE = (String) URI_MAP.get("Service"); // "http://biomoby.org/RESOURCES/MOBY-S/Services#"; + URI_SERVICE = (String) cLoader.getURI_MAP().get("Service"); - final public static String URI_NAMESPACE = (String) URI_MAP.get("Namespace"); // "http://biomoby.org/RESOURCES/MOBY-S/Namespaces#"; + URI_NAMESPACE = (String) cLoader.getURI_MAP().get("Namespace"); - final public static String URI_PREDICATE = "http://biomoby.org/RESOURCES/MOBY-S/Predicates#"; + URI_PREDICATE = "http://biomoby.org/RESOURCES/MOBY-S/Predicates#"; + + URI_ServiceINSTANCE = (String) cLoader.getURI_MAP().get("ServiceInstance"); + } - final public static String URI_ServiceINSTANCE = (String) URI_MAP.get("ServiceInstance"); // "http://biomoby.org/RESOURCES/MOBY-S/ServiceInstances#"; + private Model model = null; From kawas at dev.open-bio.org Wed Oct 11 01:55:44 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 10 Oct 2006 21:55:44 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610110155.k9B1thpg025500@dev.open-bio.org> kawas Tue Oct 10 21:55:43 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jTypes In directory dev.open-bio.org:/tmp/cvs-serv25465/Java/src/main/org/biomoby/client/ui/graphical/servlet/jTypes Modified Files: Types.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jTypes Types.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jTypes/Types.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/ui/graphical/servlet/jTypes/Types.java 2006/05/24 18:48:31 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jTypes/Types.java 2006/10/11 01:55:43 1.7 @@ -5,8 +5,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.naming.Context; -import javax.naming.InitialContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; @@ -32,46 +30,7 @@ * @see javax.servlet.GenericServlet#init() */ public final void init() throws ServletException { - // super.init(); - // try to load environment variables set in context.xml - try { - Context c = new InitialContext(); - - try { - String MOBY_CENTRAL_CONFIG = null; - MOBY_CENTRAL_CONFIG = (String) c.lookup("java:comp/env/MOBY_CENTRAL_CONFIG"); - if (MOBY_CENTRAL_CONFIG != null && !MOBY_CENTRAL_CONFIG.equals("")) { - // set MOBY_CENTRAL_CONFIG - log.info("init(setting MOBY_CENTRAL_CONFIG)"); - System.setProperty("MOBY_CENTRAL_CONFIG", MOBY_CENTRAL_CONFIG); - } - - } catch (Exception ex) { - } - try { - String MOBY_SERVER = null; - MOBY_SERVER = (String) c.lookup("java:comp/env/MOBY_SERVER"); - if (MOBY_SERVER != null && !MOBY_SERVER.equals("")) { - // set MOBY_SERVER - log.info("init(setting MOBY_SERVER)"); - System.setProperty("MOBY_SERVER", MOBY_SERVER); - } - } catch (Exception ex) { - } - - try { - String MOBY_URI = null; - MOBY_URI = (String) c.lookup("java:comp/env/MOBY_URI"); - if (MOBY_URI != null && !MOBY_URI.equals("")) { - // set MOBY_URI - log.info("init(setting MOBY_URI)"); - System.setProperty("MOBY_URI", MOBY_URI); - } - } catch (Exception ex) { - } - - } catch (Exception e) { - } + } /* (non-Javadoc) @@ -87,7 +46,7 @@ Pattern p ; Matcher m ; if (path == null) { - response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Please specify which definitions you are looking for (Objects, Services, or Namespaces)."); + response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Please specify which definitions you are looking for (i.e., Objects, Services, or Namespaces)."); return; } p = Pattern.compile("/Services\\S*"); From kawas at dev.open-bio.org Wed Oct 11 20:39:32 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Wed, 11 Oct 2006 16:39:32 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610112039.k9BKdWVK027958@dev.open-bio.org> kawas Wed Oct 11 16:39:31 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv27923/Java/docs Modified Files: RegistryServlets.html Log Message: Added some configuration information. moby-live/Java/docs RegistryServlets.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/RegistryServlets.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/RegistryServlets.html 2006/10/10 18:51:50 1.1 +++ /home/repository/moby/moby-live/Java/docs/RegistryServlets.html 2006/10/11 20:39:31 1.2 @@ -4,6 +4,11 @@ Registry Servlets +

        BioMOBY Registry Servlets

        @@ -15,7 +20,7 @@
      23. Types 'script' - a servlet that is used to generate textual dumps for the Object, Namespace and Service Type ontologies.
      24. LSID Authority Servlet - a servlet that is used to resolve biomoby.org*, LSIDs to metadata.
      25. Service Tester Servlet - a servlet that periodically 'pings' the services contained in the registry to determine whether or not the services URL are resolvable.
      26. -
      27. RDFAgent Validator - a servlet that can be used to test whether your installation of the agent was successful, or to test an RDF document that describes your services for syntatical errors.
      28. +
      29. RDFAgent Validator - a servlet that can be used to test whether your installation of the agent was successful, or to test an RDF document that describes your services for syntactical errors.
      30. LSID client web applications that can be used to resolve LSIDs. One of these applications uses AJAX and provides auto complete functionality.
      31. @@ -41,8 +46,13 @@

        Installing the Servlets

        Installing the servlets is extremely straight-forward and quite easy.

          -
        1. Download the installation file from ...
        2. -
        3. Run the installer, making sure to follow the on screen prompts.
        4. +
        5. Download the installation file from http://bioinfo.icapture.ubc.ca/ekawas/servlets/install.jar
          +
          +
        6. +
        7. From the command line, enter the following command
          +
          java -jar install.jar
          +

          A GUI should result that will guide you through the installation process.

          +
        8. Your done! Now all you have to do is configure your newly installed servlets.
        @@ -55,7 +65,15 @@
      32. The exact location of the mobycentral.config (confused? refer here)
      33. Your JAVA J2EE servers complete address
      34. -

        Once you have those values, you will have to modify the servlets configuration file that is located at /path/to/tomcat/webapps/authority/META-INF/context.xml

        +
        +

        How to Configure

        + +
        +

        Once you have those values, you will have to modify the servlets configuration file that is located at /path/to/tomcat/webapps/authority/META-INF/context.xml

        The file context.xml is written in XML and contains numerous entries that look like this:

         	
        @@ -115,12 +133,14 @@
                 
      - - -
      - (ID :)
      suffix The file name suffix
      For a more precise explanation of how to configure this aspect of the servlets, please refer to http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html
      +

      +
      +

      For a more precise explanation of how to configure this aspect of the servlets, please refer to
      http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html

      +
      +

      Once you have modified these parameters in this file, you may close the file.

      -

      Next, you will have to open the file mobycentral.config and add or modify a couple of configuration parameters:

      +

      Next, you will have to open the file mobycentral.config and add or modify a couple of configuration parameters:

    • To the [mobycentral] section of this file, please ensure that the following parameters are set:
    • @@ -164,7 +184,7 @@

       

      -
    • To the [mobynamespace] section of this file, please ensure that the following parameters are set:
    • +
    • To the [mobynamespace] section of this file, please ensure that the following parameters are set:
    • @@ -183,7 +203,7 @@
      lsid_authority

       

      -
    • To the [mobyservice] section of this file, please ensure that the following parameters are set:
    • +
    • To the [mobyservice] section of this file, please ensure that the following parameters are set:
    • @@ -201,16 +221,50 @@

      This value is most likely: http://yourDomain:yourPort/authority/RESOURCES/MOBY-S/ServiceTypes

      lsid_authority
      -

      Once these values have been added or modified, make sure to save the configuration files and restart the server. Your changes should be reflected in your registry.

      +

       

      +

      To enable the LSID authority servlets, you will have to perform up to 2 more tasks:

      +
        +
      • Create a DNS record for your domain
      • +
      • Add ProxyPass directives to your Apache servers' configuration file (optional)
      • +
      +

      Setting up DNS (excerpt)

      +
      +

      All that you - or your system administrator - must do, is to add a service record for the machine that will run the authority.

      +

      Suppose the machine is authority.company.net and that it will serve as the authority named company.net. Further suppose that the service will be on port 8080. The record that must be added should go into the master zone file for company.net's DNS server (perhaps a file named /var/named/company.net.zone on company.net):

      +
      _lsid._tcp      IN      SRV     1       0       8080    authority.company.net.
      +

      If the authority name is supposed to be authority.company.net rather than company.net, the record in company.net's zone file should look like:

      +
      _lsid._tcp.authority    IN      SRV     1       0       8080    authority.company.net. 
      +

    +
    +

    Enabling ProxyPass Apache Directives

    +
    +

    For those of you that are running Tomcat on a non-standard port, you may find that users of your registry cannot access those ports due to firewall restrictions. One way around this is to set up ProxyPass directives in your web server.

    +

    Before you begin, it is highly recommended that you backup any files mentioned here that you will be updating.

    +

    Open up your Apache servers httpd.conf file and make sure that following line is uncommented:

    +
    LoadModule proxy_module modules/mod_proxy.so 
    +

    Then add the following to the bottom of the file

    +
    +ProxyPass /authority http://localhost:8080/authority
    +ProxyPass /authority/ http://localhost:8080/authority/
    +ProxyPass authority http://localhost:8080/authority
    +ProxyPass authority/ http://localhost:8080/authority/ 
    + Now requests made to localhost/authority will be sent to localhost:8080/authority and your users should not have any problems accessing the URLs.
    +
    +

    Once these values have been added or modified, make sure to save the configuration files and restart the server. Your changes should be reflected in your registry.

    Testing Your Servlets

    -

    +

    Once you have installed and configured the servlets, you can determine if the install was successful by attempting to resolve the following URL:

    +
    +

    http://your.domain.com:your_port/authority/moby.jsp

    +
    +

    where your.domain.com is the domain name of the server that the servlets were installed on and your_port is the server port.

    +

    The resulting page will outline those servlets that are included in this distribution and will provide you with links to test them.


    - Edward A Kawas
    + Edward A Kawas
    From kawas at dev.open-bio.org Thu Oct 12 01:55:20 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Wed, 11 Oct 2006 21:55:20 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610120155.k9C1tKjF029640@dev.open-bio.org> kawas Wed Oct 11 21:55:20 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities In directory dev.open-bio.org:/tmp/cvs-serv29605/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities Modified Files: ServiceTester.java Log Message: services with urls that were 'localhost' caused the tester to perform inadequately ;-) moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities ServiceTester.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ServiceTester.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/ui/graphical/servlet/utilities/ServiceTester.java 2006/10/11 01:54:50 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ServiceTester.java 2006/10/12 01:55:20 1.5 @@ -94,16 +94,21 @@ // avoid indexing errors (we checked the length before entering loop) if (i >= services.length) break; - MobyService service = services[i]; + MobyService service = services[i++]; String authority = service.getAuthority(); String name = service.getName(); if (service.getURL().toLowerCase().startsWith("http://localhost") || service.getURL().toLowerCase().startsWith("http://127.0.0.1")) { - continue; + Map list = null; + if (theMap.containsKey(authority)) + list = (Map) theMap.get(authority); + else + list = Collections.synchronizedMap(new HashMap()); + list.put(name, new Boolean(false)); + theMap.put(authority, list); } testers[j] = new TesterThread(service); testers[j].start(); - i++; } } else { // should in theory have no more services to test ... @@ -314,4 +319,10 @@ public void setNumThreads(int numThreads) { this.numThreads = numThreads; } + public static void main(String[] args) throws MobyException { + ServiceTester s = new ServiceTester("http://localhost/cgi-bin/MOBY-Central.pl","http://localhost/MOBY/Central"); + s.testServices(s.getServices()); + System.out.println(s.getResults()); + + } } From kawas at dev.open-bio.org Thu Oct 12 14:01:15 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 12 Oct 2006 10:01:15 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610121401.k9CE1FXd008836@dev.open-bio.org> kawas Thu Oct 12 10:01:14 EDT 2006 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv8801 Modified Files: Central.pm Log Message: updated an address moby-live/Perl/MOBY Central.pm,1.260,1.261 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.260 retrieving revision 1.261 diff -u -r1.260 -r1.261 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2006/10/06 17:51:50 1.260 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2006/10/12 14:01:14 1.261 @@ -1439,7 +1439,7 @@ sub _getServiceInstanceRDF { my ( %args ) = @_; my $browser = LWP::UserAgent->new; - my $url = URI->new( 'http://mobycentral.icapture.ubc.ca/servlets/RDFGenerator' ); + my $url = URI->new( 'http://mobycentral.icapture.ubc.ca/authority/RDFGenerator' ); # makes an object representing the URL $url->query_form( # And here the form data pairs: 'name' => $args{name}, From kawas at dev.open-bio.org Thu Oct 12 16:57:14 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Thu, 12 Oct 2006 12:57:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610121657.k9CGvEeZ009629@dev.open-bio.org> kawas Thu Oct 12 12:57:14 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder In directory dev.open-bio.org:/tmp/cvs-serv9593/Java/src/main/org/biomoby/client/rdf/builder Modified Files: ServiceInstanceRDF.java Log Message: update that sets isAlive to true if information is not available at the time of RDF creation moby-live/Java/src/main/org/biomoby/client/rdf/builder ServiceInstanceRDF.java,1.31,1.32 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2006/10/11 01:54:51 1.31 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2006/10/12 16:57:14 1.32 @@ -639,13 +639,22 @@ in.close(); if (inputLine != null) { inputLine = inputLine.trim(); - if (!inputLine.equals("")) { + if (!inputLine.equals("") && (inputLine.equals("true") || inputLine.equals("false"))) { subject.addProperty(model.createProperty(FetaVocabulary.getURI() + "isAlive"), Boolean.valueOf(inputLine)); + } else { + // defaults to true + subject.addProperty(model.createProperty(FetaVocabulary.getURI() + + "isAlive"), true); } + } else { + subject.addProperty(model.createProperty(FetaVocabulary.getURI() + + "isAlive"), true); } } catch (Exception e) { + subject.addProperty(model.createProperty(FetaVocabulary.getURI() + + "isAlive"), true); } } // create the organization node From senger at dev.open-bio.org Fri Oct 13 21:47:09 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:47:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132147.k9DLl9Pr019506@dev.open-bio.org> senger Fri Oct 13 17:47:09 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY In directory dev.open-bio.org:/tmp/cvs-serv19488/MOSES/MOBY Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY added to the repository moby-live/Java/src/Perl/MOSES/MOBY - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 21:46:58 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:46:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132146.k9DLkwu7019467@dev.open-bio.org> senger Fri Oct 13 17:46:58 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES In directory dev.open-bio.org:/tmp/cvs-serv19449/MOSES Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/MOSES added to the repository moby-live/Java/src/Perl/MOSES - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 21:48:30 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:48:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132148.k9DLmUCW019545@dev.open-bio.org> senger Fri Oct 13 17:48:29 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Cache In directory dev.open-bio.org:/tmp/cvs-serv19527/MOSES/MOBY/Cache Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Cache added to the repository moby-live/Java/src/Perl/MOSES/MOBY/Cache - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Cache/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Cache/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Cache/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 21:48:30 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:48:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132148.k9DLmUQe019562@dev.open-bio.org> senger Fri Oct 13 17:48:30 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Data In directory dev.open-bio.org:/tmp/cvs-serv19527/MOSES/MOBY/Data Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Data added to the repository moby-live/Java/src/Perl/MOSES/MOBY/Data - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Data/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Data/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Data/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 21:48:30 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:48:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132148.k9DLmUlT019600@dev.open-bio.org> senger Fri Oct 13 17:48:30 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators In directory dev.open-bio.org:/tmp/cvs-serv19527/MOSES/MOBY/Generators Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators added to the repository moby-live/Java/src/Perl/MOSES/MOBY/Generators - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 21:48:30 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:48:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132148.k9DLmUIQ019581@dev.open-bio.org> senger Fri Oct 13 17:48:30 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Def In directory dev.open-bio.org:/tmp/cvs-serv19527/MOSES/MOBY/Def Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Def added to the repository moby-live/Java/src/Perl/MOSES/MOBY/Def - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Def/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Def/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Def/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 21:48:30 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:48:30 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132148.k9DLmU1c019623@dev.open-bio.org> senger Fri Oct 13 17:48:30 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Service In directory dev.open-bio.org:/tmp/cvs-serv19527/MOSES/MOBY/Service Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Service added to the repository moby-live/Java/src/Perl/MOSES/MOBY/Service - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Service/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Service/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Service/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 21:50:06 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:50:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132150.k9DLo6m4019668@dev.open-bio.org> senger Fri Oct 13 17:50:05 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/templates In directory dev.open-bio.org:/tmp/cvs-serv19650/MOSES/MOBY/Generators/templates Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/templates added to the repository moby-live/Java/src/Perl/MOSES/MOBY/Generators/templates - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/templates/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/templates/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/templates/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 21:51:16 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:51:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132151.k9DLpGZE019704@dev.open-bio.org> senger Fri Oct 13 17:51:16 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY In directory dev.open-bio.org:/tmp/cvs-serv19689/MOSES/MOBY Added Files: Base.pm Config.pm Package.pm Parser.pm ServiceException.pm Tags.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOSES/MOBY Base.pm,NONE,1.1 Config.pm,NONE,1.1 Package.pm,NONE,1.1 Parser.pm,NONE,1.1 ServiceException.pm,NONE,1.1 Tags.pm,NONE,1.1 From senger at dev.open-bio.org Fri Oct 13 21:51:16 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:51:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132151.k9DLpGhG019718@dev.open-bio.org> senger Fri Oct 13 17:51:16 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Cache In directory dev.open-bio.org:/tmp/cvs-serv19689/MOSES/MOBY/Cache Added Files: Central.pm Registries.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOSES/MOBY/Cache Central.pm,NONE,1.1 Registries.pm,NONE,1.1 From senger at dev.open-bio.org Fri Oct 13 21:51:17 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:51:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132151.k9DLpHgn019786@dev.open-bio.org> senger Fri Oct 13 17:51:17 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators/templates In directory dev.open-bio.org:/tmp/cvs-serv19689/MOSES/MOBY/Generators/templates Added Files: datatype.tt service-base.tt service.tt Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOSES/MOBY/Generators/templates datatype.tt,NONE,1.1 service-base.tt,NONE,1.1 service.tt,NONE,1.1 From senger at dev.open-bio.org Fri Oct 13 21:51:16 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:51:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132151.k9DLpG2B019752@dev.open-bio.org> senger Fri Oct 13 17:51:16 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Def In directory dev.open-bio.org:/tmp/cvs-serv19689/MOSES/MOBY/Def Added Files: Data.pm DataType.pm Namespace.pm Relationship.pm Service.pm ServiceType.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOSES/MOBY/Def Data.pm,NONE,1.1 DataType.pm,NONE,1.1 Namespace.pm,NONE,1.1 Relationship.pm,NONE,1.1 Service.pm,NONE,1.1 ServiceType.pm,NONE,1.1 From senger at dev.open-bio.org Fri Oct 13 21:51:17 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:51:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132151.k9DLpHM3019806@dev.open-bio.org> senger Fri Oct 13 17:51:17 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Service In directory dev.open-bio.org:/tmp/cvs-serv19689/MOSES/MOBY/Service Added Files: ServiceBase.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOSES/MOBY/Service ServiceBase.pm,NONE,1.1 From senger at dev.open-bio.org Fri Oct 13 21:51:16 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:51:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132151.k9DLpGWA019734@dev.open-bio.org> senger Fri Oct 13 17:51:16 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Data In directory dev.open-bio.org:/tmp/cvs-serv19689/MOSES/MOBY/Data Added Files: Boolean.pm DateTime.pm Float.pm Integer.pm Object.pm ProvisionInformation.pm String.pm Xref.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOSES/MOBY/Data Boolean.pm,NONE,1.1 DateTime.pm,NONE,1.1 Float.pm,NONE,1.1 Integer.pm,NONE,1.1 Object.pm,NONE,1.1 ProvisionInformation.pm,NONE,1.1 String.pm,NONE,1.1 Xref.pm,NONE,1.1 From senger at dev.open-bio.org Fri Oct 13 21:51:17 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 17:51:17 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132151.k9DLpHlp019772@dev.open-bio.org> senger Fri Oct 13 17:51:16 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Generators In directory dev.open-bio.org:/tmp/cvs-serv19689/MOSES/MOBY/Generators Added Files: GenServices.pm GenTypes.pm Utils.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOSES/MOBY/Generators GenServices.pm,NONE,1.1 GenTypes.pm,NONE,1.1 Utils.pm,NONE,1.1 From senger at dev.open-bio.org Fri Oct 13 22:07:56 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:07:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132207.k9DM7uxg019879@dev.open-bio.org> senger Fri Oct 13 18:07:56 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv19857/MOBY Removed Files: Base.pm Config.pm Package.pm Parser.pm ServiceException.pm Tags.pm notes Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOBY Base.pm,1.20,NONE Config.pm,1.4,NONE Package.pm,1.8,NONE Parser.pm,1.23,NONE ServiceException.pm,1.4,NONE Tags.pm,1.3,NONE notes,1.22,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/RCS/Base.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/RCS/Config.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/RCS/Package.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/RCS/Parser.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/RCS/ServiceException.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/RCS/Tags.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/RCS/notes,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 22:07:56 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:07:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132207.k9DM7uuT019919@dev.open-bio.org> senger Fri Oct 13 18:07:56 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data In directory dev.open-bio.org:/tmp/cvs-serv19857/MOBY/Data Removed Files: Boolean.pm DateTime.pm Float.pm Integer.pm Object.pm ProvisionInformation.pm String.pm Xref.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOBY/Data Boolean.pm,1.2,NONE DateTime.pm,1.1,NONE Float.pm,1.1,NONE Integer.pm,1.1,NONE Object.pm,1.8,NONE ProvisionInformation.pm,1.3,NONE String.pm,1.1,NONE Xref.pm,1.3,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data/RCS/Boolean.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data/RCS/DateTime.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data/RCS/Float.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data/RCS/Integer.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data/RCS/Object.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data/RCS/ProvisionInformation.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data/RCS/String.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Data/RCS/Xref.pm,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 22:07:57 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:07:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132207.k9DM7v0T020006@dev.open-bio.org> senger Fri Oct 13 18:07:57 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOBY/Service In directory dev.open-bio.org:/tmp/cvs-serv19857/MOBY/Service Removed Files: ServiceBase.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOBY/Service ServiceBase.pm,1.6,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Service/RCS/ServiceBase.pm,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 22:07:56 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:07:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132207.k9DM7udI019939@dev.open-bio.org> senger Fri Oct 13 18:07:56 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOBY/Def In directory dev.open-bio.org:/tmp/cvs-serv19857/MOBY/Def Removed Files: Data.pm DataType.pm Namespace.pm Relationship.pm Service.pm ServiceType.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOBY/Def Data.pm,1.5,NONE DataType.pm,1.8,NONE Namespace.pm,1.3,NONE Relationship.pm,1.4,NONE Service.pm,1.4,NONE ServiceType.pm,1.3,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Def/RCS/Data.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Def/RCS/DataType.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Def/RCS/Namespace.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Def/RCS/Relationship.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Def/RCS/Service.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Def/RCS/ServiceType.pm,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 22:07:57 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:07:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132207.k9DM7vN1019979@dev.open-bio.org> senger Fri Oct 13 18:07:57 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOBY/Generators/templates In directory dev.open-bio.org:/tmp/cvs-serv19857/MOBY/Generators/templates Removed Files: datatype.tt service-base.tt service.tt Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOBY/Generators/templates datatype.tt,1.4,NONE service-base.tt,1.10,NONE service.tt,1.17,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Generators/templates/RCS/datatype.tt,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Generators/templates/RCS/service-base.tt,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Generators/templates/RCS/service.tt,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 22:07:56 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:07:56 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132207.k9DM7uGg019895@dev.open-bio.org> senger Fri Oct 13 18:07:56 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOBY/Cache In directory dev.open-bio.org:/tmp/cvs-serv19857/MOBY/Cache Removed Files: Central.pm Registries.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOBY/Cache Central.pm,1.19,NONE Registries.pm,1.3,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Cache/RCS/Central.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Cache/RCS/Registries.pm,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 22:07:57 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:07:57 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132207.k9DM7vdw019960@dev.open-bio.org> senger Fri Oct 13 18:07:56 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOBY/Generators In directory dev.open-bio.org:/tmp/cvs-serv19857/MOBY/Generators Removed Files: GenServices.pm GenTypes.pm Utils.pm Log Message: new module names for Perl Moses moby-live/Java/src/Perl/MOBY/Generators GenServices.pm,1.17,NONE GenTypes.pm,1.15,NONE Utils.pm,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Generators/RCS/GenServices.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Generators/RCS/GenTypes.pm,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/MOBY/Generators/RCS/Utils.pm,v: No such file or directory From senger at dev.open-bio.org Fri Oct 13 22:08:22 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:08:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132208.k9DM8MQk020046@dev.open-bio.org> senger Fri Oct 13 18:08:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl In directory dev.open-bio.org:/tmp/cvs-serv20031 Added Files: notes Log Message: new module names for Perl Moses moby-live/Java/src/Perl notes,NONE,1.1 From senger at dev.open-bio.org Fri Oct 13 22:08:39 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Fri, 13 Oct 2006 18:08:39 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610132208.k9DM8dhZ020118@dev.open-bio.org> senger Fri Oct 13 18:08:39 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/scripts In directory dev.open-bio.org:/tmp/cvs-serv20067 Modified Files: config-status.pl generate-datatypes.pl generate-services.pl install.pl known-registries.pl local-cache.pl testing-parser.pl testing-service.pl universal-testing.pl Log Message: new module names for Perl Moses moby-live/Java/src/scripts config-status.pl,1.8,1.9 generate-datatypes.pl,1.5,1.6 generate-services.pl,1.6,1.7 install.pl,1.4,1.5 known-registries.pl,1.1,1.2 local-cache.pl,1.4,1.5 testing-parser.pl,1.3,1.4 testing-service.pl,1.6,1.7 universal-testing.pl,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/config-status.pl,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/src/scripts/config-status.pl 2006/07/26 17:57:56 1.8 +++ /home/repository/moby/moby-live/Java/src/scripts/config-status.pl 2006/10/13 22:08:39 1.9 @@ -29,9 +29,9 @@ # ----------------------------------------------------------- use FindBin qw( $Bin ); -use lib "$Bin/../Perl"; # assuming: Perl/MOBY/... +use lib "$Bin/../Perl"; # assuming: Perl/MOSES/... -use MOBY::Base; +use MOSES::MOBY::Base; use strict; $LOG->level ('INFO') if $opt_v; @@ -40,20 +40,20 @@ sub say { print @_, "\n"; } -say "Perl-MoSeS VERSION: $MOBY::Base::VERSION\n"; +say "Perl-MoSeS VERSION: $MOSES::MOBY::Base::VERSION\n"; say 'Configuration'; say '-------------'; -say "Default configuration file: $MOBY::Config::DEFAULT_CONFIG_FILE"; -say "Environment variable $MOBY::Config::ENV_CONFIG_DIR" . - ( exists $ENV{$MOBY::Config::ENV_CONFIG_DIR} ? ": $ENV{$MOBY::Config::ENV_CONFIG_DIR}" : ' is not set'); +say "Default configuration file: $MOSES::MOBY::Config::DEFAULT_CONFIG_FILE"; +say "Environment variable $MOSES::MOBY::Config::ENV_CONFIG_DIR" . + ( exists $ENV{$MOSES::MOBY::Config::ENV_CONFIG_DIR} ? ": $ENV{$MOSES::MOBY::Config::ENV_CONFIG_DIR}" : ' is not set'); say 'Successfully read configuration files:'; -foreach my $file (MOBY::Config->ok_files) { +foreach my $file (MOSES::MOBY::Config->ok_files) { say "\t$file"; } -my %failed = MOBY::Config->failed_files; +my %failed = MOSES::MOBY::Config->failed_files; if (keys %failed > 0) { say 'Failed configuration files:'; foreach my $file (sort keys %failed) { @@ -63,8 +63,8 @@ } say 'All configuration parameters:'; -foreach my $name (sort MOBY::Config->param()) { - say "\t$name => " . MOBY::Config->param ($name); +foreach my $name (sort MOSES::MOBY::Config->param()) { + say "\t$name => " . MOSES::MOBY::Config->param ($name); } say 'All imported names (equivalent to parameters above): '; @@ -85,7 +85,7 @@ say 'Logging'; say '-------'; -my $logger_name = $MOBY::Base::LOGGER_NAME; +my $logger_name = $MOSES::MOBY::Base::LOGGER_NAME; my $logger = Log::Log4perl->get_logger ($logger_name); say "Logger name (use it in the configuration file): $logger_name"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/generate-datatypes.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/scripts/generate-datatypes.pl 2006/07/08 03:52:17 1.5 +++ /home/repository/moby/moby-live/Java/src/scripts/generate-datatypes.pl 2006/10/13 22:08:39 1.6 @@ -34,19 +34,19 @@ # ----------------------------------------------------------- use FindBin qw( $Bin ); -use lib "$Bin/../Perl"; # assuming: Perl/MOBY/... +use lib "$Bin/../Perl"; # assuming: Perl/MOSES/... # scripts/generate-datatypes.pl use strict; -use MOBY::Base; -use MOBY::Generators::GenTypes; +use MOSES::MOBY::Base; +use MOSES::MOBY::Generators::GenTypes; $LOG->level ('INFO') if $opt_v; $LOG->level ('DEBUG') if $opt_d; sub say { print @_, "\n"; } -my $generator = new MOBY::Generators::GenTypes; +my $generator = new MOSES::MOBY::Generators::GenTypes; if (@ARGV) { say 'Generating ' . (@ARGV+0) . '+ data types.'; if ($opt_s) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/generate-services.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/scripts/generate-services.pl 2006/07/30 12:56:56 1.6 +++ /home/repository/moby/moby-live/Java/src/scripts/generate-services.pl 2006/10/13 22:08:39 1.7 @@ -50,12 +50,12 @@ # ----------------------------------------------------------- use FindBin qw( $Bin ); -use lib "$Bin/../Perl"; # assuming: Perl/MOBY/... +use lib "$Bin/../Perl"; # assuming: Perl/MOSES/... # scripts/generate-services.pl use strict; -use MOBY::Base; -use MOBY::Generators::GenServices; +use MOSES::MOBY::Base; +use MOSES::MOBY::Generators::GenServices; $LOG->level ('INFO') if $opt_v; $LOG->level ('DEBUG') if $opt_d; @@ -63,7 +63,7 @@ sub say { print @_, "\n"; } -my $generator = new MOBY::Generators::GenServices; +my $generator = new MOSES::MOBY::Generators::GenServices; if ($opt_a) { say 'Generating all services.'; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/install.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/scripts/install.pl 2006/07/30 12:56:56 1.4 +++ /home/repository/moby/moby-live/Java/src/scripts/install.pl 2006/10/13 22:08:39 1.5 @@ -72,13 +72,13 @@ } use FindBin qw( $Bin ); -use lib "$Bin/../Perl"; # assuming: Perl/MOBY/... +use lib "$Bin/../Perl"; # assuming: Perl/MOSES/... # scripts/install.pl use File::Spec; use IO::Prompt; -use MOBY::Base; -use MOBY::Cache::Central; -use MOBY::Cache::Registries; +use MOSES::MOBY::Base; +use MOSES::MOBY::Cache::Central; +use MOSES::MOBY::Cache::Registries; use English qw( -no_match_vars ) ; use strict; @@ -104,8 +104,8 @@ # what registry to use sub prompt_for_registry { - my $cache = new MOBY::Cache::Central; - my @regs = MOBY::Cache::Registries->list; + my $cache = new MOSES::MOBY::Cache::Central; + my @regs = MOSES::MOBY::Cache::Registries->list; my $registry = prompt ("What registry to use? [default] ", -m => [@regs]); $registry ||= 'default'; @@ -214,7 +214,7 @@ if ('y' eq prompt ('Should I try to fill or update the local cache [y]? ', -ynd=>'y')) { $registry = prompt_for_registry; my $details = - MOBY::Cache::Registries->get ($registry); + MOSES::MOBY::Cache::Registries->get ($registry); if ($details) { my $endpoint = $details->{endpoint}; my $uri = $details->{namespace}; @@ -239,8 +239,8 @@ # configuration file (will be found and used, or created) my $config_file = File::Spec->catfile - ($ENV{$MOBY::Config::ENV_CONFIG_DIR} || $pmoses_home, - $MOBY::Config::DEFAULT_CONFIG_FILE); + ($ENV{$MOSES::MOBY::Config::ENV_CONFIG_DIR} || $pmoses_home, + $MOSES::MOBY::Config::DEFAULT_CONFIG_FILE); if (-e $config_file and ! $opt_F) { say "Configuration file $config_file exists."; say "It will be used and not overwritten unless you start 'install.pl -F'.\n"; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/known-registries.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/scripts/known-registries.pl 2006/07/27 17:16:07 1.1 +++ /home/repository/moby/moby-live/Java/src/scripts/known-registries.pl 2006/10/13 22:08:39 1.2 @@ -7,16 +7,16 @@ # ----------------------------------------------------------- use FindBin qw( $Bin ); -use lib "$Bin/../Perl"; # assuming: Perl/MOBY/... +use lib "$Bin/../Perl"; # assuming: Perl/MOSES/... # scripts/install.pl -use MOBY::Cache::Registries; +use MOSES::MOBY::Cache::Registries; use Data::Dumper; use strict; sub say { print @_, "\n"; } -say join (", ", MOBY::Cache::Registries->list); -say (Data::Dumper->Dump ( [ MOBY::Cache::Registries->all ], ['Registries'])); +say join (", ", MOSES::MOBY::Cache::Registries->list); +say (Data::Dumper->Dump ( [ MOSES::MOBY::Cache::Registries->all ], ['Registries'])); __END__ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/local-cache.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/scripts/local-cache.pl 2006/07/27 17:16:07 1.4 +++ /home/repository/moby/moby-live/Java/src/scripts/local-cache.pl 2006/10/13 22:08:39 1.5 @@ -58,28 +58,28 @@ # ----------------------------------------------------------- use FindBin qw( $Bin ); -use lib "$Bin/../Perl"; # assuming: Perl/MOBY/... +use lib "$Bin/../Perl"; # assuming: Perl/MOSES/... # scripts/config-status.pl use strict; -use MOBY::Base; -use MOBY::Cache::Central; -use MOBY::Cache::Registries; +use MOSES::MOBY::Base; +use MOSES::MOBY::Cache::Central; +use MOSES::MOBY::Cache::Registries; $LOG->level ('INFO') if $opt_v; $LOG->level ('DEBUG') if $opt_d; sub say { print @_, "\n"; } -my $cache = new MOBY::Cache::Central; +my $cache = new MOSES::MOBY::Cache::Central; # --- get info if ($opt_i) { say 'Currently used registry: ' . $cache->registry; - say "(it can be changed in $MOBY::Config::DEFAULT_CONFIG_FILE)\n"; + say "(it can be changed in $MOSES::MOBY::Config::DEFAULT_CONFIG_FILE)\n"; my $details = - MOBY::Cache::Registries->get ($cache->registry) || - MOBY::Cache::Registries->get ('default'); + MOSES::MOBY::Cache::Registries->get ($cache->registry) || + MOSES::MOBY::Cache::Registries->get ('default'); foreach my $key (sort keys %{ $details }) { printf " %-12s: %-s\n", $key, $details->{$key}; } @@ -89,9 +89,9 @@ printf "%-13s %+13s %+13s %+10s\n", 'Registry', 'Data types', 'Authorities', 'Services'; - foreach my $reg (MOBY::Cache::Registries->list) { + foreach my $reg (MOSES::MOBY::Cache::Registries->list) { next unless $cache->cache_exists ($reg); - my $new_cache = new MOBY::Cache::Central ( registry => $reg ); + my $new_cache = new MOSES::MOBY::Cache::Central ( registry => $reg ); my $datatypes_count = $new_cache->get_datatype_names; my %authorities = $new_cache->get_service_names; my $services_count = 0; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/testing-parser.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/scripts/testing-parser.pl 2006/07/08 13:52:12 1.3 +++ /home/repository/moby/moby-live/Java/src/scripts/testing-parser.pl 2006/10/13 22:08:39 1.4 @@ -42,12 +42,12 @@ # ----------------------------------------------------------- use FindBin qw( $Bin ); -use lib "$Bin/../Perl"; # assuming: Perl/MOBY/... +use lib "$Bin/../Perl"; # assuming: Perl/MOSES/... # scripts/testing-parser.pl use strict; -use MOBY::Base; -use MOBY::Parser; +use MOSES::MOBY::Base; +use MOSES::MOBY::Parser; $LOG->level ('INFO') if $opt_v; $LOG->level ('DEBUG') if $opt_d; @@ -57,7 +57,7 @@ my ($input_name, $known_type) = split (/\s*:\s*/, $opt_b, 2); push (@parser_args, ( lowestKnownDataTypes => { $input_name => $known_type })); } -my $parser = new MOBY::Parser (@parser_args); +my $parser = new MOSES::MOBY::Parser (@parser_args); my $package = $parser->parse ( method => 'file', data => $ARGV[0] ); print $package unless $opt_n; =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/testing-service.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/src/scripts/testing-service.pl 2006/07/31 15:23:57 1.6 +++ /home/repository/moby/moby-live/Java/src/scripts/testing-service.pl 2006/10/13 22:08:39 1.7 @@ -62,7 +62,7 @@ require lib ; lib->import ("$FindBin::Bin/../Perl/services"); require lib ; lib->import ("$FindBin::Bin/../Perl/generated"); unshift (@INC, $opt_l) if $opt_l; - eval "use MOBY::Base; 1;"; + eval "use MOSES::MOBY::Base; 1;"; $LOG->level ('INFO') if $opt_v; $LOG->level ('DEBUG') if $opt_d; } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/universal-testing.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/scripts/universal-testing.pl 2006/07/26 17:57:56 1.2 +++ /home/repository/moby/moby-live/Java/src/scripts/universal-testing.pl 2006/10/13 22:08:39 1.3 @@ -36,13 +36,13 @@ use Carp; use FindBin qw( $Bin ); -use lib "$Bin/../Perl"; # assuming: Perl/MOBY/... +use lib "$Bin/../Perl"; # assuming: Perl/MOSES/... # scripts/universal-testing.pl use strict; -use MOBY::Base; -use MOBY::Cache::Central; -use MOBY::Generators::GenServices; +use MOSES::MOBY::Base; +use MOSES::MOBY::Cache::Central; +use MOSES::MOBY::Generators::GenServices; use File::Spec; $LOG->level ('INFO') if $opt_v; @@ -50,7 +50,7 @@ sub say { print @_, "\n"; } -my $cache = new MOBY::Cache::Central; +my $cache = new MOSES::MOBY::Cache::Central; my $tmpdir = File::Spec->tmpdir(); # create an empty XML input @@ -69,10 +69,10 @@ # service generator my $outdir = File::Spec->catfile ($tmpdir, 'generated-services'); -MOBY::Config->param ('generators.impl.outdir', $outdir); -MOBY::Config->param ('generators.impl.package.prefix', 'Testing'); +MOSES::MOBY::Config->param ('generators.impl.outdir', $outdir); +MOSES::MOBY::Config->param ('generators.impl.package.prefix', 'Testing'); unshift (@INC, $MOBYCFG::GENERATORS_IMPL_OUTDIR); -my $generator = new MOBY::Generators::GenServices; +my $generator = new MOSES::MOBY::Generators::GenServices; # outputs my $outputs = File::Spec->catfile ($tmpdir, 'generated-outputs'); From senger at dev.open-bio.org Sat Oct 14 16:55:13 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Sat, 14 Oct 2006 12:55:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610141655.k9EGtDSR021540@dev.open-bio.org> senger Sat Oct 14 12:55:12 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs/images In directory dev.open-bio.org:/tmp/cvs-serv21513 Modified Files: PerlMoses-architecture-small.jpg PerlMoses-architecture.jpg PerlMoses-architecture.ppt Log Message: moby-live/Java/docs/images PerlMoses-architecture-small.jpg,1.1,1.2 PerlMoses-architecture.jpg,1.1,1.2 PerlMoses-architecture.ppt,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture-small.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture-small.jpg 2006/07/30 22:41:27 1.1 and /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture-small.jpg 2006/10/14 16:55:12 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture-small.jpg: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture.jpg 2006/07/30 22:41:27 1.1 and /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture.jpg 2006/10/14 16:55:12 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture.jpg: diff failed =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture.ppt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 Binary files /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture.ppt 2006/07/30 22:41:27 1.1 and /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture.ppt 2006/10/14 16:55:12 1.2 differ rcsdiff: /home/repository/moby/moby-live/Java/docs/images/PerlMoses-architecture.ppt: diff failed From senger at dev.open-bio.org Sat Oct 14 18:37:38 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Sat, 14 Oct 2006 14:37:38 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610141837.k9EIbcxf021667@dev.open-bio.org> senger Sat Oct 14 14:37:38 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/samples In directory dev.open-bio.org:/tmp/cvs-serv21649/samples Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/samples added to the repository moby-live/Java/src/Perl/samples - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/samples/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/samples/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/samples/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Sat Oct 14 18:37:53 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Sat, 14 Oct 2006 14:37:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610141837.k9EIbrtj021706@dev.open-bio.org> senger Sat Oct 14 14:37:53 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/samples/Service In directory dev.open-bio.org:/tmp/cvs-serv21688/samples/Service Log Message: Directory /home/repository/moby/moby-live/Java/src/Perl/samples/Service added to the repository moby-live/Java/src/Perl/samples/Service - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/samples/Service/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/samples/Service/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Perl/samples/Service/RCS/directory,v: No such file or directory From senger at dev.open-bio.org Sat Oct 14 18:38:36 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Sat, 14 Oct 2006 14:38:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610141838.k9EIcaPg021756@dev.open-bio.org> senger Sat Oct 14 14:38:36 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/samples/Service In directory dev.open-bio.org:/tmp/cvs-serv21727/samples/Service Added Files: HelloBiomobyWorld.pm Mabuhay.pm Log Message: samples added moby-live/Java/src/Perl/samples/Service HelloBiomobyWorld.pm,NONE,1.1 Mabuhay.pm,NONE,1.1 From senger at dev.open-bio.org Sat Oct 14 18:38:36 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Sat, 14 Oct 2006 14:38:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610141838.k9EIca4i021742@dev.open-bio.org> senger Sat Oct 14 14:38:36 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/samples In directory dev.open-bio.org:/tmp/cvs-serv21727/samples Added Files: SERVICES_TABLE Log Message: samples added moby-live/Java/src/Perl/samples SERVICES_TABLE,NONE,1.1 From senger at dev.open-bio.org Sat Oct 14 20:46:34 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Sat, 14 Oct 2006 16:46:34 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610142046.k9EKkYaS021913@dev.open-bio.org> senger Sat Oct 14 16:46:33 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/samples/Service In directory dev.open-bio.org:/tmp/cvs-serv21894/samples/Service Modified Files: Mabuhay.pm Log Message: moby-live/Java/src/Perl/samples/Service Mabuhay.pm,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Perl/samples/Service/Mabuhay.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Perl/samples/Service/Mabuhay.pm 2006/10/14 18:38:36 1.1 +++ /home/repository/moby/moby-live/Java/src/Perl/samples/Service/Mabuhay.pm 2006/10/14 20:46:33 1.2 @@ -51,6 +51,7 @@ sub process_it { my ($self, $request, $response, $context) = @_; + # read (some) input data # (use eval to protect against missing data) my $language = eval { $request->language }; @@ -81,7 +82,7 @@ foreach my $idx (0 .. $#result_hellos) { $response->add_hello (new MOSES::MOBY::Data::simple_key_value_pair ( key => $self->as_uni_string ($result_langs[$idx]), - value => $self->as_uni_string ($result_hellos[$idx]) + value => $self->as_uni_string ($result_hellos[$idx]), )); } From senger at dev.open-bio.org Sat Oct 14 20:46:55 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Sat, 14 Oct 2006 16:46:55 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610142046.k9EKktsZ021961@dev.open-bio.org> senger Sat Oct 14 16:46:55 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv21934 Modified Files: Dashboard-NOTES.txt Perl-ChangeLog PerlMoses.html Log Message: moby-live/Java/docs Dashboard-NOTES.txt,1.13,1.14 Perl-ChangeLog,1.1,1.2 PerlMoses.html,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/Dashboard-NOTES.txt,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Java/docs/Dashboard-NOTES.txt 2006/07/28 10:41:43 1.13 +++ /home/repository/moby/moby-live/Java/docs/Dashboard-NOTES.txt 2006/10/14 20:46:55 1.14 @@ -43,12 +43,6 @@ * ParemetersTable: - Float field is not verified for non-numeric chars -* to share preferences for contact-email and authority across all - biomoby entities - -* DataTypeTreeTable - - should check for cyclic definition in data types? - * Service Input Data - should deal also with input Collections - and (perhaps?) to allow entering a more specific data type =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/Perl-ChangeLog,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/Perl-ChangeLog 2006/08/01 08:44:32 1.1 +++ /home/repository/moby/moby-live/Java/docs/Perl-ChangeLog 2006/10/14 20:46:55 1.2 @@ -1,5 +1,9 @@ +2006-10-13 Martin Senger + + * BIG change: All modules were renamed from MOBY::* to + MOSES::MOBY::* (in order not to conflict with the old BioMoby Perl + implementtaion (that uses modules named MOBY::*) + 2006-08-01 Martin Senger * Released - - =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/PerlMoses.html,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- /home/repository/moby/moby-live/Java/docs/PerlMoses.html 2006/08/01 14:58:51 1.8 +++ /home/repository/moby/moby-live/Java/docs/PerlMoses.html 2006/10/14 20:46:55 1.9 @@ -181,6 +181,7 @@ data/my-input.xml
    + An output (the same with any input data) is nothing really exciting: @@ -607,22 +608,22 @@
    Each BioMoby data type, as registerd in a BioMoby registry, is represented by a Perl object -MOBY::Data::<moby-data-type-name>. For example, a +MOSES::MOBY::Data::<moby-data-type-name>. For example, a GenericSequence object looks like this:
     #-----------------------------------------------------------------
    -# MOBY::Data::GenericSequence
    +# MOSES::MOBY::Data::GenericSequence
     # Generated: 30-Jul-2006 14:55:09 BST
     # Contact: Martin Senger <martin.senger at gmail.com> or
     #          Edward Kawas <edward.kawas at gmail.com>
     #-----------------------------------------------------------------
    -package MOBY::Data::GenericSequence;
    +package MOSES::MOBY::Data::GenericSequence;
     no strict;
     use vars qw( @ISA );
    - at ISA = qw( MOBY::Data::VirtualSequence );
    + at ISA = qw( MOSES::MOBY::Data::VirtualSequence );
     use strict;
    -use MOBY::Data::Object;
    +use MOSES::MOBY::Data::Object;
     
     #-----------------------------------------------------------------
     # accessible attributes
    @@ -630,7 +631,7 @@
     {
         my %_allowed =
             (
    -         'SequenceString' => {type => 'MOBY::Data::String'},
    +         'SequenceString' => {type => 'MOSES::MOBY::Data::String'},
              );
     
         sub _accessible {
    @@ -721,11 +722,11 @@
     # This is a mandatory section - but you can still choose one of
     # the two options (keep one and commented out the other):
     #-----------------------------------------------------------------
    -use MOBY::Base;
    +use MOSES::MOBY::Base;
     # --- (1) this option loads dynamically everything
     BEGIN {
    -    use MOBY::Generators::GenServices;
    -    new MOBY::Generators::GenServices->load
    +    use MOSES::MOBY::Generators::GenServices;
    +    new MOSES::MOBY::Generators::GenServices->load
     	(authority     => 'samples.jmoby.net',
     	 service_names => ['Mabuhay']);
     }
    @@ -741,8 +742,8 @@
     # (this to stay here with any of the options above)
     use vars qw( @ISA );
     @ISA = qw( net::jmoby::samples::MabuhayBase );
    -use MOBY::Package;
    -use MOBY::ServiceException;
    +use MOSES::MOBY::Package;
    +use MOSES::MOBY::ServiceException;
     use strict;
     
    @@ -771,7 +772,7 @@ # EDIT: PUT REAL VALUES INTO THE RESPONSE # fill the response foreach my $elem (0..2) { - my $hello = new MOBY::Data::simple_key_value_pair + my $hello = new MOSES::MOBY::Data::simple_key_value_pair ( value => "this is a 'value $elem'", # TO BE EDITED key => "this is a 'key $elem'", # TO BE EDITED @@ -867,7 +868,7 @@
    config-status.pl
    This script does not do much but gives you overview of your configuration and installation. You can run it to find how -will Perl Moses behaves when used. For example: +Perl Moses will behave when used. For example:
     Perl-MoSeS VERSION: 0.8
    @@ -950,13 +951,13 @@
            
     2006/07/30 23:00:33 (492) INFO> [[undef]] GenTypes.pm:125 - Data types will be generated into:
            '/home/senger/moby-live/Java/src/scripts/../Perl/generated'
    -2006/07/30 23:00:33 (493) DEBUG> [[undef]] GenTypes.pm:149 - MOBY::Data::BasicGFFSequenceFeature will be generated
    -2006/07/30 23:00:33 (665) DEBUG> [[undef]] GenTypes.pm:149 - MOBY::Data::DNASequence will be generated
    -2006/07/30 23:00:33 (669) DEBUG> [[undef]] GenTypes.pm:149 - MOBY::Data::DNASequenceWithGFFFeatures will be generated
    -2006/07/30 23:00:33 (673) DEBUG> [[undef]] GenTypes.pm:149 - MOBY::Data::GenericSequence will be generated
    -2006/07/30 23:00:33 (676) DEBUG> [[undef]] GenTypes.pm:149 - MOBY::Data::NucleotideSequence will be generated
    -2006/07/30 23:00:33 (680) DEBUG> [[undef]] GenTypes.pm:149 - MOBY::Data::VirtualSequence will be generated
    -2006/07/30 23:00:33 (684) DEBUG> [[undef]] GenTypes.pm:149 - MOBY::Data::multi_key_value_pair will be generated
    +2006/07/30 23:00:33 (493) DEBUG> [[undef]] GenTypes.pm:149 - MOSES::MOBY::Data::BasicGFFSequenceFeature will be generated +2006/07/30 23:00:33 (665) DEBUG> [[undef]] GenTypes.pm:149 - MOSES::MOBY::Data::DNASequence will be generated +2006/07/30 23:00:33 (669) DEBUG> [[undef]] GenTypes.pm:149 - MOSES::MOBY::Data::DNASequenceWithGFFFeatures will be generated +2006/07/30 23:00:33 (673) DEBUG> [[undef]] GenTypes.pm:149 - MOSES::MOBY::Data::GenericSequence will be generated +2006/07/30 23:00:33 (676) DEBUG> [[undef]] GenTypes.pm:149 - MOSES::MOBY::Data::NucleotideSequence will be generated +2006/07/30 23:00:33 (680) DEBUG> [[undef]] GenTypes.pm:149 - MOSES::MOBY::Data::VirtualSequence will be generated +2006/07/30 23:00:33 (684) DEBUG> [[undef]] GenTypes.pm:149 - MOSES::MOBY::Data::multi_key_value_pair will be generated
    An obvious question is "where are the data types generated to"?

    @@ -997,14 +998,14 @@ senger at sherekhan:~/jMoby/src/Perl$ ../scripts/generate-datatypes.pl Generating all data types. Done. -senger at sherekhan:~/jMoby/src/Perl$ for n in generated/MOBY/Data/*.pm ; do perl -c $n ; done -generated/MOBY/Data/ABI_Encoded.pm syntax OK -generated/MOBY/Data/Ace_Text.pm syntax OK -generated/MOBY/Data/Alignment.pm syntax OK +senger at sherekhan:~/jMoby/src/Perl$ for n in generated/MOSES/MOBY/Data/*.pm ; do perl -c $n ; done +generated/MOSES/MOBY/Data/ABI_Encoded.pm syntax OK +generated/MOSES/MOBY/Data/Ace_Text.pm syntax OK +generated/MOSES/MOBY/Data/Alignment.pm syntax OK ... -generated/MOBY/Data/WU_BLAST_Text.pm syntax OK -generated/MOBY/Data/xdom_flatfile.pm syntax OK -generated/MOBY/Data/zPDB.pm syntax OK +generated/MOSES/MOBY/Data/WU_BLAST_Text.pm syntax OK +generated/MOSES/MOBY/Data/xdom_flatfile.pm syntax OK +generated/MOSES/MOBY/Data/zPDB.pm syntax OK senger at sherekhan:~/jMoby/src/Perl$ @@ -1016,7 +1017,7 @@ script).

    Usually, you generate code for one or only several -services. And because all services belong to some authority you need +services. And because each service belongs to an authority you need to tell both:

    @@ -1111,7 +1112,7 @@
       
    known-registries.pl
    The Perl Moses has a hard-coded list of known BioMoby registries. New entries can be added - check the comments in -MOBY::Cache::Registries. Each registry has an abbreviation (a +MOSES::MOBY::Cache::Registries. Each registry has an abbreviation (a synonym) that can be used in Perl Moses configuration - it is easier and less error-prone than using the long registry's endpoint. This script can tell you which registry has which synonym (and few other @@ -1121,7 +1122,7 @@ ../scripts/known-registries.pl
    In the time of writing this documentation, the response was -(note hat one of the registry is labelled as the "default" one): +(note that one of the registries is labeled as the "default" one):
     IRRI, MIPS, default, iCAPTURE, testing
    @@ -1161,7 +1162,7 @@
            }
     };

    - This script does not have any options. + This script does not have any options (nor the help).

    local-cache.pl @@ -1176,15 +1177,15 @@
    ../scripts/local-cache.pl -t DNASequence
    --> MOBY::Def::DataType=HASH(0x86026b8)
    +-> MOSES::MOBY::Def::DataType=HASH(0x86026b8)
        'authority' => 'www.illuminae.com'
        'children' => ARRAY(0x86028b0)
             empty array
        'description' => 'Lightweight representation a DNA sequence'
        'email' => 'markw at illuminae.com'
        'lsid' => 'urn:lsid:biomoby.org:objectclass:DNASequence:2001-09-21T16-00-00Z'
    -   'module_name' => 'MOBY::Data::DNASequence'
    -   'module_parent' => 'MOBY::Data::NucleotideSequence'
    +   'module_name' => 'MOSES::MOBY::Data::DNASequence'
    +   'module_parent' => 'MOSES::MOBY::Data::NucleotideSequence'
        'name' => 'DNASequence'
        'parent' => 'NucleotideSequence'
     
    @@ -1196,16 +1197,16 @@
     All children of 'DNASequence':
    --> MOBY::Def::Relationship=HASH(0x860e608)
    +-> MOSES::MOBY::Def::Relationship=HASH(0x860e608)
        'datatype' => 'String'
        'memberName' => 'SequenceString'
    -   'module_datatype' => 'MOBY::Data::String'
    +   'module_datatype' => 'MOSES::MOBY::Data::String'
        'original_memberName' => 'SequenceString'
        'relationship' => 'HASA'
    --> MOBY::Def::Relationship=HASH(0x863a3bc)
    +-> MOSES::MOBY::Def::Relationship=HASH(0x863a3bc)
        'datatype' => 'Integer'
        'memberName' => 'Length'
    -   'module_datatype' => 'MOBY::Data::Integer'
    +   'module_datatype' => 'MOSES::MOBY::Data::Integer'
        'original_memberName' => 'Length'
        'relationship' => 'HASA'
     
    @@ -1299,8 +1300,8 @@ XML. It always takes an XML file name as a parameter:
    -../scripts/testing-parser.pl jMoby/data/parser-test-input2.xml
    -../scripts/testing-parser.pl -r jMoby/data/parser-test-input2.xml
    +../scripts/testing-parser.pl ~/jMoby/data/parser-test-input2.xml +../scripts/testing-parser.pl -r ~/jMoby/data/parser-test-input2.xml An interesting is the -b parameter. It has the form:
    @@ -1347,9 +1348,9 @@
     
            
    • A mandatory package name - a full package -name of a called service. +name of the called service.
    • Option -l location can be used to -specify a directory where is called service stored. Default is +specify a directory where is the called service stored. Default is src/Perl/services.
    • Options -v and -d make also sense in this mode (but not in the other one). @@ -1358,10 +1359,9 @@
      ../scripts/testing-service.pl -d Service::HelloBiomobyWorld
      - The output of this call was already shown -in the documentation (even though it was an example of the full, -SOAP-based call). Therefore, just look what debug messages were logged -(notice the -d option used): + The output of this call was already shown +in this documentation. Therefore, just look what debug messages were +logged (notice the -d option used):
       2006/07/31 02:19:37 (561) INFO> [23856] HelloBiomobyWorldBase.pm:92 - *** REQUEST START ***
      @@ -1379,7 +1379,7 @@
       
              
      • A mandatory service name (not a package -name) of a called service. +name) of the called service.
      • A mandatory endpoint -e endpoint defining where is the service located. Actually, presence of this parameter decides which mode is used. @@ -1389,6 +1389,16 @@
         ../scripts/testing-service.pl \
                -e http://localhost/cgi-bin/MobyServer.cgi HelloBiomobyWorld
        +

        + + There are also few other behavioral differences between these +two modes: If an input parsing error occurs (e.g. when an input has an +unknown article name), it is reported directly to the standard error +in the testing mode, but in a real mode it is properly included in the +response as an exception. Or (and only if the logging is set to record +debug messages), in testing mode the full input raw (not yet parsed) +are logged, whereas in the real mode only the first 1000 characters +are logged.

        universal-testing.pl @@ -1525,7 +1535,7 @@ Perl Moses stores configuration in a file named moby-services.cfg. The file name is hard-coded (and -cannot be changed without changing the MOBY::Config module), +cannot be changed without changing the MOSES::MOBY::Config module), but its location can be set using an environment variable BIOMOBY_CFG_DIR. Perl Moses looks for its configuration place in the following places, in this order: @@ -1547,7 +1557,7 @@ it anyway.

        The Perl Moses internally uses Config::Simple CPAN module, -but wraps it into its own MOBY::Config. This allows expansion +but wraps it into its own MOSES::MOBY::Config. This allows expansion later, or even changing the underlying configuration system. The Config::Simple is simple (thus the name, and thus we selected it) but has few drawbacks that may be worth to work on later.

        @@ -1720,16 +1730,16 @@ You can also change or add parameters during the run-time. For example, the script universal-testing.pl needs to overwrite existing parameters because it wants to create everything in a -separate space, in temporary directory, and within a 'Testing' +separate space, in a temporary directory, and within the 'Testing' package. Because the generators read from the configuration files, it is necessary to change it there:

         my $outdir = File::Spec->catfile ($tmpdir, 'generated-services');
        -MOBY::Config->param ('generators.impl.outdir', $outdir);
        -MOBY::Config->param ('generators.impl.package.prefix', 'Testing');
        +MOSES::MOBY::Config->param ('generators.impl.outdir', $outdir);
        +MOSES::MOBY::Config->param ('generators.impl.package.prefix', 'Testing');
         unshift (@INC, $MOBYCFG::GENERATORS_IMPL_OUTDIR);
        -my $generator = new MOBY::Generators::GenServices;
        +my $generator = new MOSES::MOBY::Generators::GenServices;
         
        More about how to communicate pragmatically with the configuration can @@ -1752,10 +1762,10 @@ How does it work in Perl Moses?

        The logging is available from the moment when Perl Moses knows about -the MOBY::Base module. All generated service implementations -inherit from this class, so all of them has immediate access to the -logging system. By default, the MOBY::Base creates a -logger named $LOG. Which means that in your service +the MOSES::MOBY::Base module. All generated service implementations +inherit from this class, so all of them have immediate access to the +logging system. By default, the MOSES::MOBY::Base creates a +logger in a variable $LOG. Which means that in your service implementation you can log events in five different log levels:

        @@ -1772,7 +1782,7 @@
         You can create your own logger. Which may be good if you wish to have,
         for example, a different logging level for a particular service, or
         for a part of it (an example of such situation is in
        -MOBY::Parser.pm where the parser creates its own
        +MOSES::MOBY::Parser.pm where the parser creates its own
         $PLOG logger). Here is what you need to do:
         
         
        @@ -1794,14 +1804,14 @@
         
           If Perl Moses cannot find a log4perl.properties file, and
         if there are no logging options in moby-services.cfg, it
        -assumes some defaults (check them in MOBY::Base, in its BEGIN
        +assumes some defaults (check them in MOSES::MOBY::Base, in its BEGIN
         section, if you need-to-know). 

        The better way is to use log4perl.properties file. The file name can be actually different - it is specified by an option log.config in the moby-services.cfg configuration file. This is what PerlMoses installation creates there (of course, -with your own path): +using your own path):

         [log]
        @@ -1844,7 +1854,7 @@
         To change the log level to DEBUG, replace INFo by DEBUG in the first
         line. 

        -The message format (in Perl Moses default way) means: +The message format (unless you change the Perl Moses default way) means:

         %d                  (%r ) %p   > [%x   ] %F{1}               :%L - %m      %n
        @@ -2037,11 +2047,11 @@
         # This is a mandatory section - but you can still choose one of
         # the two options (keep one and commented out the other):
         #-----------------------------------------------------------------
        -use MOBY::Base;
        +use MOSES::MOBY::Base;
         # --- (1) this option loads dynamically everything
         BEGIN {
        -    use MOBY::Generators::GenServices;
        -    new MOBY::Generators::GenServices->load
        +    use MOSES::MOBY::Generators::GenServices;
        +    new MOSES::MOBY::Generators::GenServices->load
                 (authority     => 'samples.jmoby.net',
                  service_names => ['Mabuhay']);
         }
        @@ -2062,13 +2072,13 @@
         called jobs). Your service implementation has to implement
         method process_it that is called for every individual job
         contained within every incoming request. The MOBY/Service/ServiceBase
        +href="MOSES/MOBY/Service/ServiceBase.html"> -->MOSES/MOBY/Service/ServiceBase
         has details about this method (what parameters it gets, how to deal
         with exceptions, etc.). 

        -In the beginning of the generated process_it method is code -that tells you what methods are available for reading inputs, and at -the end of the same method is the code showing how to fill the +In the beginning of the generated process_it method is the +code that tells you what methods are available for reading inputs, and +at the end of the same method is the code showing how to fill the response. Feel free to remove the code, extend it, fill it, turn it upside-down, whatever. This is, after all, your implementation. And Perl Moses generator is clever enough not to overwrite the code once @@ -2077,21 +2087,32 @@

        Perhaps the best way how to close this section is to show a full -implementation of (so often mentioned) service Mabuhay: +implementation of (so often mentioned) service Mabuhay (the code +is also available in jMoby/src/Perl/samples):

         sub process_it {
             my ($self, $request, $response, $context) = @_;
         
        +    # read (some) input data
        +    # (use eval to protect against missing data)
        +    my $language = eval { $request->language };
        +    my $regex = eval { $language->regex->value };
        +    my $ignore_cases = eval { $language->case_insensitive->value };
        +
        +    # set an exception if data are not complete
        +    unless ($language and $regex) {
        +	$response->record_error ( { code => INPUTS_INVALID,
        +				    msg  => 'Input regular expression is missing.' } );
        +	return;
        +    }
         
        -    my $regex = $request->language->regex->value;
        -    my $ignore_cases = $request->language->case_insensitive->value;
        -
        +    # creating an answer (this is the "business logic" of this service)
             my @result_hellos = ();
             my @result_langs = ();
             open HELLO, $MOBYCFG::MABUHAY_RESOURCE_FILE
        -	or $self->throw ('Mabuhay resource file not found.');
        -    while () {
        +        or $self->throw ('Mabuhay resource file not found.');
        +    while (<HELLO>) {
         	chomp;
         	my ($lang, $hello) = split (/\t+/, $_, 2);
         	if ( $ignore_cases ? 
        @@ -2104,7 +2125,7 @@
             close HELLO;
         
             foreach my $idx (0 .. $#result_hellos) {
        -	$response->add_hello (new MOBY::Data::simple_key_value_pair
        +	$response->add_hello (new MOSES::MOBY::Data::simple_key_value_pair
         			      ( key   => $self->as_uni_string ($result_langs[$idx]),
         				value => $self->as_uni_string ($result_hellos[$idx])
         				));
        @@ -2112,6 +2133,119 @@
         }
         
        +When you go through the code above you notice how to do basic things +that almost every service has to do. Which are: + +
        +
        Reading input data: +
        The possible methods were already pre-generated for you so you +know what methods to use. But you should always check if the data are +really there (the clients can send you rubbish, of course).

        + + What was not pre-generated are the methods accessing +ID and NAMESPACE. Their names are, not surprisingly, +id and namespace. For example, the Mabuhay input is +named language (as seen in the code above), so you can call: + +

        +$language->id;
        +$language->namespace;
        + + The question is what to do if input (or anything else) is not +complete or valid. This brings us to...

        + +

        Reporting exceptions: +
        One option is to throw an exception: + +
        +open HELLO, $MOBYCFG::MABUHAY_RESOURCE_FILE
        +     or $self->throw ('Mabuhay resource file not found.');
        + + This immediately stops the processing of the input request +(ignoring all remaining jobs if they are some still there), the text +of the error message is put into the response as an exception with the +code 600 ("INTERNAL_PROCESSING_ERROR"), the same message is logged as +an error, and the response is sent back to the client.

        + + Note, however, that the response may already contain some +outputs from the previously processed jobs. If you do not like it, you +can remove it (find them in the $context parameter).

        + + Another, less drastic, option is to record an +exception (and, usually, return): + +

        +$response->record_error ( { code => INPUTS_INVALID,
        +			    msg  => 'Input regular expression is missing.' } );
        + + This creates an exception in the response - you choose what +code to use -, and it does not prevent processing of the remaining (if +any) jobs.

        + + In addition to using an eval{} block to handle +exceptions (as shown above), you can also use a +try-catch-finally block structure if Error.pm has +been installed in your system. See documentation of +MOSES::MOBY::Base for details and examples.

        + + +

        Creating output data: +
        Again, methods for creating response were pre-generated, so you +have hints how to use them (they slightly differ for simple and +collection outputs; but hopefully in a logical way).

        + + Again here you can also set the ID and +NAMESPACE. For example, the code above can be extended so the +MOSES::MOBY::Data::simple_key_value_pair data type will have +also an ID and NAMESPACE: + +

        +$response->add_hello (new MOSES::MOBY::Data::simple_key_value_pair
        +                      ( key   => $self->as_uni_string ($result_langs[$idx]),
        +			value => $self->as_uni_string ($result_hellos[$idx]),
        +			id    => 'this is an ID',
        +                        namespace => 'this is a NAMESPACE'
        +	              ));
        + +
        Creating and adding cross-references: +
        Each output object can have attached zero or more +cross-references. See documentation of +MOSES::MOBY::Data::Xref. For example, in the +HelloBioMobyWorld service one can add two cross-references: + +
        +# create a simple cross-reference
        + my $simple_xref = new MOSES::MOBY::Data::Xref
        +    ( id        => 'At263644',
        +      namespace => 'TIGR'
        +    );
        +
        + # create an advanced cross-reference
        + my $advanced_xref = new MOSES::MOBY::Data::Xref
        +    ( id           => 'X112345',
        +      namespace    => 'EMBL',
        +      service      => 'getEMBLRecord',
        +      authority    => 'www.illuminae.com',
        +      evidenceCode => 'IEA',
        +      xrefType     => 'transform'
        +    );
        +
        +# add them to the output object (which has an article name 'greeting')
        +$response->greeting->add_xrefs ($simple_xref);
        +$response->greeting->add_xrefs ($advanced_xref);
        +
        + +
        Creating a service note: +
        Just use the method serviceNotes on the $context +parameter: + +
        +$context->serviceNotes ("This is my note...");
        +

        + + +

        +

        MOBY/Base

        -
        MOBY/Package
        -
        MOBY/Service/ServiceBase
        -
        MOBY/Config
        -
        MOBY/Parser (also a part of +
        MOSES/MOBY/Base
        +
        MOSES/MOBY/Package
        +
        MOSES/MOBY/Service/ServiceBase
        +
        MOSES/MOBY/Config
        +
        MOSES/MOBY/Parser (also a part of the core but you will rarely use it directly)

        BioMoby data containers:
        -
        MOBY/Data/Object
        -
        MOBY/Data/String
        -
        MOBY/Data/Boolean
        -
        MOBY/Data/DateTime
        -
        MOBY/Data/Float
        -
        MOBY/Data/Integer
        -
        MOBY/Data/ProvisionInformation
        -
        MOBY/Data/Xref
        -
        MOBY/ServiceException
        +
        MOSES/MOBY/Data/Object
        +
        MOSES/MOBY/Data/String
        +
        MOSES/MOBY/Data/Boolean
        +
        MOSES/MOBY/Data/DateTime
        +
        MOSES/MOBY/Data/Float
        +
        MOSES/MOBY/Data/Integer
        +
        MOSES/MOBY/Data/ProvisionInformation
        +
        MOSES/MOBY/Data/Xref
        +
        MOSES/MOBY/ServiceException

        Access to the local cache, and BioMoby data definitions:
        -
        MOBY/Cache/Central
        -
        MOBY/Cache/Registries
        +
        MOSES/MOBY/Cache/Central
        +
        MOSES/MOBY/Cache/Registries

        -

        MOBY/Def/Data
        -
        MOBY/Def/DataType
        -
        MOBY/Def/Namespace
        -
        MOBY/Def/Relationship
        -
        MOBY/Def/Service
        -
        MOBY/Def/ServiceType
        +
        MOSES/MOBY/Def/Data
        +
        MOSES/MOBY/Def/DataType
        +
        MOSES/MOBY/Def/Namespace
        +
        MOSES/MOBY/Def/Relationship
        +
        MOSES/MOBY/Def/Service
        +
        MOSES/MOBY/Def/ServiceType

        Perl Moses code generators:
        -
        MOBY/Generators/GenServices
        -
        MOBY/Generators/GenTypes
        -
        MOBY/Generators/Utils
        +
        MOSES/MOBY/Generators/GenServices
        +
        MOSES/MOBY/Generators/GenTypes
        +
        MOSES/MOBY/Generators/Utils

        ...and the rest
        -
        MOBY/Tags
        +
        MOSES/MOBY/Tags
        @@ -2310,7 +2444,7 @@ about them.

        And there are features (and known) bugs that should or could be -implemented (or fixed). Here are those we am aware of (B = bug, N = not yet implemented, F = potential future feature):

        @@ -2327,7 +2461,7 @@ it expands hints how to write your own service implementation.

      • (N) The generated service -implementation could have better Perl documentation listing all +implementation could have a better Perl documentation, listing all available methods for inputs and outputs (the methods are already shown in the code, but having them also in the POD would help).

        @@ -2371,7 +2505,7 @@

        Martin Senger
        -Last modified: Tue Aug 1 15:56:36 2006 +Last modified: Sat Oct 14 21:42:54 2006
        From senger at dev.open-bio.org Sat Oct 14 21:28:09 2006 From: senger at dev.open-bio.org (Martin Senger) Date: Sat, 14 Oct 2006 17:28:09 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610142128.k9ELS9Ii022025@dev.open-bio.org> senger Sat Oct 14 17:28:09 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl In directory dev.open-bio.org:/tmp/cvs-serv22006 Modified Files: notes Log Message: moby-live/Java/src/Perl notes,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Perl/notes,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Perl/notes 2006/10/13 22:08:22 1.1 +++ /home/repository/moby/moby-live/Java/src/Perl/notes 2006/10/14 21:28:09 1.2 @@ -1,6 +1,3 @@ -Example of the full Mabuhay should also show how to deal with errrors. ---- - Perl documentation: =================== From kawas at dev.open-bio.org Mon Oct 16 17:23:16 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 16 Oct 2006 13:23:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610161723.k9GHNG8P016551@dev.open-bio.org> kawas Mon Oct 16 13:23:16 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources In directory dev.open-bio.org:/tmp/cvs-serv16466/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources Modified Files: RESOURCE.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources RESOURCE.java,1.23,1.24 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java 2006/10/11 01:54:51 1.23 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/jresources/RESOURCE.java 2006/10/16 17:23:16 1.24 @@ -125,7 +125,7 @@ OBJ = (String) cLoader.getURI_MAP().get("Object"); SRV = (String) cLoader.getURI_MAP().get("Service"); NS = (String) cLoader.getURI_MAP().get("Namespace"); - PRED = "http://biomoby.org/RESOURCES/MOBY-S/Predicates#"; + PRED = "http://biomoby.org/authority/RESOURCES/MOBY-S/Predicates#"; SI = (String) cLoader.getURI_MAP().get("ServiceInstance"); } @@ -143,6 +143,7 @@ PrintWriter out = response.getWriter(); String path = request.getPathInfo(); if (path == null) { + response.setContentType("text/html"); out .println(" not MOBY-S

        not MOBY-S

        "); return; @@ -150,6 +151,7 @@ Pattern p = Pattern.compile("/MOBY\\-S/(\\S+)"); Matcher m = p.matcher(path); if (!m.matches()) { + response.setContentType("text/html"); out .println(" not MOBY-S

        not MOBY-S

        "); return; From kawas at dev.open-bio.org Mon Oct 16 17:23:16 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 16 Oct 2006 13:23:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610161723.k9GHNG4t016529@dev.open-bio.org> kawas Mon Oct 16 13:23:16 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities In directory dev.open-bio.org:/tmp/cvs-serv16466/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities Modified Files: ContextLoader.java ServiceTester.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities ContextLoader.java,1.1,1.2 ServiceTester.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ContextLoader.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/servlet/utilities/ContextLoader.java 2006/10/11 01:54:50 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ContextLoader.java 2006/10/16 17:23:16 1.2 @@ -275,14 +275,15 @@ } } catch (Exception ex) { // some defaults if nothing else works - URI_MAP.put("Object", "http://biomoby.org/RESOURCES/MOBY-S/Objects#"); + log.warn("Using hard-coded URIs for Objects, Service, Namespace and Serviceinstances."); + URI_MAP.put("Object", "http://biomoby.org/authority/RESOURCES/MOBY-S/Objects#"); - URI_MAP.put("Service", "http://biomoby.org/RESOURCES/MOBY-S/Services#"); + URI_MAP.put("Service", "http://biomoby.org/authority/RESOURCES/MOBY-S/Services#"); - URI_MAP.put("Namespace", "http://biomoby.org/RESOURCES/MOBY-S/Namespaces#"); + URI_MAP.put("Namespace", "http://biomoby.org/authority/RESOURCES/MOBY-S/Namespaces#"); URI_MAP.put("ServiceInstance", - "http://biomoby.org/RESOURCES/MOBY-S/ServiceInstances#"); + "http://biomoby.org/authority/RESOURCES/MOBY-S/ServiceInstances#"); } } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ServiceTester.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/ui/graphical/servlet/utilities/ServiceTester.java 2006/10/12 01:55:20 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ServiceTester.java 2006/10/16 17:23:16 1.6 @@ -1,5 +1,6 @@ package org.biomoby.client.ui.graphical.servlet.utilities; +import java.text.DecimalFormat; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; @@ -15,6 +16,7 @@ import org.biomoby.shared.Central; import org.biomoby.shared.MobyException; import org.biomoby.shared.MobyService; +import org.biomoby.shared.Utils; import org.tulsoft.tools.soap.axis.AxisUtils; public class ServiceTester { @@ -153,6 +155,41 @@ log.info("getting results complete"); return sb.toString(); } + + public String getStats() { + StringBuffer sb = new StringBuffer(); + Map map = getResultMap(); + int num_bad_authorities = 0; + int total_alive = 0; + int total_dead = 0; + + sb.append("There are " + map.keySet().size() + " service providers, with at least one registered service, registered with this registry." + newline); + for (Iterator it = map.keySet().iterator(); it.hasNext();) { + String key = (String) it.next(); + Map list = (Map) map.get(key); + boolean hasGoodService = false; + // dive into this authoritys' services + for (Iterator listIt = list.keySet().iterator(); listIt.hasNext();) { + String servicename = (String) listIt.next(); + Boolean contents = (Boolean) list.get(servicename); + if (contents.booleanValue()) { + total_alive++; + hasGoodService = true; + } else { + total_dead++; + } + } + // increment authority counts + if (!hasGoodService) + num_bad_authorities++; + } + DecimalFormat df = new DecimalFormat("####.00"); + sb.append("\tOf these service providers, there are " + num_bad_authorities + " that don't have at least one working service."+newline); + sb.append("There are "+total_alive+" services that are reachable in there current state."+newline); + sb.append("There are "+total_dead+" services that are not reachable."+newline); + sb.append(newline + "\tThat represents approximately " + df.format(((float)total_alive/(float)(total_dead+total_alive))*100) + "% in terms of alive services." ); + return Utils.format(sb.toString(), 4); + } public String getServiceInformationByAuthority(String authority) { StringBuffer sb = new StringBuffer(); @@ -319,10 +356,4 @@ public void setNumThreads(int numThreads) { this.numThreads = numThreads; } - public static void main(String[] args) throws MobyException { - ServiceTester s = new ServiceTester("http://localhost/cgi-bin/MOBY-Central.pl","http://localhost/MOBY/Central"); - s.testServices(s.getServices()); - System.out.println(s.getResults()); - - } } From kawas at dev.open-bio.org Mon Oct 16 17:23:16 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 16 Oct 2006 13:23:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610161723.k9GHNGK1016505@dev.open-bio.org> kawas Mon Oct 16 13:23:15 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms In directory dev.open-bio.org:/tmp/cvs-serv16466/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms Modified Files: CallableServicesServlet.java RDFAgentValidator.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms CallableServicesServlet.java,1.3,1.4 RDFAgentValidator.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/CallableServicesServlet.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/CallableServicesServlet.java 2006/10/11 01:54:50 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/CallableServicesServlet.java 2006/10/16 17:23:15 1.4 @@ -82,7 +82,26 @@ String authority = filter(request.getParameter("authority")); String servicename = filter(request.getParameter("service")); - + String getStats = filter(request.getParameter("getStats")); + if (getStats != null) { + response.setContentType("text/plain"); + if (scheduler == null || scheduler.getServiceTester() == null) { + PrintWriter out = response.getWriter(); + out.print("Sorry, there are no stats available at the moment. Please try again in a few minutes(x0011)."); + return; + } else { + if (scheduler.getServiceTester().getResultMap() == null + || scheduler.getServiceTester().getResultMap().isEmpty()) { + PrintWriter out = response.getWriter(); + out.print("Sorry, there are no stats available at the moment. Please try again in a few minutes(x0012)."); + return; + } + PrintWriter out = response.getWriter(); + out.print(scheduler.getServiceTester().getStats()); + return; + } + } + if (scheduler == null) { response .sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/RDFAgentValidator.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/RDFAgentValidator.java 2006/10/11 01:54:50 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/RDFAgentValidator.java 2006/10/16 17:23:15 1.4 @@ -72,16 +72,17 @@ url = url.trim(); url = URLDecoder.decode(url, "UTF-8"); - String pre = "\n" - + "\n" - + "\n" - + "\n" - + "RDF Agent Validator Output\n" - + "\n" - + "\n" - + "\n " + url + "

        ";
        +		String pre = ""
        +				+ ""
        +				+ ""
        +				+ ""
        +				+ ""
        +				+ "RDF Agent Validator Output"
        +				+ ""
        +				+ ""
        +				+ " " + url + "

        ";
         
        -		String post = "
        \n" + ""; + String post = "
        " + ""; Properties prop = MobyProperties.SERVICE_INSTANCE_PROPERTIES(); String rdfagent = (String) prop.get("rdfagent"); From kawas at dev.open-bio.org Mon Oct 16 17:39:49 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 16 Oct 2006 13:39:49 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610161739.k9GHdnrq016916@dev.open-bio.org> kawas Mon Oct 16 13:39:49 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY In directory dev.open-bio.org:/tmp/cvs-serv16881/Java/src/Perl/MOSES/MOBY Modified Files: Parser.pm Log Message: moby-live/Java/src/Perl/MOSES/MOBY Parser.pm,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Parser.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Parser.pm 2006/10/13 21:51:16 1.1 +++ /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Parser.pm 2006/10/16 17:39:49 1.2 @@ -649,7 +649,7 @@ $actor->$methodName($parameter); } }; - if ($@) { + if ($@ and ($insubstitution == 0)) { $PLOG->error("Method '$methodName' was not found in the object ". $actor->mobyname); $self->error( "Method '$methodName' was not found in the object " . $actor->mobyname); } From kawas at dev.open-bio.org Mon Oct 16 18:07:15 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 16 Oct 2006 14:07:15 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610161807.k9GI7FlU017130@dev.open-bio.org> kawas Mon Oct 16 14:07:15 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/scripts In directory dev.open-bio.org:/tmp/cvs-serv17095/Java/src/scripts Modified Files: install.pl Log Message: added the module Unicode::String to the list of required modules. Every time (2 to be exact ;-) that i ran the install on a linux machine, the installer failed after it reported that I had all the correct modules installed. It seems that Unicode::String was always missing. moby-live/Java/src/scripts install.pl,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/scripts/install.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/scripts/install.pl 2006/10/13 22:08:39 1.5 +++ /home/repository/moby/moby-live/Java/src/scripts/install.pl 2006/10/16 18:07:15 1.6 @@ -60,6 +60,7 @@ Config::Simple IO::Scalar IO::Prompt + Unicode::String ) ) { check_module ($module); } From kawas at dev.open-bio.org Mon Oct 16 18:37:14 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Mon, 16 Oct 2006 14:37:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610161837.k9GIbEjG017325@dev.open-bio.org> kawas Mon Oct 16 14:37:14 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY In directory dev.open-bio.org:/tmp/cvs-serv17290/Java/src/Perl/MOSES/MOBY Modified Files: Parser.pm Log Message: moby-live/Java/src/Perl/MOSES/MOBY Parser.pm,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Parser.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Parser.pm 2006/10/16 17:39:49 1.2 +++ /home/repository/moby/moby-live/Java/src/Perl/MOSES/MOBY/Parser.pm 2006/10/16 18:37:14 1.3 @@ -649,7 +649,7 @@ $actor->$methodName($parameter); } }; - if ($@ and ($insubstitution == 0)) { + if ($@ and not $insubstitution) { $PLOG->error("Method '$methodName' was not found in the object ". $actor->mobyname); $self->error( "Method '$methodName' was not found in the object " . $actor->mobyname); } From kawas at dev.open-bio.org Tue Oct 17 13:42:54 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 17 Oct 2006 09:42:54 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610171342.k9HDgsb4019946@dev.open-bio.org> kawas Tue Oct 17 09:42:53 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv19911/Java/docs Modified Files: RegistryServlets.html Log Message: added a blurb on the rdf_generator property in the [mobycentral] section moby-live/Java/docs RegistryServlets.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/RegistryServlets.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/docs/RegistryServlets.html 2006/10/11 20:39:31 1.2 +++ /home/repository/moby/moby-live/Java/docs/RegistryServlets.html 2006/10/17 13:42:53 1.3 @@ -163,6 +163,10 @@

        The URL that would return the RDF describing all ontologies in your registry.

        This value is most likely: http://yourDomain:yourPort/authority/RESOURCES/MOBY-S/FULL

        + + rdf_generator +

        The location of the RDFGenerator included with the Registry Servlet that you are currently installing, i.e.
        http://your.domain/authority/RDFGenerator

        +

         

      • To the [mobyobject] section of this file, please ensure that the following parameters are set:
      • From kawas at dev.open-bio.org Tue Oct 17 14:00:53 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 17 Oct 2006 10:00:53 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610171400.k9HE0rVk020012@dev.open-bio.org> kawas Tue Oct 17 10:00:53 EDT 2006 Update of /home/repository/moby/moby-live/Perl/MOBY In directory dev.open-bio.org:/tmp/cvs-serv19977 Modified Files: Central.pm Log Message: added code that removes the hard coded URL from this module and replaces it with a property that is obtained from mobycentral.config. The property and value are: rdf_generator = http://mobycentral.icapture.ubc.ca/authority/RDFGenerator However, if you have a custom registry and you have installed the 'registry servlets', then use your own url as per the configuration documentation for the servlets. moby-live/Perl/MOBY Central.pm,1.261,1.262 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.261 retrieving revision 1.262 diff -u -r1.261 -r1.262 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2006/10/12 14:01:14 1.261 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2006/10/17 14:00:53 1.262 @@ -1439,7 +1439,9 @@ sub _getServiceInstanceRDF { my ( %args ) = @_; my $browser = LWP::UserAgent->new; - my $url = URI->new( 'http://mobycentral.icapture.ubc.ca/authority/RDFGenerator' ); + my $conf = MOBY::Config->new(); + return "" unless $conf->{mobycentral}->{rdf_generator}; + my $url = URI->new( $conf->{mobycentral}->{rdf_generator} ); # makes an object representing the URL $url->query_form( # And here the form data pairs: 'name' => $args{name}, @@ -1447,7 +1449,6 @@ 'url' => $args{url}, 'uri' => $args{uri} ); - my $response = $browser->get($url); if ($response) { my $rdfXML = $response->content; From kawas at dev.open-bio.org Tue Oct 17 14:02:05 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Tue, 17 Oct 2006 10:02:05 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610171402.k9HE25dq020092@dev.open-bio.org> kawas Tue Oct 17 10:02:05 EDT 2006 Update of /home/repository/moby/moby-live/Docs/MOBY-S_API In directory dev.open-bio.org:/tmp/cvs-serv20037/MOBY-S_API Modified Files: InstallingLocalMOBYCentral.html Log Message: updated to include new servlets, as well as the updated [mobycentral] section of mobycentral.config moby-live/Docs/MOBY-S_API InstallingLocalMOBYCentral.html,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Docs/MOBY-S_API/InstallingLocalMOBYCentral.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Docs/MOBY-S_API/InstallingLocalMOBYCentral.html 2006/02/26 17:57:18 1.5 +++ /home/repository/moby/moby-live/Docs/MOBY-S_API/InstallingLocalMOBYCentral.html 2006/10/17 14:02:05 1.6 @@ -183,8 +183,7 @@
            $> cvs -d :pserver:cvs at cvs.open-bio.org:/home/repository/moby login 
            $> cvs -d :pserver:cvs at cvs.open-bio.org:/home/repository/moby checkout moby-live 
            $> cvs update -dP 
        - (the 'P' flag for the update will clean-up your checkout and get rid of unused directories) -
      • + (the 'P' flag for the update will clean-up your checkout and get rid of unused directories)
      • Install BioMOBY Perl code
      •     $> cd ~/moby-live/Perl 
        To install in default path for Perl modules (root privileges required): @@ -248,8 +247,7 @@
            root $> rcmysql start 
      • If this is the first time mysql is started you will receive a warning not to forget to create a root password for mysql. - Do so if you haven't done so already. -
      • + Do so if you haven't done so already.
      • Create a mobycentral.config file and make the following entries (note that a template mobycentral.config file exists in the moby-live/Database folder of your CVS checkout):
        @@ -263,6 +261,7 @@
             lsid_namespace = serviceinstance
             resourceURL = http://your.host.name/RESOURCES/MOBY-S/ServiceInstances
             allResources = http://your.host.name/RESOURCES/MOBY-S/FULL
        +    rdf_generator = http://mobycentral.icapture.ubc.ca/authority/RDFGenerator
          
             [mobyobject]
             username = mysql_username
        @@ -314,8 +313,7 @@
              
      • If you have come this far and the stuff above was configured correctly, you can use the
            ~/moby-live/Perl/scripts/CloneCentralDatabases.pl 
        script. This will create the databases, set privileges, fetch all data from THE central BioMOBY Central - and load it into your local central. -
      • + and load it into your local central.
      • If you prefer to configure your BioMOBY Central databases manually, proceed with the next steps.
        • If you are going to bootstrap the databases with only the most primitive information, then simply run the @@ -360,8 +358,7 @@
        • In case you mess up your central during debugging you can simply nuke your databases and start with a fresh BioMOBY Central clone using the
              ~/moby-live/Perl/scripts/CloneCentralDatabases.pl 
          - script. -
        • + script.
        @@ -372,8 +369,7 @@ Taverna uses your BioMOBY Central endpoint to request the URLs for the RDF files, which are dynamically generated by the servlets. Hence, using your local central with Taverna is a two step process that requires both a working BioMOBY Central CGI script at your BioMOBY Central endpoint - and several servlets to generate RDF files. - + and several servlets to generate RDF files.
      • Install Tomcat if necessary.
      • Get root privileges:
            $> su 
        @@ -392,27 +388,23 @@
      • To make the RDF files accessible using the same port your webserver is using, you can not use Tomcat standalone, but should configure Apache as frontend for Tomcat instead. - This requires a module for Apache like for example mod_jk. Install mod_jk if necessary. -
      • + This requires a module for Apache like for example mod_jk. Install mod_jk if necessary.
      • Configure Tomcat to work with Apache:
        $CATALINA_HOME is used to refer to the directory into which you have installed Tomcat 5.
        • Create a workers.properties file in the $CATALINA_HOME/conf/jk/ dir. - There should be an example workers.properties file in the $CATALINA_HOME/conf/ dir. -
        • + There should be an example workers.properties file in the $CATALINA_HOME/conf/ dir.
        • Open your workers.properties file and change the path for workers.tomcat_home and workers.java_home according to your setup. - And set the ps (path separator) for your OS. -
        • + And set the ps (path separator) for your OS.
        • Edit $CATALINA_HOME/conf/server.xml and append:
               <Listener className="org.apache.jk.config.ApacheConfig"
                   modJk="/usr/lib/apache2/mod_jk.so"
                   workersConfig="$CATALINA_HOME/conf/jk/workers.properties" /> 
          to the <Server> section. - Change the modJk and workersConfig path according to your setup. -
        • + Change the modJk and workersConfig path according to your setup.
      • Configure Apache 2 to work with Tomcat:
        @@ -451,66 +443,18 @@
    • Download the servlets installer from:
      - http://bioinfo.icapture.ubc.ca/ekawas/servlets/install.jar -
    • + http://bioinfo.icapture.ubc.ca/ekawas/servlets/install.jar
    • Install the servlets:
          for Sun's java $> java -jar install.jar 
          for IBM's java $> java install.jar 
      - You should get a graphical interface that will guide you through the installation process... -
    • -
    • Configure the servlets in Tomcat.
      - Ensure that the following environment variables are available to Tomcat: -
          MOBY_CENTRAL_CONFIG - the path to your mobycentral.config file created above 
      -
          MOBY_SERVER - the endpoint of your local registry (see below, Configure your clients)
      -
          MOBY_URI - the namespace of your local registry (see below, Configure your clients)
      -

      - And if you installed the servlets outside the the default webapps folder, make sure Tomcat knows where to find them. - The easiest way to do this is to make the following three config files in $CATALINA_HOME/conf/Catalina/localhost/ : -

      -      <?xml version='1.0' encoding='utf-8'?>
      -      <!-- Example authority.xml file -->
      -      <Context docBase="/path/to/your/webapps/authority" path="/authority">
      -	      <Environment name="MOBY_CENTRAL_CONFIG" 
      -                          value="/path/to/your/mobycentral.config" 
      -                          type="java.lang.String"/>
      -	      <Environment name="MOBY_SERVER" 
      -                          value="http://your.host.name/biomoby/central/cgi-bin/MOBY-Central.pl" 
      -                          type="java.lang.String"/>
      -	      <Environment name="MOBY_URI" 
      -                          value="http://your.host.name/MOBY/Central" 
      -                          type="java.lang.String"/>
      -      </Context>
      -      
      -
      -      <?xml version='1.0' encoding='utf-8'?>
      -      <!-- Example RESOURCES.xml file -->
      -      <Context docBase="/path/to/your/webapps/RESOURCES" path="/RESOURCES">
      -	      <Environment name="MOBY_CENTRAL_CONFIG" 
      -                          value="/path/to/your/mobycentral.config" 
      -                          type="java.lang.String"/>
      -	      <Environment name="MOBY_SERVER" 
      -                          value="http://your.host.name/biomoby/central/cgi-bin/MOBY-Central.pl" 
      -                          type="java.lang.String"/>
      -	      <Environment name="MOBY_URI" 
      -                          value="http://your.host.name/MOBY/Central" 
      -                          type="java.lang.String"/>
      -      </Context>
      -      
      -
      -      <?xml version='1.0' encoding='utf-8'?>
      -      <!-- Example types.xml file -->
      -      <Context docBase="/path/to/your/webapps/types" path="/types">
      -	      <Environment name="MOBY_CENTRAL_CONFIG" 
      -                          value="/path/to/your/mobycentral.config" 
      -                          type="java.lang.String"/>
      -	      <Environment name="MOBY_SERVER" 
      -                          value="http://your.host.name/biomoby/central/cgi-bin/MOBY-Central.pl" 
      -                          type="java.lang.String"/>
      -	      <Environment name="MOBY_URI" 
      -                          value="http://your.host.name/MOBY/Central" 
      -                          type="java.lang.String"/>
      -      </Context>
      -      
      + You should get a graphical interface that will guide you through the installation process...
    • +
    • Configure the servlets in Tomcat.
      +
      +
        +
      • Configuration details can be found here.
        +
        +
      • +
    • restart Tomcat as root:
          root $> rctomcat restart 
      @@ -522,14 +466,12 @@
      • Copy the
            ~/moby-live/Perl/scripts/OntologyServer.cgi 
        - CGI script into your webserver cgi-bin folder. -
      • + CGI script into your webserver cgi-bin folder.
      • You will now have to edit the MOBY::Client::OntologyServer.pm module manually (sorry!). This module was hardcoded to point to the OntologyServer.cgi at THE central BioMOBY Central. You will have to change the line that reads
            host => ["http://mobycentral.icapture.ubc.ca/cgi-bin/OntologyServer.cgi",'read/write'] 
        - to point to the URL of your OntologyServer.cgi that you just set up. -
      • + to point to the URL of your OntologyServer.cgi that you just set up.
    • @@ -146,6 +147,7 @@ &samplesBuild; &mosesBuild; &dashboardBuild; + &seahawkBuild; From gordonp at dev.open-bio.org Wed Oct 25 02:33:22 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XMeZ010012@dev.open-bio.org> gordonp Tue Oct 24 22:33:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv9957/docs Modified Files: ChangeLog Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/docs ChangeLog,1.73,1.74 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2006/10/02 21:12:45 1.73 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2006/10/25 02:33:22 1.74 @@ -1,6 +1,12 @@ +2006-10-24 Paul Gordon + + * Added Seahawk (MOBY-S client) code to CVS + + * Added MobyServlet code + 2006-10-02 Martin Senger - * Added to Dasboard: 'Call RDF Agent' button + * Added to Dashboard: 'Call RDF Agent' button * Added to Dashboard: list of well-known registries From gordonp at dev.open-bio.org Wed Oct 25 02:33:22 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XM0q010026@dev.open-bio.org> gordonp Tue Oct 24 22:33:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/Clients In directory dev.open-bio.org:/tmp/cvs-serv9957/src/Clients Added Files: ServletTester.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/Clients ServletTester.java,NONE,1.1 From gordonp at dev.open-bio.org Wed Oct 25 02:33:22 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XMum010056@dev.open-bio.org> gordonp Tue Oct 24 22:33:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/ca/ucalgary/seahawk/gui/test Added Files: MobyContentGUITestCase.java SeahawkTestCase.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test MobyContentGUITestCase.java,NONE,1.1 SeahawkTestCase.java,NONE,1.1 From gordonp at dev.open-bio.org Wed Oct 25 02:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNx3010134@dev.open-bio.org> gordonp Tue Oct 24 22:33:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/test In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/ca/ucalgary/seahawk/services/test Added Files: MobyRequestTestCase.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/ca/ucalgary/seahawk/services/test MobyRequestTestCase.java,NONE,1.1 From gordonp at dev.open-bio.org Wed Oct 25 02:33:22 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XM2B010076@dev.open-bio.org> gordonp Tue Oct 24 22:33:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/ca/ucalgary/seahawk/resources Added Files: MobyContentGUIHelp.html moby2HTML.xsl mobyBuilderRules.xml Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/ca/ucalgary/seahawk/resources MobyContentGUIHelp.html,NONE,1.1 moby2HTML.xsl,NONE,1.1 mobyBuilderRules.xml,NONE,1.1 From gordonp at dev.open-bio.org Wed Oct 25 02:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XMkT010114@dev.open-bio.org> gordonp Tue Oct 24 22:33:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/ca/ucalgary/seahawk/services Added Files: MobyClient.java MobyComplexBuilder.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyClient.java,NONE,1.1 MobyComplexBuilder.java,NONE,1.1 From gordonp at dev.open-bio.org Wed Oct 25 02:33:22 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XMvU010042@dev.open-bio.org> gordonp Tue Oct 24 22:33:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/ca/ucalgary/seahawk/gui Added Files: MobyContentClipboard.java MobyContentGUI.java MobyContentHelpPane.java MobyContentPane.java MobySaveDialog.java MobySecondaryInputGUI.java MobyServicesGUI.java MobyShimmer.java SeahawkSplasher.java SplashWindow.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyContentClipboard.java,NONE,1.1 MobyContentGUI.java,NONE,1.1 MobyContentHelpPane.java,NONE,1.1 MobyContentPane.java,NONE,1.1 MobySaveDialog.java,NONE,1.1 MobySecondaryInputGUI.java,NONE,1.1 MobyServicesGUI.java,NONE,1.1 MobyShimmer.java,NONE,1.1 SeahawkSplasher.java,NONE,1.1 SplashWindow.java,NONE,1.1 From gordonp at dev.open-bio.org Wed Oct 25 02:33:22 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:22 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XMfN010096@dev.open-bio.org> gordonp Tue Oct 24 22:33:22 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/images In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/ca/ucalgary/seahawk/resources/images Added Files: back.gif back_d.gif bookmarks.gif bookmarks_d.gif clipboard.gif document.gif failed.gif forward.gif forward_d.gif help.gif help_tab.gif hourglass.gif print.gif print_d.gif save.gif save_d.gif seahawk_splash.jpg Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/ca/ucalgary/seahawk/resources/images back.gif,NONE,1.1 back_d.gif,NONE,1.1 bookmarks.gif,NONE,1.1 bookmarks_d.gif,NONE,1.1 clipboard.gif,NONE,1.1 document.gif,NONE,1.1 failed.gif,NONE,1.1 forward.gif,NONE,1.1 forward_d.gif,NONE,1.1 help.gif,NONE,1.1 help_tab.gif,NONE,1.1 hourglass.gif,NONE,1.1 print.gif,NONE,1.1 print_d.gif,NONE,1.1 save.gif,NONE,1.1 save_d.gif,NONE,1.1 seahawk_splash.jpg,NONE,1.1 From gordonp at dev.open-bio.org Wed Oct 25 02:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNNl010150@dev.open-bio.org> gordonp Tue Oct 24 22:33:23 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/ca/ucalgary/seahawk/util Added Files: BrowserLauncher.java DescriptiveFileFilter.java DynamicJPopupMenu.java MobyUtils.java NamespaceContextImpl.java PrintableJEditorPane.java Sequence.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/ca/ucalgary/seahawk/util BrowserLauncher.java,NONE,1.1 DescriptiveFileFilter.java,NONE,1.1 DynamicJPopupMenu.java,NONE,1.1 MobyUtils.java,NONE,1.1 NamespaceContextImpl.java,NONE,1.1 PrintableJEditorPane.java,NONE,1.1 Sequence.java,NONE,1.1 From gordonp at dev.open-bio.org Wed Oct 25 02:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNVl010216@dev.open-bio.org> gordonp Tue Oct 24 22:33:23 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/org/biomoby/service Added Files: MobyServlet.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/org/biomoby/service MobyServlet.java,NONE,1.1 From gordonp at dev.open-bio.org Wed Oct 25 02:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNmX010174@dev.open-bio.org> gordonp Tue Oct 24 22:33:23 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/org/biomoby/client Modified Files: MobyRequest.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/org/biomoby/client MobyRequest.java,1.19,1.20 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java 2006/09/22 22:59:09 1.19 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java 2006/10/25 02:33:23 1.20 @@ -477,7 +477,7 @@ * * @return The root element of the MOBY response DOM */ - protected Element decodeSOAPMessage(Element n, StringBuffer contentsXMLOutput, String inputXML) throws SOAPException, MobyException{ + public Element decodeSOAPMessage(Element n, StringBuffer contentsXMLOutput, String inputXML) throws SOAPException, MobyException{ if(n == null){ throw new SOAPException("SOAP Message given to decode is null"); } From gordonp at dev.open-bio.org Wed Oct 25 02:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNZv010262@dev.open-bio.org> gordonp Tue Oct 24 22:33:23 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/org/biomoby/shared/extended Modified Files: ServiceInstanceParser.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/org/biomoby/shared/extended ServiceInstanceParser.java,1.17,1.18 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceInstanceParser.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceInstanceParser.java 2006/07/13 18:35:01 1.17 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceInstanceParser.java 2006/10/25 02:33:23 1.18 @@ -293,6 +293,12 @@ .getObject().toString(); service.setDescription(description); } + // see if the service is working + if (resource.hasProperty(FetaVocabulary.isAlive)) { + String bool = resource.getProperty(FetaVocabulary.isAlive) + .getObject().toString(); + service.setStatus(MobyService.ALIVE, "true".equals(bool)); + } // process in/outputs StmtIterator arguements = resource.listProperties(FetaVocabulary.hasOperation); From gordonp at dev.open-bio.org Wed Oct 25 02:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNZC010198@dev.open-bio.org> gordonp Tue Oct 24 22:33:23 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/org/biomoby/client/rdf/builder Modified Files: ServiceInstanceRDF.java Added Files: FilteredStream.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/org/biomoby/client/rdf/builder FilteredStream.java,NONE,1.1 ServiceInstanceRDF.java,1.32,1.33 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2006/10/12 16:57:14 1.32 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/rdf/builder/ServiceInstanceRDF.java 2006/10/25 02:33:23 1.33 @@ -1103,27 +1103,3 @@ // log.info(findService("", "", false)); } } - -class FilteredStream extends FilterOutputStream { - StringBuffer sb = null; - - public FilteredStream(OutputStream aStream) { - super(aStream); - sb = new StringBuffer("" - + System.getProperty("line.separator")); - } - - public void write(byte b[]) throws IOException { - String aString = new String(b); - sb.append(aString); - } - - public void write(byte b[], int off, int len) throws IOException { - String aString = new String(b, off, len); - sb.append(aString); - } - - public String getOutput() { - return sb.toString(); - } -} \ No newline at end of file From gordonp at dev.open-bio.org Wed Oct 25 02:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNHZ010310@dev.open-bio.org> gordonp Tue Oct 24 22:33:23 EDT 2006 Update of /home/repository/moby/moby-live/Java/xmls In directory dev.open-bio.org:/tmp/cvs-serv9957/xmls Modified Files: libraries.xml Added Files: seahawkBuild.xml Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/xmls seahawkBuild.xml,NONE,1.1 libraries.xml,1.14,1.15 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/libraries.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- /home/repository/moby/moby-live/Java/xmls/libraries.xml 2006/10/09 18:55:09 1.14 +++ /home/repository/moby/moby-live/Java/xmls/libraries.xml 2006/10/25 02:33:23 1.15 @@ -48,6 +48,7 @@ + @@ -102,6 +103,7 @@ + @@ -180,6 +182,7 @@ + From gordonp at dev.open-bio.org Wed Oct 25 02:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNWj010240@dev.open-bio.org> gordonp Tue Oct 24 22:33:23 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/org/biomoby/shared Modified Files: MobyService.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/org/biomoby/shared MobyService.java,1.12,1.13 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2006/07/07 04:12:40 1.12 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2006/10/25 02:33:23 1.13 @@ -53,6 +53,14 @@ protected String lsid = null; protected MobyServiceType serviceType = new MobyServiceType(); + public static final int UNCHECKED = 0; + public static final int DEAD= 1; + public static final int ALIVE = 2; // Can connect to the service endpoint + public static final int PINGED = 4; // Responds to a blank MOBY request + public static final int TESTED = 8; // Gives a valid answer to a valid test input provided by the service + protected int serviceStatus = UNCHECKED; + protected int statusChecks = UNCHECKED; + // the elements of these Vectors are of type MobyData protected Vector primaryInputs = new Vector(); protected Vector secondaryInputs = new Vector(); @@ -99,6 +107,32 @@ return name + "/" + authority; } + /** + * @param statusCode should be one of ALIVE, PINGED, TESTED + * @param mode whether the service passed the requirement or not + */ + public void setStatus(int statusCode, boolean mode){ + if(mode){ + serviceStatus |= statusCode; + } + statusChecks |= statusCode; + } + + /** + * @return bit-wise combination of ALIVE, PINGED, TESTED states for the service, or DEAD if no tests passed, or UNCHECKED if no tests have been run + */ + public int getStatus(){ + if((statusChecks & serviceStatus) != 0){ //some status test passed + return serviceStatus; + } + else if(statusChecks == UNCHECKED){ + return UNCHECKED; + } + else{ + return DEAD; // failed every test thrown at it so far + } + } + public String getName() { return name; } From gordonp at dev.open-bio.org Wed Oct 25 02:33:23 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 24 Oct 2006 22:33:23 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610250233.k9P2XNme010288@dev.open-bio.org> gordonp Tue Oct 24 22:33:23 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser In directory dev.open-bio.org:/tmp/cvs-serv9957/src/main/org/biomoby/shared/parser Modified Files: JDOMUtils.java ServiceException.java Log Message: Added MobyServlet and Seahawk initial versions to the repository moby-live/Java/src/main/org/biomoby/shared/parser JDOMUtils.java,1.1,1.2 ServiceException.java,1.9,1.10 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/JDOMUtils.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/JDOMUtils.java 2006/07/07 04:12:40 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/JDOMUtils.java 2006/10/25 02:33:23 1.2 @@ -5,8 +5,87 @@ import org.jdom.Element; import org.jdom.Namespace; +import java.util.Iterator; +import java.util.Vector; + public class JDOMUtils{ /************************************************************************** + * + *************************************************************************/ + public static Element toXMLElement(ServiceException se) { + Element elem = MobyPackage.getXMLElement (MobyTags.MOBYEXCEPTION); + MobyPackage.setXMLAttribute (elem, MobyTags.SEVERITY, se.getSeverityAsString()); + if (se.getJobId() != null) + MobyPackage.setXMLAttribute (elem, MobyTags.REFQUERYID, se.getJobId()); + if (se.getDataName() != null) + MobyPackage.setXMLAttribute (elem, MobyTags.REFELEMENT, se.getDataName()); + Element elemCode = MobyPackage.getXMLElement (MobyTags.EXCEPTIONCODE); + elemCode.setText (""+se.getErrorCode()); + elem.addContent (elemCode); + String desc = se.getMessage(); + if (desc != null) { + Element elemDesc = MobyPackage.getXMLElement (MobyTags.EXCEPTIONMESSAGE); + elemDesc.setText (desc); + elem.addContent (elemDesc); + } + return elem; + } + + /************************************************************************** + * Extract all exceptions from a serviceNotes XML + * element. This is a convenient method that can be used when + * dealing with an XML response from a service without parsing the + * whole response to a {@link MobyPackage}.

      + * + * @param serviceNotes a piece of XML + * <serviceNotes>...</serviceNotes> + * + * @return an array, potentially an empty array, of all exceptions + * extracted from the 'serviceNotes' + *************************************************************************/ + public static ServiceException[] extractExceptions (Element serviceNotes) { + if (serviceNotes == null) + return new ServiceException[] {}; + + Vector v = new Vector(); + for (Iterator it = + serviceNotes.getChildren (MobyTags.MOBYEXCEPTION).iterator(); + it.hasNext(); ) { + ServiceException ex = extractException ((Element)it.next()); + if (ex != null) + v.addElement (ex); + } + for (Iterator it = + serviceNotes.getChildren (MobyTags.MOBYEXCEPTION, JDOMUtils.MOBY_NS).iterator(); + it.hasNext(); ) { + ServiceException ex = extractException ((Element)it.next()); + if (ex != null) + v.addElement (ex); + } + ServiceException[] result = new ServiceException [v.size()]; + v.copyInto (result); + return result; + } + + /************************************************************************** + * Extract one exception from an XML element 'mobyException'. + *************************************************************************/ + protected static ServiceException extractException (Element elem) { + ServiceException ex = new ServiceException(); + String severity = elem.getAttributeValue (MobyTags.SEVERITY); + if (severity == null) + severity = elem.getAttributeValue (MobyTags.SEVERITY, JDOMUtils.MOBY_NS); + ex.setSeverity (severity); + String codeStr = JDOMUtils.getChildText (elem, MobyTags.EXCEPTIONCODE); + try { + ex.setErrorCode (new Integer (codeStr).intValue()); + } catch (Exception e) { + } + ex.setMessage (JDOMUtils.getChildText (elem, MobyTags.EXCEPTIONMESSAGE)); + return ex; + } + + /************************************************************************** * Turns a PIB Object into a JDOM representation. *************************************************************************/ public static Element toXMLElement(MobyProvisionInfo mpi) { =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/ServiceException.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/ServiceException.java 2006/07/07 04:12:40 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/parser/ServiceException.java 2006/10/25 02:33:23 1.10 @@ -492,7 +492,7 @@ xml.append(""+code+""); if(getMessage() != null){ - xml.append(" "+getMessage()); + xml.append(" "+getMessage()+""); } xml.append(" "); From gordonp at dev.open-bio.org Wed Oct 25 13:54:50 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 09:54:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610251354.k9PDsotR012235@dev.open-bio.org> gordonp Wed Oct 25 09:54:50 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv12196 Modified Files: MobyContentGUI.java SplashWindow.java Log Message: Fixed javadoc errors moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyContentGUI.java,1.1,1.2 SplashWindow.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2006/10/25 13:54:50 1.2 @@ -444,9 +444,6 @@ /** * Displays the choice to the user to open a file or URL. * Choice callback will call either showFileDialog or showWebDialog. - * - * @param x the x coordinate at which to show the popup menu choices - * @param y the y coordinate at which to show the popup menu choices */ public void openDocument(){ JPopupMenu fileOrWeb = new JPopupMenu(); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/SplashWindow.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/SplashWindow.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/SplashWindow.java 2006/10/25 13:54:50 1.2 @@ -416,7 +416,7 @@ /** * Invokes the init method of the JApplet class provided by name. - * @param args the applet that was actually launched + * @param applet the applet that was actually launched */ public static void invokeInit(String className, javax.swing.JApplet applet) { From gordonp at dev.open-bio.org Wed Oct 25 13:54:50 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 09:54:50 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610251354.k9PDsooF012259@dev.open-bio.org> gordonp Wed Oct 25 09:54:50 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test In directory dev.open-bio.org:/tmp/cvs-serv12196/test Modified Files: MobyContentGUITestCase.java SeahawkTestCase.java Log Message: Fixed javadoc errors moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test MobyContentGUITestCase.java,1.1,1.2 SeahawkTestCase.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/MobyContentGUITestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/MobyContentGUITestCase.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/MobyContentGUITestCase.java 2006/10/25 13:54:50 1.2 @@ -258,7 +258,7 @@ } /** - * @returns a test suite for all the test methods of this test case. + * @return a test suite for all the test methods of this test case. */ public static Test suite() { // Reflection is used here to add all =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/SeahawkTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/SeahawkTestCase.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/SeahawkTestCase.java 2006/10/25 13:54:50 1.2 @@ -917,7 +917,7 @@ } /** - * @returns a test suite for all the test methods of this test case. + * @return a test suite for all the test methods of this test case. */ public static Test suite() { From kawas at dev.open-bio.org Wed Oct 25 19:32:54 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Wed, 25 Oct 2006 15:32:54 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610251932.k9PJWsJF014148@dev.open-bio.org> kawas Wed Oct 25 15:32:54 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms In directory dev.open-bio.org:/tmp/cvs-serv14113/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms Modified Files: CallableServicesServlet.java Log Message: made service testing code more modular and fixed a thread (cleanup) issue moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms CallableServicesServlet.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/CallableServicesServlet.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/ui/graphical/servlet/forms/CallableServicesServlet.java 2006/10/18 22:31:06 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/CallableServicesServlet.java 2006/10/25 19:32:54 1.6 @@ -6,11 +6,6 @@ import java.io.IOException; import java.io.PrintWriter; -import java.util.Calendar; -import java.util.Date; -import java.util.Map; -import java.util.Timer; -import java.util.TimerTask; import javax.servlet.ServletConfig; import javax.servlet.ServletException; @@ -18,14 +13,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.commons.discovery.tools.DiscoverSingleton; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.biomoby.client.CentralImpl; -import org.biomoby.client.ui.graphical.servlet.utilities.ContextLoader; -import org.biomoby.client.ui.graphical.servlet.utilities.ServiceTester; -import org.biomoby.shared.MobyException; -import org.biomoby.shared.MobyService; +import org.biomoby.client.ui.graphical.servlet.utilities.ServiceTesterRunner; /** * @author Eddie Kawas This class was created to call out to all registered @@ -43,31 +33,10 @@ // some useful variables private final String newline = System.getProperty("line.separator"); - ServiceTesterRunner scheduler = null; + - public void init(ServletConfig arg0) throws ServletException { - super.init(arg0); - - ContextLoader cLoader = null; - try { - cLoader = (ContextLoader) DiscoverSingleton.find(Class - .forName((String) ContextLoader.class.getCanonicalName()), Class.forName( - (String) ContextLoader.class.getCanonicalName()).getName()); - log - .warn((cLoader == null ? "ContextLoader is null and is therefore not loaded. This is BAD!" - : "ContextLoader has loaded successfully.")); - } catch (Exception e) { - log.warn("ContextLoader is null and is therefore not loaded. This is BAD!" - + System.getProperty("line.separator") + e.getStackTrace()); - } - - log.info("initializing CallableServiceServlet"); - scheduler = new ServiceTesterRunner(); - Timer timer = new Timer(); - Calendar calendar = Calendar.getInstance(); - Date time = calendar.getTime(); - log.info("Scheduling on going task."); - timer.scheduleAtFixedRate(scheduler, time, 1000 * 60 * 60); + public void init(ServletConfig conf) throws ServletException { + super.init(conf); } /* @@ -79,7 +48,9 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // set the content type - + + ServiceTesterRunner scheduler = (ServiceTesterRunner) getServletContext().getAttribute("tester"); + String authority = filter(request.getParameter("authority")); String servicename = filter(request.getParameter("service")); String getStats = filter(request.getParameter("getStats")); @@ -163,11 +134,6 @@ } - public void init() throws ServletException { - super.init(); - - } - private static String filter(String input) { if (input == null) return null; @@ -201,63 +167,5 @@ doGet(arg0, arg1); } - public final class ServiceTesterRunner extends TimerTask { - /* - * - */ - - protected ServiceTester t = null; - - public ServiceTesterRunner() { - try { - t = new ServiceTester( - System.getProperty("MOBY_SERVER") == null ? CentralImpl.DEFAULT_ENDPOINT - : System.getProperty("MOBY_SERVER"), - System.getProperty("MOBY_URI") == null ? CentralImpl.DEFAULT_NAMESPACE - : System.getProperty("MOBY_URI")); - } catch (MobyException e) { - log.error("Couldn't instantiate a ServiceTester object", e); - } - // run(); - } - - /* - * Implements TimerTask's abstract run method. - */ - public void run() { - if (t == null) { - try { - t = new ServiceTester( - System.getProperty("MOBY_SERVER") == null ? CentralImpl.DEFAULT_ENDPOINT - : System.getProperty("MOBY_SERVER"), - System.getProperty("MOBY_URI") == null ? CentralImpl.DEFAULT_NAMESPACE - : System.getProperty("MOBY_URI")); - } catch (MobyException e) { - log.error("Couldn't instantiate a ServiceTester object", e); - return; - } - } - // implement this method to contain whatever it is you want to do - log.info("re-querying services..."); - MobyService[] services = t.getServices(); - if (services != null && services.length > 0) { - Map map = t.testServices(services); - if (map != null && !map.isEmpty()) - t.setResultMap(map); - } - services = null; - log.info("service checking complete!"); - // log stats every hour - t.logStats(); - } - - public ServiceTester getServiceTester() { - return t; - } - - // expressed in milliseconds - private final static long ONCE_PER_DAY = 1000 * 60 * 60 * 24; - - } } From kawas at dev.open-bio.org Wed Oct 25 19:32:54 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Wed, 25 Oct 2006 15:32:54 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610251932.k9PJWspu014168@dev.open-bio.org> kawas Wed Oct 25 15:32:54 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities In directory dev.open-bio.org:/tmp/cvs-serv14113/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities Modified Files: ServiceTester.java Added Files: ServiceTesterRunner.java RegistryContextListener.java Log Message: made service testing code more modular and fixed a thread (cleanup) issue moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities ServiceTesterRunner.java,NONE,1.1 RegistryContextListener.java,NONE,1.1 ServiceTester.java,1.8,1.9 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ServiceTester.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/client/ui/graphical/servlet/utilities/ServiceTester.java 2006/10/18 22:27:56 1.8 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/utilities/ServiceTester.java 2006/10/25 19:32:54 1.9 @@ -5,6 +5,7 @@ import java.io.IOException; import java.text.DecimalFormat; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -28,7 +29,9 @@ public class ServiceTester { - private Central central = null; + private String url = null; + + private String uri = null; private Map results = null; @@ -40,13 +43,19 @@ private Log log = LogFactory.getLog(this.getClass()); public ServiceTester() throws MobyException { - central = new CentralImpl(); + // default here + this.url = CentralImpl.DEFAULT_ENDPOINT; + this.uri = CentralImpl.DEFAULT_NAMESPACE; + results = new TreeMap(); } @SuppressWarnings("unchecked") public ServiceTester(String url, String uri) throws MobyException { - central = new CentralImpl(url, uri); + // use default if necessary + this.url = url == null || url.trim().equals("") ? CentralImpl.DEFAULT_ENDPOINT : url; + this.uri = uri == null || uri.trim().equals("") ? CentralImpl.DEFAULT_NAMESPACE : uri; + results = Collections.synchronizedMap(new TreeMap()); } @@ -55,9 +64,10 @@ MobyService template = new MobyService(); try { + Central central = new CentralImpl(url, uri); services = central.findService(template); } catch (MobyException e) { - + log.error("Couldn't query Moby Central ..." + newline + Utils.format(e, 3)); } if (services == null) return new MobyService[] {}; @@ -245,63 +255,41 @@ if (DIRECTORY == null) { try { Context c = new InitialContext(); - DIRECTORY = (String)c.lookup("java:comp/env/CACHE_PATH"); + DIRECTORY = (String) c.lookup("java:comp/env/CACHE_PATH"); } catch (Exception e) { // default to the the user directory DIRECTORY = System.getProperty("user.dir"); } } - BufferedWriter out = new BufferedWriter(new FileWriter(DIRECTORY +"/" + "CallableStatsLog.txt", true)); - out.write(sb.toString()+newline); - out.close(); - } catch (IOException e) { - } - - // would like if this wrote to a different file + BufferedWriter out = new BufferedWriter(new FileWriter(DIRECTORY + "/" + + "CallableStatsLog.txt", true)); + out.write(sb.toString() + newline); + out.close(); + } catch (IOException e) { + } + + // would like if this wrote to a different file Logger.getLogger("CallableStats").info("###" + sb.toString() + "###"); } private String DIRECTORY = null; + public String getDeadServicesByAuthority() { StringBuffer sb = new StringBuffer(); sb.append("The following are services, sorted by Service Provider, have been identified" - + " as \"dead\" by the MOBY Service Testing agent." - + newline - + newline + + " as \"dead\" by the MOBY Service Testing agent." + newline + newline + "A \"dead\" service is one that does not respond correctly to a MOBY " - + "\"ping\"; where a correct \"ping\" request/response is:" - + newline - + newline - + "REQUEST" - + newline - + newline - + " " - + newline - + " " - + newline - + " " - + newline - + newline - + "RESPONSE" - + newline - + newline - + " " - + newline - + " " - + newline - + " " - + newline - + newline - + "The status of all services is tested hourly, and is recorded in the " - + newline - + "LSID metadata for each service as a boolean value in the RDF tag" - + newline - + " \"isAlive\", which may be used by client software to filter-out" - + newline - + " non-functional services." - + newline); - + + "\"ping\"; where a correct \"ping\" request/response is:" + newline + newline + + "REQUEST" + newline + newline + " " + newline + + " " + newline + " " + newline + + newline + "RESPONSE" + newline + newline + " " + newline + + " " + newline + " " + newline + + newline + "The status of all services is tested hourly, and is recorded in the " + + newline + "LSID metadata for each service as a boolean value in the RDF tag" + + newline + " \"isAlive\", which may be used by client software to filter-out" + + newline + " non-functional services." + newline); + Map map = getResultMap(); for (Iterator it = map.keySet().iterator(); it.hasNext();) { @@ -353,6 +341,7 @@ MobyService s = new MobyService(servicename); s.setAuthority(authority); try { + Central central = new CentralImpl(url, uri); if (central.findService(s).length > 0) return true; } catch (MobyException e) { @@ -365,6 +354,7 @@ MobyService s = new MobyService(servicename); s.setAuthority(authority); try { + Central central = new CentralImpl(url, uri); if (central.findService(s).length > 0) return true; } catch (MobyException e) { @@ -491,4 +481,19 @@ this.numThreads = numThreads; } + public String toString() { + return "ServiceTester(" + + newline + + "\t\t" + + url + + "," + + newline + + "\t\t" + + uri + + ")" + + newline + + " @ " + + new Date().toString(); + } + } From kawas at dev.open-bio.org Wed Oct 25 22:39:12 2006 From: kawas at dev.open-bio.org (Eddie Kawas) Date: Wed, 25 Oct 2006 18:39:12 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610252239.k9PMdCCs014400@dev.open-bio.org> kawas Wed Oct 25 18:39:12 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority In directory dev.open-bio.org:/tmp/cvs-serv14365/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority Modified Files: LSIDDataLookup.java Log Message: moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority LSIDDataLookup.java,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java 2006/10/11 01:54:50 1.13 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/lsid/authority/LSIDDataLookup.java 2006/10/25 22:39:12 1.14 @@ -183,7 +183,7 @@ } else return UNKNOWN; - log.info(lsid.getObject() + " " + mobycentral.getProperty("lsid_namespace") + " " + ns); + log.info(lsid.getObject() + " " + ns); return result; } From gordonp at dev.open-bio.org Thu Oct 26 00:28:58 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:28:58 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260028.k9Q0Sw3d014750@dev.open-bio.org> gordonp Wed Oct 25 20:28:58 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended In directory dev.open-bio.org:/tmp/cvs-serv14715/src/main/org/biomoby/shared/extended Modified Files: ServiceInstanceParser.java Log Message: Simple javadoc fix moby-live/Java/src/main/org/biomoby/shared/extended ServiceInstanceParser.java,1.18,1.19 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceInstanceParser.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceInstanceParser.java 2006/10/25 02:33:23 1.18 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/extended/ServiceInstanceParser.java 2006/10/26 00:28:58 1.19 @@ -187,7 +187,7 @@ } - /* + /** * @param list the list to put the services in @param model the model to use */ private boolean processModel(ArrayList list, Model model) { From gordonp at dev.open-bio.org Thu Oct 26 00:30:27 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:30:27 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260030.k9Q0URKC014834@dev.open-bio.org> gordonp Wed Oct 25 20:30:27 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv14799/src/main/org/biomoby/shared/data Modified Files: MobyDataComposite.java Log Message: Fixed varargs c-tor logic moby-live/Java/src/main/org/biomoby/shared/data MobyDataComposite.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.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/data/MobyDataComposite.java 2006/07/07 04:12:40 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataComposite.java 2006/10/26 00:30:27 1.8 @@ -89,6 +89,12 @@ */ public MobyDataComposite(MobyDataType type, MobyNamespace namespace, String id, Object... memberStrings) throws IllegalArgumentException, MobyException{ super(namespace.getName(), id); + + if(type == null){ + throw new IllegalArgumentException("MOBY data type given in composite object " + + "constructor was null (not in the ontology?)"); + } + setDataType(type); members = new ConcurrentHashMap(); @@ -111,7 +117,8 @@ // which will be the basis for the member. else{ put(children[0].getName(), - MobyDataObject.createInstanceFromString(children[0].getName(), memberStrings[0].toString())); + MobyDataObject.createInstanceFromString(children[0].getDataTypeName(), + memberStrings[0].toString())); } return; } @@ -124,7 +131,7 @@ } String name = (String) arg1; - Object arg2 = memberStrings[i++]; + Object arg2 = memberStrings[++i]; for(int j = 0; i < memberStrings.length && j < children.length; j++){ MobyRelationship relationship = children[j]; From gordonp at dev.open-bio.org Thu Oct 26 00:31:21 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:31:21 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260031.k9Q0VL8C014877@dev.open-bio.org> gordonp Wed Oct 25 20:31:21 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv14842/src/main/org/biomoby/shared/data Modified Files: MobyDataObject.java Log Message: Fixed issue related to article names causing cached service lookups to fail match moby-live/Java/src/main/org/biomoby/shared/data MobyDataObject.java,1.9,1.10 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java 2006/07/07 04:12:40 1.9 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java 2006/10/26 00:31:21 1.10 @@ -562,7 +562,28 @@ return "<" + getDataType().getName() +" " + getAttrXML() + "/>"; } else{ - return super.toXML(); + // Override super because article name is not actually important to us + // but will cause cache misses for MOBY Central calls since the xml + // is used as a key in the call cache. + StringBuffer buf = new StringBuffer(); + buf.append ("\n"); + buf.append (""); + if (getDataType() != null) buf.append (getDataType().getName()); + buf.append ("\n"); + if (namespaces.size() > 0) { + for (java.util.Enumeration en = namespaces.elements(); en.hasMoreElements(); ) { + MobyNamespace ns = (MobyNamespace)en.nextElement(); + if(ns != null){ + buf.append (""); + buf.append ( ns.getName() ); + buf.append (""); + } + } + } + buf.append (""); + buf.append ("\n"); + return buf.toString(); + //return super.toXML(); } } From gordonp at dev.open-bio.org Thu Oct 26 00:32:20 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:32:20 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260032.k9Q0WKPw014924@dev.open-bio.org> gordonp Wed Oct 25 20:32:20 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv14885/src/main/org/biomoby/shared/data Modified Files: MobyContentInstance.java MobyDataUtils.java Log Message: Became more lenient in namespace resoltion (moby-s allowed, but give warnings) moby-live/Java/src/main/org/biomoby/shared/data MobyContentInstance.java,1.4,1.5 MobyDataUtils.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyContentInstance.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/MobyContentInstance.java 2006/09/22 23:01:04 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyContentInstance.java 2006/10/26 00:32:20 1.5 @@ -87,10 +87,18 @@ ") was not " + MobyTags.MOBYCONTENT); } if(!MobyPrefixResolver.MOBY_XML_NAMESPACE.equals(objectTag.getNamespaceURI())){ - throw new MobyException("The content element's namespace (" + - objectTag.getNamespaceURI() + - ") did not have the MOBY namespace " + - MobyPrefixResolver.MOBY_XML_NAMESPACE); + if(!MobyPrefixResolver.MOBY_XML_NAMESPACE_INVALID.equals(objectTag.getNamespaceURI())){ + throw new MobyException("The content element's namespace (" + + objectTag.getNamespaceURI() + + ") did not have the MOBY namespace " + + MobyPrefixResolver.MOBY_XML_NAMESPACE); + } + else{ + System.err.println("Invalid namespace used for content element (was " + + objectTag.getNamespaceURI() + + ", but should be " + MobyPrefixResolver.MOBY_XML_NAMESPACE + + ", proceeding anyway"); + } } members = new HashMap(); @@ -100,11 +108,12 @@ NodeList mobyData = MobyPrefixResolver.getChildElements(objectTag, MobyTags.MOBYDATA); - if(mobyData.getLength() == 0){ - throw new MobyException("The document's " + MobyTags.MOBYCONTENT + - " element does not have a " + MobyTags.MOBYDATA + - " child. It must have one or more according to the MOBY API"); - } + // The case below is no longer true: an empty content block is a "ping" request as per mailing list 2006-08 +// if(mobyData.getLength() == 0){ +// throw new MobyException("The document's " + MobyTags.MOBYCONTENT + +// " element does not have a " + MobyTags.MOBYDATA + +// " child. It must have one or more according to the MOBY API"); +// } // Now back to the main data for(int i = 0; i < mobyData.getLength(); i++){ =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataUtils.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/data/MobyDataUtils.java 2006/07/07 04:12:40 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataUtils.java 2006/10/26 00:32:20 1.4 @@ -57,14 +57,25 @@ doc_root.getLocalName() + ") was not " + MobyTags.MOBY); } + NodeList envelope = null; if(!MobyPrefixResolver.MOBY_XML_NAMESPACE.equals(doc_root.getNamespaceURI())){ - throw new MobyException("The XML document's root element namespace (" + - doc_root.getNamespaceURI() + - ") is not the MOBY namespace " + - MobyPrefixResolver.MOBY_XML_NAMESPACE); + if(!MobyPrefixResolver.MOBY_XML_NAMESPACE_INVALID.equals(doc_root.getNamespaceURI())){ + throw new MobyException("The XML document's root element namespace (" + + doc_root.getNamespaceURI() + + ") is not the MOBY namespace " + + MobyPrefixResolver.MOBY_XML_NAMESPACE); + } + System.err.println("Invalid namespace used for root element (was " + doc_root.getNamespaceURI() + + ", but should be " + MobyPrefixResolver.MOBY_XML_NAMESPACE + + ", proceeding anyway"); + envelope = doc_root.getElementsByTagNameNS(MobyPrefixResolver.MOBY_XML_NAMESPACE_INVALID, + MobyTags.MOBYCONTENT); + } + else{ + envelope = doc_root.getElementsByTagNameNS(MobyPrefixResolver.MOBY_XML_NAMESPACE, + MobyTags.MOBYCONTENT); } - NodeList envelope = doc_root.getElementsByTagNameNS(MobyPrefixResolver.MOBY_XML_NAMESPACE, - MobyTags.MOBYCONTENT); + if(envelope.getLength() == 0){ throw new MobyException("The document's " + MobyTags.MOBY + " element does not contain a " + From gordonp at dev.open-bio.org Thu Oct 26 00:33:36 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:33:36 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260033.k9Q0Xa4f014967@dev.open-bio.org> gordonp Wed Oct 25 20:33:35 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv14932/src/main/org/biomoby/shared Modified Files: MobyService.java Log Message: Added method to grab metadata-filled-in service instances moby-live/Java/src/main/org/biomoby/shared MobyService.java,1.13,1.14 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2006/10/25 02:33:23 1.13 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java 2006/10/26 00:33:35 1.14 @@ -10,6 +10,7 @@ import java.util.Comparator; import java.util.Enumeration; import java.util.Vector; +import org.biomoby.shared.extended.ServiceInstanceParser; /** * A container representing a service. But do not be too excited - @@ -60,6 +61,10 @@ public static final int TESTED = 8; // Gives a valid answer to a valid test input provided by the service protected int serviceStatus = UNCHECKED; protected int statusChecks = UNCHECKED; + + // We need both, because you can't synchrinize on a null array + protected static MobyService[] uninitializedServices = new MobyService[0]; + protected static MobyService[] services = uninitializedServices; // the elements of these Vectors are of type MobyData protected Vector primaryInputs = new Vector(); @@ -438,4 +443,35 @@ this.serviceType = (serviceType == null ? new MobyServiceType() : serviceType); } + public static MobyService getService(String name, String authority){ + if(name == null || authority == null){ + return null; + } + + // This method has not been called yet in the JVM, populate the datatypes + synchronized (services){ + if(services == uninitializedServices){ + try{ + ServiceInstanceParser p = new ServiceInstanceParser("http://biomoby.org/RESOURCES/MOBY-S/ServiceInstances"); + services = p.getMobyServicesFromRDF(); + } + catch(Exception e){ + System.err.println("Cannot parse MOBY Service Instance Database: " + e); + e.printStackTrace(); + return null; + } + } + } + + // Perform a linear search for the corresponding namespace and authority + for(int i = 0; i < services.length; i++){ + if(name.equals(services[i].getName()) && + authority.equals(services[i].getAuthority())){ + return services[i]; + } + } + + // Wasn't found if we got to here + return null; + } } From gordonp at dev.open-bio.org Thu Oct 26 00:34:13 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:34:13 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260034.k9Q0YDUf015012@dev.open-bio.org> gordonp Wed Oct 25 20:34:13 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv14977/src/main/org/biomoby/shared Modified Files: MobyPrefixResolver.java Log Message: Became more lenient in namespace resolution (moby-s allowed, but give warnings) moby-live/Java/src/main/org/biomoby/shared MobyPrefixResolver.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrefixResolver.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/shared/MobyPrefixResolver.java 2006/07/07 04:12:40 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrefixResolver.java 2006/10/26 00:34:13 1.6 @@ -22,6 +22,7 @@ public class MobyPrefixResolver implements PrefixResolver{ public static final String MOBY_XML_NAMESPACE = "http://www.biomoby.org/moby"; + public static final String MOBY_XML_NAMESPACE_INVALID = "http://www.biomoby.org/moby-s"; public static final String MOBY_XML_PREFIX = "moby"; public static final String MOBY_TRANSPORT_NAMESPACE = "http://biomoby.org/"; public static final String MOBY_TRANSPORT_PREFIX = "mobyt"; From gordonp at dev.open-bio.org Thu Oct 26 00:35:20 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:35:20 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260035.k9Q0ZKQF015055@dev.open-bio.org> gordonp Wed Oct 25 20:35:19 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util In directory dev.open-bio.org:/tmp/cvs-serv15020/src/main/ca/ucalgary/seahawk/util Modified Files: MobyUtils.java Log Message: Made single words into keywords by default moby-live/Java/src/main/ca/ucalgary/seahawk/util MobyUtils.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2006/10/26 00:35:19 1.2 @@ -31,7 +31,13 @@ // Can always use the data as a string objects.add(new MobyDataString(objectName, data)); - + // If it's a single word, give keyword options + if(data.trim().matches("^[A-Za-z0-9_-]{3,}$")){ + objects.add(new MobyDataComposite("Global_Keyword", + "dummy_name", + "seahawk_namespace", + data.trim())); + } // See if it's sequence MobyDataComposite mdc = createMobySequence(data, "user-selection"); From gordonp at dev.open-bio.org Thu Oct 26 00:36:16 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:36:16 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260036.k9Q0aGAo015098@dev.open-bio.org> gordonp Wed Oct 25 20:36:15 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv15063/src/main/ca/ucalgary/seahawk/services Modified Files: MobyClient.java Log Message: Got rid of redundant service lookup code moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyClient.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2006/10/26 00:36:15 1.2 @@ -622,23 +622,51 @@ return (MobyDataObject[]) objectVector.toArray(new MobyDataObject[objectVector.size()]); } + public void setRequiredServiceLevel(int level){ + serviceLevel = level; + System.err.println("Service level is now set to " + serviceLevel); + } + + public MobyDataServiceAssocInstance getServices(MobyDataObjectSet mdos) throws MobyException{ + return (getServices(new MobyDataObjectSet[]{mdos}))[0]; + } + + public MobyDataServiceAssocInstance getServices(MobyDataObject mdo) throws MobyException{ + return (getServices(new MobyDataObject[]{mdo}))[0]; + } + + public MobyDataServiceAssocInstance[] getServices(MobyDataObjectSet[] mdoss) throws MobyException{ + return getServices((MobyPrimaryData[]) mdoss); + } + public MobyDataServiceAssocInstance[] getServices(MobyDataObject[] mdos) throws MobyException{ + return getServices((MobyPrimaryData[]) mdos); + } + + protected MobyDataServiceAssocInstance[] getServices(MobyPrimaryData[] mdos) throws MobyException{ MobyDataServiceAssocInstance[] mobyDataServiceAssocInstances = new MobyDataServiceAssocInstance[mdos.length]; for(int i = 0; i < mdos.length; i++){ MobyService templateServices = new MobyService(""); templateServices.addInput(mdos[i]); - //System.out.println("find services: "); MobyService[] mService = c.findService(templateServices); Vector filteredServices = new Vector(); // Let's make sure all of the services have their service type properly instantiated // for ontology checks later on for(int j = 0; j < mService.length; j++){ + MobyService service = MobyService.getService(mService[j].getName(), mService[j].getAuthority()); + if(service != null){ + mService[j] = service; + } + mService[j].setServiceType(MobyServiceType.getServiceType(mService[j].getServiceType().getName())); - if(serviceLevel != MobyService.UNCHECKED && - ((mService[j].getStatus() & serviceLevel) >= serviceLevel)){ - filteredServices.add(mService[j]); + if(serviceLevel != MobyService.UNCHECKED){ + int serviceStatus = mService[j].getStatus(); + //System.err.println("Service " + mService[j].getName() + " has status " + serviceStatus); + if((serviceStatus & serviceLevel) >= serviceLevel){ + filteredServices.add(mService[j]); + } } } @@ -646,7 +674,16 @@ mService = (MobyService []) filteredServices.toArray(new MobyService[filteredServices.size()]); } - mobyDataServiceAssocInstances[i] = new MobyDataObjectSAI(mdos[i], mService); + if(mdos[i] instanceof MobyDataObject){ + mobyDataServiceAssocInstances[i] = new MobyDataObjectSAI((MobyDataObject) mdos[i], mService); + } + else if(mdos[i] instanceof MobyDataObjectSet){ + mobyDataServiceAssocInstances[i] = new MobyDataObjectSetSAI((MobyDataObjectSet) mdos[i], mService); + } + else{ + logger.warn("MobyClient could not handle service-associating an instance of " + mdos[i].getClass()); + System.err.println("MobyClient could not handle service-associating an instance of " + mdos[i].getClass()); + } } return mobyDataServiceAssocInstances; } From gordonp at dev.open-bio.org Thu Oct 26 00:37:29 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 20:37:29 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260037.k9Q0bTsE015141@dev.open-bio.org> gordonp Wed Oct 25 20:37:28 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv15106/src/main/ca/ucalgary/seahawk/gui Modified Files: MobyContentGUI.java Log Message: Added caching of service instances (mainly to filter for alive ones), put caching of this and object hierarchy into threads on startup moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyContentGUI.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2006/10/25 13:54:50 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyContentGUI.java 2006/10/26 00:37:28 1.3 @@ -857,10 +857,17 @@ // "error"); // } + // The following command will cache all data type definitions for this session + new Thread(){ + public void run(){org.biomoby.shared.MobyDataType.getDataType("Object");} + }.start(); + // And the service definitions + new Thread(){ + public void run(){org.biomoby.shared.MobyService.getService("","");} + }.start(); + MobyContentGUI gui = ca.ucalgary.seahawk.util.MobyUtils.getMobyContentGUI(new JLabel()); gui.setDefaultCloseOperation(defaultCloseOperation); - // The following command will cache all data type definitions for this session - Object dataType = org.biomoby.shared.MobyDataType.getDataType("Object"); gui.setVisible(true); if(argv.length != 0){ From gordonp at dev.open-bio.org Thu Oct 26 01:31:25 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 21:31:25 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260131.k9Q1VPim015249@dev.open-bio.org> gordonp Wed Oct 25 21:31:25 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv15214/src/main/ca/ucalgary/seahawk/gui Modified Files: MobyServicesGUI.java Log Message: Got rid of redundant code moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyServicesGUI.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/10/26 01:31:25 1.2 @@ -53,6 +53,7 @@ public MobyServicesGUI() throws Exception{ mobyClient = new MobyClient(); + mobyClient.setRequiredServiceLevel(MobyService.ALIVE); mobyRequest = new MobyRequest(mobyClient.getMobyCentralImpl()); waitItem = new JMenuItem("Building data list, please wait..."); @@ -529,61 +530,76 @@ addClipboardItem(submenu, mobyData); submenu.add(getWaitItem(submenu)); - MobyService[] foundServices = null; +// MobyService[] foundServices = null; +// try{ +// mobyData.setXmlMode(MobyDataInstance.CENTRAL_XML_MODE); +// //logger.debug("Querying central with: " + mobyData.toXML()); +// MobyService templateService = new MobyService(""); +// if(!(mobyData instanceof MobyData)){ +// logger.warn("MobyDataInstance implementer " + mobyData.getClass() + +// " cannot be used to find services, it does not " + +// "inherit from MobyData as Central requires"); +// } +// templateService.addInput((MobyData) mobyData); +// foundServices = mobyClient.getMobyCentralImpl().findService(templateService); +// } +// catch(Exception mobye){ +// logger.error("Could not retrieve list of MobyServices from initialized MobyClient using the " + +// "MOBY data " + mobyData);mobye.printStackTrace(); +// synchronized(popupList){ +// popupList.setVisible(false); +// popupList.remove(waitItem); +// if(submenu.isPopupMenuVisible()){ +// submenu.setPopupMenuVisible(false); +// submenu.remove(getWaitItem(submenu)); +// submenu.setPopupMenuVisible(true); +// } +// else{ +// submenu.remove(getWaitItem(submenu)); +// } +// popupList.setVisible(true); +// } +// return; +// } +// if(foundServices == null || foundServices.length == 0){ +// popupList.setVisible(false); +// return; +// } + +// // Let's make sure all of the services have their service type properly instantiated +// // for ontology checks later on +// for(int j = 0; j < foundServices.length; j++){ +// foundServices[j].setServiceType(MobyServiceType.getServiceType(foundServices[j].getServiceType().getName())); +// } + + MobyDataServiceAssocInstance serviceAssocObject = null; +// //Services for only the one piece of data try{ - mobyData.setXmlMode(MobyDataInstance.CENTRAL_XML_MODE); - //logger.debug("Querying central with: " + mobyData.toXML()); - MobyService templateService = new MobyService(""); - if(!(mobyData instanceof MobyData)){ - logger.warn("MobyDataInstance implementer " + mobyData.getClass() + - " cannot be used to find services, it does not " + - "inherit from MobyData as Central requires"); + if(mobyData instanceof MobyDataObjectSet){ + serviceAssocObject = mobyClient.getServices((MobyDataObjectSet) mobyData); } - templateService.addInput((MobyData) mobyData); - foundServices = mobyClient.getMobyCentralImpl().findService(templateService); - } - catch(Exception mobye){ - logger.error("Could not retrieve list of MobyServices from initialized MobyClient using the " + - "MOBY data " + mobyData);mobye.printStackTrace(); - synchronized(popupList){ - popupList.setVisible(false); - popupList.remove(waitItem); - if(submenu.isPopupMenuVisible()){ - submenu.setPopupMenuVisible(false); - submenu.remove(getWaitItem(submenu)); - submenu.setPopupMenuVisible(true); - } - else{ - submenu.remove(getWaitItem(submenu)); - } - popupList.setVisible(true); + else if(mobyData instanceof MobyDataObject){ + serviceAssocObject = mobyClient.getServices((MobyDataObject) mobyData); } - return; - } - if(foundServices == null || foundServices.length == 0){ + else{ + logger.warn("Service options for objects other than MobyDataObject " + + "and MobyDataObjectSet are not yet supported."); + return; + } + } catch(Exception mobye){ + logger.error("Could not retrieve list of MobyServices from initialized MobyClient using the " + + "MOBY data " + mobyData); + mobye.printStackTrace(); popupList.setVisible(false); return; } - // Let's make sure all of the services have their service type properly instatiated - // for ontology checks later on - for(int j = 0; j < foundServices.length; j++){ - foundServices[j].setServiceType(MobyServiceType.getServiceType(foundServices[j].getServiceType().getName())); + if(serviceAssocObject == null || serviceAssocObject.getServices() == null || + serviceAssocObject.getServices().length == 0){ + popupList.setVisible(false); + return; } - MobyDataServiceAssocInstance serviceAssocObject = null; - //Services for only the one piece of data - if(mobyData instanceof MobyDataObjectSet){ - serviceAssocObject = new MobyDataObjectSetSAI((MobyDataObjectSet) mobyData, foundServices); - } - else if(mobyData instanceof MobyDataObject){ - serviceAssocObject = new MobyDataObjectSAI((MobyDataObject) mobyData, foundServices); - } - else{ - logger.warn("Service options for objects other than MobyDataObject " + - "and MobyDataObjectSet are not yet supported."); - return; - } addServicesToSubMenu(submenu, serviceAssocObject, handler); } From gordonp at dev.open-bio.org Thu Oct 26 01:32:06 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 21:32:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260132.k9Q1W6R2015292@dev.open-bio.org> gordonp Wed Oct 25 21:32:06 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources In directory dev.open-bio.org:/tmp/cvs-serv15257/src/main/ca/ucalgary/seahawk/resources Modified Files: moby2HTML.xsl Log Message: Became more lenient with moby-s namespace for tags moby-live/Java/src/main/ca/ucalgary/seahawk/resources moby2HTML.xsl,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/moby2HTML.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/moby2HTML.xsl 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/moby2HTML.xsl 2006/10/26 01:32:06 1.2 @@ -31,7 +31,8 @@ + xmlns:moby="http://www.biomoby.org/moby" + xmlns:mobys="http://www.biomoby.org/moby-s"> - + - -

      MOBY Data from + +

      MOBY Data from

      - + - +

      The MOBY data is:

      @@ -84,7 +85,7 @@ - + @@ -93,9 +94,9 @@ - +

      - + @@ -109,7 +110,7 @@

      - + @@ -136,7 +137,7 @@ - + @@ -162,7 +163,7 @@ - + @@ -170,17 +171,17 @@ - +
      - + @@ -207,24 +208,24 @@ - + - +
      Xref:
      - - ID : () - + + ID : () + - + - ID : ():
      - + ID : ():
      +
      - - :
      + + :
      @@ -241,7 +242,7 @@
      MOBY Data for query - +
      + (ID :) @@ -253,11 +254,11 @@ - + - Collection of data elements:
      + Collection of data elements:
        - +
      From gordonp at dev.open-bio.org Thu Oct 26 01:32:06 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 21:32:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260132.k9Q1W6EU015312@dev.open-bio.org> gordonp Wed Oct 25 21:32:06 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services In directory dev.open-bio.org:/tmp/cvs-serv15257/src/main/ca/ucalgary/seahawk/services Modified Files: MobyClient.java Log Message: Became more lenient with moby-s namespace for tags moby-live/Java/src/main/ca/ucalgary/seahawk/services MobyClient.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2006/10/26 00:36:15 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/services/MobyClient.java 2006/10/26 01:32:06 1.3 @@ -624,7 +624,6 @@ public void setRequiredServiceLevel(int level){ serviceLevel = level; - System.err.println("Service level is now set to " + serviceLevel); } public MobyDataServiceAssocInstance getServices(MobyDataObjectSet mdos) throws MobyException{ From gordonp at dev.open-bio.org Thu Oct 26 01:32:06 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 21:32:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260132.k9Q1W6vd015374@dev.open-bio.org> gordonp Wed Oct 25 21:32:06 EDT 2006 Update of /home/repository/moby/moby-live/Java/xmls In directory dev.open-bio.org:/tmp/cvs-serv15257/xmls Modified Files: seahawkBuild.xml Log Message: Became more lenient with moby-s namespace for tags moby-live/Java/xmls seahawkBuild.xml,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/xmls/seahawkBuild.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/xmls/seahawkBuild.xml 2006/10/25 02:33:23 1.1 +++ /home/repository/moby/moby-live/Java/xmls/seahawkBuild.xml 2006/10/26 01:32:06 1.2 @@ -53,8 +53,8 @@ - + + From gordonp at dev.open-bio.org Thu Oct 26 01:32:06 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 21:32:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260132.k9Q1W68D015356@dev.open-bio.org> gordonp Wed Oct 25 21:32:06 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv15257/src/main/org/biomoby/shared/data Modified Files: MobyContentInstance.java Log Message: Became more lenient with moby-s namespace for tags moby-live/Java/src/main/org/biomoby/shared/data MobyContentInstance.java,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyContentInstance.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/shared/data/MobyContentInstance.java 2006/10/26 00:32:20 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyContentInstance.java 2006/10/26 01:32:06 1.6 @@ -190,6 +190,9 @@ MobyDataJob job = new MobyDataJob(); groupID = dataGroupTag.getAttributeNS(MobyPrefixResolver.MOBY_XML_NAMESPACE, MobyTags.QUERYID); + if(groupID == null){ + groupID = dataGroupTag.getAttributeNS(MobyPrefixResolver.MOBY_XML_NAMESPACE_INVALID, MobyTags.QUERYID); + } if(groupID == null || groupID.length() == 0){ groupID = dataGroupTag.getAttributeNS("", MobyTags.QUERYID); } From gordonp at dev.open-bio.org Thu Oct 26 01:32:06 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 21:32:06 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260132.k9Q1W6Hp015334@dev.open-bio.org> gordonp Wed Oct 25 21:32:06 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv15257/src/main/org/biomoby/shared Modified Files: MobyPrefixResolver.java Log Message: Became more lenient with moby-s namespace for tags moby-live/Java/src/main/org/biomoby/shared MobyPrefixResolver.java,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrefixResolver.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/MobyPrefixResolver.java 2006/10/26 00:34:13 1.6 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrefixResolver.java 2006/10/26 01:32:06 1.7 @@ -51,6 +51,9 @@ public static String getAttr(org.w3c.dom.Element e, String attrName){ String value = e.getAttributeNS(MOBY_XML_NAMESPACE, attrName); if(value == null || "".equals(value)){ + value = e.getAttributeNS(MOBY_XML_NAMESPACE_INVALID, attrName); + } + if(value == null || "".equals(value)){ value = e.getAttributeNS(null, attrName); } return value; @@ -95,7 +98,8 @@ } // Make sure it's in the MOBY namespace, or no namespace at all String uri = child.getNamespaceURI(); - if(uri != null && uri.length() != 0 && !uri.equals(MOBY_XML_NAMESPACE)){ + if(uri != null && uri.length() != 0 && !uri.equals(MOBY_XML_NAMESPACE) && + !uri.equals(MOBY_XML_NAMESPACE_INVALID)){ continue; } From gordonp at dev.open-bio.org Thu Oct 26 01:40:43 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Wed, 25 Oct 2006 21:40:43 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610260140.k9Q1eh4Y015423@dev.open-bio.org> gordonp Wed Oct 25 21:40:43 EDT 2006 Update of /home/repository/moby/moby-live/Java/docs In directory dev.open-bio.org:/tmp/cvs-serv15388 Modified Files: Seahawk.html Log Message: Updated docs to reflect fact that Seahawk is now completely in the jMOBY CVS moby-live/Java/docs Seahawk.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/Seahawk.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/docs/Seahawk.html 2006/08/01 16:00:49 1.2 +++ /home/repository/moby/moby-live/Java/docs/Seahawk.html 2006/10/26 01:40:43 1.3 @@ -50,7 +50,7 @@

      How do I launch it?

      -

      The applet can be launched from the following Web site: http://moby.ucalgary.ca/seahawk/

      +

      The applet can be launched from the following Web site: http://moby.ucalgary.ca/seahawk/. If you are a programmer, you can run it with a checked out version of the jMOBY CVS: ./build.sh seahawk/tt>

      @@ -69,7 +69,7 @@

      The jar (Java archive) file containing all of the required classes (including those from Axis, Jena, Xalan, Xerces, etc.) is available - here. Note that this JAR + here. Note that this JAR is signed by the University of Calgary Bioinformatics Lab. This jar file can be used as an application with the command:

      java -jar seahawk.jar
      @@ -79,8 +79,8 @@

      Or it can be launched from within another Java application with the following code (and assuming seahawk.jar is in the classpath):

      -import ca.ucalgary.bluejay.util.MobyUtils;
      -import ca.ucalgary.bluejay.gui.MobyContentGUI;
      +import ca.ucalgary.seahawk.util.MobyUtils;
      +import ca.ucalgary.seahawk.gui.MobyContentGUI;
       
       // the rest of your application code goes here...
       
      @@ -108,7 +108,7 @@
         There are 4 main mechanisms for creating Moby Data Instances in Seahawk:
       
      1. When a Moby XML file is loaded, the resulting (customizable) HTML display contains XPointer-based hyperlinks to parts of the original XML file.
      2. -
      3. Highlighted text is automatically turned into a Moby String Object by ca.ucalgary.bluejay.gui.MobyContentGUI, and +
      4. Highlighted text is automatically turned into a Moby String Object by ca.ucalgary.seahawk.gui.MobyContentGUI, and this same class will create a MOBY DNASequence, RNASequence or AASequence if 95% of the characters are valid for that sequence type.
      5. Highlighted text is tested against a set of regular expression rules
      6. Programmatically selected XML document nodes (e.g. when genes are clicked in Bluejay) are tested against a set of XPath rules
      7. From gordonp at dev.open-bio.org Fri Oct 27 20:00:35 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 27 Oct 2006 16:00:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610272000.k9RK0ZWA023723@dev.open-bio.org> gordonp Fri Oct 27 16:00:35 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util In directory dev.open-bio.org:/tmp/cvs-serv23670/src/main/ca/ucalgary/seahawk/util Modified Files: MobyUtils.java Log Message: Improvements to popup-menu hierarchy when there are many, many service options moby-live/Java/src/main/ca/ucalgary/seahawk/util MobyUtils.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2006/10/26 00:35:19 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2006/10/27 20:00:35 1.3 @@ -5,12 +5,13 @@ import org.biomoby.shared.data.*; import org.biomoby.shared.MobyDataType; +import org.biomoby.shared.MobyNamespace; import java.util.Vector; import javax.swing.JLabel; public class MobyUtils{ - public static final int MAX_OBJ_NAME_LEN = 18; + public static final int MAX_OBJ_NAME_LEN = 12; private static MobyContentGUI mobyContentGUI = null; private static MobyServicesGUI mobyServicesGUI = null; @@ -29,13 +30,15 @@ } // Can always use the data as a string - objects.add(new MobyDataString(objectName, data)); + MobyDataString strObject = new MobyDataString(objectName, data); + strObject.setPrimaryNamespace(new MobyNamespace("seahawk")); + objects.add(strObject); // If it's a single word, give keyword options if(data.trim().matches("^[A-Za-z0-9_-]{3,}$")){ objects.add(new MobyDataComposite("Global_Keyword", "dummy_name", - "seahawk_namespace", + "seahawk", data.trim())); } @@ -113,19 +116,19 @@ if(Sequence.isDNA(sequenceData)){ sequence = new MobyDataComposite("DNASequence", "dummy_name", - "seahawk_namespace", + "seahawk", id); } else if(Sequence.isRNA(sequenceData)){ sequence = new MobyDataComposite("RNASequence", "dummy_name", - "seahawk_namespace", + "seahawk", id); } else if(Sequence.isProtein(sequenceData)){ sequence = new MobyDataComposite("AminoAcidSequence", "dummy_name", - "seahawk_namespace", + "seahawk", id); } // Not a recognized type of sequence From gordonp at dev.open-bio.org Fri Oct 27 20:00:35 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 27 Oct 2006 16:00:35 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610272000.k9RK0Z6X023705@dev.open-bio.org> gordonp Fri Oct 27 16:00:35 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv23670/src/main/ca/ucalgary/seahawk/gui Modified Files: MobyServicesGUI.java Log Message: Improvements to popup-menu hierarchy when there are many, many service options moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyServicesGUI.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/10/26 01:31:25 1.2 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/10/27 20:00:35 1.3 @@ -22,7 +22,7 @@ public final static String SERVICE_SUBMENU_NAME = "seahawkPopupSubMenuName"; // After this many, subdivide the services for an object into sublists based of service ontology - public final static int MAX_SERVICES_PER_SUBMENU = 7; + public final static int MAX_SERVICES_PER_SUBMENU = 20; public final static int MAX_SERVICE_DESC_LEN = 100; public final static String CLIPBOARD_CMD = "clipboard"; /** Always spring MOBY response in a new window if this modifier is present for a click */ @@ -530,48 +530,6 @@ addClipboardItem(submenu, mobyData); submenu.add(getWaitItem(submenu)); -// MobyService[] foundServices = null; -// try{ -// mobyData.setXmlMode(MobyDataInstance.CENTRAL_XML_MODE); -// //logger.debug("Querying central with: " + mobyData.toXML()); -// MobyService templateService = new MobyService(""); -// if(!(mobyData instanceof MobyData)){ -// logger.warn("MobyDataInstance implementer " + mobyData.getClass() + -// " cannot be used to find services, it does not " + -// "inherit from MobyData as Central requires"); -// } -// templateService.addInput((MobyData) mobyData); -// foundServices = mobyClient.getMobyCentralImpl().findService(templateService); -// } -// catch(Exception mobye){ -// logger.error("Could not retrieve list of MobyServices from initialized MobyClient using the " + -// "MOBY data " + mobyData);mobye.printStackTrace(); -// synchronized(popupList){ -// popupList.setVisible(false); -// popupList.remove(waitItem); -// if(submenu.isPopupMenuVisible()){ -// submenu.setPopupMenuVisible(false); -// submenu.remove(getWaitItem(submenu)); -// submenu.setPopupMenuVisible(true); -// } -// else{ -// submenu.remove(getWaitItem(submenu)); -// } -// popupList.setVisible(true); -// } -// return; -// } -// if(foundServices == null || foundServices.length == 0){ -// popupList.setVisible(false); -// return; -// } - -// // Let's make sure all of the services have their service type properly instantiated -// // for ontology checks later on -// for(int j = 0; j < foundServices.length; j++){ -// foundServices[j].setServiceType(MobyServiceType.getServiceType(foundServices[j].getServiceType().getName())); -// } - MobyDataServiceAssocInstance serviceAssocObject = null; // //Services for only the one piece of data try{ @@ -725,6 +683,140 @@ if(ontologyDepth >= maxOntologyDepth){ // TO DO: for now, a long list will appear instead //System.err.println("In TODO big sublist ("+ontologyDepth+">="+maxOntologyDepth+")"); + // Recursively call this method for each type in the ontology at the given depth + + // Make smaller lists based on returned data ontology + MobyDataType[][] outputLineages = new MobyDataType[unsortedServices.length][]; + int maxDataOntologyDepth = 0; + for(int i = 0; i < unsortedServices.length; i++){ + MobyData[] output = unsortedServices[i].getPrimaryOutputs(); + + MobyDataType outputType = null; + if(output != null && output.length != 0 && output[0] instanceof MobyPrimaryData){ + outputType = MobyDataType.getDataType(((MobyPrimaryData) output[0]).getDataType().getName()); + } + if(outputType == null){ + logger.warn("No output data type (ontology) was associated with service " + + unsortedServices[i] + ", cannot add to the hierarchical service " + + "menus (skipping)"); + continue; + } + outputLineages[i] = outputType.getLineage(); + if(outputLineages[i] == null){ + logger.debug("No output data type lineage (ontology position) was associated with service type " + + outputType + ", cannot add to the hierarchical service " + + "menus (skipping)"); + } + else if(outputLineages[i].length > maxOntologyDepth){ + maxDataOntologyDepth = outputLineages[i].length; + } + logger.debug("Data lineage for " + unsortedServices[i].getName() + + "had length " + outputLineages[i].length); + } + + String commonDataAncestorDesc = ""; + int dataOntologyDepth = 0; + breadth_first_data_search: for(; dataOntologyDepth < maxDataOntologyDepth; dataOntologyDepth++){ + MobyDataType commonOutputType = null; + for(int i = 0; i < outputLineages.length; i++){ + if(outputLineages[i] == null || outputLineages[i].length <= dataOntologyDepth){ + continue; + } + + // Not yet set + if(commonOutputType == null){ + commonOutputType = outputLineages[i][dataOntologyDepth]; + commonAncestorDesc += outputLineages[i][dataOntologyDepth] + " > "; + } + // Difference in lineages found, need to split the menu here... + else if(!commonOutputType.equals(outputLineages[i][dataOntologyDepth])){ + break breadth_first_data_search; // labelled break + } + } + } + //System.err.println("common ontology depth is " + dataOntologyDepth); + + if(dataOntologyDepth >= maxDataOntologyDepth){ + // Must separate by name + sortServicesByName(unsortedServices); + for(int j = 0; j < unsortedServices.length-1;j += MAX_SERVICES_PER_SUBMENU){ + MobyService[] services = null; + if(j+MAX_SERVICES_PER_SUBMENU < unsortedServices.length){ //full slot + services = new MobyService[MAX_SERVICES_PER_SUBMENU]; + System.arraycopy(unsortedServices, j, services, 0, MAX_SERVICES_PER_SUBMENU); + } + else{ + services = new MobyService[unsortedServices.length-j]; + System.arraycopy(unsortedServices, j, services, 0, unsortedServices.length-j); + } + + JMenu newMenu = addNameDivSubMenu(submenu, services); + MobyDataServiceAssocInstance newMsadi = null; + if(msadi instanceof MobyDataXref){ + newMsadi = new MobyDataXref((MobyDataObject) msadi, services[0]); + } + else if(msadi instanceof MobyDataObjectSAI){ + newMsadi = new MobyDataObjectSAI((MobyDataObject) msadi, services); + } + else if(msadi instanceof MobyDataObjectSetSAI){ + newMsadi = new MobyDataObjectSetSAI((MobyDataObjectSet) msadi, services); + } + addServicesToSubMenu(newMenu, newMsadi, handler); + } + } + + else{ + // How many submenus do we need? + Map> outputType2Services = + new TreeMap>(); + for(int i = 0; i < outputLineages.length; i++){ + if(outputLineages[i] == null){ + continue; + } + MobyDataType type = null; + // Branch + if(outputLineages[i].length > dataOntologyDepth){ + type = outputLineages[i][dataOntologyDepth]; + } + // Leaf + else if(dataOntologyDepth >= 1){ + type = outputLineages[i][outputLineages[i].length-1]; + } + // ?? rootless node? + else{ + type = new MobyDataType("Object (no details)"); + } + MobyService service = unsortedServices[i]; + // type exists already + if(outputType2Services.containsKey(type)){ + outputType2Services.get(type).add(service); + } + // otherwise first service of this type + else{ + Vector serviceItems = new Vector(); + serviceItems.add(service); + outputType2Services.put(type, serviceItems); + } + } + + for(MobyDataType type: outputType2Services.keySet()){ + + JMenu newMenu = addOutputTypeSubMenu(submenu, type); + + Vector serviceVector = outputType2Services.get(type); + MobyService[] services = serviceVector.toArray(new MobyService[serviceVector.size()]); + MobyDataServiceAssocInstance newMsadi = null; + if(msadi instanceof MobyDataXref){ + newMsadi = new MobyDataXref((MobyDataObject) msadi, services[0]); + } + else if(msadi instanceof MobyDataObjectSAI){ + newMsadi = new MobyDataObjectSAI((MobyDataObject) msadi, services); + } + else if(msadi instanceof MobyDataObjectSetSAI){ + newMsadi = new MobyDataObjectSetSAI((MobyDataObjectSet) msadi, services); + } + addServicesToSubMenu(newMenu, newMsadi, handler); + }} } else{ @@ -742,7 +834,7 @@ } // Leaf else if(ontologyDepth >= 1){ - type = serviceLineages[i][ontologyDepth-1]; + type = serviceLineages[i][serviceLineages[i].length-1]; } // ?? rootless node? else{ @@ -780,21 +872,21 @@ } addServicesToSubMenu(newMenu, newMsadi, handler); } + } - // Causes resizing based on new items - if(submenu.isPopupMenuVisible()){ - submenu.setPopupMenuVisible(false); - submenu.remove(getWaitItem(submenu)); - submenu.setPopupMenuVisible(true); - } - else{ - submenu.remove(getWaitItem(submenu)); - } - // If recursed to create more submenus, do not execute the code below, - // which would add the items to the top level submenu too. - return; + // Causes resizing based on new items + if(submenu.isPopupMenuVisible()){ + submenu.setPopupMenuVisible(false); + submenu.remove(getWaitItem(submenu)); + submenu.setPopupMenuVisible(true); } - + else{ + submenu.remove(getWaitItem(submenu)); + } + // If recursed to create more submenus, do not execute the code below, + // which would add the items to the top level submenu too. + return; + } addHandler(handler); @@ -900,6 +992,76 @@ return menu; } + protected String getNameStart(MobyService service){ + String serviceName = service.getName(); + if(serviceName.length() <= 9){ + return serviceName; + } + else{ + return serviceName.substring(0, 8)+"..."; + } + } + + public JMenu addNameDivSubMenu(JMenu parentMenu, MobyService[] services){ + if(services == null || services.length == 0){ + return null; + } + + JMenu menu = new JMenu("Service name "+getNameStart(services[0]) + "-"+ + getNameStart(services[services.length-1])+":"); + parentMenu.add(menu); + + // The following is to keep track of nested menu parents, which + // you can't do directly in Swing (see + // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4103931) + while(service2submenu.containsKey(parentMenu)){ + parentMenu = (JMenu) service2submenu.get(parentMenu); + } + + // All menus, no matter how nested, point to top submenu that corresponds to the data object + service2submenu.put(menu, parentMenu); + + return menu; + } + + public JMenu addOutputTypeSubMenu(JMenu parentMenu, MobyDataType type){ + JMenu menu = new JMenu("Result type: " + type.getName()); + + MobyDataType[] typeLineage = type.getLineage(); + String commonAncestorDesc = ""; + for(int i = 0; i < typeLineage.length; i++){ + if(typeLineage == null){ + commonAncestorDesc = "No details available"; + break; + } + commonAncestorDesc += typeLineage[i].getName() + " > "; + } + + String desc = type.getDescription(); + if(desc == null || desc.length() == 0){ + desc = type.getComment(); + } + String menuToolTip = commonAncestorDesc + desc; + if(menuToolTip.length() > MAX_SERVICE_DESC_LEN){ + // Cut down really long ancestry descs to the last part (most precise) + menuToolTip = "..." + menuToolTip.substring(menuToolTip.length()-MAX_SERVICE_DESC_LEN); + } + menu.setToolTipText(menuToolTip); + parentMenu.add(menu); + + // The following is to keep track of nested menu parents, which + // you can't do directly in Swing (see + // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4103931) + while(service2submenu.containsKey(parentMenu)){ + parentMenu = (JMenu) service2submenu.get(parentMenu); + } + + // All menus, no matter how nested, point to top submenu that corresponds to the data object + service2submenu.put(menu, parentMenu); + + return menu; + } + public JMenu createObjectSubMenu(MobyDataInstance mdi){ if(!(mdi instanceof MobyPrimaryData)){ logger.warn("Ignoring non-primary data object submitted to menu creation: " + mdi); From gordonp at dev.open-bio.org Fri Oct 27 20:11:01 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 27 Oct 2006 16:11:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610272011.k9RKB1XB023774@dev.open-bio.org> gordonp Fri Oct 27 16:11:01 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv23739/src/main/ca/ucalgary/seahawk/gui Modified Files: MobyServicesGUI.java Log Message: Improvements to popup-menu hierarchy when there are many, many service options moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyServicesGUI.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/10/27 20:00:35 1.3 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/10/27 20:11:01 1.4 @@ -22,7 +22,7 @@ public final static String SERVICE_SUBMENU_NAME = "seahawkPopupSubMenuName"; // After this many, subdivide the services for an object into sublists based of service ontology - public final static int MAX_SERVICES_PER_SUBMENU = 20; + public final static int MAX_SERVICES_PER_SUBMENU = 12; public final static int MAX_SERVICE_DESC_LEN = 100; public final static String CLIPBOARD_CMD = "clipboard"; /** Always spring MOBY response in a new window if this modifier is present for a click */ From gordonp at dev.open-bio.org Fri Oct 27 20:11:01 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 27 Oct 2006 16:11:01 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610272011.k9RKB1va023794@dev.open-bio.org> gordonp Fri Oct 27 16:11:01 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util In directory dev.open-bio.org:/tmp/cvs-serv23739/src/main/ca/ucalgary/seahawk/util Modified Files: MobyUtils.java Log Message: Improvements to popup-menu hierarchy when there are many, many service options moby-live/Java/src/main/ca/ucalgary/seahawk/util MobyUtils.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2006/10/27 20:00:35 1.3 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MobyUtils.java 2006/10/27 20:11:01 1.4 @@ -11,7 +11,7 @@ import javax.swing.JLabel; public class MobyUtils{ - public static final int MAX_OBJ_NAME_LEN = 12; + public static final int MAX_OBJ_NAME_LEN = 18; private static MobyContentGUI mobyContentGUI = null; private static MobyServicesGUI mobyServicesGUI = null; From gordonp at dev.open-bio.org Fri Oct 27 20:55:14 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Fri, 27 Oct 2006 16:55:14 -0400 Subject: [MOBY-guts] biomoby commit Message-ID: <200610272055.k9RKtEgq023949@dev.open-bio.org> gordonp Fri Oct 27 16:55:14 EDT 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui In directory dev.open-bio.org:/tmp/cvs-serv23914/src/main/ca/ucalgary/seahawk/gui Modified Files: MobyServicesGUI.java Log Message: Handle long tooltips better now, using multiline HTML rather than truncating moby-live/Java/src/main/ca/ucalgary/seahawk/gui MobyServicesGUI.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/10/27 20:11:01 1.4 +++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/MobyServicesGUI.java 2006/10/27 20:55:14 1.5 @@ -23,7 +23,7 @@ // After this many, subdivide the services for an object into sublists based of service ontology public final static int MAX_SERVICES_PER_SUBMENU = 12; - public final static int MAX_SERVICE_DESC_LEN = 100; + public final static int MAX_SERVICE_DESC_LEN = 50; public final static String CLIPBOARD_CMD = "clipboard"; /** Always spring MOBY response in a new window if this modifier is present for a click */ public final static int USE_DEFAULT_HANDLER_MASK = ActionEvent.SHIFT_MASK; @@ -928,8 +928,8 @@ String serviceDesc = service.getDescription(); String serviceAuthority = service.getAuthority(); if(serviceDesc != null && serviceDesc.length() > 0){ - if(serviceDesc.length() > MAX_SERVICE_DESC_LEN+3){ - serviceDesc = serviceDesc.substring(0, MAX_SERVICE_DESC_LEN) + "..."; + if(serviceDesc.length() > MAX_SERVICE_DESC_LEN){ + serviceDesc = htmlifyToolTipText(serviceDesc); } sdesc = serviceDesc; } @@ -974,7 +974,7 @@ String menuToolTip = commonAncestorDesc + type.getDescription(); if(menuToolTip.length() > MAX_SERVICE_DESC_LEN){ // Cut down really long ancestry descs to the last part (most precise) - menuToolTip = "..." + menuToolTip.substring(menuToolTip.length()-MAX_SERVICE_DESC_LEN); + menuToolTip = htmlifyToolTipText(menuToolTip); } menu.setToolTipText(menuToolTip); parentMenu.add(menu); @@ -1002,6 +1002,46 @@ } } + /** + * By turning the tool tip text into HTML, we can make it multiline + */ + protected String htmlifyToolTipText(String text){ + int maxLine = MAX_SERVICE_DESC_LEN; + StringBuffer result = null; + + while(true){ + result = new StringBuffer(""); + StringTokenizer st = new StringTokenizer(text, " \t\n"); + int lineCharCount = 0; + + if(st.hasMoreTokens()){ + result.append(st.nextToken()); + lineCharCount = result.length()-6; + } + while(st.hasMoreTokens()){ + String word = st.nextToken(); + if(lineCharCount != 0 && lineCharCount + word.length() >= maxLine){ + result.append("
        " + word); + lineCharCount = word.length(); + continue; + } + result.append(" " + word); + lineCharCount += word.length()+1; + + if(lineCharCount > maxLine){ //single word is bigger than preset width, redo layout + maxLine = lineCharCount; + break; + } + } + result.append(""); + if(!st.hasMoreTokens()){ //used up all the text, didn't break previous loop abnormally + break; + } + } //end layout block + + return result.toString(); + } + public JMenu addNameDivSubMenu(JMenu parentMenu, MobyService[] services){ if(services == null || services.length == 0){ return null; @@ -1044,7 +1084,7 @@ String menuToolTip = commonAncestorDesc + desc; if(menuToolTip.length() > MAX_SERVICE_DESC_LEN){ // Cut down really long ancestry descs to the last part (most precise) - menuToolTip = "..." + menuToolTip.substring(menuToolTip.length()-MAX_SERVICE_DESC_LEN); + menuToolTip = htmlifyToolTipText(menuToolTip); } menu.setToolTipText(menuToolTip); parentMenu.add(menu); From gordonp at dev.open-bio.org Sun Oct 29 15:26:55 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Sun, 29 Oct 2006 10:26:55 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200610291526.k9TFQtbw018754@dev.open-bio.org> gordonp Sun Oct 29 10:26:53 EST 2006 Update of /home/repository/moby/jars-archive/current In directory dev.open-bio.org:/tmp/cvs-serv18719 Modified Files: MobyServlet.war Log Message: Fixed manifest to have ServletTester as main-class. The mainfest got overwritten in the last update by mistake jars-archive/current MobyServlet.war,1.2,1.3 =================================================================== RCS file: /home/repository/moby/jars-archive/current/MobyServlet.war,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 Binary files /home/repository/moby/jars-archive/current/MobyServlet.war 2006/10/24 17:50:14 1.2 and /home/repository/moby/jars-archive/current/MobyServlet.war 2006/10/29 15:26:53 1.3 differ rcsdiff: /home/repository/moby/jars-archive/current/MobyServlet.war: diff failed From gordonp at dev.open-bio.org Mon Oct 30 15:49:39 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 30 Oct 2006 10:49:39 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200610301549.k9UFnde3025206@dev.open-bio.org> gordonp Mon Oct 30 10:49:38 EST 2006 Update of /home/repository/moby/jars-archive/current In directory dev.open-bio.org:/tmp/cvs-serv25171 Modified Files: MobyServlet.war Log Message: Updates to fix issue with registering services taking Collections (which didn't support data types due to a quirk in MobyPrimaryDataSet's implementation) jars-archive/current MobyServlet.war,1.3,1.4 =================================================================== RCS file: /home/repository/moby/jars-archive/current/MobyServlet.war,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 Binary files /home/repository/moby/jars-archive/current/MobyServlet.war 2006/10/29 15:26:53 1.3 and /home/repository/moby/jars-archive/current/MobyServlet.war 2006/10/30 15:49:37 1.4 differ rcsdiff: /home/repository/moby/jars-archive/current/MobyServlet.war: diff failed From gordonp at dev.open-bio.org Mon Oct 30 15:54:39 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 30 Oct 2006 10:54:39 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200610301554.k9UFsdWV025311@dev.open-bio.org> gordonp Mon Oct 30 10:54:39 EST 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data In directory dev.open-bio.org:/tmp/cvs-serv25276/main/org/biomoby/shared/data Modified Files: MobyDataObject.java Log Message: Checked for freak condition that no data type has been assigned to the object before printing moby-live/Java/src/main/org/biomoby/shared/data MobyDataObject.java,1.10,1.11 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.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/shared/data/MobyDataObject.java 2006/10/26 00:31:21 1.10 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java 2006/10/30 15:54:39 1.11 @@ -559,7 +559,15 @@ } // One-tag representation, since it doesn't have any CRIB or PIB to enclose - return "<" + getDataType().getName() +" " + getAttrXML() + "/>"; + if(getDataType() == null){ + // If the data type is null, there must be something wrong + // with fetching the ontology RDF from MOBY Central. At the very + // least, we know the thing must be an Object. + return ""; + } + else{ + return "<" + getDataType().getName() +" " + getAttrXML() + "/>"; + } } else{ // Override super because article name is not actually important to us From gordonp at dev.open-bio.org Mon Oct 30 15:55:36 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 30 Oct 2006 10:55:36 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200610301555.k9UFtaHJ025354@dev.open-bio.org> gordonp Mon Oct 30 10:55:36 EST 2006 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory dev.open-bio.org:/tmp/cvs-serv25319/main/org/biomoby/shared Modified Files: MobyPrimaryDataSet.java Log Message: Added support for declaring data type of set, even if no elements are present yet. If elements are added, the data type is changed moby-live/Java/src/main/org/biomoby/shared MobyPrimaryDataSet.java,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSet.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/MobyPrimaryDataSet.java 2006/07/07 04:12:40 1.7 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyPrimaryDataSet.java 2006/10/30 15:55:36 1.8 @@ -25,6 +25,7 @@ extends MobyPrimaryData { protected Vector elements = new Vector(); // elemenst are of type MobyPrimaryDataSimple + protected MobyDataType defaultDataType = new MobyDataType("Object"); /************************************************************************** * Default constructor. Other characteristics are empty - which is usually @@ -82,7 +83,7 @@ if (elements.size() > 0) return ((MobyPrimaryDataSimple)elements.firstElement()).getDataType(); else - return null; + return defaultDataType; } } @@ -92,6 +93,7 @@ * data type). *************************************************************************/ public void setDataType (MobyDataType dataType) { + defaultDataType = dataType; synchronized (elements) { for (Enumeration en = elements.elements(); en.hasMoreElements(); ) ((MobyPrimaryDataSimple)en.nextElement()).setDataType (dataType); @@ -170,6 +172,11 @@ for (Enumeration en = elements.elements(); en.hasMoreElements(); ) buf.append (((MobyPrimaryDataSimple)en.nextElement()).toXML()); } + else{ + MobyPrimaryDataSimple template = new MobyPrimaryDataSimple(); + template.setDataType(defaultDataType); + buf.append(template.toXML()); + } buf.append (""); buf.append ("\n"); return new String (buf); From gordonp at dev.open-bio.org Mon Oct 30 15:56:19 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Mon, 30 Oct 2006 10:56:19 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200610301556.k9UFuJsX025393@dev.open-bio.org> gordonp Mon Oct 30 10:56:19 EST 2006 Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util In directory dev.open-bio.org:/tmp/cvs-serv25362/main/ca/ucalgary/seahawk/util Added Files: MinJarMaker.java Log Message: Tool used to generate Seahawk standalone JAR moby-live/Java/src/main/ca/ucalgary/seahawk/util MinJarMaker.java,NONE,1.1 From gordonp at dev.open-bio.org Tue Oct 31 20:25:56 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 31 Oct 2006 15:25:56 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200610312025.k9VKPufQ029279@dev.open-bio.org> gordonp Tue Oct 31 15:25:55 EST 2006 Update of /home/repository/moby/moby-live/Java/src/Clients In directory dev.open-bio.org:/tmp/cvs-serv29244/src/Clients Modified Files: ServletTester.java Log Message: Better error reporting if the provided 'web.xml' file is not syntactically correct moby-live/Java/src/Clients ServletTester.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/ServletTester.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/ServletTester.java 2006/10/25 02:33:22 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/ServletTester.java 2006/10/31 20:25:55 1.2 @@ -33,7 +33,7 @@ ServletTester tester = new ServletTester(); // Open the web.xml file to determine the service name and inputs/outputs. - java.net.URL webXmlURL = tester.getClass().getClassLoader().getResource("WEB-INF/web.xml"); + java.net.URL webXmlURL = tester.getClass().getClassLoader().getResource("WEB-INF/web.xml"); if(webXmlURL == null){ System.err.println("Could not find \"WEB-INF/web.xml\", aborting!"); System.exit(1); @@ -48,10 +48,18 @@ dbf.setNamespaceAware(false); DocumentBuilder docBuilder = dbf.newDocumentBuilder(); - Element docRoot = docBuilder.parse(webXmlURL.openStream()).getDocumentElement(); - if(docRoot == null || !docRoot.getNodeName().equals("web-app")){ - System.err.println("Could not find /web-app tag in " + - webXmlURL + ", aborting!"); + Element docRoot = null; + try{ + docRoot = docBuilder.parse(webXmlURL.openStream()).getDocumentElement(); + if(docRoot == null || !docRoot.getNodeName().equals("web-app")){ + System.err.println("Could not find /web-app tag in " + + webXmlURL + ", aborting!"); + System.exit(1); + } + } catch(Exception e){ + System.err.println("There appears to be a problem with the \"WEB-INF/web.xml\" file (XML syntax?)." + + "While parsing it I encountered the error: " + e); + e.printStackTrace(); System.exit(1); } Element servlet = getChildElement(docRoot, "servlet"); From gordonp at dev.open-bio.org Tue Oct 31 20:55:45 2006 From: gordonp at dev.open-bio.org (Paul Gordon) Date: Tue, 31 Oct 2006 15:55:45 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200610312055.k9VKtjgb029560@dev.open-bio.org> gordonp Tue Oct 31 15:55:45 EST 2006 Update of /home/repository/moby/jars-archive/current In directory dev.open-bio.org:/tmp/cvs-serv29525 Modified Files: MobyServlet.war Log Message: Better error reporting if the provided 'web.xml' file is not syntactically correctin test client jars-archive/current MobyServlet.war,1.4,1.5 =================================================================== RCS file: /home/repository/moby/jars-archive/current/MobyServlet.war,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 Binary files /home/repository/moby/jars-archive/current/MobyServlet.war 2006/10/30 15:49:37 1.4 and /home/repository/moby/jars-archive/current/MobyServlet.war 2006/10/31 20:55:44 1.5 differ rcsdiff: /home/repository/moby/jars-archive/current/MobyServlet.war: diff failed
      - (ID :)