|
Re: How to restore UISession? [message #1039965 is a reply to message #1039933] |
Fri, 12 April 2013 21:47 |
|
Unfortunately this is not possible. It's more complicated than just reconnecting to the UISession on the server. The UISession is tied to the HttpSession, so it will indeed stay around until the session times out (or the user reconnects when it will be cleaned up and a new one created). The problem is that there isn't currently a way to reconstruct the client browser state from the server representation. It should technically be possible, but I think it will require a significant effort.
The best solution is to implement this functionality at the application level. There is some existing functionality for BrowserHistory and BrowserNavigation (see the Deep Links section)[1] which could be leveraged in your application. For instance, you could use the BrowserHistory to push information about the open dialog which your application could then query on startup to restore the state. Also, see the Exit Confirmation support on that same page which allows you to prompt users when before they exit the application and accidentally lose information.
If you want to go one step further and save the information entered in the dialog/wizard, you can store that information on the server (by registering Modify/Focus listeners on the widgets). You could store that in the HttpSession (see User-specific data)[2], but it may be lost if the browser crashes and doesn't reconnect to the same HttpSession. You could also use the ApplicationContext[also 2], a global singleton, an OSGi service, or similar mechanism to store the partially-entered data (you would need a userId or similar key, of course). This would naturally be quite a bit of work, so consider if your users really expect such behavior.
[1] http://eclipse.org/rap/developers-guide/devguide.php?topic=navigation.html&version=2.0
[2]http://eclipse.org/rap/developers-guide/devguide.php?topic=data-stores.html&version=2.0
Hope that helps,
Cole Markham
|
|
|
|
Re: How to restore UISession? [message #1042708 is a reply to message #1042148] |
Tue, 16 April 2013 19:33 |
|
Hi Barys,
Actually this feature is something we consider for one of the next
versions after 2.1. We call it "UISession reconnect". However, there are
still a couple of open questions such as: How would the client know and
specify the UISession id to connect to? How would the server know which
UISessions to serialize and store? If you have ideas about these,
related to your specific use case, that would be interesting.
Regards, Ralf
--
Ralf Sternberg
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Re: How to restore UISession? [message #1044318 is a reply to message #1042708] |
Thu, 18 April 2013 19:10 |
Barys Dubauski Messages: 38 Registered: July 2009 |
Member |
|
|
One of the ideas I had (maybe it isn't going to work but I'll throw it out there anyway) is to have automatic url redirect upon initial client connection (when UISession is created for the first time).
For example, when user connects to the web server <siteURL>/mypath for the first time he/she would automatically be redirected to <siteURL>/mypath?session=xUOSHD10334 and that is the address the user would see in the address bar of the browser. Here xUOSHD10334 is the id of the UISession.
If browser got closed (accidentally or on purpose) and user enters <siteURL>/mypath?session=xUOSHD10334 then RAP would try to restore the UISession with id xUOSHD10334.
If user connects to <siteURL>/mypath then a new UISession would be created.
When UISessions would be recycled? Same timeout based approach could be used here too. The timeout value would be configured on the server end. After UISession has been recycled they would see a message: "Your session has expired. A new session will be established..." and they would be redirected to a new session with a new ID.
[Updated on: Thu, 18 April 2013 19:11] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04488 seconds