Merge branch 'dev-1.5' into development
This commit is contained in:
commit
0db5c59947
4 changed files with 27 additions and 5 deletions
|
@ -15,6 +15,7 @@ import java.util.function.BooleanSupplier;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.commons.text.StringEscapeUtils;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
@ -481,7 +482,7 @@ public class LmsSetupForm implements TemplateComposer {
|
||||||
case TOKEN_REQUEST: {
|
case TOKEN_REQUEST: {
|
||||||
throw new PageMessageException(new LocTextKey(
|
throw new PageMessageException(new LocTextKey(
|
||||||
"sebserver.lmssetup.action.test.tokenRequestError",
|
"sebserver.lmssetup.action.test.tokenRequestError",
|
||||||
Utils.formatHTMLLinesForceEscaped(Utils.escapeHTML_XML_EcmaScript(error.message))));
|
Utils.formatHTMLLinesForceEscaped(StringEscapeUtils.escapeHtml4(error.message))));
|
||||||
}
|
}
|
||||||
case QUIZ_ACCESS_API_REQUEST: {
|
case QUIZ_ACCESS_API_REQUEST: {
|
||||||
if (error.message.contains("quizaccess_sebserver_get_exams")) {
|
if (error.message.contains("quizaccess_sebserver_get_exams")) {
|
||||||
|
|
|
@ -11,7 +11,9 @@ package ch.ethz.seb.sebserver.gui.service.i18n.impl;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.commons.text.StringEscapeUtils;
|
||||||
import org.eclipse.rap.rwt.RWT;
|
import org.eclipse.rap.rwt.RWT;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
|
@ -30,6 +32,8 @@ import org.eclipse.swt.widgets.TableItem;
|
||||||
import org.eclipse.swt.widgets.Text;
|
import org.eclipse.swt.widgets.Text;
|
||||||
import org.eclipse.swt.widgets.Tree;
|
import org.eclipse.swt.widgets.Tree;
|
||||||
import org.eclipse.swt.widgets.TreeItem;
|
import org.eclipse.swt.widgets.TreeItem;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -49,6 +53,8 @@ import ch.ethz.seb.sebserver.gui.widget.Selection;
|
||||||
@GuiProfile
|
@GuiProfile
|
||||||
public final class PolyglotPageServiceImpl implements PolyglotPageService {
|
public final class PolyglotPageServiceImpl implements PolyglotPageService {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(PolyglotPageServiceImpl.class);
|
||||||
|
|
||||||
private final I18nSupport i18nSupport;
|
private final I18nSupport i18nSupport;
|
||||||
|
|
||||||
public PolyglotPageServiceImpl(final I18nSupport i18nSupport) {
|
public PolyglotPageServiceImpl(final I18nSupport i18nSupport) {
|
||||||
|
@ -93,7 +99,11 @@ public final class PolyglotPageServiceImpl implements PolyglotPageService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void injectI18n(final Label label, final LocTextKey locTextKey) {
|
public void injectI18n(final Label label, final LocTextKey locTextKey) {
|
||||||
injectI18n(label, locTextKey, null);
|
try {
|
||||||
|
injectI18n(label, locTextKey, null);
|
||||||
|
} catch (final Exception e) {
|
||||||
|
log.error("Failed to injectI18n: {}", e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -269,8 +279,14 @@ public final class PolyglotPageServiceImpl implements PolyglotPageService {
|
||||||
final I18nSupport i18nSupport) {
|
final I18nSupport i18nSupport) {
|
||||||
|
|
||||||
return label -> {
|
return label -> {
|
||||||
|
|
||||||
if (locTextKey != null) {
|
if (locTextKey != null) {
|
||||||
label.setText(i18nSupport.getText(locTextKey));
|
final String text = i18nSupport.getText(locTextKey);
|
||||||
|
if (BooleanUtils.toBoolean((Boolean) label.getData(RWT.MARKUP_ENABLED))) {
|
||||||
|
label.setText(StringEscapeUtils.escapeHtml4(text));
|
||||||
|
} else {
|
||||||
|
label.setText(text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (i18nSupport.hasText(locToolTipKey)) {
|
if (i18nSupport.hasText(locToolTipKey)) {
|
||||||
label.setToolTipText(Utils.formatLineBreaks(i18nSupport.getText(locToolTipKey)));
|
label.setToolTipText(Utils.formatLineBreaks(i18nSupport.getText(locToolTipKey)));
|
||||||
|
|
|
@ -10,6 +10,7 @@ package ch.ethz.seb.sebserver.gui.widget;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import org.apache.commons.text.StringEscapeUtils;
|
||||||
import org.eclipse.rap.rwt.RWT;
|
import org.eclipse.rap.rwt.RWT;
|
||||||
import org.eclipse.rap.rwt.widgets.DialogCallback;
|
import org.eclipse.rap.rwt.widgets.DialogCallback;
|
||||||
import org.eclipse.swt.graphics.Rectangle;
|
import org.eclipse.swt.graphics.Rectangle;
|
||||||
|
@ -17,7 +18,6 @@ import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.MessageBox;
|
import org.eclipse.swt.widgets.MessageBox;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
import ch.ethz.seb.sebserver.gbl.util.Utils;
|
|
||||||
import ch.ethz.seb.sebserver.gui.service.i18n.I18nSupport;
|
import ch.ethz.seb.sebserver.gui.service.i18n.I18nSupport;
|
||||||
import ch.ethz.seb.sebserver.gui.widget.WidgetFactory.CustomVariant;
|
import ch.ethz.seb.sebserver.gui.widget.WidgetFactory.CustomVariant;
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ public final class Message extends MessageBox {
|
||||||
super.prepareOpen();
|
super.prepareOpen();
|
||||||
} catch (final IllegalArgumentException e) {
|
} catch (final IllegalArgumentException e) {
|
||||||
// fallback on markup text error
|
// fallback on markup text error
|
||||||
super.setMessage(Utils.escapeHTML_XML_EcmaScript(super.getMessage()));
|
super.setMessage(StringEscapeUtils.escapeHtml4(super.getMessage()));
|
||||||
super.prepareOpen();
|
super.prepareOpen();
|
||||||
}
|
}
|
||||||
final GridLayout layout = (GridLayout) super.shell.getLayout();
|
final GridLayout layout = (GridLayout) super.shell.getLayout();
|
||||||
|
|
|
@ -326,6 +326,11 @@ public class ExamProctoringRoomServiceImpl implements ExamProctoringRoomService
|
||||||
cc.getExamId(),
|
cc.getExamId(),
|
||||||
cc.getConnectionToken());
|
cc.getConnectionToken());
|
||||||
|
|
||||||
|
if (proctoringRoom == null) {
|
||||||
|
log.warn("Assign SEB client to proctoring room failed for: {}", cc);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("Assigning new SEB client to proctoring room: {}, connection: {}",
|
log.debug("Assigning new SEB client to proctoring room: {}, connection: {}",
|
||||||
proctoringRoom.id,
|
proctoringRoom.id,
|
||||||
|
|
Loading…
Reference in a new issue