[jsword-devel] Help with APIExamples

Tim Hawes trhawes at althusius.net
Wed Dec 27 19:50:39 MST 2017



There appears to be no references to rawcom in the junit tests at all. Only an enum reference in the code. If you can send an example next time you have time at your computer, it would be greatly appreciated.



---- On Wed, 27 Dec 2017 21:25:51 -0500 DM Smith <dmsmith at crosswire.org> wrote ----




Yes. In JSword. BibleDesktop doesn’t yet. Look in junit tests for rawcom. I’m away from my computer at the moment and can’t look. 



— DM Smith

>From my phone. Brief. Weird autocorrections. 




On Dec 27, 2017, at 9:15 PM, Tim Hawes <trhawes at althusius.net> wrote:




_______________________________________________

jsword-devel mailing list

jsword-devel at crosswire.org

http://www.crosswire.org/mailman/listinfo/jsword-devel


_______________________________________________ 

jsword-devel mailing list 

jsword-devel at crosswire.org 

http://www.crosswire.org/mailman/listinfo/jsword-devel 


Does JSword have the ability to write to the Personal Commentary? I seem to remember reading something a while back that it did. However, I can't seem to find any references.





---- On Tue, 26 Dec 2017 12:46:51 -0500 Tim Hawes <trhawes at althusius.net> wrote ----




Thank you! That did it.





---- On Tue, 26 Dec 2017 10:51:55 -0500 DM Smith <dmsmith at crosswire.org> wrote ----










_______________________________________________ 

jsword-devel mailing list 

jsword-devel at crosswire.org 

http://www.crosswire.org/mailman/listinfo/jsword-devel 


Just migrated the xslt from BibleDesktop into JSword.



The converter that the ConverterFactory uses is now org.crosswire.jsword.xml.ConfigurableConverter.java



The xslt is a resource of the same path.



I’m in the process of updating the xslt to HTML5. If you don’t like it or it doesn’t work for you you can revert to simple.xsl. Or continue whatever you are using.



In Him,

DM



On Dec 23, 2017, at 9:46 AM, DM Smith <dmsmith at crosswire.org> wrote:



Configuration is done via reflection using config.xml. Config.xml brings in a couple of classes in BibleDesktop for converting via xslt. I’ve begun to look into migrating it to JSword. Problem is that I have to break the dependency on Font which is in AWT.



The converter reflects to a class in BibleDesktop which looks for xsl/cswing/simple.xsl as a resource. If that resource is not found via classpath it fails.



The resources are in the BibleDesktop project. Just copy xsl/cswing/simple.xsl to the resource folder of JSword. Or add the BibleDesktop resource folder to the APIExamples classpath.



The only execution problem I found is that ESV has been renamed. So I’ll change the example to KLV (the Klingon Bible) as that won’t change.



DM



On Dec 21, 2017, at 7:22 AM, Tim Hawes <trhawes at althusius.net> wrote:



Thank you so much for looking into this! But, no, I don't think that's it. If I comment out the call to readStyledText(), I get this exception instead:



Exception in thread "main" java.util.MissingResourceException: Cannot find resource: xsl/cswing/simple.xsl

        at org.crosswire.common.util.ResourceUtil.getResource(ResourceUtil.java:75)

        at org.crosswire.common.util.ResourceUtil.getResource(ResourceUtil.java:57)

        at com.selfdidactic.APIExamples.searchAndShow(APIExamples.java:286)

        at com.selfdidactic.APIExamples.main(APIExamples.java:465)



That error does go away when I add that stylesheet from bibledesktop. So that should probably still be moved to jsword. But is seemingly unrelated to the NullPointerException I am getting when I call readStyledText() in the APIExamples.java



I've searched for other references for ConverterFactory.getConverter() in bibledesktop. I can see where it is being called, but am clueless why it seems to work for bibledesktop and not for the API examples.



---- On Wed, 20 Dec 2017 23:20:54 -0500 DM Smith <dmsmith at crosswire.org> wrote ----




I’ll check it out. I think that JSword’s example uses the xslt from BibleDesktop. I’ve been working on that. 



I should move it into JSword. 



— DM Smith






On Dec 20, 2017, at 7:54 PM, Tim Hawes <trhawes at althusius.net> wrote:




_______________________________________________

jsword-devel mailing list

jsword-devel at crosswire.org

http://www.crosswire.org/mailman/listinfo/jsword-devel



_______________________________________________ 

jsword-devel mailing list 

jsword-devel at crosswire.org 

http://www.crosswire.org/mailman/listinfo/jsword-devel 


When trying to run the APIExamples.java for JSword, it throws this exception:



Exception in thread "main" java.lang.NullPointerException

at org.crosswire.jsword.util.ConverterFactory.getConverter(ConverterFactory.java:51)

at com.selfdidactic.APIExamples.readStyledText(APIExamples.java:163)

at com.selfdidactic.APIExamples.main(APIExamples.java:461)



It is happening in the readStyledText method where...



Converter styler = ConverterFactory.getConverter();





Has JSword changed without updating the API examples?














_______________________________________________

jsword-devel mailing list

jsword-devel at crosswire.org

http://www.crosswire.org/mailman/listinfo/jsword-devel







_______________________________________________

jsword-devel mailing list

jsword-devel at crosswire.org

http://www.crosswire.org/mailman/listinfo/jsword-devel






_______________________________________________ 

jsword-devel mailing list 

jsword-devel at crosswire.org 

http://www.crosswire.org/mailman/listinfo/jsword-devel 











-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20171227/a18f38a2/attachment.html>


More information about the jsword-devel mailing list