<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
On 06/07/2011 04:37 PM, Martin Denham wrote:
<blockquote
cite="mid:BANLkTik50a+YMRQ+wrD8sVA8099khONW0g@mail.gmail.com"
type="cite">Books containing Strong's Numbers don't always have:<br>
Feature=StrongsNumbers
<div>in their .conf file</div>
<div><br>
</div>
<div>But they do always have:</div>
<div><span class="Apple-style-span" style="border-collapse:
collapse; color: rgb(80, 0, 80); font-family:
arial,sans-serif; font-size: 13px;"> </span>GlobalOptionFilter=OSISStrongs</div>
<div><br>
</div>
<div>Checking for 'Feature=StrongsNumbers' is easy:</div>
<div> book.hasFeature(FeatureType.STRONGS_NUMBERS)</div>
<div><br>
</div>
<div>But I don't know how to check for
'GlobalOptionFilter=OSISStrongs'.</div>
<div><br>
</div>
<div>Can anybody give me some advice or sample code?</div>
</blockquote>
There's a bug in the assumption in
o.c.j.book.sword.SwordBookMetaData.hasFeature(FeatureType feature)<br>
It looks first at Feature and then at GlobalOptionFilters. It
assumes that the filter is named the same as the Feature but has the
SourceType appended to it.<br>
<br>
The basic difference between SWORD API and JSword regarding
GlobalOptionFilters is that for SWORD, they are the name of a class
that does filtering and the order of the filters in the conf can
make a difference. For JSword, all filtering takes place in the
XSLT. I had thought that (prior to Peter's input) in a SWORD app the
presence of a Feature is meant to indicate whether the toggle should
be made available and the presence of the GlobalOptionFilter is what
actually does the work.<br>
<br>
I think the easiest fix is to change:<br>
o.c.j.book.FeatureType.STRONGS_NUMBER("StrongsNumber");<br>
to<br>
o.c.j.book.FeatureType.STRONGS_NUMBER("Strongs");<br>
<br>
This change should work correctly for all JSword apps.<br>
<br>
Hope that helps for now....<br>
<br>
In Him,<br>
DM<br>
<br>
<blockquote
cite="mid:BANLkTik50a+YMRQ+wrD8sVA8099khONW0g@mail.gmail.com"
type="cite">
<div><br>
</div>
<div>Thanks</div>
<div>Martin</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>