Override option prompting user when opening map in DITA Map Manager
Posted: Tue Dec 21, 2021 5:17 pm
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