diff --git a/sormas-api/pom.xml b/sormas-api/pom.xml
index 599275a1b17..8988b10c31b 100644
--- a/sormas-api/pom.xml
+++ b/sormas-api/pom.xml
@@ -2,7 +2,7 @@
de.symeda.sormas
sormas-base
- 1.76.4
+ 1.76.5
../sormas-base
4.0.0
diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/FacadeProvider.java b/sormas-api/src/main/java/de/symeda/sormas/api/FacadeProvider.java
index f2c77831dbb..16383b20a47 100644
--- a/sormas-api/src/main/java/de/symeda/sormas/api/FacadeProvider.java
+++ b/sormas-api/src/main/java/de/symeda/sormas/api/FacadeProvider.java
@@ -37,6 +37,7 @@
import de.symeda.sormas.api.contact.ContactFacade;
import de.symeda.sormas.api.customizableenum.CustomizableEnumFacade;
import de.symeda.sormas.api.dashboard.DashboardFacade;
+import de.symeda.sormas.api.deletionconfiguration.DeletionConfigurationFacade;
import de.symeda.sormas.api.disease.DiseaseConfigurationFacade;
import de.symeda.sormas.api.docgeneneration.DocumentTemplateFacade;
import de.symeda.sormas.api.docgeneneration.EventDocumentFacade;
@@ -484,6 +485,10 @@ public static AuditLoggerFacade getAuditLoggerFacade() {
return get().lookupEjbRemote(AuditLoggerFacade.class);
}
+ public static DeletionConfigurationFacade getDeletionConfigurationFacade() {
+ return get().lookupEjbRemote(DeletionConfigurationFacade.class);
+ }
+
@SuppressWarnings("unchecked")
public
P lookupEjbRemote(Class
clazz) {
try {
diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/deletionconfiguration/DeletionConfigurationFacade.java b/sormas-api/src/main/java/de/symeda/sormas/api/deletionconfiguration/DeletionConfigurationFacade.java
index 07e4e5102e2..1059c98acfb 100644
--- a/sormas-api/src/main/java/de/symeda/sormas/api/deletionconfiguration/DeletionConfigurationFacade.java
+++ b/sormas-api/src/main/java/de/symeda/sormas/api/deletionconfiguration/DeletionConfigurationFacade.java
@@ -4,4 +4,7 @@
@Remote
public interface DeletionConfigurationFacade {
+
+ void startAutomaticDeletion();
+
}
diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java
index 5a1bca6c806..b46d3ba6da0 100644
--- a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java
+++ b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java
@@ -71,6 +71,7 @@ public interface Captions {
String actionDismiss = "actionDismiss";
String actionEnable = "actionEnable";
String actionEnterBulkEditMode = "actionEnterBulkEditMode";
+ String actionExecuteAutomaticDeletion = "actionExecuteAutomaticDeletion";
String actionGenerate = "actionGenerate";
String actionGenerateNewPassword = "actionGenerateNewPassword";
String actionGenerateNewPasswords = "actionGenerateNewPasswords";
diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java
index 51a9971cc74..16f49e04521 100644
--- a/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java
+++ b/sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java
@@ -386,6 +386,7 @@ public interface Strings {
String headingArchiveImmunization = "headingArchiveImmunization";
String headingArchiveTravelEntry = "headingArchiveTravelEntry";
String headingArchivingNotPossible = "headingArchivingNotPossible";
+ String headingAutomaticDeletionStarted = "headingAutomaticDeletionStarted";
String headingBurialDetails = "headingBurialDetails";
String headingCampaignBasics = "headingCampaignBasics";
String headingCampaignDashboard = "headingCampaignDashboard";
@@ -937,6 +938,7 @@ public interface Strings {
String messageAreasArchived = "messageAreasArchived";
String messageAreasArchivingNotPossible = "messageAreasArchivingNotPossible";
String messageAreasDearchived = "messageAreasDearchived";
+ String messageAutomaticDeletionStarted = "messageAutomaticDeletionStarted";
String messageBulkCasesWithDifferentDiseasesSelected = "messageBulkCasesWithDifferentDiseasesSelected";
String messageBulkContactsWithDifferentDiseasesSelected = "messageBulkContactsWithDifferentDiseasesSelected";
String messageBulkDontShareWithReportingToolWarning = "messageBulkDontShareWithReportingToolWarning";
diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/user/UserRight.java b/sormas-api/src/main/java/de/symeda/sormas/api/user/UserRight.java
index 5643e27aa74..d3245d4b5b4 100644
--- a/sormas-api/src/main/java/de/symeda/sormas/api/user/UserRight.java
+++ b/sormas-api/src/main/java/de/symeda/sormas/api/user/UserRight.java
@@ -419,6 +419,7 @@ public enum UserRight {
public static final String _SORMAS_UI = "SORMAS_UI";
public static final String _SORMAS_TO_SORMAS_CLIENT = "SORMAS_TO_SORMAS_CLIENT";
public static final String _EXTERNAL_VISITS = "EXTERNAL_VISITS";
+ public static final String _DEV_MODE = "DEV_MODE";
private static final Map> userRightDependencies = buildUserRightDependencies();
diff --git a/sormas-api/src/main/resources/captions.properties b/sormas-api/src/main/resources/captions.properties
index 565e726faa7..a24c98e17fc 100644
--- a/sormas-api/src/main/resources/captions.properties
+++ b/sormas-api/src/main/resources/captions.properties
@@ -184,6 +184,7 @@ actionOkAndGoToMerge = Okay, and continue to merge overview
actionOkAndGoToContactDirectory = Okay, and continue to contact directory
actionOkAndGoToContactDetails = Okay, and continue to contact
actionOkAndGoToPersonDirectory = Okay, and continue to person directory
+actionExecuteAutomaticDeletion = Execute automatic deletion
activityAsCaseFlightNumber=Flight number
ActivityAsCase=Activity as case
ActivityAsCase.startDate=Start of activity
diff --git a/sormas-api/src/main/resources/strings.properties b/sormas-api/src/main/resources/strings.properties
index e2dbf7488ee..5fd8810b119 100644
--- a/sormas-api/src/main/resources/strings.properties
+++ b/sormas-api/src/main/resources/strings.properties
@@ -746,6 +746,7 @@ headingDeleteUserRoleNotPossible = Cannot delete user role
headingSaveUserNotPossible = Cannot save user
immunizationVaccinationHeading = Vaccination
immunizationRecoveryHeading = Recovery
+headingAutomaticDeletionStarted = Automatic deletion started
# Info texts
infoActivityAsCaseInvestigation = Please document ALL relevant activities after infection:
@@ -1257,6 +1258,7 @@ messageSormasToSormasSimilarConvertedContactFound = There is at least one simila
messageSormasToSormasSimilarCaseToContactFound = There is at least one similar case in your system.After accepting the request, it may be necessary to perform a manual conversion of the accepted contacts.
messageSormasToSormasSimilarPersonFound = There is at least one similar person in your system. If you accept the request the case/contact maybe will create a person in your system as a duplicate.Please check this after accepting.
messageDeleteWithPendingShareRequest = There is a pending share request. With a deletion, the share request will be revoked and deleted.
+messageAutomaticDeletionStarted = Automatic deletion has been started and will be executed in the background. Please note that, depending on the amount of data that is deleted, this process can take some time.
# Notifications
notificationCaseClassificationChanged = The classification of case %s has changed to %s.
notificationCaseInvestigationDone = The investigation of case %s has been done.
diff --git a/sormas-app/pom.xml b/sormas-app/pom.xml
index f169b01e0f9..1ec17250f80 100644
--- a/sormas-app/pom.xml
+++ b/sormas-app/pom.xml
@@ -3,7 +3,7 @@
sormas-base
de.symeda.sormas
- 1.76.4
+ 1.76.5
../sormas-base
4.0.0
diff --git a/sormas-backend/pom.xml b/sormas-backend/pom.xml
index 29aa4c46426..f5544612e3f 100644
--- a/sormas-backend/pom.xml
+++ b/sormas-backend/pom.xml
@@ -3,7 +3,7 @@
sormas-base
de.symeda.sormas
- 1.76.4
+ 1.76.5
../sormas-base
4.0.0
diff --git a/sormas-backend/src/main/java/de/symeda/sormas/backend/deletionconfiguration/DeletionConfigurationFacadeEjb.java b/sormas-backend/src/main/java/de/symeda/sormas/backend/deletionconfiguration/DeletionConfigurationFacadeEjb.java
index 7a04117ce77..782cbdc19c1 100644
--- a/sormas-backend/src/main/java/de/symeda/sormas/backend/deletionconfiguration/DeletionConfigurationFacadeEjb.java
+++ b/sormas-backend/src/main/java/de/symeda/sormas/backend/deletionconfiguration/DeletionConfigurationFacadeEjb.java
@@ -1,11 +1,31 @@
package de.symeda.sormas.backend.deletionconfiguration;
+import javax.ejb.Asynchronous;
+import javax.ejb.EJB;
+import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import de.symeda.sormas.api.deletionconfiguration.DeletionConfigurationFacade;
+import de.symeda.sormas.api.user.UserRight;
+import de.symeda.sormas.backend.common.CronService;
+import de.symeda.sormas.backend.util.RightsAllowed;
@Stateless(name = "DeletionConfigurationFacade")
public class DeletionConfigurationFacadeEjb implements DeletionConfigurationFacade {
+ @EJB
+ private CronService cronService;
+ @Override
+ @Asynchronous
+ @RightsAllowed(UserRight._DEV_MODE)
+ public void startAutomaticDeletion() {
+ cronService.deleteExpiredEntities();
+ }
+
+ @LocalBean
+ @Stateless
+ public static class DeletionConfigurationFacadeEjbLocal extends DeletionConfigurationFacadeEjb {
+
+ }
}
diff --git a/sormas-base/dependencies/serverlibs.pom b/sormas-base/dependencies/serverlibs.pom
index 276f53cc92d..94dc1ae03b1 100644
--- a/sormas-base/dependencies/serverlibs.pom
+++ b/sormas-base/dependencies/serverlibs.pom
@@ -8,7 +8,7 @@
sormas-base
de.symeda.sormas
- 1.76.4
+ 1.76.5
../
diff --git a/sormas-base/pom.xml b/sormas-base/pom.xml
index 31071cc634f..46621e33f84 100644
--- a/sormas-base/pom.xml
+++ b/sormas-base/pom.xml
@@ -5,7 +5,7 @@
de.symeda.sormas
sormas-base
pom
- 1.76.4
+ 1.76.5
1.8
diff --git a/sormas-cargoserver/pom.xml b/sormas-cargoserver/pom.xml
index 23c30eb0e94..a7f7a0d0f15 100644
--- a/sormas-cargoserver/pom.xml
+++ b/sormas-cargoserver/pom.xml
@@ -3,7 +3,7 @@
de.symeda.sormas
sormas-base
- 1.76.4
+ 1.76.5
../sormas-base
diff --git a/sormas-ear/pom.xml b/sormas-ear/pom.xml
index 86bb5351df3..ac3f0eb006d 100644
--- a/sormas-ear/pom.xml
+++ b/sormas-ear/pom.xml
@@ -3,7 +3,7 @@
de.symeda.sormas
sormas-base
- 1.76.4
+ 1.76.5
../sormas-base
diff --git a/sormas-keycloak-service-provider/pom.xml b/sormas-keycloak-service-provider/pom.xml
index 35918ecdd9a..09b38e5a847 100644
--- a/sormas-keycloak-service-provider/pom.xml
+++ b/sormas-keycloak-service-provider/pom.xml
@@ -3,7 +3,7 @@
sormas-base
de.symeda.sormas
- 1.76.4
+ 1.76.5
../sormas-base
4.0.0
diff --git a/sormas-rest/pom.xml b/sormas-rest/pom.xml
index de3e4262679..ab97a511d27 100644
--- a/sormas-rest/pom.xml
+++ b/sormas-rest/pom.xml
@@ -3,7 +3,7 @@
de.symeda.sormas
sormas-base
- 1.76.4
+ 1.76.5
../sormas-base
diff --git a/sormas-ui/pom.xml b/sormas-ui/pom.xml
index 901b90e9fc4..bc4bd6936e7 100644
--- a/sormas-ui/pom.xml
+++ b/sormas-ui/pom.xml
@@ -3,7 +3,7 @@
sormas-base
de.symeda.sormas
- 1.76.4
+ 1.76.5
../sormas-base
4.0.0
diff --git a/sormas-ui/src/main/java/de/symeda/sormas/ui/configuration/DevModeView.java b/sormas-ui/src/main/java/de/symeda/sormas/ui/configuration/DevModeView.java
index 89a0ddb8d7c..38640b32063 100644
--- a/sormas-ui/src/main/java/de/symeda/sormas/ui/configuration/DevModeView.java
+++ b/sormas-ui/src/main/java/de/symeda/sormas/ui/configuration/DevModeView.java
@@ -105,6 +105,7 @@
import de.symeda.sormas.ui.utils.ButtonHelper;
import de.symeda.sormas.ui.utils.CssStyles;
import de.symeda.sormas.ui.utils.DateFormatHelper;
+import de.symeda.sormas.ui.utils.VaadinUiUtil;
public class DevModeView extends AbstractConfigurationView {
@@ -168,12 +169,20 @@ private HorizontalLayout createDevButtonsLayout() {
HorizontalLayout horizontalLayout = new HorizontalLayout();
horizontalLayout.setSpacing(true);
- Button btnResetEnumCache = ButtonHelper.createButton((Captions.actionResetEnumCache), e -> {
- FacadeProvider.getCustomizableEnumFacade().loadData();
- });
-
+ Button btnResetEnumCache =
+ ButtonHelper.createButton((Captions.actionResetEnumCache), e -> FacadeProvider.getCustomizableEnumFacade().loadData());
horizontalLayout.addComponent(btnResetEnumCache);
+ Button btnExecuteAutomaticDeletion = ButtonHelper.createButton((Captions.actionExecuteAutomaticDeletion), e -> {
+ VaadinUiUtil.showSimplePopupWindow(
+ I18nProperties.getString(Strings.headingAutomaticDeletionStarted),
+ I18nProperties.getString(Strings.messageAutomaticDeletionStarted),
+ ContentMode.TEXT,
+ 640);
+ FacadeProvider.getDeletionConfigurationFacade().startAutomaticDeletion();
+ });
+ horizontalLayout.addComponent(btnExecuteAutomaticDeletion);
+
return horizontalLayout;
}
@@ -1247,8 +1256,8 @@ private void generateContacts() {
int[] followUpDays = random().ints(1, followUpCount + 1).distinct().limit(followUpCount).toArray();
List followUpDates = new ArrayList<>();
for (int day : followUpDays) {
- followUpDates.add(
- UtilDate.toLocalDate(contactStartDate).atStartOfDay().plusDays(day - 1).plusMinutes(random().nextInt(60 * 24 + 1)));
+ followUpDates
+ .add(UtilDate.toLocalDate(contactStartDate).atStartOfDay().plusDays(day - 1).plusMinutes(random().nextInt(60 * 24 + 1)));
}
for (LocalDateTime date : followUpDates) {
diff --git a/sormas-widgetset/pom.xml b/sormas-widgetset/pom.xml
index 9ee12bbcce6..a6d40762d30 100644
--- a/sormas-widgetset/pom.xml
+++ b/sormas-widgetset/pom.xml
@@ -3,7 +3,7 @@
sormas-base
de.symeda.sormas
- 1.76.4
+ 1.76.5
../sormas-base
4.0.0