Override option prompting user when opening map in DITA Map Manager
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 2
- Joined: Tue Dec 21, 2021 3:47 pm
Override option prompting user when opening map in DITA Map Manager
Hello,
In the standalone Oxygen workspace, I'm trying to programically open a DITA map in both the DITA Maps Manager and the primary Editor, irrespective of user preferences and without prompting the user to decide. I've tried several approaches but none seem to work:
To simply open it in the Dita Maps Manager, I've tried the following:
But the user still gets prompted as to where to open the file. From what I can tell, none of the
methods do anything with the parameters other than the initial URL, and the subclasses don't override this behavior.
Another approach I tried was to set the user preference before the call and then restore it afterwards, something like:
But I get the following error:
Am I missing something or is what I'm trying to do simply not possible?
Thanks
In the standalone Oxygen workspace, I'm trying to programically open a DITA map in both the DITA Maps Manager and the primary Editor, irrespective of user preferences and without prompting the user to decide. I've tried several approaches but none seem to work:
To simply open it in the Dita Maps Manager, I've tried the following:
Code: Select all
PluginWorkspaceProvider.getPluginWorkspace().open(url, EditorPageConstants.PAGE_DITA_MAP);
Code: Select all
ro.sync.ecss.extensions.api.component.BaseComponentEditorManager#open(URL,...)
Another approach I tried was to set the user preference before the call and then restore it afterwards, something like:
Code: Select all
final String ASK_OPEN_IN_DITAMAP_PROP = "ask.open.ditamap.in.dita.manager";
PluginWorkspace ws = PluginWorkspaceProvider.getPluginWorkspace();
Object originalValue = PluginWorkspaceProvider.getPluginWorkspace().getGlobalObjectProperty(ASK_OPEN_IN_DITAMAP_PROP);
ws.setGlobalObjectProperty(ASK_OPEN_IN_DITAMAP_PROP, StandalonePluginWorkspace.DITA_MAPS_EDITING_AREA);
ws.open(url, EditorPageConstants.PAGE_DITA_MAP);
ws.setGlobalObjectProperty(ASK_OPEN_IN_DITAMAP_PROP, originalValue);
Code: Select all
java.lang.IllegalArgumentException: Only keys in the APIAccessibleOptionTags interface are accessible via the API.
Thanks
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Override option prompting user when opening map in DITA Map Manager
Hi,
Doing something like this should open the map in the main editing area:
I'm afraid we do not have an API to force open the DITA Map in the DITA Maps Manager view.
About this alternative you are trying with reading the current state of the global setting "PluginWorkspaceProvider.getPluginWorkspace().getGlobalObjectProperty(ASK_OPEN_IN_DITAMAP_PROP)", I'm afraid that for security reasons (for example not allowing plugins to read saved passwords) we allow plugins to read only keys which appear in the "ro.sync.exml.options.APIAccessibleOptionTags" interface.
As the "ask.open.ditamap.in.dita.manager" key is safe I just moved it to the "ro.sync.exml.options.APIAccessibleOptionTags" interface so in Oxygen 24.1 you will be able to query its current value.
Regards,
Radu
Doing something like this should open the map in the main editing area:
Code: Select all
pluginWorkspaceAccess.open(new URL("...flowers.ditamap"), null, "text/xml");
About this alternative you are trying with reading the current state of the global setting "PluginWorkspaceProvider.getPluginWorkspace().getGlobalObjectProperty(ASK_OPEN_IN_DITAMAP_PROP)", I'm afraid that for security reasons (for example not allowing plugins to read saved passwords) we allow plugins to read only keys which appear in the "ro.sync.exml.options.APIAccessibleOptionTags" interface.
As the "ask.open.ditamap.in.dita.manager" key is safe I just moved it to the "ro.sync.exml.options.APIAccessibleOptionTags" interface so in Oxygen 24.1 you will be able to query its current value.
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