From 302ae9d6f4cbb0d58ea36d21ed63648c00a54f09 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Sat, 9 Aug 2014 20:25:27 -0400 Subject: [PATCH] Skeleton for verse lookup is complete. Unfortunately, looks like I'm going to have some work to either incorporate an OSIS formatter, or re-use one. Given the license of and-bible, I think I might end up re-using that. --- .../service/book/VerseLookupService.java | 35 +++---------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/app/src/main/java/org/bspeice/minimalbible/service/book/VerseLookupService.java b/app/src/main/java/org/bspeice/minimalbible/service/book/VerseLookupService.java index 30e7b51..3e03a29 100644 --- a/app/src/main/java/org/bspeice/minimalbible/service/book/VerseLookupService.java +++ b/app/src/main/java/org/bspeice/minimalbible/service/book/VerseLookupService.java @@ -3,18 +3,8 @@ package org.bspeice.minimalbible.service.book; import android.content.Context; import android.support.v4.util.LruCache; -import org.crosswire.common.xml.Converter; -import org.crosswire.common.xml.TransformingSAXEventProvider; -import org.crosswire.common.xml.XMLUtil; import org.crosswire.jsword.book.Book; -import org.crosswire.jsword.book.BookData; -import org.crosswire.jsword.book.BookException; -import org.crosswire.jsword.book.BookMetaData; import org.crosswire.jsword.passage.Verse; -import org.crosswire.jsword.util.ConverterFactory; -import org.xml.sax.SAXException; - -import javax.xml.transform.TransformerException; import rx.functions.Action1; import rx.schedulers.Schedulers; @@ -72,30 +62,13 @@ public class VerseLookupService implements Action1 { /** * Perform the ugly work of getting the actual data for a verse + * @param v + * @return */ public String doVerseLookup(Verse v) { - BookData bookData = new BookData(book, v); + //BookData bookData = new BookData(book, v); - String verseHTML = null; - - try { - Converter styler = ConverterFactory.getConverter(); - TransformingSAXEventProvider htmlsep = (TransformingSAXEventProvider) - styler.convert(bookData.getSAXEventProvider()); - BookMetaData bmd = book.getBookMetaData(); - boolean direction = bmd.isLeftToRight(); - htmlsep.setParameter("direction", direction ? "ltr" : "rtl"); - - verseHTML = XMLUtil.writeToString(htmlsep); - } catch (TransformerException e) { - e.printStackTrace(); - } catch (BookException e) { - e.printStackTrace(); - } catch (SAXException e) { - e.printStackTrace(); - } - - return verseHTML; + return "Not yet implemented!"; } /**