fix messages and remove started quiz check on import

This commit is contained in:
anhefti 2019-09-04 15:49:36 +02:00
parent 7702a6649c
commit e195007c82
8 changed files with 18 additions and 17 deletions

View file

@ -47,6 +47,7 @@ management.endpoints.web.base-path=/actuator
management.endpoints.web.exposure.include=logfile,loggers
# GUI server configuration
sebserver.gui.external.messages=file:/sebserver/messages
sebserver.gui.entrypoint=/gui
sebserver.gui.webservice.protocol=http
sebserver.gui.webservice.address=${server.address}

View file

@ -27,7 +27,6 @@ services:
volumes:
- ./application-demo.properties:/sebserver/application-demo.properties
- ./messages_en.properties:/sebserver/messages_en.properties
- ./messages.properties:/sebserver/messages.properties
ports:
- 8080:8080
- 9090:9090

View file

@ -1 +0,0 @@

View file

@ -15,7 +15,6 @@ import javax.servlet.ServletException;
import org.eclipse.rap.rwt.engine.RWTServlet;
import org.eclipse.rap.rwt.engine.RWTServletContextListener;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
@ -33,6 +32,9 @@ public class RAPSpringConfig {
@Value("${sebserver.gui.entrypoint}")
private String entrypoint;
@Value("${sebserver.gui.external.messages:messages}")
private String externalMessagesPath;
@Bean
public ServletContextInitializer initializer() {
return new RAPServletContextInitializer();
@ -52,9 +54,15 @@ public class RAPSpringConfig {
}
@Bean
@ConfigurationProperties("spring.messages")
public MessageSource messageSource() {
return new ReloadableResourceBundleMessageSource();
final ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource =
new ReloadableResourceBundleMessageSource();
reloadableResourceBundleMessageSource.setBasenames(
this.externalMessagesPath,
"classpath:messages");
return reloadableResourceBundleMessageSource;
}
private static class RAPServletContextInitializer implements ServletContextInitializer {

View file

@ -233,9 +233,9 @@ public class QuizDiscoveryList implements TemplateComposer {
action.getSingleSelection();
final QuizData selectedROWData = table.getSelectedROWData();
if (selectedROWData.startTime != null) {
if (selectedROWData.endTime != null) {
final DateTime now = DateTime.now(DateTimeZone.UTC);
if (selectedROWData.startTime.isBefore(now)) {
if (selectedROWData.endTime.isBefore(now)) {
throw new PageMessageException(NO_IMPORT_OF_OUT_DATED_QUIZ);
}
}

View file

@ -25,10 +25,12 @@
<Logger name="ch.ethz.seb.sebserver.gui" level="INFO" additivity="true" />
<Logger name="ch.ethz.seb.sebserver.webservice" level="INFO" additivity="true" />
<Logger name="org.apache.ibatis.datasource" level="INFO" additivity="true" />
<Logger name="org.mybatis" level="DEBUG" additivity="true" />
<Logger name="org.mybatis" level="INFO" additivity="true" />
<Logger name="org.mybatis.generator" level="INFO" additivity="true" />
<Logger name="org.springframework.boot" level="INFO" additivity="true" />
<Logger name="org.springframework.security" level="INFO" additivity="true" />
<Logger name="org.springframework.context.support.ResourceBundleMessageSource" level="DEBUG" additivity="true" />
<Logger name="org.springframework.web" level="INFO" additivity="true" />
<Logger name="org.springframework.security.oauth2" level="INFO" additivity="true" />

View file

@ -3,10 +3,6 @@
################################
sebserver.overall.version=SEB Server Version : {0}
sebserver.overall.imprint=
sebserver.overall.imprint.markup=
sebserver.overall.about=
sebserver.overall.about.markup=
sebserver.overall.help=Documentation
sebserver.overall.help.link=https://www.safeexambrowser.org/news_en.html
@ -258,7 +254,7 @@ sebserver.quizdiscovery.info.pleaseSelect=Please Select a Quiz first
sebserver.quizdiscovery.action.list=Quiz Discovery
sebserver.quizdiscovery.action.import=Import as Exam
sebserver.quizdiscovery.quiz.import.out.dated=The Selected Quiz is in the past and can't be imported
sebserver.quizdiscovery.quiz.import.out.dated=The Selected Quiz is is already finished and can't be imported
sebserver.quizdiscovery.action.details=Show Details
sebserver.quizdiscovery.quiz.details.title=Quiz Details

View file

@ -3,10 +3,6 @@
################################
sebserver.overall.version=SEB Server Version : {0}
sebserver.overall.imprint=
sebserver.overall.imprint.markup=
sebserver.overall.about=
sebserver.overall.about.markup=
sebserver.overall.help=Documentation
sebserver.overall.help.link=https://www.safeexambrowser.org/news_en.html