JavaWebStart - Dynamic Open File

Having trouble installing Oxygen? Got a bug to report? Post it all here.
CheryBen
Posts: 24
Joined: Tue Jun 05, 2012 10:34 am

JavaWebStart - Dynamic Open File

Post by CheryBen »

Hi all, i have a web server containing a web application, an oracle database (containing xml and images refs).
My web app offers a list of the xml documents, for each document, a link is provided to open it in oxygen (distributed via javawebstart).

How do should i say to oxygen to open this document? I know that we could give, in the jnlp file, a list of documents to open, but this list is not dynamic, we have to launch the packager each time...

The documents could be accessed by webdav, or may be other ways.

Another problem is that my xml documents contain references to images, could i use relative path to reference it? With local xml and local images in the same directory, i refer only the image name, will it work if use the same webdav directory.
Radu
Posts: 9449
Joined: Fri Jul 09, 2004 5:18 pm

Re: JavaWebStart - Dynamic Open File

Post by Radu »

Hi Benoit,

Indeed JavaWebstart is not at all flexible in this regard.

The JWS packager ANT build file which comes with Oxygen signs by default the JNLP file (this means that a copy of it is included in the main JAR library) in this step:

Code: Select all

 <copy file="${outputDir}/${packageName}/${productName}.jnlp" tofile="${home}/JNLP-INF/APPLICATION.JNLP"/>
Signing the JNLP file indeed means that it is impossible to automatically generate a JNLP file containing some dynamic arguments.

But the JNLP does not need to be signed. Indeed the user will probably receive this information when launching the application but at least in this way you should be able to dynamically generate a JNLP file via a PHP script based on the URL which was clicked by the user.
The generated JNLP would then take as argument the URL which needs to be opened when Oxygen starts.

Maybe a different approach (more complicated though) would be to have the JNLP file signed and always refer as an URL argument a location like this:

http://path/to/server/redirectEditedURL.php

When the URL gets clicked on the client side you would also call a PHP script on the server side which would update the redirect location for redirectEditedURL.php to point to the clicked XML resource. Then the opened Oxygen would try to connect to the redirect PHP and be redirected to open the XML.

About this question:
Another problem is that my xml documents contain references to images, could i use relative path to reference it? With local xml and local images in the same directory, i refer only the image name, will it work if use the same webdav directory.
When a relative image is specified in Oxygen (in the Author visual editing page) Oxygen first tries to compose an absolute URL location for it by looking at the URL of the opened XML file. Then using that absolute URL it tries to load the image.
So it should work, no matter if the XML is opened from a local drive or from the web.

Of course Oxygen has out-of-the-box support for exploring WebDav resources but indeed it's probably easier for the user to automatically have Oxygen opened with the clicked XML file.

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