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

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

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: 5088

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

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

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

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: 5088

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

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

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

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.

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 2 guests