[jsword-devel] [JIRA] Commented: (JS-213) Missing code in thml.ATag causes missing osisRef attribute in reference

DM Smith (JIRA) jira at crosswire.org
Sat Mar 17 18:30:04 MST 2012


    [ http://www.crosswire.org/bugs/browse/JS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=24572#comment-24572 ] 

DM Smith commented on JS-213:
-----------------------------

Sorry for the confusion.

I think that was the last time it was discussed (I reviewed the thread), but I don't think anything came of it. At the time of the discussion, no module had links to itself or any other module. In the SWORD beta repository there are StrongsGreek, StrongsHebrew and Strongs. I was trying to see how the self references are encoded, but I'm pretty sure that they are not as in the Xiphos module.

But that's not the point. We should support what does exist.

What I was suggesting is that the URI be parsed by the JSword library. Right now, BibleDesktop does that in Desktop.java. The parts of the URI are protocol, module and key. Today, the URI that BD parses has a protocol for the type of module (e.g. bible://, dict://, greek://, comm://) which maps to the user selected default book/module for that type.

The other part of the BD parsed URI is the key.

Once the two parts are recognized, the book is gotten and the key is gotten from the book. From there the application can do something with it. I've wanted to put the parsing into Book and Key into JSword so that all front ends can use it.

The actual ProtocolHandler (or whatever it is called) that is registered with the HTML viewer is the responsibility of the front end. What it does with the URI can be pushed into JSword. At least in part.

Some things to consider: the specified Book might not be installed. It might not be in any of the repositories. If it is known but not installed, there are some things that can be done. Perhaps offer it to be installed. Maybe see if there is an installed module that might satisfy the end user. For example, if the URI is to a Strongs Greek module and the user has installed a different one that can satisfy, maybe that one could be used. If there are many possibilities, may be a list can be offered. So, in addition to locating the Book and determining whether it is or is not installed. There could be a method to find similar Books that are installed. Perhaps, the list could be pruned to those that actually have the key.

> Missing code in thml.ATag causes missing osisRef attribute in reference
> -----------------------------------------------------------------------
>
>                 Key: JS-213
>                 URL: http://www.crosswire.org/bugs/browse/JS-213
>             Project: JSword
>          Issue Type: Bug
>          Components: o.c.jsword.book.filter.thml
>            Reporter: Martin Denham
>            Assignee: DM Smith
>            Priority: Minor
>         Attachments: ATag.java, ATagTest.java
>
>
> I believe there is some missing code in thml.ATag.  In StrongsRealGreek there are references like:
>    <a href="sword://StrongsRealGreek/01909">1909</a>
> and the above is currently converted to OSIS as:
>    <reference>1909</reference>
> However I think it should be:
>    <reference osisRef="sword://StrongsRealGreek/01909">1909</reference>
> Joe has left the following comment in ATag which seems to confirm that some code is missing:
>    // LATER(joe): put the correct reference here
> I added the following just before Joe's comment which seems to fix the problem:
>         String href = attrs.getValue("href");
>         if (href!=null && !href.isEmpty()) {
>             reference.setAttribute(OSISUtil.OSIS_ATTR_REF, href);
>         }
> I will attach the amended ATag.java and also a junit test.  If nobody comments adversely before next week then I can check in the junit and fixed code next week.
> There is probably also an issue with xml like "<a name="01993">1993</a>" which is not addressed by the attached fix.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jsword-devel mailing list