[jsword-devel] FW: checkin r2140 for JS-184

DM Smith dmsmith at crosswire.org
Sat Apr 2 19:37:24 MST 2011


I just did a big, big checkin. Below is a summary. The log comment is at the bottom.

I've started some work on Alternate Versification. The first step was to stop using magic numbers for Genesis to Revelation (i.e. 1 to 66). This had a big ripple effect in that many methods had "int book" as a parameter.

The second step was to add the non-canonical books to BibleBooks. These are named according to their osisIDs. Note, that Java doesn't like variable to start with a number so 1En (1 Enoch) is named EN1.

If there are no objections, I'd like to rename the constants for GENESIS to REVELATION to match. I've left them as they were called in BibleNames so that it would be easier for you to find and adjust your code.

To this end there is an Enum named BibleBook. If you want to iterate over the OT and NT (i.e. the 66 canonical books), the following is your friend:
for (BibleBook b: EnumSet.range(BibleBook.GENESIS, BibleBook.REVELATION)) {
   ... do something with b...
}

The next step would be to allow for 0 to be a book, chapter or verse value. For BibleBook, that would be OT_INTRO and NT_INTRO. These would be before GENESIS and MATTHEW, respectively. Since we need for an intro for the NT, there needs to be Testament to be added to Verse and Passage classes.

But before I get to that, I'll be looking at using JSword in a concurrent setting, e.g. a web server. Chris has found that two threads cannot go after the same book at the same time. :(

In Him,
	DM

On Apr 2, 2011, at 10:07 PM, jsword-svn-owner at crosswire.org wrote:

> From: dmsmith
> Date: April 2, 2011 10:07:01 PM EDT
> To: jsword-svn
> Subject: r2140 - in trunk: bibledesktop/.settings bibledesktop/src/main/java/org/crosswire/bibledesktop/book bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic bibledesktop/src/main/java/org/crosswire/bibledesktop/passage jsword/src/main/java/org/crosswire/jsword/book jsword/src/main/java/org/crosswire/jsword/book/sword jsword/src/main/java/org/crosswire/jsword/bridge jsword/src/main/java/org/crosswire/jsword/examples jsword/src/main/java/org/crosswire/jsword/passage jsword/src/main/java/org/crosswire/jsword/versification jsword/src/main/resources jsword/src/test/java/org/crosswire/common/compress jsword/src/test/java/org/crosswire/common/progress jsword/src/test/java/org/crosswire/common/util jsword/src/test/java/org/crosswire/jsword/book jsword/src/test/java/org/crosswire/jsword/book/sword jsword/src/test/java/org/crosswire/jsword/bridge jsword/src/test/java/org/crosswire/jsword/passage
> 
> 
> Author: dmsmith
> Date: 2011-04-02 19:07:01 -0700 (Sat, 02 Apr 2011)
> New Revision: 2140
> 
> Added:
>   trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleBook.java
> Removed:
>   trunk/jsword/src/main/java/org/crosswire/jsword/versification/OSISNames.java
> Modified:
>   trunk/bibledesktop/.settings/de.guhsoft.jinto.core.prefs
>   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/BibleComboBoxModel.java
>   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/BibleComboBoxModelSet.java
>   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/DisplaySelectPane.java
>   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/TextPaneBookMetaDataDisplay.java
>   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/TextPaneBookDataDisplay.java
>   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/WholeBibleTreeNode.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/book/SentenceUtil.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordConstants.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BibleScope.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BookExporter.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/bridge/DwrBridge.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/examples/BibleToOsis.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/passage/AbstractPassage.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/passage/AccuracyType.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/passage/Passage.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/passage/PassageEvent.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/passage/PassageTally.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/passage/ReadOnlyPassage.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/passage/RestrictionType.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/passage/RocketPassage.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/passage/SynchronizedPassage.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/passage/Verse.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/passage/VerseRange.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleInfo.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleNames.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/versification/BookName.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/versification/DivisionName.java
>   trunk/jsword/src/main/java/org/crosswire/jsword/versification/SectionNames.java
>   trunk/jsword/src/main/resources/BibleNames.properties
>   trunk/jsword/src/main/resources/BibleNames_af.properties
>   trunk/jsword/src/main/resources/BibleNames_ar_EG.properties
>   trunk/jsword/src/main/resources/BibleNames_bg.properties
>   trunk/jsword/src/main/resources/BibleNames_cs.properties
>   trunk/jsword/src/main/resources/BibleNames_da.properties
>   trunk/jsword/src/main/resources/BibleNames_de.properties
>   trunk/jsword/src/main/resources/BibleNames_en.properties
>   trunk/jsword/src/main/resources/BibleNames_es.properties
>   trunk/jsword/src/main/resources/BibleNames_et.properties
>   trunk/jsword/src/main/resources/BibleNames_fa.properties
>   trunk/jsword/src/main/resources/BibleNames_fi.properties
>   trunk/jsword/src/main/resources/BibleNames_fo.properties
>   trunk/jsword/src/main/resources/BibleNames_fr.properties
>   trunk/jsword/src/main/resources/BibleNames_he.properties
>   trunk/jsword/src/main/resources/BibleNames_hu.properties
>   trunk/jsword/src/main/resources/BibleNames_id.properties
>   trunk/jsword/src/main/resources/BibleNames_in.properties
>   trunk/jsword/src/main/resources/BibleNames_it.properties
>   trunk/jsword/src/main/resources/BibleNames_iw.properties
>   trunk/jsword/src/main/resources/BibleNames_ko.properties
>   trunk/jsword/src/main/resources/BibleNames_la.properties
>   trunk/jsword/src/main/resources/BibleNames_lt.properties
>   trunk/jsword/src/main/resources/BibleNames_nb.properties
>   trunk/jsword/src/main/resources/BibleNames_nl.properties
>   trunk/jsword/src/main/resources/BibleNames_nn.properties
>   trunk/jsword/src/main/resources/BibleNames_no.properties
>   trunk/jsword/src/main/resources/BibleNames_pl.properties
>   trunk/jsword/src/main/resources/BibleNames_pt.properties
>   trunk/jsword/src/main/resources/BibleNames_pt_BR.properties
>   trunk/jsword/src/main/resources/BibleNames_ro.properties
>   trunk/jsword/src/main/resources/BibleNames_ru.properties
>   trunk/jsword/src/main/resources/BibleNames_sk.properties
>   trunk/jsword/src/main/resources/BibleNames_sl.properties
>   trunk/jsword/src/main/resources/BibleNames_sv.properties
>   trunk/jsword/src/main/resources/BibleNames_th.properties
>   trunk/jsword/src/main/resources/BibleNames_uk.properties
>   trunk/jsword/src/main/resources/BibleNames_vi.properties
>   trunk/jsword/src/main/resources/BibleNames_zh.properties
>   trunk/jsword/src/main/resources/BibleNames_zh_CN.properties
>   trunk/jsword/src/main/resources/BookDriver.plugin
>   trunk/jsword/src/main/resources/Bookmark.plugin
>   trunk/jsword/src/main/resources/CWLogging.properties
>   trunk/jsword/src/main/resources/Choice.plugin
>   trunk/jsword/src/main/resources/Converter.plugin
>   trunk/jsword/src/main/resources/Filter.plugin
>   trunk/jsword/src/main/resources/GPLMsg.properties
>   trunk/jsword/src/main/resources/GPLMsg_de.properties
>   trunk/jsword/src/main/resources/GPLMsg_fa.properties
>   trunk/jsword/src/main/resources/IndexManager.plugin
>   trunk/jsword/src/main/resources/IndexMetadata.properties
>   trunk/jsword/src/main/resources/InstallManager.plugin
>   trunk/jsword/src/main/resources/InstallerFactory.plugin
>   trunk/jsword/src/main/resources/JSMsg.properties
>   trunk/jsword/src/main/resources/JSMsg_cs.properties
>   trunk/jsword/src/main/resources/JSMsg_de.properties
>   trunk/jsword/src/main/resources/JSMsg_fa.properties
>   trunk/jsword/src/main/resources/JSMsg_fi.properties
>   trunk/jsword/src/main/resources/JSMsg_fo.properties
>   trunk/jsword/src/main/resources/JSMsg_in.properties
>   trunk/jsword/src/main/resources/JSMsg_lt.properties
>   trunk/jsword/src/main/resources/JSMsg_nb.properties
>   trunk/jsword/src/main/resources/JSMsg_nn.properties
>   trunk/jsword/src/main/resources/JSMsg_pl.properties
>   trunk/jsword/src/main/resources/JSMsg_ru.properties
>   trunk/jsword/src/main/resources/JSMsg_vi.properties
>   trunk/jsword/src/main/resources/JSMsg_zh.properties
>   trunk/jsword/src/main/resources/JSMsg_zh_CN.properties
>   trunk/jsword/src/main/resources/JSOtherMsg.properties
>   trunk/jsword/src/main/resources/JSOtherMsg_de.properties
>   trunk/jsword/src/main/resources/JSOtherMsg_fa.properties
>   trunk/jsword/src/main/resources/JSOtherMsg_in.properties
>   trunk/jsword/src/main/resources/JSOtherMsg_zh.properties
>   trunk/jsword/src/main/resources/JSOtherMsg_zh_CN.properties
>   trunk/jsword/src/main/resources/LGPLMsg.properties
>   trunk/jsword/src/main/resources/OSISNames.properties
>   trunk/jsword/src/main/resources/OldMsg.properties
>   trunk/jsword/src/main/resources/OldMsg_fa.properties
>   trunk/jsword/src/main/resources/OldMsg_in.properties
>   trunk/jsword/src/main/resources/OldMsg_zh.properties
>   trunk/jsword/src/main/resources/OldMsg_zh_CN.properties
>   trunk/jsword/src/main/resources/QueryBuilder.plugin
>   trunk/jsword/src/main/resources/QueryDecorator.plugin
>   trunk/jsword/src/main/resources/README.txt
>   trunk/jsword/src/main/resources/Searcher.plugin
>   trunk/jsword/src/main/resources/iso3166.properties
>   trunk/jsword/src/main/resources/iso639.properties
>   trunk/jsword/src/main/resources/iso639_en.properties
>   trunk/jsword/src/main/resources/iso639_fa.properties
>   trunk/jsword/src/main/resources/iso639_in.properties
>   trunk/jsword/src/main/resources/iso639full.properties
>   trunk/jsword/src/main/resources/log4j.properties
>   trunk/jsword/src/main/resources/ot1nt2.properties
>   trunk/jsword/src/main/resources/ot1nt2_fa.properties
>   trunk/jsword/src/main/resources/ot1nt2_in.properties
>   trunk/jsword/src/main/resources/ot1nt2_zh.properties
>   trunk/jsword/src/main/resources/ot1nt2_zh_CN.properties
>   trunk/jsword/src/main/resources/readings.txt
>   trunk/jsword/src/main/resources/translations.txt
>   trunk/jsword/src/test/java/org/crosswire/common/compress/LZSSTest.java
>   trunk/jsword/src/test/java/org/crosswire/common/progress/JobTest.java
>   trunk/jsword/src/test/java/org/crosswire/common/progress/WorkEventTest.java
>   trunk/jsword/src/test/java/org/crosswire/common/util/StringUtilTest.java
>   trunk/jsword/src/test/java/org/crosswire/jsword/book/BooksTest.java
>   trunk/jsword/src/test/java/org/crosswire/jsword/book/GatherAllReferences.java
>   trunk/jsword/src/test/java/org/crosswire/jsword/book/SentanceUtilTest.java
>   trunk/jsword/src/test/java/org/crosswire/jsword/book/sword/RawFileBackendTest.java
>   trunk/jsword/src/test/java/org/crosswire/jsword/book/sword/SwordBookMetaDataTest.java
>   trunk/jsword/src/test/java/org/crosswire/jsword/bridge/DwrBridgeTest.java
>   trunk/jsword/src/test/java/org/crosswire/jsword/passage/BibleInfoTest.java
>   trunk/jsword/src/test/java/org/crosswire/jsword/passage/PassageConstantsTest.java
>   trunk/jsword/src/test/java/org/crosswire/jsword/passage/PassageParentTst.java
>   trunk/jsword/src/test/java/org/crosswire/jsword/passage/PassageTally2Test.java
>   trunk/jsword/src/test/java/org/crosswire/jsword/passage/VerseRangeTest.java
>   trunk/jsword/src/test/java/org/crosswire/jsword/passage/VerseTest.java
> Log:
> JS-184 Converted the list of constants in BibleNames to an enum BibleBook. Refactored much in BibleInfo, deprecating methods relating to the getting of Bible book names.
> 
> Added non-canonical books to BibleBook.
> 
> Added LGPL 2.1 or later statement to resources.
> 
> Improved tests, fixing assertEquals to have expected and actual in the correct place. Still more to go.
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20110402/67633667/attachment-0001.html>


More information about the jsword-devel mailing list