ExternalObjectInsertionHandler Not Firing for Dragged XML Files
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 37
- Joined: Tue Nov 30, 2010 7:34 pm
ExternalObjectInsertionHandler Not Firing for Dragged XML Files
I've written a custom ExternalObjectInsertionHandler to add references from one XML to another (both files have .xml extensions). This extension is working fine when dragging files from the project window, but when I drag an XML file from the Windows File Explorer (more typical use case), the XML file opens in Oxygen and does not fire the extension. Oddly enough, dragging an image from Windows to the same file does trigger the extension as expected.
How do I control which file types are handled by the extension? Thanks for any tips.
Brian
How do I control which file types are handled by the extension? Thanks for any tips.
Brian
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: ExternalObjectInsertionHandler Not Firing for Dragged XML Files
Hi Brian,
This is an expected behavior.
Whenever an XML document is dropped in Oxygen we somehow need to know if the end user wants to open that file in Oxygen or if they want to insert a reference to it. We considered that when dropping files from the Project the highest likelihood is for people to want to insert references to them (as they can always double click the files in the Project view to open them in Oxygen).
But for drops coming from outside of Oxygen, if they are images we consider that probably people want references to them (and call the API) but for XML file types we consider that probably people want to open them in Oxygen.
Unfortunately this cannot be controlled on your side but if you want we can consider adding some API or setting to control this behavior.
By the way, also Copying files from Windows Explorer (any type of files) and then pasting them in Oxygen should also call your API extension.
Regards,
Radu
This is an expected behavior.
Whenever an XML document is dropped in Oxygen we somehow need to know if the end user wants to open that file in Oxygen or if they want to insert a reference to it. We considered that when dropping files from the Project the highest likelihood is for people to want to insert references to them (as they can always double click the files in the Project view to open them in Oxygen).
But for drops coming from outside of Oxygen, if they are images we consider that probably people want references to them (and call the API) but for XML file types we consider that probably people want to open them in Oxygen.
Unfortunately this cannot be controlled on your side but if you want we can consider adding some API or setting to control this behavior.
By the way, also Copying files from Windows Explorer (any type of files) and then pasting them in Oxygen should also call your API extension.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 37
- Joined: Tue Nov 30, 2010 7:34 pm
Re: ExternalObjectInsertionHandler Not Firing for Dragged XML Files
Thanks Radu. Obviously I'm bias, but I think it would be very useful for all drags to go through the extension, and then allow the use of a return code or overridden function to determine whether the extension should or has dealt with the event. For my particular use case, my "project" file is a proprietary XML file (similar to a DITA map) and I am trying to provide users with an interface to be able to quickly add references to other XML files.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: ExternalObjectInsertionHandler Not Firing for Dragged XML Files
Hi Brian,
As I was looking into how we can add new API to allow you to control this, I found out that we do have that possibility.
Basically in your AuthorExternalObjectInsertionHandler implementation you should override this acceptSource base method:
Regards,
Radu
As I was looking into how we can add new API to allow you to control this, I found out that we do have that possibility.
Basically in your AuthorExternalObjectInsertionHandler implementation you should override this acceptSource base method:
Code: Select all
/**
* @see ro.sync.ecss.extensions.api.AuthorExternalObjectInsertionHandler#acceptSource(ro.sync.ecss.extensions.api.AuthorAccess, int)
*/
@Override
public boolean acceptSource(AuthorAccess authorAccess, int source) {
return source == DND_EXTERNAL || super.acceptSource(authorAccess, source);
}
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