Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bespoke fix 2023 10 12 #9

Open
wants to merge 1 commit into
base: jsword-stepbible-2023
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>org.crosswire</groupId>
<artifactId>jsword</artifactId>
<packaging>jar</packaging>
<version>1.6.5-SNAPSHOT</version>
<version>1.6.4-SNAPSHOT</version>
<name>jsword</name>
<url>http://maven.apache.org</url>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ public Versification() {
* chapter. Do not include chapter 0.
*/
public Versification(String name, BibleBook[] booksOT, BibleBook[] booksNT, int[][] lastVerseOT, int[][] lastVerseNT) {
this.name = name;

initializeVersification(name, booksOT, booksNT, lastVerseOT, lastVerseNT);
}
public void initializeVersification(String name, BibleBook[] booksOT, BibleBook[] booksNT, int[][] lastVerseOT, int[][] lastVerseNT) {
this.name = name;
// Copy the books into an aggregated BibleBook array
// including INTRO_BIBLE and INTRO_OT/INTRO_NT for non-null book lists
int bookCount = 1; // Always include the INTRO_BIBLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,33 +39,36 @@ public void loadFromJSON(final File jsonFile) throws NoSuchKeyException, BookExc
//convert json string to V11nTmp object
V11nTmp v11n = objectMapper.readValue(jsonData, V11nTmp.class);

SystemCustomVersification.V11N_NAME = v11n.v11nName;
SystemCustomVersification scv = new SystemCustomVersification();

scv.V11N_NAME = v11n.v11nName;

int vmIndex = 0;
SystemCustomVersification.BOOKS_OT = new BibleBook[v11n.otbooks.length - 1];
SystemCustomVersification.LAST_VERSE_OT = new int[v11n.otbooks.length - 1][];
scv.BOOKS_OT = new BibleBook[v11n.otbooks.length - 1];
scv.LAST_VERSE_OT = new int[v11n.otbooks.length - 1][];
for(int i = 0; i < v11n.otbooks.length - 1; i++){
SystemCustomVersification.BOOKS_OT[i] = BibleBook.fromOSIS(v11n.otbooks[i].osis);
SystemCustomVersification.LAST_VERSE_OT[i] = new int[v11n.otbooks[i].chapmax];
System.arraycopy( v11n.vm, vmIndex, SystemCustomVersification.LAST_VERSE_OT[i], 0, v11n.otbooks[i].chapmax);
scv.BOOKS_OT[i] = BibleBook.fromOSIS(v11n.otbooks[i].osis);
scv.LAST_VERSE_OT[i] = new int[v11n.otbooks[i].chapmax];
System.arraycopy( v11n.vm, vmIndex, scv.LAST_VERSE_OT[i], 0, v11n.otbooks[i].chapmax);
vmIndex += v11n.otbooks[i].chapmax;
}

SystemCustomVersification.BOOKS_NT = new BibleBook[v11n.ntbooks.length - 1];
SystemCustomVersification.LAST_VERSE_NT = new int[v11n.ntbooks.length - 1][];
scv.BOOKS_NT = new BibleBook[v11n.ntbooks.length - 1];
scv.LAST_VERSE_NT = new int[v11n.ntbooks.length - 1][];
for(int i = 0; i < v11n.ntbooks.length - 1; i++){
SystemCustomVersification.BOOKS_NT[i] = BibleBook.fromOSIS(v11n.ntbooks[i].osis);
SystemCustomVersification.LAST_VERSE_NT[i] = new int[v11n.ntbooks[i].chapmax];
System.arraycopy( v11n.vm, vmIndex, SystemCustomVersification.LAST_VERSE_NT[i], 0, v11n.ntbooks[i].chapmax);
scv.BOOKS_NT[i] = BibleBook.fromOSIS(v11n.ntbooks[i].osis);
scv.LAST_VERSE_NT[i] = new int[v11n.ntbooks[i].chapmax];
System.arraycopy( v11n.vm, vmIndex, scv.LAST_VERSE_NT[i], 0, v11n.ntbooks[i].chapmax);
vmIndex += v11n.ntbooks[i].chapmax;
}

if(!Versifications.instance().isDefined(SystemCustomVersification.V11N_NAME)) {
Versifications.instance().register(new SystemCustomVersification());
if(!Versifications.instance().isDefined(scv.V11N_NAME)) {
scv.uodateSuper();
Versifications.instance().register(scv);
try {
URI[] dirs = CWProject.instance().getProjectResourceDirs();
final File parent = new File(dirs[0]);
File mapFile = new File(parent, SystemCustomVersification.V11N_NAME + ".properties");
File mapFile = new File(parent, scv.V11N_NAME + ".properties");
if (mapFile.exists()) mapFile.delete();
if(v11n.jsword_mappings.length > 0) {
mapFile.createNewFile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,25 @@
public class SystemCustomVersification extends Versification {

/* protected */ SystemCustomVersification() {
super(V11N_NAME, BOOKS_OT, BOOKS_NT, LAST_VERSE_OT, LAST_VERSE_NT);
//super(V11N_NAME, BOOKS_OT, BOOKS_NT, LAST_VERSE_OT, LAST_VERSE_NT);
}

public static String V11N_NAME = "";
static BibleBook[] BOOKS_OT = {
public void uodateSuper() {
super.initializeVersification(this.V11N_NAME, BOOKS_OT, BOOKS_NT, LAST_VERSE_OT, LAST_VERSE_NT);
}

public String V11N_NAME = "";
BibleBook[] BOOKS_OT = {
};

static BibleBook[] BOOKS_NT = {
BibleBook[] BOOKS_NT = {
};

static int[][] LAST_VERSE_OT = {
int[][] LAST_VERSE_OT = {
};

static int[][] LAST_VERSE_NT = {
int[][] LAST_VERSE_NT = {
};

private static final long serialVersionUID = -1483944788413812511L;
//private static final long serialVersionUID = -1483944788413812511L;
}