<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
You are very close, though I don't know why you are having a timeout
issue.<br>
<br>
It looks like there are a couple of things going on. I suggest
trying to separate them.<br>
What platform are you developing for? Unix/Linux, Windows, Mac or
something else? If something else, that might be a problem to solve.
This helps find the default location for mods.d and modules folder.
(The example code does not allow for anything but default
preferences.)<br>
<br>
It should be located at:<br>
OSType.getOSType().getUserAreaFolder(".sword", "Sword").<br>
Make sure that directory exists and that the conf and the module's
files are appropriately under there in mods.d and modules
respectively.<br>
<br>
<br>
Try to separate the installer from doing a lookup. That way you
isolate whether the problem is installing or if it is in doing a
lookup.<br>
<br>
Without the installer you can do the following to find a book:<br>
Book book = Books.installed().getBook("KJV"); // or what ever
"initials" you want to use.<br>
<br>
To do a lookup in that book (just as you have done):<br>
Key key = book.getKey("Gen 1:1");<br>
BookData data = new BookData(book, key);<br>
String text =
OSISUtil.getCanonicalText(data.getOsisFragment());<br>
<br>
Regarding deleting:<br>
The call to Books.installed().remove(book); is unnecessary. The
comment is correct: doing that will make the book not be visible
during the current process. Run it again and it will be visible.<br>
<br>
The second call, book.getDriver().delete(book), should delete the
conf and all the files in the module. It won't delete the index.<br>
<br>
To delete the index, if present, you'll need to do:<br>
IndexManager imanager = IndexManagerFactory.getIndexManager();<br>
if (imanager.isIndexed(book)) {<br>
imanager.deleteIndex(book);<br>
}<br>
<br>
Let me know if this works.<br>
<br>
In Him, <br>
DM<br>
<br>
On 09/10/2010 01:49 PM, Matthias Wegner wrote:
<blockquote
cite="mid:008901cb5110$7cf86010$76e92030$@mat.wegner@web.de"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered
medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
-->
</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Hi All,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">my Name is Matthias
Wegner from Germany,
Freiburg. I develop since 13 years java and want to use the
jsword api for an
own application. For that I need some bibles and a search
for the bible text in
dependency of the “key”. I try since three days to get the
given API
Example working. I think I understood in a raw concept what
the different Installer-Classes
and the WebRessource-Class are doing, but I don’t get it
what is going
wrong.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">i tried to get a working
APIExample. I use the
newest Eclipse, load all Librarys from Maven and have a
working set. My problem
is, that I always get a timeout (I moved, so I only have
UMTS at the moment).
When I put the timeout in WebResource-Class to 5000ms the
Application below
starts, but I always get in the Console<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style=""><b><span style="font-size: 10pt;
font-family: "Courier New"; color: black;">ESV</span></b><b><span
style="font-size: 10pt; font-family: "Courier
New";"><o:p></o:p></span></b></p>
<p class="MsoNormal" style=""><b><span style="font-size: 10pt;
font-family: "Courier New"; color: black;">Book
contains key: false</span></b><b><span style="font-size:
10pt; font-family: "Courier New";"><o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-size: 10pt;
font-family: "Courier New"; color: black;">Text
is ''<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family:
"Arial","sans-serif"; color: black;"
lang="EN-US">I don‘t get what i am doing wrong. Is the
problem a
connection problem? When I put manually the esv.conf in the
mods.d-directory,
then the book is removed and deleted (that means only the
config-file). Is that
the way it goes? I downloaded the esv and put it relative to
mods.d to “../modules”.
In the full desktop application this works fine, so I don’t
understood
whats wrong.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family:
"Arial","sans-serif"; color: black;"
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family:
"Arial","sans-serif"; color: black;"
lang="EN-US">I really appreciate some help or hints. Can you
give me some
tryouts, so I can find the “real” problem?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family:
"Arial","sans-serif"; color: black;"
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family:
"Arial","sans-serif"; color: black;"
lang="EN-US">Warm Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family:
"Arial","sans-serif"; color: black;"
lang="EN-US">Matthias<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family:
"Arial","sans-serif"; color: black;"
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family:
"Arial","sans-serif"; color: black;">Example
Code:</span><span style="font-family:
"Arial","sans-serif";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style=""><b><span style="font-size: 10pt;
font-family: "Courier New"; color: rgb(127, 0,
85);" lang="EN-US">
public</span></b><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> </span><b><span style="font-size: 10pt;
font-family: "Courier New"; color: rgb(127, 0,
85);" lang="EN-US">static</span></b><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US"> </span><b><span
style="font-size: 10pt; font-family: "Courier
New"; color: rgb(127, 0, 85);" lang="EN-US">void</span></b><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US">
main(String[] args) {</span><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
InstallManager imanager = </span><b><span style="font-size:
10pt; font-family: "Courier New"; color:
rgb(127, 0, 85);" lang="EN-US">new</span></b><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US">
InstallManager(); </span><span style="font-size:
10pt; font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
Installer installer = imanager.getInstaller(</span><span
style="font-size: 10pt; font-family: "Courier
New"; color: rgb(42, 0, 255);" lang="EN-US">"CrossWire"</span><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US">);</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><b><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(127, 0, 85);"
lang="EN-US">try</span></b><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> {</span><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
installer.reloadBookList();</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
}</span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><b><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(127, 0, 85);"
lang="EN-US">catch</span></b><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> (InstallException e) {</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
e.printStackTrace();</span><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
}</span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
<u>List</u> availableBooks = installer.getBooks(</span><b><span
style="font-size: 10pt; font-family: "Courier
New"; color: rgb(127, 0, 85);" lang="EN-US">new</span></b><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US">
MyBookFilter(</span><span style="font-size: 10pt;
font-family: "Courier New"; color: rgb(42, 0,
255);" lang="EN-US">"ESV"</span><span style="font-size:
10pt; font-family: "Courier New"; color: black;"
lang="EN-US">)); </span><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
Book book = (Book) availableBooks.get(0);</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> </span><span style="font-size:
10pt; font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><b><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(127, 0, 85);"
lang="EN-US">if</span></b><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> (book != </span><b><span style="font-size:
10pt; font-family: "Courier New"; color:
rgb(127, 0, 85);" lang="EN-US">null</span></b><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US">) {</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><b><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(127, 0, 85);"
lang="EN-US">try</span></b><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> {</span><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><b><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(127, 0, 85);"
lang="EN-US">if</span></b><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> (Books.<i>installed</i>().getBook(</span><span
style="font-size: 10pt; font-family: "Courier
New"; color: rgb(42, 0, 255);" lang="EN-US">"ESV"</span><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US">) != </span><b><span
style="font-size: 10pt; font-family: "Courier
New"; color: rgb(127, 0, 85);" lang="EN-US">null</span></b><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US">) {</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
System.</span><i><span style="font-size: 10pt;
font-family: "Courier New"; color: rgb(0, 0,
192);" lang="EN-US">out</span></i><span style="font-size:
10pt; font-family: "Courier New"; color: black;"
lang="EN-US">.println(</span><span style="font-size: 10pt;
font-family: "Courier New"; color: rgb(42, 0,
255);" lang="EN-US">"Book
"</span><span style="font-size: 10pt; font-family:
"Courier New"; color: black;" lang="EN-US"> +
book.getInitials() + </span><span style="font-size: 10pt;
font-family: "Courier New"; color: rgb(42, 0,
255);" lang="EN-US">" is removed"</span><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US">);</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
Books.<i>installed</i>().removeBook(book);</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
System.</span><i><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(0, 0, 192);"
lang="EN-US">out</span></i><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">.println(</span><span style="font-size: 10pt;
font-family: "Courier New"; color: rgb(42, 0,
255);" lang="EN-US">"Book
"</span><span style="font-size: 10pt; font-family:
"Courier New"; color: black;" lang="EN-US"> +
book.getInitials() + </span><span style="font-size: 10pt;
font-family: "Courier New"; color: rgb(42, 0,
255);" lang="EN-US">" is deleted"</span><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US">);</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
book.getDriver().delete(book);</span><span style="font-size:
10pt; font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
}</span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
}</span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><b><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(127, 0, 85);"
lang="EN-US">catch</span></b><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> (BookException e1)</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
{</span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
e1.printStackTrace();</span><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
}</span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
}</span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
System.</span><i><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(0, 0, 192);"
lang="EN-US">out</span></i><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">.println(book.getInitials());</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><b><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(127, 0, 85);"
lang="EN-US">try</span></b><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> {</span><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
installer.install(book);</span><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><b><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(127, 0, 85);"
lang="EN-US">if</span></b><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> (Books.<i>installed</i>().getBook(</span><span
style="font-size: 10pt; font-family: "Courier
New"; color: rgb(42, 0, 255);" lang="EN-US">"ESV"</span><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US">) != </span><b><span
style="font-size: 10pt; font-family: "Courier
New"; color: rgb(127, 0, 85);" lang="EN-US">null</span></b><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US">) {</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
System.</span><i><span style="font-size: 10pt;
font-family: "Courier New"; color: rgb(0, 0,
192);" lang="EN-US">out</span></i><span style="font-size:
10pt; font-family: "Courier New"; color: black;"
lang="EN-US">.println(</span><span style="font-size: 10pt;
font-family: "Courier New"; color: rgb(42, 0,
255);" lang="EN-US">"Book
is NOT empty"</span><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">);</span><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
} </span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
}</span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><b><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(127, 0, 85);"
lang="EN-US">catch</span></b><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> (InstallException e) {</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
e.printStackTrace();</span><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
}</span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> </span><b><span style="font-size:
10pt; font-family: "Courier New"; color:
rgb(127, 0, 85);" lang="EN-US">try</span></b><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US"> {</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> Key
key = book.getKey(</span><span style="font-size: 10pt;
font-family: "Courier New"; color: rgb(42, 0,
255);" lang="EN-US">"Gen 1:1"</span><span style="font-size:
10pt; font-family: "Courier New"; color: black;"
lang="EN-US">);</span><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> System.</span><i><span
style="font-size: 10pt; font-family: "Courier
New"; color: rgb(0, 0, 192);" lang="EN-US">out</span></i><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US">.println(</span><span
style="font-size: 10pt; font-family: "Courier
New"; color: rgb(42, 0, 255);" lang="EN-US">"Book
contains key: "</span><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">+ book.contains(key));</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> BookData
data = </span><b><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(127, 0, 85);"
lang="EN-US">new</span></b><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> BookData(book, key);</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
String text = OSISUtil.<i>getCanonicalText</i>(data.getOsisFragment());</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
System.</span><i><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(0, 0, 192);"
lang="EN-US">out</span></i><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">.println(</span><span style="font-size: 10pt;
font-family: "Courier New"; color: rgb(42, 0,
255);" lang="EN-US">"Text is
'"</span><span style="font-size: 10pt; font-family:
"Courier New"; color: black;" lang="EN-US"> +
text+</span><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(42, 0, 255);"
lang="EN-US">"'"</span><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">);</span><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> }
</span><b><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(127, 0, 85);"
lang="EN-US">catch</span></b><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> (NoSuchKeyException e) {</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> e.printStackTrace();</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> }
</span><b><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(127, 0, 85);"
lang="EN-US">catch</span></b><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> (BookException e) {</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> e.printStackTrace();</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> }</span><span style="font-size:
10pt; font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
System.<i>exit</i>(1);</span><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> }</span><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> </span><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> </span><b><span style="font-size: 10pt;
font-family: "Courier New"; color: rgb(127, 0,
85);" lang="EN-US">static</span></b><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US"> </span><b><span
style="font-size: 10pt; font-family: "Courier
New"; color: rgb(127, 0, 85);" lang="EN-US">class</span></b><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US">
MyBookFilter </span><b><span style="font-size: 10pt;
font-family: "Courier New"; color: rgb(127, 0,
85);" lang="EN-US">implements</span></b><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US"> BookFilter</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
{</span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><b><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(127, 0, 85);"
lang="EN-US">public</span></b><span style="font-size:
10pt; font-family: "Courier New"; color: black;"
lang="EN-US"> MyBookFilter(String bookName)</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
{</span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(0, 0, 192);"
lang="EN-US">name</span><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US"> = bookName;</span><span style="font-size:
10pt; font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
}</span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><b><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(127, 0, 85);"
lang="EN-US">public</span></b><span style="font-size:
10pt; font-family: "Courier New"; color: black;"
lang="EN-US"> </span><b><span style="font-size: 10pt;
font-family: "Courier New"; color: rgb(127, 0,
85);" lang="EN-US">boolean</span></b><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US">
test(Book bk)</span><span style="font-size: 10pt;
font-family: "Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
{</span><span style="font-size: 10pt; font-family:
"Courier New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><b><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(127, 0, 85);"
lang="EN-US">return</span></b><span style="font-size:
10pt; font-family: "Courier New"; color: black;"
lang="EN-US"> bk.getInitials().equals(</span><span
style="font-size: 10pt; font-family: "Courier
New"; color: rgb(0, 0, 192);" lang="EN-US">name</span><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US">);</span><span
style="font-size: 10pt; font-family: "Courier
New";" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;"
lang="EN-US">
</span><span style="font-size: 10pt; font-family:
"Courier New"; color: black;">}</span><span
style="font-size: 10pt; font-family: "Courier
New";"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New";"><o:p> </o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: "Courier New"; color: black;">
</span><b><span style="font-size: 10pt; font-family:
"Courier New"; color: rgb(127, 0, 85);">private</span></b><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;"> String </span><span
style="font-size: 10pt; font-family: "Courier
New"; color: rgb(0, 0, 192);">name</span><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;">;</span><span style="font-size:
10pt; font-family: "Courier New";"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family:
"Courier New"; color: black;"> }</span><span
lang="EN-US"><o:p></o:p></span></p>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
jsword-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:jsword-devel@crosswire.org">jsword-devel@crosswire.org</a>
<a class="moz-txt-link-freetext" href="http://www.crosswire.org/mailman/listinfo/jsword-devel">http://www.crosswire.org/mailman/listinfo/jsword-devel</a>
</pre>
</blockquote>
<br>
</body>
</html>