Browse Source

[merge from 6.7] #8305 extend Liferay session when the user interacts with a Vaadin portlet

svn changeset:23802/svn branch:6.8
tags/7.0.0.alpha3
Automerge 12 years ago
parent
commit
35b979139f
1 changed files with 27 additions and 0 deletions
  1. 27
    0
      src/com/vaadin/terminal/gwt/client/ApplicationConnection.java

+ 27
- 0
src/com/vaadin/terminal/gwt/client/ApplicationConnection.java View File

@@ -330,6 +330,25 @@ public class ApplicationConnection {
}
}-*/;

/**
* If on Liferay and logged in, ask the client side session management
* JavaScript to extend the session duration.
*
* Otherwise, Liferay client side JavaScript will explicitly expire the
* session even though the server side considers the session to be active.
* See ticket #8305 for more information.
*/
protected native void extendLiferaySession()
/*-{
if ($wnd.Liferay && $wnd.Liferay.Session) {
$wnd.Liferay.Session.extend();
// if the extend banner is visible, hide it
if ($wnd.Liferay.Session.banner) {
$wnd.Liferay.Session.banner.remove();
}
}
}-*/;

/**
* Get the active Console for writing debug messages. May return an actual
* logging console, or the NullConsole if debugging is not turned on.
@@ -819,6 +838,14 @@ public class ApplicationConnection {
public void execute() {
if (!hasActiveRequest()) {
hideLoadingIndicator();

// If on Liferay and session expiration management is in
// use, extend session duration on each request.
// Doing it here rather than before the request to improve
// responsiveness.
// Postponed until the end of the next request if other
// requests still pending.
extendLiferaySession();
}
}
});

Loading…
Cancel
Save