diff --git a/README.rst b/README.rst
index 47bd8aa7..49870279 100644
--- a/README.rst
+++ b/README.rst
@@ -1,11 +1,22 @@
+Master:
.. image:: https://travis-ci.com/SafeExamBrowser/seb-server.svg?branch=master
:target: https://travis-ci.com/SafeExamBrowser/seb-server
-.. image:: https://codecov.io/gh/SafeExamBrowser/seb-server/branch/master/graph/badge.svg
- :target: https://codecov.io/gh/SafeExamBrowser/seb-server
.. image:: https://readthedocs.org/projects/seb-server/badge/?version=latest
:target: https://seb-server.readthedocs.io/en/latest/?badge=latest
- :alt: Documentation Status
+.. image:: https://codecov.io/gh/SafeExamBrowser/seb-server/branch/master/graph/badge.svg
+ :target: https://codecov.io/gh/SafeExamBrowser/seb-server
+.. image:: https://img.shields.io/github/languages/code-size/SafeExamBrowser/seb-server
+ :target: https://github.com/SafeExamBrowser/seb-server
+
+Development:
+
+.. image:: https://travis-ci.com/SafeExamBrowser/seb-server.svg?branch=development
+ :target: https://github.com/SafeExamBrowser/seb-server/tree/development
+.. image:: https://codecov.io/gh/SafeExamBrowser/seb-server/branch/development/graph/badge.svg
+ :target: https://codecov.io/gh/SafeExamBrowser/seb-server
+.. image:: https://img.shields.io/github/last-commit/SafeExamBrowser/seb-server/development?logo=github
+ :target: https://github.com/SafeExamBrowser/seb-server/tree/development
What is Safe Exam Browser (SEB)?
--------------------------------
diff --git a/codecov.yml b/codecov.yml
index de337b64..ca7d26f9 100644
--- a/codecov.yml
+++ b/codecov.yml
@@ -1,7 +1,7 @@
coverage:
- range: "40...75"
- round: down
precision: 2
+ round: down
+ range: "40...100"
fixes:
-"::seb-server/"
diff --git a/pom.xml b/pom.xml
index 73a5f3a7..4c45f724 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,7 +18,7 @@
jar
- 1.0.1-SNAPSHOT
+ 1.0.2-SNAPSHOT
${sebserver-version}
UTF-8
UTF-8
diff --git a/src/main/java/ch/ethz/seb/sebserver/ClientHttpRequestFactoryService.java b/src/main/java/ch/ethz/seb/sebserver/ClientHttpRequestFactoryService.java
index eb8cf754..6e69a81e 100644
--- a/src/main/java/ch/ethz/seb/sebserver/ClientHttpRequestFactoryService.java
+++ b/src/main/java/ch/ethz/seb/sebserver/ClientHttpRequestFactoryService.java
@@ -45,12 +45,12 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ResourceUtils;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentialService;
+import ch.ethz.seb.sebserver.gbl.client.ProxyData;
import ch.ethz.seb.sebserver.gbl.profile.GuiProfile;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.gbl.util.Utils;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentialService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ProxyData;
@Lazy
@Service
diff --git a/src/main/java/ch/ethz/seb/sebserver/SEBServerInit.java b/src/main/java/ch/ethz/seb/sebserver/SEBServerInit.java
index 5936b75e..8a704889 100644
--- a/src/main/java/ch/ethz/seb/sebserver/SEBServerInit.java
+++ b/src/main/java/ch/ethz/seb/sebserver/SEBServerInit.java
@@ -12,12 +12,11 @@ import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
-import ch.ethz.seb.sebserver.webservice.WebserviceInfo;
-
@Lazy
@Component
public class SEBServerInit {
@@ -25,13 +24,15 @@ public class SEBServerInit {
public static final Logger INIT_LOGGER = LoggerFactory.getLogger("ch.ethz.seb.SEB_SERVER_INIT");
private final Environment environment;
- private final WebserviceInfo webserviceInfo;
+ private final String version;
private boolean initialized = false;
- protected SEBServerInit(final Environment environment, final WebserviceInfo webserviceInfo) {
+ protected SEBServerInit(
+ final Environment environment,
+ @Value("${sebserver.version}") final String version) {
this.environment = environment;
- this.webserviceInfo = webserviceInfo;
+ this.version = version;
}
public void init() {
@@ -43,7 +44,7 @@ public class SEBServerInit {
INIT_LOGGER.info("----> |___/|___||___/ |___/\\___||_| \\_/ \\___||_| ");
INIT_LOGGER.info("---->");
INIT_LOGGER.info("---->");
- INIT_LOGGER.info("----> Version: {}", this.webserviceInfo.getSebServerVersion());
+ INIT_LOGGER.info("----> Version: {}", this.version);
INIT_LOGGER.info("---->");
INIT_LOGGER.info("----> Active profiles: {}", Arrays.toString(this.environment.getActiveProfiles()));
INIT_LOGGER.info("---->");
@@ -51,5 +52,4 @@ public class SEBServerInit {
this.initialized = true;
}
}
-
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/client/ClientCredentialService.java b/src/main/java/ch/ethz/seb/sebserver/gbl/client/ClientCredentialService.java
similarity index 98%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/client/ClientCredentialService.java
rename to src/main/java/ch/ethz/seb/sebserver/gbl/client/ClientCredentialService.java
index 386d861b..6614b6b5 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/client/ClientCredentialService.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gbl/client/ClientCredentialService.java
@@ -6,7 +6,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-package ch.ethz.seb.sebserver.webservice.servicelayer.client;
+package ch.ethz.seb.sebserver.gbl.client;
import ch.ethz.seb.sebserver.gbl.util.Result;
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/client/ClientCredentialServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/gbl/client/ClientCredentialServiceImpl.java
similarity index 97%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/client/ClientCredentialServiceImpl.java
rename to src/main/java/ch/ethz/seb/sebserver/gbl/client/ClientCredentialServiceImpl.java
index 525ab263..12e23887 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/client/ClientCredentialServiceImpl.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gbl/client/ClientCredentialServiceImpl.java
@@ -6,7 +6,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-package ch.ethz.seb.sebserver.webservice.servicelayer.client;
+package ch.ethz.seb.sebserver.gbl.client;
import java.nio.CharBuffer;
import java.security.SecureRandom;
@@ -19,13 +19,11 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
-import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Cryptor;
import ch.ethz.seb.sebserver.gbl.util.Result;
@Lazy
@Service
-@WebServiceProfile
public class ClientCredentialServiceImpl implements ClientCredentialService {
private static final Logger log = LoggerFactory.getLogger(ClientCredentialServiceImpl.class);
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/client/ClientCredentials.java b/src/main/java/ch/ethz/seb/sebserver/gbl/client/ClientCredentials.java
similarity index 93%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/client/ClientCredentials.java
rename to src/main/java/ch/ethz/seb/sebserver/gbl/client/ClientCredentials.java
index d25d6f89..5aac3b34 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/client/ClientCredentials.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gbl/client/ClientCredentials.java
@@ -6,7 +6,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-package ch.ethz.seb.sebserver.webservice.servicelayer.client;
+package ch.ethz.seb.sebserver.gbl.client;
/** Defines a simple data bean holding (encrypted) client credentials */
public final class ClientCredentials {
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/client/ProxyData.java b/src/main/java/ch/ethz/seb/sebserver/gbl/client/ProxyData.java
similarity index 92%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/client/ProxyData.java
rename to src/main/java/ch/ethz/seb/sebserver/gbl/client/ProxyData.java
index 57467704..1edfd3c5 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/client/ProxyData.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gbl/client/ProxyData.java
@@ -6,7 +6,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-package ch.ethz.seb.sebserver.webservice.servicelayer.client;
+package ch.ethz.seb.sebserver.gbl.client;
public class ProxyData {
diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/EntityKey.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/EntityKey.java
index ad785589..cc8a5cac 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/EntityKey.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/EntityKey.java
@@ -18,15 +18,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import ch.ethz.seb.sebserver.gbl.api.EntityType;
-/** A EntityKey uniquely identifies a domain entity within the SEB Server's domain model.
- * A EntityKey consists of the model identifier of a domain entity and the type of the entity.
- * JSON:
- *
- *
- *
- *
- *
- * */
+/** An EntityKey uniquely identifies a domain entity within the SEB Server's domain model.
+ * An EntityKey consists of the model identifier of a domain entity and the type of the entity. */
@JsonIgnoreProperties(ignoreUnknown = true)
public class EntityKey implements ModelIdAware, Serializable {
diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Exam.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Exam.java
index a5881ee4..193cbab1 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Exam.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/Exam.java
@@ -179,7 +179,6 @@ public final class Exam implements GrantEntity {
EXAM.ATTR_STATUS,
ExamStatus.class,
getStatusFromDate(this.startTime, this.endTime));
-// this.lmsSebRestriction = mapper.getBoolean(EXAM.ATTR_LMS_SEB_RESTRICTION);
this.browserExamKeys = mapper.getString(EXAM.ATTR_BROWSER_KEYS);
this.active = mapper.getBoolean(EXAM.ATTR_ACTIVE);
this.supporter = mapper.getStringSet(EXAM.ATTR_SUPPORTER);
diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/OpenEdxSebRestriction.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/OpenEdxSEBRestriction.java
similarity index 97%
rename from src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/OpenEdxSebRestriction.java
rename to src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/OpenEdxSEBRestriction.java
index ebbacc24..6936c1fa 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/OpenEdxSebRestriction.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/OpenEdxSEBRestriction.java
@@ -25,7 +25,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import ch.ethz.seb.sebserver.gbl.Constants;
import ch.ethz.seb.sebserver.gbl.util.Utils;
-public class OpenEdxSebRestriction {
+public class OpenEdxSEBRestriction {
public static final String ATTR_USER_BANNING_ENABLED = "USER_BANNING_ENABLED";
public static final String ATTR_PERMISSION_COMPONENTS = "PERMISSION_COMPONENTS";
@@ -96,7 +96,7 @@ public class OpenEdxSebRestriction {
public final Boolean banningEnabled;
@JsonCreator
- OpenEdxSebRestriction(
+ OpenEdxSEBRestriction(
@JsonProperty(ATTR_CONFIG_KEYS) final Collection configKeys,
@JsonProperty(ATTR_BROWSER_KEYS) final Collection browserExamKeys,
@JsonProperty(ATTR_WHITELIST_PATHS) final Collection whiteListPaths,
@@ -155,7 +155,7 @@ public class OpenEdxSebRestriction {
return builder.toString();
}
- public static OpenEdxSebRestriction from(final SebRestriction sebRestrictionData) {
+ public static OpenEdxSEBRestriction from(final SEBRestriction sebRestrictionData) {
final String whiteListPathsString = sebRestrictionData.additionalProperties
.get(ATTR_WHITELIST_PATHS);
@@ -200,7 +200,7 @@ public class OpenEdxSebRestriction {
permissionComponents = Utils.immutableCollectionOf(defaultPermissions);
}
- return new OpenEdxSebRestriction(
+ return new OpenEdxSEBRestriction(
sebRestrictionData.configKeys,
sebRestrictionData.browserExamKeys,
whiteListPaths,
diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/SebRestriction.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/SEBRestriction.java
similarity index 90%
rename from src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/SebRestriction.java
rename to src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/SEBRestriction.java
index 1f066903..96acd23c 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/SebRestriction.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/SEBRestriction.java
@@ -26,7 +26,7 @@ import ch.ethz.seb.sebserver.gbl.model.Entity;
import ch.ethz.seb.sebserver.gbl.util.Utils;
@JsonIgnoreProperties(ignoreUnknown = true)
-public final class SebRestriction implements Entity {
+public final class SEBRestriction implements Entity {
public static final String ATTR_BROWSER_KEYS = "browserExamKeys";
public static final String ATTR_CONFIG_KEYS = "configKeys";
@@ -42,7 +42,7 @@ public final class SebRestriction implements Entity {
public final Map additionalProperties;
@JsonCreator
- public SebRestriction(
+ public SEBRestriction(
@JsonProperty(Domain.EXAM.ATTR_ID) final Long examId,
@JsonProperty(ATTR_CONFIG_KEYS) final Collection configKeys,
@JsonProperty(ATTR_BROWSER_KEYS) final Collection browserExamKeys,
@@ -107,7 +107,7 @@ public final class SebRestriction implements Entity {
return false;
if (getClass() != obj.getClass())
return false;
- final SebRestriction other = (SebRestriction) obj;
+ final SEBRestriction other = (SEBRestriction) obj;
if (this.additionalProperties == null) {
if (other.additionalProperties != null)
return false;
@@ -129,7 +129,7 @@ public final class SebRestriction implements Entity {
@Override
public String toString() {
final StringBuilder builder = new StringBuilder();
- builder.append("SebRestriction [examId=");
+ builder.append("SEBRestriction [examId=");
builder.append(this.examId);
builder.append(", configKeys=");
builder.append(this.configKeys);
@@ -141,32 +141,32 @@ public final class SebRestriction implements Entity {
return builder.toString();
}
- public static SebRestriction from(final Long examId, final OpenEdxSebRestriction edxData) {
+ public static SEBRestriction from(final Long examId, final OpenEdxSEBRestriction edxData) {
final Map attrs = new HashMap<>();
if (!CollectionUtils.isEmpty(edxData.whiteListPaths)) {
attrs.put(
- OpenEdxSebRestriction.ATTR_WHITELIST_PATHS,
+ OpenEdxSEBRestriction.ATTR_WHITELIST_PATHS,
StringUtils.join(edxData.whiteListPaths, Constants.LIST_SEPARATOR_CHAR));
}
if (!CollectionUtils.isEmpty(edxData.blacklistChapters)) {
attrs.put(
- OpenEdxSebRestriction.ATTR_BLACKLIST_CHAPTERS,
+ OpenEdxSEBRestriction.ATTR_BLACKLIST_CHAPTERS,
StringUtils.join(edxData.blacklistChapters, Constants.LIST_SEPARATOR_CHAR));
}
if (!CollectionUtils.isEmpty(edxData.permissionComponents)) {
attrs.put(
- OpenEdxSebRestriction.ATTR_PERMISSION_COMPONENTS,
+ OpenEdxSEBRestriction.ATTR_PERMISSION_COMPONENTS,
StringUtils.join(edxData.permissionComponents, Constants.LIST_SEPARATOR_CHAR));
}
attrs.put(
- OpenEdxSebRestriction.ATTR_USER_BANNING_ENABLED,
+ OpenEdxSEBRestriction.ATTR_USER_BANNING_ENABLED,
(edxData.banningEnabled) ? Constants.TRUE_STRING : Constants.FALSE_STRING);
- return new SebRestriction(
+ return new SEBRestriction(
examId,
edxData.configKeys,
edxData.browserExamKeys,
diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/sebconfig/SebClientConfig.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/sebconfig/SEBClientConfig.java
similarity index 97%
rename from src/main/java/ch/ethz/seb/sebserver/gbl/model/sebconfig/SebClientConfig.java
rename to src/main/java/ch/ethz/seb/sebserver/gbl/model/sebconfig/SEBClientConfig.java
index 7f4b3806..82013905 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/sebconfig/SebClientConfig.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/sebconfig/SEBClientConfig.java
@@ -28,7 +28,7 @@ import ch.ethz.seb.sebserver.gbl.model.Domain.SEB_CLIENT_CONFIGURATION;
import ch.ethz.seb.sebserver.gbl.model.Entity;
import ch.ethz.seb.sebserver.gbl.model.GrantEntity;
-public final class SebClientConfig implements GrantEntity, Activatable {
+public final class SEBClientConfig implements GrantEntity, Activatable {
public static final String ATTR_CONFIG_PURPOSE = "sebConfigPurpose";
public static final String ATTR_FALLBACK = "sebServerFallback ";
@@ -106,7 +106,7 @@ public final class SebClientConfig implements GrantEntity, Activatable {
public final Boolean active;
@JsonCreator
- public SebClientConfig(
+ public SEBClientConfig(
@JsonProperty(SEB_CLIENT_CONFIGURATION.ATTR_ID) final Long id,
@JsonProperty(SEB_CLIENT_CONFIGURATION.ATTR_INSTITUTION_ID) final Long institutionId,
@JsonProperty(SEB_CLIENT_CONFIGURATION.ATTR_NAME) final String name,
@@ -144,7 +144,7 @@ public final class SebClientConfig implements GrantEntity, Activatable {
this.active = active;
}
- public SebClientConfig(final Long institutionId, final POSTMapper postParams) {
+ public SEBClientConfig(final Long institutionId, final POSTMapper postParams) {
this.id = null;
this.institutionId = institutionId;
this.name = postParams.getString(Domain.SEB_CLIENT_CONFIGURATION.ATTR_NAME);
@@ -271,7 +271,7 @@ public final class SebClientConfig implements GrantEntity, Activatable {
@Override
public String toString() {
- final StringBuilder sb = new StringBuilder("SebClientConfig{");
+ final StringBuilder sb = new StringBuilder("SEBClientConfig{");
sb.append("id=").append(this.id);
sb.append(", institutionId=").append(this.institutionId);
sb.append(", name='").append(this.name).append('\'');
@@ -293,7 +293,7 @@ public final class SebClientConfig implements GrantEntity, Activatable {
@Override
public Entity printSecureCopy() {
- return new SebClientConfig(
+ return new SEBClientConfig(
this.id,
this.institutionId,
this.name,
@@ -313,8 +313,8 @@ public final class SebClientConfig implements GrantEntity, Activatable {
this.active);
}
- public static SebClientConfig createNew(final Long institutionId) {
- return new SebClientConfig(
+ public static SEBClientConfig createNew(final Long institutionId) {
+ return new SEBClientConfig(
null,
institutionId,
null,
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/GuiInit.java b/src/main/java/ch/ethz/seb/sebserver/gui/GuiInit.java
index 5a139167..4373f5bb 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/GuiInit.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/GuiInit.java
@@ -10,6 +10,7 @@ package ch.ethz.seb.sebserver.gui;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
+import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import ch.ethz.seb.sebserver.SEBServerInit;
@@ -20,9 +21,14 @@ import ch.ethz.seb.sebserver.gbl.profile.GuiProfile;
public class GuiInit implements ApplicationListener {
private final SEBServerInit sebServerInit;
+ private final Environment environment;
+
+ protected GuiInit(
+ final SEBServerInit sebServerInit,
+ final Environment environment) {
- protected GuiInit(final SEBServerInit sebServerInit) {
this.sebServerInit = sebServerInit;
+ this.environment = environment;
}
@Override
@@ -36,6 +42,29 @@ public class GuiInit implements ApplicationListener {
SEBServerInit.INIT_LOGGER.info("---->");
SEBServerInit.INIT_LOGGER.info("----> GUI Service successfully successfully started up!");
SEBServerInit.INIT_LOGGER.info("---->");
+
+ final String webServiceProtocol = this.environment.getProperty("sebserver.gui.webservice.protocol", "http");
+ final String webServiceAddress = this.environment.getRequiredProperty("sebserver.gui.webservice.address");
+ final String webServicePort = this.environment.getProperty("sebserver.gui.webservice.port", "80");
+
+ SEBServerInit.INIT_LOGGER.info("----> Webservice connection: " + webServiceProtocol + "://" + webServiceAddress
+ + ":" + webServicePort);
+
+ final String webServiceAdminAPIEndpoint =
+ this.environment.getRequiredProperty("sebserver.gui.webservice.apipath");
+ final String webServiceExamAPIEndpoint =
+ this.environment.getRequiredProperty("sebserver.webservice.api.exam.endpoint");
+
+ SEBServerInit.INIT_LOGGER.info("---->");
+ SEBServerInit.INIT_LOGGER.info("----> Webservice admin API endpoint: " + webServiceAdminAPIEndpoint);
+ SEBServerInit.INIT_LOGGER.info("----> Webservice exam API endpoint: " + webServiceExamAPIEndpoint);
+
+ final String webServiceAPIBasicAccess =
+ this.environment.getRequiredProperty("sebserver.webservice.api.admin.clientId");
+
+ SEBServerInit.INIT_LOGGER.info("---->");
+ SEBServerInit.INIT_LOGGER.info("----> Webservice admin API basic access: --" + webServiceAPIBasicAccess + "--");
+
}
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/ConfigTemplateForm.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/ConfigTemplateForm.java
index 71113434..76ebeb9f 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/ConfigTemplateForm.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/ConfigTemplateForm.java
@@ -141,7 +141,7 @@ public class ConfigTemplateForm implements TemplateComposer {
formContext.getParent(),
titleKey);
- // The SebClientConfig form
+ // The SEBClientConfig form
final FormHandle formHandle = this.pageService.formBuilder(
formContext.copyOf(content))
.readonly(isReadonly)
@@ -292,7 +292,7 @@ public class ConfigTemplateForm implements TemplateComposer {
.newAction(ActionDefinition.SEB_EXAM_CONFIG_TEMPLATE_CREATE_CONFIG)
.withEntityKey(entityKey)
- .withExec(SebExamConfigCreationPopup.configCreationFunction(
+ .withExec(SEBExamConfigCreationPopup.configCreationFunction(
this.pageService,
pageContext
.withAttribute(
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/ExamForm.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/ExamForm.java
index 31b4ece2..c9ab06dd 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/ExamForm.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/ExamForm.java
@@ -62,10 +62,10 @@ import ch.ethz.seb.sebserver.gui.service.page.TemplateComposer;
import ch.ethz.seb.sebserver.gui.service.page.event.ActionEvent;
import ch.ethz.seb.sebserver.gui.service.page.impl.PageAction;
import ch.ethz.seb.sebserver.gui.service.remote.download.DownloadService;
-import ch.ethz.seb.sebserver.gui.service.remote.download.SebExamConfigDownload;
+import ch.ethz.seb.sebserver.gui.service.remote.download.SEBExamConfigDownload;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestService;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.CheckExamConsistency;
-import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.CheckSebRestriction;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.CheckSEBRestriction;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.DeleteExamConfigMapping;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.DeleteIndicator;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.GetExam;
@@ -248,9 +248,9 @@ public class ExamForm implements TemplateComposer {
final boolean editable = examStatus == ExamStatus.UP_COMING
|| examStatus == ExamStatus.RUNNING
&& currentUser.get().hasRole(UserRole.EXAM_ADMIN);
- final boolean sebRestrictionAvailable = testSebRestrictionAPI(exam);
+ final boolean sebRestrictionAvailable = testSEBRestrictionAPI(exam);
final boolean isRestricted = readonly && sebRestrictionAvailable && this.restService
- .getBuilder(CheckSebRestriction.class)
+ .getBuilder(CheckSEBRestriction.class)
.withURIVariable(API.PARAM_MODEL_ID, exam.getModelId())
.call()
.onError(e -> log.error("Unexpected error while trying to verify seb restriction settings: ", e))
@@ -393,9 +393,9 @@ public class ExamForm implements TemplateComposer {
.newAction(ActionDefinition.EXAM_MODIFY_SEB_RESTRICTION_DETAILS)
.withEntityKey(entityKey)
- .withExec(ExamSebRestrictionSettings.settingsFunction(this.pageService))
+ .withExec(ExamSEBRestrictionSettings.settingsFunction(this.pageService))
.withAttribute(
- ExamSebRestrictionSettings.PAGE_CONTEXT_ATTR_LMS_TYPE,
+ ExamSEBRestrictionSettings.PAGE_CONTEXT_ATTR_LMS_TYPE,
this.restService.getBuilder(GetLmsSetup.class)
.withURIVariable(API.PARAM_MODEL_ID, String.valueOf(exam.lmsSetupId))
.call()
@@ -406,13 +406,13 @@ public class ExamForm implements TemplateComposer {
.newAction(ActionDefinition.EXAM_ENABLE_SEB_RESTRICTION)
.withEntityKey(entityKey)
- .withExec(action -> ExamSebRestrictionSettings.setSebRestriction(action, true, this.restService))
+ .withExec(action -> ExamSEBRestrictionSettings.setSEBRestriction(action, true, this.restService))
.publishIf(() -> sebRestrictionAvailable && readonly && modifyGrant && !importFromQuizData
&& BooleanUtils.isFalse(isRestricted))
.newAction(ActionDefinition.EXAM_DISABLE_SEB_RESTRICTION)
.withEntityKey(entityKey)
- .withExec(action -> ExamSebRestrictionSettings.setSebRestriction(action, false, this.restService))
+ .withExec(action -> ExamSEBRestrictionSettings.setSEBRestriction(action, false, this.restService))
.publishIf(() -> sebRestrictionAvailable && readonly && modifyGrant && !importFromQuizData
&& BooleanUtils.isTrue(isRestricted));
@@ -583,14 +583,14 @@ public class ExamForm implements TemplateComposer {
private PageAction importExam(
final PageAction action,
final FormHandle formHandle,
- final boolean applySebRestriction) {
+ final boolean applySEBRestriction) {
// process normal save first
final PageAction processFormSave = formHandle.processFormSave(action);
// when okay and the exam sebRestriction is true
- if (applySebRestriction) {
- ExamSebRestrictionSettings.setSebRestriction(
+ if (applySEBRestriction) {
+ ExamSEBRestrictionSettings.setSEBRestriction(
processFormSave,
true,
this.restService,
@@ -600,7 +600,7 @@ public class ExamForm implements TemplateComposer {
return processFormSave;
}
- private boolean testSebRestrictionAPI(final Exam exam) {
+ private boolean testSEBRestrictionAPI(final Exam exam) {
return this.restService.getBuilder(GetLmsSetup.class)
.withURIVariable(API.PARAM_MODEL_ID, String.valueOf(exam.lmsSetupId))
.call()
@@ -656,7 +656,7 @@ public class ExamForm implements TemplateComposer {
final String downloadURL = this.downloadService.createDownloadURL(
selection.modelId,
action.pageContext().getParentEntityKey().modelId,
- SebExamConfigDownload.class,
+ SEBExamConfigDownload.class,
this.downloadFileName);
urlLauncher.openURL(downloadURL);
}
@@ -701,7 +701,7 @@ public class ExamForm implements TemplateComposer {
final EntityKey examConfigMappingKey = action.getSingleSelection();
if (examConfigMappingKey != null) {
action.withEntityKey(examConfigMappingKey);
- return SebExamConfigForm
+ return SEBExamConfigForm
.getConfigKeyFunction(this.pageService)
.apply(action);
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/ExamList.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/ExamList.java
index dcdfa841..db82db77 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/ExamList.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/ExamList.java
@@ -134,7 +134,7 @@ public class ExamList implements TemplateComposer {
final PageActionBuilder actionBuilder = this.pageService
.pageActionBuilder(pageContext.clearEntityKeys());
- final BooleanSupplier isSebAdmin =
+ final BooleanSupplier isSEBAdmin =
() -> currentUser.get().hasRole(UserRole.SEB_SERVER_ADMIN);
final Function institutionNameFunction =
@@ -150,7 +150,7 @@ public class ExamList implements TemplateComposer {
.withStaticFilter(Exam.FILTER_ATTR_ACTIVE, Constants.TRUE_STRING)
.withColumnIf(
- isSebAdmin,
+ isSEBAdmin,
() -> new ColumnDefinition(
Domain.EXAM.ATTR_INSTITUTION_ID,
COLUMN_TITLE_INSTITUTION_KEY,
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/ExamSebRestrictionSettings.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/ExamSEBRestrictionSettings.java
similarity index 84%
rename from src/main/java/ch/ethz/seb/sebserver/gui/content/ExamSebRestrictionSettings.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/content/ExamSEBRestrictionSettings.java
index d94983ed..660212c1 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/ExamSebRestrictionSettings.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/ExamSEBRestrictionSettings.java
@@ -25,8 +25,8 @@ import ch.ethz.seb.sebserver.gbl.Constants;
import ch.ethz.seb.sebserver.gbl.api.API;
import ch.ethz.seb.sebserver.gbl.model.EntityKey;
import ch.ethz.seb.sebserver.gbl.model.exam.Chapters;
-import ch.ethz.seb.sebserver.gbl.model.exam.OpenEdxSebRestriction;
-import ch.ethz.seb.sebserver.gbl.model.exam.SebRestriction;
+import ch.ethz.seb.sebserver.gbl.model.exam.OpenEdxSEBRestriction;
+import ch.ethz.seb.sebserver.gbl.model.exam.SEBRestriction;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup.LmsType;
import ch.ethz.seb.sebserver.gbl.util.Tuple;
import ch.ethz.seb.sebserver.gbl.util.Utils;
@@ -41,13 +41,13 @@ import ch.ethz.seb.sebserver.gui.service.page.PageService;
import ch.ethz.seb.sebserver.gui.service.page.impl.ModalInputDialog;
import ch.ethz.seb.sebserver.gui.service.page.impl.PageAction;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestService;
-import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.ActivateSebRestriction;
-import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.DeactivateSebRestriction;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.ActivateSEBRestriction;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.DeactivateSEBRestriction;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.GetCourseChapters;
-import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.GetSebRestriction;
-import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.SaveSebRestriction;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.GetSEBRestriction;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.SaveSEBRestriction;
-public class ExamSebRestrictionSettings {
+public class ExamSEBRestrictionSettings {
private final static LocTextKey SEB_RESTRICTION_ERROR =
new LocTextKey("sebserver.error.exam.seb.restriction");
@@ -85,7 +85,7 @@ public class ExamSebRestrictionSettings {
.setDialogWidth(740)
.setDialogHeight(400);
- final SebRestrictionPropertiesForm bindFormContext = new SebRestrictionPropertiesForm(
+ final SEBRestrictionPropertiesForm bindFormContext = new SEBRestrictionPropertiesForm(
pageService,
action.pageContext());
@@ -117,30 +117,30 @@ public class ExamSebRestrictionSettings {
final EntityKey entityKey = pageContext.getEntityKey();
final LmsType lmsType = getLmsType(pageContext);
- SebRestriction bodyValue = null;
+ SEBRestriction bodyValue = null;
try {
final Form form = formHandle.getForm();
final Collection browserKeys = Utils.getListOfLines(
- form.getFieldValue(SebRestriction.ATTR_BROWSER_KEYS));
+ form.getFieldValue(SEBRestriction.ATTR_BROWSER_KEYS));
final Map additionalAttributes = new HashMap<>();
if (lmsType == LmsType.OPEN_EDX) {
additionalAttributes.put(
- OpenEdxSebRestriction.ATTR_PERMISSION_COMPONENTS,
- form.getFieldValue(OpenEdxSebRestriction.ATTR_PERMISSION_COMPONENTS));
+ OpenEdxSEBRestriction.ATTR_PERMISSION_COMPONENTS,
+ form.getFieldValue(OpenEdxSEBRestriction.ATTR_PERMISSION_COMPONENTS));
additionalAttributes.put(
- OpenEdxSebRestriction.ATTR_WHITELIST_PATHS,
- form.getFieldValue(OpenEdxSebRestriction.ATTR_WHITELIST_PATHS));
+ OpenEdxSEBRestriction.ATTR_WHITELIST_PATHS,
+ form.getFieldValue(OpenEdxSEBRestriction.ATTR_WHITELIST_PATHS));
additionalAttributes.put(
- OpenEdxSebRestriction.ATTR_USER_BANNING_ENABLED,
- form.getFieldValue(OpenEdxSebRestriction.ATTR_USER_BANNING_ENABLED));
+ OpenEdxSEBRestriction.ATTR_USER_BANNING_ENABLED,
+ form.getFieldValue(OpenEdxSEBRestriction.ATTR_USER_BANNING_ENABLED));
additionalAttributes.put(
- OpenEdxSebRestriction.ATTR_BLACKLIST_CHAPTERS,
+ OpenEdxSEBRestriction.ATTR_BLACKLIST_CHAPTERS,
Utils.convertCarriageReturnToListSeparator(
- form.getFieldValue(OpenEdxSebRestriction.ATTR_BLACKLIST_CHAPTERS)));
+ form.getFieldValue(OpenEdxSEBRestriction.ATTR_BLACKLIST_CHAPTERS)));
}
- bodyValue = new SebRestriction(
+ bodyValue = new SEBRestriction(
Long.parseLong(entityKey.modelId),
null,
browserKeys,
@@ -152,7 +152,7 @@ public class ExamSebRestrictionSettings {
return !pageService
.getRestService()
- .getBuilder(SaveSebRestriction.class)
+ .getBuilder(SaveSEBRestriction.class)
.withURIVariable(API.PARAM_MODEL_ID, entityKey.modelId)
.withBody(bodyValue)
.call()
@@ -160,13 +160,13 @@ public class ExamSebRestrictionSettings {
.hasError();
}
- private static final class SebRestrictionPropertiesForm
+ private static final class SEBRestrictionPropertiesForm
implements ModalInputDialogComposer> {
private final PageService pageService;
private final PageContext pageContext;
- protected SebRestrictionPropertiesForm(
+ protected SEBRestrictionPropertiesForm(
final PageService pageService,
final PageContext pageContext) {
@@ -188,8 +188,8 @@ public class ExamSebRestrictionSettings {
.getWidgetFactory()
.createPopupScrollComposite(parent);
- final SebRestriction sebRestriction = restService
- .getBuilder(GetSebRestriction.class)
+ final SEBRestriction sebRestriction = restService
+ .getBuilder(GetSEBRestriction.class)
.withURIVariable(API.PARAM_MODEL_ID, entityKey.modelId)
.call()
.getOrThrow();
@@ -205,7 +205,7 @@ public class ExamSebRestrictionSettings {
.copyOf(content)
.clearEntityKeys();
- final FormHandle formHandle = this.pageService.formBuilder(
+ final FormHandle formHandle = this.pageService.formBuilder(
formContext)
.withDefaultSpanInput(6)
.withEmptyCellSeparation(false)
@@ -220,14 +220,14 @@ public class ExamSebRestrictionSettings {
.readonly(true))
.addField(FormBuilder.text(
- SebRestriction.ATTR_CONFIG_KEYS,
+ SEBRestriction.ATTR_CONFIG_KEYS,
SEB_RESTRICTION_FORM_CONFIG_KEYS,
StringUtils.join(sebRestriction.getConfigKeys(), Constants.CARRIAGE_RETURN))
.asArea(50)
.readonly(true))
.addField(FormBuilder.text(
- SebRestriction.ATTR_BROWSER_KEYS,
+ SEBRestriction.ATTR_BROWSER_KEYS,
SEB_RESTRICTION_FORM_BROWSER_KEYS,
StringUtils.join(sebRestriction.getBrowserExamKeys(), Constants.CARRIAGE_RETURN))
.asArea())
@@ -235,31 +235,31 @@ public class ExamSebRestrictionSettings {
.addFieldIf(
() -> lmsType == LmsType.OPEN_EDX,
() -> FormBuilder.multiCheckboxSelection(
- OpenEdxSebRestriction.ATTR_WHITELIST_PATHS,
+ OpenEdxSEBRestriction.ATTR_WHITELIST_PATHS,
SEB_RESTRICTION_FORM_EDX_WHITE_LIST_PATHS,
sebRestriction.getAdditionalProperties()
- .get(OpenEdxSebRestriction.ATTR_WHITELIST_PATHS),
+ .get(OpenEdxSEBRestriction.ATTR_WHITELIST_PATHS),
resourceService::sebRestrictionWhiteListResources))
.addFieldIf(
() -> chapters == null && lmsType == LmsType.OPEN_EDX,
() -> FormBuilder.text(
- OpenEdxSebRestriction.ATTR_BLACKLIST_CHAPTERS,
+ OpenEdxSEBRestriction.ATTR_BLACKLIST_CHAPTERS,
SEB_RESTRICTION_FORM_EDX_BLACKLIST_CHAPTERS,
Utils.convertListSeparatorToCarriageReturn(
sebRestriction
.getAdditionalProperties()
- .get(OpenEdxSebRestriction.ATTR_BLACKLIST_CHAPTERS)))
+ .get(OpenEdxSEBRestriction.ATTR_BLACKLIST_CHAPTERS)))
.asArea())
.addFieldIf(
() -> chapters != null && lmsType == LmsType.OPEN_EDX,
() -> FormBuilder.multiCheckboxSelection(
- OpenEdxSebRestriction.ATTR_BLACKLIST_CHAPTERS,
+ OpenEdxSEBRestriction.ATTR_BLACKLIST_CHAPTERS,
SEB_RESTRICTION_FORM_EDX_BLACKLIST_CHAPTERS,
sebRestriction
.getAdditionalProperties()
- .get(OpenEdxSebRestriction.ATTR_BLACKLIST_CHAPTERS),
+ .get(OpenEdxSEBRestriction.ATTR_BLACKLIST_CHAPTERS),
() -> chapters.chapters
.stream()
.map(chapter -> new Tuple<>(chapter.id, chapter.name))
@@ -268,20 +268,20 @@ public class ExamSebRestrictionSettings {
.addFieldIf(
() -> lmsType == LmsType.OPEN_EDX,
() -> FormBuilder.multiCheckboxSelection(
- OpenEdxSebRestriction.ATTR_PERMISSION_COMPONENTS,
+ OpenEdxSEBRestriction.ATTR_PERMISSION_COMPONENTS,
SEB_RESTRICTION_FORM_EDX_PERMISSIONS,
sebRestriction.getAdditionalProperties()
- .get(OpenEdxSebRestriction.ATTR_PERMISSION_COMPONENTS),
+ .get(OpenEdxSEBRestriction.ATTR_PERMISSION_COMPONENTS),
resourceService::sebRestrictionPermissionResources))
.addFieldIf(
() -> lmsType == LmsType.OPEN_EDX,
() -> FormBuilder.checkbox(
- OpenEdxSebRestriction.ATTR_USER_BANNING_ENABLED,
+ OpenEdxSEBRestriction.ATTR_USER_BANNING_ENABLED,
SEB_RESTRICTION_FORM_EDX_USER_BANNING_ENABLED,
sebRestriction
.getAdditionalProperties()
- .get(OpenEdxSebRestriction.ATTR_USER_BANNING_ENABLED)))
+ .get(OpenEdxSEBRestriction.ATTR_USER_BANNING_ENABLED)))
.build();
@@ -298,27 +298,27 @@ public class ExamSebRestrictionSettings {
}
}
- public static PageAction setSebRestriction(
+ public static PageAction setSEBRestriction(
final PageAction action,
final boolean activateRestriction,
final RestService restService) {
- return setSebRestriction(
+ return setSEBRestriction(
action,
activateRestriction,
restService,
error -> action.pageContext().notifyError(SEB_RESTRICTION_ERROR, error));
}
- public static PageAction setSebRestriction(
+ public static PageAction setSEBRestriction(
final PageAction action,
final boolean activateRestriction,
final RestService restService,
final Consumer errorHandler) {
restService.getBuilder((activateRestriction)
- ? ActivateSebRestriction.class
- : DeactivateSebRestriction.class)
+ ? ActivateSEBRestriction.class
+ : DeactivateSEBRestriction.class)
.withURIVariable(
API.PARAM_MODEL_ID,
action.getEntityKey().modelId)
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/MonitoringClientConnection.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/MonitoringClientConnection.java
index 3ca8a2a3..310e3b3a 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/MonitoringClientConnection.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/MonitoringClientConnection.java
@@ -84,7 +84,7 @@ public class MonitoringClientConnection implements TemplateComposer {
private final ResourceService resourceService;
private final I18nSupport i18nSupport;
private final InstructionProcessor instructionProcessor;
- private final SebClientLogDetailsPopup sebClientLogDetailsPopup;
+ private final SEBClientLogDetailsPopup sebClientLogDetailsPopup;
private final long pollInterval;
private final int pageSize;
@@ -97,7 +97,7 @@ public class MonitoringClientConnection implements TemplateComposer {
final PageService pageService,
final ResourceService resourceService,
final InstructionProcessor instructionProcessor,
- final SebClientLogDetailsPopup sebClientLogDetailsPopup,
+ final SEBClientLogDetailsPopup sebClientLogDetailsPopup,
@Value("${sebserver.gui.webservice.poll-interval:500}") final long pollInterval,
@Value("${sebserver.gui.list.page.size:20}") final Integer pageSize) {
@@ -243,7 +243,7 @@ public class MonitoringClientConnection implements TemplateComposer {
.newAction(ActionDefinition.MONITOR_EXAM_CLIENT_CONNECTION_QUIT)
.withConfirm(() -> CONFIRM_QUIT)
.withExec(action -> {
- this.instructionProcessor.propagateSebQuitInstruction(
+ this.instructionProcessor.propagateSEBQuitInstruction(
exam.id,
connectionToken,
pageContext);
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/MonitoringRunningExam.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/MonitoringRunningExam.java
index 9eb2419d..ae8c311d 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/MonitoringRunningExam.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/MonitoringRunningExam.java
@@ -181,7 +181,7 @@ public class MonitoringRunningExam implements TemplateComposer {
.newAction(ActionDefinition.MONITOR_EXAM_QUIT_ALL)
.withEntityKey(entityKey)
.withConfirm(() -> CONFIRM_QUIT_ALL)
- .withExec(action -> this.quitSebClients(action, clientTable, true))
+ .withExec(action -> this.quitSEBClients(action, clientTable, true))
.noEventPropagation()
.publishIf(privilege)
@@ -190,7 +190,7 @@ public class MonitoringRunningExam implements TemplateComposer {
.withConfirm(() -> CONFIRM_QUIT_SELECTED)
.withSelect(
() -> this.selectionForQuitInstruction(clientTable),
- action -> this.quitSebClients(action, clientTable, false),
+ action -> this.quitSEBClients(action, clientTable, false),
EMPTY_ACTIVE_SELECTION_TEXT_KEY)
.noEventPropagation()
.publishIf(privilege, false)
@@ -200,7 +200,7 @@ public class MonitoringRunningExam implements TemplateComposer {
.withConfirm(() -> CONFIRM_DISABLE_SELECTED)
.withSelect(
clientTable::getSelection,
- action -> this.disableSebClients(action, clientTable, false),
+ action -> this.disableSEBClients(action, clientTable, false),
EMPTY_SELECTION_TEXT_KEY)
.noEventPropagation()
.publishIf(privilege, false);
@@ -311,12 +311,12 @@ public class MonitoringRunningExam implements TemplateComposer {
return clientTable.getSelection();
}
- private PageAction quitSebClients(
+ private PageAction quitSEBClients(
final PageAction action,
final ClientConnectionTable clientTable,
final boolean all) {
- this.instructionProcessor.propagateSebQuitInstruction(
+ this.instructionProcessor.propagateSEBQuitInstruction(
clientTable.getExam().id,
statesPredicate -> clientTable.getConnectionTokens(
statesPredicate,
@@ -328,7 +328,7 @@ public class MonitoringRunningExam implements TemplateComposer {
return action;
}
- private PageAction disableSebClients(
+ private PageAction disableSEBClients(
final PageAction action,
final ClientConnectionTable clientTable,
final boolean all) {
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/QuizLookupList.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/QuizLookupList.java
index 5c1456c6..8f94aeaa 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/QuizLookupList.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/QuizLookupList.java
@@ -150,7 +150,7 @@ public class QuizLookupList implements TemplateComposer {
final PageActionBuilder actionBuilder =
this.pageService.pageActionBuilder(pageContext.clearEntityKeys());
- final BooleanSupplier isSebAdmin =
+ final BooleanSupplier isSEBAdmin =
() -> currentUser.get().hasRole(UserRole.SEB_SERVER_ADMIN);
final Function institutionNameFunction =
@@ -163,7 +163,7 @@ public class QuizLookupList implements TemplateComposer {
.withPaging(this.pageSize)
.withColumnIf(
- isSebAdmin,
+ isSEBAdmin,
() -> new ColumnDefinition(
QuizData.QUIZ_ATTR_INSTITUTION_ID,
INSTITUTION_TEXT_KEY,
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebClientConfigForm.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBClientConfigForm.java
similarity index 88%
rename from src/main/java/ch/ethz/seb/sebserver/gui/content/SebClientConfigForm.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/content/SEBClientConfigForm.java
index fa0d7bdd..d08b4a39 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebClientConfigForm.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBClientConfigForm.java
@@ -8,8 +8,10 @@
package ch.ethz.seb.sebserver.gui.content;
-import ch.ethz.seb.sebserver.gbl.Constants;
-import ch.ethz.seb.sebserver.gui.service.page.PageMessageException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.rap.rwt.RWT;
@@ -21,11 +23,12 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
+import ch.ethz.seb.sebserver.gbl.Constants;
import ch.ethz.seb.sebserver.gbl.api.API;
import ch.ethz.seb.sebserver.gbl.api.EntityType;
import ch.ethz.seb.sebserver.gbl.model.Domain;
import ch.ethz.seb.sebserver.gbl.model.EntityKey;
-import ch.ethz.seb.sebserver.gbl.model.sebconfig.SebClientConfig;
+import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
import ch.ethz.seb.sebserver.gbl.model.user.UserInfo;
import ch.ethz.seb.sebserver.gbl.profile.GuiProfile;
import ch.ethz.seb.sebserver.gui.content.action.ActionDefinition;
@@ -34,10 +37,11 @@ import ch.ethz.seb.sebserver.gui.form.FormHandle;
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.PageMessageException;
import ch.ethz.seb.sebserver.gui.service.page.PageService;
import ch.ethz.seb.sebserver.gui.service.page.TemplateComposer;
import ch.ethz.seb.sebserver.gui.service.remote.download.DownloadService;
-import ch.ethz.seb.sebserver.gui.service.remote.download.SebClientConfigDownload;
+import ch.ethz.seb.sebserver.gui.service.remote.download.SEBClientConfigDownload;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestService;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.clientconfig.ActivateClientConfig;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.clientconfig.DeactivateClientConfig;
@@ -48,14 +52,10 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser.EntityGrantCheck;
import ch.ethz.seb.sebserver.gui.widget.WidgetFactory;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
@Lazy
@Component
@GuiProfile
-public class SebClientConfigForm implements TemplateComposer {
+public class SEBClientConfigForm implements TemplateComposer {
private static final LocTextKey FORM_TITLE_NEW =
new LocTextKey("sebserver.clientconfig.form.title.new");
@@ -94,15 +94,14 @@ public class SebClientConfigForm implements TemplateComposer {
new LocTextKey("sebserver.clientconfig.form.encryptSecret.confirm");
private static final Set FALLBACK_ATTRIBUTES = new HashSet<>(Arrays.asList(
- SebClientConfig.ATTR_FALLBACK_START_URL,
- SebClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL,
- SebClientConfig.ATTR_FALLBACK_ATTEMPTS,
- SebClientConfig.ATTR_FALLBACK_TIMEOUT,
- SebClientConfig.ATTR_FALLBACK_PASSWORD,
- SebClientConfig.ATTR_FALLBACK_PASSWORD_CONFIRM,
- SebClientConfig.ATTR_QUIT_PASSWORD,
- SebClientConfig.ATTR_QUIT_PASSWORD_CONFIRM
- ));
+ SEBClientConfig.ATTR_FALLBACK_START_URL,
+ SEBClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL,
+ SEBClientConfig.ATTR_FALLBACK_ATTEMPTS,
+ SEBClientConfig.ATTR_FALLBACK_TIMEOUT,
+ SEBClientConfig.ATTR_FALLBACK_PASSWORD,
+ SEBClientConfig.ATTR_FALLBACK_PASSWORD_CONFIRM,
+ SEBClientConfig.ATTR_QUIT_PASSWORD,
+ SEBClientConfig.ATTR_QUIT_PASSWORD_CONFIRM));
private static final String FALLBACK_DEFAULT_TIME = String.valueOf(2 * Constants.MINUTE_IN_MILLIS);
private static final String FALLBACK_DEFAULT_ATTEMPTS = String.valueOf(5);
@@ -114,7 +113,7 @@ public class SebClientConfigForm implements TemplateComposer {
private final DownloadService downloadService;
private final String downloadFileName;
- protected SebClientConfigForm(
+ protected SEBClientConfigForm(
final PageService pageService,
final RestService restService,
final CurrentUser currentUser,
@@ -140,8 +139,8 @@ public class SebClientConfigForm implements TemplateComposer {
final boolean isNew = entityKey == null;
// get data or create new. Handle error if happen
- final SebClientConfig clientConfig = (isNew)
- ? SebClientConfig.createNew((parentEntityKey != null)
+ final SEBClientConfig clientConfig = (isNew)
+ ? SEBClientConfig.createNew((parentEntityKey != null)
? Long.valueOf(parentEntityKey.modelId)
: user.institutionId)
: this.restService
@@ -167,8 +166,8 @@ public class SebClientConfigForm implements TemplateComposer {
formContext.getParent(),
titleKey);
- // The SebClientConfig form
- final FormHandle formHandle = this.pageService.formBuilder(
+ // The SEBClientConfig form
+ final FormHandle formHandle = this.pageService.formBuilder(
formContext.copyOf(content))
.readonly(isReadonly)
.putStaticValueIf(() -> !isNew,
@@ -192,12 +191,12 @@ public class SebClientConfigForm implements TemplateComposer {
.mandatory(!isReadonly))
.addField(FormBuilder.singleSelection(
- SebClientConfig.ATTR_CONFIG_PURPOSE,
+ SEBClientConfig.ATTR_CONFIG_PURPOSE,
CLIENT_PURPOSE_TEXT_KEY,
clientConfig.configPurpose != null
? clientConfig.configPurpose.name()
- : SebClientConfig.ConfigPurpose.START_EXAM.name(),
- () -> pageService.getResourceService().sebClientConfigPurposeResources())
+ : SEBClientConfig.ConfigPurpose.START_EXAM.name(),
+ () -> this.pageService.getResourceService().sebClientConfigPurposeResources())
.mandatory(!isReadonly))
.withDefaultSpanInput(3)
@@ -210,21 +209,20 @@ public class SebClientConfigForm implements TemplateComposer {
.addFieldIf(
() -> !isReadonly,
() -> FormBuilder.password(
- SebClientConfig.ATTR_ENCRYPT_SECRET_CONFIRM,
+ SEBClientConfig.ATTR_ENCRYPT_SECRET_CONFIRM,
FORM_CONFIRM_ENCRYPT_SECRET_TEXT_KEY,
clientConfig.getEncryptSecret()))
.addField(FormBuilder.checkbox(
- SebClientConfig.ATTR_FALLBACK,
+ SEBClientConfig.ATTR_FALLBACK,
FALLBACK_TEXT_KEY,
clientConfig.fallback != null
? clientConfig.fallback.toString()
- : Constants.FALSE_STRING)
- )
+ : Constants.FALSE_STRING))
.withDefaultSpanInput(5)
.addField(FormBuilder.text(
- SebClientConfig.ATTR_FALLBACK_START_URL,
+ SEBClientConfig.ATTR_FALLBACK_START_URL,
FALLBACK_URL_TEXT_KEY,
clientConfig.fallbackStartURL)
.mandatory(!isReadonly))
@@ -232,7 +230,7 @@ public class SebClientConfigForm implements TemplateComposer {
.withDefaultSpanEmptyCell(1)
.withDefaultSpanInput(2)
.addField(FormBuilder.text(
- SebClientConfig.ATTR_FALLBACK_ATTEMPTS,
+ SEBClientConfig.ATTR_FALLBACK_ATTEMPTS,
FALLBACK_ATTEMPTS_TEXT_KEY,
clientConfig.fallbackAttempts != null
? String.valueOf(clientConfig.fallbackAttempts)
@@ -244,7 +242,7 @@ public class SebClientConfigForm implements TemplateComposer {
.withEmptyCellSeparation(false)
.withDefaultSpanLabel(1)
.addField(FormBuilder.text(
- SebClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL,
+ SEBClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL,
FALLBACK_ATTEMPT_INTERVAL_TEXT_KEY,
clientConfig.fallbackAttemptInterval != null
? String.valueOf(clientConfig.fallbackAttemptInterval)
@@ -256,7 +254,7 @@ public class SebClientConfigForm implements TemplateComposer {
.withDefaultSpanEmptyCell(1)
.withDefaultSpanLabel(2)
.addField(FormBuilder.text(
- SebClientConfig.ATTR_FALLBACK_TIMEOUT,
+ SEBClientConfig.ATTR_FALLBACK_TIMEOUT,
FALLBACK_TIMEOUT_TEXT_KEY,
clientConfig.fallbackTimeout != null
? String.valueOf(clientConfig.fallbackTimeout)
@@ -269,14 +267,14 @@ public class SebClientConfigForm implements TemplateComposer {
.withDefaultSpanInput(2)
.withDefaultSpanLabel(2)
.addField(FormBuilder.password(
- SebClientConfig.ATTR_FALLBACK_PASSWORD,
+ SEBClientConfig.ATTR_FALLBACK_PASSWORD,
FALLBACK_PASSWORD_TEXT_KEY,
clientConfig.getFallbackPassword()))
.withEmptyCellSeparation(false)
.withDefaultSpanLabel(1)
.addField(FormBuilder.password(
- SebClientConfig.ATTR_QUIT_PASSWORD,
+ SEBClientConfig.ATTR_QUIT_PASSWORD,
QUIT_PASSWORD_TEXT_KEY,
clientConfig.getQuitPassword()))
@@ -287,7 +285,7 @@ public class SebClientConfigForm implements TemplateComposer {
.addFieldIf(
() -> !isReadonly,
() -> FormBuilder.password(
- SebClientConfig.ATTR_FALLBACK_PASSWORD_CONFIRM,
+ SEBClientConfig.ATTR_FALLBACK_PASSWORD_CONFIRM,
FALLBACK_PASSWORD_CONFIRM_TEXT_KEY,
clientConfig.getFallbackPasswordConfirm()))
@@ -296,33 +294,29 @@ public class SebClientConfigForm implements TemplateComposer {
.addFieldIf(
() -> !isReadonly,
() -> FormBuilder.password(
- SebClientConfig.ATTR_QUIT_PASSWORD_CONFIRM,
+ SEBClientConfig.ATTR_QUIT_PASSWORD_CONFIRM,
QUIT_PASSWORD_CONFIRM_TEXT_KEY,
clientConfig.getQuitPasswordConfirm()))
-
.buildFor((isNew)
? this.restService.getRestCall(NewClientConfig.class)
: this.restService.getRestCall(SaveClientConfig.class));
formHandle.process(
FALLBACK_ATTRIBUTES::contains,
- ffa -> ffa.setVisible(BooleanUtils.isTrue(clientConfig.fallback))
- );
+ ffa -> ffa.setVisible(BooleanUtils.isTrue(clientConfig.fallback)));
- formHandle.getForm().getFieldInput(SebClientConfig.ATTR_FALLBACK)
+ formHandle.getForm().getFieldInput(SEBClientConfig.ATTR_FALLBACK)
.addListener(SWT.Selection, event -> formHandle.process(
FALLBACK_ATTRIBUTES::contains,
ffa -> {
- boolean selected = ((Button) event.widget).getSelection();
+ final boolean selected = ((Button) event.widget).getSelection();
ffa.setVisible(selected);
if (!selected && ffa.hasError()) {
ffa.resetError();
ffa.setStringValue(StringUtils.EMPTY);
}
- }
- ));
-
+ }));
final UrlLauncher urlLauncher = RWT.getClient().getService(UrlLauncher.class);
this.pageService.pageActionBuilder(formContext.clearEntityKeys())
@@ -339,7 +333,7 @@ public class SebClientConfigForm implements TemplateComposer {
.withExec(action -> {
final String downloadURL = this.downloadService.createDownloadURL(
entityKey.modelId,
- SebClientConfigDownload.class,
+ SEBClientConfigDownload.class,
this.downloadFileName);
urlLauncher.openURL(downloadURL);
return action;
@@ -375,11 +369,11 @@ public class SebClientConfigForm implements TemplateComposer {
.publishIf(() -> !isReadonly);
}
- private void checkNaturalNumber(String value) {
+ private void checkNaturalNumber(final String value) {
if (StringUtils.isBlank(value)) {
return;
}
- long num = Long.parseLong(value);
+ final long num = Long.parseLong(value);
if (num < 0) {
throw new PageMessageException("Number must be positive");
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebClientConfigList.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBClientConfigList.java
similarity index 95%
rename from src/main/java/ch/ethz/seb/sebserver/gui/content/SebClientConfigList.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/content/SEBClientConfigList.java
index 461ae3f0..37882509 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebClientConfigList.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBClientConfigList.java
@@ -21,7 +21,7 @@ import ch.ethz.seb.sebserver.gbl.Constants;
import ch.ethz.seb.sebserver.gbl.api.EntityType;
import ch.ethz.seb.sebserver.gbl.model.Domain;
import ch.ethz.seb.sebserver.gbl.model.Entity;
-import ch.ethz.seb.sebserver.gbl.model.sebconfig.SebClientConfig;
+import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
import ch.ethz.seb.sebserver.gbl.model.user.UserInfo;
import ch.ethz.seb.sebserver.gbl.model.user.UserRole;
import ch.ethz.seb.sebserver.gbl.profile.GuiProfile;
@@ -46,7 +46,7 @@ import ch.ethz.seb.sebserver.gui.table.TableFilter.CriteriaType;
@Lazy
@Component
@GuiProfile
-public class SebClientConfigList implements TemplateComposer {
+public class SEBClientConfigList implements TemplateComposer {
private static final LocTextKey NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION =
new LocTextKey("sebserver.clientconfig.list.action.no.modify.privilege");
@@ -69,7 +69,7 @@ public class SebClientConfigList implements TemplateComposer {
private final TableFilterAttribute dateFilter =
new TableFilterAttribute(
CriteriaType.DATE,
- SebClientConfig.FILTER_ATTR_CREATION_DATE,
+ SEBClientConfig.FILTER_ATTR_CREATION_DATE,
DateTime.now(DateTimeZone.UTC)
.minusYears(1)
.toString(Constants.DEFAULT_DATE_TIME_FORMAT));
@@ -81,7 +81,7 @@ public class SebClientConfigList implements TemplateComposer {
private final ResourceService resourceService;
private final int pageSize;
- protected SebClientConfigList(
+ protected SEBClientConfigList(
final PageService pageService,
final RestService restService,
final CurrentUser currentUser,
@@ -117,7 +117,7 @@ public class SebClientConfigList implements TemplateComposer {
this.pageService.pageActionBuilder(pageContext.clearEntityKeys());
// table
- final EntityTable table =
+ final EntityTable table =
this.pageService.entityTableBuilder(this.restService.getRestCall(GetClientConfigPage.class))
.withEmptyMessage(EMPTY_LIST_TEXT_KEY)
.withPaging(this.pageSize)
@@ -131,7 +131,7 @@ public class SebClientConfigList implements TemplateComposer {
.withColumn(new ColumnDefinition<>(
Domain.SEB_CLIENT_CONFIGURATION.ATTR_NAME,
NAME_TEXT_KEY,
- SebClientConfig::getName)
+ SEBClientConfig::getName)
.withFilter(this.nameFilter)
.sortable())
.withColumn(new ColumnDefinition<>(
@@ -139,13 +139,13 @@ public class SebClientConfigList implements TemplateComposer {
new LocTextKey(
"sebserver.clientconfig.list.column.date",
i18nSupport.getUsersTimeZoneTitleSuffix()),
- SebClientConfig::getDate)
+ SEBClientConfig::getDate)
.withFilter(this.dateFilter)
.sortable())
.withColumn(new ColumnDefinition<>(
Domain.SEB_CLIENT_CONFIGURATION.ATTR_ACTIVE,
ACTIVE_TEXT_KEY,
- this.pageService.getResourceService(). localizedActivityFunction())
+ this.pageService.getResourceService(). localizedActivityFunction())
.withFilter(this.activityFilter)
.sortable())
.withDefaultAction(pageActionBuilder
@@ -190,7 +190,7 @@ public class SebClientConfigList implements TemplateComposer {
}
- private static Function clientConfigInstitutionNameFunction(
+ private static Function clientConfigInstitutionNameFunction(
final ResourceService resourceService) {
return config -> resourceService.getInstitutionNameFunction()
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebClientLogDetailsPopup.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBClientLogDetailsPopup.java
similarity index 98%
rename from src/main/java/ch/ethz/seb/sebserver/gui/content/SebClientLogDetailsPopup.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/content/SEBClientLogDetailsPopup.java
index 99317e16..496f3649 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebClientLogDetailsPopup.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBClientLogDetailsPopup.java
@@ -37,9 +37,9 @@ import org.springframework.stereotype.Component;
@Lazy
@Component
@GuiProfile
-public class SebClientLogDetailsPopup {
+public class SEBClientLogDetailsPopup {
- private static final Logger log = LoggerFactory.getLogger(SebClientLogDetailsPopup.class);
+ private static final Logger log = LoggerFactory.getLogger(SEBClientLogDetailsPopup.class);
private static final LocTextKey DETAILS_TITLE_TEXT_KEY =
new LocTextKey("sebserver.seblogs.details.title");
@@ -86,7 +86,7 @@ public class SebClientLogDetailsPopup {
private final I18nSupport i18nSupport;
private final WidgetFactory widgetFactory;
- public SebClientLogDetailsPopup(
+ public SEBClientLogDetailsPopup(
final PageService pageService,
final WidgetFactory widgetFactory) {
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebClientLogs.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBClientLogs.java
similarity index 97%
rename from src/main/java/ch/ethz/seb/sebserver/gui/content/SebClientLogs.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/content/SEBClientLogs.java
index 8b74881d..c273ed80 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebClientLogs.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBClientLogs.java
@@ -42,7 +42,7 @@ import ch.ethz.seb.sebserver.gui.widget.WidgetFactory;
@Lazy
@Component
@GuiProfile
-public class SebClientLogs implements TemplateComposer {
+public class SEBClientLogs implements TemplateComposer {
private static final LocTextKey TITLE_TEXT_KEY =
new LocTextKey("sebserver.seblogs.list.title");
@@ -70,12 +70,12 @@ public class SebClientLogs implements TemplateComposer {
private final ResourceService resourceService;
private final RestService restService;
private final I18nSupport i18nSupport;
- private final SebClientLogDetailsPopup sebClientLogDetailsPopup;
+ private final SEBClientLogDetailsPopup sebClientLogDetailsPopup;
private final int pageSize;
- public SebClientLogs(
+ public SEBClientLogs(
final PageService pageService,
- final SebClientLogDetailsPopup sebClientLogDetailsPopup,
+ final SEBClientLogDetailsPopup sebClientLogDetailsPopup,
@Value("${sebserver.gui.list.page.size:20}") final Integer pageSize) {
this.pageService = pageService;
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebExamConfigCreationPopup.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBExamConfigCreationPopup.java
similarity index 97%
rename from src/main/java/ch/ethz/seb/sebserver/gui/content/SebExamConfigCreationPopup.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/content/SEBExamConfigCreationPopup.java
index 12e87325..e9ebefe7 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebExamConfigCreationPopup.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBExamConfigCreationPopup.java
@@ -35,7 +35,7 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCall;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.CopyConfiguration;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.NewExamConfig;
-final class SebExamConfigCreationPopup {
+final class SEBExamConfigCreationPopup {
static final LocTextKey FORM_COPY_TEXT_KEY =
new LocTextKey("sebserver.examconfig.action.copy.dialog");
@@ -174,16 +174,16 @@ final class SebExamConfigCreationPopup {
entityKey.getModelId())
.addField(FormBuilder.text(
Domain.CONFIGURATION_NODE.ATTR_NAME,
- SebExamConfigForm.FORM_NAME_TEXT_KEY))
+ SEBExamConfigForm.FORM_NAME_TEXT_KEY))
.addField(FormBuilder.text(
Domain.CONFIGURATION_NODE.ATTR_DESCRIPTION,
- SebExamConfigForm.FORM_DESCRIPTION_TEXT_KEY)
+ SEBExamConfigForm.FORM_DESCRIPTION_TEXT_KEY)
.asArea())
.addFieldIf(
() -> !this.copyAsTemplate && !this.createFromTemplate,
() -> FormBuilder.checkbox(
ConfigCreationInfo.ATTR_COPY_WITH_HISTORY,
- SebExamConfigForm.FORM_HISTORY_TEXT_KEY))
+ SEBExamConfigForm.FORM_HISTORY_TEXT_KEY))
.build();
return () -> formHandle;
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebExamConfigForm.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBExamConfigForm.java
similarity index 97%
rename from src/main/java/ch/ethz/seb/sebserver/gui/content/SebExamConfigForm.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/content/SEBExamConfigForm.java
index e2bb8e55..2895d0e4 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebExamConfigForm.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBExamConfigForm.java
@@ -49,7 +49,7 @@ import ch.ethz.seb.sebserver.gui.service.page.TemplateComposer;
import ch.ethz.seb.sebserver.gui.service.page.impl.ModalInputDialog;
import ch.ethz.seb.sebserver.gui.service.page.impl.PageAction;
import ch.ethz.seb.sebserver.gui.service.remote.download.DownloadService;
-import ch.ethz.seb.sebserver.gui.service.remote.download.SebExamConfigPlaintextDownload;
+import ch.ethz.seb.sebserver.gui.service.remote.download.SEBExamConfigPlaintextDownload;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestService;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.GetExamConfigMappingNames;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.GetExamConfigMappingsPage;
@@ -67,7 +67,7 @@ import ch.ethz.seb.sebserver.gui.widget.WidgetFactory.CustomVariant;
@Lazy
@Component
@GuiProfile
-public class SebExamConfigForm implements TemplateComposer {
+public class SEBExamConfigForm implements TemplateComposer {
static final LocTextKey FORM_TITLE_NEW =
new LocTextKey("sebserver.examconfig.form.title.new");
@@ -107,7 +107,7 @@ public class SebExamConfigForm implements TemplateComposer {
private final DownloadService downloadService;
private final String downloadFileName;
- protected SebExamConfigForm(
+ protected SEBExamConfigForm(
final PageService pageService,
final CurrentUser currentUser,
final DownloadService downloadService,
@@ -228,7 +228,7 @@ public class SebExamConfigForm implements TemplateComposer {
.newAction(ActionDefinition.SEB_EXAM_CONFIG_COPY_CONFIG)
.withEntityKey(entityKey)
- .withExec(SebExamConfigCreationPopup.configCreationFunction(
+ .withExec(SEBExamConfigCreationPopup.configCreationFunction(
this.pageService,
actionContext
.withEntityKey(entityKey)
@@ -243,7 +243,7 @@ public class SebExamConfigForm implements TemplateComposer {
.newAction(ActionDefinition.SEA_EXAM_CONFIG_COPY_CONFIG_AS_TEMPLATE)
.withEntityKey(entityKey)
- .withExec(SebExamConfigCreationPopup.configCreationFunction(
+ .withExec(SEBExamConfigCreationPopup.configCreationFunction(
this.pageService,
pageContext.withAttribute(
PageContext.AttributeKeys.COPY_AS_TEMPLATE,
@@ -256,7 +256,7 @@ public class SebExamConfigForm implements TemplateComposer {
.withExec(action -> {
final String downloadURL = this.downloadService.createDownloadURL(
entityKey.modelId,
- SebExamConfigPlaintextDownload.class,
+ SEBExamConfigPlaintextDownload.class,
this.downloadFileName);
urlLauncher.openURL(downloadURL);
return action;
@@ -266,13 +266,13 @@ public class SebExamConfigForm implements TemplateComposer {
.newAction(ActionDefinition.SEB_EXAM_CONFIG_GET_CONFIG_KEY)
.withEntityKey(entityKey)
- .withExec(SebExamConfigForm.getConfigKeyFunction(this.pageService))
+ .withExec(SEBExamConfigForm.getConfigKeyFunction(this.pageService))
.noEventPropagation()
.publishIf(() -> modifyGrant && isReadonly)
.newAction(ActionDefinition.SEB_EXAM_CONFIG_IMPORT_TO_EXISTING_CONFIG)
.withEntityKey(entityKey)
- .withExec(SebExamConfigImportPopup.importFunction(this.pageService, false))
+ .withExec(SEBExamConfigImportPopup.importFunction(this.pageService, false))
.noEventPropagation()
.publishIf(() -> modifyGrant && isReadonly && !isAttachedToExam)
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebExamConfigImportPopup.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBExamConfigImportPopup.java
similarity index 86%
rename from src/main/java/ch/ethz/seb/sebserver/gui/content/SebExamConfigImportPopup.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/content/SEBExamConfigImportPopup.java
index e90ed32a..100e4342 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebExamConfigImportPopup.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBExamConfigImportPopup.java
@@ -17,6 +17,8 @@ import java.util.function.Supplier;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import ch.ethz.seb.sebserver.gbl.api.API;
import ch.ethz.seb.sebserver.gbl.api.APIMessage;
@@ -42,11 +44,14 @@ import ch.ethz.seb.sebserver.gui.service.page.impl.ModalInputDialog;
import ch.ethz.seb.sebserver.gui.service.page.impl.PageAction;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCall;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCallError;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.GetExamConfigNodeNames;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.ImportExamConfigOnExistingConfig;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.ImportNewExamConfig;
import ch.ethz.seb.sebserver.gui.widget.FileUploadSelection;
-final class SebExamConfigImportPopup {
+final class SEBExamConfigImportPopup {
+
+ private static final Logger log = LoggerFactory.getLogger(SEBExamConfigImportPopup.class);
private final static PageMessageException MISSING_PASSWORD = new PageMessageException(
new LocTextKey("sebserver.examconfig.action.import.missing-password"));
@@ -69,7 +74,7 @@ final class SebExamConfigImportPopup {
newConfig);
dialog.open(
- SebExamConfigForm.FORM_IMPORT_TEXT_KEY,
+ SEBExamConfigForm.FORM_IMPORT_TEXT_KEY,
(Predicate>) formHandle -> doImport(
pageService,
formHandle,
@@ -115,6 +120,29 @@ final class SebExamConfigImportPopup {
3,
255)));
return false;
+ } else {
+ // check if name already exists
+ try {
+ if (pageService.getRestService()
+ .getBuilder(GetExamConfigNodeNames.class)
+ .call()
+ .getOrThrow()
+ .stream()
+ .filter(n -> n.name.equals(fieldValue))
+ .findFirst()
+ .isPresent()) {
+
+ form.setFieldError(
+ Domain.CONFIGURATION_NODE.ATTR_NAME,
+ pageService
+ .getI18nSupport()
+ .getText(new LocTextKey(
+ "sebserver.form.validation.fieldError.name.notunique")));
+ return false;
+ }
+ } catch (final Exception e) {
+ log.error("Failed to verify unique name: {}", e.getMessage());
+ }
}
}
@@ -153,7 +181,7 @@ final class SebExamConfigImportPopup {
.call();
if (!configuration.hasError()) {
- context.publishInfo(SebExamConfigForm.FORM_IMPORT_CONFIRM_TEXT_KEY);
+ context.publishInfo(SEBExamConfigForm.FORM_IMPORT_CONFIRM_TEXT_KEY);
if (newConfig) {
final PageAction action = pageService.pageActionBuilder(context)
@@ -186,7 +214,7 @@ final class SebExamConfigImportPopup {
}
formHandle.getContext().notifyError(
- SebExamConfigForm.FORM_TITLE,
+ SEBExamConfigForm.FORM_TITLE,
configuration.getError());
}
@@ -200,7 +228,7 @@ final class SebExamConfigImportPopup {
return false;
} catch (final Exception e) {
- formHandle.getContext().notifyError(SebExamConfigForm.FORM_TITLE, e);
+ formHandle.getContext().notifyError(SEBExamConfigForm.FORM_TITLE, e);
return true;
}
}
@@ -236,7 +264,7 @@ final class SebExamConfigImportPopup {
.readonly(false)
.addField(FormBuilder.fileUpload(
API.IMPORT_FILE_ATTR_NAME,
- SebExamConfigForm.FORM_IMPORT_SELECT_TEXT_KEY,
+ SEBExamConfigForm.FORM_IMPORT_SELECT_TEXT_KEY,
null,
API.SEB_FILE_EXTENSION))
@@ -244,24 +272,24 @@ final class SebExamConfigImportPopup {
() -> this.newConfig,
() -> FormBuilder.text(
Domain.CONFIGURATION_NODE.ATTR_NAME,
- SebExamConfigForm.FORM_NAME_TEXT_KEY))
+ SEBExamConfigForm.FORM_NAME_TEXT_KEY))
.addFieldIf(
() -> this.newConfig,
() -> FormBuilder.text(
Domain.CONFIGURATION_NODE.ATTR_DESCRIPTION,
- SebExamConfigForm.FORM_DESCRIPTION_TEXT_KEY)
+ SEBExamConfigForm.FORM_DESCRIPTION_TEXT_KEY)
.asArea())
.addFieldIf(
() -> this.newConfig && !examConfigTemplateResources.isEmpty(),
() -> FormBuilder.singleSelection(
Domain.CONFIGURATION_NODE.ATTR_TEMPLATE_ID,
- SebExamConfigForm.FORM_TEMPLATE_TEXT_KEY,
+ SEBExamConfigForm.FORM_TEMPLATE_TEXT_KEY,
null,
resourceService::getExamConfigTemplateResources))
.addField(FormBuilder.text(
API.IMPORT_PASSWORD_ATTR_NAME,
- SebExamConfigForm.FORM_IMPORT_PASSWORD_TEXT_KEY,
+ SEBExamConfigForm.FORM_IMPORT_PASSWORD_TEXT_KEY,
"").asPasswordField())
.build();
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebExamConfigList.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBExamConfigList.java
similarity index 98%
rename from src/main/java/ch/ethz/seb/sebserver/gui/content/SebExamConfigList.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/content/SEBExamConfigList.java
index ea7066b3..3b11f1d7 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebExamConfigList.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBExamConfigList.java
@@ -41,7 +41,7 @@ import ch.ethz.seb.sebserver.gui.widget.WidgetFactory;
@Lazy
@Component
@GuiProfile
-public class SebExamConfigList implements TemplateComposer {
+public class SEBExamConfigList implements TemplateComposer {
private static final LocTextKey NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION =
new LocTextKey("sebserver.examconfig.list.action.no.modify.privilege");
@@ -73,7 +73,7 @@ public class SebExamConfigList implements TemplateComposer {
private final ResourceService resourceService;
private final int pageSize;
- protected SebExamConfigList(
+ protected SEBExamConfigList(
final PageService pageService,
final RestService restService,
final CurrentUser currentUser,
@@ -172,7 +172,7 @@ public class SebExamConfigList implements TemplateComposer {
.newAction(ActionDefinition.SEB_EXAM_CONFIG_IMPORT_TO_NEW_CONFIG)
.withSelect(
configTable.getGrantedSelection(this.currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
- SebExamConfigImportPopup.importFunction(this.pageService, true),
+ SEBExamConfigImportPopup.importFunction(this.pageService, true),
EMPTY_SELECTION_TEXT_KEY)
.noEventPropagation()
.publishIf(examConfigGrant::im);
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebSettingsForm.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBSettingsForm.java
similarity index 96%
rename from src/main/java/ch/ethz/seb/sebserver/gui/content/SebSettingsForm.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/content/SEBSettingsForm.java
index 52d22af7..614ca21c 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/SebSettingsForm.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/SEBSettingsForm.java
@@ -47,7 +47,7 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestService;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.GetConfigurations;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.GetExamConfigNode;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.SaveExamConfigHistory;
-import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.SebExamConfigUndo;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.SEBExamConfigUndo;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser.GrantCheck;
import ch.ethz.seb.sebserver.gui.widget.WidgetFactory;
@@ -55,9 +55,9 @@ import ch.ethz.seb.sebserver.gui.widget.WidgetFactory;
@Lazy
@Component
@GuiProfile
-public class SebSettingsForm implements TemplateComposer {
+public class SEBSettingsForm implements TemplateComposer {
- private static final Logger log = LoggerFactory.getLogger(SebSettingsForm.class);
+ private static final Logger log = LoggerFactory.getLogger(SEBSettingsForm.class);
private static final String VIEW_TEXT_KEY_PREFIX =
"sebserver.examconfig.props.form.views.";
@@ -76,7 +76,7 @@ public class SebSettingsForm implements TemplateComposer {
private final CurrentUser currentUser;
private final ExamConfigurationService examConfigurationService;
- protected SebSettingsForm(
+ protected SEBSettingsForm(
final PageService pageService,
final RestService restService,
final CurrentUser currentUser,
@@ -178,7 +178,7 @@ public class SebSettingsForm implements TemplateComposer {
.newAction(ActionDefinition.SEB_EXAM_CONFIG_UNDO)
.withEntityKey(entityKey)
.withExec(action -> {
- this.restService.getBuilder(SebExamConfigUndo.class)
+ this.restService.getBuilder(SEBExamConfigUndo.class)
.withURIVariable(API.PARAM_MODEL_ID, configuration.getModelId())
.call()
.getOrThrow();
@@ -192,7 +192,7 @@ public class SebSettingsForm implements TemplateComposer {
.newAction(ActionDefinition.SEA_EXAM_CONFIG_COPY_CONFIG_AS_TEMPLATE)
.withEntityKey(entityKey)
- .withExec(SebExamConfigCreationPopup.configCreationFunction(
+ .withExec(SEBExamConfigCreationPopup.configCreationFunction(
this.pageService,
pageContext
.withAttribute(
@@ -214,7 +214,7 @@ public class SebSettingsForm implements TemplateComposer {
throw e;
} catch (final Exception e) {
log.error("Unexpected error while trying to fetch exam configuration data and create views", e);
- pageContext.notifyError(SebExamConfigForm.FORM_TITLE, e);
+ pageContext.notifyError(SEBExamConfigForm.FORM_TITLE, e);
}
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/UserActivityLogs.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/UserActivityLogs.java
index 99986a28..8b8229c7 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/UserActivityLogs.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/UserActivityLogs.java
@@ -136,7 +136,7 @@ public class UserActivityLogs implements TemplateComposer {
.clearEntityKeys()
.clearAttributes());
- final BooleanSupplier isSebAdmin =
+ final BooleanSupplier isSEBAdmin =
() -> currentUser.get().hasRole(UserRole.SEB_SERVER_ADMIN);
final Function institutionNameFunction =
@@ -159,7 +159,7 @@ public class UserActivityLogs implements TemplateComposer {
.withPaging(this.pageSize)
.withColumnIf(
- isSebAdmin,
+ isSEBAdmin,
() -> new ColumnDefinition<>(
UserActivityLog.FILTER_ATTR_INSTITUTION,
INSTITUTION_TEXT_KEY,
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java
index b9f33e03..8547959f 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java
@@ -296,12 +296,12 @@ public class ActivitiesPane implements TemplateComposer {
// ---- MONITORING ---------------------------------------------------------------------
final boolean isSupporter = this.currentUser.get().hasAnyRole(UserRole.EXAM_SUPPORTER);
- final boolean viewSebClientLogs = this.currentUser.hasInstitutionalPrivilege(
+ final boolean viewSEBClientLogs = this.currentUser.hasInstitutionalPrivilege(
PrivilegeType.READ,
EntityType.EXAM) ||
this.currentUser.get().hasRole(UserRole.EXAM_SUPPORTER);
- if (isSupporter || viewSebClientLogs) {
+ if (isSupporter || viewSEBClientLogs) {
// Monitoring
final TreeItem monitoring = this.widgetFactory.treeItemLocalized(
navigation,
@@ -320,7 +320,7 @@ public class ActivitiesPane implements TemplateComposer {
}
// SEB Client Logs
- if (viewSebClientLogs) {
+ if (viewSEBClientLogs) {
final TreeItem sebLogs = (isSupporter)
? this.widgetFactory.treeItemLocalized(
monitoring,
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/PageStateDefinitionImpl.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/PageStateDefinitionImpl.java
index 2f43138d..2e42d752 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/PageStateDefinitionImpl.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/PageStateDefinitionImpl.java
@@ -22,12 +22,12 @@ import ch.ethz.seb.sebserver.gui.content.MonitoringClientConnection;
import ch.ethz.seb.sebserver.gui.content.MonitoringRunningExam;
import ch.ethz.seb.sebserver.gui.content.MonitoringRunningExamList;
import ch.ethz.seb.sebserver.gui.content.QuizLookupList;
-import ch.ethz.seb.sebserver.gui.content.SebClientConfigForm;
-import ch.ethz.seb.sebserver.gui.content.SebClientConfigList;
-import ch.ethz.seb.sebserver.gui.content.SebClientLogs;
-import ch.ethz.seb.sebserver.gui.content.SebExamConfigList;
-import ch.ethz.seb.sebserver.gui.content.SebExamConfigForm;
-import ch.ethz.seb.sebserver.gui.content.SebSettingsForm;
+import ch.ethz.seb.sebserver.gui.content.SEBClientConfigForm;
+import ch.ethz.seb.sebserver.gui.content.SEBClientConfigList;
+import ch.ethz.seb.sebserver.gui.content.SEBClientLogs;
+import ch.ethz.seb.sebserver.gui.content.SEBExamConfigList;
+import ch.ethz.seb.sebserver.gui.content.SEBExamConfigForm;
+import ch.ethz.seb.sebserver.gui.content.SEBSettingsForm;
import ch.ethz.seb.sebserver.gui.content.UserAccountChangePasswordForm;
import ch.ethz.seb.sebserver.gui.content.UserAccountForm;
import ch.ethz.seb.sebserver.gui.content.UserAccountList;
@@ -59,15 +59,15 @@ public enum PageStateDefinitionImpl implements PageStateDefinition {
EXAM_EDIT(Type.FORM_EDIT, ExamForm.class, ActivityDefinition.EXAM),
INDICATOR_EDIT(Type.FORM_EDIT, IndicatorForm.class, ActivityDefinition.EXAM),
- SEB_CLIENT_CONFIG_LIST(Type.LIST_VIEW, SebClientConfigList.class, ActivityDefinition.SEB_CLIENT_CONFIG),
- SEB_CLIENT_CONFIG_VIEW(Type.FORM_VIEW, SebClientConfigForm.class, ActivityDefinition.SEB_CLIENT_CONFIG),
- SEB_CLIENT_CONFIG_EDIT(Type.FORM_EDIT, SebClientConfigForm.class, ActivityDefinition.SEB_CLIENT_CONFIG),
+ SEB_CLIENT_CONFIG_LIST(Type.LIST_VIEW, SEBClientConfigList.class, ActivityDefinition.SEB_CLIENT_CONFIG),
+ SEB_CLIENT_CONFIG_VIEW(Type.FORM_VIEW, SEBClientConfigForm.class, ActivityDefinition.SEB_CLIENT_CONFIG),
+ SEB_CLIENT_CONFIG_EDIT(Type.FORM_EDIT, SEBClientConfigForm.class, ActivityDefinition.SEB_CLIENT_CONFIG),
- SEB_EXAM_CONFIG_LIST(Type.LIST_VIEW, SebExamConfigList.class, ActivityDefinition.SEB_EXAM_CONFIG),
- SEB_EXAM_CONFIG_PROP_VIEW(Type.FORM_VIEW, SebExamConfigForm.class, ActivityDefinition.SEB_EXAM_CONFIG),
- SEB_EXAM_CONFIG_PROP_EDIT(Type.FORM_EDIT, SebExamConfigForm.class, ActivityDefinition.SEB_EXAM_CONFIG),
- SEB_EXAM_CONFIG_EDIT(Type.FORM_IN_TIME_EDIT, SebSettingsForm.class, ActivityDefinition.SEB_EXAM_CONFIG),
- SEB_EXAM_CONFIG_VIEW(Type.FORM_VIEW, SebSettingsForm.class, ActivityDefinition.SEB_EXAM_CONFIG),
+ SEB_EXAM_CONFIG_LIST(Type.LIST_VIEW, SEBExamConfigList.class, ActivityDefinition.SEB_EXAM_CONFIG),
+ SEB_EXAM_CONFIG_PROP_VIEW(Type.FORM_VIEW, SEBExamConfigForm.class, ActivityDefinition.SEB_EXAM_CONFIG),
+ SEB_EXAM_CONFIG_PROP_EDIT(Type.FORM_EDIT, SEBExamConfigForm.class, ActivityDefinition.SEB_EXAM_CONFIG),
+ SEB_EXAM_CONFIG_EDIT(Type.FORM_IN_TIME_EDIT, SEBSettingsForm.class, ActivityDefinition.SEB_EXAM_CONFIG),
+ SEB_EXAM_CONFIG_VIEW(Type.FORM_VIEW, SEBSettingsForm.class, ActivityDefinition.SEB_EXAM_CONFIG),
SEB_EXAM_CONFIG_TEMPLATE_LIST(Type.LIST_VIEW, ConfigTemplateList.class,
ActivityDefinition.SEB_EXAM_CONFIG_TEMPLATE),
@@ -85,7 +85,7 @@ public enum PageStateDefinitionImpl implements PageStateDefinition {
MONITORING_CLIENT_CONNECTION(Type.FORM_VIEW, MonitoringClientConnection.class, ActivityDefinition.MONITORING_EXAMS),
USER_ACTIVITY_LOGS(Type.LIST_VIEW, UserActivityLogs.class, ActivityDefinition.USER_ACTIVITY_LOGS),
- SEB_CLIENT_LOGS(Type.LIST_VIEW, SebClientLogs.class, ActivityDefinition.SEB_CLIENT_LOGS)
+ SEB_CLIENT_LOGS(Type.LIST_VIEW, SEBClientLogs.class, ActivityDefinition.SEB_CLIENT_LOGS)
;
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/ResourceService.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/ResourceService.java
index 62da1623..2576bbaa 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/service/ResourceService.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/ResourceService.java
@@ -20,7 +20,7 @@ import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
-import ch.ethz.seb.sebserver.gbl.model.sebconfig.SebClientConfig;
+import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
import ch.ethz.seb.sebserver.gbl.util.Tuple3;
import ch.ethz.seb.sebserver.gbl.util.Utils;
import org.apache.commons.lang3.StringUtils;
@@ -40,8 +40,8 @@ import ch.ethz.seb.sebserver.gbl.model.exam.Exam.ExamStatus;
import ch.ethz.seb.sebserver.gbl.model.exam.Exam.ExamType;
import ch.ethz.seb.sebserver.gbl.model.exam.ExamConfigurationMap;
import ch.ethz.seb.sebserver.gbl.model.exam.Indicator.IndicatorType;
-import ch.ethz.seb.sebserver.gbl.model.exam.OpenEdxSebRestriction.PermissionComponent;
-import ch.ethz.seb.sebserver.gbl.model.exam.OpenEdxSebRestriction.WhiteListPath;
+import ch.ethz.seb.sebserver.gbl.model.exam.OpenEdxSEBRestriction.PermissionComponent;
+import ch.ethz.seb.sebserver.gbl.model.exam.OpenEdxSEBRestriction.WhiteListPath;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup.LmsType;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.AttributeType;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationNode;
@@ -658,7 +658,7 @@ public class ResourceService {
}
public List> sebClientConfigPurposeResources() {
- return Arrays.stream(SebClientConfig.ConfigPurpose.values())
+ return Arrays.stream(SEBClientConfig.ConfigPurpose.values())
.map(type -> new Tuple3<>(
type.name(),
this.i18nSupport.getText(SEB_CLIENT_CONFIG_PURPOSE_PREFIX + type.name()),
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SebClientConfigDownload.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SEBClientConfigDownload.java
similarity index 92%
rename from src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SebClientConfigDownload.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SEBClientConfigDownload.java
index 0652ce35..72787ff3 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SebClientConfigDownload.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SEBClientConfigDownload.java
@@ -27,14 +27,14 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.clientconfig.
@Lazy
@Component
@GuiProfile
-public class SebClientConfigDownload extends AbstractDownloadServiceHandler {
+public class SEBClientConfigDownload extends AbstractDownloadServiceHandler {
- private static final Logger log = LoggerFactory.getLogger(SebClientConfigDownload.class);
+ private static final Logger log = LoggerFactory.getLogger(SEBClientConfigDownload.class);
private final RestService restService;
public final String downloadFileName;
- protected SebClientConfigDownload(
+ protected SEBClientConfigDownload(
final RestService restService,
@Value("${sebserver.gui.seb.client.config.download.filename}") final String downloadFileName) {
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SebExamConfigDownload.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SEBExamConfigDownload.java
similarity index 90%
rename from src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SebExamConfigDownload.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SEBExamConfigDownload.java
index 151744b6..9305be12 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SebExamConfigDownload.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SEBExamConfigDownload.java
@@ -26,13 +26,13 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.ExportExamCo
@Lazy
@Component
@GuiProfile
-public class SebExamConfigDownload extends AbstractDownloadServiceHandler {
+public class SEBExamConfigDownload extends AbstractDownloadServiceHandler {
- private static final Logger log = LoggerFactory.getLogger(SebExamConfigDownload.class);
+ private static final Logger log = LoggerFactory.getLogger(SEBExamConfigDownload.class);
private final RestService restService;
- protected SebExamConfigDownload(final RestService restService) {
+ protected SEBExamConfigDownload(final RestService restService) {
this.restService = restService;
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SebExamConfigPlaintextDownload.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SEBExamConfigPlaintextDownload.java
similarity index 89%
rename from src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SebExamConfigPlaintextDownload.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SEBExamConfigPlaintextDownload.java
index 6bbcff1c..3dd5a4be 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SebExamConfigPlaintextDownload.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/download/SEBExamConfigPlaintextDownload.java
@@ -26,13 +26,13 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.Ex
@Lazy
@Component
@GuiProfile
-public class SebExamConfigPlaintextDownload extends AbstractDownloadServiceHandler {
+public class SEBExamConfigPlaintextDownload extends AbstractDownloadServiceHandler {
- private static final Logger log = LoggerFactory.getLogger(SebExamConfigPlaintextDownload.class);
+ private static final Logger log = LoggerFactory.getLogger(SEBExamConfigPlaintextDownload.class);
private final RestService restService;
- protected SebExamConfigPlaintextDownload(final RestService restService) {
+ protected SEBExamConfigPlaintextDownload(final RestService restService) {
this.restService = restService;
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/ActivateSebRestriction.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/ActivateSEBRestriction.java
similarity index 90%
rename from src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/ActivateSebRestriction.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/ActivateSEBRestriction.java
index 16deb374..67de13f7 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/ActivateSebRestriction.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/ActivateSEBRestriction.java
@@ -24,9 +24,9 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCall;
@Lazy
@Component
@GuiProfile
-public class ActivateSebRestriction extends RestCall {
+public class ActivateSEBRestriction extends RestCall {
- public ActivateSebRestriction() {
+ public ActivateSEBRestriction() {
super(new TypeKey<>(
CallType.ACTIVATION_ACTIVATE,
EntityType.EXAM_SEB_RESTRICTION,
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/CheckSebRestriction.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/CheckSEBRestriction.java
similarity index 90%
rename from src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/CheckSebRestriction.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/CheckSEBRestriction.java
index 6844a180..d7a02885 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/CheckSebRestriction.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/CheckSEBRestriction.java
@@ -23,9 +23,9 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCall;
@Lazy
@Component
@GuiProfile
-public class CheckSebRestriction extends RestCall {
+public class CheckSEBRestriction extends RestCall {
- public CheckSebRestriction() {
+ public CheckSEBRestriction() {
super(new TypeKey<>(
CallType.UNDEFINED,
EntityType.EXAM_SEB_RESTRICTION,
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/DeactivateSebRestriction.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/DeactivateSEBRestriction.java
similarity index 90%
rename from src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/DeactivateSebRestriction.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/DeactivateSEBRestriction.java
index dd2b1b64..1d327f13 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/DeactivateSebRestriction.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/DeactivateSEBRestriction.java
@@ -24,9 +24,9 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCall;
@Lazy
@Component
@GuiProfile
-public class DeactivateSebRestriction extends RestCall {
+public class DeactivateSEBRestriction extends RestCall {
- public DeactivateSebRestriction() {
+ public DeactivateSEBRestriction() {
super(new TypeKey<>(
CallType.ACTIVATION_DEACTIVATE,
EntityType.EXAM_SEB_RESTRICTION,
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/GetSebRestriction.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/GetSEBRestriction.java
similarity index 83%
rename from src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/GetSebRestriction.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/GetSEBRestriction.java
index ecdf4f19..3efbef01 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/GetSebRestriction.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/GetSEBRestriction.java
@@ -17,20 +17,20 @@ import com.fasterxml.jackson.core.type.TypeReference;
import ch.ethz.seb.sebserver.gbl.api.API;
import ch.ethz.seb.sebserver.gbl.api.EntityType;
-import ch.ethz.seb.sebserver.gbl.model.exam.SebRestriction;
+import ch.ethz.seb.sebserver.gbl.model.exam.SEBRestriction;
import ch.ethz.seb.sebserver.gbl.profile.GuiProfile;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCall;
@Lazy
@Component
@GuiProfile
-public class GetSebRestriction extends RestCall {
+public class GetSEBRestriction extends RestCall {
- public GetSebRestriction() {
+ public GetSEBRestriction() {
super(new TypeKey<>(
CallType.GET_SINGLE,
EntityType.EXAM_SEB_RESTRICTION,
- new TypeReference() {
+ new TypeReference() {
}),
HttpMethod.GET,
MediaType.APPLICATION_JSON_UTF8,
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/SaveSebRestriction.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/SaveSEBRestriction.java
similarity index 91%
rename from src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/SaveSebRestriction.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/SaveSEBRestriction.java
index 39b5a9a1..1cc262ce 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/SaveSebRestriction.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/exam/SaveSEBRestriction.java
@@ -24,9 +24,9 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCall;
@Lazy
@Component
@GuiProfile
-public class SaveSebRestriction extends RestCall {
+public class SaveSEBRestriction extends RestCall {
- public SaveSebRestriction() {
+ public SaveSEBRestriction() {
super(new TypeKey<>(
CallType.GET_SINGLE,
EntityType.EXAM_SEB_RESTRICTION,
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/clientconfig/GetClientConfig.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/clientconfig/GetClientConfig.java
index c1cfc676..50a03cfa 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/clientconfig/GetClientConfig.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/clientconfig/GetClientConfig.java
@@ -17,20 +17,20 @@ import com.fasterxml.jackson.core.type.TypeReference;
import ch.ethz.seb.sebserver.gbl.api.API;
import ch.ethz.seb.sebserver.gbl.api.EntityType;
-import ch.ethz.seb.sebserver.gbl.model.sebconfig.SebClientConfig;
+import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
import ch.ethz.seb.sebserver.gbl.profile.GuiProfile;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCall;
@Lazy
@Component
@GuiProfile
-public class GetClientConfig extends RestCall {
+public class GetClientConfig extends RestCall {
public GetClientConfig() {
super(new TypeKey<>(
CallType.GET_SINGLE,
EntityType.SEB_CLIENT_CONFIGURATION,
- new TypeReference() {
+ new TypeReference() {
}),
HttpMethod.GET,
MediaType.APPLICATION_FORM_URLENCODED,
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/clientconfig/GetClientConfigPage.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/clientconfig/GetClientConfigPage.java
index a37bb9bc..26c62789 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/clientconfig/GetClientConfigPage.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/clientconfig/GetClientConfigPage.java
@@ -18,20 +18,20 @@ import com.fasterxml.jackson.core.type.TypeReference;
import ch.ethz.seb.sebserver.gbl.api.API;
import ch.ethz.seb.sebserver.gbl.api.EntityType;
import ch.ethz.seb.sebserver.gbl.model.Page;
-import ch.ethz.seb.sebserver.gbl.model.sebconfig.SebClientConfig;
+import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
import ch.ethz.seb.sebserver.gbl.profile.GuiProfile;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCall;
@Lazy
@Component
@GuiProfile
-public class GetClientConfigPage extends RestCall> {
+public class GetClientConfigPage extends RestCall> {
public GetClientConfigPage() {
super(new TypeKey<>(
CallType.GET_PAGE,
EntityType.SEB_CLIENT_CONFIGURATION,
- new TypeReference>() {
+ new TypeReference>() {
}),
HttpMethod.GET,
MediaType.APPLICATION_FORM_URLENCODED,
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/clientconfig/NewClientConfig.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/clientconfig/NewClientConfig.java
index 4282f9c0..af56e3c2 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/clientconfig/NewClientConfig.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/clientconfig/NewClientConfig.java
@@ -17,20 +17,20 @@ import com.fasterxml.jackson.core.type.TypeReference;
import ch.ethz.seb.sebserver.gbl.api.API;
import ch.ethz.seb.sebserver.gbl.api.EntityType;
-import ch.ethz.seb.sebserver.gbl.model.sebconfig.SebClientConfig;
+import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
import ch.ethz.seb.sebserver.gbl.profile.GuiProfile;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCall;
@Lazy
@Component
@GuiProfile
-public class NewClientConfig extends RestCall {
+public class NewClientConfig extends RestCall {
public NewClientConfig() {
super(new TypeKey<>(
CallType.NEW,
EntityType.SEB_CLIENT_CONFIGURATION,
- new TypeReference() {
+ new TypeReference() {
}),
HttpMethod.POST,
MediaType.APPLICATION_FORM_URLENCODED,
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/clientconfig/SaveClientConfig.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/clientconfig/SaveClientConfig.java
index d6cff1ce..e3884e2a 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/clientconfig/SaveClientConfig.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/clientconfig/SaveClientConfig.java
@@ -17,20 +17,20 @@ import com.fasterxml.jackson.core.type.TypeReference;
import ch.ethz.seb.sebserver.gbl.api.API;
import ch.ethz.seb.sebserver.gbl.api.EntityType;
-import ch.ethz.seb.sebserver.gbl.model.sebconfig.SebClientConfig;
+import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
import ch.ethz.seb.sebserver.gbl.profile.GuiProfile;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCall;
@Lazy
@Component
@GuiProfile
-public class SaveClientConfig extends RestCall {
+public class SaveClientConfig extends RestCall {
public SaveClientConfig() {
super(new TypeKey<>(
CallType.SAVE,
EntityType.SEB_CLIENT_CONFIGURATION,
- new TypeReference() {
+ new TypeReference() {
}),
HttpMethod.PUT,
MediaType.APPLICATION_JSON_UTF8,
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/examconfig/SebExamConfigUndo.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/examconfig/SEBExamConfigUndo.java
similarity index 90%
rename from src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/examconfig/SebExamConfigUndo.java
rename to src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/examconfig/SEBExamConfigUndo.java
index 9bb4b976..7ca0f79d 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/examconfig/SebExamConfigUndo.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/api/seb/examconfig/SEBExamConfigUndo.java
@@ -24,9 +24,9 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCall;
@Lazy
@Component
@GuiProfile
-public class SebExamConfigUndo extends RestCall {
+public class SEBExamConfigUndo extends RestCall {
- public SebExamConfigUndo() {
+ public SEBExamConfigUndo() {
super(new TypeKey<>(
CallType.SAVE,
EntityType.CONFIGURATION,
diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/session/InstructionProcessor.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/session/InstructionProcessor.java
index 9128b6ce..9a409f66 100644
--- a/src/main/java/ch/ethz/seb/sebserver/gui/service/session/InstructionProcessor.java
+++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/session/InstructionProcessor.java
@@ -54,19 +54,19 @@ public class InstructionProcessor {
this.jsonMapper = pageService.getJSONMapper();
}
- public void propagateSebQuitInstruction(
+ public void propagateSEBQuitInstruction(
final Long examId,
final String connectionToken,
final PageContext pageContext) {
- propagateSebQuitInstruction(
+ propagateSEBQuitInstruction(
examId,
p -> Stream.of(connectionToken).collect(Collectors.toSet()),
pageContext);
}
- public void propagateSebQuitInstruction(
+ public void propagateSEBQuitInstruction(
final Long examId,
final Function, Set> selectionFunction,
final PageContext pageContext) {
@@ -75,7 +75,7 @@ public class InstructionProcessor {
.apply(ClientConnection.getStatusPredicate(ConnectionStatus.ACTIVE));
if (connectionTokens.isEmpty()) {
- // TODO message
+ log.warn("Empty selection");
return;
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/AdminUserInitializer.java b/src/main/java/ch/ethz/seb/sebserver/webservice/AdminUserInitializer.java
index acdf426e..93553f67 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/AdminUserInitializer.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/AdminUserInitializer.java
@@ -10,13 +10,13 @@ package ch.ethz.seb.sebserver.webservice;
import ch.ethz.seb.sebserver.SEBServerInit;
import ch.ethz.seb.sebserver.WebSecurityConfig;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentialServiceImpl;
import ch.ethz.seb.sebserver.gbl.model.institution.Institution;
import ch.ethz.seb.sebserver.gbl.model.user.UserMod;
import ch.ethz.seb.sebserver.gbl.model.user.UserRole;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.impl.SEBServerUser;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentialServiceImpl;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.InstitutionDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.UserDAO;
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/WebserviceInfo.java b/src/main/java/ch/ethz/seb/sebserver/webservice/WebserviceInfo.java
index 47e08eba..3d7c61f7 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/WebserviceInfo.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/WebserviceInfo.java
@@ -108,7 +108,7 @@ public class WebserviceInfo {
}
}
- public String getSebServerVersion() {
+ public String getSEBServerVersion() {
return this.sebServerVersion;
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ExamDAO.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ExamDAO.java
index 2ae97151..2e5cbb4e 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ExamDAO.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ExamDAO.java
@@ -114,7 +114,7 @@ public interface ExamDAO extends ActivatableEntityDAO, BulkActionSup
* @return Result refer to the lock-check-result or to an error if happened */
Result isLocked(Long examId);
- /** Use this to check of the exam with the specified identifier is up to date
+ /** Use this to check if the exam with the specified identifier is up to date
*
* @param examId the exam identifier
* @param updateId the update identifier of the exam
@@ -126,6 +126,6 @@ public interface ExamDAO extends ActivatableEntityDAO, BulkActionSup
* @param examId the exam identifier
* @param sebRestriction the seb-restriction flag value
* @return Result refer to the updated Exam or to an error if happened */
- Result setSebRestriction(Long examId, boolean sebRestriction);
+ Result setSEBRestriction(Long examId, boolean sebRestriction);
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/FilterMap.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/FilterMap.java
index 92457df0..cf6d28d3 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/FilterMap.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/FilterMap.java
@@ -28,7 +28,7 @@ import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationAttribute;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationNode;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationValue;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.Orientation;
-import ch.ethz.seb.sebserver.gbl.model.sebconfig.SebClientConfig;
+import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
import ch.ethz.seb.sebserver.gbl.model.session.ClientConnection;
import ch.ethz.seb.sebserver.gbl.model.session.ClientEvent;
import ch.ethz.seb.sebserver.gbl.model.session.ClientEvent.EventType;
@@ -101,8 +101,8 @@ public class FilterMap extends POSTMapper {
return Utils.toDateTime(getString(QuizData.FILTER_ATTR_START_TIME));
}
- public DateTime getSebClientConfigFromTime() {
- return Utils.toDateTime(getString(SebClientConfig.FILTER_ATTR_CREATION_DATE));
+ public DateTime getSEBClientConfigFromTime() {
+ return Utils.toDateTime(getString(SEBClientConfig.FILTER_ATTR_CREATION_DATE));
}
public Long getLmsSetupId() {
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/LmsSetupDAO.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/LmsSetupDAO.java
index c065f0ac..771587f7 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/LmsSetupDAO.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/LmsSetupDAO.java
@@ -8,11 +8,11 @@
package ch.ethz.seb.sebserver.webservice.servicelayer.dao;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentials;
+import ch.ethz.seb.sebserver.gbl.client.ProxyData;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup;
import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionSupportDAO;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentials;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ProxyData;
/** Concrete EntityDAO interface of LmsSetup entities */
public interface LmsSetupDAO extends ActivatableEntityDAO, BulkActionSupportDAO {
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/SebClientConfigDAO.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/SEBClientConfigDAO.java
similarity index 70%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/SebClientConfigDAO.java
rename to src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/SEBClientConfigDAO.java
index c5a9fccd..0d803429 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/SebClientConfigDAO.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/SEBClientConfigDAO.java
@@ -13,30 +13,30 @@ import java.util.Set;
import org.springframework.cache.annotation.CacheEvict;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentials;
import ch.ethz.seb.sebserver.gbl.model.EntityKey;
-import ch.ethz.seb.sebserver.gbl.model.sebconfig.SebClientConfig;
+import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.BulkActionSupportDAO;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentials;
import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.ClientConfigService;
-/** Concrete EntityDAO interface of SebClientConfig entities */
-public interface SebClientConfigDAO extends
- ActivatableEntityDAO,
- BulkActionSupportDAO {
+/** Concrete EntityDAO interface of SEBClientConfig entities */
+public interface SEBClientConfigDAO extends
+ ActivatableEntityDAO,
+ BulkActionSupportDAO {
- /** Get a SebClientConfig by specified client identifier
+ /** Get a SEBClientConfig by specified client identifier
*
* @param clientName the client name
- * @return Result refer to the SebClientConfig for client or refer to an error if happened */
- Result byClientName(String clientName);
+ * @return Result refer to the SEBClientConfig for client or refer to an error if happened */
+ Result byClientName(String clientName);
- /** Get the configured ClientCredentials for a given SebClientConfig.
+ /** Get the configured ClientCredentials for a given SEBClientConfig.
* The ClientCredentials are still encoded as they are on DB storage
*
- * @param modelId the model identifier of the SebClientConfig to get the ClientCredentials for
- * @return the configured ClientCredentials for a given SebClientConfig */
- Result getSebClientCredentials(String modelId);
+ * @param modelId the model identifier of the SEBClientConfig to get the ClientCredentials for
+ * @return the configured ClientCredentials for a given SEBClientConfig */
+ Result getSEBClientCredentials(String modelId);
/** Get the stored encrypted configuration password from a specified SEB client configuration.
* The SEB client configuration password is used to encrypt a SEB Client Configuration
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamConfigurationMapDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamConfigurationMapDAOImpl.java
index f6e70e47..fdd11fdd 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamConfigurationMapDAOImpl.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamConfigurationMapDAOImpl.java
@@ -28,6 +28,7 @@ import org.springframework.transaction.annotation.Transactional;
import ch.ethz.seb.sebserver.gbl.api.API.BulkActionType;
import ch.ethz.seb.sebserver.gbl.api.APIMessage.APIMessageException;
import ch.ethz.seb.sebserver.gbl.api.APIMessage.ErrorMessage;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentialService;
import ch.ethz.seb.sebserver.gbl.api.EntityType;
import ch.ethz.seb.sebserver.gbl.model.EntityKey;
import ch.ethz.seb.sebserver.gbl.model.exam.Exam;
@@ -48,7 +49,6 @@ import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ConfigurationNodeR
import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ExamConfigurationMapRecord;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ExamRecord;
import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.impl.BulkAction;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentialService;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOLoggingSupport;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ExamConfigurationMapDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ExamDAO;
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java
index cc80acbe..baa5308a 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java
@@ -244,7 +244,7 @@ public class ExamDAOImpl implements ExamDAO {
@Override
@Transactional
- public Result setSebRestriction(final Long examId, final boolean sebRestriction) {
+ public Result setSEBRestriction(final Long examId, final boolean sebRestriction) {
return Result.tryCatch(() -> {
final ExamRecord examRecord = new ExamRecord(
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/LmsSetupDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/LmsSetupDAOImpl.java
index 274f4a2c..5a0e59b5 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/LmsSetupDAOImpl.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/LmsSetupDAOImpl.java
@@ -26,6 +26,9 @@ import org.springframework.transaction.annotation.Transactional;
import ch.ethz.seb.sebserver.gbl.api.APIMessage;
import ch.ethz.seb.sebserver.gbl.api.APIMessage.APIMessageException;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentialService;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentials;
+import ch.ethz.seb.sebserver.gbl.client.ProxyData;
import ch.ethz.seb.sebserver.gbl.api.EntityType;
import ch.ethz.seb.sebserver.gbl.model.Domain;
import ch.ethz.seb.sebserver.gbl.model.EntityKey;
@@ -38,9 +41,6 @@ import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.LmsSetupRecordDyn
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.LmsSetupRecordMapper;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.LmsSetupRecord;
import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.impl.BulkAction;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentialService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentials;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ProxyData;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOLoggingSupport;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.LmsSetupDAO;
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/SebClientConfigDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/SEBClientConfigDAOImpl.java
similarity index 85%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/SebClientConfigDAOImpl.java
rename to src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/SEBClientConfigDAOImpl.java
index 6ec19f8d..abf0523c 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/SebClientConfigDAOImpl.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/SEBClientConfigDAOImpl.java
@@ -31,11 +31,13 @@ import org.springframework.transaction.annotation.Transactional;
import ch.ethz.seb.sebserver.gbl.api.APIMessage;
import ch.ethz.seb.sebserver.gbl.api.APIMessage.APIMessageException;
import ch.ethz.seb.sebserver.gbl.api.APIMessage.ErrorMessage;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentialService;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentials;
import ch.ethz.seb.sebserver.gbl.api.EntityType;
import ch.ethz.seb.sebserver.gbl.model.Domain;
import ch.ethz.seb.sebserver.gbl.model.EntityKey;
-import ch.ethz.seb.sebserver.gbl.model.sebconfig.SebClientConfig;
-import ch.ethz.seb.sebserver.gbl.model.sebconfig.SebClientConfig.ConfigPurpose;
+import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
+import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig.ConfigPurpose;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.gbl.util.Utils;
@@ -44,24 +46,22 @@ import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.SebClientConfigRe
import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.AdditionalAttributeRecord;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.SebClientConfigRecord;
import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.impl.BulkAction;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentialService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentials;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOLoggingSupport;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ResourceNotFoundException;
-import ch.ethz.seb.sebserver.webservice.servicelayer.dao.SebClientConfigDAO;
+import ch.ethz.seb.sebserver.webservice.servicelayer.dao.SEBClientConfigDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.TransactionHandler;
@Lazy
@Component
@WebServiceProfile
-public class SebClientConfigDAOImpl implements SebClientConfigDAO {
+public class SEBClientConfigDAOImpl implements SEBClientConfigDAO {
private final SebClientConfigRecordMapper sebClientConfigRecordMapper;
private final ClientCredentialService clientCredentialService;
private final AdditionalAttributesDAOImpl additionalAttributesDAO;
- protected SebClientConfigDAOImpl(
+ protected SEBClientConfigDAOImpl(
final SebClientConfigRecordMapper sebClientConfigRecordMapper,
final ClientCredentialService clientCredentialService,
final AdditionalAttributesDAOImpl additionalAttributesDAO) {
@@ -78,14 +78,14 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
@Override
@Transactional(readOnly = true)
- public Result byPK(final Long id) {
+ public Result byPK(final Long id) {
return recordById(id)
.flatMap(this::toDomainModel);
}
@Override
@Transactional(readOnly = true)
- public Result> all(final Long institutionId, final Boolean active) {
+ public Result> all(final Long institutionId, final Boolean active) {
return Result.tryCatch(() -> {
final List records = (active != null)
@@ -109,9 +109,9 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
@Override
@Transactional(readOnly = true)
- public Result> allMatching(
+ public Result> allMatching(
final FilterMap filterMap,
- final Predicate predicate) {
+ final Predicate predicate) {
return Result.tryCatch(() -> this.sebClientConfigRecordMapper
.selectByExample()
@@ -123,7 +123,7 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
isLikeWhenPresent(filterMap.getName()))
.and(
SebClientConfigRecordDynamicSqlSupport.date,
- isGreaterThanOrEqualToWhenPresent(filterMap.getSebClientConfigFromTime()))
+ isGreaterThanOrEqualToWhenPresent(filterMap.getSEBClientConfigFromTime()))
.and(
SebClientConfigRecordDynamicSqlSupport.active,
isEqualToWhenPresent(filterMap.getActiveAsInt()))
@@ -137,7 +137,7 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
}
@Override
- public Result byClientName(final String clientName) {
+ public Result byClientName(final String clientName) {
return Result.tryCatch(() -> this.sebClientConfigRecordMapper
.selectByExample()
.where(
@@ -210,7 +210,7 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
@Override
@Transactional
- public Result createNew(final SebClientConfig sebClientConfig) {
+ public Result createNew(final SEBClientConfig sebClientConfig) {
return this.clientCredentialService
.generatedClientCredentials()
.map(cc -> {
@@ -240,7 +240,7 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
@Override
@Transactional
- public Result save(final SebClientConfig sebClientConfig) {
+ public Result save(final SEBClientConfig sebClientConfig) {
return Result.tryCatch(() -> {
checkUniqueName(sebClientConfig);
@@ -287,7 +287,7 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
@Override
@Transactional(readOnly = true)
- public Result> allOf(final Set pks) {
+ public Result> allOf(final Set pks) {
return Result.tryCatch(() -> this.sebClientConfigRecordMapper.selectByExample()
.where(SebClientConfigRecordDynamicSqlSupport.id, isIn(new ArrayList<>(pks)))
.build()
@@ -311,7 +311,7 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
@Override
@Transactional(readOnly = true)
- public Result getSebClientCredentials(final String modelId) {
+ public Result getSEBClientCredentials(final String modelId) {
return recordByModelId(modelId)
.map(rec -> new ClientCredentials(
rec.getClientName(),
@@ -355,7 +355,7 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
});
}
- private Result toDomainModel(final SebClientConfigRecord record) {
+ private Result toDomainModel(final SebClientConfigRecord record) {
final Map additionalAttributes = this.additionalAttributesDAO
.getAdditionalAttributes(
@@ -367,37 +367,37 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
AdditionalAttributeRecord::getName,
Function.identity()));
- additionalAttributes.get(SebClientConfig.ATTR_CONFIG_PURPOSE);
+ additionalAttributes.get(SEBClientConfig.ATTR_CONFIG_PURPOSE);
- return Result.tryCatch(() -> new SebClientConfig(
+ return Result.tryCatch(() -> new SEBClientConfig(
record.getId(),
record.getInstitutionId(),
record.getName(),
- additionalAttributes.containsKey(SebClientConfig.ATTR_CONFIG_PURPOSE)
+ additionalAttributes.containsKey(SEBClientConfig.ATTR_CONFIG_PURPOSE)
? ConfigPurpose
- .valueOf(additionalAttributes.get(SebClientConfig.ATTR_CONFIG_PURPOSE).getValue())
+ .valueOf(additionalAttributes.get(SEBClientConfig.ATTR_CONFIG_PURPOSE).getValue())
: ConfigPurpose.START_EXAM,
- additionalAttributes.containsKey(SebClientConfig.ATTR_FALLBACK) &&
- BooleanUtils.toBoolean(additionalAttributes.get(SebClientConfig.ATTR_FALLBACK).getValue()),
- additionalAttributes.containsKey(SebClientConfig.ATTR_FALLBACK_START_URL)
- ? additionalAttributes.get(SebClientConfig.ATTR_FALLBACK_START_URL).getValue()
+ additionalAttributes.containsKey(SEBClientConfig.ATTR_FALLBACK) &&
+ BooleanUtils.toBoolean(additionalAttributes.get(SEBClientConfig.ATTR_FALLBACK).getValue()),
+ additionalAttributes.containsKey(SEBClientConfig.ATTR_FALLBACK_START_URL)
+ ? additionalAttributes.get(SEBClientConfig.ATTR_FALLBACK_START_URL).getValue()
: null,
- additionalAttributes.containsKey(SebClientConfig.ATTR_FALLBACK_TIMEOUT)
- ? Long.parseLong(additionalAttributes.get(SebClientConfig.ATTR_FALLBACK_TIMEOUT).getValue())
+ additionalAttributes.containsKey(SEBClientConfig.ATTR_FALLBACK_TIMEOUT)
+ ? Long.parseLong(additionalAttributes.get(SEBClientConfig.ATTR_FALLBACK_TIMEOUT).getValue())
: null,
- additionalAttributes.containsKey(SebClientConfig.ATTR_FALLBACK_ATTEMPTS)
- ? Short.parseShort(additionalAttributes.get(SebClientConfig.ATTR_FALLBACK_ATTEMPTS).getValue())
+ additionalAttributes.containsKey(SEBClientConfig.ATTR_FALLBACK_ATTEMPTS)
+ ? Short.parseShort(additionalAttributes.get(SEBClientConfig.ATTR_FALLBACK_ATTEMPTS).getValue())
: null,
- additionalAttributes.containsKey(SebClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL)
+ additionalAttributes.containsKey(SEBClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL)
? Short.parseShort(
- additionalAttributes.get(SebClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL).getValue())
+ additionalAttributes.get(SEBClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL).getValue())
: null,
- additionalAttributes.containsKey(SebClientConfig.ATTR_FALLBACK_PASSWORD)
- ? additionalAttributes.get(SebClientConfig.ATTR_FALLBACK_PASSWORD).getValue()
+ additionalAttributes.containsKey(SEBClientConfig.ATTR_FALLBACK_PASSWORD)
+ ? additionalAttributes.get(SEBClientConfig.ATTR_FALLBACK_PASSWORD).getValue()
: null,
null,
- additionalAttributes.containsKey(SebClientConfig.ATTR_QUIT_PASSWORD)
- ? additionalAttributes.get(SebClientConfig.ATTR_QUIT_PASSWORD).getValue()
+ additionalAttributes.containsKey(SEBClientConfig.ATTR_QUIT_PASSWORD)
+ ? additionalAttributes.get(SEBClientConfig.ATTR_QUIT_PASSWORD).getValue()
: null,
null,
record.getDate(),
@@ -406,7 +406,7 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
BooleanUtils.toBooleanObject(record.getActive())));
}
- private String getEncryptionPassword(final SebClientConfig sebClientConfig) {
+ private String getEncryptionPassword(final SEBClientConfig sebClientConfig) {
if (sebClientConfig.hasEncryptionSecret() &&
!sebClientConfig.encryptSecret.equals(sebClientConfig.encryptSecretConfirm)) {
throw new APIMessageException(ErrorMessage.PASSWORD_MISMATCH);
@@ -420,7 +420,7 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
// check if same name already exists for the same institution
// if true an APIMessageException with a field validation error is thrown
- private void checkUniqueName(final SebClientConfig sebClientConfig) {
+ private void checkUniqueName(final SEBClientConfig sebClientConfig) {
final Long otherWithSameName = this.sebClientConfigRecordMapper
.countByExample()
@@ -437,11 +437,11 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
}
}
- private void saveAdditionalAttributes(final SebClientConfig sebClientConfig, final Long configId) {
+ private void saveAdditionalAttributes(final SEBClientConfig sebClientConfig, final Long configId) {
this.additionalAttributesDAO.saveAdditionalAttribute(
EntityType.SEB_CLIENT_CONFIGURATION,
configId,
- SebClientConfig.ATTR_CONFIG_PURPOSE,
+ SEBClientConfig.ATTR_CONFIG_PURPOSE,
(sebClientConfig.configPurpose != null)
? sebClientConfig.configPurpose.name()
: ConfigPurpose.CONFIGURE_CLIENT.name());
@@ -449,79 +449,79 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
this.additionalAttributesDAO.saveAdditionalAttribute(
EntityType.SEB_CLIENT_CONFIGURATION,
configId,
- SebClientConfig.ATTR_FALLBACK,
+ SEBClientConfig.ATTR_FALLBACK,
String.valueOf(BooleanUtils.isTrue(sebClientConfig.fallback)));
if (BooleanUtils.isTrue(sebClientConfig.fallback)) {
this.additionalAttributesDAO.saveAdditionalAttribute(
EntityType.SEB_CLIENT_CONFIGURATION,
configId,
- SebClientConfig.ATTR_FALLBACK_START_URL,
+ SEBClientConfig.ATTR_FALLBACK_START_URL,
sebClientConfig.fallbackStartURL);
} else {
this.additionalAttributesDAO.delete(
configId,
- SebClientConfig.ATTR_FALLBACK_START_URL);
+ SEBClientConfig.ATTR_FALLBACK_START_URL);
}
if (BooleanUtils.isTrue(sebClientConfig.fallback)) {
this.additionalAttributesDAO.saveAdditionalAttribute(
EntityType.SEB_CLIENT_CONFIGURATION,
configId,
- SebClientConfig.ATTR_FALLBACK_TIMEOUT,
+ SEBClientConfig.ATTR_FALLBACK_TIMEOUT,
sebClientConfig.fallbackTimeout.toString());
} else {
this.additionalAttributesDAO.delete(
configId,
- SebClientConfig.ATTR_FALLBACK_TIMEOUT);
+ SEBClientConfig.ATTR_FALLBACK_TIMEOUT);
}
if (BooleanUtils.isTrue(sebClientConfig.fallback)) {
this.additionalAttributesDAO.saveAdditionalAttribute(
EntityType.SEB_CLIENT_CONFIGURATION,
configId,
- SebClientConfig.ATTR_FALLBACK_ATTEMPTS,
+ SEBClientConfig.ATTR_FALLBACK_ATTEMPTS,
sebClientConfig.fallbackAttempts.toString());
} else {
this.additionalAttributesDAO.delete(
configId,
- SebClientConfig.ATTR_FALLBACK_ATTEMPTS);
+ SEBClientConfig.ATTR_FALLBACK_ATTEMPTS);
}
if (BooleanUtils.isTrue(sebClientConfig.fallback)) {
this.additionalAttributesDAO.saveAdditionalAttribute(
EntityType.SEB_CLIENT_CONFIGURATION,
configId,
- SebClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL,
+ SEBClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL,
sebClientConfig.fallbackAttemptInterval.toString());
} else {
this.additionalAttributesDAO.delete(
configId,
- SebClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL);
+ SEBClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL);
}
if (BooleanUtils.isTrue(sebClientConfig.fallback) && StringUtils.isNotBlank(sebClientConfig.fallbackPassword)) {
this.additionalAttributesDAO.saveAdditionalAttribute(
EntityType.SEB_CLIENT_CONFIGURATION,
configId,
- SebClientConfig.ATTR_FALLBACK_PASSWORD,
+ SEBClientConfig.ATTR_FALLBACK_PASSWORD,
this.clientCredentialService.encrypt(sebClientConfig.fallbackPassword).toString());
} else {
this.additionalAttributesDAO.delete(
configId,
- SebClientConfig.ATTR_FALLBACK_PASSWORD);
+ SEBClientConfig.ATTR_FALLBACK_PASSWORD);
}
if (BooleanUtils.isTrue(sebClientConfig.fallback) && StringUtils.isNotBlank(sebClientConfig.quitPassword)) {
this.additionalAttributesDAO.saveAdditionalAttribute(
EntityType.SEB_CLIENT_CONFIGURATION,
configId,
- SebClientConfig.ATTR_QUIT_PASSWORD,
+ SEBClientConfig.ATTR_QUIT_PASSWORD,
this.clientCredentialService.encrypt(sebClientConfig.quitPassword).toString());
} else {
this.additionalAttributesDAO.delete(
configId,
- SebClientConfig.ATTR_QUIT_PASSWORD);
+ SEBClientConfig.ATTR_QUIT_PASSWORD);
}
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/exam/ExamAdminServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/exam/ExamAdminServiceImpl.java
index 71fcaae6..37a680ac 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/exam/ExamAdminServiceImpl.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/exam/ExamAdminServiceImpl.java
@@ -25,7 +25,7 @@ import ch.ethz.seb.sebserver.gbl.api.JSONMapper;
import ch.ethz.seb.sebserver.gbl.model.exam.Exam;
import ch.ethz.seb.sebserver.gbl.model.exam.Indicator;
import ch.ethz.seb.sebserver.gbl.model.exam.Indicator.IndicatorType;
-import ch.ethz.seb.sebserver.gbl.model.exam.OpenEdxSebRestriction;
+import ch.ethz.seb.sebserver.gbl.model.exam.OpenEdxSEBRestriction;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup.LmsType;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
@@ -34,7 +34,7 @@ import ch.ethz.seb.sebserver.webservice.servicelayer.dao.AdditionalAttributesDAO
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ExamDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.IndicatorDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPIService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.lms.SebRestrictionService;
+import ch.ethz.seb.sebserver.webservice.servicelayer.lms.SEBRestrictionService;
@Lazy
@Service
@@ -109,14 +109,14 @@ public class ExamAdminServiceImpl implements ExamAdminService {
if (lmsSetup.lmsType == LmsType.OPEN_EDX) {
final List permissions = Arrays.asList(
- OpenEdxSebRestriction.PermissionComponent.ALWAYS_ALLOW_STAFF.key,
- OpenEdxSebRestriction.PermissionComponent.CHECK_CONFIG_KEY.key);
+ OpenEdxSEBRestriction.PermissionComponent.ALWAYS_ALLOW_STAFF.key,
+ OpenEdxSEBRestriction.PermissionComponent.CHECK_CONFIG_KEY.key);
this.additionalAttributesDAO.saveAdditionalAttribute(
EntityType.EXAM,
exam.id,
- SebRestrictionService.SEB_RESTRICTION_ADDITIONAL_PROPERTY_NAME_PREFIX +
- OpenEdxSebRestriction.ATTR_PERMISSION_COMPONENTS,
+ SEBRestrictionService.SEB_RESTRICTION_ADDITIONAL_PROPERTY_NAME_PREFIX +
+ OpenEdxSEBRestriction.ATTR_PERMISSION_COMPONENTS,
StringUtils.join(permissions, Constants.LIST_SEPARATOR_CHAR))
.getOrThrow();
}
@@ -135,7 +135,7 @@ public class ExamAdminServiceImpl implements ExamAdminService {
return this.lmsAPIService
.getLmsAPITemplate(exam.lmsSetupId)
- .map(lmsAPI -> !lmsAPI.getSebClientRestriction(exam).hasError());
+ .map(lmsAPI -> !lmsAPI.getSEBClientRestriction(exam).hasError());
}
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/LmsAPITemplate.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/LmsAPITemplate.java
index a9d897a7..4e4a1b0b 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/LmsAPITemplate.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/LmsAPITemplate.java
@@ -22,7 +22,7 @@ import ch.ethz.seb.sebserver.gbl.api.EntityType;
import ch.ethz.seb.sebserver.gbl.model.exam.Chapters;
import ch.ethz.seb.sebserver.gbl.model.exam.Exam;
import ch.ethz.seb.sebserver.gbl.model.exam.QuizData;
-import ch.ethz.seb.sebserver.gbl.model.exam.SebRestriction;
+import ch.ethz.seb.sebserver.gbl.model.exam.SEBRestriction;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetupTestResult;
import ch.ethz.seb.sebserver.gbl.util.Result;
@@ -111,37 +111,37 @@ public interface LmsAPITemplate {
/** Used to get a list of chapters (display name and chapter-identifier) that can be used to
* apply chapter-based SEB restriction for a specified course.
- *
+ *
* The availability of this depends on the type of LMS and on installed plugins that supports this feature.
* If this is not supported by the underling LMS a UnsupportedOperationException will be presented
* within the Result.
- *
+ *
* @param courseId The course identifier
* @return Result referencing to the Chapters model for the given course or to an error when happened. */
Result getCourseChapters(String courseId);
- /** Get SEB restriction data form LMS within a SebRestrictionData instance if available
+ /** Get SEB restriction data form LMS within a SEBRestrictionData instance if available
* or a ResourceNotFoundException if not yet available or restricted
*
* @param exam the exam to get the SEB restriction data for
- * @return Result refer to the SebRestrictionData instance or to an ResourceNotFoundException if restriction is
+ * @return Result refer to the SEBRestrictionData instance or to an ResourceNotFoundException if restriction is
* missing or to another exception on unexpected error case */
- Result getSebClientRestriction(Exam exam);
+ Result getSEBClientRestriction(Exam exam);
/** Applies a SEB Client restriction within the LMS with the given attributes.
*
* @param externalExamId The exam identifier from LMS side (Exam.externalId)
* @param sebRestrictionData containing all data for SEB Client restriction
- * @return Result refer to the given SebRestrictionData if restriction was successful or to an error if not */
- Result applySebClientRestriction(
+ * @return Result refer to the given SEBRestrictionData if restriction was successful or to an error if not */
+ Result applySEBClientRestriction(
String externalExamId,
- SebRestriction sebRestrictionData);
+ SEBRestriction sebRestrictionData);
/** Releases an already applied SEB Client restriction within the LMS for a given Exam.
* This completely removes the SEB Client restriction on LMS side.
*
* @param exam the Exam to release the restriction for
* @return Result refer to the given Exam if successful or to an error if not */
- Result releaseSebClientRestriction(Exam exam);
+ Result releaseSEBClientRestriction(Exam exam);
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/SebRestrictionService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/SEBRestrictionService.java
similarity index 74%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/SebRestrictionService.java
rename to src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/SEBRestrictionService.java
index 3c97bb19..3cea6a00 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/SebRestrictionService.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/SEBRestrictionService.java
@@ -9,32 +9,32 @@
package ch.ethz.seb.sebserver.webservice.servicelayer.lms;
import ch.ethz.seb.sebserver.gbl.model.exam.Exam;
-import ch.ethz.seb.sebserver.gbl.model.exam.SebRestriction;
+import ch.ethz.seb.sebserver.gbl.model.exam.SEBRestriction;
import ch.ethz.seb.sebserver.gbl.util.Result;
-public interface SebRestrictionService {
+public interface SEBRestrictionService {
/** Used as name prefix to store additional SEB restriction properties within AdditionalAttribute domain. */
String SEB_RESTRICTION_ADDITIONAL_PROPERTY_NAME_PREFIX = "sebRestrictionProp_";
String SEB_RESTRICTION_ADDITIONAL_PROPERTY_CONFIG_KEY = "config_key";
- /** Get the SebRestriction properties for specified Exam.
+ /** Get the SEBRestriction properties for specified Exam.
*
* @param exam the Exam
- * @return the SebRestriction properties for specified Exam */
- Result getSebRestrictionFromExam(Exam exam);
+ * @return the SEBRestriction properties for specified Exam */
+ Result getSEBRestrictionFromExam(Exam exam);
- /** Saves the given SebRestriction for the given Exam.
+ /** Saves the given SEBRestriction for the given Exam.
*
* The webservice saves the given browser Exam keys within the Exam record
* and given additional restriction properties within the Additional attributes linked
* to the given Exam.
*
* @param exam the Exam instance to save the SEB restrictions for
- * @param sebRestriction SebRestriction data containing generic and LMS specific restriction attributes
+ * @param sebRestriction SEBRestriction data containing generic and LMS specific restriction attributes
* @return Result refer to the given Exam instance or to an error if happened */
- Result saveSebRestrictionToExam(Exam exam, SebRestriction sebRestriction);
+ Result saveSEBRestrictionToExam(Exam exam, SEBRestriction sebRestriction);
/** Used to apply SEB Client restriction within the LMS API for a specified Exam.
* If the underling LMS Setup API didn't support the SEB restriction feature
@@ -42,12 +42,12 @@ public interface SebRestrictionService {
*
* @param exam the Exam instance
* @return Result refer to the Exam instance or to an error if happened */
- Result applySebClientRestriction(Exam exam);
+ Result applySEBClientRestriction(Exam exam);
/** Release SEB Client restriction within the LMS API for a specified Exam.
*
* @param exam the Exam instance
* @return Result refer to the Exam instance or to an error if happened */
- Result releaseSebClientRestriction(Exam exam);
+ Result releaseSEBClientRestriction(Exam exam);
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/LmsAPIServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/LmsAPIServiceImpl.java
index c0d46030..3c83aa98 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/LmsAPIServiceImpl.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/LmsAPIServiceImpl.java
@@ -22,6 +22,9 @@ import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;
import ch.ethz.seb.sebserver.gbl.Constants;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentialService;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentials;
+import ch.ethz.seb.sebserver.gbl.client.ProxyData;
import ch.ethz.seb.sebserver.gbl.model.Page;
import ch.ethz.seb.sebserver.gbl.model.exam.QuizData;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup;
@@ -29,9 +32,6 @@ import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetupTestResult;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.webservice.WebserviceInfo;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentialService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentials;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ProxyData;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.LmsSetupDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPIService;
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/MockupLmsAPITemplate.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/MockupLmsAPITemplate.java
index 5ee7ea2e..ae3cfaeb 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/MockupLmsAPITemplate.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/MockupLmsAPITemplate.java
@@ -22,17 +22,17 @@ import org.slf4j.LoggerFactory;
import ch.ethz.seb.sebserver.gbl.Constants;
import ch.ethz.seb.sebserver.gbl.api.APIMessage;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentials;
import ch.ethz.seb.sebserver.gbl.model.Domain.LMS_SETUP;
import ch.ethz.seb.sebserver.gbl.model.exam.Chapters;
import ch.ethz.seb.sebserver.gbl.model.exam.Exam;
import ch.ethz.seb.sebserver.gbl.model.exam.QuizData;
-import ch.ethz.seb.sebserver.gbl.model.exam.SebRestriction;
+import ch.ethz.seb.sebserver.gbl.model.exam.SEBRestriction;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup.LmsType;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetupTestResult;
import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.webservice.WebserviceInfo;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentials;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap;
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPIService;
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPITemplate;
@@ -61,7 +61,7 @@ final class MockupLmsAPITemplate implements LmsAPITemplate {
this.mockups = new ArrayList<>();
this.mockups.add(new QuizData(
"quiz1", institutionId, lmsSetupId, lmsType, "Demo Quiz 1 (MOCKUP)", "Demo Quiz Mockup",
- "2020-01-01T09:00:00Z", "2021-01-01T09:00:00Z", "http://lms.mockup.com/api/"));
+ "2020-01-01T09:00:00Z", null, "http://lms.mockup.com/api/"));
this.mockups.add(new QuizData(
"quiz2", institutionId, lmsSetupId, lmsType, "Demo Quiz 2 (MOCKUP)", "Demo Quiz Mockup",
"2020-01-01T09:00:00Z", "2021-01-01T09:00:00Z", "http://lms.mockup.com/api/"));
@@ -184,22 +184,22 @@ final class MockupLmsAPITemplate implements LmsAPITemplate {
}
@Override
- public Result getSebClientRestriction(final Exam exam) {
+ public Result getSEBClientRestriction(final Exam exam) {
log.info("Apply SEB Client restriction for Exam: {}", exam);
- return Result.ofError(new NoSebRestrictionException());
+ return Result.ofError(new NoSEBRestrictionException());
}
@Override
- public Result applySebClientRestriction(
+ public Result applySEBClientRestriction(
final String externalExamId,
- final SebRestriction sebRestrictionData) {
+ final SEBRestriction sebRestrictionData) {
log.info("Apply SEB Client restriction: {}", sebRestrictionData);
return Result.of(sebRestrictionData);
}
@Override
- public Result releaseSebClientRestriction(final Exam exam) {
+ public Result releaseSEBClientRestriction(final Exam exam) {
log.info("Release SEB Client restriction for Exam: {}", exam);
return Result.of(exam);
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/NoSebRestrictionException.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/NoSEBRestrictionException.java
similarity index 71%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/NoSebRestrictionException.java
rename to src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/NoSEBRestrictionException.java
index bf41bfc7..c4551cfe 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/NoSebRestrictionException.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/NoSEBRestrictionException.java
@@ -8,14 +8,14 @@
package ch.ethz.seb.sebserver.webservice.servicelayer.lms.impl;
-public class NoSebRestrictionException extends RuntimeException {
+public class NoSEBRestrictionException extends RuntimeException {
private static final long serialVersionUID = -6444577025412136884L;
- public NoSebRestrictionException() {
+ public NoSEBRestrictionException() {
}
- public NoSebRestrictionException(final Throwable cause) {
+ public NoSEBRestrictionException(final Throwable cause) {
super(cause);
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/SebRestrictionServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/SEBRestrictionServiceImpl.java
similarity index 88%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/SebRestrictionServiceImpl.java
rename to src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/SEBRestrictionServiceImpl.java
index d312092c..3b3f6d01 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/SebRestrictionServiceImpl.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/SEBRestrictionServiceImpl.java
@@ -28,29 +28,29 @@ import org.springframework.transaction.annotation.Transactional;
import ch.ethz.seb.sebserver.gbl.Constants;
import ch.ethz.seb.sebserver.gbl.api.EntityType;
import ch.ethz.seb.sebserver.gbl.model.exam.Exam;
-import ch.ethz.seb.sebserver.gbl.model.exam.SebRestriction;
+import ch.ethz.seb.sebserver.gbl.model.exam.SEBRestriction;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup.Features;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.AdditionalAttributesDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ExamDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPIService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.lms.SebRestrictionService;
+import ch.ethz.seb.sebserver.webservice.servicelayer.lms.SEBRestrictionService;
import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.ExamConfigService;
@Lazy
@Service
@WebServiceProfile
-public class SebRestrictionServiceImpl implements SebRestrictionService {
+public class SEBRestrictionServiceImpl implements SEBRestrictionService {
- private static final Logger log = LoggerFactory.getLogger(SebRestrictionServiceImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(SEBRestrictionServiceImpl.class);
private final ExamDAO examDAO;
private final LmsAPIService lmsAPIService;
private final AdditionalAttributesDAO additionalAttributesDAO;
private final ExamConfigService examConfigService;
- protected SebRestrictionServiceImpl(
+ protected SEBRestrictionServiceImpl(
final ExamDAO examDAO,
final LmsAPIService lmsAPIService,
final AdditionalAttributesDAO additionalAttributesDAO,
@@ -64,7 +64,7 @@ public class SebRestrictionServiceImpl implements SebRestrictionService {
@Override
@Transactional
- public Result getSebRestrictionFromExam(final Exam exam) {
+ public Result getSEBRestrictionFromExam(final Exam exam) {
return Result.tryCatch(() -> {
// load the config keys from restriction and merge with new generated config keys
final Set configKeys = new HashSet<>();
@@ -76,7 +76,7 @@ public class SebRestrictionServiceImpl implements SebRestrictionService {
if (generatedKeys != null && !generatedKeys.isEmpty()) {
configKeys.addAll(this.lmsAPIService
.getLmsAPITemplate(exam.lmsSetupId)
- .flatMap(lmsTemplate -> lmsTemplate.getSebClientRestriction(exam))
+ .flatMap(lmsTemplate -> lmsTemplate.getSEBClientRestriction(exam))
.map(r -> r.configKeys)
.getOr(Collections.emptyList()));
}
@@ -110,7 +110,7 @@ public class SebRestrictionServiceImpl implements SebRestrictionService {
e);
}
- return new SebRestriction(
+ return new SEBRestriction(
exam.id,
configKeys,
browserExamKeys,
@@ -120,10 +120,10 @@ public class SebRestrictionServiceImpl implements SebRestrictionService {
@Override
@Transactional
- public Result saveSebRestrictionToExam(final Exam exam, final SebRestriction sebRestriction) {
+ public Result saveSEBRestrictionToExam(final Exam exam, final SEBRestriction sebRestriction) {
if (log.isDebugEnabled()) {
- log.debug("Save SebRestriction: {} for Exam: {}", sebRestriction, exam);
+ log.debug("Save SEBRestriction: {} for Exam: {}", sebRestriction, exam);
}
return Result.tryCatch(() -> {
@@ -166,7 +166,7 @@ public class SebRestrictionServiceImpl implements SebRestrictionService {
}
@Override
- public Result applySebClientRestriction(final Exam exam) {
+ public Result applySEBClientRestriction(final Exam exam) {
if (!this.lmsAPIService
.getLmsSetup(exam.lmsSetupId)
.getOrThrow().lmsType.features.contains(Features.SEB_RESTRICTION)) {
@@ -174,16 +174,16 @@ public class SebRestrictionServiceImpl implements SebRestrictionService {
return Result.of(exam);
}
- return this.getSebRestrictionFromExam(exam)
+ return this.getSEBRestrictionFromExam(exam)
.map(sebRestrictionData -> {
if (log.isDebugEnabled()) {
- log.debug("Appling SEB Client restriction on LMS with: {}", sebRestrictionData);
+ log.debug("Applying SEB Client restriction on LMS with: {}", sebRestrictionData);
}
return this.lmsAPIService
.getLmsAPITemplate(exam.lmsSetupId)
- .flatMap(lmsTemplate -> lmsTemplate.applySebClientRestriction(
+ .flatMap(lmsTemplate -> lmsTemplate.applySEBClientRestriction(
exam.externalId,
sebRestrictionData))
.map(data -> exam)
@@ -192,7 +192,7 @@ public class SebRestrictionServiceImpl implements SebRestrictionService {
}
@Override
- public Result releaseSebClientRestriction(final Exam exam) {
+ public Result releaseSEBClientRestriction(final Exam exam) {
if (log.isDebugEnabled()) {
log.debug("Release SEB Client restrictions for exam: {}", exam);
@@ -200,7 +200,7 @@ public class SebRestrictionServiceImpl implements SebRestrictionService {
return this.lmsAPIService
.getLmsAPITemplate(exam.lmsSetupId)
- .flatMap(template -> template.releaseSebClientRestriction(exam));
+ .flatMap(template -> template.releaseSEBClientRestriction(exam));
}
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/edx/OpenEdxCourseRestriction.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/edx/OpenEdxCourseRestriction.java
index 71b1f840..54cf7e84 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/edx/OpenEdxCourseRestriction.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/edx/OpenEdxCourseRestriction.java
@@ -26,11 +26,11 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import ch.ethz.seb.sebserver.gbl.api.APIMessage;
import ch.ethz.seb.sebserver.gbl.api.APIMessage.APIMessageException;
import ch.ethz.seb.sebserver.gbl.api.JSONMapper;
-import ch.ethz.seb.sebserver.gbl.model.exam.OpenEdxSebRestriction;
+import ch.ethz.seb.sebserver.gbl.model.exam.OpenEdxSEBRestriction;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetupTestResult;
import ch.ethz.seb.sebserver.gbl.util.Result;
-import ch.ethz.seb.sebserver.webservice.servicelayer.lms.impl.NoSebRestrictionException;
+import ch.ethz.seb.sebserver.webservice.servicelayer.lms.impl.NoSEBRestrictionException;
public class OpenEdxCourseRestriction {
@@ -104,24 +104,24 @@ public class OpenEdxCourseRestriction {
return LmsSetupTestResult.ofOkay();
}
- Result getSebRestriction(final String courseId) {
+ Result getSEBRestriction(final String courseId) {
if (log.isDebugEnabled()) {
log.debug("GET SEB Client restriction on course: {}", courseId);
}
return Result.tryCatch(() -> {
- final String url = this.lmsSetup.lmsApiUrl + getSebRestrictionUrl(courseId);
+ final String url = this.lmsSetup.lmsApiUrl + getSEBRestrictionUrl(courseId);
final HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
httpHeaders.add(HttpHeaders.CACHE_CONTROL, "no-cache, no-store, must-revalidate");
try {
- final OpenEdxSebRestriction data = this.restTemplate.exchange(
+ final OpenEdxSEBRestriction data = this.restTemplate.exchange(
url,
HttpMethod.GET,
new HttpEntity<>(httpHeaders),
- OpenEdxSebRestriction.class)
+ OpenEdxSEBRestriction.class)
.getBody();
if (log.isDebugEnabled()) {
@@ -130,36 +130,36 @@ public class OpenEdxCourseRestriction {
return data;
} catch (final HttpClientErrorException ce) {
if (ce.getStatusCode() == HttpStatus.NOT_FOUND || ce.getStatusCode() == HttpStatus.UNAUTHORIZED) {
- throw new NoSebRestrictionException(ce);
+ throw new NoSEBRestrictionException(ce);
}
throw ce;
}
});
}
- Result putSebRestriction(
+ Result putSEBRestriction(
final String courseId,
- final OpenEdxSebRestriction restriction) {
+ final OpenEdxSEBRestriction restriction) {
if (log.isDebugEnabled()) {
log.debug("PUT SEB Client restriction on course: {} : {}", courseId, restriction);
}
- return handleSebRestriction(processSebRestrictionUpdate(pushSebRestrictionFunction(
+ return handleSEBRestriction(processSEBRestrictionUpdate(pushSEBRestrictionFunction(
restriction,
courseId)));
}
- Result deleteSebRestriction(final String courseId) {
+ Result deleteSEBRestriction(final String courseId) {
if (log.isDebugEnabled()) {
log.debug("DELETE SEB Client restriction on course: {}", courseId);
}
- return handleSebRestriction(processSebRestrictionUpdate(deleteSebRestrictionFunction(courseId)));
+ return handleSEBRestriction(processSEBRestrictionUpdate(deleteSEBRestrictionFunction(courseId)));
}
- private BooleanSupplier processSebRestrictionUpdate(final BooleanSupplier restrictionUpdate) {
+ private BooleanSupplier processSEBRestrictionUpdate(final BooleanSupplier restrictionUpdate) {
return () -> {
if (this.restrictionAPIPushCount > 0) {
// NOTE: This is a temporary work-around for SEB Restriction API within Open edX SEB integration plugin to
@@ -193,20 +193,20 @@ public class OpenEdxCourseRestriction {
};
}
- private BooleanSupplier pushSebRestrictionFunction(
- final OpenEdxSebRestriction restriction,
+ private BooleanSupplier pushSEBRestrictionFunction(
+ final OpenEdxSEBRestriction restriction,
final String courseId) {
- final String url = this.lmsSetup.lmsApiUrl + getSebRestrictionUrl(courseId);
+ final String url = this.lmsSetup.lmsApiUrl + getSEBRestrictionUrl(courseId);
final HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
httpHeaders.add(HttpHeaders.CACHE_CONTROL, "no-cache, no-store, must-revalidate");
return () -> {
- final OpenEdxSebRestriction body = this.restTemplate.exchange(
+ final OpenEdxSEBRestriction body = this.restTemplate.exchange(
url,
HttpMethod.PUT,
new HttpEntity<>(toJson(restriction), httpHeaders),
- OpenEdxSebRestriction.class)
+ OpenEdxSEBRestriction.class)
.getBody();
if (log.isDebugEnabled()) {
@@ -217,9 +217,9 @@ public class OpenEdxCourseRestriction {
};
}
- private BooleanSupplier deleteSebRestrictionFunction(final String courseId) {
+ private BooleanSupplier deleteSEBRestrictionFunction(final String courseId) {
- final String url = this.lmsSetup.lmsApiUrl + getSebRestrictionUrl(courseId);
+ final String url = this.lmsSetup.lmsApiUrl + getSEBRestrictionUrl(courseId);
return () -> {
final HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add(HttpHeaders.CACHE_CONTROL, "no-cache, no-store, must-revalidate");
@@ -242,7 +242,7 @@ public class OpenEdxCourseRestriction {
};
}
- private Result handleSebRestriction(final BooleanSupplier task) {
+ private Result handleSEBRestriction(final BooleanSupplier task) {
return getRestTemplate()
.map(restTemplate -> {
try {
@@ -259,7 +259,7 @@ public class OpenEdxCourseRestriction {
});
}
- private String getSebRestrictionUrl(final String courseId) {
+ private String getSEBRestrictionUrl(final String courseId) {
return String.format(OPEN_EDX_DEFAULT_COURSE_RESTRICTION_API_PATH, courseId);
}
@@ -277,7 +277,7 @@ public class OpenEdxCourseRestriction {
return Result.of(this.restTemplate);
}
- private String toJson(final OpenEdxSebRestriction restriction) {
+ private String toJson(final OpenEdxSEBRestriction restriction) {
try {
return this.jsonMapper.writeValueAsString(restriction);
} catch (final JsonProcessingException e) {
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/edx/OpenEdxLmsAPITemplate.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/edx/OpenEdxLmsAPITemplate.java
index 4390e623..2ee937c8 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/edx/OpenEdxLmsAPITemplate.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/edx/OpenEdxLmsAPITemplate.java
@@ -19,9 +19,9 @@ import org.slf4j.LoggerFactory;
import ch.ethz.seb.sebserver.gbl.model.exam.Chapters;
import ch.ethz.seb.sebserver.gbl.model.exam.Exam;
-import ch.ethz.seb.sebserver.gbl.model.exam.OpenEdxSebRestriction;
+import ch.ethz.seb.sebserver.gbl.model.exam.OpenEdxSEBRestriction;
import ch.ethz.seb.sebserver.gbl.model.exam.QuizData;
-import ch.ethz.seb.sebserver.gbl.model.exam.SebRestriction;
+import ch.ethz.seb.sebserver.gbl.model.exam.SEBRestriction;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetupTestResult;
import ch.ethz.seb.sebserver.gbl.util.Result;
@@ -87,40 +87,40 @@ final class OpenEdxLmsAPITemplate implements LmsAPITemplate {
}
@Override
- public Result getSebClientRestriction(final Exam exam) {
+ public Result getSEBClientRestriction(final Exam exam) {
if (log.isDebugEnabled()) {
log.debug("Get SEB Client restriction for Exam: {}", exam);
}
return this.openEdxCourseRestriction
- .getSebRestriction(exam.externalId)
- .map(restriction -> SebRestriction.from(exam.id, restriction));
+ .getSEBRestriction(exam.externalId)
+ .map(restriction -> SEBRestriction.from(exam.id, restriction));
}
@Override
- public Result applySebClientRestriction(
+ public Result applySEBClientRestriction(
final String externalExamId,
- final SebRestriction sebRestrictionData) {
+ final SEBRestriction sebRestrictionData) {
if (log.isDebugEnabled()) {
log.debug("Apply SEB Client restriction: {}", sebRestrictionData);
}
return this.openEdxCourseRestriction
- .putSebRestriction(
+ .putSEBRestriction(
externalExamId,
- OpenEdxSebRestriction.from(sebRestrictionData))
+ OpenEdxSEBRestriction.from(sebRestrictionData))
.map(result -> sebRestrictionData);
}
@Override
- public Result releaseSebClientRestriction(final Exam exam) {
+ public Result releaseSEBClientRestriction(final Exam exam) {
if (log.isDebugEnabled()) {
log.debug("Release SEB Client restriction for Exam: {}", exam);
}
- return this.openEdxCourseRestriction.deleteSebRestriction(exam.externalId)
+ return this.openEdxCourseRestriction.deleteSEBRestriction(exam.externalId)
.map(result -> exam);
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/edx/OpenEdxLmsAPITemplateFactory.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/edx/OpenEdxLmsAPITemplateFactory.java
index 87ef5114..0be3ed27 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/edx/OpenEdxLmsAPITemplateFactory.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/edx/OpenEdxLmsAPITemplateFactory.java
@@ -17,13 +17,13 @@ import ch.ethz.seb.sebserver.ClientHttpRequestFactoryService;
import ch.ethz.seb.sebserver.gbl.Constants;
import ch.ethz.seb.sebserver.gbl.api.JSONMapper;
import ch.ethz.seb.sebserver.gbl.async.AsyncService;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentialService;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentials;
+import ch.ethz.seb.sebserver.gbl.client.ProxyData;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.webservice.WebserviceInfo;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentialService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentials;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ProxyData;
@Lazy
@Service
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/edx/OpenEdxRestTemplateFactory.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/edx/OpenEdxRestTemplateFactory.java
index 00692faf..77dc9f44 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/edx/OpenEdxRestTemplateFactory.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/edx/OpenEdxRestTemplateFactory.java
@@ -35,13 +35,13 @@ import org.springframework.util.MultiValueMap;
import ch.ethz.seb.sebserver.ClientHttpRequestFactoryService;
import ch.ethz.seb.sebserver.gbl.Constants;
import ch.ethz.seb.sebserver.gbl.api.APIMessage;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentialService;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentials;
+import ch.ethz.seb.sebserver.gbl.client.ProxyData;
import ch.ethz.seb.sebserver.gbl.model.Domain.LMS_SETUP;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetupTestResult;
import ch.ethz.seb.sebserver.gbl.util.Result;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentialService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentials;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ProxyData;
final class OpenEdxRestTemplateFactory {
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleLmsAPITemplate.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleLmsAPITemplate.java
index 8c94442b..7aae8ec6 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleLmsAPITemplate.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleLmsAPITemplate.java
@@ -15,7 +15,7 @@ import java.util.Set;
import ch.ethz.seb.sebserver.gbl.model.exam.Chapters;
import ch.ethz.seb.sebserver.gbl.model.exam.Exam;
import ch.ethz.seb.sebserver.gbl.model.exam.QuizData;
-import ch.ethz.seb.sebserver.gbl.model.exam.SebRestriction;
+import ch.ethz.seb.sebserver.gbl.model.exam.SEBRestriction;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetupTestResult;
import ch.ethz.seb.sebserver.gbl.util.Result;
@@ -75,20 +75,20 @@ public class MoodleLmsAPITemplate implements LmsAPITemplate {
}
@Override
- public Result getSebClientRestriction(final Exam exam) {
+ public Result getSEBClientRestriction(final Exam exam) {
return Result.ofError(new UnsupportedOperationException("SEB Restriction API not available yet"));
}
@Override
- public Result applySebClientRestriction(
+ public Result applySEBClientRestriction(
final String externalExamId,
- final SebRestriction sebRestrictionData) {
+ final SEBRestriction sebRestrictionData) {
return Result.ofError(new UnsupportedOperationException("SEB Restriction API not available yet"));
}
@Override
- public Result releaseSebClientRestriction(final Exam exam) {
+ public Result releaseSEBClientRestriction(final Exam exam) {
return Result.ofError(new UnsupportedOperationException("SEB Restriction API not available yet"));
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleLmsAPITemplateFactory.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleLmsAPITemplateFactory.java
index 30492c09..b6b1114a 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleLmsAPITemplateFactory.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleLmsAPITemplateFactory.java
@@ -17,12 +17,12 @@ import ch.ethz.seb.sebserver.ClientHttpRequestFactoryService;
import ch.ethz.seb.sebserver.gbl.Constants;
import ch.ethz.seb.sebserver.gbl.api.JSONMapper;
import ch.ethz.seb.sebserver.gbl.async.AsyncService;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentialService;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentials;
+import ch.ethz.seb.sebserver.gbl.client.ProxyData;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Result;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentialService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentials;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ProxyData;
@Lazy
@Service
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleRestTemplateFactory.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleRestTemplateFactory.java
index 8fb42471..6dfbc0c2 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleRestTemplateFactory.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleRestTemplateFactory.java
@@ -11,14 +11,15 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.lms.impl.moodle;
import ch.ethz.seb.sebserver.ClientHttpRequestFactoryService;
import ch.ethz.seb.sebserver.gbl.api.APIMessage;
import ch.ethz.seb.sebserver.gbl.api.JSONMapper;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentialService;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentials;
+import ch.ethz.seb.sebserver.gbl.client.ProxyData;
import ch.ethz.seb.sebserver.gbl.model.Domain.LMS_SETUP;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetupTestResult;
import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.gbl.util.Utils;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentialService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentials;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ProxyData;
+
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/ClientConfigService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/ClientConfigService.java
index d19a9786..8f1f6db4 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/ClientConfigService.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/ClientConfigService.java
@@ -17,7 +17,7 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.security.oauth2.provider.ClientDetails;
import ch.ethz.seb.sebserver.gbl.async.AsyncServiceSpringConfig;
-import ch.ethz.seb.sebserver.gbl.model.sebconfig.SebClientConfig;
+import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
import ch.ethz.seb.sebserver.gbl.util.Result;
public interface ClientConfigService {
@@ -27,32 +27,32 @@ public interface ClientConfigService {
/** The cache name of ClientDetails */
String EXAM_CLIENT_DETAILS_CACHE = "EXAM_CLIENT_DETAILS_CACHE";
- /** Indicates if there is any SebClientConfiguration for a specified institution.
+ /** Indicates if there is any SEBClientConfiguration for a specified institution.
*
* @param institutionId the institution identifier
- * @return true if there is any SebClientConfiguration for a specified institution. False otherwise */
- boolean hasSebClientConfigurationForInstitution(Long institutionId);
+ * @return true if there is any SEBClientConfiguration for a specified institution. False otherwise */
+ boolean hasSEBClientConfigurationForInstitution(Long institutionId);
- /** Use this to auto-generate a SebClientConfiguration for a specified institution.
+ /** Use this to auto-generate a SEBClientConfiguration for a specified institution.
* clientName and clientSecret are randomly generated.
*
* @param institutionId the institution identifier
- * @return the created SebClientConfig */
- Result autoCreateSebClientConfigurationForInstitution(Long institutionId);
+ * @return the created SEBClientConfiguration */
+ Result autoCreateSEBClientConfigurationForInstitution(Long institutionId);
- /** Use this to export a specified SebClientConfiguration within a given OutputStream.
+ /** Use this to export a specified SEBClientConfiguration within a given OutputStream.
* The SEB Client Configuration is exported in the defined SEB Configuration format
* as described here: https://www.safeexambrowser.org/developer/seb-file-format.html
*
* @param out OutputStream to write the export to
- * @param modelId the model identifier of the SebClientConfiguration to export */
- void exportSebClientConfiguration(
+ * @param modelId the model identifier of the SEBClientConfiguration to export */
+ void exportSEBClientConfiguration(
OutputStream out,
final String modelId);
- /** Get the ClientDetails for given client name that identifies a SebClientConfig entry.
+ /** Get the ClientDetails for given client name that identifies a SEBClientConfiguration entry.
*
- * @param clientName the client name of a SebClientConfig entry
+ * @param clientName the client name of a SEBClientConfiguration entry
* @return Result refer to the ClientDetails for the specified clientName or to an error if happened */
@Cacheable(
cacheNames = EXAM_CLIENT_DETAILS_CACHE,
@@ -60,12 +60,12 @@ public interface ClientConfigService {
unless = "#result.hasError()")
Result getClientConfigDetails(String clientName);
- /** Internally used to check OAuth2 access for a active SebClientConfig.
+ /** Internally used to check OAuth2 access for a active SEBClientConfig.
*
- * @param config the SebClientConfig to check access
+ * @param config the SEBClientConfig to check access
* @return true if the system was able to gain an access token for the client. False otherwise */
- boolean checkAccess(SebClientConfig config);
+ boolean checkAccess(SEBClientConfig config);
@Async(AsyncServiceSpringConfig.EXECUTOR_BEAN_NAME)
- void initalCheckAccess(SebClientConfig config);
+ void initalCheckAccess(SEBClientConfig config);
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SebConfigCryptor.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SEBConfigCryptor.java
similarity index 84%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SebConfigCryptor.java
rename to src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SEBConfigCryptor.java
index 5003c6fe..9c44edb7 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SebConfigCryptor.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SEBConfigCryptor.java
@@ -15,13 +15,13 @@ import java.util.Set;
import org.springframework.scheduling.annotation.Async;
import ch.ethz.seb.sebserver.gbl.async.AsyncServiceSpringConfig;
-import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SebConfigEncryptionService.Strategy;
+import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SEBConfigEncryptionService.Strategy;
/** Interface for a SEB Configuration encryption and decryption strategy.
*
* To support a new SEB Configuration encryption and decryption strategy use this interface
* to implement a concrete strategy for encryption and decryption of SEB configurations */
-public interface SebConfigCryptor {
+public interface SEBConfigCryptor {
/** The type of strategies a concrete implementation is supporting
*
@@ -33,23 +33,23 @@ public interface SebConfigCryptor {
*
* @param output the output stream to write encrypted data to
* @param input the input stream to read plain data from
- * @param context the SebConfigEncryptionContext to access strategy specific data needed for encryption */
+ * @param context the SEBConfigEncryptionContext to access strategy specific data needed for encryption */
@Async(AsyncServiceSpringConfig.EXECUTOR_BEAN_NAME)
void encrypt(
final OutputStream output,
final InputStream input,
- final SebConfigEncryptionContext context);
+ final SEBConfigEncryptionContext context);
/** Decrypt an incoming cipher data stream to an outgoing plain text data stream
* This uses Springs @Async annotation to run in a separated thread
*
* @param output the output stream to write the plain text data to
* @param input the input stream to read the cipher text from
- * @param context the SebConfigEncryptionContext to access strategy specific data needed for encryption */
+ * @param context the SEBConfigEncryptionContext to access strategy specific data needed for encryption */
@Async(AsyncServiceSpringConfig.EXECUTOR_BEAN_NAME)
void decrypt(
final OutputStream output,
final InputStream input,
- final SebConfigEncryptionContext context);
+ final SEBConfigEncryptionContext context);
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SebConfigEncryptionContext.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SEBConfigEncryptionContext.java
similarity index 90%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SebConfigEncryptionContext.java
rename to src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SEBConfigEncryptionContext.java
index 59d4d8d7..fd099e49 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SebConfigEncryptionContext.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SEBConfigEncryptionContext.java
@@ -10,11 +10,11 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig;
import java.security.cert.Certificate;
-import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SebConfigEncryptionService.Strategy;
+import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SEBConfigEncryptionService.Strategy;
/** Encryption context used to supply additional data for encryption or decryption
* within a concrete strategy. */
-public interface SebConfigEncryptionContext {
+public interface SEBConfigEncryptionContext {
/** Get the current encryption/decryption strategy
*
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SebConfigEncryptionService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SEBConfigEncryptionService.java
similarity index 91%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SebConfigEncryptionService.java
rename to src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SEBConfigEncryptionService.java
index d385822e..e1a0a4a5 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SebConfigEncryptionService.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/SEBConfigEncryptionService.java
@@ -19,7 +19,7 @@ import ch.ethz.seb.sebserver.gbl.async.AsyncServiceSpringConfig;
import ch.ethz.seb.sebserver.gbl.util.Utils;
/** Used for SEB Configuration encryption and decryption */
-public interface SebConfigEncryptionService {
+public interface SEBConfigEncryptionService {
/** Types of encryption strategies */
enum Type {
@@ -67,22 +67,22 @@ public interface SebConfigEncryptionService {
*
* @param output the output data stream to write the cipher text to
* @param input the input stream to read the plain text from
- * @param context the SebConfigEncryptionContext to access strategy specific data needed for encryption */
+ * @param context the SEBConfigEncryptionContext to access strategy specific data needed for encryption */
@Async(AsyncServiceSpringConfig.EXECUTOR_BEAN_NAME)
void streamEncrypted(
final OutputStream output,
final InputStream input,
- SebConfigEncryptionContext context);
+ SEBConfigEncryptionContext context);
/** This can be used to stream incoming cipher data to decrypted plain text data output stream.
*
* @param output the output data stream to write encrypted plain text to
* @param input the input stream to read the cipher text from
- * @param context the SebConfigEncryptionContext to access strategy specific data needed for encryption */
+ * @param context the SEBConfigEncryptionContext to access strategy specific data needed for encryption */
@Async(AsyncServiceSpringConfig.EXECUTOR_BEAN_NAME)
Future streamDecrypted(
final OutputStream output,
final InputStream input,
- final SebConfigEncryptionContext context);
+ final SEBConfigEncryptionContext context);
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ClientConfigServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ClientConfigServiceImpl.java
index be8ebe4a..a3986c98 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ClientConfigServiceImpl.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ClientConfigServiceImpl.java
@@ -42,21 +42,21 @@ import org.springframework.web.client.RestTemplate;
import ch.ethz.seb.sebserver.WebSecurityConfig;
import ch.ethz.seb.sebserver.gbl.Constants;
import ch.ethz.seb.sebserver.gbl.api.API;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentialService;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentials;
import ch.ethz.seb.sebserver.gbl.model.institution.Institution;
-import ch.ethz.seb.sebserver.gbl.model.sebconfig.SebClientConfig;
+import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.gbl.util.Utils;
import ch.ethz.seb.sebserver.webservice.WebserviceInfo;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentialService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentials;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.InstitutionDAO;
-import ch.ethz.seb.sebserver.webservice.servicelayer.dao.SebClientConfigDAO;
+import ch.ethz.seb.sebserver.webservice.servicelayer.dao.SEBClientConfigDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.ClientConfigService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SebConfigEncryptionService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SebConfigEncryptionService.Strategy;
+import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SEBConfigEncryptionService;
+import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SEBConfigEncryptionService.Strategy;
import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.ZipService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.impl.SebConfigEncryptionServiceImpl.EncryptionContext;
+import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.impl.SEBConfigEncryptionServiceImpl.EncryptionContext;
import ch.ethz.seb.sebserver.webservice.weblayer.oauth.WebserviceResourceConfiguration;
@Lazy
@@ -99,18 +99,18 @@ public class ClientConfigServiceImpl implements ClientConfigService {
" %s%n";
private final InstitutionDAO institutionDAO;
- private final SebClientConfigDAO sebClientConfigDAO;
+ private final SEBClientConfigDAO sebClientConfigDAO;
private final ClientCredentialService clientCredentialService;
- private final SebConfigEncryptionService sebConfigEncryptionService;
+ private final SEBConfigEncryptionService sebConfigEncryptionService;
private final PasswordEncoder clientPasswordEncoder;
private final ZipService zipService;
private final WebserviceInfo webserviceInfo;
protected ClientConfigServiceImpl(
final InstitutionDAO institutionDAO,
- final SebClientConfigDAO sebClientConfigDAO,
+ final SEBClientConfigDAO sebClientConfigDAO,
final ClientCredentialService clientCredentialService,
- final SebConfigEncryptionService sebConfigEncryptionService,
+ final SEBConfigEncryptionService sebConfigEncryptionService,
final ZipService zipService,
@Qualifier(WebSecurityConfig.CLIENT_PASSWORD_ENCODER_BEAN_NAME) final PasswordEncoder clientPasswordEncoder,
final WebserviceInfo webserviceInfo) {
@@ -125,19 +125,19 @@ public class ClientConfigServiceImpl implements ClientConfigService {
}
@Override
- public boolean hasSebClientConfigurationForInstitution(final Long institutionId) {
- final Result> all = this.sebClientConfigDAO.all(institutionId, true);
+ public boolean hasSEBClientConfigurationForInstitution(final Long institutionId) {
+ final Result> all = this.sebClientConfigDAO.all(institutionId, true);
return all != null && !all.hasError() && !all.getOrThrow().isEmpty();
}
@Override
- public Result autoCreateSebClientConfigurationForInstitution(final Long institutionId) {
+ public Result autoCreateSEBClientConfigurationForInstitution(final Long institutionId) {
return Result.tryCatch(() -> {
final Institution institution = this.institutionDAO
.byPK(institutionId)
.getOrThrow();
- return new SebClientConfig(
+ return new SEBClientConfig(
null,
institutionId,
institution.name + "_" + UUID.randomUUID(),
@@ -184,11 +184,11 @@ public class ClientConfigServiceImpl implements ClientConfigService {
}
@Override
- public void exportSebClientConfiguration(
+ public void exportSEBClientConfiguration(
final OutputStream output,
final String modelId) {
- final SebClientConfig config = this.sebClientConfigDAO
+ final SEBClientConfig config = this.sebClientConfigDAO
.byModelId(modelId).getOrThrow();
final CharSequence encryptionPassword = this.sebClientConfigDAO
@@ -236,7 +236,7 @@ public class ClientConfigServiceImpl implements ClientConfigService {
this.zipService.write(output, zipIn);
if (log.isDebugEnabled()) {
- log.debug("*** Finished Seb client configuration download streaming composition");
+ log.debug("*** Finished SEB client configuration download streaming composition");
}
} catch (final Exception e) {
@@ -248,35 +248,35 @@ public class ClientConfigServiceImpl implements ClientConfigService {
}
}
- private String extractXMLContent(final SebClientConfig config) {
+ private String extractXMLContent(final SEBClientConfig config) {
String fallbackAddition = "";
if (BooleanUtils.isTrue(config.fallback)) {
fallbackAddition += String.format(
SEB_CLIENT_CONFIG_STRING_TEMPLATE,
- SebClientConfig.ATTR_FALLBACK_START_URL,
+ SEBClientConfig.ATTR_FALLBACK_START_URL,
config.fallbackStartURL);
fallbackAddition += String.format(
SEB_CLIENT_CONFIG_INTEGER_TEMPLATE,
- SebClientConfig.ATTR_FALLBACK_TIMEOUT,
+ SEBClientConfig.ATTR_FALLBACK_TIMEOUT,
config.fallbackTimeout);
fallbackAddition += String.format(
SEB_CLIENT_CONFIG_INTEGER_TEMPLATE,
- SebClientConfig.ATTR_FALLBACK_ATTEMPTS,
+ SEBClientConfig.ATTR_FALLBACK_ATTEMPTS,
config.fallbackAttempts);
fallbackAddition += String.format(
SEB_CLIENT_CONFIG_INTEGER_TEMPLATE,
- SebClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL,
+ SEBClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL,
config.fallbackAttemptInterval);
if (StringUtils.isNotBlank(config.fallbackPassword)) {
final CharSequence decrypt = this.clientCredentialService.decrypt(config.fallbackPassword);
fallbackAddition += String.format(
SEB_CLIENT_CONFIG_STRING_TEMPLATE,
- SebClientConfig.ATTR_FALLBACK_PASSWORD,
+ SEBClientConfig.ATTR_FALLBACK_PASSWORD,
Utils.hash_SHA_256_Base_16(decrypt));
}
@@ -284,13 +284,13 @@ public class ClientConfigServiceImpl implements ClientConfigService {
final CharSequence decrypt = this.clientCredentialService.decrypt(config.quitPassword);
fallbackAddition += String.format(
SEB_CLIENT_CONFIG_STRING_TEMPLATE,
- SebClientConfig.ATTR_QUIT_PASSWORD,
+ SEBClientConfig.ATTR_QUIT_PASSWORD,
Utils.hash_SHA_256_Base_16(decrypt));
}
}
final ClientCredentials sebClientCredentials = this.sebClientConfigDAO
- .getSebClientCredentials(config.getModelId())
+ .getSEBClientCredentials(config.getModelId())
.getOrThrow();
final CharSequence plainClientId = sebClientCredentials.clientId;
final CharSequence plainClientSecret = this.clientCredentialService
@@ -317,7 +317,7 @@ public class ClientConfigServiceImpl implements ClientConfigService {
}
@Override
- public boolean checkAccess(final SebClientConfig config) {
+ public boolean checkAccess(final SEBClientConfig config) {
if (!config.isActive()) {
return false;
}
@@ -335,7 +335,7 @@ public class ClientConfigServiceImpl implements ClientConfigService {
final MultiValueMap headers = new LinkedMultiValueMap<>();
headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
final ClientCredentials credentials = this.sebClientConfigDAO
- .getSebClientCredentials(config.getModelId())
+ .getSEBClientCredentials(config.getModelId())
.getOrThrow();
final CharSequence plainClientSecret = this.clientCredentialService.getPlainClientSecret(credentials);
final String basicAuth = credentials.clientId +
@@ -358,17 +358,17 @@ public class ClientConfigServiceImpl implements ClientConfigService {
if (exchange.getStatusCode().value() == HttpStatus.OK.value()) {
return true;
} else {
- log.warn("Failed to check access SebClientConfig {} response: {}", config, exchange.getStatusCode());
+ log.warn("Failed to check access SEBClientConfig {} response: {}", config, exchange.getStatusCode());
return false;
}
} catch (final Exception e) {
- log.warn("Failed to check access for SebClientConfig: {} cause: {}", config, e.getMessage());
+ log.warn("Failed to check access for SEBClientConfig: {} cause: {}", config, e.getMessage());
return false;
}
}
@Override
- public void initalCheckAccess(final SebClientConfig config) {
+ public void initalCheckAccess(final SEBClientConfig config) {
checkAccess(config);
}
@@ -378,7 +378,7 @@ public class ClientConfigServiceImpl implements ClientConfigService {
final InputStream input) {
if (log.isDebugEnabled()) {
- log.debug("*** Seb client configuration with password based encryption");
+ log.debug("*** SEB client configuration with password based encryption");
}
final CharSequence encryptionPasswordPlaintext = (encryptionPassword == StringUtils.EMPTY)
@@ -393,10 +393,10 @@ public class ClientConfigServiceImpl implements ClientConfigService {
encryptionPasswordPlaintext));
}
- /** Get a encoded clientSecret for the SebClientConfiguration with specified clientId/clientName.
+ /** Get a encoded clientSecret for the SEBClientConfiguration with specified clientId/clientName.
*
* @param clientId the clientId/clientName
- * @return encoded clientSecret for that SebClientConfiguration with clientId or null of not existing */
+ * @return encoded clientSecret for that SEBClientConfiguration with clientId or null of not existing */
private Result getEncodedClientConfigSecret(final String clientId) {
return this.sebClientConfigDAO.getConfigPasswordCipherByClientName(clientId)
.map(cipher -> this.clientPasswordEncoder.encode(this.clientCredentialService.decrypt(cipher)));
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ExamConfigServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ExamConfigServiceImpl.java
index 786dcd38..fba24d73 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ExamConfigServiceImpl.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/ExamConfigServiceImpl.java
@@ -30,22 +30,22 @@ import org.springframework.stereotype.Service;
import ch.ethz.seb.sebserver.gbl.api.APIMessage;
import ch.ethz.seb.sebserver.gbl.api.APIMessage.APIMessageException;
import ch.ethz.seb.sebserver.gbl.api.APIMessage.FieldValidationException;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentialService;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.Configuration;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationAttribute;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationTableValues;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationValue;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Result;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentialService;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ConfigurationAttributeDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ExamConfigurationMapDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.ConfigurationFormat;
import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.ConfigurationValueValidator;
import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.ExamConfigService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SebConfigEncryptionService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SebConfigEncryptionService.Strategy;
+import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SEBConfigEncryptionService;
+import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SEBConfigEncryptionService.Strategy;
import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.ZipService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.impl.SebConfigEncryptionServiceImpl.EncryptionContext;
+import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.impl.SEBConfigEncryptionServiceImpl.EncryptionContext;
@Lazy
@Service
@@ -60,7 +60,7 @@ public class ExamConfigServiceImpl implements ExamConfigService {
private final Collection validators;
private final ClientCredentialService clientCredentialService;
private final ZipService zipService;
- private final SebConfigEncryptionService sebConfigEncryptionService;
+ private final SEBConfigEncryptionService sebConfigEncryptionService;
protected ExamConfigServiceImpl(
final ExamConfigIO examConfigIO,
@@ -69,7 +69,7 @@ public class ExamConfigServiceImpl implements ExamConfigService {
final Collection validators,
final ClientCredentialService clientCredentialService,
final ZipService zipService,
- final SebConfigEncryptionService sebConfigEncryptionService) {
+ final SEBConfigEncryptionService sebConfigEncryptionService) {
this.examConfigIO = examConfigIO;
this.configurationAttributeDAO = configurationAttributeDAO;
@@ -180,7 +180,7 @@ public class ExamConfigServiceImpl implements ExamConfigService {
if (StringUtils.isNotBlank(passwordCipher)) {
if (log.isDebugEnabled()) {
- log.debug("*** Seb exam configuration with password based encryption");
+ log.debug("*** SEB exam configuration with password based encryption");
}
final CharSequence encryptionPasswordPlaintext = this.clientCredentialService
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/NoneEncryptor.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/NoneEncryptor.java
index f82edf17..b1e76eb6 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/NoneEncryptor.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/NoneEncryptor.java
@@ -21,14 +21,14 @@ import org.springframework.stereotype.Component;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Utils;
-import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SebConfigCryptor;
-import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SebConfigEncryptionContext;
-import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SebConfigEncryptionService.Strategy;
+import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SEBConfigCryptor;
+import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SEBConfigEncryptionContext;
+import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SEBConfigEncryptionService.Strategy;
@Lazy
@Component
@WebServiceProfile
-public class NoneEncryptor implements SebConfigCryptor {
+public class NoneEncryptor implements SEBConfigCryptor {
private static final Logger log = LoggerFactory.getLogger(NoneEncryptor.class);
@@ -44,7 +44,7 @@ public class NoneEncryptor implements SebConfigCryptor {
public void encrypt(
final OutputStream output,
final InputStream input,
- final SebConfigEncryptionContext context) {
+ final SEBConfigEncryptionContext context) {
if (log.isDebugEnabled()) {
log.debug("No encryption, write plain input data");
@@ -75,7 +75,7 @@ public class NoneEncryptor implements SebConfigCryptor {
public void decrypt(
final OutputStream output,
final InputStream input,
- final SebConfigEncryptionContext context) {
+ final SEBConfigEncryptionContext context) {
if (log.isDebugEnabled()) {
log.debug("No decryption, read plain input data");
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/PasswordEncryptor.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/PasswordEncryptor.java
index 2095b0f7..70808bac 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/PasswordEncryptor.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/PasswordEncryptor.java
@@ -29,14 +29,14 @@ import org.springframework.stereotype.Component;
import ch.ethz.seb.sebserver.gbl.Constants;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Utils;
-import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SebConfigCryptor;
-import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SebConfigEncryptionContext;
-import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SebConfigEncryptionService.Strategy;
+import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SEBConfigCryptor;
+import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SEBConfigEncryptionContext;
+import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SEBConfigEncryptionService.Strategy;
@Lazy
@Component
@WebServiceProfile
-public class PasswordEncryptor implements SebConfigCryptor {
+public class PasswordEncryptor implements SEBConfigCryptor {
private static final Logger log = LoggerFactory.getLogger(PasswordEncryptor.class);
@@ -59,7 +59,7 @@ public class PasswordEncryptor implements SebConfigCryptor {
public void encrypt(
final OutputStream output,
final InputStream input,
- final SebConfigEncryptionContext context) {
+ final SEBConfigEncryptionContext context) {
if (log.isDebugEnabled()) {
log.debug("*** Start streaming asynchronous encryption");
@@ -108,7 +108,7 @@ public class PasswordEncryptor implements SebConfigCryptor {
public void decrypt(
final OutputStream output,
final InputStream input,
- final SebConfigEncryptionContext context) {
+ final SEBConfigEncryptionContext context) {
final CharSequence password = context.getPassword();
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/SebConfigEncryptionServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/SEBConfigEncryptionServiceImpl.java
similarity index 89%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/SebConfigEncryptionServiceImpl.java
rename to src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/SEBConfigEncryptionServiceImpl.java
index ea6932cc..af6b6537 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/SebConfigEncryptionServiceImpl.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/SEBConfigEncryptionServiceImpl.java
@@ -36,21 +36,21 @@ import ch.ethz.seb.sebserver.gbl.Constants;
import ch.ethz.seb.sebserver.gbl.api.APIMessage;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Result;
-import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SebConfigCryptor;
-import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SebConfigEncryptionContext;
-import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SebConfigEncryptionService;
+import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SEBConfigCryptor;
+import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SEBConfigEncryptionContext;
+import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.SEBConfigEncryptionService;
@Lazy
@Service
@WebServiceProfile
-public final class SebConfigEncryptionServiceImpl implements SebConfigEncryptionService {
+public final class SEBConfigEncryptionServiceImpl implements SEBConfigEncryptionService {
- private static final Logger log = LoggerFactory.getLogger(SebConfigEncryptionServiceImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(SEBConfigEncryptionServiceImpl.class);
- private final Map encryptors;
+ private final Map encryptors;
- public SebConfigEncryptionServiceImpl(
- final Collection encryptors) {
+ public SEBConfigEncryptionServiceImpl(
+ final Collection encryptors) {
this.encryptors = encryptors
.stream()
@@ -64,7 +64,7 @@ public final class SebConfigEncryptionServiceImpl implements SebConfigEncryption
public void streamEncrypted(
final OutputStream output,
final InputStream input,
- final SebConfigEncryptionContext context) {
+ final SEBConfigEncryptionContext context) {
final Strategy strategy = context.getStrategy();
PipedOutputStream pout = null;
@@ -108,7 +108,7 @@ public final class SebConfigEncryptionServiceImpl implements SebConfigEncryption
public Future streamDecrypted(
final OutputStream output,
final InputStream input,
- final SebConfigEncryptionContext context) {
+ final SEBConfigEncryptionContext context) {
PipedOutputStream pout = null;
PipedInputStream pin = null;
@@ -180,8 +180,8 @@ public final class SebConfigEncryptionServiceImpl implements SebConfigEncryption
}
}
- private Result getEncryptor(final Strategy strategy) {
- final SebConfigCryptor encryptor = this.encryptors.get(strategy);
+ private Result getEncryptor(final Strategy strategy) {
+ final SEBConfigCryptor encryptor = this.encryptors.get(strategy);
if (encryptor == null) {
return Result.ofError(new IllegalArgumentException("No Encryptor found for strategy : " + strategy));
}
@@ -189,7 +189,7 @@ public final class SebConfigEncryptionServiceImpl implements SebConfigEncryption
return Result.of(encryptor);
}
- static class EncryptionContext implements SebConfigEncryptionContext {
+ static class EncryptionContext implements SEBConfigEncryptionContext {
public final Strategy strategy;
public final CharSequence password;
@@ -223,12 +223,12 @@ public final class SebConfigEncryptionServiceImpl implements SebConfigEncryption
return this.certificateStore.apply(key);
}
- static SebConfigEncryptionContext contextOf(final Strategy strategy, final CharSequence password) {
+ static SEBConfigEncryptionContext contextOf(final Strategy strategy, final CharSequence password) {
checkPasswordBased(strategy);
return new EncryptionContext(strategy, password, null);
}
- static SebConfigEncryptionContext contextOf(
+ static SEBConfigEncryptionContext contextOf(
final Strategy strategy,
final Function certificateStore) {
@@ -248,11 +248,11 @@ public final class SebConfigEncryptionServiceImpl implements SebConfigEncryption
}
}
- public static SebConfigEncryptionContext contextOfPlainText() {
+ public static SEBConfigEncryptionContext contextOfPlainText() {
return new EncryptionContext(Strategy.PLAIN_TEXT, null, null);
}
- public static SebConfigEncryptionContext contextOf(final CharSequence password) {
+ public static SEBConfigEncryptionContext contextOf(final CharSequence password) {
return new EncryptionContext(null, password, null);
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/ArrayOfStringConverter.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/ArrayOfStringConverter.java
index 10b26c9a..4971c76d 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/ArrayOfStringConverter.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/ArrayOfStringConverter.java
@@ -85,7 +85,7 @@ public class ArrayOfStringConverter implements AttributeValueConverter {
final ConfigurationValue value,
final boolean xml) 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)) {
final String[] values = StringUtils.split(val, Constants.LIST_SEPARATOR);
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/InlineTableConverter.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/InlineTableConverter.java
index 34c860e1..f005df9b 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/InlineTableConverter.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/InlineTableConverter.java
@@ -92,7 +92,7 @@ public class InlineTableConverter implements AttributeValueConverter {
(xml) ? XML_KEY_TEMPLATE : JSON_KEY_TEMPLATE,
AttributeValueConverter.extractName(attribute))));
- if (StringUtils.isBlank(value.value)) {
+ if (value == null || StringUtils.isBlank(value.value)) {
out.write((xml) ? XML_EMPTY_ARRAY : JSON_EMPTY_ARRAY);
out.flush();
return;
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/StringConverter.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/StringConverter.java
index 140c3ccb..eabac5f7 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/StringConverter.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/sebconfig/impl/converter/StringConverter.java
@@ -22,12 +22,12 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import ch.ethz.seb.sebserver.gbl.Constants;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentialService;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.AttributeType;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationAttribute;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationValue;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Utils;
-import ch.ethz.seb.sebserver.webservice.servicelayer.client.ClientCredentialService;
import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.AttributeValueConverter;
import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.impl.ExamConfigXMLParser;
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/ExamSessionService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/ExamSessionService.java
index c4ea8aaa..cce27c0c 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/ExamSessionService.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/ExamSessionService.java
@@ -68,7 +68,7 @@ public interface ExamSessionService {
*
* @param examId The Exam identifier
* @return true if the given Exam has currently no active client connection, false otherwise. */
- boolean hasActiveSebClientConnections(final Long examId);
+ boolean hasActiveSEBClientConnections(final Long examId);
/** Checks if a specified Exam has at least a default SEB Exam configuration attached.
*
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/SebClientConnectionService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/SEBClientConnectionService.java
similarity index 97%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/SebClientConnectionService.java
rename to src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/SEBClientConnectionService.java
index 56f51398..bb6d0393 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/SebClientConnectionService.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/SEBClientConnectionService.java
@@ -15,7 +15,7 @@ import ch.ethz.seb.sebserver.gbl.model.session.ClientEvent;
import ch.ethz.seb.sebserver.gbl.util.Result;
/** Service interface defining functionality to handle SEB client connections on running exams. */
-public interface SebClientConnectionService {
+public interface SEBClientConnectionService {
/** Use this to get the underling ExamSessionService
*
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/SebInstructionService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/SEBInstructionService.java
similarity index 96%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/SebInstructionService.java
rename to src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/SEBInstructionService.java
index 065a664b..20c87597 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/SebInstructionService.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/SEBInstructionService.java
@@ -25,7 +25,7 @@ import ch.ethz.seb.sebserver.webservice.WebserviceInfo;
*
* SEB instructions are sent as response of a SEB Ping on a active SEB Connection
* If there is an instruction in the queue for a specified SEB Client. */
-public interface SebInstructionService {
+public interface SEBInstructionService {
/** Get the underling WebserviceInfo
*
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamConfigUpdateServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamConfigUpdateServiceImpl.java
index 84978dd0..f33ad452 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamConfigUpdateServiceImpl.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamConfigUpdateServiceImpl.java
@@ -133,8 +133,8 @@ public class ExamConfigUpdateServiceImpl implements ExamConfigUpdateService {
if (exam.getStatus() == ExamStatus.RUNNING || this.examAdminService.isRestricted(exam).getOr(false)) {
this.examUpdateHandler
- .getSebRestrictionService()
- .applySebClientRestriction(exam)
+ .getSEBRestrictionService()
+ .applySEBClientRestriction(exam)
.onError(t -> log.error("Failed to update SEB Client restriction for Exam: {}", exam, t));
}
}
@@ -203,8 +203,8 @@ public class ExamConfigUpdateServiceImpl implements ExamConfigUpdateService {
// update seb client restriction if the feature is activated for the exam
if (this.examAdminService.isRestricted(exam).getOr(false)) {
this.examUpdateHandler
- .getSebRestrictionService()
- .applySebClientRestriction(exam)
+ .getSEBRestrictionService()
+ .applySEBClientRestriction(exam)
.onError(t -> log.error(
"Failed to update SEB Client restriction for Exam: {}",
exam,
@@ -229,7 +229,7 @@ public class ExamConfigUpdateServiceImpl implements ExamConfigUpdateService {
}
private void checkActiveClientConnections(final Exam exam) {
- if (this.examSessionService.hasActiveSebClientConnections(exam.id)) {
+ if (this.examSessionService.hasActiveSEBClientConnections(exam.id)) {
throw new APIMessage.APIMessageException(
ErrorMessage.INTEGRITY_VALIDATION,
"Integrity violation: There are currently active SEB Client connection.");
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionCacheService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionCacheService.java
index d0909d6d..bb2ab02c 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionCacheService.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionCacheService.java
@@ -36,7 +36,7 @@ import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.ExamConfigService
/** Handles caching for exam session and defines caching for following object:
*
* - Running exams (examId -> Exam)
- * - in-memory exam configuration (examId -> InMemorySebConfig)
+ * - in-memory exam configuration (examId -> InMemorySEBConfig)
* - active client connections (connectionToken -> ClientConnectionDataInternal)
* - client event records for last ping store (connectionToken -> ReusableClientEventRecord) */
@Lazy
@@ -163,7 +163,7 @@ public class ExamSessionCacheService {
cacheNames = CACHE_NAME_SEB_CONFIG_EXAM,
key = "#exam.id",
sync = true)
- public InMemorySebConfig getDefaultSebConfigForExam(final Exam exam) {
+ public InMemorySEBConfig getDefaultSEBConfigForExam(final Exam exam) {
try {
final ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
@@ -172,7 +172,7 @@ public class ExamSessionCacheService {
exam.institutionId,
exam.id);
- return new InMemorySebConfig(configId, exam.id, byteOut.toByteArray());
+ return new InMemorySEBConfig(configId, exam.id, byteOut.toByteArray());
} catch (final Exception e) {
log.error("Unexpected error while getting default exam configuration for running exam; {}", exam, e);
@@ -183,7 +183,7 @@ public class ExamSessionCacheService {
@CacheEvict(
cacheNames = CACHE_NAME_SEB_CONFIG_EXAM,
key = "#exam.id")
- public void evictDefaultSebConfig(final Exam exam) {
+ public void evictDefaultSEBConfig(final Exam exam) {
if (log.isDebugEnabled()) {
log.debug("Eviction of default SEB Configuration from cache for exam: {}", exam.id);
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionControlTask.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionControlTask.java
index 12f41369..b08a0daf 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionControlTask.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionControlTask.java
@@ -26,7 +26,7 @@ import ch.ethz.seb.sebserver.SEBServerInitEvent;
import ch.ethz.seb.sebserver.gbl.model.exam.Exam;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ExamDAO;
-import ch.ethz.seb.sebserver.webservice.servicelayer.session.SebClientConnectionService;
+import ch.ethz.seb.sebserver.webservice.servicelayer.session.SEBClientConnectionService;
@Service
@WebServiceProfile
@@ -35,7 +35,7 @@ class ExamSessionControlTask implements DisposableBean {
private static final Logger log = LoggerFactory.getLogger(ExamSessionControlTask.class);
private final ExamDAO examDAO;
- private final SebClientConnectionService sebClientConnectionService;
+ private final SEBClientConnectionService sebClientConnectionService;
private final ExamUpdateHandler examUpdateHandler;
private final Long examTimePrefix;
private final Long examTimeSuffix;
@@ -58,7 +58,7 @@ class ExamSessionControlTask implements DisposableBean {
protected ExamSessionControlTask(
final ExamDAO examDAO,
- final SebClientConnectionService sebClientConnectionService,
+ final SEBClientConnectionService sebClientConnectionService,
final ExamUpdateHandler examUpdateHandler,
@Value("${sebserver.webservice.api.exam.time-prefix:3600000}") final Long examTimePrefix,
@Value("${sebserver.webservice.api.exam.time-suffix:3600000}") final Long examTimeSuffix,
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionServiceImpl.java
index 31f45403..66babe9c 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionServiceImpl.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionServiceImpl.java
@@ -44,7 +44,7 @@ import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ExamDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.IndicatorDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPIService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.lms.impl.NoSebRestrictionException;
+import ch.ethz.seb.sebserver.webservice.servicelayer.lms.impl.NoSEBRestrictionException;
import ch.ethz.seb.sebserver.webservice.servicelayer.session.ExamSessionService;
@Lazy
@@ -131,12 +131,12 @@ public class ExamSessionServiceImpl implements ExamSessionService {
if (t.testCourseRestrictionAPI().isOk()) {
return t;
} else {
- throw new NoSebRestrictionException();
+ throw new NoSEBRestrictionException();
}
})
- .flatMap(t -> t.getSebClientRestriction(exam))
+ .flatMap(t -> t.getSEBClientRestriction(exam))
.onError(error -> {
- if (error instanceof NoSebRestrictionException) {
+ if (error instanceof NoSEBRestrictionException) {
result.add(
ErrorMessage.EXAM_CONSISTENCY_VALIDATION_SEB_RESTRICTION
.of(exam.getModelId()));
@@ -160,7 +160,7 @@ public class ExamSessionServiceImpl implements ExamSessionService {
}
@Override
- public boolean hasActiveSebClientConnections(final Long examId) {
+ public boolean hasActiveSEBClientConnections(final Long examId) {
if (examId == null || !this.isExamRunning(examId)) {
return false;
}
@@ -199,6 +199,7 @@ public class ExamSessionServiceImpl implements ExamSessionService {
log.trace("Running exam request for exam {}", examId);
}
+ updateExamCache(examId);
final Exam exam = this.examSessionCacheService.getRunningExam(examId);
if (this.examSessionCacheService.isRunning(exam)) {
@@ -271,17 +272,17 @@ public class ExamSessionServiceImpl implements ExamSessionService {
}
if (log.isDebugEnabled()) {
- log.debug("Trying to get exam from InMemorySebConfig");
+ log.debug("Trying to get exam from InMemorySEBConfig");
}
final Exam exam = this.getRunningExam(connection.examId)
.getOrThrow();
- final InMemorySebConfig sebConfigForExam = this.examSessionCacheService
- .getDefaultSebConfigForExam(exam);
+ final InMemorySEBConfig sebConfigForExam = this.examSessionCacheService
+ .getDefaultSEBConfigForExam(exam);
if (sebConfigForExam == null) {
- log.error("Failed to get and cache InMemorySebConfig for connection: {}", connection);
+ log.error("Failed to get and cache InMemorySEBConfig for connection: {}", connection);
return;
}
@@ -327,6 +328,10 @@ public class ExamSessionServiceImpl implements ExamSessionService {
@Override
public Result updateExamCache(final Long examId) {
final Exam exam = this.examSessionCacheService.getRunningExam(examId);
+ if (exam == null) {
+ return Result.ofEmpty();
+ }
+
final Boolean isUpToDate = this.examDAO.upToDate(examId, exam.lastUpdate)
.onError(t -> log.error("Failed to verify if cached exam is up to date: {}", exam, t))
.getOr(false);
@@ -342,7 +347,7 @@ public class ExamSessionServiceImpl implements ExamSessionService {
public Result flushCache(final Exam exam) {
return Result.tryCatch(() -> {
this.examSessionCacheService.evict(exam);
- this.examSessionCacheService.evictDefaultSebConfig(exam);
+ this.examSessionCacheService.evictDefaultSEBConfig(exam);
this.clientConnectionDAO
.getConnectionTokens(exam.id)
.getOrElse(Collections::emptyList)
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamUpdateHandler.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamUpdateHandler.java
index 4c0d883a..c6568112 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamUpdateHandler.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamUpdateHandler.java
@@ -23,7 +23,7 @@ import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.gbl.util.Utils;
import ch.ethz.seb.sebserver.webservice.WebserviceInfo;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ExamDAO;
-import ch.ethz.seb.sebserver.webservice.servicelayer.lms.SebRestrictionService;
+import ch.ethz.seb.sebserver.webservice.servicelayer.lms.SEBRestrictionService;
@Lazy
@Service
@@ -33,13 +33,13 @@ class ExamUpdateHandler {
private static final Logger log = LoggerFactory.getLogger(ExamUpdateHandler.class);
private final ExamDAO examDAO;
- private final SebRestrictionService sebRestrictionService;
+ private final SEBRestrictionService sebRestrictionService;
private final String updatePrefix;
private final Long examTimeSuffix;
public ExamUpdateHandler(
final ExamDAO examDAO,
- final SebRestrictionService sebRestrictionService,
+ final SEBRestrictionService sebRestrictionService,
final WebserviceInfo webserviceInfo,
@Value("${sebserver.webservice.api.exam.time-suffix:3600000}") final Long examTimeSuffix) {
@@ -50,7 +50,7 @@ class ExamUpdateHandler {
this.examTimeSuffix = examTimeSuffix;
}
- public SebRestrictionService getSebRestrictionService() {
+ public SEBRestrictionService getSEBRestrictionService() {
return this.sebRestrictionService;
}
@@ -82,7 +82,7 @@ class ExamUpdateHandler {
exam.id,
ExamStatus.RUNNING,
updateId))
- .flatMap(this.sebRestrictionService::applySebClientRestriction)
+ .flatMap(this.sebRestrictionService::applySEBClientRestriction)
.flatMap(e -> this.examDAO.releaseLock(e.id, updateId))
.onError(error -> this.examDAO.forceUnlock(exam.id)
.onError(unlockError -> log.error("Failed to force unlock update look for exam: {}", exam.id)))
@@ -100,7 +100,7 @@ class ExamUpdateHandler {
exam.id,
ExamStatus.FINISHED,
updateId))
- .flatMap(this.sebRestrictionService::releaseSebClientRestriction)
+ .flatMap(this.sebRestrictionService::releaseSEBClientRestriction)
.flatMap(e -> this.examDAO.releaseLock(e.id, updateId))
.onError(error -> this.examDAO.forceUnlock(exam.id))
.getOrThrow();
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/InMemorySebConfig.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/InMemorySEBConfig.java
similarity index 88%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/InMemorySebConfig.java
rename to src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/InMemorySEBConfig.java
index bf93d2a8..a648741c 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/InMemorySebConfig.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/InMemorySEBConfig.java
@@ -8,13 +8,13 @@
package ch.ethz.seb.sebserver.webservice.servicelayer.session.impl;
-public final class InMemorySebConfig {
+public final class InMemorySEBConfig {
public final Long configId;
public final Long examId;
private final byte[] data;
- protected InMemorySebConfig(final Long configId, final Long examId, final byte[] data) {
+ protected InMemorySEBConfig(final Long configId, final Long examId, final byte[] data) {
super();
this.configId = configId;
this.examId = examId;
@@ -50,7 +50,7 @@ public final class InMemorySebConfig {
return false;
if (getClass() != obj.getClass())
return false;
- final InMemorySebConfig other = (InMemorySebConfig) obj;
+ final InMemorySEBConfig other = (InMemorySEBConfig) obj;
if (this.configId == null) {
if (other.configId != null)
return false;
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SebClientConnectionServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientConnectionServiceImpl.java
similarity index 97%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SebClientConnectionServiceImpl.java
rename to src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientConnectionServiceImpl.java
index 20a836a0..47a13ef4 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SebClientConnectionServiceImpl.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientConnectionServiceImpl.java
@@ -33,20 +33,20 @@ import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.gbl.util.Utils;
import ch.ethz.seb.sebserver.webservice.WebserviceInfo;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ClientConnectionDAO;
-import ch.ethz.seb.sebserver.webservice.servicelayer.dao.SebClientConfigDAO;
+import ch.ethz.seb.sebserver.webservice.servicelayer.dao.SEBClientConfigDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.session.EventHandlingStrategy;
import ch.ethz.seb.sebserver.webservice.servicelayer.session.ExamSessionService;
import ch.ethz.seb.sebserver.webservice.servicelayer.session.PingHandlingStrategy;
-import ch.ethz.seb.sebserver.webservice.servicelayer.session.SebClientConnectionService;
-import ch.ethz.seb.sebserver.webservice.servicelayer.session.SebInstructionService;
+import ch.ethz.seb.sebserver.webservice.servicelayer.session.SEBClientConnectionService;
+import ch.ethz.seb.sebserver.webservice.servicelayer.session.SEBInstructionService;
import ch.ethz.seb.sebserver.webservice.weblayer.api.APIConstraintViolationException;
@Lazy
@Service
@WebServiceProfile
-public class SebClientConnectionServiceImpl implements SebClientConnectionService {
+public class SEBClientConnectionServiceImpl implements SEBClientConnectionService {
- private static final Logger log = LoggerFactory.getLogger(SebClientConnectionServiceImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(SEBClientConnectionServiceImpl.class);
private final ExamSessionService examSessionService;
private final ExamSessionCacheService examSessionCacheService;
@@ -54,16 +54,16 @@ public class SebClientConnectionServiceImpl implements SebClientConnectionServic
private final EventHandlingStrategy eventHandlingStrategy;
private final ClientConnectionDAO clientConnectionDAO;
private final PingHandlingStrategy pingHandlingStrategy;
- private final SebClientConfigDAO sebClientConfigDAO;
- private final SebInstructionService sebInstructionService;
+ private final SEBClientConfigDAO sebClientConfigDAO;
+ private final SEBInstructionService sebInstructionService;
private final WebserviceInfo webserviceInfo;
- protected SebClientConnectionServiceImpl(
+ protected SEBClientConnectionServiceImpl(
final ExamSessionService examSessionService,
final EventHandlingStrategyFactory eventHandlingStrategyFactory,
final PingHandlingStrategyFactory pingHandlingStrategyFactory,
- final SebClientConfigDAO sebClientConfigDAO,
- final SebInstructionService sebInstructionService) {
+ final SEBClientConfigDAO sebClientConfigDAO,
+ final SEBInstructionService sebInstructionService) {
this.examSessionService = examSessionService;
this.examSessionCacheService = examSessionService.getExamSessionCacheService();
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SebInstructionServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBInstructionServiceImpl.java
similarity index 95%
rename from src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SebInstructionServiceImpl.java
rename to src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBInstructionServiceImpl.java
index 3e3f0ffa..a2e400ed 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SebInstructionServiceImpl.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBInstructionServiceImpl.java
@@ -33,14 +33,14 @@ import ch.ethz.seb.sebserver.webservice.WebserviceInfo;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ClientInstructionRecord;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ClientConnectionDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ClientInstructionDAO;
-import ch.ethz.seb.sebserver.webservice.servicelayer.session.SebInstructionService;
+import ch.ethz.seb.sebserver.webservice.servicelayer.session.SEBInstructionService;
@Lazy
@Service
@WebServiceProfile
-public class SebInstructionServiceImpl implements SebInstructionService {
+public class SEBInstructionServiceImpl implements SEBInstructionService {
- private static final Logger log = LoggerFactory.getLogger(SebInstructionServiceImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(SEBInstructionServiceImpl.class);
private static final String JSON_INST = "instruction";
private static final String JSON_ATTR = "attributes";
@@ -52,7 +52,7 @@ public class SebInstructionServiceImpl implements SebInstructionService {
private long lastRefresh = 0;
- public SebInstructionServiceImpl(
+ public SEBInstructionServiceImpl(
final WebserviceInfo webserviceInfo,
final ClientConnectionDAO clientConnectionDAO,
final ClientInstructionDAO clientInstructionDAO) {
@@ -71,7 +71,7 @@ public class SebInstructionServiceImpl implements SebInstructionService {
@EventListener(SEBServerInitEvent.class)
public void init() {
SEBServerInit.INIT_LOGGER.info("------>");
- SEBServerInit.INIT_LOGGER.info("------> Run SebInstructionService...");
+ SEBServerInit.INIT_LOGGER.info("------> Run SEBInstructionService...");
loadInstruction()
.onError(
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ConfigurationNodeController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ConfigurationNodeController.java
index f79e715b..6a8380a7 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ConfigurationNodeController.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ConfigurationNodeController.java
@@ -270,7 +270,7 @@ public class ConfigurationNodeController extends EntityController doImport = doImport(password, request, followup);
if (doImport.hasError()) {
- // rollback if the new configuration
+ // rollback of the new configuration
this.configurationNodeDAO.delete(new HashSet<>(Arrays.asList(new EntityKey(
followup.configurationNodeId,
EntityType.CONFIGURATION_NODE))));
@@ -510,6 +510,7 @@ public class ConfigurationNodeController extends EntityController {
private final LmsAPIService lmsAPIService;
private final ExamConfigService sebExamConfigService;
private final ExamSessionService examSessionService;
- private final SebRestrictionService sebRestrictionService;
+ private final SEBRestrictionService sebRestrictionService;
public ExamAdministrationController(
final AuthorizationService authorization,
@@ -101,7 +101,7 @@ public class ExamAdministrationController extends EntityController {
final ExamAdminService examAdminService,
final ExamConfigService sebExamConfigService,
final ExamSessionService examSessionService,
- final SebRestrictionService sebRestrictionService) {
+ final SEBRestrictionService sebRestrictionService) {
super(authorization,
bulkActionService,
@@ -257,7 +257,7 @@ public class ExamAdministrationController extends EntityController {
+ API.EXAM_ADMINISTRATION_CHECK_RESTRICTION_PATH_SEGMENT,
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
- public Boolean checkSebRestriction(
+ public Boolean checkSEBRestriction(
@PathVariable final Long modelId,
@RequestParam(
name = API.PARAM_INSTITUTION_ID,
@@ -275,7 +275,7 @@ public class ExamAdministrationController extends EntityController {
+ API.EXAM_ADMINISTRATION_SEB_RESTRICTION_PATH_SEGMENT,
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
- public SebRestriction getSebRestriction(
+ public SEBRestriction getSEBRestriction(
@RequestParam(
name = API.PARAM_INSTITUTION_ID,
required = true,
@@ -285,7 +285,7 @@ public class ExamAdministrationController extends EntityController {
checkModifyPrivilege(institutionId);
return this.entityDAO.byPK(modelId)
.flatMap(this.authorization::checkRead)
- .flatMap(this.sebRestrictionService::getSebRestrictionFromExam)
+ .flatMap(this.sebRestrictionService::getSEBRestrictionFromExam)
.getOrThrow();
}
@@ -294,20 +294,20 @@ public class ExamAdministrationController extends EntityController {
+ API.EXAM_ADMINISTRATION_SEB_RESTRICTION_PATH_SEGMENT,
method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
- public Exam saveSebRestrictionData(
+ public Exam saveSEBRestrictionData(
@RequestParam(
name = API.PARAM_INSTITUTION_ID,
required = true,
defaultValue = UserService.USERS_INSTITUTION_AS_DEFAULT) final Long institutionId,
@PathVariable(API.PARAM_MODEL_ID) final Long examId,
- @Valid @RequestBody final SebRestriction sebRestriction) {
+ @Valid @RequestBody final SEBRestriction sebRestriction) {
checkModifyPrivilege(institutionId);
return this.entityDAO.byPK(examId)
.flatMap(this.authorization::checkModify)
- .flatMap(exam -> this.sebRestrictionService.saveSebRestrictionToExam(exam, sebRestriction))
+ .flatMap(exam -> this.sebRestrictionService.saveSEBRestrictionToExam(exam, sebRestriction))
.flatMap(exam -> this.examAdminService.isRestricted(exam).getOrThrow()
- ? this.applySebRestriction(exam, true)
+ ? this.applySEBRestriction(exam, true)
: Result.of(exam))
.getOrThrow();
}
@@ -317,7 +317,7 @@ public class ExamAdministrationController extends EntityController {
+ API.EXAM_ADMINISTRATION_SEB_RESTRICTION_PATH_SEGMENT,
method = RequestMethod.PUT,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
- public Exam applySebRestriction(
+ public Exam applySEBRestriction(
@RequestParam(
name = API.PARAM_INSTITUTION_ID,
required = true,
@@ -327,7 +327,7 @@ public class ExamAdministrationController extends EntityController {
checkModifyPrivilege(institutionId);
return this.entityDAO.byPK(examlId)
.flatMap(this.authorization::checkModify)
- .flatMap(exam -> this.applySebRestriction(exam, true))
+ .flatMap(exam -> this.applySEBRestriction(exam, true))
.flatMap(this.userActivityLogDAO::logModify)
.getOrThrow();
}
@@ -337,7 +337,7 @@ public class ExamAdministrationController extends EntityController {
+ API.EXAM_ADMINISTRATION_SEB_RESTRICTION_PATH_SEGMENT,
method = RequestMethod.DELETE,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
- public Exam deleteSebRestriction(
+ public Exam deleteSEBRestriction(
@RequestParam(
name = API.PARAM_INSTITUTION_ID,
required = true,
@@ -347,7 +347,7 @@ public class ExamAdministrationController extends EntityController {
checkModifyPrivilege(institutionId);
return this.entityDAO.byPK(examlId)
.flatMap(this.authorization::checkModify)
- .flatMap(exam -> this.applySebRestriction(exam, false))
+ .flatMap(exam -> this.applySEBRestriction(exam, false))
.flatMap(this.userActivityLogDAO::logModify)
.getOrThrow();
}
@@ -445,8 +445,8 @@ public class ExamAdministrationController extends EntityController {
return exam;
}
- private Result checkNoActiveSebClientConnections(final Exam exam) {
- if (this.examSessionService.hasActiveSebClientConnections(exam.id)) {
+ private Result checkNoActiveSEBClientConnections(final Exam exam) {
+ if (this.examSessionService.hasActiveSEBClientConnections(exam.id)) {
return Result.ofError(new APIMessageException(
APIMessage.ErrorMessage.INTEGRITY_VALIDATION
.of("Exam currently has active SEB Client connections.")));
@@ -455,7 +455,7 @@ public class ExamAdministrationController extends EntityController {
return Result.of(exam);
}
- private Result applySebRestriction(final Exam exam, final boolean restrict) {
+ private Result applySEBRestriction(final Exam exam, final boolean restrict) {
final LmsSetup lmsSetup = this.lmsAPIService.getLmsSetup(exam.lmsSetupId)
.getOrThrow();
@@ -474,18 +474,18 @@ public class ExamAdministrationController extends EntityController {
.of("The LMS for this Exam has no SEB restriction feature")));
}
- if (this.examSessionService.hasActiveSebClientConnections(exam.id)) {
+ if (this.examSessionService.hasActiveSEBClientConnections(exam.id)) {
return Result.ofError(new APIMessageException(
APIMessage.ErrorMessage.INTEGRITY_VALIDATION
.of("Exam currently has active SEB Client connections.")));
}
- return this.checkNoActiveSebClientConnections(exam)
- .flatMap(this.sebRestrictionService::applySebClientRestriction)
- .flatMap(e -> this.examDAO.setSebRestriction(exam.id, restrict));
+ return this.checkNoActiveSEBClientConnections(exam)
+ .flatMap(this.sebRestrictionService::applySEBClientRestriction)
+ .flatMap(e -> this.examDAO.setSEBRestriction(exam.id, restrict));
} else {
- return this.sebRestrictionService.releaseSebClientRestriction(exam)
- .flatMap(e -> this.examDAO.setSebRestriction(exam.id, restrict));
+ return this.sebRestrictionService.releaseSEBClientRestriction(exam)
+ .flatMap(e -> this.examDAO.setSEBRestriction(exam.id, restrict));
}
}
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamConfigurationMappingController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamConfigurationMappingController.java
index 0b459556..f153c6d3 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamConfigurationMappingController.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamConfigurationMappingController.java
@@ -237,7 +237,7 @@ public class ExamConfigurationMappingController extends EntityController {
+public class SEBClientConfigController extends ActivatableEntityController {
private final ClientConfigService sebClientConfigService;
- public SebClientConfigController(
- final SebClientConfigDAO sebClientConfigDAO,
+ public SEBClientConfigController(
+ final SEBClientConfigDAO sebClientConfigDAO,
final AuthorizationService authorization,
final UserActivityLogDAO userActivityLogDAO,
final BulkActionService bulkActionService,
@@ -96,7 +96,7 @@ public class SebClientConfigController extends ActivatableEntityController validForCreate(final SebClientConfig entity) {
+ protected Result validForCreate(final SEBClientConfig entity) {
return super.validForCreate(entity)
.map(this::checkPasswordMatch);
}
@Override
- protected Result validForSave(final SebClientConfig entity) {
+ protected Result validForSave(final SEBClientConfig entity) {
return super.validForSave(entity)
.map(this::checkPasswordMatch);
}
@Override
- protected Result notifySaved(final SebClientConfig entity) {
+ protected Result notifySaved(final SEBClientConfig entity) {
if (entity.isActive()) {
// try to get access token for SEB client
this.sebClientConfigService.initalCheckAccess(entity);
@@ -155,7 +155,7 @@ public class SebClientConfigController extends ActivatableEntityController errors = new ArrayList<>();
if (entity.hasEncryptionSecret() && !entity.encryptSecret.equals(entity.encryptSecretConfirm)) {
errors.add(APIMessage.fieldValidationError(
@@ -169,7 +169,7 @@ public class SebClientConfigController extends ActivatableEntityController {
- log.error("Active ClientConfig not found: ", t);
+ log.error("Active ClientConfig not found: {} cause: {}", clientId, t.getMessage());
throw new AccessDeniedException(t.getMessage());
});
}
diff --git a/src/main/resources/config/application-gui.properties b/src/main/resources/config/application-gui.properties
new file mode 100644
index 00000000..aca55cea
--- /dev/null
+++ b/src/main/resources/config/application-gui.properties
@@ -0,0 +1,33 @@
+##########################################################
+### SEB Server GUI configuration
+
+# theme
+sebserver.gui.theme=css/sebserver.css
+sebserver.gui.list.page.size=20
+sebserver.gui.defaultLogo=classpath:/static/images/sebserver-logo.png
+
+# User Account
+sebserver.gui.self-registering=true
+sebserver.gui.multilingual=false
+sebserver.gui.supported.languages=en
+sebserver.gui.date.displayformat=de
+
+# GUI API
+sebserver.gui.entrypoint=/gui
+sebserver.gui.webservice.protocol=http
+sebserver.gui.webservice.address=localhost
+sebserver.gui.webservice.port=8080
+sebserver.gui.webservice.apipath=${sebserver.webservice.api.admin.endpoint}
+# defines the polling interval that is used to poll the webservice for client connection data on a monitored exam page
+sebserver.gui.webservice.poll-interval=1000
+sebserver.gui.webservice.mock-lms-enabled=true
+sebserver.gui.seb.client.config.download.filename=SEBServerSettings.seb
+sebserver.gui.seb.exam.config.download.filename=SEBExamSettings.seb
+
+# Webservice connection details
+sebserver.webservice.api.exam.endpoint=/exam-api
+sebserver.webservice.api.exam.endpoint.discovery=${sebserver.webservice.api.exam.endpoint}/discovery
+sebserver.webservice.http.redirect.gui=${sebserver.gui.entrypoint}
+sebserver.webservice.api.admin.endpoint=/admin-api/v1
+sebserver.webservice.api.admin.clientId=guiClient
+sebserver.webservice.api.admin.clientSecret=${sebserver.password}
\ No newline at end of file
diff --git a/src/main/resources/config/application-ws.properties b/src/main/resources/config/application-ws.properties
new file mode 100644
index 00000000..559f1061
--- /dev/null
+++ b/src/main/resources/config/application-ws.properties
@@ -0,0 +1,54 @@
+##########################################################
+### SEB Server Webservice configuration
+
+sebserver.test.property=This is the default/root configuration
+
+### webservice initialization
+sebserver.init.adminaccount.gen-on-init=true
+sebserver.init.organisation.name=SEB Server
+sebserver.init.adminaccount.username=sebserver-admin
+
+### webservice data source configuration
+spring.datasource.username=root
+spring.datasource.initialize=true
+spring.datasource.initialization-mode=always
+spring.datasource.url=jdbc:mariadb://${datastore.mariadb.server.address}:${datastore.mariadb.server.port}/SEBServer?useSSL=false&createDatabaseIfNotExist=true
+spring.flyway.enabled=true
+spring.flyway.locations=classpath:config/sql/base
+spring.flyway.cleanDisabled=true
+spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
+spring.datasource.hikari.initializationFailTimeout=3000
+spring.datasource.hikari.connectionTimeout=30000
+spring.datasource.hikari.idleTimeout=600000
+spring.datasource.hikari.maxLifetime=1800000
+
+### webservice security
+spring.datasource.password=${sebserver.mariadb.password}
+sebserver.webservice.api.admin.clientSecret=${sebserver.password}
+sebserver.webservice.internalSecret=${sebserver.password}
+
+### webservice networking
+sebserver.webservice.distributed=false
+sebserver.webservice.http.external.scheme=https
+sebserver.webservice.http.external.servername=
+sebserver.webservice.http.external.port=
+sebserver.webservice.http.redirect.gui=/gui
+
+### webservice API
+sebserver.webservice.api.admin.clientId=guiClient
+sebserver.webservice.api.admin.endpoint=/admin-api/v1
+sebserver.webservice.api.admin.accessTokenValiditySeconds=3600
+sebserver.webservice.api.admin.refreshTokenValiditySeconds=25200
+sebserver.webservice.api.exam.config.init.permittedProcesses=config/initialPermittedProcesses.xml
+sebserver.webservice.api.exam.config.init.prohibitedProcesses=config/initialProhibitedProcesses.xml
+sebserver.webservice.api.exam.endpoint=/exam-api
+sebserver.webservice.api.exam.endpoint.discovery=${sebserver.webservice.api.exam.endpoint}/discovery
+sebserver.webservice.api.exam.endpoint.v1=${sebserver.webservice.api.exam.endpoint}/v1
+sebserver.webservice.api.exam.accessTokenValiditySeconds=3600
+sebserver.webservice.api.exam.event-handling-strategy=SINGLE_EVENT_STORE_STRATEGY
+sebserver.webservice.api.exam.enable-indicator-cache=true
+sebserver.webservice.api.pagination.maxPageSize=500
+# comma separated list of known possible OpenEdX API access token request endpoints
+sebserver.webservice.lms.openedx.api.token.request.paths=/oauth2/access_token
+sebserver.webservice.lms.moodle.api.token.request.paths=/login/token.php
+sebserver.webservice.lms.address.alias=
\ No newline at end of file
diff --git a/src/main/resources/config/application.properties b/src/main/resources/config/application.properties
index 865d7213..ea7af68d 100644
--- a/src/main/resources/config/application.properties
+++ b/src/main/resources/config/application.properties
@@ -1,6 +1,6 @@
spring.application.name=SEB Server
spring.profiles.active=dev
-sebserver.version=1.0.0
+sebserver.version=1.0.1
##########################################################
### Global Server Settings
@@ -54,85 +54,3 @@ security.require-ssl=false
# Disable this if a redirect is done by a reverse proxy for example
sebserver.ssl.redirect.enabled=false
sebserver.ssl.redirect.html.port=8080
-
-##########################################################
-### SEB Server Webservice configuration
-
-sebserver.test.property=This is the default/root configuration
-
-### webservice initialization
-sebserver.init.adminaccount.gen-on-init=true
-sebserver.init.organisation.name=SEB Server
-sebserver.init.adminaccount.username=sebserver-admin
-
-### webservice data source configuration
-spring.datasource.username=root
-spring.datasource.initialize=true
-spring.datasource.initialization-mode=always
-spring.datasource.url=jdbc:mariadb://${datastore.mariadb.server.address}:${datastore.mariadb.server.port}/SEBServer?useSSL=false&createDatabaseIfNotExist=true
-spring.flyway.enabled=true
-spring.flyway.locations=classpath:config/sql/base
-spring.flyway.cleanDisabled=true
-spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
-spring.datasource.hikari.initializationFailTimeout=3000
-spring.datasource.hikari.connectionTimeout=30000
-spring.datasource.hikari.idleTimeout=600000
-spring.datasource.hikari.maxLifetime=1800000
-
-### webservice security
-spring.datasource.password=${sebserver.mariadb.password}
-sebserver.webservice.api.admin.clientSecret=${sebserver.password}
-sebserver.webservice.internalSecret=${sebserver.password}
-
-### webservice networking
-sebserver.webservice.distributed=false
-sebserver.webservice.http.external.scheme=https
-sebserver.webservice.http.external.servername=
-sebserver.webservice.http.external.port=
-sebserver.webservice.http.redirect.gui=/gui
-
-### webservice API
-sebserver.webservice.api.admin.clientId=guiClient
-sebserver.webservice.api.admin.endpoint=/admin-api/v1
-sebserver.webservice.api.admin.accessTokenValiditySeconds=3600
-sebserver.webservice.api.admin.refreshTokenValiditySeconds=25200
-sebserver.webservice.api.exam.config.init.permittedProcesses=config/initialPermittedProcesses.xml
-sebserver.webservice.api.exam.config.init.prohibitedProcesses=config/initialProhibitedProcesses.xml
-sebserver.webservice.api.exam.endpoint=/exam-api
-sebserver.webservice.api.exam.endpoint.discovery=${sebserver.webservice.api.exam.endpoint}/discovery
-sebserver.webservice.api.exam.endpoint.v1=${sebserver.webservice.api.exam.endpoint}/v1
-sebserver.webservice.api.exam.accessTokenValiditySeconds=3600
-sebserver.webservice.api.exam.event-handling-strategy=SINGLE_EVENT_STORE_STRATEGY
-sebserver.webservice.api.exam.enable-indicator-cache=true
-sebserver.webservice.api.pagination.maxPageSize=500
-# comma separated list of known possible OpenEdX API access token request endpoints
-sebserver.webservice.lms.openedx.api.token.request.paths=/oauth2/access_token
-sebserver.webservice.lms.moodle.api.token.request.paths=/login/token.php
-sebserver.webservice.lms.address.alias=
-
-##########################################################
-### SEB Server GUI configuration
-
-# theme
-sebserver.gui.theme=css/sebserver.css
-sebserver.gui.list.page.size=20
-sebserver.gui.defaultLogo=classpath:/static/images/sebserver-logo.png
-
-# User Account
-sebserver.gui.self-registering=true
-sebserver.gui.multilingual=false
-sebserver.gui.supported.languages=en
-sebserver.gui.date.displayformat=de
-
-# GUI API
-sebserver.gui.entrypoint=/gui
-sebserver.gui.webservice.protocol=http
-sebserver.gui.webservice.address=localhost
-sebserver.gui.webservice.port=8080
-sebserver.gui.webservice.apipath=${sebserver.webservice.api.admin.endpoint}
-# defines the polling interval that is used to poll the webservice for client connection data on a monitored exam page
-sebserver.gui.webservice.poll-interval=1000
-sebserver.gui.webservice.mock-lms-enabled=true
-sebserver.gui.seb.client.config.download.filename=SEBServerSettings.seb
-sebserver.gui.seb.exam.config.download.filename=SEBExamSettings.seb
-
diff --git a/src/test/java/ch/ethz/seb/sebserver/webservice/servicelayer/client/ClientCredentialServiceTest.java b/src/test/java/ch/ethz/seb/sebserver/gbl/client/ClientCredentialServiceTest.java
similarity index 94%
rename from src/test/java/ch/ethz/seb/sebserver/webservice/servicelayer/client/ClientCredentialServiceTest.java
rename to src/test/java/ch/ethz/seb/sebserver/gbl/client/ClientCredentialServiceTest.java
index 01384d7e..ec38bc0a 100644
--- a/src/test/java/ch/ethz/seb/sebserver/webservice/servicelayer/client/ClientCredentialServiceTest.java
+++ b/src/test/java/ch/ethz/seb/sebserver/gbl/client/ClientCredentialServiceTest.java
@@ -6,12 +6,13 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-package ch.ethz.seb.sebserver.webservice.servicelayer.client;
+package ch.ethz.seb.sebserver.gbl.client;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentialServiceImpl;
import ch.ethz.seb.sebserver.gbl.util.Cryptor;
import org.junit.Test;
import org.springframework.core.env.Environment;
diff --git a/src/test/java/ch/ethz/seb/sebserver/gbl/model/exam/OpenEdxSebRestrictionTest.java b/src/test/java/ch/ethz/seb/sebserver/gbl/model/exam/OpenEdxSebRestrictionTest.java
index 75e10ddb..7d5e1640 100644
--- a/src/test/java/ch/ethz/seb/sebserver/gbl/model/exam/OpenEdxSebRestrictionTest.java
+++ b/src/test/java/ch/ethz/seb/sebserver/gbl/model/exam/OpenEdxSebRestrictionTest.java
@@ -22,7 +22,7 @@ public class OpenEdxSebRestrictionTest {
public void testEmpty1() throws JsonProcessingException {
final JSONMapper mapper = new JSONMapper();
- final OpenEdxSebRestriction data = new OpenEdxSebRestriction(null, null, null, null, null, false);
+ final OpenEdxSEBRestriction data = new OpenEdxSEBRestriction(null, null, null, null, null, false);
final String json = mapper.writeValueAsString(data);
assertEquals(
"{\"CONFIG_KEYS\":[],\"BROWSER_KEYS\":[],\"WHITELIST_PATHS\":[],\"BLACKLIST_CHAPTERS\":[],\"PERMISSION_COMPONENTS\":[],\"USER_BANNING_ENABLED\":false}",
@@ -33,8 +33,8 @@ public class OpenEdxSebRestrictionTest {
public void testEmpty2() throws JsonProcessingException {
final JSONMapper mapper = new JSONMapper();
- final OpenEdxSebRestriction data =
- OpenEdxSebRestriction.from(new SebRestriction(null, null, null, null));
+ final OpenEdxSEBRestriction data =
+ OpenEdxSEBRestriction.from(new SEBRestriction(null, null, null, null));
final String json = mapper.writeValueAsString(data);
assertEquals(
"{\"CONFIG_KEYS\":[],\"BROWSER_KEYS\":[],\"WHITELIST_PATHS\":[],\"BLACKLIST_CHAPTERS\":[],\"PERMISSION_COMPONENTS\":[\"AlwaysAllowStaff\"],\"USER_BANNING_ENABLED\":false}",
diff --git a/src/test/java/ch/ethz/seb/sebserver/gui/integration/ClientConfigTest.java b/src/test/java/ch/ethz/seb/sebserver/gui/integration/ClientConfigTest.java
index 0ff08e7b..d6cbeb9c 100644
--- a/src/test/java/ch/ethz/seb/sebserver/gui/integration/ClientConfigTest.java
+++ b/src/test/java/ch/ethz/seb/sebserver/gui/integration/ClientConfigTest.java
@@ -16,7 +16,7 @@ import org.springframework.test.context.jdbc.Sql;
import ch.ethz.seb.sebserver.gbl.api.API;
import ch.ethz.seb.sebserver.gbl.model.Domain;
import ch.ethz.seb.sebserver.gbl.model.EntityProcessingReport;
-import ch.ethz.seb.sebserver.gbl.model.sebconfig.SebClientConfig;
+import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestServiceImpl;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.clientconfig.ActivateClientConfig;
@@ -32,15 +32,15 @@ public class ClientConfigTest extends GuiIntegrationTest {
public void testNewClientConfigWithQueryParam() {
final RestServiceImpl restService = createRestServiceForUser("admin", "admin", new NewClientConfig());
- final Result call = restService.getBuilder(NewClientConfig.class)
+ final Result call = restService.getBuilder(NewClientConfig.class)
.withQueryParam(Domain.SEB_CLIENT_CONFIGURATION.ATTR_NAME, "new client config")
.withFormParam("Test", "new client config")
- .withFormParam(SebClientConfig.ATTR_CONFIG_PURPOSE, SebClientConfig.ConfigPurpose.START_EXAM.name())
+ .withFormParam(SEBClientConfig.ATTR_CONFIG_PURPOSE, SEBClientConfig.ConfigPurpose.START_EXAM.name())
.call();
assertNotNull(call);
assertFalse(call.hasError());
- final SebClientConfig createdConfig = call.get();
+ final SEBClientConfig createdConfig = call.get();
assertEquals(Long.valueOf(1), createdConfig.id);
assertEquals("new client config", createdConfig.name);
assertFalse(createdConfig.active);
@@ -50,14 +50,14 @@ public class ClientConfigTest extends GuiIntegrationTest {
public void testNewClientConfigWithURLEncodedForm() {
final RestServiceImpl restService = createRestServiceForUser("admin", "admin", new NewClientConfig());
- final Result call = restService.getBuilder(NewClientConfig.class)
+ final Result call = restService.getBuilder(NewClientConfig.class)
.withFormParam(Domain.SEB_CLIENT_CONFIGURATION.ATTR_NAME, "new client config")
- .withFormParam(SebClientConfig.ATTR_CONFIG_PURPOSE, SebClientConfig.ConfigPurpose.START_EXAM.name())
+ .withFormParam(SEBClientConfig.ATTR_CONFIG_PURPOSE, SEBClientConfig.ConfigPurpose.START_EXAM.name())
.call();
assertNotNull(call);
assertFalse(call.hasError());
- final SebClientConfig createdConfig = call.get();
+ final SEBClientConfig createdConfig = call.get();
assertEquals(Long.valueOf(1), createdConfig.id);
assertEquals("new client config", createdConfig.name);
assertFalse(createdConfig.active);
@@ -73,20 +73,20 @@ public class ClientConfigTest extends GuiIntegrationTest {
new DeactivateClientConfig());
// create one
- final SebClientConfig config = restService.getBuilder(NewClientConfig.class)
+ final SEBClientConfig config = restService.getBuilder(NewClientConfig.class)
.withQueryParam(Domain.SEB_CLIENT_CONFIGURATION.ATTR_NAME, "new client config")
- .withFormParam(SebClientConfig.ATTR_CONFIG_PURPOSE, SebClientConfig.ConfigPurpose.START_EXAM.name())
+ .withFormParam(SEBClientConfig.ATTR_CONFIG_PURPOSE, SEBClientConfig.ConfigPurpose.START_EXAM.name())
.call()
.getOrThrow();
// get
- final Result call = restService.getBuilder(GetClientConfig.class)
+ final Result call = restService.getBuilder(GetClientConfig.class)
.withURIVariable(API.PARAM_MODEL_ID, config.getModelId())
.call();
assertNotNull(call);
assertFalse(call.hasError());
- final SebClientConfig createdConfig = call.get();
+ final SEBClientConfig createdConfig = call.get();
assertEquals(config.id, createdConfig.id);
assertEquals("new client config", createdConfig.name);
assertFalse(createdConfig.active);
@@ -104,11 +104,11 @@ public class ClientConfigTest extends GuiIntegrationTest {
// save with password (no confirm) expecting validation error
final Result> valError = restService.getBuilder(SaveClientConfig.class)
- .withBody(new SebClientConfig(
+ .withBody(new SEBClientConfig(
config.id,
config.institutionId,
"new client config",
- SebClientConfig.ConfigPurpose.START_EXAM,
+ SEBClientConfig.ConfigPurpose.START_EXAM,
null,
null,
null,
@@ -130,12 +130,12 @@ public class ClientConfigTest extends GuiIntegrationTest {
assertTrue(error.getMessage().contains("password.mismatch"));
// save with new password
- final SebClientConfig newConfig = restService.getBuilder(SaveClientConfig.class)
- .withBody(new SebClientConfig(
+ final SEBClientConfig newConfig = restService.getBuilder(SaveClientConfig.class)
+ .withBody(new SEBClientConfig(
config.id,
config.institutionId,
"new client config",
- SebClientConfig.ConfigPurpose.START_EXAM,
+ SEBClientConfig.ConfigPurpose.START_EXAM,
null,
null,
null,
diff --git a/src/test/java/ch/ethz/seb/sebserver/gui/integration/SEBClientBot.java b/src/test/java/ch/ethz/seb/sebserver/gui/integration/SEBClientBot.java
new file mode 100644
index 00000000..89b25202
--- /dev/null
+++ b/src/test/java/ch/ethz/seb/sebserver/gui/integration/SEBClientBot.java
@@ -0,0 +1,567 @@
+/*
+ * Copyright (c) 2020 ETH Zürich, Educational Development and Technology (LET)
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+package ch.ethz.seb.sebserver.gui.integration;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Random;
+import java.util.UUID;
+
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.client.ClientHttpResponse;
+import org.springframework.http.client.SimpleClientHttpRequestFactory;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.security.oauth2.client.OAuth2RestTemplate;
+import org.springframework.security.oauth2.client.http.OAuth2ErrorHandler;
+import org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsResourceDetails;
+import org.springframework.security.oauth2.common.OAuth2AccessToken;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentials;
+import ch.ethz.seb.sebserver.gbl.model.session.RunningExamInfo;
+
+public class SEBClientBot {
+
+ private static final Logger log = LoggerFactory.getLogger(SEBClientBot.class);
+
+ private static final Character COMMA = ',';
+ private static final Character AMPERSAND = '&';
+ private static final Character EQUALITY_SIGN = '=';
+
+ private static final String LIST_SEPARATOR = COMMA.toString();
+ private static final String FORM_URL_ENCODED_SEPARATOR = AMPERSAND.toString();
+ private static final String FORM_URL_ENCODED_NAME_VALUE_SEPARATOR = EQUALITY_SIGN.toString();
+
+ private static final String PARAM_INSTITUTION_ID = "institutionId";
+ private static final String EXAM_API_PARAM_EXAM_ID = "examId";
+ private static final String EXAM_API_SEB_CONNECTION_TOKEN = "SEBConnectionToken";
+ private static final String EXAM_API_USER_SESSION_ID = "seb_user_session_id";
+ private static final String EXAM_API_HANDSHAKE_ENDPOINT = "/handshake";
+ private static final String EXAM_API_CONFIGURATION_REQUEST_ENDPOINT = "/examconfig";
+ private static final String EXAM_API_PING_ENDPOINT = "/sebping";
+ private static final String EXAM_API_PING_TIMESTAMP = "timestamp";
+ private static final String EXAM_API_PING_NUMBER = "ping-number";
+ private static final String EXAM_API_EVENT_ENDPOINT = "/seblog";
+
+ private static final long ONE_SECOND = 1000; // milliseconds
+ static final long TEN_SECONDS = 10 * ONE_SECOND;
+ static final long ONE_MINUTE = 60 * ONE_SECOND;
+ @SuppressWarnings("unused")
+ private static final long ONE_HOUR = 60 * ONE_MINUTE;
+
+ //private final ExecutorService executorService;
+ private final List scopes = Arrays.asList("read", "write");
+ private final ObjectMapper jsonMapper = new ObjectMapper();
+ private final Random random = new Random();
+
+ String webserviceAddress = "http://localhost:8080";
+ String accessTokenEndpoint = "/oauth/token";
+ String clientId = "test";
+ String sessionId = null;
+ String clientSecret = "test";
+ String apiPath = "/exam-api";
+ String apiVersion = "v1";
+ String examId = "2";
+ String institutionId = "1";
+ int numberOfConnections = 4;
+ long establishDelay = 0;
+ long pingInterval = 100;
+ long pingPause = 0;
+ long pingPauseDelay = 0;
+ long errorInterval = ONE_SECOND;
+ long warnInterval = ONE_SECOND / 2;
+ long runtime = ONE_SECOND * 2;
+ int connectionAttempts = 1;
+
+ public SEBClientBot(final ClientCredentials credentials, final String examId, final String instId)
+ throws Exception {
+
+ this.clientId = credentials.clientIdAsString();
+ this.clientSecret = credentials.secretAsString();
+ this.examId = examId;
+ this.institutionId = instId;
+
+ //this.executorService = Executors.newFixedThreadPool(this.numberOfConnections);
+
+ for (int i = 0; i < this.numberOfConnections; i++) {
+ final String sessionId = StringUtils.isNotBlank(this.sessionId)
+ ? this.sessionId
+ : "connection_" + getRandomName();
+
+ new ConnectionBot(sessionId).run();
+ //this.executorService.execute(new ConnectionBot(sessionId));
+ }
+
+ //this.executorService.shutdown();
+ }
+
+ private String getRandomName() {
+ final StringBuilder sb = new StringBuilder(String.valueOf(this.random.nextInt(100)));
+ while (sb.length() < 3) {
+ sb.insert(0, "0");
+ }
+ return sb.toString();
+ }
+
+ private final class ConnectionBot implements Runnable {
+
+ private final String name;
+ private final OAuth2RestTemplate restTemplate;
+
+ private final String handshakeURI = SEBClientBot.this.webserviceAddress +
+ SEBClientBot.this.apiPath + "/" +
+ SEBClientBot.this.apiVersion + EXAM_API_HANDSHAKE_ENDPOINT;
+ private final String configurartionURI = SEBClientBot.this.webserviceAddress +
+ SEBClientBot.this.apiPath + "/" +
+ SEBClientBot.this.apiVersion + EXAM_API_CONFIGURATION_REQUEST_ENDPOINT;
+ private final String pingURI = SEBClientBot.this.webserviceAddress +
+ SEBClientBot.this.apiPath + "/" +
+ SEBClientBot.this.apiVersion + EXAM_API_PING_ENDPOINT;
+ private final String eventURI = SEBClientBot.this.webserviceAddress +
+ SEBClientBot.this.apiPath + "/" +
+ SEBClientBot.this.apiVersion + EXAM_API_EVENT_ENDPOINT;
+
+ private final HttpEntity> connectBody;
+
+ protected ConnectionBot(final String name) {
+ this.name = name;
+ this.restTemplate = createRestTemplate(null);
+ final MultiValueMap headers = new LinkedMultiValueMap<>();
+ headers.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
+ this.connectBody = new HttpEntity<>(PARAM_INSTITUTION_ID +
+ FORM_URL_ENCODED_NAME_VALUE_SEPARATOR +
+ SEBClientBot.this.institutionId
+// + Constants.FORM_URL_ENCODED_SEPARATOR
+// + API.EXAM_API_PARAM_EXAM_ID
+// + Constants.FORM_URL_ENCODED_NAME_VALUE_SEPARATOR
+// + this.examId
+ ,
+ headers);
+
+ }
+
+ @Override
+ public void run() {
+
+ int attempt = 0;
+ String connectionToken = null;
+
+ while (connectionToken == null && attempt < SEBClientBot.this.connectionAttempts) {
+ attempt++;
+ log.info("ConnectionBot {} : Try to request access-token; attempt: {}", this.name, attempt);
+ try {
+
+ final OAuth2AccessToken accessToken = this.restTemplate.getAccessToken();
+ log.info("ConnectionBot {} : Got access token: {}", this.name, accessToken);
+ connectionToken = createConnection();
+
+ } catch (final Exception e) {
+ log.error("ConnectionBot {} : Failed to request access-token: ", this.name, e);
+ if (attempt >= SEBClientBot.this.connectionAttempts) {
+ log.error("ConnectionBot {} : Gave up afer {} connection attempts: ", this.name, attempt);
+ throw new RuntimeException("Connection Error. See Logs", e);
+ }
+ }
+ }
+
+ final MultiValueMap headers = new LinkedMultiValueMap<>();
+ headers.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
+ headers.set(EXAM_API_SEB_CONNECTION_TOKEN, connectionToken);
+
+ final MultiValueMap eventHeaders = new LinkedMultiValueMap<>();
+ eventHeaders.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_UTF8_VALUE);
+ eventHeaders.set(EXAM_API_SEB_CONNECTION_TOKEN, connectionToken);
+
+ if (connectionToken != null) {
+ if (getConfig(headers) && establishConnection(headers)) {
+
+ final PingEntity pingHeader = new PingEntity(headers);
+ final EventEntity errorHeader = new EventEntity(eventHeaders, "ERROR_LOG");
+ final EventEntity warnHeader = new EventEntity(eventHeaders, "WARN_LOG");
+
+ try {
+ final long startTime = System.currentTimeMillis();
+ final long endTime = startTime + SEBClientBot.this.runtime;
+ final long pingPauseStart = startTime + SEBClientBot.this.pingPauseDelay;
+ final long pingPauseEnd = pingPauseStart + SEBClientBot.this.pingPause;
+ long currentTime = startTime;
+ long lastPingTime = startTime;
+ long lastErrorTime = startTime;
+ long lastWarnTime = startTime;
+
+ while (currentTime < endTime) {
+ if (currentTime - lastPingTime >= SEBClientBot.this.pingInterval &&
+ !(currentTime > pingPauseStart && currentTime < pingPauseEnd)) {
+
+ pingHeader.next();
+ if (!sendPing(pingHeader)) {
+ // expecting a quit instruction was sent here
+ return;
+ }
+ lastPingTime = currentTime;
+ }
+ if (currentTime - lastErrorTime >= SEBClientBot.this.errorInterval) {
+ errorHeader.next();
+ sendEvent(errorHeader);
+ lastErrorTime = currentTime;
+ }
+ if (currentTime - lastWarnTime >= SEBClientBot.this.warnInterval) {
+ warnHeader.next();
+ sendEvent(warnHeader);
+ lastWarnTime = currentTime;
+ }
+ try {
+ Thread.sleep(50);
+ } catch (final Exception e) {
+ }
+ currentTime = System.currentTimeMillis();
+ }
+ } catch (final Throwable t) {
+ log.error("ConnectionBot {} : Error sending events: ", this.name, t);
+ throw new RuntimeException("ConnectionBot {} : Error sending events: ");
+ } finally {
+ disconnect(connectionToken);
+ }
+ }
+ }
+ }
+
+ private String createConnection() {
+ log.info("ConnectionBot {} : init connection", this.name);
+
+ try {
+ final ResponseEntity exchange = this.restTemplate.exchange(
+ this.handshakeURI,
+ HttpMethod.POST,
+ this.connectBody,
+ new ParameterizedTypeReference() {
+ });
+
+ final HttpStatus statusCode = exchange.getStatusCode();
+ if (statusCode.isError()) {
+ throw new RuntimeException("Webservice answered with error: " + exchange.getBody());
+ }
+
+ final Collection body = SEBClientBot.this.jsonMapper.readValue(
+ exchange.getBody(),
+ new TypeReference>() {
+ });
+ final String token = exchange.getHeaders().getFirst(EXAM_API_SEB_CONNECTION_TOKEN);
+
+ log.info("ConnectionBot {} : successfully created connection, token: {} body: {} ",
+ this.name,
+ token,
+ body);
+
+ return token;
+ } catch (final Exception e) {
+ log.error("ConnectionBot {} : Failed to init connection", this.name, e);
+ throw new RuntimeException("ConnectionBot {} : Failed to init connection: ", e);
+ }
+ }
+
+ public boolean getConfig(final MultiValueMap headers) {
+ final HttpEntity> configHeader = new HttpEntity<>(headers);
+
+ log.info("ConnectionBot {} : get SEB Configuration", this.name);
+
+ try {
+ final ResponseEntity exchange = this.restTemplate.exchange(
+ this.configurartionURI + "?" + EXAM_API_PARAM_EXAM_ID +
+ FORM_URL_ENCODED_NAME_VALUE_SEPARATOR +
+ SEBClientBot.this.examId,
+ HttpMethod.GET,
+ configHeader,
+ new ParameterizedTypeReference() {
+ });
+
+ final HttpStatus statusCode = exchange.getStatusCode();
+ if (statusCode.isError()) {
+ throw new RuntimeException("Webservice answered with error: " + exchange.getBody());
+ }
+
+ final byte[] config = exchange.getBody();
+
+ if (ArrayUtils.isEmpty(config)) {
+ log.error("No Exam config get from API. processing anyway");
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug(
+ "ConnectionBot {} : successfully requested exam config: " + SEBClientBot.toString(config),
+ this.name);
+ } else {
+ log.info("ConnectionBot {} : successfully requested exam config", this.name);
+ }
+
+ return true;
+ } catch (final Exception e) {
+ log.error("ConnectionBot {} : Failed get SEB Configuration", this.name, e);
+ return false;
+ }
+ }
+
+ public boolean establishConnection(final MultiValueMap headers) {
+
+ if (SEBClientBot.this.establishDelay > 0) {
+ try {
+
+ log.info("Wait for connection activation -> {}", SEBClientBot.this.establishDelay);
+
+ Thread.sleep(SEBClientBot.this.establishDelay);
+ } catch (final Exception e) {
+ log.error("Failed to wait for connection activiation -> {} : {}",
+ SEBClientBot.this.establishDelay,
+ e.getMessage());
+ throw new RuntimeException();
+ }
+ }
+
+ final HttpEntity> configHeader = new HttpEntity<>(
+ EXAM_API_USER_SESSION_ID +
+ FORM_URL_ENCODED_NAME_VALUE_SEPARATOR +
+ this.name,
+ headers);
+
+ log.info("ConnectionBot {} : Trying to establish SEB client connection", this.name);
+
+ try {
+
+ final ResponseEntity exchange = this.restTemplate.exchange(
+ this.handshakeURI,
+ HttpMethod.PUT,
+ configHeader,
+ new ParameterizedTypeReference() {
+ });
+
+ final HttpStatus statusCode = exchange.getStatusCode();
+ if (statusCode.isError()) {
+ throw new RuntimeException("Webservice answered with error: " + exchange.getBody());
+ }
+
+ log.info("ConnectionBot {} : successfully established SEB client connection", this.name);
+
+ return true;
+ } catch (final Exception e) {
+ log.error("ConnectionBot {} : Failed get established SEB client connection", this.name, e);
+ throw new RuntimeException();
+ }
+ }
+
+ private boolean sendPing(final HttpEntity pingHeader) {
+ try {
+
+ final ResponseEntity exchange = this.restTemplate.exchange(
+ this.pingURI,
+ HttpMethod.POST,
+ pingHeader,
+ new ParameterizedTypeReference() {
+ });
+
+ if (exchange.hasBody() && exchange.getBody().contains("SEB_QUIT")) {
+ log.info("SEB_QUIT client {}, response: {}",
+ pingHeader.getHeaders().get(EXAM_API_SEB_CONNECTION_TOKEN),
+ exchange.getBody());
+ return false;
+ }
+
+ return true;
+ } catch (final Exception e) {
+ log.error("ConnectionBot {} : Failed send ping", this.name, e);
+ throw new RuntimeException();
+ }
+ }
+
+ private boolean sendEvent(final HttpEntity eventHeader) {
+ try {
+
+ this.restTemplate.exchange(
+ this.eventURI,
+ HttpMethod.POST,
+ eventHeader,
+ new ParameterizedTypeReference() {
+ });
+
+ return true;
+ } catch (final Exception e) {
+ log.error("ConnectionBot {} : Failed send event", this.name, e);
+ throw new RuntimeException();
+ }
+ }
+
+ public boolean disconnect(final String connectionToken) {
+ final MultiValueMap headers = new LinkedMultiValueMap<>();
+ headers.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
+ headers.set(EXAM_API_SEB_CONNECTION_TOKEN, connectionToken);
+ final HttpEntity> configHeader = new HttpEntity<>(headers);
+
+ log.info("ConnectionBot {} : Trying to delete SEB client connection", this.name);
+
+ try {
+
+ final ResponseEntity exchange = this.restTemplate.exchange(
+ this.handshakeURI,
+ HttpMethod.DELETE,
+ configHeader,
+ new ParameterizedTypeReference() {
+ });
+
+ final HttpStatus statusCode = exchange.getStatusCode();
+ if (statusCode.isError()) {
+ throw new RuntimeException("Webservice answered with error: " + exchange.getBody());
+ }
+
+ log.info("ConnectionBot {} : successfully deleted SEB client connection", this.name);
+
+ return true;
+ } catch (final Exception e) {
+ log.error("ConnectionBot {} : Failed get deleted SEB client connection", this.name, e);
+ throw new RuntimeException();
+ }
+ }
+ }
+
+ private OAuth2RestTemplate createRestTemplate(final String scopes) {
+ final ClientCredentialsResourceDetails clientCredentialsResourceDetails =
+ new ClientCredentialsResourceDetails();
+ clientCredentialsResourceDetails
+ .setAccessTokenUri(this.webserviceAddress + this.accessTokenEndpoint);
+ clientCredentialsResourceDetails.setClientId(this.clientId);
+ clientCredentialsResourceDetails.setClientSecret(this.clientSecret);
+ if (StringUtils.isBlank(scopes)) {
+ clientCredentialsResourceDetails.setScope(this.scopes);
+ } else {
+ clientCredentialsResourceDetails.setScope(
+ Arrays.asList(StringUtils.split(scopes, LIST_SEPARATOR)));
+ }
+
+ final OAuth2RestTemplate restTemplate = new OAuth2RestTemplate(clientCredentialsResourceDetails);
+ restTemplate.setErrorHandler(new OAuth2ErrorHandler(clientCredentialsResourceDetails) {
+
+ @Override
+ public void handleError(final ClientHttpResponse response) throws IOException {
+ System.out.println("********************** handleError: " + response.getStatusCode());
+ super.handleError(response);
+ }
+
+ });
+ restTemplate
+ .getMessageConverters()
+ .add(0, new StringHttpMessageConverter(Charset.forName("UTF-8")));
+ //restTemplate.setRetryBadAccessTokens(true);
+
+ final SimpleClientHttpRequestFactory simpleClientHttpRequestFactory = new SimpleClientHttpRequestFactory();
+ simpleClientHttpRequestFactory.setReadTimeout(30000);
+ simpleClientHttpRequestFactory.setOutputStreaming(false);
+ restTemplate.setRequestFactory(simpleClientHttpRequestFactory);
+
+ return restTemplate;
+ }
+
+ private static class PingEntity extends HttpEntity {
+ private final String pingBodyTemplate = EXAM_API_PING_TIMESTAMP +
+ FORM_URL_ENCODED_NAME_VALUE_SEPARATOR +
+ "%s" +
+ FORM_URL_ENCODED_SEPARATOR +
+ EXAM_API_PING_NUMBER +
+ FORM_URL_ENCODED_NAME_VALUE_SEPARATOR +
+ "%s";
+
+ private long timestamp = 0;
+ private int count = 0;
+
+ protected PingEntity(final MultiValueMap headers) {
+ super(headers);
+ }
+
+ void next() {
+ this.timestamp = System.currentTimeMillis();
+ this.count++;
+ }
+
+ @Override
+ public String getBody() {
+ return String.format(this.pingBodyTemplate, this.timestamp, this.count);
+ }
+
+ @Override
+ public boolean hasBody() {
+ return true;
+ }
+ }
+
+ private static class EventEntity extends HttpEntity {
+ private final String eventBodyTemplate =
+ "{ \"type\": \"%s\", \"timestamp\": %s, \"text\": \"some error " + UUID.randomUUID() + " \" }";
+
+ private long timestamp = 0;
+ private final String eventType;
+
+ protected EventEntity(final MultiValueMap headers, final String eventType) {
+ super(headers);
+ this.eventType = eventType;
+ }
+
+ void next() {
+ this.timestamp = System.currentTimeMillis();
+ }
+
+ @Override
+ public String getBody() {
+ return String.format(this.eventBodyTemplate, this.eventType, this.timestamp);
+ }
+
+ @Override
+ public boolean hasBody() {
+ return true;
+ }
+ }
+
+ public static CharBuffer toCharBuffer(final ByteBuffer byteBuffer) {
+ if (byteBuffer == null) {
+ return CharBuffer.allocate(0);
+ }
+
+ byteBuffer.rewind();
+ return StandardCharsets.UTF_8.decode(byteBuffer);
+ }
+
+ public static String toString(final ByteBuffer byteBuffer) {
+ return toCharBuffer(byteBuffer).toString();
+ }
+
+ public static String toString(final byte[] byteArray) {
+ if (byteArray == null) {
+ return null;
+ }
+
+ return toString(ByteBuffer.wrap(byteArray));
+ }
+
+}
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 da4bcfbe..a52d3a00 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
@@ -30,16 +30,20 @@ import org.apache.tomcat.util.buf.StringUtils;
import org.joda.time.DateTimeZone;
import org.junit.After;
import org.junit.Before;
+import org.junit.FixMethodOrder;
import org.junit.Test;
+import org.junit.runners.MethodSorters;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.core.io.ClassPathResource;
import org.springframework.test.context.jdbc.Sql;
import org.springframework.util.StreamUtils;
-import org.springframework.web.servlet.DispatcherServlet;
import ch.ethz.seb.sebserver.gbl.Constants;
import ch.ethz.seb.sebserver.gbl.api.API;
+import ch.ethz.seb.sebserver.gbl.api.APIMessage;
import ch.ethz.seb.sebserver.gbl.api.JSONMapper;
+import ch.ethz.seb.sebserver.gbl.client.ClientCredentials;
import ch.ethz.seb.sebserver.gbl.model.Domain;
import ch.ethz.seb.sebserver.gbl.model.Domain.SEB_CLIENT_CONFIGURATION;
import ch.ethz.seb.sebserver.gbl.model.EntityName;
@@ -48,6 +52,7 @@ import ch.ethz.seb.sebserver.gbl.model.Page;
import ch.ethz.seb.sebserver.gbl.model.exam.Exam;
import ch.ethz.seb.sebserver.gbl.model.exam.Exam.ExamStatus;
import ch.ethz.seb.sebserver.gbl.model.exam.Exam.ExamType;
+import ch.ethz.seb.sebserver.gbl.model.exam.ExamConfigurationMap;
import ch.ethz.seb.sebserver.gbl.model.exam.Indicator;
import ch.ethz.seb.sebserver.gbl.model.exam.Indicator.IndicatorType;
import ch.ethz.seb.sebserver.gbl.model.exam.Indicator.Threshold;
@@ -57,6 +62,7 @@ import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup.LmsType;
import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetupTestResult;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigCreationInfo;
+import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigKey;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.Configuration;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationAttribute;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationNode;
@@ -66,9 +72,14 @@ import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationTableValues;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationTableValues.TableValue;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationValue;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.Orientation;
-import ch.ethz.seb.sebserver.gbl.model.sebconfig.SebClientConfig;
+import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.TemplateAttribute;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.View;
+import ch.ethz.seb.sebserver.gbl.model.session.ClientConnectionData;
+import ch.ethz.seb.sebserver.gbl.model.session.ClientInstruction;
+import ch.ethz.seb.sebserver.gbl.model.session.ClientInstruction.InstructionType;
+import ch.ethz.seb.sebserver.gbl.model.session.ExtendedClientEvent;
+import ch.ethz.seb.sebserver.gbl.model.session.IndicatorValue;
import ch.ethz.seb.sebserver.gbl.model.user.PasswordChange;
import ch.ethz.seb.sebserver.gbl.model.user.UserInfo;
import ch.ethz.seb.sebserver.gbl.model.user.UserRole;
@@ -78,14 +89,20 @@ import ch.ethz.seb.sebserver.gui.service.examconfig.impl.AttributeMapping;
import ch.ethz.seb.sebserver.gui.service.examconfig.impl.ExamConfigurationServiceImpl;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCallError;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestServiceImpl;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.CheckExamConsistency;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.DeleteExamConfigMapping;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.ExportExamConfig;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.GetExam;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.GetExamConfigMappingNames;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.GetExamConfigMappingsPage;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.GetExamNames;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.GetExamPage;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.GetIndicator;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.GetIndicatorPage;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.NewExamConfigMapping;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.NewIndicator;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.SaveExam;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.SaveExamConfigMapping;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.exam.SaveIndicator;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.institution.ActivateInstitution;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.institution.GetInstitution;
@@ -98,6 +115,7 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.lmssetup.GetLmsSe
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.lmssetup.NewLmsSetup;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.lmssetup.SaveLmsSetup;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.lmssetup.TestLmsSetup;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.logs.GetExtendedClientEventPage;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.quiz.GetQuizData;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.quiz.GetQuizPage;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.quiz.ImportAsExam;
@@ -110,6 +128,7 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.clientconfig.
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.clientconfig.SaveClientConfig;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.AttachDefaultOrientation;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.CopyConfiguration;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.ExportConfigKey;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.ExportPlainXML;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.GetConfigAttributes;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.GetConfigurationPage;
@@ -118,6 +137,7 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.Ge
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.GetConfigurationValues;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.GetConfigurations;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.GetExamConfigNode;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.GetExamConfigNodeNames;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.GetExamConfigNodePage;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.GetFollowupConfiguration;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.GetOrientationPage;
@@ -132,18 +152,24 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.Im
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.NewExamConfig;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.RemoveOrientation;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.ResetTemplateValues;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.SEBExamConfigUndo;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.SaveExamConfig;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.SaveExamConfigHistory;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.SaveExamConfigTableValues;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.SaveExamConfigValue;
-import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.SebExamConfigUndo;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.session.DisableClientConnection;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.session.GetClientConnectionDataList;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.session.GetRunningExamPage;
+import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.session.PropagateInstruction;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.useraccount.ActivateUserAccount;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.useraccount.ChangePassword;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.useraccount.GetUserAccount;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.useraccount.GetUserAccountNames;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.useraccount.NewUserAccount;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.useraccount.SaveUserAccount;
+import ch.ethz.seb.sebserver.webservice.servicelayer.dao.SEBClientConfigDAO;
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class UseCasesIntegrationTest extends GuiIntegrationTest {
@Before
@@ -163,7 +189,7 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
// *************************************
// Use Case 1: SEB Administrator creates a new institution and activate this new institution
- public void testUsecase1() {
+ public void testUsecase01() {
final RestServiceImpl restService = createRestServiceForUser(
"admin",
"admin",
@@ -205,7 +231,7 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
// *************************************
// Use Case 2: SEB Administrator creates a new Institutional Administrator user for the
// newly created institution and activate this user
- public void testUsecase2() {
+ public void testUsecase02_CreateInstitutionalAdminUser() {
final RestServiceImpl restService = createRestServiceForUser(
"admin",
"admin",
@@ -274,7 +300,7 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
// check also that it is not possible to change to SEB Administrator role
// check also this it is possible to change the password and after that a new login is needed
// check also that property changes are possible. E.g: email
- public void testUsecase3() {
+ public void testUsecase03_TestInstitutionalView() {
RestServiceImpl restService = createRestServiceForUser(
"TestInstAdmin",
"12345678",
@@ -387,7 +413,7 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
// - create a new user-account (examAdmin2) with Exam Administrator role
// - create a new user-account (examSupport1) with Exam Supporter role
// - create a new user-account (examSupport2) with Exam Administrator and Exam Supporter role
- public void testUsecase4() {
+ public void testUsecase04_CreateUserAccount() {
final RestServiceImpl restService = createRestServiceForUser(
"TestInstAdmin",
"987654321",
@@ -504,7 +530,7 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
// - change name of active LMS and check modification update
// - deactivate LMS Setup and check no quizzes are available
// - activate again for following tests
- public void testUsecase5() {
+ public void testUsecase05_CreateLMSSetupMockup() {
final RestServiceImpl restService = createRestServiceForUser(
"TestInstAdmin",
"987654321",
@@ -684,7 +710,7 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
// *************************************
// Use Case 5.5: Login as TestInstAdmin and create new Open edX LMS setup and activate
// - login as TestInstAdmin : 987654321
- public void testUsecase5_5() {
+ public void testUsecase06_CreateOpenEdxLMSSetup() {
final RestServiceImpl restService = createRestServiceForUser(
"TestInstAdmin",
"987654321",
@@ -720,25 +746,23 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
.call()
.getOrThrow();
- final DispatcherServlet dispatcherServlet = this.mockMvc.getDispatcherServlet();
-
assertNotNull(testResult);
assertFalse(testResult.isOk());
assertEquals("[Error [errorType=TOKEN_REQUEST, message=Failed to gain access token from OpenEdX Rest API:\n" +
" tried token endpoints: [/oauth2/access_token]]]", String.valueOf(testResult.errors));
- // TODO how to mockup a Open edX response
+ // TODO how to mockup an Open edX response
}
@Test
- @Order(6)
+ @Order(7)
// *************************************
// Use Case 6: Login as examAdmin2
- // - Check if there are some quizzes form previous LMS Setup
+ // - Check if there are some quizzes from previous LMS Setup
// - Import a quiz as Exam
// - get exam page and check the exam is there
// - edit exam property and save again
- public void testUsecase6() {
+ public void testUsecase07_ImportExam() {
final RestServiceImpl restService = createRestServiceForUser(
"examAdmin2",
"examAdmin2",
@@ -824,17 +848,31 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
assertEquals(ExamType.MANAGED, savedExam.type);
assertFalse(savedExam.supporter.isEmpty());
+
+ // get exam list
+ final Result> exams = restService
+ .getBuilder(GetExamPage.class)
+ .call();
+
+ assertNotNull(exams);
+ assertFalse(exams.hasError());
+ final Page examPage = exams.get();
+ assertFalse(examPage.isEmpty());
+ assertTrue(examPage.content
+ .stream()
+ .filter(exam -> exam.name.equals(newExam.name))
+ .findFirst().isPresent());
}
@Test
- @Order(7)
+ @Order(8)
// *************************************
// Use Case 7: Login as examAdmin2
// - Get imported exam
// - add new indicator for exam
// - save exam with new indicator and test
// - create some thresholds for the new indicator
- public void testUsecase7() {
+ public void testUsecase08_CreateExamIndicator() {
final RestServiceImpl restService = createRestServiceForUser(
"examAdmin2",
"examAdmin2",
@@ -911,13 +949,13 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
}
@Test
- @Order(8)
+ @Order(9)
// *************************************
- // Use Case 8: Login as TestInstAdmin and create a SEB Client Configuration
+ // Use Case 9: Login as TestInstAdmin and create a SEB Client Configuration
// - create one with and one without password
// - activate one config
// - export both configurations
- public void testUsecase8() throws IOException {
+ public void testUsecase09_CreateClientConfig() throws IOException {
final RestServiceImpl restService = createRestServiceForUser(
"TestInstAdmin",
"987654321",
@@ -930,20 +968,20 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
new ExportClientConfig());
// create SEB Client Config without password protection
- final Result newConfigResponse = restService
+ final Result newConfigResponse = restService
.getBuilder(NewClientConfig.class)
.withFormParam(Domain.SEB_CLIENT_CONFIGURATION.ATTR_NAME, "No Password Protection")
- .withFormParam(SebClientConfig.ATTR_FALLBACK, Constants.TRUE_STRING)
- .withFormParam(SebClientConfig.ATTR_FALLBACK_START_URL, "http://fallback.com/fallback")
- .withFormParam(SebClientConfig.ATTR_FALLBACK_TIMEOUT, "100")
- .withFormParam(SebClientConfig.ATTR_FALLBACK_ATTEMPTS, "5")
- .withFormParam(SebClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL, "5")
- .withFormParam(SebClientConfig.ATTR_CONFIG_PURPOSE, SebClientConfig.ConfigPurpose.START_EXAM.name())
+ .withFormParam(SEBClientConfig.ATTR_FALLBACK, Constants.TRUE_STRING)
+ .withFormParam(SEBClientConfig.ATTR_FALLBACK_START_URL, "http://fallback.com/fallback")
+ .withFormParam(SEBClientConfig.ATTR_FALLBACK_TIMEOUT, "100")
+ .withFormParam(SEBClientConfig.ATTR_FALLBACK_ATTEMPTS, "5")
+ .withFormParam(SEBClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL, "5")
+ .withFormParam(SEBClientConfig.ATTR_CONFIG_PURPOSE, SEBClientConfig.ConfigPurpose.START_EXAM.name())
.call();
assertNotNull(newConfigResponse);
assertFalse(newConfigResponse.hasError());
- final SebClientConfig sebClientConfig = newConfigResponse.get();
+ final SEBClientConfig sebClientConfig = newConfigResponse.get();
assertEquals("No Password Protection", sebClientConfig.name);
assertFalse(sebClientConfig.isActive());
assertEquals("http://fallback.com/fallback", sebClientConfig.fallbackStartURL);
@@ -957,33 +995,33 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
assertNotNull(activationResponse);
assertFalse(activationResponse.hasError());
- final Result getConfigResponse = restService
+ final Result getConfigResponse = restService
.getBuilder(GetClientConfig.class)
.withURIVariable(API.PARAM_MODEL_ID, sebClientConfig.getModelId())
.call();
assertNotNull(getConfigResponse);
assertFalse(getConfigResponse.hasError());
- final SebClientConfig activeConfig = getConfigResponse.get();
+ final SEBClientConfig activeConfig = getConfigResponse.get();
assertTrue(activeConfig.isActive());
// create a config with password protection
- final Result configWithPasswordResponse = restService
+ final Result configWithPasswordResponse = restService
.getBuilder(NewClientConfig.class)
.withFormParam(Domain.SEB_CLIENT_CONFIGURATION.ATTR_NAME, "With Password Protection")
- .withFormParam(SebClientConfig.ATTR_CONFIG_PURPOSE, SebClientConfig.ConfigPurpose.START_EXAM.name())
- .withFormParam(SebClientConfig.ATTR_FALLBACK, Constants.TRUE_STRING)
- .withFormParam(SebClientConfig.ATTR_FALLBACK_START_URL, "http://fallback.com/fallback")
- .withFormParam(SebClientConfig.ATTR_FALLBACK_TIMEOUT, "100")
- .withFormParam(SebClientConfig.ATTR_FALLBACK_ATTEMPTS, "5")
- .withFormParam(SebClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL, "5")
+ .withFormParam(SEBClientConfig.ATTR_CONFIG_PURPOSE, SEBClientConfig.ConfigPurpose.START_EXAM.name())
+ .withFormParam(SEBClientConfig.ATTR_FALLBACK, Constants.TRUE_STRING)
+ .withFormParam(SEBClientConfig.ATTR_FALLBACK_START_URL, "http://fallback.com/fallback")
+ .withFormParam(SEBClientConfig.ATTR_FALLBACK_TIMEOUT, "100")
+ .withFormParam(SEBClientConfig.ATTR_FALLBACK_ATTEMPTS, "5")
+ .withFormParam(SEBClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL, "5")
.withFormParam(SEB_CLIENT_CONFIGURATION.ATTR_ENCRYPT_SECRET, "123")
- .withFormParam(SebClientConfig.ATTR_ENCRYPT_SECRET_CONFIRM, "123")
+ .withFormParam(SEBClientConfig.ATTR_ENCRYPT_SECRET_CONFIRM, "123")
.call();
assertNotNull(configWithPasswordResponse);
assertFalse(configWithPasswordResponse.hasError());
- final SebClientConfig configWithPassword = configWithPasswordResponse.get();
+ final SEBClientConfig configWithPassword = configWithPasswordResponse.get();
assertEquals("With Password Protection", configWithPassword.name);
assertFalse(configWithPassword.isActive());
assertEquals("http://fallback.com/fallback", configWithPassword.fallbackStartURL);
@@ -1015,25 +1053,25 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
assertFalse(readLines.isEmpty());
// get page
- final Result> pageResponse = restService
+ final Result> pageResponse = restService
.getBuilder(GetClientConfigPage.class)
.call();
assertNotNull(pageResponse);
assertFalse(pageResponse.hasError());
- final Page page = pageResponse.get();
+ final Page page = pageResponse.get();
assertFalse(page.content.isEmpty());
assertTrue(page.content.size() == 2);
}
@Test
- @Order(9)
+ @Order(10)
// *************************************
- // Use Case 9: Login as examAdmin2 and test Exam Configuration data basis
+ // Use Case 10: Login as examAdmin2 and test Exam Configuration data basis
// - get all Views for the default template
// - get all Attributes and and Orientations for the default view
@Sql(scripts = { "classpath:data-test-additional.sql" })
- public void testUsecase9() throws IOException {
+ public void testUsecase10_TestExamConfigBaseData() throws IOException {
final RestServiceImpl restService = createRestServiceForUser(
"examAdmin2",
"examAdmin2",
@@ -1079,14 +1117,14 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
}
@Test
- @Order(10)
+ @Order(11)
// *************************************
- // Use Case 10: Login as examAdmin2 and create a new SEB Exam Configuration
+ // Use Case 11: Login as examAdmin2 and create a new SEB Exam Configuration
// - test creation
// - save configuration in history
// - change some attribute
// - process an undo
- public void testUsecase10() throws IOException {
+ public void testUsecase11_CreateExamConfig() throws IOException {
final RestServiceImpl restService = createRestServiceForUser(
"examAdmin2",
"examAdmin2",
@@ -1097,7 +1135,7 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
new GetConfigurations(),
new SaveExamConfigHistory(),
new GetConfigurationTableValues(),
- new SebExamConfigUndo(),
+ new SEBExamConfigUndo(),
new SaveExamConfigValue(),
new SaveExamConfigTableValues(),
new GetConfigurationValuePage(),
@@ -1261,7 +1299,7 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
// undo
final Result undoResponse = restService
- .getBuilder(SebExamConfigUndo.class)
+ .getBuilder(SEBExamConfigUndo.class)
.withURIVariable(API.PARAM_MODEL_ID, followup.getModelId())
.call();
@@ -1287,14 +1325,14 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
}
@Test
- @Order(11)
+ @Order(12)
// *************************************
- // Use Case 11: Login as examAdmin2 and get newly created exam configuration
+ // Use Case 12: Login as examAdmin2 and get newly created exam configuration
// - get permitted processes table values
// - modify permitted processes table values
// - save permitted processes table values
// - check save OK
- public void testUsecase11() throws IOException {
+ public void testUsecase12_TestInitDataOfNewExamConfig() throws IOException {
final RestServiceImpl restService = createRestServiceForUser(
"examAdmin2",
"examAdmin2",
@@ -1408,13 +1446,13 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
}
@Test
- @Order(12)
+ @Order(13)
// *************************************
- // Use Case 12: Login as examAdmin2 and use newly created configuration
+ // Use Case 13: Login as examAdmin2 and use newly created configuration
// - get follow-up configuration by API
// - import
// - export
- public void testUsecase12() throws IOException {
+ public void testUsecase13_ExamConfigImportExport() throws IOException {
final RestServiceImpl restService = createRestServiceForUser(
"examAdmin2",
"examAdmin2",
@@ -1574,11 +1612,11 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
}
@Test
- @Order(13)
+ @Order(14)
// *************************************
- // Use Case 13: Login as examAdmin2 and use newly created configuration
+ // Use Case 14: Login as examAdmin2 and use newly created configuration
// - change configuration status to "Ready to Use"
- public void testUsecase13() throws IOException {
+ public void testUsecase14_EditExamConfig() throws IOException {
final RestServiceImpl restService = createRestServiceForUser(
"examAdmin2",
"examAdmin2",
@@ -1623,7 +1661,7 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
// - Remove one template attribute from orientation
// - Change one template attribute value
// - Reset template values
- public void testUsecase15() throws IOException {
+ public void testUsecase15_CreateConfigurationTemplate() throws IOException {
final RestServiceImpl restService = createRestServiceForUser(
"examAdmin2",
"examAdmin2",
@@ -1809,4 +1847,341 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
.ifPresent(cValue -> assertNull(cValue.value));
}
+ @Test
+ @Order(16)
+ // *************************************
+ // Use Case 16: Login as examAdmin2 and map a Exam Config to an Exam
+ // - Get Exam
+ // - Get List of available Exam Config for mapping
+ // - Map a Exam Config to the Exam
+ // - Remove Exam Config
+ // - Add config again
+ // - Export Config Key
+ // - Export Config as XML
+ public void testUsecase16_MapExamConfigToExam() throws IOException {
+ final RestServiceImpl restService = createRestServiceForUser(
+ "examAdmin2",
+ "examAdmin2",
+ new GetExamPage(),
+ new GetExamConfigNode(),
+ new GetExamConfigNodeNames(),
+ new GetExamConfigMappingNames(),
+ new GetExamConfigMappingsPage(),
+ new SaveExamConfigMapping(),
+ new NewExamConfigMapping(),
+ new CheckExamConsistency(),
+ new DeleteExamConfigMapping(),
+ new ExportConfigKey(),
+ new ExportExamConfig());
+
+ // get exam
+ final Result> exams = restService
+ .getBuilder(GetExamPage.class)
+ .call();
+
+ assertNotNull(exams);
+ assertFalse(exams.hasError());
+ final Page