[jsword-devel] [sword-devel] Web Front-end for JSword (iPhone targeted)

Greg Hellings greg.hellings at gmail.com
Sat Apr 19 10:40:52 MST 2008


On Sat, Apr 19, 2008 at 12:20 PM, DM Smith <dmsmith555 at yahoo.com> wrote:
>
>  On Apr 19, 2008, at 12:43 PM, Greg Hellings wrote:
>
>  > On Sat, Apr 19, 2008 at 8:42 AM, DM Smith <dmsmith555 at yahoo.com>
>  > wrote:
>  >> On Apr 19, 2008, at 5:22 AM, Greg Hellings wrote:
>  >>
>  >>> I've thrown together a quick AJAX-based front-end for JSword.  I'm
>  >>> aiming to make it look and work nice for iPhone users.  We'll see if
>  >>> it works out.  Right now it works fine in Safari on the desktop, and
>  >>> also in the iPhone simulator.  In the simulator the display of
>  >>> non-ASCII characters seems to fail (specifically the WLC and AraSVD
>  >>> modules with Hebrew and Arabic).  I don't know if that's the same on
>  >>> the devices, as I don't have access to one at this time, however,
>  >>> they
>  >>> work fine in desktop Safari.
>  >>
>  >> Super. Great start!
>  >>
>  >> I'm doing the same. :) But I'm not trying to actually create a
>  >> product.
>  >>
>  >> My goal is to create *a* working tutorial for Safari, IE and Firefox.
>  >> Right now, it does not work on Safari. I haven't tried it on IE.
>  >
>  > I get essentially the same error in IE7 as I got in Safari "
>  > 'undefined' is not an object."
>
>  Hmm. More work to do. :)
>
>
>  >  Then again, my own page has IE7 issues
>  > it seems, the CSS for :hover doesn't appear to be supported in IE7 or
>  > Mozilla, while it works fine in Safari.  Likely this is because the
>  > items are not actually links, and the :hover style is, I believe,
>  > targeted at anchor tags specifically.  However, that styling is aimed
>  > at just making it more obvious to desktop users - iPhone has no
>  > concept of mouseover/hover.
>
>  This can be solved with a small piece of JavaScript that adds a class
>  style on mouse enter and removes it on mouse out.
>  See: http://www.alistapart.com/articles/dropdowns
>  You'll need to adapt their code.

Yes, the GWT has a MouseListener which I can register and just make
that change.  I hadn't even thought to check if :hover was supported
outside of anchors on Mozilla and IE - generally if something
nonstandard is supported I have found that FF and IE are the ones to
do it in a non-standard way. -1 for Safari standards compatibility
score.

>
>
>  >
>  >
>  >>
>  >> For more details see my post on jsword-devel:
>  >>
>  >> http://www.crosswire.org/pipermail/jsword-devel/2008-April/
>  >> 002453.html
>  >
>  > I read through it.  It seems most of the problem you're encountering
>  > is with client-side XSL transformations.  I don't know what exactly
>  > you're doing with the XML on the client side.  My version is just
>  > sending the output of getRawText(user_key) across the wire.  I'd like
>  > to send the transformed HTML, but I get a NullPointerExcepion when I
>  > invoke ConverterFactory.getConverter() from my servlet.  When I
>  > iterate over the Converters that it recognizes, the only one is the
>  > ConfigurableSwingConverter, but even trying to retrieve that Converter
>  > throws the exception on line 55 of ConverterFactory.java.
>
>  Try including the bibledesktop*.jar. It is in there.

All of those are included, and the class exists within the project (I
can instantiate the SAX Converter directly - though I don't know the
URI that it's looking for).  It just seems that ConverterFactory isn't
picking up on its existence for some reason.

>
>
>  >  If I
>  > understood more of how to pull the pure XML from the module and where
>  > to find the XSLT, I could do the transformation client-side with GWT's
>  > built-in XSL processor, as it would only make sense for me to be
>  > displaying HTML and not RawText in a browser window.
>
>  See o.c.jsword.bridge.DwrBridge and o.c.jsword.examples.APIExample
>  for, well, examples.

APIExamples has been my crutch throughout the whole project.  It's the
code from getStyledText() in the examples that I'm using to try and
convert to HTML on the server side.  However, the above
ConverterFactory error appears to be the only thing hampering my
efforts.  I'll take a look at DwrBridge.

>
>
>
>
>  >
>  >
>  >>
>  >>
>  >>>
>  >>>
>  >>> There are still some rough edges with the interface - primarily it
>  >>> doesn't properly detect the books that are in a module at any given
>  >>> moment.  It does detect chapters-in-book and verses-in-chapter,
>  >>> though.  For now, you just have to assume that if you get to the
>  >>> verse
>  >>> display and there is no text (and no error box), then that module
>  >>> must
>  >>> not support that verse/book.  There are also additional GUI tweaks
>  >>> that will be needed to smooth the functioning of it, but this is
>  >>> just
>  >>> a quickly hobbled together patch-up.
>  >>
>  >>
>  >> One of the things that I think that is needed in JSword is that the
>  >> global key list actually reflect the content of the module. For
>  >> Bibles
>  >> and commentaries, it assumes Gen-Rev. I'll probably do the same thing
>  >> I did for dictionaries there too.
>  >
>  > I had tried that method (get the global key list, then try the
>  > .contains() method) and to my surprise, it told me that all of the
>  > Bible was available in the LXX.  I likewise tried catching exceptions
>  > from the .getKey() method, but that seems to only throw them if the
>  > Key doesn't exist in the Bible at all, rather than if it doesn't exist
>  > in this module.  However, having each Bible support the
>  > .booksInModule() as well as its own implementation of
>  > .chaptersInBook() and .versesInChapter() would allow for ease of use
>  > if alternate versification ever pops up.  Currently the BibleInfo
>  > class works fine for the latter two, but I can't figure out any way to
>  > narrow down the books available.  It sounds like this is a "ToDo" on
>  > your list, though.
>
>  Books available can be done *today* by checking chapter 1, verse 1 of
>  each book.

I must not be checking them correctly.  I've done it by (1) calling
getGlobalKeyList() and then checking "<book> 1:1" for all 66 books and
seeing if they're in the returned global key list and (2) calling
getKey() on "<book> 1:1" and catching exceptions - if an exception
occurs then I assume the book is not in the module and if none occurs
I add the book name to the list of valid books.  However, both of the
above methods return all 66 books as valid regardless of which module
I'm using.  I couldn't find any examples of how to check it.  What is
the correct method?

--Greg

>
>
>
>
>
>  _______________________________________________
>  jsword-devel mailing list
>  jsword-devel at crosswire.org
>  http://www.crosswire.org/mailman/listinfo/jsword-devel
>



More information about the jsword-devel mailing list