added missing exam configuration properties

This commit is contained in:
anhefti 2020-01-16 10:46:52 +01:00
parent 1f2d6ca76b
commit 3b8924ac53
6 changed files with 131 additions and 7 deletions

View file

@ -8,6 +8,7 @@
package ch.ethz.seb.sebserver.gui.content;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.swt.widgets.Composite;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
@ -28,6 +29,7 @@ import ch.ethz.seb.sebserver.gui.form.FormBuilder;
import ch.ethz.seb.sebserver.gui.form.FormHandle;
import ch.ethz.seb.sebserver.gui.service.ResourceService;
import ch.ethz.seb.sebserver.gui.service.examconfig.ExamConfigurationService;
import ch.ethz.seb.sebserver.gui.service.i18n.I18nSupport;
import ch.ethz.seb.sebserver.gui.service.i18n.LocTextKey;
import ch.ethz.seb.sebserver.gui.service.page.PageContext;
import ch.ethz.seb.sebserver.gui.service.page.PageService;
@ -76,6 +78,7 @@ public class ConfigTemplateForm implements TemplateComposer {
private final PageService pageService;
private final RestService restService;
private final CurrentUser currentUser;
private final I18nSupport i18nSupport;
private final ResourceService resourceService;
private final ExamConfigurationService examConfigurationService;
@ -93,6 +96,7 @@ public class ConfigTemplateForm implements TemplateComposer {
this.pageService = pageService;
this.restService = restService;
this.currentUser = currentUser;
this.i18nSupport = pageService.getI18nSupport();
this.resourceService = pageService.getResourceService();
this.examConfigurationService = examConfigurationService;
@ -195,27 +199,31 @@ public class ConfigTemplateForm implements TemplateComposer {
.withColumn(new ColumnDefinition<>(
Domain.CONFIGURATION_ATTRIBUTE.ATTR_NAME,
ATTRIBUTES_LIST_NAME_TEXT_KEY,
TemplateAttribute::getName)
this::getAttributeName)
.withFilter(this.nameFilter)
.sortable())
.sortable()
.widthProportion(3))
.withColumn(new ColumnDefinition<TemplateAttribute>(
Domain.CONFIGURATION_ATTRIBUTE.ATTR_TYPE,
ATTRIBUTES_LIST_TYPE_TEXT_KEY,
resourceService::getAttributeTypeName)
.withFilter(typeFilter)
.sortable())
.sortable()
.widthProportion(1))
.withColumn(new ColumnDefinition<>(
Domain.ORIENTATION.ATTR_VIEW_ID,
ATTRIBUTES_LIST_VIEW_TEXT_KEY,
resourceService.getViewNameFunction(entityKey.modelId))
.withFilter(viewFilter)
.sortable())
.sortable()
.widthProportion(1))
.withColumn(new ColumnDefinition<>(
Domain.ORIENTATION.ATTR_GROUP_ID,
ATTRIBUTES_LIST_GROUP_TEXT_KEY,
TemplateAttribute::getGroupId)
.withFilter(this.groupFilter)
.sortable())
.sortable()
.widthProportion(1))
.withDefaultAction(pageActionBuilder
.newAction(ActionDefinition.SEB_EXAM_CONFIG_TEMPLATE_ATTR_EDIT)
.withParentEntityKey(entityKey)
@ -295,6 +303,18 @@ public class ConfigTemplateForm implements TemplateComposer {
}
private String getAttributeName(final TemplateAttribute attribute) {
final String name = this.i18nSupport.getText(
ExamConfigurationService.ATTRIBUTE_LABEL_LOC_TEXT_PREFIX + attribute.getName(),
"");
if (StringUtils.isNotBlank(name)) {
return attribute.getName() + " (" + name + ")";
} else {
return attribute.getName();
}
}
private final PageAction resetToDefaults(
final PageAction action,
final EntityTable<TemplateAttribute> attrTable) {

View file

@ -21,8 +21,6 @@ import ch.ethz.seb.sebserver.gui.service.examconfig.impl.ViewContext;
public interface InputFieldBuilder {
String RES_BUNDLE_KEY_PREFIX = "sebserver.examconfig.attribute.";
/** Called by the InputFieldBuilderSupplier bean instance on initialization to avoid
* circular dependencies.
*

View file

@ -61,6 +61,7 @@ public class ExamConfigXMLParser extends DefaultHandler {
"outsideSebEnableStartTaskManager",
"outsideSebEnableSwitchUser",
"outsideSebEnableVmWareClientShade",
"outsideSebEnableShutDown",
"enableURLContentFilter",
"enableURLFilter",
"prohibitedProcesses.windowHandlingProcess",

View file

@ -276,6 +276,41 @@ INSERT IGNORE INTO configuration_attribute VALUES
(812, 'allowWlan', 'CHECKBOX', null, null, null, null, 'false'),
(813, 'hookKeys', 'CHECKBOX', null, null, null, null, 'true'),
(900, 'examSessionClearCookiesOnEnd', 'CHECKBOX', null, null, null, null, 'false'),
(901, 'examSessionClearCookiesOnStart', 'CHECKBOX', null, null, null, null, 'false'),
(902, 'showBackToStartButton', 'CHECKBOX', null, null, null, null, 'true'),
(903, 'showSettingsInApp', 'CHECKBOX', null, null, null, null, 'false'),
(904, 'browserUserAgentWinTouchModeIPad', 'TEXT_FIELD', null, null, null, null, 'Mozilla/5.0 (iPad; CPU OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1'),
(905, 'mobileAllowPictureInPictureMediaPlayback', 'CHECKBOX', null, null, null, null, 'false'),
(906, 'lockOnMessageSocketClose', 'CHECKBOX', null, null, null, null, 'false'),
(907, 'enableDrawingEditor', 'CHECKBOX', null, null, null, null, 'false'),
(908, 'URLFilterMessage', 'RADIO_SELECTION', null, '0,1', null, null, '0'),
(909, 'allowDictation', 'CHECKBOX', null, null, null, null, 'false'),
(910, 'allowUserSwitching', 'CHECKBOX', null, null, null, null, 'false'),
(911, 'allowiOSBetaVersionNumber', 'SINGLE_SELECTION', null, '0,12', null, null, '0'),
(912, 'allowiOSVersionNumberMajor', 'SINGLE_SELECTION', null, '9,10,11,12', null, null, '9'),
(913, 'allowiOSVersionNumberMinor', 'INTEGER', null, null, null, null, '3'),
(914, 'allowiOSVersionNumberPatch', 'INTEGER', null, null, null, null, '5'),
(915, 'browserURLSalt', 'CHECKBOX', null, null, null, null, 'true'),
(916, 'examKeySalt', 'TEXT_FIELD', null, null, null, null, null),
(917, 'browserUserAgentiOS', 'SINGLE_SELECTION', null, '0,1,2,3', null, null, '0'),
(918, 'browserUserAgentiOSCustom', 'TEXT_FIELD', null, null, null, null, ''),
(919, 'browserWindowShowURL', 'SINGLE_SELECTION', null, '0,1,2,3', null, null, '0'),
(920, 'mobileAllowQRCodeConfig', 'CHECKBOX', null, null, null, null, 'false'),
(921, 'mobileAllowSingleAppMode', 'CHECKBOX', null, null, null, null, 'false'),
(922, 'mobileEnableASAM', 'CHECKBOX', null, null, null, null, 'true'),
(923, 'mobileEnableGuidedAccessLinkTransform', 'CHECKBOX', null, null, null, null, 'false'),
(924, 'mobilePreventAutoLock', 'CHECKBOX', null, null, null, null, 'true'),
(925, 'mobileShowSettings', 'CHECKBOX', null, null, null, null, 'false'),
(926, 'mobileStatusBarAppearance', 'SINGLE_SELECTION', null, '0,1,2', null, null, '1'),
(927, 'mobileStatusBarAppearanceExtended', 'SINGLE_SELECTION', null, '0,1,2,3,4', null, null, '1'),
(928, 'newBrowserWindowShowURL', 'SINGLE_SELECTION', null, '0,1,2,3', null, null, '1'),
(929, 'pinEmbeddedCertificates', 'CHECKBOX', null, null, null, null, 'false'),
(930, 'sendBrowserExamKey', 'CHECKBOX', null, null, null, null, 'false'),
(931, 'showNavigationButtons', 'CHECKBOX', null, null, null, null, 'false'),
(932, 'showScanQRCodeButton', 'CHECKBOX', null, null, null, null, 'false'),
(933, 'startResource', 'TEXT_FIELD', null, null, null, null, ''),
(1000, 'originatorVersion', 'TEXT_FIELD', null, null, null, null, 'SEB_Server_0.3.0'),
(1001, 'sebConfigPurpose', 'RADIO_SELECTION', null, '0,1', null, null, '0')

View file

@ -249,6 +249,41 @@ INSERT IGNORE INTO configuration_attribute VALUES
(812, 'allowWlan', 'CHECKBOX', null, null, null, null, 'false'),
(813, 'hookKeys', 'CHECKBOX', null, null, null, null, 'true'),
(900, 'examSessionClearCookiesOnEnd', 'CHECKBOX', null, null, null, null, 'false'),
(901, 'examSessionClearCookiesOnStart', 'CHECKBOX', null, null, null, null, 'false'),
(902, 'showBackToStartButton', 'CHECKBOX', null, null, null, null, 'true'),
(903, 'showSettingsInApp', 'CHECKBOX', null, null, null, null, 'false'),
(904, 'browserUserAgentWinTouchModeIPad', 'TEXT_FIELD', null, null, null, null, 'Mozilla/5.0 (iPad; CPU OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1'),
(905, 'mobileAllowPictureInPictureMediaPlayback', 'CHECKBOX', null, null, null, null, 'false'),
(906, 'lockOnMessageSocketClose', 'CHECKBOX', null, null, null, null, 'false'),
(907, 'enableDrawingEditor', 'CHECKBOX', null, null, null, null, 'false'),
(908, 'URLFilterMessage', 'RADIO_SELECTION', null, '0,1', null, null, '0'),
(909, 'allowDictation', 'CHECKBOX', null, null, null, null, 'false'),
(910, 'allowUserSwitching', 'CHECKBOX', null, null, null, null, 'false'),
(911, 'allowiOSBetaVersionNumber', 'SINGLE_SELECTION', null, '0,12', null, null, '0'),
(912, 'allowiOSVersionNumberMajor', 'SINGLE_SELECTION', null, '9,10,11,12', null, null, '9'),
(913, 'allowiOSVersionNumberMinor', 'INTEGER', null, null, null, null, '3'),
(914, 'allowiOSVersionNumberPatch', 'INTEGER', null, null, null, null, '5'),
(915, 'browserURLSalt', 'CHECKBOX', null, null, null, null, 'true'),
(916, 'examKeySalt', 'TEXT_FIELD', null, null, null, null, null),
(917, 'browserUserAgentiOS', 'SINGLE_SELECTION', null, '0,1,2,3', null, null, '0'),
(918, 'browserUserAgentiOSCustom', 'TEXT_FIELD', null, null, null, null, ''),
(919, 'browserWindowShowURL', 'SINGLE_SELECTION', null, '0,1,2,3', null, null, '0'),
(920, 'mobileAllowQRCodeConfig', 'CHECKBOX', null, null, null, null, 'false'),
(921, 'mobileAllowSingleAppMode', 'CHECKBOX', null, null, null, null, 'false'),
(922, 'mobileEnableASAM', 'CHECKBOX', null, null, null, null, 'true'),
(923, 'mobileEnableGuidedAccessLinkTransform', 'CHECKBOX', null, null, null, null, 'false'),
(924, 'mobilePreventAutoLock', 'CHECKBOX', null, null, null, null, 'true'),
(925, 'mobileShowSettings', 'CHECKBOX', null, null, null, null, 'false'),
(926, 'mobileStatusBarAppearance', 'SINGLE_SELECTION', null, '0,1,2', null, null, '1'),
(927, 'mobileStatusBarAppearanceExtended', 'SINGLE_SELECTION', null, '0,1,2,3,4', null, null, '1'),
(928, 'newBrowserWindowShowURL', 'SINGLE_SELECTION', null, '0,1,2,3', null, null, '1'),
(929, 'pinEmbeddedCertificates', 'CHECKBOX', null, null, null, null, 'false'),
(930, 'sendBrowserExamKey', 'CHECKBOX', null, null, null, null, 'false'),
(931, 'showNavigationButtons', 'CHECKBOX', null, null, null, null, 'false'),
(932, 'showScanQRCodeButton', 'CHECKBOX', null, null, null, null, 'false'),
(933, 'startResource', 'TEXT_FIELD', null, null, null, null, ''),
(1000, 'originatorVersion', 'TEXT_FIELD', null, null, null, null, 'SEB_Server_0.3.0'),
(1001, 'sebConfigPurpose', 'RADIO_SELECTION', null, '0,1', null, null, '0')

View file

@ -257,6 +257,41 @@ INSERT IGNORE INTO configuration_attribute VALUES
(812, 'allowWlan', 'CHECKBOX', null, null, null, null, 'false'),
(813, 'hookKeys', 'CHECKBOX', null, null, null, null, 'true'),
(900, 'examSessionClearCookiesOnEnd', 'CHECKBOX', null, null, null, null, 'false'),
(901, 'examSessionClearCookiesOnStart', 'CHECKBOX', null, null, null, null, 'false'),
(902, 'showBackToStartButton', 'CHECKBOX', null, null, null, null, 'true'),
(903, 'showSettingsInApp', 'CHECKBOX', null, null, null, null, 'false'),
(904, 'browserUserAgentWinTouchModeIPad', 'TEXT_FIELD', null, null, null, null, 'Mozilla/5.0 (iPad; CPU OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1'),
(905, 'mobileAllowPictureInPictureMediaPlayback', 'CHECKBOX', null, null, null, null, 'false'),
(906, 'lockOnMessageSocketClose', 'CHECKBOX', null, null, null, null, 'false'),
(907, 'enableDrawingEditor', 'CHECKBOX', null, null, null, null, 'false'),
(908, 'URLFilterMessage', 'RADIO_SELECTION', null, '0,1', null, null, '0'),
(909, 'allowDictation', 'CHECKBOX', null, null, null, null, 'false'),
(910, 'allowUserSwitching', 'CHECKBOX', null, null, null, null, 'false'),
(911, 'allowiOSBetaVersionNumber', 'SINGLE_SELECTION', null, '0,12', null, null, '0'),
(912, 'allowiOSVersionNumberMajor', 'SINGLE_SELECTION', null, '9,10,11,12', null, null, '9'),
(913, 'allowiOSVersionNumberMinor', 'INTEGER', null, null, null, null, '3'),
(914, 'allowiOSVersionNumberPatch', 'INTEGER', null, null, null, null, '5'),
(915, 'browserURLSalt', 'CHECKBOX', null, null, null, null, 'true'),
(916, 'examKeySalt', 'TEXT_FIELD', null, null, null, null, null),
(917, 'browserUserAgentiOS', 'SINGLE_SELECTION', null, '0,1,2,3', null, null, '0'),
(918, 'browserUserAgentiOSCustom', 'TEXT_FIELD', null, null, null, null, ''),
(919, 'browserWindowShowURL', 'SINGLE_SELECTION', null, '0,1,2,3', null, null, '0'),
(920, 'mobileAllowQRCodeConfig', 'CHECKBOX', null, null, null, null, 'false'),
(921, 'mobileAllowSingleAppMode', 'CHECKBOX', null, null, null, null, 'false'),
(922, 'mobileEnableASAM', 'CHECKBOX', null, null, null, null, 'true'),
(923, 'mobileEnableGuidedAccessLinkTransform', 'CHECKBOX', null, null, null, null, 'false'),
(924, 'mobilePreventAutoLock', 'CHECKBOX', null, null, null, null, 'true'),
(925, 'mobileShowSettings', 'CHECKBOX', null, null, null, null, 'false'),
(926, 'mobileStatusBarAppearance', 'SINGLE_SELECTION', null, '0,1,2', null, null, '1'),
(927, 'mobileStatusBarAppearanceExtended', 'SINGLE_SELECTION', null, '0,1,2,3,4', null, null, '1'),
(928, 'newBrowserWindowShowURL', 'SINGLE_SELECTION', null, '0,1,2,3', null, null, '1'),
(929, 'pinEmbeddedCertificates', 'CHECKBOX', null, null, null, null, 'false'),
(930, 'sendBrowserExamKey', 'CHECKBOX', null, null, null, null, 'false'),
(931, 'showNavigationButtons', 'CHECKBOX', null, null, null, null, 'false'),
(932, 'showScanQRCodeButton', 'CHECKBOX', null, null, null, null, 'false'),
(933, 'startResource', 'TEXT_FIELD', null, null, null, null, ''),
(1000, 'originatorVersion', 'TEXT_FIELD', null, null, null, null, 'SEB_Server_0.3.0'),
(1001, 'sebConfigPurpose', 'RADIO_SELECTION', null, '0,1', null, null, '0')