Tuesday, 18 August 2009

Re: [Tyndale STEP - Programming] Successful proof of concept GWT / Jetty / JSword

Not sure if this goes through with the screenshot
Cheers
Chris

2009/8/18 Tyndale STEP Project <TyndaleSTEP@gmail.com>
Hi all

Just to let you know that I've been able to tie Jetty to JSword to GWT quite easily. Here's how it works.


0 - Compile your GWT application. I've used the default Google GWT application that comes with the Eclipse plugin and hacked it around to make a call to the JSword API
---------------------------------------------------

1 - The user starts the application
2 - If the ESV (parameterizable) is not installed, it is downloaded from the internet from Crosswire. This step I'm sure we could try and bypass by distributing the bibles from Crosswire? Is that right Troy? as in distribute them as part of the installation disk (or at least one or two)
3 - The Jetty web server is started up (in process - invisible to the user)
4 - The Jetty web server is told to point at the compiled GWT application
5 - The user makes a request to http://localhost:8080 (in my case 8080 because that's what I've told Jetty to listen on).
6 - The Jetty server serves the first page (platform-targetted javascript and html) which prompts the user for his name
7 - When entered, a response is sent to the Jetty server and the GWT server side code kicks in. It used to send the name the user entered on the screen. Now however, it connects to JSword and sends Genesis 1:1 back to the user.

In order to do this, I just re-used the example I had before, and then tied it in to an API Example from JSword that I found from the internet (slightly modified). There's hardly any code - probably about 100 lines or so...

Would you like me to tie it in to a database? JavaDB or HSQL for example? I'm happy to go forward with that... With Java 1.6, it would be trivial to start the browser automatically as well. With Java 1.5 we could code things to determine what the OS is, look for the default browser (for eg. safari on Macs, internet explorer on windows, etc.) and then open the default command lines...  Alternatively, the shortcut we provide to the user, could first launch the application, and then launch the app, and we'd distribute several shortcuts for the user to press...

Let me know what you think guys.
Chris



--
Posted By Tyndale STEP Project to Tyndale STEP - Programming on 8/18/2009 01:06:00 PM

No comments:

Post a Comment