<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">&lt;<a href="mailto:greg.hellings@gmail.com" target="_blank">greg.hellings@gmail.com</a>&gt;</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&#39;s this presentation that is tripping me up. To continue using Pilgrim&#39;s Progress as an example, the following call works:<br></div><div><br>
</div><div>Book book = Books.installed().getBook(&quot;Pilgrim&quot;);</div>
<div>Key baseKey = book.getKey(&quot;SOURCE&quot;);</div><div><br></div><div>This call, prints out the exception message, &quot;org.crosswire.jsword.passage.NoSuchKeyException: No entry for &#39;PART_I&#39; in Pilgrim.&quot;:</div>

<div><br></div><div>Book book = Books.installed().getBook(&quot;Pilgrim&quot;);</div><div>Key baseKey = book.getKey(&quot;PART_I&quot;);</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&#39;m guessing that in BibleDesktop you&#39;re expanding a tree in the UI whose nodes already have a reference to the Key itself, so you don&#39;t need to retrieve an arbitrary key out of a GenBook? I&#39;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&#39;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&#39;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&#39;s worth of data in JSON. It&#39;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&#39;ve included a rudimentary amount of app-side caching to improve performance of some of the longer-running requests (e.g. &quot;Please feed me /KJV/Gen-Rev&quot;). I&#39;m looking for any set of ways to improve its quality so it&#39;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>