Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » receiving information/reading a file
receiving information/reading a file [message #859557] Fri, 27 April 2012 17:46 Go to next message
Sean Gilley is currently offline Sean GilleyFriend
Messages: 14
Registered: April 2012
Junior Member
Let me start with I'm a newbie at Eclipse, and at RAP, and pretty much all the technologies I'm trying to use. Java is about the only thing I'm proficient with.

That said, I'm trying to complete a RAP application that was started by someone else. It's close enough to complete that I'd like to try deploying it, but I'm confused about something.

Currently we have a CGI script that gets some information, then produces XML which the user downloads to their PC. The user now needs to edit a .bat file to input the name of the XML file and run an RCP application.

The idea of the RAP app is to replace the second stage of the process with something basically invisible to the user, i.e., the user provides the information via a CGI script, then the XML is generated and fed to the RAP app, which magically appears in the user's browser.

Currently the RAP application reads the information from a file on my PC, using an environment variable set up in the Run Configuration menu.

How do I feed the XML to the RAP application? The XML can be relatively large -- on the order of 650 lines, so I'm not sure that sending via get/post is a viable solution, but I'm willing to look at it. If so, how do I get the RAP application to read the input? If not via CGI, do I just need to save the XML in a temp location and send the RAP application the filename, and read it from there?

I'm more than willing to read a website if the info's out there. I just haven't been able to find it.

Thanks,

Sean.
Re: receiving information/reading a file [message #863275 is a reply to message #859557] Sun, 29 April 2012 11:06 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Sean,

you probably don't have to create and upload this file again every
single time a given user starts the application, do you? If not, you
could save this XML file in the user's setting store (a persistent
server-side store, see RWT.getSettingStore()). If you need a new file
for every session, keep it in the session store (RWT.getSessionStore()).

Before you start the workbench in your entrypoint, you could check for
the file, and if it is not present, let the user upload or paste it. You
could even build an SWT-based form for the user to enter the information
needed to generate the XML file. When you have the file, store it in the
session store or setting store and start the workbench. The application
can read the XML file from this store when needed.

Does this help?
Ralf


--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: receiving information/reading a file [message #865487 is a reply to message #863275] Mon, 30 April 2012 12:26 Go to previous messageGo to next message
Sean Gilley is currently offline Sean GilleyFriend
Messages: 14
Registered: April 2012
Junior Member
Ralf, thanks for your reply.

The idea behind the app is to display a dependency tree that is created in real time from a database. The dependency tree can be created from any one of 40-50 entry points. I might be able to get away with just two files, as I believe all the dependencies exist in one of two trees, but I can't do better than that, and even then, as I said, that's not really what management wants. And the files would probably need to be recreated on a daily basis, but I can set up a cron job to do that -- it isn't an issue.

But, let's assume I go with a single file. Like I said, I'm new at Eclipse/RAP. How do I set the filename in the session store?

Thanks,

Sean.
Re: receiving information/reading a file [message #866225 is a reply to message #865487] Mon, 30 April 2012 19:59 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

So, are these XML files the same for every user or does the user need to
select one? In the latter case I'd recommend to show a selection UI
before you start the application itself.

If you want to put something in the session store, call

RWT.getSessionStore().setAttribute( name, value );

HTH, Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: receiving information/reading a file [message #866242 is a reply to message #859557] Mon, 30 April 2012 20:13 Go to previous messageGo to next message
Cole Markham is currently offline Cole MarkhamFriend
Messages: 150
Registered: July 2009
Location: College Station, TX
Senior Member

Sean,

If you can modify the CGI script, you could have it send the xml data directly to a servlet within the RAP server which could store the data however it wants. You would need a unique identifier to match the data later, so that could either be generated by the CGI script and sent along with the data, or it could be generated by the servlet and returned to the CGI script. Either way, the CGI script would then redirect the user to the RAP entry point, passing the unique ID as a URL parameter. In your RAP entry point, you can get the URL parameter with something like:
RWT.getRequest().getParameter("uniqueId");
You should add error checking and such.

Since all of this is not really related to RAP, I would be glad to discuss offline.

Cole
Re: receiving information/reading a file [message #867958 is a reply to message #866242] Tue, 01 May 2012 15:16 Go to previous message
Sean Gilley is currently offline Sean GilleyFriend
Messages: 14
Registered: April 2012
Junior Member
Cole,

If you'll PM me, I would like to discuss. I can't initiate, as your PM function is turned off.

Thanks,

Sean.
Previous Topic:[ANN] Migration from CVS to Git
Next Topic:Combo Drop Down Transparency
Goto Forum:
  


Current Time: Mon Dec 06 23:41:45 GMT 2021

Powered by FUDForum. Page generated in 0.02453 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top