Extension class not detected

Post here questions and problems related to oXygen frameworks/document types.
benw
Posts: 2
Joined: Wed Dec 20, 2023 2:24 pm

Extension class not detected

Post by benw »

I am trying to add a custom references resolver to a custom framework, but my class doesn't get detected. Could you help me figure out what I'm missing?

I have made an Extensions bundle as per: https://www.oxygenxml.com/doc/versions/ ... undle.html
It contains a class which implements `AuthorReferenceResolver`, and which is instantiated by the bundle's `createAuthorReferenceResolver` function, as per https://www.oxygenxml.com/doc/versions/ ... olver.html

I am running Oxygen Editor v24, so built against the SDK version 24.1.0.0.

With the JAR is added to the framework class path, the bundle is properly detected by the "Extensions Bundle" 'choose' button. However, even with that bundle selected, when I attempt to 'choose' a References resolver, my class is not found.

Is there something specific in the implementation that need to be satisfied for detection to work?
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Extension class not detected

Post by Radu »

Hi,
So you extended the "ro.sync.ecss.extensions.api.ExtensionsBundle" base class and in it you overwrote the method "ro.sync.ecss.extensions.api.ExtensionsBundle.createAuthorReferenceResolver()" correct? This should be enough, once you choose to use your extensions bundle implementation, Oxygen should start calling the "ExtensionsBundle.createAuthorReferenceResolver()" method.
The separate "AuthorReferenceResolver" implementation can be set by someone who does not want to extend an entire ExtensionsBundle.
Do you want to create such an extension for your custom XML vocabulary or do you want to do that for a vocabulary for which Oxygen already has editing frameworks like DITA, DocBook?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
benw
Posts: 2
Joined: Wed Dec 20, 2023 2:24 pm

Re: Extension class not detected

Post by benw »

Hi Radu,

Yes, I extended the ExtensionsBundle class and overwrote the createAuthorReferenceResolver. I see, indeed it does work automatically if I use the entire bundle.

The framework we are using is an extension of the built-in Docbook framework, and it uses Oxygen's built-in Docbook5 extensions bundle. I was therefore planning to use the ReferenceResolver as a standalone addition. Would it be better to extend the Docbook bundle with the new ReferenceResolver? Would I simply extend "ro.sync.ecss.extensions.docbook.DocBook5ExtensionsBundle" instead of "ro.sync.ecss.extensions.api.ExtensionsBundle" ?
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Extension class not detected

Post by Radu »

Hi,
Yes, please extend the DocBook5ExtensionsBundle and override its createAuthorReferenceResolver, delegate to the super implementation and then wrap it in your own implementation. This would help you avoid losing the large amounts of functionality we have in the base DocBook5ExtensionsBundle.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply