From 18280173c0182abf7f0c6cbb7759acd7da4685c6 Mon Sep 17 00:00:00 2001
From: anhefti
Date: Wed, 22 Apr 2020 12:38:27 +0200
Subject: [PATCH] new name for Client Config export file
"SEBServerSettings.seb" and
"Configure a Client" as default purpose.
---
docs/client_config.rst | 2 +-
docs/exams.rst | 27 ++++------
docs/lmssetup.rst | 9 ++--
.../gbl/model/sebconfig/SebClientConfig.java | 50 +++++++++----------
.../dao/impl/SebClientConfigDAOImpl.java | 16 +++---
.../sebconfig/ClientConfigService.java | 1 +
.../weblayer/api/EntityController.java | 26 +++++++---
.../config/application-dev-gui.properties | 2 +-
.../resources/config/application.properties | 2 +-
9 files changed, 70 insertions(+), 65 deletions(-)
diff --git a/docs/client_config.rst b/docs/client_config.rst
index 6351fa4d..225070c2 100644
--- a/docs/client_config.rst
+++ b/docs/client_config.rst
@@ -121,7 +121,7 @@ Now we want to activate this client configuration and export it to make it acces
specific Client configuration.
- Then either on the list or in the view mode of the form, use the "Activate Client Configuration" action on the right action pane to activate the client configuration
- Now there is a "Export Client Configuration" action in the detail view of the client configuration. Use the "Export Client Configuration" action
- to start a download dialog. Choose "Save As" and download the file with the name "SEBClientSettings.seb".
+ to start a download dialog. Choose "Save As" and download the file with the name "SEBServerSettings.seb".
- This file can now be published as download-link within a public server where SEB user can click and start the download and startup of the SEB client automatically.
**Deactivate a Client Configuration**
diff --git a/docs/exams.rst b/docs/exams.rst
index 7680441c..3142341f 100644
--- a/docs/exams.rst
+++ b/docs/exams.rst
@@ -1,24 +1,15 @@
Exams
=====
-TODO
+Within an exam in SEB server all threads come together to set up a e-assessment with Safe Exam Browser and SEB Server. An exam can be imported
+from a course that exists on an LMS that was binded with a LMS Setup. An exam configuration that was formerly created can be attached to the exam by
+choosing one from the library. Indicators can be defined that are shown in the monitoring section while monitoring a running exam. And if
+the API of the specified LMS integration supports individual SEB restriction attributes for a e-assessment, this can also be defined and managed
+on the exam management of SEB Server.
-Import
-------
-
-TODO
-
-Exam Configuration Binding
---------------------------
-
-TODO
-
-Thresholds
-----------
-
-TODO
-
-SEB Restriction On LMS
--------------------------
+We will go through all the steps to setting up an exam for Safe Exam Browser with SEB Server one by one.
+
+
+
diff --git a/docs/lmssetup.rst b/docs/lmssetup.rst
index c10468a1..c599e358 100644
--- a/docs/lmssetup.rst
+++ b/docs/lmssetup.rst
@@ -6,10 +6,11 @@ Leraning Management System Setup
Overview
--------
-To be able to connect to a learning management system (LMS) and view and manage the courses provided by a LMS is an essential feature of the SEB Server.
-To create an exam or e-assessment, based on a course existing on a LMS, to use with SEB we need some data of this course from the LMS like,
-start- end-time, name and others. If we furthermore want to be able to automatically restrict the course for SEB access only we need to have proper
-integration API's in place on both sides, the LMS and the SEB Server. This integration is separated into two main features so far. This are:
+To be able to connect to a learning management system (LMS), to view and manage the courses provided by a LMS is an essential feature of the SEB Server.
+To setup an exam or e-assessment for SEB on SEB Server that is based on a course from a LMS, we have to make a binding to the course on the LMS.
+This allows as to always get the actual course data from LMS like, start- end-time, name and others. If we furthermore want to be able to automatically
+restrict the course for SEB access only we also need to have proper integration API's in place on both sides, the LMS and the SEB Server.
+This integration is separated into two main features so far. This are:
**Course API**
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
index 039de7a3..7f4b3806 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
@@ -200,41 +200,41 @@ public final class SebClientConfig implements GrantEntity, Activatable {
}
public ConfigPurpose getConfigPurpose() {
- return configPurpose;
+ return this.configPurpose;
}
public Boolean getFallback() {
- return fallback;
+ return this.fallback;
}
public Long getFallbackTimeout() {
- return fallbackTimeout;
+ return this.fallbackTimeout;
}
public Short getFallbackAttempts() {
- return fallbackAttempts;
+ return this.fallbackAttempts;
}
public Short getFallbackAttemptInterval() {
- return fallbackAttemptInterval;
+ return this.fallbackAttemptInterval;
}
public CharSequence getFallbackPassword() {
- return fallbackPassword;
+ return this.fallbackPassword;
}
@JsonIgnore
public CharSequence getFallbackPasswordConfirm() {
- return fallbackPasswordConfirm;
+ return this.fallbackPasswordConfirm;
}
public CharSequence getQuitPassword() {
- return quitPassword;
+ return this.quitPassword;
}
@JsonIgnore
public CharSequence getQuitPasswordConfirm() {
- return quitPasswordConfirm;
+ return this.quitPasswordConfirm;
}
public DateTime getDate() {
@@ -272,21 +272,21 @@ public final class SebClientConfig implements GrantEntity, Activatable {
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("SebClientConfig{");
- sb.append("id=").append(id);
- sb.append(", institutionId=").append(institutionId);
- sb.append(", name='").append(name).append('\'');
- sb.append(", configPurpose=").append(configPurpose);
- sb.append(", fallback=").append(fallback);
- sb.append(", fallbackStartURL='").append(fallbackStartURL).append('\'');
- sb.append(", fallbackTimeout=").append(fallbackTimeout);
- sb.append(", fallbackAttempts=").append(fallbackAttempts);
- sb.append(", fallbackAttemptInterval=").append(fallbackAttemptInterval);
- sb.append(", fallbackPassword=").append(fallbackPassword);
- sb.append(", fallbackPasswordConfirm=").append(fallbackPasswordConfirm);
- sb.append(", date=").append(date);
- sb.append(", encryptSecret=").append(encryptSecret);
- sb.append(", encryptSecretConfirm=").append(encryptSecretConfirm);
- sb.append(", active=").append(active);
+ sb.append("id=").append(this.id);
+ sb.append(", institutionId=").append(this.institutionId);
+ sb.append(", name='").append(this.name).append('\'');
+ sb.append(", configPurpose=").append(this.configPurpose);
+ sb.append(", fallback=").append(this.fallback);
+ sb.append(", fallbackStartURL='").append(this.fallbackStartURL).append('\'');
+ sb.append(", fallbackTimeout=").append(this.fallbackTimeout);
+ sb.append(", fallbackAttempts=").append(this.fallbackAttempts);
+ sb.append(", fallbackAttemptInterval=").append(this.fallbackAttemptInterval);
+ sb.append(", fallbackPassword=").append(this.fallbackPassword);
+ sb.append(", fallbackPasswordConfirm=").append(this.fallbackPasswordConfirm);
+ sb.append(", date=").append(this.date);
+ sb.append(", encryptSecret=").append(this.encryptSecret);
+ sb.append(", encryptSecretConfirm=").append(this.encryptSecretConfirm);
+ sb.append(", active=").append(this.active);
sb.append('}');
return sb.toString();
}
@@ -318,7 +318,7 @@ public final class SebClientConfig implements GrantEntity, Activatable {
null,
institutionId,
null,
- ConfigPurpose.START_EXAM,
+ ConfigPurpose.CONFIGURE_CLIENT,
false,
null,
null,
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
index a47aef74..6ec19f8d 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
@@ -357,10 +357,10 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
private Result toDomainModel(final SebClientConfigRecord record) {
- Map additionalAttributes = this.additionalAttributesDAO
+ final Map additionalAttributes = this.additionalAttributesDAO
.getAdditionalAttributes(
- EntityType.SEB_CLIENT_CONFIGURATION,
- record.getId())
+ EntityType.SEB_CLIENT_CONFIGURATION,
+ record.getId())
.getOrThrow()
.stream()
.collect(Collectors.toMap(
@@ -374,7 +374,8 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
record.getInstitutionId(),
record.getName(),
additionalAttributes.containsKey(SebClientConfig.ATTR_CONFIG_PURPOSE)
- ? ConfigPurpose.valueOf(additionalAttributes.get(SebClientConfig.ATTR_CONFIG_PURPOSE).getValue())
+ ? ConfigPurpose
+ .valueOf(additionalAttributes.get(SebClientConfig.ATTR_CONFIG_PURPOSE).getValue())
: ConfigPurpose.START_EXAM,
additionalAttributes.containsKey(SebClientConfig.ATTR_FALLBACK) &&
BooleanUtils.toBoolean(additionalAttributes.get(SebClientConfig.ATTR_FALLBACK).getValue()),
@@ -388,7 +389,8 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
? Short.parseShort(additionalAttributes.get(SebClientConfig.ATTR_FALLBACK_ATTEMPTS).getValue())
: null,
additionalAttributes.containsKey(SebClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL)
- ? Short.parseShort(additionalAttributes.get(SebClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL).getValue())
+ ? Short.parseShort(
+ additionalAttributes.get(SebClientConfig.ATTR_FALLBACK_ATTEMPT_INTERVAL).getValue())
: null,
additionalAttributes.containsKey(SebClientConfig.ATTR_FALLBACK_PASSWORD)
? additionalAttributes.get(SebClientConfig.ATTR_FALLBACK_PASSWORD).getValue()
@@ -435,14 +437,14 @@ public class SebClientConfigDAOImpl implements SebClientConfigDAO {
}
}
- private void saveAdditionalAttributes(SebClientConfig sebClientConfig, Long configId) {
+ private void saveAdditionalAttributes(final SebClientConfig sebClientConfig, final Long configId) {
this.additionalAttributesDAO.saveAdditionalAttribute(
EntityType.SEB_CLIENT_CONFIGURATION,
configId,
SebClientConfig.ATTR_CONFIG_PURPOSE,
(sebClientConfig.configPurpose != null)
? sebClientConfig.configPurpose.name()
- : ConfigPurpose.START_EXAM.name());
+ : ConfigPurpose.CONFIGURE_CLIENT.name());
this.additionalAttributesDAO.saveAdditionalAttribute(
EntityType.SEB_CLIENT_CONFIGURATION,
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 f7a24184..d19a9786 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
@@ -24,6 +24,7 @@ public interface ClientConfigService {
Logger log = LoggerFactory.getLogger(ClientConfigService.class);
+ /** The cache name of ClientDetails */
String EXAM_CLIENT_DETAILS_CACHE = "EXAM_CLIENT_DETAILS_CACHE";
/** Indicates if there is any SebClientConfiguration for a specified institution.
diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/EntityController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/EntityController.java
index a25af003..8ff49ae3 100644
--- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/EntityController.java
+++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/EntityController.java
@@ -95,17 +95,27 @@ public abstract class EntityController {
}
// ******************
- // * GET (getAll)
+ // * GET (getPage)
// ******************
- /** The get-all or get-page rest endpoint for all types of Entity and returns a Page of
- * entities of specific type.
- *
- * GET /{api}/{entity-type-endpoint-name}
- *
+ /** The generic endpoint to get a Page of domain-entities of a specific type.
+ *
+ * GET /{api}/{domain-entity-name}
+ *
+ * For example for the "exam" domain-entity
* GET /admin-api/v1/exam
* GET /admin-api/v1/exam?page_number=2&page_size=10&sort=-name
* GET /admin-api/v1/exam?name=seb&active=true
+ *
+ * Sorting: the sort parameter to sort the list of entities before paging
+ * the sort parameter is the name of the entity-model attribute to sort with a leading '-' sign for
+ * descending sort order. Note that not all entity-model attribute are suited for sorting while the most
+ * are.
+ *
+ * Filter: The filter attributes accepted by this API depend on the actual entity model (domain object)
+ * and are of the form [domain-attribute-name]=[filter-value]. E.g.: name=abc or type=EXAM. Usually
+ * filter attributes of text type are treated as SQL wildcard with %[text]% to filter all text containing
+ * a given text-snippet.
*
* @param institutionId The institution identifier of the request.
* Default is the institution identifier of the institution of the current user
@@ -113,8 +123,8 @@ public abstract class EntityController {
* @param pageSize the size of the page that is requested
* @param sort the sort parameter to sort the list of entities before paging
* the sort parameter is the name of the entity-model attribute to sort with a leading '-' sign for
- * descending sort order
- * @param allRequestParams a MultiValueMap of all request parameter that is used for filtering
+ * descending sort order.
+ * @param allRequestParams a MultiValueMap of all request parameter that is used for filtering.
* @return Page of domain-model-entities of specified type */
@RequestMapping(
method = RequestMethod.GET,
diff --git a/src/main/resources/config/application-dev-gui.properties b/src/main/resources/config/application-dev-gui.properties
index 8637b28d..5a44192a 100644
--- a/src/main/resources/config/application-dev-gui.properties
+++ b/src/main/resources/config/application-dev-gui.properties
@@ -18,5 +18,5 @@ sebserver.gui.multilingual=false
sebserver.gui.supported.languages=en,de
sebserver.gui.date.displayformat=de
-sebserver.gui.seb.client.config.download.filename=SEBClientSettings.seb
+sebserver.gui.seb.client.config.download.filename=SEBServerSettings.seb
sebserver.gui.seb.exam.config.download.filename=SEBExamSettings.seb
\ No newline at end of file
diff --git a/src/main/resources/config/application.properties b/src/main/resources/config/application.properties
index b7c84b5a..e0a8a417 100644
--- a/src/main/resources/config/application.properties
+++ b/src/main/resources/config/application.properties
@@ -131,6 +131,6 @@ 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=SEBClientSettings.seb
+sebserver.gui.seb.client.config.download.filename=SEBServerSettings.seb
sebserver.gui.seb.exam.config.download.filename=SEBExamSettings.seb