Page 1 of 1

is my add-on running in XML Author or XL Editor?

Posted: Thu Feb 23, 2017 4:02 pm
by daniel7
Hi,

how can my add-on find out whether it's running in XML Author or XML Editor? The reason I need to know is that their preference files seem to be independent, either "oxyOptionsSa18.1.xml" or "oxyAuthorOptionsSa18.1.xml" is used. I need to find the setting for the spell checker language, and as API read access to the configuration doesn't seem to be possible (post29252.html), I need to load the file directly.

Regards
Daniel

Re: is my add-on running in XML Author or XL Editor?

Posted: Thu Feb 23, 2017 4:18 pm
by Radu
Hi Daniel,

Right now there is an API method called PluginWorkspaceProvider.getPluginWorkspace().getApplicationName(). It should return <oXygen/> XML Editor in one case and <oXygen/> XML Author in the other.
In Oxygen 19 you will have more specific API for this.
We also added an API interface containing API keys for which values can be obtained from a plugin ro.sync.exml.options.APIAccessibleOptionTags.
I can try for Oxygen 19 (April-May this year) to make accessible in this APIAccessibleOptionTags also the spell checker options key.

Regards,
Radu

Re: is my add-on running in XML Author or XL Editor?

Posted: Thu Feb 23, 2017 4:59 pm
by daniel7
Radu wrote:PluginWorkspaceProvider.getPluginWorkspace().getApplicationName()
getApplicationName() isn't found here when I use this dependency in Maven, am I missing something?

Code: Select all

        <dependency>
<groupId>com.oxygenxml</groupId>
<artifactId>oxygen</artifactId>
<version>18.1.0.2</version>
<scope>provided</scope>
</dependency>

Re: is my add-on running in XML Author or XL Editor?

Posted: Thu Feb 23, 2017 5:16 pm
by Radu
Hi Daniel,

Oops, sorry, I double checked and even that application name API is scheduled for 19, so it was not available in 18.1.
As possible workarounds:

1) ro.sync.exml.workspace.api.WorkspaceUtilities.getParentFrame(), cast it to java.awt.Frame and get its title. It should contain the application name at the end.
2) ro.sync.exml.workspace.api.WorkspaceUtilities.getLicenseInformationProvider().getComponents() shows for what application the license key was generated. This might not work if end user has license for XML Editor but is running XML Author (which can be run with XML Editor license).

Regards,
Radu

Re: is my add-on running in XML Author or XL Editor?

Posted: Thu Feb 23, 2017 6:12 pm
by daniel7
Radu wrote: 1) ro.sync.exml.workspace.api.WorkspaceUtilities.getParentFrame(), cast it to java.awt.Frame and get its title.
Thanks, this workaround seems to work nicely.