Drag & drop of multiple links from a JavaFX webview to DITA Map Manager

Post here questions and problems related to oXygen frameworks/document types.
fwe4d
Posts: 2
Joined: Wed May 19, 2021 12:01 pm

Drag & drop of multiple links from a JavaFX webview to DITA Map Manager

Post by fwe4d »

Hi,

In the context of a plugin development, we want to support drag & drop of links from a JavaFX webview to DITA Map Manager.

We have so far managed to successfully support drag and drop for a single link and for Oxygen XML 23 only.
  • Could you please provide guidance about drag & drop of multiple links to DITA Map Manager ? We have tried without success to set dataTransfer using "text/uri-list" media type as specified by IETF[1] : DITA Map Manager seems to interpret it as one uri by ignoring CRLF line separators.
  • Do you think that drag & drop from webview to DITA Map Manager could be achievable for previous versions of Oxygen XML, i.e. prior to 23 ?
Thanks,
Fabien

[1] https://datatracker.ietf.org/doc/html/rfc2483#section-5
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: Drag & drop of multiple links from a JavaFX webview to DITA Map Manager

Post by Radu »

Hi Fabien,

We had a client about a year ago who wanted the same thing, to drop from a JavaFX panel URLs to the DITA Maps Manager view.

We discovered that in the case of drag and drops from the JavaFX panel, we received in our code this mimetype:

Code: Select all

mimetype=text/uri-list;representationclass=java.io.InputStream;charset=windows-1252
Before Oxygen 23 we did not treat this mimetime, but based on this client's request we started handling it in Oxygen 23.0.

Then this same client reported the same problem, that he could not send a list of URLs separated by line breaks.
From what I discovered then and looked in our code we split the received content by "\n" and create an URL for each split token.
So the problem is not on our side, we just use whatever is provided by the Java APIs, and it provides us with a single string containing the concatenated URLs.

Maybe as a workaround you can provide a single URL with some parameter containing extra base 64 encoded information and in the API callback:

Code: Select all

ro.sync.exml.workspace.api.editor.page.ditamap.dnd.DITAMapTreeDropHandler.consumeDropURLs(List, AuthorNode, boolean)
consume the list yourselves, get the single URL from the list, create multiple resources from it and then use our APIs:

Code: Select all

ro.sync.exml.workspace.api.editor.page.ditamap.WSDITAMapEditorPage.getDocumentController()
to insert topicrefs in the DITA Maps Manager view.


Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
fwe4d
Posts: 2
Joined: Wed May 19, 2021 12:01 pm

Re: Drag & drop of multiple links from a JavaFX webview to DITA Map Manager

Post by fwe4d »

Thank you very much Radu for your responsiveness and this very useful answer.

Best regards,
Fabien
Post Reply