diff --git a/docs/exam_config.rst b/docs/exam_config.rst index e8ef1ce5..082266e5 100644 --- a/docs/exam_config.rst +++ b/docs/exam_config.rst @@ -225,6 +225,8 @@ SEB Setting Differences In the current version (1.0) of SEB Server, there are some differences to some SEB settings and also some SEB settings that are currently not available on the SEB Server. + + **SEB settings currently not supported by the SEB Server** - Start URL: Since SEB Server has already been contacted by a SEB client when downloading the exam configuration this is not used by the exam configuration on SEB Server. But this can be used as fallback URL in the Client Configuration. @@ -235,11 +237,12 @@ available on the SEB Server. - Browser Exam Key: There is currently no possibility to generate the Browser Exam Key on the SEB Server. But an already generated Browser Exam Key may be used within the SEB restriction feature on the exam configuration if this feature is supported by the LMS in use. - **SEB settings that has a slightly different form or handling in SEB Server comparing to the SEB configuration tool** - Download Directory OSX: Since it is not possible within a web-service to choose a local directory on a remote device this is just a text input where one has to give the full-path to the directory on the client device in text form. - Log Directory OSX, Log Directory Win: Since it is not possible within a web-service to choose a local directory on a remote device this is just a text input where one has to give the full-path to the directory on the client device in text form. - Permitted Processes / Executable: This is also just a text input field where one can give the name of the process in text form. - +**SEB settings from versions before 3.0 that are not supported anymore** + - Permitted Processes / Window Handling Process + diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ExamConfigXMLParser.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ExamConfigXMLParser.java index 6838ed4e..436aecc9 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ExamConfigXMLParser.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ExamConfigXMLParser.java @@ -8,6 +8,21 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.impl; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; +import java.util.Stack; +import java.util.function.Consumer; +import java.util.function.Function; + +import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.StringEscapeUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xml.sax.Attributes; +import org.xml.sax.helpers.DefaultHandler; + import ch.ethz.seb.sebserver.gbl.Constants; import ch.ethz.seb.sebserver.gbl.model.sebconfig.AttributeType; import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationAttribute; @@ -15,19 +30,6 @@ import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationValue; import ch.ethz.seb.sebserver.gbl.util.Cryptor; import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.impl.ExamConfigXMLParser.PListNode.Type; import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.impl.converter.KioskModeConverter; -import org.apache.commons.lang3.BooleanUtils; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.xml.sax.Attributes; -import org.xml.sax.helpers.DefaultHandler; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; -import java.util.Stack; -import java.util.function.Consumer; -import java.util.function.Function; public class ExamConfigXMLParser extends DefaultHandler { @@ -86,8 +88,7 @@ public class ExamConfigXMLParser extends DefaultHandler { public static final Set PASSWORD_ATTRIBUTES = new HashSet<>(Arrays.asList( "hashedQuitPassword", - "hashedAdminPassword" - )); + "hashedAdminPassword")); private final Cryptor cryptor; private final Consumer valueConsumer; @@ -330,7 +331,8 @@ public class ExamConfigXMLParser extends DefaultHandler { // check if we have a simple values array if (attribute != null && (attribute.type == AttributeType.MULTI_CHECKBOX_SELECTION - || attribute.type == AttributeType.MULTI_SELECTION)) { + || attribute.type == AttributeType.MULTI_SELECTION + || attribute.type == AttributeType.TEXT_AREA)) { saveValue(attrName, attribute, top.listIndex, (top.value == null) ? "" : top.value); } @@ -389,7 +391,11 @@ public class ExamConfigXMLParser extends DefaultHandler { final String value = String.valueOf(valueChar); final PListNode top = this.stack.peek(); if (top.type == Type.VALUE_STRING) { - top.value = value; + if (top.value == null) { + top.value = StringEscapeUtils.unescapeXml(value); + } else { + top.value += StringEscapeUtils.unescapeXml(value); + } } else if (top.type == Type.VALUE_INTEGER) { top.value = value; } else if (top.type == Type.KEY) { @@ -450,7 +456,7 @@ public class ExamConfigXMLParser extends DefaultHandler { attribute.id, listIndex, StringUtils.isNotBlank(value) - ? cryptor.encrypt(value + Constants.IMPORTED_PASSWORD_MARKER).toString() + ? this.cryptor.encrypt(value + Constants.IMPORTED_PASSWORD_MARKER).toString() : value); } diff --git a/src/main/resources/config/initialPermittedProcesses.xml b/src/main/resources/config/initialPermittedProcesses.xml index f815e4ce..d5273951 100644 --- a/src/main/resources/config/initialPermittedProcesses.xml +++ b/src/main/resources/config/initialPermittedProcesses.xml @@ -9,8 +9,6 @@ allowUserToChooseApp - allowedExecutables - arguments autostart @@ -33,8 +31,6 @@ title SEB - windowHandlingProcess - originalName firefox.exe diff --git a/src/main/resources/config/sql/base/V2__insert_data_v1_0.sql b/src/main/resources/config/sql/base/V2__insert_data_v1_0.sql index afa5bbee..ff0c273e 100644 --- a/src/main/resources/config/sql/base/V2__insert_data_v1_0.sql +++ b/src/main/resources/config/sql/base/V2__insert_data_v1_0.sql @@ -98,7 +98,6 @@ INSERT INTO configuration_attribute VALUES (77, 'permittedProcesses.description', 'TEXT_FIELD', 73, null, null, null, ''), (78, 'permittedProcesses.executable', 'TEXT_FIELD', 73, null, null, null, ''), (79, 'permittedProcesses.originalName', 'TEXT_FIELD', 73, null, null, null, ''), - (80, 'permittedProcesses.allowedExecutables', 'TEXT_FIELD', 73, null, null, null, ''), (81, 'permittedProcesses.path', 'TEXT_FIELD', 73, null, null, null, ''), (82, 'permittedProcesses.arguments', 'INLINE_TABLE', 73, '1:active:CHECKBOX|4:argument:TEXT_FIELD', null, null, null), (85, 'permittedProcesses.identifier', 'TEXT_FIELD', 73, null, null, null, ''), @@ -364,7 +363,6 @@ INSERT INTO orientation VALUES (77, 77, 0, 6, null, 0, 3, 1, 1, 'LEFT'), (78, 78, 0, 6, null, 3, 4, 4, 1, 'LEFT'), (79, 79, 0, 6, null, 0, 5, 1, 1, 'LEFT'), - (80, 80, 0, 6, null, 0, 6, 1, 1, 'LEFT'), (81, 81, 0, 6, null, 0, 7, 1, 1, 'LEFT'), (82, 82, 0, 6, null, 0, 8, 1, 3, 'LEFT'), diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index f971dec3..fb444366 100644 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -892,7 +892,7 @@ sebserver.examconfig.props.label.browserUserAgentWinDesktopMode.1=Custom sebserver.examconfig.props.label.browserUserAgentWinDesktopMode.1.tooltip=Zoom only text on web pages using Ctrl-Mousewheel (Win) sebserver.examconfig.props.label.browserUserAgentWinDesktopModeCustom.tooltip=Custom desktop user agent string
(SEB appends its version number automatically) -sebserver.examconfig.props.group.userAgentTouch=User agent for touch/table mode +sebserver.examconfig.props.group.userAgentTouch=User agent for touch/tablet mode sebserver.examconfig.props.label.browserUserAgentWinTouchMode.0=Touch default sebserver.examconfig.props.label.browserUserAgentWinTouchMode.1=iPad sebserver.examconfig.props.label.browserUserAgentWinTouchMode.2=Custom @@ -953,7 +953,7 @@ sebserver.examconfig.props.label.permittedProcesses.active=Active sebserver.examconfig.props.label.permittedProcesses.active.tooltip=This permitted process item is active. sebserver.examconfig.props.label.permittedProcesses.os=OS sebserver.examconfig.props.label.permittedProcesses.os.tooltip=Indicates on which operating system the permitted process runs. -sebserver.examconfig.props.label.permittedProcesses.os.0=OS X +sebserver.examconfig.props.label.permittedProcesses.os.0=macOS sebserver.examconfig.props.label.permittedProcesses.os.1=Win sebserver.examconfig.props.label.permittedProcesses.title=Title sebserver.examconfig.props.label.permittedProcesses.title.tooltip=Application title which is displayed in the application chooser.
Background processes don't have a title, because they can't be selected by users. @@ -988,7 +988,7 @@ sebserver.examconfig.props.label.prohibitedProcesses=Prohibited Processes sebserver.examconfig.props.label.prohibitedProcesses.active=Active sebserver.examconfig.props.label.prohibitedProcesses.active.tooltip=Indicates if this prohibited process item is active. sebserver.examconfig.props.label.prohibitedProcesses.os=OS -sebserver.examconfig.props.label.prohibitedProcesses.os.0=OS X +sebserver.examconfig.props.label.prohibitedProcesses.os.0=macOS sebserver.examconfig.props.label.prohibitedProcesses.os.1=Win sebserver.examconfig.props.label.prohibitedProcesses.description=Description sebserver.examconfig.props.label.prohibitedProcesses.description.tooltip=Optional, to explain what kind of process this is,
because this might not be obvious only from the executable's name. diff --git a/src/test/java/ch/ethz/seb/sebserver/gui/integration/UseCasesIntegrationTest.java b/src/test/java/ch/ethz/seb/sebserver/gui/integration/UseCasesIntegrationTest.java index 8b550499..6bbbd703 100644 --- a/src/test/java/ch/ethz/seb/sebserver/gui/integration/UseCasesIntegrationTest.java +++ b/src/test/java/ch/ethz/seb/sebserver/gui/integration/UseCasesIntegrationTest.java @@ -1052,7 +1052,7 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest { assertNotNull(attributes); assertFalse(attributes.hasError()); final AttributeMapping attributeMapping = attributes.get(); - assertEquals(195, attributeMapping.attributeIdMapping.size()); + assertEquals(194, attributeMapping.attributeIdMapping.size()); assertEquals( "[active, audio, backToStart, browserSecurity, browserViewMode, exitSequence, functionKeys, kioskMode, logging, " + "macSettings, newBrowserWindow, newwinsize, proxies, quitLink, registry, servicePolicy, sessionHandling, " @@ -1716,7 +1716,7 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest { .getOrThrow(); assertNotNull(templateTrientations); assertFalse(templateTrientations.isEmpty()); - assertEquals(195, templateTrientations.size()); + assertEquals(194, templateTrientations.size()); // get template attributes page final Page templateAttributes = restService diff --git a/src/test/resources/data-test-additional.sql b/src/test/resources/data-test-additional.sql index ea2a7a9d..e5ead1b6 100644 --- a/src/test/resources/data-test-additional.sql +++ b/src/test/resources/data-test-additional.sql @@ -121,7 +121,6 @@ INSERT IGNORE INTO configuration_attribute VALUES (77, 'permittedProcesses.description', 'TEXT_FIELD', 73, null, null, null, ''), (78, 'permittedProcesses.executable', 'TEXT_FIELD', 73, null, null, null, ''), (79, 'permittedProcesses.originalName', 'TEXT_FIELD', 73, null, null, null, ''), - (80, 'permittedProcesses.allowedExecutables', 'TEXT_FIELD', 73, null, null, null, ''), (81, 'permittedProcesses.path', 'TEXT_FIELD', 73, null, null, null, ''), (82, 'permittedProcesses.arguments', 'INLINE_TABLE', 73, '1:active:CHECKBOX|4:argument:TEXT_FIELD', null, null, null), (85, 'permittedProcesses.identifier', 'TEXT_FIELD', 73, null, null, null, ''), @@ -387,7 +386,6 @@ INSERT IGNORE INTO orientation VALUES (77, 77, 0, 6, null, 0, 3, 1, 1, 'LEFT'), (78, 78, 0, 6, null, 3, 4, 4, 1, 'LEFT'), (79, 79, 0, 6, null, 0, 5, 1, 1, 'LEFT'), - (80, 80, 0, 6, null, 0, 6, 1, 1, 'LEFT'), (81, 81, 0, 6, null, 0, 7, 1, 1, 'LEFT'), (82, 82, 0, 6, null, 0, 8, 1, 3, 'LEFT'),