Dropping ditamap url to DITA Maps Manager

Post here questions and problems related to oXygen frameworks/document types.
abhik
Posts: 17
Joined: Tue Sep 05, 2023 12:14 am

Dropping ditamap url to DITA Maps Manager

Post by abhik »

Hello Team

We want to perform drag n drop operation where we want to drag n drop topic/ditamap url to DITA Maps Manager and add the dropped url as reference.
We have extended DITAMapTreeDropHandler to process dropped urls and we have added extended DITAMapTreeDropHandler to the WSDITAMapEditorPage.
https://www.oxygenxml.com/InstData/Edit ... ndler.html
This is working fine for dita topics and we are able to process dropped urls with DITAMapTreeDropHandler.
But for the case of ditamaps, DITA Maps manager is opening the dropped ditamap url instead of processing it with DITAMapTreeDropHandler.
We are unable to override this default behaviour for ditamap urls with help of DITAMapTreeDropHandler.
How can we customize the processing of dropped ditamap urls for DITA Maps Manager?

Thanks & Regards,
Abhi_K
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Dropping ditamap url to DITA Maps Manager

Post by Radu »

Hi,

So:
How can we customize the processing of dropped ditamap urls for DITA Maps Manager?
When dropping a DITA Map URL in the DITA Maps Manager view Oxygen has two choices: either open the dropped DITA Map in the DITA Maps Manager view or add a reference in the current opened DITA Map to the dropped DITA Map. By default Oxygen chooses the first option, it considers that probably the end user wants to open the DITA map in the DITA Maps manager view so it no longer delegates to your API. Your API cannot control this choice made by Oxygen and Oxygen itself does not know the user's intentions.
On Windows if when dropping the map URL in the DITA maps manager view you press "Ctrl-Shift" the dropped content will be interpreted as a drop to link operation and Oxygen should delegate the insertion of the map reference to your APIs. But if the user does not press "Ctrl-Shift" when drag and dropping Oxygen will continue to open the dropped dita map instead of linking to it.
I will add an internal issue to improve on this behavior so that if the APIs you implemented is interested in the dropped URL Oxygen should delegate the drop to the APis instead of choosing to open the DITA Map. If we manage to implement the issue in a future version we will let you know by updating this forum thread.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
abhik
Posts: 17
Joined: Tue Sep 05, 2023 12:14 am

Re: Dropping ditamap url to DITA Maps Manager

Post by abhik »

Hi Radu,

I understand the user choice to open the DITA map in the DITA Maps manager view.
Yes, please consider adding this customization with future version.

As of now we have implemented some workaround to fix this issue:
For drag operation we have replaced the '.ditamap' extension with some dummyExtension.
For drop operation at DITAMapTreeDropHandler.consumeDropURLs() we have replaced dummyExtension with original extension and then we can process further with the original url.

Looks like Oxygen is checking url extension to detect the DITA maps. So far this workaround is working fine for us.

Thanks and Regard,
Abhi_K
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Dropping ditamap url to DITA Maps Manager

Post by Radu »

Hi Abhi_K,
Alright, nice trick :D , yes Oxygen looks only at the extension.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply