Interacting with webservice on startup and user action

Oxygen general issues.
sijomon
Posts: 83
Joined: Wed May 20, 2009 1:18 pm

Interacting with webservice on startup and user action

Post by sijomon »

Hi there
I am looking for some advice on where to find documentation or examples to assist in my implementation of the following scenario.

I would like to start Oxygen XML Editor (I'm using a 10.x version) with a custom command line argument or system property or similar and have it load, on start-up, an XML file from a webservice, and at some later date commit a file back to a second webservice.

The scenario I want to support is as follows;

1) User selects a file from a website and clicks an edit button
2) Website invokes oxygen on the client machine using an applet
3) Applet invokes oxygen with custom parameters or system properties or something similar
4) Oxygen recognises the custom invocation and on starting up calls webservice 1
5) Webservice 1 supplies an XML file to oxygen
6) User edits XML file locally
7) User selects to save XML file back to webservice 2
8) Oxygen calls webservice 2 and sends edited XML file

I am comfortable creating the applet, and webservices to do whatever is required, however I have next to no knowledge about customising Oxygen. I have read the XML editor user manual, particularly Chapter 20, and also wandered around the Oxygen SDK Javadocs and exmaples, but am none the wiser.

I assume I need to implement a couple of plug-ins which will interact with the webservices; one invoked by oxygen on start up to download the XML file from the first webservice, and second plug-in invoked by a user action to send the edited XML to the second webservice. The plug-in development guide (http://www.oxygenxml.com/doc/ug-oxygen/ ... lugin.html) doesn't seem to give any advice on either of these activities, and I can't find any other appropriate documentation.

At a push I could get the applet to invoke the first webservice and download the XML file to a local directory then start Oxygen pointing at this local file, but this doesn’t help me with part 2, committing file back to webservice 2, and I would prefer to handle all of this inside Oxygen.

Any advice on where to go for further information would be greatly appreciated.

Thanks,

Simon.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Interacting with webservice on startup and user action

Post by sorin_ristache »

Hello,
sijomon wrote:I would like to start Oxygen XML Editor (I'm using a 10.x version) with a custom command line argument or system property or similar and have it load, on start-up, an XML file from a webservice, and at some later date commit a file back to a second webservice.
It is not possible to invoke a web service when starting Oxygen from the command line.
sijomon wrote:At a push I could get the applet to invoke the first webservice and download the XML file to a local directory then start Oxygen pointing at this local file, but this doesn’t help me with part 2, committing file back to webservice 2, and I would prefer to handle all of this inside Oxygen.
Yes, you can do that: download the XML file to the local computer and pass the path of the local file as parameter to the Oxygen launcher. You have to do part 2 outside Oxygen too, because calling the webservice for comitting the file can be done only from the Oxygen user interface, not as parameter passed to the Oxygen launcher.


Regards,
Sorin
sijomon
Posts: 83
Joined: Wed May 20, 2009 1:18 pm

Re: Interacting with webservice on startup and user action

Post by sijomon »

Thanks for your fast response.

Ok, so I use a applet to access webservice 1 and download the file to the local machine and then get the applet to fire up Oxygen pointing at this file.

Now for part 2, I can't use the applet to comit the file back rto webservice 2 as the editing process can take several days, ceratainly longer than the web browser and hence the applet will be around for.

Can I create a plugin for oxygen to send the currently open file to a webservice and invoke this plugin from within Oxygen - or would I have to create a standalone client app and invoke this as an external tool from Oxygen?

Thanks Agian,

Simon.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Interacting with webservice on startup and user action

Post by sorin_ristache »

Yes, for saving in Oxygen as a user action you can create a plugin of type custom protocol plugin that handles opening and saving of resources for a protocol that you create.

This can be used for opening the file from the webservice too. For example your custom protocol plugin creates the protocol sijomon_ws and Oxygen will call your plugin for each open and save operation on a resource of that type, for example:

Code: Select all

sijomon_ws://www.your-webservice.site.com/folder/service.wsdl
When you pass the URL to the launcher:

Code: Select all

oxygen.bat sijomon_ws://www.your-webservice.site.com/folder/service.wsdl
Oxygen calls your plugin and opens service.wsdl automatically at startup. On Linux you have to use the oxygen.sh script instead of oxygen.bat and on Mac OS X you have to use the oxygenMac.sh script.


Regards,
Sorin
sijomon
Posts: 83
Joined: Wed May 20, 2009 1:18 pm

Re: Interacting with webservice on startup and user action

Post by sijomon »

Excellent, thanks for the assistnace. I'll proceed along the lines you suggest and see how far I get before I need to come back for more assistnace.

Why can't all tecnical forums be this helpful and active.

Many thanks.

Simon.
Post Reply