SEBSERV-256 implemented

This commit is contained in:
anhefti 2022-05-16 10:23:13 +02:00
parent cf10ccfbff
commit 71ccb8e63a
14 changed files with 168 additions and 42 deletions

View file

@ -71,6 +71,10 @@ public class SEBClientConfigForm implements TemplateComposer {
new LocTextKey("sebserver.clientconfig.form.title"); new LocTextKey("sebserver.clientconfig.form.title");
private static final LocTextKey FORM_NAME_TEXT_KEY = private static final LocTextKey FORM_NAME_TEXT_KEY =
new LocTextKey("sebserver.clientconfig.form.name"); new LocTextKey("sebserver.clientconfig.form.name");
private static final LocTextKey FORM_UPDATE_USER_TEXT_KEY =
new LocTextKey("sebserver.clientconfig.form.update.user");
private static final LocTextKey FORM_UPDATE_TIME_TEXT_KEY =
new LocTextKey("sebserver.clientconfig.form.update.time");
private static final LocTextKey FORM_DATE_TEXT_KEY = private static final LocTextKey FORM_DATE_TEXT_KEY =
new LocTextKey("sebserver.clientconfig.form.date"); new LocTextKey("sebserver.clientconfig.form.date");
@ -295,11 +299,31 @@ public class SEBClientConfigForm implements TemplateComposer {
Domain.SEB_CLIENT_CONFIGURATION.ATTR_INSTITUTION_ID, Domain.SEB_CLIENT_CONFIGURATION.ATTR_INSTITUTION_ID,
String.valueOf(clientConfig.getInstitutionId())) String.valueOf(clientConfig.getInstitutionId()))
.addFieldIf(() -> !isNew, .addFieldIf(() -> isReadonly,
() -> FormBuilder.text( () -> FormBuilder.text(
Domain.SEB_CLIENT_CONFIGURATION.ATTR_DATE, Domain.SEB_CLIENT_CONFIGURATION.ATTR_DATE,
FORM_DATE_TEXT_KEY, FORM_DATE_TEXT_KEY,
i18nSupport.formatDisplayDateWithTimeZone(clientConfig.date)) i18nSupport.formatDisplayDateWithTimeZone(clientConfig.date))
.readonly(true)
.withInputSpan(2)
.withEmptyCellSeparation(false))
.addFieldIf(() -> isReadonly,
() -> FormBuilder.text(
Domain.SEB_CLIENT_CONFIGURATION.ATTR_LAST_UPDATE_TIME,
FORM_UPDATE_TIME_TEXT_KEY,
i18nSupport.formatDisplayDateWithTimeZone(clientConfig.lastUpdateTime))
.readonly(true)
.withLabelSpan(1)
.withInputSpan(2)
.withEmptyCellSeparation(false))
.addFieldIf(() -> isReadonly,
() -> FormBuilder.singleSelection(
Domain.SEB_CLIENT_CONFIGURATION.ATTR_LAST_UPDATE_USER,
FORM_UPDATE_USER_TEXT_KEY,
clientConfig.lastUpdateUser,
() -> this.pageService.getResourceService().userResources())
.readonly(true)) .readonly(true))
.addField(FormBuilder.text( .addField(FormBuilder.text(

View file

@ -81,6 +81,11 @@ public class SEBExamConfigForm implements TemplateComposer {
new LocTextKey("sebserver.examconfig.form.title"); new LocTextKey("sebserver.examconfig.form.title");
static final LocTextKey FORM_NAME_TEXT_KEY = static final LocTextKey FORM_NAME_TEXT_KEY =
new LocTextKey("sebserver.examconfig.form.name"); new LocTextKey("sebserver.examconfig.form.name");
static final LocTextKey FORM_UPDATE_TIME_TEXT_KEY =
new LocTextKey("sebserver.examconfig.form.update.time");
static final LocTextKey FORM_UPDATE_USER_TEXT_KEY =
new LocTextKey("sebserver.examconfig.form.update.user");
static final LocTextKey FORM_DESCRIPTION_TEXT_KEY = static final LocTextKey FORM_DESCRIPTION_TEXT_KEY =
new LocTextKey("sebserver.examconfig.form.description"); new LocTextKey("sebserver.examconfig.form.description");
static final LocTextKey FORM_HISTORY_TEXT_KEY = static final LocTextKey FORM_HISTORY_TEXT_KEY =
@ -219,6 +224,28 @@ public class SEBExamConfigForm implements TemplateComposer {
: String.valueOf(examConfig.templateId), : String.valueOf(examConfig.templateId),
resourceService::getExamConfigTemplateResources) resourceService::getExamConfigTemplateResources)
.readonly(!isNew)) .readonly(!isNew))
.addFieldIf(() -> isReadonly,
() -> FormBuilder.text(
Domain.CONFIGURATION_NODE.ATTR_LAST_UPDATE_TIME,
FORM_UPDATE_TIME_TEXT_KEY,
this.pageService.getI18nSupport()
.formatDisplayDateWithTimeZone(examConfig.lastUpdateTime))
.readonly(true)
.withInputSpan(2)
.withEmptyCellSeparation(false))
.addFieldIf(() -> isReadonly,
() -> FormBuilder.singleSelection(
Domain.SEB_CLIENT_CONFIGURATION.ATTR_LAST_UPDATE_USER,
FORM_UPDATE_USER_TEXT_KEY,
examConfig.lastUpdateUser,
() -> this.pageService.getResourceService().userResources())
.readonly(true)
.withLabelSpan(1)
.withInputSpan(2)
.withEmptyCellSeparation(false))
.addField(FormBuilder.text( .addField(FormBuilder.text(
Domain.CONFIGURATION_NODE.ATTR_NAME, Domain.CONFIGURATION_NODE.ATTR_NAME,
FORM_NAME_TEXT_KEY, FORM_NAME_TEXT_KEY,

View file

@ -0,0 +1,15 @@
/*
* Copyright (c) 2022 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.webservice.servicelayer.dao;
public interface DAOUserServcie {
String getCurrentUserUUID();
}

View file

@ -44,7 +44,6 @@ import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationTableValues.TableV
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Result; import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.gbl.util.Utils; import ch.ethz.seb.sebserver.gbl.util.Utils;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.BatisConfig; import ch.ethz.seb.sebserver.webservice.datalayer.batis.BatisConfig;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ConfigurationAttributeRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ConfigurationAttributeRecordDynamicSqlSupport;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ConfigurationAttributeRecordMapper; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ConfigurationAttributeRecordMapper;
@ -58,6 +57,7 @@ import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ConfigurationAttri
import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ConfigurationNodeRecord; import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ConfigurationNodeRecord;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ConfigurationRecord; import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ConfigurationRecord;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ConfigurationValueRecord; import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ConfigurationValueRecord;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOUserServcie;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ResourceNotFoundException; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ResourceNotFoundException;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.TransactionHandler; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.TransactionHandler;
import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.ExamConfigInitService; import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.ExamConfigInitService;
@ -80,10 +80,10 @@ class ConfigurationDAOBatchService {
private final ConfigurationRecordMapper batchConfigurationRecordMapper; private final ConfigurationRecordMapper batchConfigurationRecordMapper;
private final ExamConfigInitService examConfigInitService; private final ExamConfigInitService examConfigInitService;
private final SqlSessionTemplate batchSqlSessionTemplate; private final SqlSessionTemplate batchSqlSessionTemplate;
private final CurrentUser currentUser; private final DAOUserServcie daoUserServcie;
protected ConfigurationDAOBatchService( protected ConfigurationDAOBatchService(
final CurrentUser currentUser, final DAOUserServcie daoUserServcie,
@Qualifier(BatisConfig.SQL_BATCH_SESSION_TEMPLATE) final SqlSessionTemplate batchSqlSessionTemplate, @Qualifier(BatisConfig.SQL_BATCH_SESSION_TEMPLATE) final SqlSessionTemplate batchSqlSessionTemplate,
final ExamConfigInitService examConfigInitService) { final ExamConfigInitService examConfigInitService) {
@ -119,7 +119,7 @@ class ConfigurationDAOBatchService {
this.batchConfigurationRecordMapper = this.batchConfigurationRecordMapper =
batchSqlSessionTemplate.getMapper(ConfigurationRecordMapper.class); batchSqlSessionTemplate.getMapper(ConfigurationRecordMapper.class);
this.batchSqlSessionTemplate = batchSqlSessionTemplate; this.batchSqlSessionTemplate = batchSqlSessionTemplate;
this.currentUser = currentUser; this.daoUserServcie = daoUserServcie;
} }
Result<ConfigurationNode> createNewConfiguration(final ConfigurationNode data) { Result<ConfigurationNode> createNewConfiguration(final ConfigurationNode data) {
@ -152,7 +152,7 @@ class ConfigurationDAOBatchService {
data.type.name(), data.type.name(),
(data.status != null) ? data.status.name() : ConfigurationStatus.CONSTRUCTION.name(), (data.status != null) ? data.status.name() : ConfigurationStatus.CONSTRUCTION.name(),
Utils.getMillisecondsNow(), Utils.getMillisecondsNow(),
this.currentUser.get().getUuid()); this.daoUserServcie.getCurrentUserUUID());
this.batchConfigurationNodeRecordMapper.insert(newRecord); this.batchConfigurationNodeRecordMapper.insert(newRecord);
this.batchSqlSessionTemplate.flushStatements(); this.batchSqlSessionTemplate.flushStatements();
@ -403,7 +403,7 @@ class ConfigurationDAOBatchService {
copyInfo.configurationType.name(), copyInfo.configurationType.name(),
ConfigurationStatus.CONSTRUCTION.name(), ConfigurationStatus.CONSTRUCTION.name(),
Utils.getMillisecondsNow(), Utils.getMillisecondsNow(),
this.currentUser.get().getUuid()); this.daoUserServcie.getCurrentUserUUID());
this.batchConfigurationNodeRecordMapper.insert(newNodeRec); this.batchConfigurationNodeRecordMapper.insert(newNodeRec);
this.batchSqlSessionTemplate.flushStatements(); this.batchSqlSessionTemplate.flushStatements();

View file

@ -42,7 +42,6 @@ import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationNode.Configuration
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Result; import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.gbl.util.Utils; import ch.ethz.seb.sebserver.gbl.util.Utils;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ConfigurationAttributeRecordMapper; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ConfigurationAttributeRecordMapper;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ConfigurationNodeRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ConfigurationNodeRecordDynamicSqlSupport;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ConfigurationNodeRecordMapper; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ConfigurationNodeRecordMapper;
@ -61,6 +60,7 @@ import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ConfigurationNodeR
import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.impl.BulkAction; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.impl.BulkAction;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ConfigurationNodeDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ConfigurationNodeDAO;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOLoggingSupport; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOLoggingSupport;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOUserServcie;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap; 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.ResourceNotFoundException;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.TransactionHandler; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.TransactionHandler;
@ -77,7 +77,7 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO {
private final ExamTemplateRecordMapper examTemplateRecordMapper; private final ExamTemplateRecordMapper examTemplateRecordMapper;
private final ViewRecordMapper viewRecordMapper; private final ViewRecordMapper viewRecordMapper;
private final OrientationRecordMapper orientationRecordMapper; private final OrientationRecordMapper orientationRecordMapper;
private final CurrentUser currentUser; private final DAOUserServcie daoUserServcie;
protected ConfigurationNodeDAOImpl( protected ConfigurationNodeDAOImpl(
final ConfigurationRecordMapper configurationRecordMapper, final ConfigurationRecordMapper configurationRecordMapper,
@ -88,7 +88,7 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO {
final ExamTemplateRecordMapper examTemplateRecordMapper, final ExamTemplateRecordMapper examTemplateRecordMapper,
final ViewRecordMapper viewRecordMapper, final ViewRecordMapper viewRecordMapper,
final OrientationRecordMapper orientationRecordMapper, final OrientationRecordMapper orientationRecordMapper,
final CurrentUser currentUser) { final DAOUserServcie daoUserServcie) {
this.configurationRecordMapper = configurationRecordMapper; this.configurationRecordMapper = configurationRecordMapper;
this.configurationNodeRecordMapper = configurationNodeRecordMapper; this.configurationNodeRecordMapper = configurationNodeRecordMapper;
@ -97,7 +97,7 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO {
this.examTemplateRecordMapper = examTemplateRecordMapper; this.examTemplateRecordMapper = examTemplateRecordMapper;
this.viewRecordMapper = viewRecordMapper; this.viewRecordMapper = viewRecordMapper;
this.orientationRecordMapper = orientationRecordMapper; this.orientationRecordMapper = orientationRecordMapper;
this.currentUser = currentUser; this.daoUserServcie = daoUserServcie;
} }
@Override @Override
@ -240,7 +240,7 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO {
null, null,
(data.status != null) ? data.status.name() : ConfigurationStatus.CONSTRUCTION.name(), (data.status != null) ? data.status.name() : ConfigurationStatus.CONSTRUCTION.name(),
Utils.getMillisecondsNow(), Utils.getMillisecondsNow(),
this.currentUser.get().getUuid()); this.daoUserServcie.getCurrentUserUUID());
this.configurationNodeRecordMapper.updateByPrimaryKeySelective(newRecord); this.configurationNodeRecordMapper.updateByPrimaryKeySelective(newRecord);
return this.configurationNodeRecordMapper.selectByPrimaryKey(data.id); return this.configurationNodeRecordMapper.selectByPrimaryKey(data.id);
@ -336,7 +336,7 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO {
this.configurationNodeRecordMapper.updateByExampleSelective( this.configurationNodeRecordMapper.updateByExampleSelective(
new ConfigurationNodeRecord(null, null, 0L, null, null, null, null, null, new ConfigurationNodeRecord(null, null, 0L, null, null, null, null, null,
Utils.getMillisecondsNow(), Utils.getMillisecondsNow(),
this.currentUser.get().getUuid())) this.daoUserServcie.getCurrentUserUUID()))
.where(ConfigurationNodeRecordDynamicSqlSupport.templateId, isIn(configurationIds)) .where(ConfigurationNodeRecordDynamicSqlSupport.templateId, isIn(configurationIds))
.build() .build()
.execute(); .execute();

View file

@ -0,0 +1,43 @@
/*
* Copyright (c) 2022 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.webservice.servicelayer.dao.impl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.AuthorizationService;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOUserServcie;
@Lazy
@Service
@WebServiceProfile
public class DAOUserServcieImpl implements DAOUserServcie {
private static final Logger log = LoggerFactory.getLogger(DAOUserServcieImpl.class);
private final AuthorizationService authorizationService;
public DAOUserServcieImpl(final AuthorizationService authorizationService) {
this.authorizationService = authorizationService;
}
@Override
public String getCurrentUserUUID() {
try {
return this.authorizationService.getUserService().getCurrentUser().uuid();
} catch (final Exception e) {
log.error("Failed to get current user: ", e);
return null;
}
}
}

View file

@ -44,13 +44,13 @@ import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig.VDIType;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Result; import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.gbl.util.Utils; import ch.ethz.seb.sebserver.gbl.util.Utils;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.SebClientConfigRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.SebClientConfigRecordDynamicSqlSupport;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.SebClientConfigRecordMapper; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.SebClientConfigRecordMapper;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.AdditionalAttributeRecord; 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.datalayer.batis.model.SebClientConfigRecord;
import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.impl.BulkAction; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.impl.BulkAction;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOLoggingSupport; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOLoggingSupport;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOUserServcie;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap; 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.ResourceNotFoundException;
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.SEBClientConfigDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.SEBClientConfigDAO;
@ -64,18 +64,18 @@ public class SEBClientConfigDAOImpl implements SEBClientConfigDAO {
private final SebClientConfigRecordMapper sebClientConfigRecordMapper; private final SebClientConfigRecordMapper sebClientConfigRecordMapper;
private final ClientCredentialService clientCredentialService; private final ClientCredentialService clientCredentialService;
private final AdditionalAttributesDAOImpl additionalAttributesDAO; private final AdditionalAttributesDAOImpl additionalAttributesDAO;
private final CurrentUser currentUser; private final DAOUserServcie daoUserServcie;
protected SEBClientConfigDAOImpl( protected SEBClientConfigDAOImpl(
final SebClientConfigRecordMapper sebClientConfigRecordMapper, final SebClientConfigRecordMapper sebClientConfigRecordMapper,
final ClientCredentialService clientCredentialService, final ClientCredentialService clientCredentialService,
final AdditionalAttributesDAOImpl additionalAttributesDAO, final AdditionalAttributesDAOImpl additionalAttributesDAO,
final CurrentUser currentUser) { final DAOUserServcie daoUserServcie) {
this.sebClientConfigRecordMapper = sebClientConfigRecordMapper; this.sebClientConfigRecordMapper = sebClientConfigRecordMapper;
this.clientCredentialService = clientCredentialService; this.clientCredentialService = clientCredentialService;
this.additionalAttributesDAO = additionalAttributesDAO; this.additionalAttributesDAO = additionalAttributesDAO;
this.currentUser = currentUser; this.daoUserServcie = daoUserServcie;
} }
@Override @Override
@ -208,7 +208,7 @@ public class SEBClientConfigDAOImpl implements SEBClientConfigDAO {
null, null, null, null, null, null, null, null, null, null, null, null, null, null,
BooleanUtils.toIntegerObject(active), BooleanUtils.toIntegerObject(active),
Utils.getMillisecondsNow(), Utils.getMillisecondsNow(),
this.currentUser.get().getUuid()); this.daoUserServcie.getCurrentUserUUID());
this.sebClientConfigRecordMapper.updateByExampleSelective(record) this.sebClientConfigRecordMapper.updateByExampleSelective(record)
.where(SebClientConfigRecordDynamicSqlSupport.id, isIn(ids)) .where(SebClientConfigRecordDynamicSqlSupport.id, isIn(ids))
@ -240,7 +240,7 @@ public class SEBClientConfigDAOImpl implements SEBClientConfigDAO {
getEncryptionPassword(sebClientConfig), getEncryptionPassword(sebClientConfig),
BooleanUtils.toInteger(BooleanUtils.isTrue(sebClientConfig.active)), BooleanUtils.toInteger(BooleanUtils.isTrue(sebClientConfig.active)),
Utils.getMillisecondsNow(), Utils.getMillisecondsNow(),
this.currentUser.get().getUuid()); this.daoUserServcie.getCurrentUserUUID());
this.sebClientConfigRecordMapper this.sebClientConfigRecordMapper
.insert(newRecord); .insert(newRecord);
@ -273,7 +273,7 @@ public class SEBClientConfigDAOImpl implements SEBClientConfigDAO {
getEncryptionPassword(sebClientConfig), getEncryptionPassword(sebClientConfig),
record.getActive(), record.getActive(),
Utils.getMillisecondsNow(), Utils.getMillisecondsNow(),
this.currentUser.get().getUuid()); this.daoUserServcie.getCurrentUserUUID());
this.sebClientConfigRecordMapper.updateByPrimaryKey(newRecord); this.sebClientConfigRecordMapper.updateByPrimaryKey(newRecord);

View file

@ -7,3 +7,22 @@ MODIFY `source_ids` VARCHAR(4000) NULL,
ADD COLUMN IF NOT EXISTS `owner` VARCHAR(255) NULL AFTER `institution_id`, ADD COLUMN IF NOT EXISTS `owner` VARCHAR(255) NULL AFTER `institution_id`,
ADD COLUMN IF NOT EXISTS `attributes` VARCHAR(4000) NULL AFTER `action_type` ADD COLUMN IF NOT EXISTS `attributes` VARCHAR(4000) NULL AFTER `action_type`
; ;
-- -----------------------------------------------------
-- Alter Table `configuration_node`
-- -----------------------------------------------------
ALTER TABLE `configuration_node`
ADD COLUMN IF NOT EXISTS `last_update_time` BIGINT UNSIGNED NULL AFTER `status`,
ADD COLUMN IF NOT EXISTS `last_update_user` VARCHAR(255) NULL AFTER `last_update_time`
;
-- -----------------------------------------------------
-- Alter Table `seb_client_configuration`
-- -----------------------------------------------------
ALTER TABLE `seb_client_configuration`
ADD COLUMN IF NOT EXISTS `last_update_time` BIGINT UNSIGNED NULL AFTER `active`,
ADD COLUMN IF NOT EXISTS `last_update_user` VARCHAR(255) NULL AFTER `last_update_time`
;

View file

@ -1,16 +0,0 @@
-- -----------------------------------------------------
-- Alter Table `configuration_node`
-- -----------------------------------------------------
ALTER TABLE `configuration_node`
ADD COLUMN IF NOT EXISTS `last_update_time` BIGINT UNSIGNED NULL AFTER `status`,
ADD COLUMN IF NOT EXISTS `last_update_user` VARCHAR(255) NULL AFTER `last_update_time`
-- -----------------------------------------------------
-- Alter Table `seb_client_configuration`
-- -----------------------------------------------------
ALTER TABLE `seb_client_configuration`
ADD COLUMN IF NOT EXISTS `last_update_time` BIGINT UNSIGNED NULL AFTER `active`,
ADD COLUMN IF NOT EXISTS `last_update_user` VARCHAR(255) NULL AFTER `last_update_time`
;

View file

@ -760,6 +760,8 @@ sebserver.clientconfig.form.title.subtitle=
sebserver.clientconfig.form.name=Name sebserver.clientconfig.form.name=Name
sebserver.clientconfig.form.name.tooltip=The name of the connection configuration.<br/>Any name that not already is in use for another connection configuration sebserver.clientconfig.form.name.tooltip=The name of the connection configuration.<br/>Any name that not already is in use for another connection configuration
sebserver.clientconfig.form.update.time Last Update
sebserver.clientconfig.form.update.user=Last Update By
sebserver.clientconfig.form.pinginterval=Ping Interval sebserver.clientconfig.form.pinginterval=Ping Interval
sebserver.clientconfig.form.pinginterval.tooltip=Defines an interval time in milliseconds for a SEB client to send a ping to the SEB Server sebserver.clientconfig.form.pinginterval.tooltip=Defines an interval time in milliseconds for a SEB client to send a ping to the SEB Server
sebserver.clientconfig.form.vditype=VDI Setup sebserver.clientconfig.form.vditype=VDI Setup
@ -910,6 +912,9 @@ sebserver.examconfig.form.status.tooltip=The status of this SEB exam configurati
sebserver.examconfig.form.config-key.title=Config Key sebserver.examconfig.form.config-key.title=Config Key
sebserver.examconfig.form.attached-to=Attached To Exam sebserver.examconfig.form.attached-to=Attached To Exam
sebserver.examconfig.form.attached-to.tooltip=This SEB exam configuration is currently attached to the following exams.<br/><br/>Select an exam from the list and use the "View Exam" or Double-Click on the list to go to a specific exam. sebserver.examconfig.form.attached-to.tooltip=This SEB exam configuration is currently attached to the following exams.<br/><br/>Select an exam from the list and use the "View Exam" or Double-Click on the list to go to a specific exam.
sebserver.examconfig.form.update.time=Last Update
sebserver.examconfig.form.update.user=Last Update By
sebserver.examconfig.status.CONSTRUCTION=Under Construction sebserver.examconfig.status.CONSTRUCTION=Under Construction
sebserver.examconfig.status.READY_TO_USE=Ready To Use sebserver.examconfig.status.READY_TO_USE=Ready To Use

View file

@ -129,13 +129,15 @@ public class ModelObjectJSONGenerator {
"encryptSecretConfirm", "encryptSecretConfirm",
"certAlias", "certAlias",
false, false,
true); true,
DateTime.now(),
"user123");
System.out.println(domainObject.getClass().getSimpleName() + ":"); System.out.println(domainObject.getClass().getSimpleName() + ":");
System.out.println(writerWithDefaultPrettyPrinter.writeValueAsString(domainObject)); System.out.println(writerWithDefaultPrettyPrinter.writeValueAsString(domainObject));
domainObject = new ConfigurationNode( domainObject = new ConfigurationNode(
1L, 1L, 1L, "name", "description", ConfigurationType.EXAM_CONFIG, "ownerUUID", 1L, 1L, 1L, "name", "description", ConfigurationType.EXAM_CONFIG, "ownerUUID",
ConfigurationStatus.CONSTRUCTION); ConfigurationStatus.CONSTRUCTION, DateTime.now(), "user123");
System.out.println(domainObject.getClass().getSimpleName() + ":"); System.out.println(domainObject.getClass().getSimpleName() + ":");
System.out.println(writerWithDefaultPrettyPrinter.writeValueAsString(domainObject)); System.out.println(writerWithDefaultPrettyPrinter.writeValueAsString(domainObject));

View file

@ -126,6 +126,8 @@ public class ClientConfigTest extends GuiIntegrationTest {
null, null,
"certAlias", "certAlias",
false, false,
null,
null,
null)) null))
.call(); .call();
@ -157,6 +159,8 @@ public class ClientConfigTest extends GuiIntegrationTest {
"password", "password",
"certAlias", "certAlias",
false, false,
null,
null,
null)) null))
.call() .call()
.getOrThrow(); .getOrThrow();

View file

@ -30,6 +30,7 @@ import java.util.stream.Collectors;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone; import org.joda.time.DateTimeZone;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
@ -1715,7 +1716,9 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
config.description, config.description,
ConfigurationType.EXAM_CONFIG, ConfigurationType.EXAM_CONFIG,
config.owner, config.owner,
ConfigurationStatus.READY_TO_USE); ConfigurationStatus.READY_TO_USE,
DateTime.now(),
config.owner);
final ConfigurationNode savedConfig = restService final ConfigurationNode savedConfig = restService
.getBuilder(SaveExamConfig.class) .getBuilder(SaveExamConfig.class)

View file

@ -3,8 +3,8 @@ INSERT IGNORE INTO lms_setup VALUES
; ;
INSERT IGNORE INTO seb_client_configuration VALUES INSERT IGNORE INTO seb_client_configuration VALUES
(1, 1, 'test', '2019-07-02 09:22:50', 'test', '98ac3c953abf5948d9d13c81cab580819ee2624c76d6d4147d4896a5b79f49956d382c08c93cb3b9ae350b32', null, 1), (1, 1, 'test', '2019-07-02 09:22:50', 'test', '98ac3c953abf5948d9d13c81cab580819ee2624c76d6d4147d4896a5b79f49956d382c08c93cb3b9ae350b32', null, 1, null, null),
(2, 1, 'testVDI', '2019-07-02 09:22:50', 'testVDI', '8b92ecd63305c97c359b5f39ba707356e2487cf118eb783b92fb7c6cdb217f87709fefa03abb13f8b4e5a14fa2c2ba', null, 1) (2, 1, 'testVDI', '2019-07-02 09:22:50', 'testVDI', '8b92ecd63305c97c359b5f39ba707356e2487cf118eb783b92fb7c6cdb217f87709fefa03abb13f8b4e5a14fa2c2ba', null, 1, null, null)
; ;
INSERT IGNORE INTO additional_attributes VALUES INSERT IGNORE INTO additional_attributes VALUES
@ -526,7 +526,7 @@ INSERT IGNORE INTO orientation VALUES
; ;
INSERT IGNORE INTO configuration_node VALUES INSERT IGNORE INTO configuration_node VALUES
(1, 1, 0, 'super-admin', 'test', null, 'EXAM_CONFIG', 'READY_TO_USE') (1, 1, 0, 'super-admin', 'test', null, 'EXAM_CONFIG', 'READY_TO_USE', null, null)
; ;
INSERT IGNORE INTO configuration VALUES INSERT IGNORE INTO configuration VALUES