Check Oxygen License Validity

Post here questions and problems related to oXygen frameworks/document types.
Isabelle
Posts: 142
Joined: Fri Jan 20, 2017 1:11 pm

Check Oxygen License Validity

Post by Isabelle »

Hello,

Currently the AuthorComponentFactory.init method, launch itself the pop up for Oxygen license but we need to show our license manager pop up.
We want to manage the case when Oxygen license is not valid before launching AuthorComponentFactory.init method.

Is it possible to check in java, if an Oxygen license (file or string) is valid ?

Thanks,
Regards,
Isabelle
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Check Oxygen License Validity

Post by Radu »

Hi Isabelle,

I'm afraid we do not have such a feature in our API.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Isabelle
Posts: 142
Joined: Fri Jan 20, 2017 1:11 pm

Re: Check Oxygen License Validity

Post by Isabelle »

Hello,

In our application, we have a splashscreen on launch, and some times the Oxygen license pop up is hidden by this.
It is not possible to our client to see the error message and then close it and add the license.

As the method AuthorComponentFactory.init return nothing, how can we know if Oxygen License is invalid ?
Is it possible to configure Oxygen license pop up ?

Regards,
Isabelle.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Check Oxygen License Validity

Post by Radu »

Hi Isabelle,

I'm afraid that's all the API we have. Maybe you can use the Swing API "java.awt.Window.getWindows()" to access all created windows and see if a window with a certain title is visible.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Isabelle
Posts: 142
Joined: Fri Jan 20, 2017 1:11 pm

Re: Check Oxygen License Validity

Post by Isabelle »

Hello Radu,

I tried the Swing API "java.awt.Window.getWindows()" but it is not relevant for my purpose.

First : as the method AuthorComponentFactory.init does not end until user answers to license po up,
I have to create a thread to check every XX second all the windows open, which is an heavy behavior in my opinion

Second : I only found this king of window name "frame0", "frame1", "dialog0", "dialog1", and they don't have title at all.
I don't find safe to manage window without to be sure it is the license pop up or not.

Regards,
Isabelle
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Check Oxygen License Validity

Post by Radu »

Hi Isabelle,
First : as the method AuthorComponentFactory.init does not end until user answers to license po up,
Yes.
I have to create a thread to check every XX second all the windows open, which is an heavy behavior in my opinion
Creating a thread is not heavy, you could have the thread check the opened windows for about 10-15 seconds and avoid it run forever.

Just to get back to your original needs, so your need would be to ask the author component is there is some sort of valid license already saved persistently on disk for the end user before calling AuthorComponentFactory.init. And what would you do with that information? If for example you would know there is not a valid license file available, you would show your own license registration dialog, right? And then? Overwrite the XML configuration file in the user home which Oxygen uses to store the license information? And then call AuthorComponentFactory.init after doing that? How about if you read the XML configuration file where the Author Component stores the license directly to decide if there is a license stored there or not?
I'm afraid we will not create new API for this.
Second : I only found this king of window name "frame0", "frame1", "dialog0", "dialog1", and they don't have title at all.
I don't find safe to manage window without to be sure it is the license pop up or not.
The window you are interested in is an instance of JDialog which has API to obtain a title for it "java.awt.Dialog.getTitle()".

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Isabelle
Posts: 142
Joined: Fri Jan 20, 2017 1:11 pm

Re: Check Oxygen License Validity

Post by Isabelle »

Hello,

My use case is the following :
- First install of our application, user has not yet Application license neither Oxygen License.
- License pop up show and user add licenses
- Our App copy Oxygen license in the good folder in com.oxygenxml.ApplicationDataFolder
- License pop up is closed
- AuthorComponentFactory.init is launched

What I want to do is to check Oxygen license before copy it in ApplicationDataFolder/[...]/AppID
and stay on our pop up license as long as users do not have a valid one.
The window you are interested in is an instance of JDialog which has API to obtain a title for it "java.awt.Dialog.getTitle()".
I made my test with JFrame instead of JDialog.
I get the good title know, thanks.

Regards,
Isabelle
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Check Oxygen License Validity

Post by Radu »

Hi Isabelle,

I'm afraid I do not understand the entire thing, so there are two license keys the user must input, one for your application and one for the Author Component?
And you show a separate license input dialog for your application's specific license? But you do not want to show your own license input dialog if the author component does not accept its own pasted license as valid?
So what if you keep things separate as they are now? You accept your license and we accept ours? So the user has a good license for your product, they input it in your dialog and a bad license for ours which is pasted in our license registration dialog, they will not be able to use the component anyway...


Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply