Catching new XREF node in Java code
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 4
- Joined: Tue Nov 15, 2016 9:32 pm
Catching new XREF node in Java code
I'm working in a DITA customized framework, we are creating our own Image Map Editor. We want to reuse Oxygen's Insert Crossreference dialogue (DITAAccess.insertHref), but this function is inserting the new xref node directly into the AuthorDocument.
I need an option that returns a new ElementNode that I can manipulate and insert in a DOM tree, before saving the whole Image Map into the AuthorDocument.
What's the best approach to catch the new xref ElementNode created by DITAAccess.insertHref, or any other function?
Thanks for your assistance.
I need an option that returns a new ElementNode that I can manipulate and insert in a DOM tree, before saving the whole Image Map into the AuthorDocument.
What's the best approach to catch the new xref ElementNode created by DITAAccess.insertHref, or any other function?
Thanks for your assistance.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Catching new XREF node in Java code
Hi,
I'm afraid that's the API we have right now.
I see two possible solutions:
1) Implement a reference insertion dialog yourself. You can use the API "ro.sync.exml.workspace.api.standalone.StandalonePluginWorkspace.createEditorComponentProvider(String[], String)" to create the preview area where you would show a preview for each element.
2) (More of a hack) Before calling DITAAccess.insertHref create your own class which implements the "AuthorAccess" interface and delegates to our AuthorAccess, so create some kind of wrapper class over our AuthorAccess.
On the callback "ro.sync.ecss.extensions.api.AuthorAccess.getDocumentController()" return your own wrapper class over the AuthorDocumentController API which delegates to ours.
Oxygen's code will probably call the method "ro.sync.ecss.ue.AuthorDocumentController.insertXMLFragmentSchemaAware(String, int)" to insert the composed XML fragment in the editor and you could bypass and intercept it in your wrapper class.
REgards,
Radu
I'm afraid that's the API we have right now.
I see two possible solutions:
1) Implement a reference insertion dialog yourself. You can use the API "ro.sync.exml.workspace.api.standalone.StandalonePluginWorkspace.createEditorComponentProvider(String[], String)" to create the preview area where you would show a preview for each element.
2) (More of a hack) Before calling DITAAccess.insertHref create your own class which implements the "AuthorAccess" interface and delegates to our AuthorAccess, so create some kind of wrapper class over our AuthorAccess.
On the callback "ro.sync.ecss.extensions.api.AuthorAccess.getDocumentController()" return your own wrapper class over the AuthorDocumentController API which delegates to ours.
Oxygen's code will probably call the method "ro.sync.ecss.ue.AuthorDocumentController.insertXMLFragmentSchemaAware(String, int)" to insert the composed XML fragment in the editor and you could bypass and intercept it in your wrapper class.
REgards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 4
- Joined: Tue Nov 15, 2016 9:32 pm
Re: Catching new XREF node in Java code
Hola Radu:
I'm trying your option 2, using a custom DocumentController, but I'm getting a ClassCastException: CustomDocumentController cannot be cast to ro.sync.ecss.extensions.o.
Any idea for a work around?
Thanks for your help.
— Efrén
I'm trying your option 2, using a custom DocumentController, but I'm getting a ClassCastException: CustomDocumentController cannot be cast to ro.sync.ecss.extensions.o.
Any idea for a work around?
Thanks for your help.
— Efrén
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Catching new XREF node in Java code
Hi Efrén,
I'm afraid I did not test the second solution I proposed to you, somewhere in our code Oxygen probably casts the AuthorDocumentController interface to its implementation and of course the implementation is not what it expects anymore. So you will probably need to re-implement the dialog.
Other than that let the dialog insert the content in the document and then copy what was inserted in the document, post process it, delete the original insertion from the document and then insert the post processed version.
Regards,
Radu
I'm afraid I did not test the second solution I proposed to you, somewhere in our code Oxygen probably casts the AuthorDocumentController interface to its implementation and of course the implementation is not what it expects anymore. So you will probably need to re-implement the dialog.
Other than that let the dialog insert the content in the document and then copy what was inserted in the document, post process it, delete the original insertion from the document and then insert the post processed version.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service