From 3026edeb4c4eec137733bc2ff1cbd667107d79ee Mon Sep 17 00:00:00 2001 From: anhefti Date: Thu, 23 Feb 2023 16:49:31 +0100 Subject: [PATCH] SEBSERV-353 --- .../configs/SEBExamConfigBatchResetToTemplatePopup.java | 8 ++++++++ .../configs/SEBExamConfigBatchStateChangePopup.java | 8 ++++++++ .../gui/content/exam/ExamBatchArchivePopup.java | 8 ++++++++ .../sebserver/gui/content/exam/ExamBatchDeletePopup.java | 8 ++++++++ .../gui/service/page/AbstractBatchActionWizard.java | 8 +++----- src/main/resources/messages.properties | 9 +++++---- 6 files changed, 40 insertions(+), 9 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBExamConfigBatchResetToTemplatePopup.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBExamConfigBatchResetToTemplatePopup.java index f424c0aa..597f8f28 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBExamConfigBatchResetToTemplatePopup.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBExamConfigBatchResetToTemplatePopup.java @@ -17,6 +17,7 @@ import ch.ethz.seb.sebserver.gbl.api.API.BatchActionType; import ch.ethz.seb.sebserver.gbl.model.BatchAction; import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationNode; import ch.ethz.seb.sebserver.gbl.profile.GuiProfile; +import ch.ethz.seb.sebserver.gui.content.action.ActionDefinition; import ch.ethz.seb.sebserver.gui.form.FormBuilder; import ch.ethz.seb.sebserver.gui.form.FormHandle; import ch.ethz.seb.sebserver.gui.service.i18n.LocTextKey; @@ -89,4 +90,11 @@ public class SEBExamConfigBatchResetToTemplatePopup extends AbstractBatchActionW return formHead; } + @Override + protected void processUpdateListAction(final PageContext formContext) { + this.pageService.executePageAction(this.pageService.pageActionBuilder(formContext) + .newAction(ActionDefinition.SEB_EXAM_CONFIG_LIST) + .create()); + } + } diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBExamConfigBatchStateChangePopup.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBExamConfigBatchStateChangePopup.java index 9842a03a..f9b6189e 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBExamConfigBatchStateChangePopup.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBExamConfigBatchStateChangePopup.java @@ -20,6 +20,7 @@ import ch.ethz.seb.sebserver.gbl.model.Domain; import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationNode; import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationNode.ConfigurationStatus; import ch.ethz.seb.sebserver.gbl.profile.GuiProfile; +import ch.ethz.seb.sebserver.gui.content.action.ActionDefinition; import ch.ethz.seb.sebserver.gui.form.FormBuilder; import ch.ethz.seb.sebserver.gui.form.FormHandle; import ch.ethz.seb.sebserver.gui.service.i18n.LocTextKey; @@ -114,4 +115,11 @@ public class SEBExamConfigBatchStateChangePopup extends AbstractBatchActionWizar batchActionRequestBuilder.withFormParam(BatchAction.ACTION_ATTRIBUT_TARGET_STATE, targetStateName); } + @Override + protected void processUpdateListAction(final PageContext formContext) { + this.pageService.executePageAction(this.pageService.pageActionBuilder(formContext) + .newAction(ActionDefinition.SEB_EXAM_CONFIG_LIST) + .create()); + } + } diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamBatchArchivePopup.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamBatchArchivePopup.java index 8bf5343d..f5597723 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamBatchArchivePopup.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamBatchArchivePopup.java @@ -29,6 +29,7 @@ import ch.ethz.seb.sebserver.gbl.model.EntityKey; import ch.ethz.seb.sebserver.gbl.model.exam.Exam; import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationNode; import ch.ethz.seb.sebserver.gbl.profile.GuiProfile; +import ch.ethz.seb.sebserver.gui.content.action.ActionDefinition; import ch.ethz.seb.sebserver.gui.form.FormBuilder; import ch.ethz.seb.sebserver.gui.form.FormHandle; import ch.ethz.seb.sebserver.gui.service.ResourceService; @@ -104,6 +105,13 @@ public class ExamBatchArchivePopup extends AbstractBatchActionWizard { return formHead; } + @Override + protected void processUpdateListAction(final PageContext formContext) { + this.pageService.executePageAction(this.pageService.pageActionBuilder(formContext) + .newAction(ActionDefinition.EXAM_VIEW_LIST) + .create()); + } + @Override protected void applySelectionList( final PageContext formContext, diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamBatchDeletePopup.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamBatchDeletePopup.java index 793ab850..8257a1af 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamBatchDeletePopup.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamBatchDeletePopup.java @@ -29,6 +29,7 @@ import ch.ethz.seb.sebserver.gbl.model.EntityKey; import ch.ethz.seb.sebserver.gbl.model.exam.Exam; import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationNode; import ch.ethz.seb.sebserver.gbl.profile.GuiProfile; +import ch.ethz.seb.sebserver.gui.content.action.ActionDefinition; import ch.ethz.seb.sebserver.gui.form.FormBuilder; import ch.ethz.seb.sebserver.gui.form.FormHandle; import ch.ethz.seb.sebserver.gui.service.ResourceService; @@ -102,6 +103,13 @@ public class ExamBatchDeletePopup extends AbstractBatchActionWizard { return formHead; } + @Override + protected void processUpdateListAction(final PageContext formContext) { + this.pageService.executePageAction(this.pageService.pageActionBuilder(formContext) + .newAction(ActionDefinition.EXAM_VIEW_LIST) + .create()); + } + @Override protected void applySelectionList( final PageContext formContext, diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/page/AbstractBatchActionWizard.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/page/AbstractBatchActionWizard.java index 4e65d268..318cf440 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/page/AbstractBatchActionWizard.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/page/AbstractBatchActionWizard.java @@ -24,7 +24,6 @@ import ch.ethz.seb.sebserver.gbl.model.Domain.BATCH_ACTION; import ch.ethz.seb.sebserver.gbl.model.EntityKey; import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationNode; import ch.ethz.seb.sebserver.gbl.util.Utils; -import ch.ethz.seb.sebserver.gui.content.action.ActionDefinition; import ch.ethz.seb.sebserver.gui.form.Form; import ch.ethz.seb.sebserver.gui.form.FormBuilder; import ch.ethz.seb.sebserver.gui.form.FormHandle; @@ -84,10 +83,11 @@ public abstract class AbstractBatchActionWizard { final FormBuilder formHead, final boolean readonly); + protected abstract void processUpdateListAction(final PageContext formContext); + protected void applySelectionList( final PageContext formContext, final Set multiSelection) { - } public Function popupCreationFunction(final PageContext pageContext) { @@ -227,9 +227,7 @@ public abstract class AbstractBatchActionWizard { formContext.getParent().layout(true, true); - this.pageService.executePageAction(this.pageService.pageActionBuilder(formContext) - .newAction(ActionDefinition.SEB_EXAM_CONFIG_LIST) - .create()); + processUpdateListAction(formContext); } protected FormBuilder getFormHeadBuilder( diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index 6d6262d4..912a00ff 100644 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -50,6 +50,7 @@ sebserver.overall.types.activityType.DELETE=Delete sebserver.overall.types.activityType.LOGIN=Login sebserver.overall.types.activityType.LOGOUT=Logout sebserver.overall.types.activityType.FINISHED=Finished +sebserver.overall.types.activityType.ARCHIVE=Archived sebserver.overall.types.entityType.CONFIGURATION_ATTRIBUTE=Configuration Attribute sebserver.overall.types.entityType.CONFIGURATION_VALUE=Configuration Value @@ -516,12 +517,12 @@ sebserver.exam.list.action.no.modify.privilege=No Access: An Exam from another i sebserver.exam.list.action.archive=Archive Selected Exams sebserver.exam.list.action.delete=Delete Selected Exams -sebserver.exam.list.batch.archive.title=Batch Archive Exams +sebserver.exam.list.batch.archive.title=Archive all Exams in Batch Action sebserver.exam.list.batch.action.archive=Archive All -sebserver.exam.list.batch.action.archive.info=This batch action archives all selected exams below.
If a particular exam is in a invalid state for archiving it will be ignored.
Please make sure that all selected exams shall be archived. -sebserver.exam.list.batch.delete.title=Delete All +sebserver.exam.list.batch.action.archive.info=This batch action archives all selected exams below. To archive an exam it must be finished (Finished state)
If a particular exam is in a invalid state for archiving it will be ignored. Archive is an irreversible action and once an exam is archived it cannot be reactivated anymore,
please make sure all exams below shall be archived before applying the batch action. +sebserver.exam.list.batch.delete.title=Delete all Exams in Batch Action sebserver.exam.list.batch.action.delete=Delete Selected Exams -sebserver.exam.list.batch.action.delete.info=This batch action deletes all selected exams below.
If a particular exam is in a invalid state for deleting it will be ignored.
Since this action is irreversible and all deleted exams are lost, please make sure that all selected exams shall be deleted and use Cancel to abort the action if not so. +sebserver.exam.list.batch.action.delete.info=This batch action deletes all selected exams below.
If a particular exam is in a invalid state for deleting it will be ignored.
Delete is an action is an irreversible action and all deleted exams will be lost.
Please make sure that all selected exams below shall be deleted and use Cancel to abort the action if not so. sebserver.exam.consistency.title=Note: This exam is already running but has some missing settings sebserver.exam.consistency.missing-supporter= - There are no Exam Supporter defined for this exam. Use 'Edit Exam' on the right to add an Exam Supporter.