[jsword-devel] JSword servlet usage.

DM Smith dmsmith555 at yahoo.com
Fri Apr 18 10:42:30 MST 2008


I have worked up an example, demo, starting point of how to use JSword 
in a servlet using DWR - Direct Web Remoting.

Here is a tutorial on how to do it:
http://www.crosswire.org/jsword/tutorial.html

Here is a somewhat working version of it.
(I don't have any of these indexed, so search does not work.)
http://www.crosswire.org:8080/jsword/iBD.html

This doesn't follow the tutorial exactly. I had to tweak the dwr 
javascript inclusions.

There are some shortcomings in this example:
1) Because all the links are handled via java script, it never leaves 
the page. Hitting the brower's back button does not take you to the 
prior verse. It would be really nice to have history.
2) There are no options, e.g. show/hide notes/Strong's/xrefs/verse 
numbers/verse per line, .... There should be.
3) This does no caching at all.
    a) It should cache the XSLT processor. During development, you don't 
want caching.
    b) In doing options, we should cache the dom for the current view. 
No sense in getting it again.
    c) It may make sense to cache the dom for some items in history.
4) It does not make good use of JavaScript. These are pretty trivial.
    a) Rather than notes in a sidebar, it would be good to have a hover 
enabled popup of the note body.
    b) Implement Strong's and Robinson's morphology lookup into a popup. 
Currently, it does these are not handled at all.
    c) Perhaps highlight all words on the page having the same Strong's 
number.
    d) The javascript constrains the return to 100 verses to prevent 
overloading the server with a request like: Gen-Rev. It would be good to 
be able to get the next "n" verses.
    e) Allow dictionary lookup of a displayed word.
    f) The search input box and button should be disabled when a book is 
not indexed.
5) It makes no use of Cookies:
    a) It would be good to have it remember current state
       - Current Bible.
       - Current passage.
       - Last lookup
       - History
       - Settings, e.g. show hide
    b) Allow the user to prune the Bible list to only those that they 
care about.
6) Handle right-to-left languages.
7) Allow for the specification of where to look for modules and an 
alternate location ~/.jsword. (This is a shortcoming in JSword that 
should be fixed.)
    Right now it looks at every conceivable location for SWORD modules 
and it will let you specify additional locations. There is no way to 
prune the list or to specify that it should only look in a given location.
    Right now it will only look at ~/.jsword, which must be writable. In 
a Tomcat installation, this might not be a desirable location. Today 
this can be changed by changing the jsword.home property. There should 
be an easier way to override this.
8) It is not internationalized. It'd be cool to grab the text from 
BibleDesktop.
9) The UI is merely functional. That is, it is ugly. Make it look much 
nicer.
......

I'd also like to add a menu and toolbar. Perhaps, with the toolbar 
hiding the locate and search text inputs behind icons.

I'm sure you can add to this list. Feedback welcomed.

In Him,
    DM









More information about the jsword-devel mailing list