SEBSERV-261
This commit is contained in:
parent
499c01e943
commit
b735e95587
2 changed files with 18 additions and 0 deletions
|
@ -30,6 +30,7 @@ import org.eclipse.rap.rwt.service.ServiceManager;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.web.context.WebApplicationContext;
|
import org.springframework.web.context.WebApplicationContext;
|
||||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||||
|
@ -42,6 +43,7 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.SEBServerAuthori
|
||||||
|
|
||||||
public class RAPConfiguration implements ApplicationConfiguration {
|
public class RAPConfiguration implements ApplicationConfiguration {
|
||||||
|
|
||||||
|
public static final String ATTR_USER_SESSION_TIMEOUT = "sebserver.gui.session.timeout";
|
||||||
private static final String DEFAULT_THEME_NAME = "sebserver";
|
private static final String DEFAULT_THEME_NAME = "sebserver";
|
||||||
private static final Logger log = LoggerFactory.getLogger(RAPConfiguration.class);
|
private static final Logger log = LoggerFactory.getLogger(RAPConfiguration.class);
|
||||||
|
|
||||||
|
@ -141,6 +143,7 @@ public class RAPConfiguration implements ApplicationConfiguration {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createContents(final Composite parent) {
|
protected void createContents(final Composite parent) {
|
||||||
|
|
||||||
final HttpSession httpSession = RWT
|
final HttpSession httpSession = RWT
|
||||||
.getUISession(parent.getDisplay())
|
.getUISession(parent.getDisplay())
|
||||||
.getHttpSession();
|
.getHttpSession();
|
||||||
|
@ -164,6 +167,19 @@ public class RAPConfiguration implements ApplicationConfiguration {
|
||||||
final WebApplicationContext webApplicationContext = getWebApplicationContext(httpSession);
|
final WebApplicationContext webApplicationContext = getWebApplicationContext(httpSession);
|
||||||
initSpringBasedRAPServices(webApplicationContext);
|
initSpringBasedRAPServices(webApplicationContext);
|
||||||
|
|
||||||
|
final Environment environment = webApplicationContext.getBean(Environment.class);
|
||||||
|
if (environment != null) {
|
||||||
|
|
||||||
|
final Integer sessionTimeout = environment.getProperty(
|
||||||
|
ATTR_USER_SESSION_TIMEOUT,
|
||||||
|
Integer.class,
|
||||||
|
-1);
|
||||||
|
|
||||||
|
httpSession.setMaxInactiveInterval(sessionTimeout);
|
||||||
|
} else {
|
||||||
|
httpSession.setMaxInactiveInterval(-1);
|
||||||
|
}
|
||||||
|
|
||||||
final EntryPointService entryPointService = webApplicationContext
|
final EntryPointService entryPointService = webApplicationContext
|
||||||
.getBean(EntryPointService.class);
|
.getBean(EntryPointService.class);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
##########################################################
|
##########################################################
|
||||||
### SEB Server GUI configuration
|
### SEB Server GUI configuration
|
||||||
|
|
||||||
|
sebserver.gui.session.timeout=-1
|
||||||
|
|
||||||
# theme
|
# theme
|
||||||
sebserver.gui.theme=css/sebserver.css
|
sebserver.gui.theme=css/sebserver.css
|
||||||
sebserver.gui.list.page.size=20
|
sebserver.gui.list.page.size=20
|
||||||
|
|
Loading…
Reference in a new issue