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

Post here questions and problems related to oXygen frameworks/document types.
daniel7
Posts: 10
Joined: Tue May 27, 2014 10:00 am

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

Post by daniel7 » Thu Feb 23, 2017 4:02 pm

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

Radu
Posts: 6274
Joined: Fri Jul 09, 2004 5:18 pm

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

Post by Radu » Thu Feb 23, 2017 4:18 pm

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

daniel7
Posts: 10
Joined: Tue May 27, 2014 10:00 am

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

Post by daniel7 » Thu Feb 23, 2017 4:59 pm

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>

Radu
Posts: 6274
Joined: Fri Jul 09, 2004 5:18 pm

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

Post by Radu » Thu Feb 23, 2017 5:16 pm

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

daniel7
Posts: 10
Joined: Tue May 27, 2014 10:00 am

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

Post by daniel7 » Thu Feb 23, 2017 6:12 pm

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.

Post Reply