[jsword-devel] ReadingsBook keys

Brian Fernandes infernalproteus at gmail.com
Mon Jul 7 12:55:03 MST 2008


FireBible took a small step this weekend, I managed to implement the URL 
scheme we discussed months ago for most books, including bibles.

I am however having a problem with ReadingsBook keys. Given a selection 
like "July 7, 2008", I use book.getKey("July 9, 2008") to get the Key 
from the book. The code in ReadingsBook seems to create a key on the fly 
- a DefaultKeyList which contains a single ReadingsKey. When I use 
either of these keys to get the corresponding text from the bible (using 
code from APIExamples), I get

  Exception in thread "main" org.crosswire.jsword.book.BookException: 
Key not found July 7, 2008
	at 
org.crosswire.jsword.book.readings.ReadingsBook.getOsisIterator(ReadingsBook.java:130)
	at org.crosswire.jsword.book.BookData.getOsisContent(BookData.java:167)
	at org.crosswire.jsword.book.BookData.getOsisFragment(BookData.java:105)
....

If I try passing in another key string, like "July 9" or "July 9 2008", 
JSword will not accept it and I won't even get a Key instance. I have 
this problem with "ot1nt2". I tried with JSword 1.0.7 and a nightly 
1.0.8 from the 29th of June.

If I try something similar with Day by Day Grace, it works without 
issue. Note that DBD is a "SwordDailyDevotional", though it still 
appears as a "readings book" in Bible Desktop (at least they have the 
same icon).

Q1: In what (text) form should I pass in a key to a ReadingsBook so that 
I get the desired text? Note that I cannot use any objects as FireBible 
is URL based.

Q2: Do all readings books contain links to chapters to be read or do 
some contain normal text as well? (I was unable to find anything beyond 
ot1nt2)

Thanks!
Brian.

P.S.
Here is a small blog post about the current state of FireBible:
http://thegoan.com/blog/firebible-beyond-bibles



More information about the jsword-devel mailing list