aspose file tools*
The moose likes JNLP and Web Start and the fly likes Passing parameter from Web UI to RCP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "Passing parameter from Web UI to RCP" Watch "Passing parameter from Web UI to RCP" New topic
Author

Passing parameter from Web UI to RCP

ved gunjan
Ranch Hand

Joined: May 17, 2003
Posts: 86
Hi All,
Im making a Eclipse RCP application which gets launched from the web UI.
Im using JWS/JNLP for launching the RCP application.
My doubt is how do we pass data/parameters from web UI to RCP through using JNLP/JWS api's , for example how do we pass things like User data, Session data etc from web UI to RCP.
Any help will be great.

Thanks
Ved
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
You have several options and can pick which one suits your needs best.
Add a Property Element which is then retrieved the System.getProperty(),

Add an Argument element which is then sent in on the String[] of arguments to the main method of your application

Review http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/syntax.html


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
ved gunjan
Ranch Hand

Joined: May 17, 2003
Posts: 86
Many Thanks Carl Trusiak for the reply.
I could understand that through resources element tag we can pass the values from Web-UI(thin client)to RCP using any of the 6 different possible subelements of the resources element: jar, nativelib, j2se, property, package,and extension.

But my problem is im not able to figure out how i can do this.
Let me try to explain my scenario

Let's say we have this links on our jsp page
Open Rectangle
Open Square
Open Circle

Now when the user clicks on any of this links,using JWS we launch the Eclipse RCP and we show on the RCP editor either Rectangle or Sqaure or Circle.
Now we have to pass information related to Rectangle,Square or Circle from the Web-UI to the RCP, so that it can show the appropiate shapes.
So my query is how can i pass these parameters from Web-UI to RCP.

Hope im able to explain my scenario and prolem.

Any help would be great.

Thanks and Regards.
Ved
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
You have a seperate JNLP file for each! They will be identical except for the Parameter element. One will say shape=Rectangle, another shape=Square and the final shape=Circle
ved gunjan
Ranch Hand

Joined: May 17, 2003
Posts: 86
But Carl these shapes are dymanic and we dont know before-hand what shapes are there in the system.Actually these shapes are created by the user in to the system,so we cant prepare JNLP file for all the possible shapes in the system.

Hope u got the real problem.

Thanks.
Ved
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
The simple answer is to make the JNLP dynamic. You can create the content of the JNLP using a servlet and dynamically change the parameter based on what is selected from the dynamic link.

Remember, the jnlp file is simply a text document with a mime-type of application/x-java-jnlp-file
ved gunjan
Ranch Hand

Joined: May 17, 2003
Posts: 86
Thanks Carl Trusiak for the suggestion.Even i was thinking on the same line.
But im still kind of abstract about how we can dynamically generate the jnlp file.
I want to pass the session of the user from the web client to RCP.
So for this i have thought of having a variable let say sessionID ,which will take value of the session
sum thing like this...
----------------
<application-desc main-class="com.rcp.core.HelloWorld">
<property name="sessionID" value="$$userSessionId"/>
</application-desc>
--------------
But im not able to figure out how i will populate the sessionID variable.
which class should be responsible for doing this?
whether that class will be in the RCP code or in the Web code...i guess it is in the web code?

Please if u can clarify these doubts then it will be great.

Thanks
ved
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing parameter from Web UI to RCP