added new fields to Exam Config

This commit is contained in:
anhefti 2019-10-15 08:39:05 +02:00
parent 258ba2939f
commit d22213a6fb
8 changed files with 74 additions and 12 deletions

View file

@ -242,7 +242,7 @@ public class ExamConfigImportHandler extends DefaultHandler {
final ConfigurationAttribute attribute = this.attributeResolver.apply(attrName); final ConfigurationAttribute attribute = this.attributeResolver.apply(attrName);
if (attribute == null) { if (attribute == null) {
log.warn("*********************** Save null value: {}", attrName); log.warn("Import of unknown attribute. name={} value={}", attrName, top.value);
return; return;
} }
@ -270,11 +270,11 @@ public class ExamConfigImportHandler extends DefaultHandler {
} }
if (value == null) { if (value == null) {
log.warn("*********************** Save null value: {}", name); log.debug("*********************** Save null value: {}", name);
} else if (StringUtils.isBlank(value)) { } else if (StringUtils.isBlank(value)) {
log.warn("*********************** Save blank value: {}", name); log.debug("*********************** Save blank value: {}", name);
} else { } else {
log.warn("*********************** Save value value: {} : {}", name, value); log.debug("*********************** Save value value: {} : {}", name, value);
} }
final ConfigurationValue configurationValue = new ConfigurationValue( final ConfigurationValue configurationValue = new ConfigurationValue(

View file

@ -16,6 +16,7 @@ import java.util.HashSet;
import java.util.Set; import java.util.Set;
import java.util.function.Function; import java.util.function.Function;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -68,11 +69,16 @@ public class BooleanConverter implements AttributeValueConverter {
final ConfigurationValue value, final ConfigurationValue value,
final String template) throws IOException { final String template) throws IOException {
String defaultValue = attribute.getDefaultValue();
if (StringUtils.isBlank(defaultValue)) {
defaultValue = Constants.FALSE_STRING;
}
out.write(Utils.toByteArray( out.write(Utils.toByteArray(
String.format( String.format(
template, template,
extractName(attribute), extractName(attribute),
(value.value != null) ? value.value : Constants.FALSE_STRING))); (value != null && value.value != null) ? value.value : defaultValue)));
} }
} }

View file

@ -92,10 +92,10 @@ public class KioskModeConverter implements AttributeValueConverter {
final String template) throws IOException { final String template) throws IOException {
final String val = (ATTR_NAME_CREATE_NEW_DESKTOP.equals(name)) final String val = (ATTR_NAME_CREATE_NEW_DESKTOP.equals(name))
? value.getValue() == null || "0".equals(value.getValue()) ? value == null || value.getValue() == null || "0".equals(value.getValue())
? Constants.TRUE_STRING ? Constants.TRUE_STRING
: Constants.FALSE_STRING : Constants.FALSE_STRING
: value.getValue() == null || "0".equals(value.getValue()) : value == null || value.getValue() == null || "0".equals(value.getValue())
? Constants.FALSE_STRING ? Constants.FALSE_STRING
: Constants.TRUE_STRING; : Constants.TRUE_STRING;

View file

@ -84,7 +84,7 @@ public class StringConverter implements AttributeValueConverter {
final String template, final String template,
final String emptyTemplate) throws IOException { final String emptyTemplate) throws IOException {
final String val = (value.value != null) ? value.value : attribute.getDefaultValue(); final String val = (value != null && value.value != null) ? value.value : attribute.getDefaultValue();
if (StringUtils.isNotBlank(val)) { if (StringUtils.isNotBlank(val)) {
out.write(Utils.toByteArray(String.format( out.write(Utils.toByteArray(String.format(
template, template,

View file

@ -159,6 +159,7 @@ INSERT IGNORE INTO configuration_attribute VALUES
(99, 'prohibitedProcesses.identifier', 'TEXT_FIELD', 93, null, null, null, ''), (99, 'prohibitedProcesses.identifier', 'TEXT_FIELD', 93, null, null, null, ''),
(100, 'prohibitedProcesses.strongKill', 'CHECKBOX', 93, null, null, null, 'false'), (100, 'prohibitedProcesses.strongKill', 'CHECKBOX', 93, null, null, null, 'false'),
(101, 'prohibitedProcesses.currentUser', 'CHECKBOX', 93, null, null, null, 'false'), (101, 'prohibitedProcesses.currentUser', 'CHECKBOX', 93, null, null, null, 'false'),
(102, 'prohibitedProcesses.user', 'TEXT_FIELD', 93, null, null, null, null),
(200, 'URLFilterEnable', 'CHECKBOX', null, null, null, null, 'false'), (200, 'URLFilterEnable', 'CHECKBOX', null, null, null, null, 'false'),
(201, 'URLFilterEnableContentFilter', 'CHECKBOX', null, null, null, null, 'false'), (201, 'URLFilterEnableContentFilter', 'CHECKBOX', null, null, null, null, 'false'),
@ -261,10 +262,27 @@ INSERT IGNORE INTO configuration_attribute VALUES
(519, 'enableF11', 'CHECKBOX', null, null, null, null, 'false'), (519, 'enableF11', 'CHECKBOX', null, null, null, null, 'false'),
(520, 'enableF12', 'CHECKBOX', null, null, null, null, 'false'), (520, 'enableF12', 'CHECKBOX', null, null, null, null, 'false'),
(800, 'browserMessagingSocket', 'TEXT_FIELD', null, null, null, null, 'ws:\\localhost:8706'),
(801, 'browserMessagingPingTime', 'INTEGER', null, null, null, null, '120000'),
(802, 'allowPreferencesWindow', 'CHECKBOX', null, null, null, null, 'true'),
(803, 'useAsymmetricOnlyEncryption', 'CHECKBOX', null, null, null, null, 'false'),
(804, 'touchOptimized', 'CHECKBOX', null, null, null, null, 'false'),
(805, 'browserScreenKeyboard', 'CHECKBOX', null, null, null, null, 'false'),
(806, 'newBrowserWindowByScriptPolicy', 'INTEGER', null, null, null, null, '2'),
(807, 'newBrowserWindowByScriptBlockForeign', 'CHECKBOX', null, null, null, null, 'false'),
(808, 'monitorProcesses', 'CHECKBOX', null, null, null, null, 'false'),
(809, 'blacklistURLFilter', 'TEXT_FIELD', null, null, null, null, ''),
(810, 'whitelistURLFilter', 'TEXT_FIELD', null, null, null, null, ''),
(811, 'killExplorerShell', 'CHECKBOX', null, null, null, null, 'false'),
(812, 'allowWlan', 'CHECKBOX', null, null, null, null, 'false'),
(813, 'hookKeys', 'CHECKBOX', null, null, null, null, 'true'),
(1000, 'originatorVersion', 'TEXT_FIELD', null, null, null, null, 'SEB_Server_0.3.0'), (1000, 'originatorVersion', 'TEXT_FIELD', null, null, null, null, 'SEB_Server_0.3.0'),
(1001, 'sebConfigPurpose', 'RADIO_SELECTION', null, '0,1', null, null, '0') (1001, 'sebConfigPurpose', 'RADIO_SELECTION', null, '0,1', null, null, '0')
; ;
INSERT IGNORE INTO orientation VALUES INSERT IGNORE INTO orientation VALUES
(1, 1, 0, 1, null, 1, 1, 1, 2, 'LEFT'), (1, 1, 0, 1, null, 1, 1, 1, 2, 'LEFT'),
(2, 2, 0, 1, null, 1, 3, 1, 1, 'LEFT'), (2, 2, 0, 1, null, 1, 3, 1, 1, 'LEFT'),

View file

@ -132,6 +132,8 @@ INSERT IGNORE INTO configuration_attribute VALUES
(98, 'prohibitedProcesses.originalName', 'TEXT_FIELD', 93, null, null, null, ''), (98, 'prohibitedProcesses.originalName', 'TEXT_FIELD', 93, null, null, null, ''),
(99, 'prohibitedProcesses.identifier', 'TEXT_FIELD', 93, null, null, null, ''), (99, 'prohibitedProcesses.identifier', 'TEXT_FIELD', 93, null, null, null, ''),
(100, 'prohibitedProcesses.strongKill', 'CHECKBOX', 93, null, null, null, 'false'), (100, 'prohibitedProcesses.strongKill', 'CHECKBOX', 93, null, null, null, 'false'),
(101, 'prohibitedProcesses.currentUser', 'CHECKBOX', 93, null, null, null, 'false'),
(102, 'prohibitedProcesses.user', 'TEXT_FIELD', 93, null, null, null, null),
(200, 'URLFilterEnable', 'CHECKBOX', null, null, null, null, 'false'), (200, 'URLFilterEnable', 'CHECKBOX', null, null, null, null, 'false'),
(201, 'URLFilterEnableContentFilter', 'CHECKBOX', null, null, null, null, 'false'), (201, 'URLFilterEnableContentFilter', 'CHECKBOX', null, null, null, null, 'false'),
@ -234,8 +236,25 @@ INSERT IGNORE INTO configuration_attribute VALUES
(519, 'enableF11', 'CHECKBOX', null, null, null, null, 'false'), (519, 'enableF11', 'CHECKBOX', null, null, null, null, 'false'),
(520, 'enableF12', 'CHECKBOX', null, null, null, null, 'false'), (520, 'enableF12', 'CHECKBOX', null, null, null, null, 'false'),
(800, 'browserMessagingSocket', 'TEXT_FIELD', null, null, null, null, 'ws:\\localhost:8706'),
(801, 'browserMessagingPingTime', 'INTEGER', null, null, null, null, '120000'),
(802, 'allowPreferencesWindow', 'CHECKBOX', null, null, null, null, 'true'),
(803, 'useAsymmetricOnlyEncryption', 'CHECKBOX', null, null, null, null, 'false'),
(804, 'touchOptimized', 'CHECKBOX', null, null, null, null, 'false'),
(805, 'browserScreenKeyboard', 'CHECKBOX', null, null, null, null, 'false'),
(806, 'newBrowserWindowByScriptPolicy', 'INTEGER', null, null, null, null, '2'),
(807, 'newBrowserWindowByScriptBlockForeign', 'CHECKBOX', null, null, null, null, 'false'),
(808, 'monitorProcesses', 'CHECKBOX', null, null, null, null, 'false'),
(809, 'blacklistURLFilter', 'TEXT_FIELD', null, null, null, null, ''),
(810, 'whitelistURLFilter', 'TEXT_FIELD', null, null, null, null, ''),
(811, 'killExplorerShell', 'CHECKBOX', null, null, null, null, 'false'),
(812, 'allowWlan', 'CHECKBOX', null, null, null, null, 'false'),
(813, 'hookKeys', 'CHECKBOX', null, null, null, null, 'true'),
(1000, 'originatorVersion', 'TEXT_FIELD', null, null, null, null, 'SEB_Server_0.3.0'), (1000, 'originatorVersion', 'TEXT_FIELD', null, null, null, null, 'SEB_Server_0.3.0'),
(1001, 'sebConfigPurpose', 'RADIO_SELECTION', null, '0,1', null, null, '0') (1001, 'sebConfigPurpose', 'RADIO_SELECTION', null, '0,1', null, null, '0')
; ;
INSERT IGNORE INTO orientation VALUES INSERT IGNORE INTO orientation VALUES

View file

@ -139,6 +139,8 @@ INSERT IGNORE INTO configuration_attribute VALUES
(98, 'prohibitedProcesses.originalName', 'TEXT_FIELD', 93, null, null, null, ''), (98, 'prohibitedProcesses.originalName', 'TEXT_FIELD', 93, null, null, null, ''),
(99, 'prohibitedProcesses.identifier', 'TEXT_FIELD', 93, null, null, null, ''), (99, 'prohibitedProcesses.identifier', 'TEXT_FIELD', 93, null, null, null, ''),
(100, 'prohibitedProcesses.strongKill', 'CHECKBOX', 93, null, null, null, 'false'), (100, 'prohibitedProcesses.strongKill', 'CHECKBOX', 93, null, null, null, 'false'),
(101, 'prohibitedProcesses.currentUser', 'CHECKBOX', 93, null, null, null, 'false'),
(102, 'prohibitedProcesses.user', 'TEXT_FIELD', 93, null, null, null, null),
(200, 'URLFilterEnable', 'CHECKBOX', null, null, null, null, 'false'), (200, 'URLFilterEnable', 'CHECKBOX', null, null, null, null, 'false'),
(201, 'URLFilterEnableContentFilter', 'CHECKBOX', null, null, null, null, 'false'), (201, 'URLFilterEnableContentFilter', 'CHECKBOX', null, null, null, null, 'false'),
@ -146,7 +148,7 @@ INSERT IGNORE INTO configuration_attribute VALUES
(203, 'URLFilterRules.active', 'CHECKBOX', 202, null, null, null, 'true'), (203, 'URLFilterRules.active', 'CHECKBOX', 202, null, null, null, 'true'),
(204, 'URLFilterRules.regex', 'CHECKBOX', 202, null, null, null, 'false'), (204, 'URLFilterRules.regex', 'CHECKBOX', 202, null, null, null, 'false'),
(205, 'URLFilterRules.expression', 'TEXT_FIELD', 202, null, null, null, ''), (205, 'URLFilterRules.expression', 'TEXT_FIELD', 202, null, null, null, ''),
(206, 'URLFilterRules.action', 'SINGLE_SELECTION', 202, '0,1', null, null, ''), (206, 'URLFilterRules.action', 'SINGLE_SELECTION', 202, '0,1', null, null, '0'),
(210, 'proxySettingsPolicy', 'RADIO_SELECTION', null, '0,1', null, null, '0'), (210, 'proxySettingsPolicy', 'RADIO_SELECTION', null, '0,1', null, null, '0'),
(220, 'proxies', 'COMPOSITE_TABLE', null, 'active,TABLE_ENTRY|autoDiscovery,autoConfiguration,http,https,ftp,socks,rtsp', null, null, null), (220, 'proxies', 'COMPOSITE_TABLE', null, 'active,TABLE_ENTRY|autoDiscovery,autoConfiguration,http,https,ftp,socks,rtsp', null, null, null),
@ -241,10 +243,27 @@ INSERT IGNORE INTO configuration_attribute VALUES
(519, 'enableF11', 'CHECKBOX', null, null, null, null, 'false'), (519, 'enableF11', 'CHECKBOX', null, null, null, null, 'false'),
(520, 'enableF12', 'CHECKBOX', null, null, null, null, 'false'), (520, 'enableF12', 'CHECKBOX', null, null, null, null, 'false'),
(800, 'browserMessagingSocket', 'TEXT_FIELD', null, null, null, null, 'ws:\\localhost:8706'),
(801, 'browserMessagingPingTime', 'INTEGER', null, null, null, null, '120000'),
(802, 'allowPreferencesWindow', 'CHECKBOX', null, null, null, null, 'true'),
(803, 'useAsymmetricOnlyEncryption', 'CHECKBOX', null, null, null, null, 'false'),
(804, 'touchOptimized', 'CHECKBOX', null, null, null, null, 'false'),
(805, 'browserScreenKeyboard', 'CHECKBOX', null, null, null, null, 'false'),
(806, 'newBrowserWindowByScriptPolicy', 'INTEGER', null, null, null, null, '2'),
(807, 'newBrowserWindowByScriptBlockForeign', 'CHECKBOX', null, null, null, null, 'false'),
(808, 'monitorProcesses', 'CHECKBOX', null, null, null, null, 'false'),
(809, 'blacklistURLFilter', 'TEXT_FIELD', null, null, null, null, ''),
(810, 'whitelistURLFilter', 'TEXT_FIELD', null, null, null, null, ''),
(811, 'killExplorerShell', 'CHECKBOX', null, null, null, null, 'false'),
(812, 'allowWlan', 'CHECKBOX', null, null, null, null, 'false'),
(813, 'hookKeys', 'CHECKBOX', null, null, null, null, 'true'),
(1000, 'originatorVersion', 'TEXT_FIELD', null, null, null, null, 'SEB_Server_0.3.0'), (1000, 'originatorVersion', 'TEXT_FIELD', null, null, null, null, 'SEB_Server_0.3.0'),
(1001, 'sebConfigPurpose', 'RADIO_SELECTION', null, '0,1', null, null, '0') (1001, 'sebConfigPurpose', 'RADIO_SELECTION', null, '0,1', null, null, '0')
; ;
INSERT IGNORE INTO orientation VALUES INSERT IGNORE INTO orientation VALUES
(1, 1, 0, 1, null, 1, 1, 1, 2, 'LEFT'), (1, 1, 0, 1, null, 1, 1, 1, 2, 'LEFT'),
(2, 2, 0, 1, null, 1, 3, 1, 1, 'LEFT'), (2, 2, 0, 1, null, 1, 3, 1, 1, 'LEFT'),