View / Window Scope to support multiple browser tabs #50

Closed
gemaSantiago opened this Issue Jan 25, 2016 · 6 comments
@gemaSantiago

The solution will be based on a Dolphin-Session that is defined by a unique ID.

@Dierk
Contributor
Dierk commented Jan 25, 2016

Wait with this one. It needs more consideration.

@hendrikebbers
Member

@Dierk I will add my thoughts about this topic the next days.

@hendrikebbers
Member

From my point of view this problem is already solved by some web application frameworks. The trick is to create a new scope type that is part of the session. By default all tabs in a browser share a session. If you now want to define anything that is only specific for one tab you need to define a scope that is smaller than the session scope. This means that a session can hold several of this scope instances in parallel. Since the HTTP protocol can't simply handle such a feature a specific identifier is needed that defines a tab. Holding this identifier is quite easy because each tab has it's own JavaScript Sandbox. But synchronizing this identifier with the server is often a problem. This is very hard if you use several remoting types in an application like REST and WS. If the complete communication is wrapped by a remoting layer like in the Dolphin Platform this is quite easy. In this case the remoting layer can add the tab identifier as a param for each request header.
In addition it's important that an action is triggered whenever a tab is closed. If this won't happen the server has no idea when he can destroy the scope of the tab. As far as I know this can be handled by JavaScript in a general way (http://stackoverflow.com/questions/3888902/javascript-detect-browser-close-tab-close-browser / http://stackoverflow.com/questions/10311341/confirmation-before-closing-of-tab-browser).

Here are some links that document the feature for JavaEE, Spring, JSF and Vaadin:

I think it's important that all tabs still share the same session. By doing so a user don't need to relogin when he opens a new tab since the security informations are stored in a session. In addition general user data like the shopping cart informations of a webshop can be stored in the session and will automatically be shared between all tabs.

When talking about Dolphin Platform I think that we need something like a ClientScope (I don't like WindowsScope since we can have desktop clients). All Information of one server dolphin / model store are stored in the context of one ClientScope instance. If the user closes the window we can simply remove the context and it's content.

@hendrikebbers
Member
@hendrikebbers hendrikebbers added this to the 0.8.4 milestone Mar 13, 2016
@hendrikebbers
Member

resolved in #131

@hendrikebbers
Member

With 0.8.4 the server (JavaEE and Spring) is ready for this feature (see #131) . Changes / support in the client will come in the next version.

@hendrikebbers hendrikebbers modified the milestone: 0.8.5, 0.8.4, 0.8.6 May 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment