소스 검색

[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 년 전
부모
커밋
35b979139f
1개의 변경된 파일27개의 추가작업 그리고 0개의 파일을 삭제
  1. 27
    0
      src/com/vaadin/terminal/gwt/client/ApplicationConnection.java

+ 27
- 0
src/com/vaadin/terminal/gwt/client/ApplicationConnection.java 파일 보기

} }
}-*/; }-*/;


/**
* 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 * Get the active Console for writing debug messages. May return an actual
* logging console, or the NullConsole if debugging is not turned on. * logging console, or the NullConsole if debugging is not turned on.
public void execute() { public void execute() {
if (!hasActiveRequest()) { if (!hasActiveRequest()) {
hideLoadingIndicator(); 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…
취소
저장