<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jan 11, 2014 at 11:30 PM, Greg Hellings <span dir="ltr"><<a href="mailto:greg.hellings@gmail.com" target="_blank">greg.hellings@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>It's this presentation that is tripping me up. To continue using Pilgrim's Progress as an example, the following call works:<br></div><div><br>
</div><div>Book book = Books.installed().getBook("Pilgrim");</div>
<div>Key baseKey = book.getKey("SOURCE");</div><div><br></div><div>This call, prints out the exception message, "org.crosswire.jsword.passage.NoSuchKeyException: No entry for 'PART_I' in Pilgrim.":</div>
<div><br></div><div>Book book = Books.installed().getBook("Pilgrim");</div><div>Key baseKey = book.getKey("PART_I");</div><div><br></div><div>However, when I iterate the results of getGlobalKeyList I see PART_I listed as a sub-key of the module. I'm guessing that in BibleDesktop you're expanding a tree in the UI whose nodes already have a reference to the Key itself, so you don't need to retrieve an arbitrary key out of a GenBook? I'm looking at this from the context of a web service where a request could come in with any arbitrary key depth.</div>
<span class=""><font color="#888888">
<div><br></div><div><br></div></font></span></div></div></div></blockquote><div><br></div><div>Here's the full context: <a href="https://github.com/greg-hellings/jsword-json">https://github.com/greg-hellings/jsword-json</a></div>
<div><br></div><div>It's a simple read-only REST resource/WebSocket server that fetches back a list of installed modules, a list of the top-level keys in that module, and any parse-able key's worth of data in JSON. It's super simple and is only intended to be a proof of concept that hitting a Sword module to fetch out JSON is not very difficult. You can sample it running at <a href="http://thehellings.com:10001/">http://thehellings.com:10001/</a> or over WebSockets at ws://<a href="http://thehellings.com:10002/">thehellings.com:10002/</a>, though please be gentle. I've included a rudimentary amount of app-side caching to improve performance of some of the longer-running requests (e.g. "Please feed me /KJV/Gen-Rev"). I'm looking for any set of ways to improve its quality so it's a less bad demo of how simply modules can be generically accessed.</div>
<div><br></div><div>Every time I hear people talking about wanting access to Sword materials in JavaScript it keeps reminding me of how simple it is to build a web service in Java to allow people to access that data in a web-happier way rather than trying to read and parse modules in JavaScript.</div>
<div><br></div><div>--Greg</div></div></div></div>