diff --git a/src/main/java/com/databasepreservation/common/client/common/visualization/manager/SIARDPanel/SIARDManagerPage.java b/src/main/java/com/databasepreservation/common/client/common/visualization/manager/SIARDPanel/SIARDManagerPage.java index 031e82e4..a408d7de 100644 --- a/src/main/java/com/databasepreservation/common/client/common/visualization/manager/SIARDPanel/SIARDManagerPage.java +++ b/src/main/java/com/databasepreservation/common/client/common/visualization/manager/SIARDPanel/SIARDManagerPage.java @@ -143,7 +143,8 @@ private void populateNavigationPanels() { if (ApplicationType.getType().equals(ViewerConstants.APPLICATION_ENV_SERVER)) { DatabaseService.Util.call((Set databasePermissions) -> { ContextService.Util.call((Set authorizationGroups) -> { - permissionsNavigationPanel = PermissionsNavigationPanel.getInstance(database, databasePermissions, authorizationGroups); + permissionsNavigationPanel = PermissionsNavigationPanel.getInstance(database, databasePermissions, + authorizationGroups); if (permissionsNavigationPanel.hasPermissionsOrGroups()) { navigationPanels.add(permissionsNavigationPanel.build()); } @@ -207,21 +208,16 @@ private void setupFooterButtons() { if (ApplicationType.getType().equals(ViewerConstants.APPLICATION_ENV_DESKTOP)) { message = messages.SIARDHomePageTextForDeleteAllFromDesktop(); } - if (database.getVersion().equals(ViewerConstants.SIARD_DK_1007) || database.getVersion().equals(ViewerConstants.SIARD_DK_128)) { - Dialogs.showInformationDialog(messages.SIARDHomePageDialogTitleForDelete(), - "SIARD deletion only supports SIARD version 2.1.", messages.basicActionUnderstood(), "btn btn-link"); - } else { - CommonDialogs.showConfirmDialog(messages.SIARDHomePageDialogTitleForDelete(), message, - messages.basicActionCancel(), messages.basicActionConfirm(), CommonDialogs.Level.DANGER, "500px", - new DefaultAsyncCallback() { - @Override - public void onSuccess(Boolean result) { - if (result) { - deleteAll(); - } + CommonDialogs.showConfirmDialog(messages.SIARDHomePageDialogTitleForDelete(), message, + messages.basicActionCancel(), messages.basicActionConfirm(), CommonDialogs.Level.DANGER, "500px", + new DefaultAsyncCallback() { + @Override + public void onSuccess(Boolean result) { + if (result) { + deleteAll(); } - }); - } + } + }); } else if (ViewerDatabaseStatus.INGESTING.equals(database.getStatus())) { Dialogs.showInformationDialog(messages.SIARDManagerPageInformationDialogTitle(), messages.SIARDManagerPageTextForWaitForFinishing(), messages.basicActionClose(), "btn btn-link"); diff --git a/src/main/java/com/databasepreservation/common/server/controller/SIARDController.java b/src/main/java/com/databasepreservation/common/server/controller/SIARDController.java index 6bc6048c..3037572e 100644 --- a/src/main/java/com/databasepreservation/common/server/controller/SIARDController.java +++ b/src/main/java/com/databasepreservation/common/server/controller/SIARDController.java @@ -886,17 +886,20 @@ public static boolean deleteAll(String databaseUUID) ViewerDatabase database = solrManager.retrieve(ViewerDatabase.class, databaseUUID); - if (ViewerFactory.getViewerConfiguration().getApplicationEnvironment() - .equals(ViewerConstants.APPLICATION_ENV_SERVER)) { - String siardPath = database.getPath(); - final boolean deleteSiard = !ViewerConfiguration.getInstance().getViewerConfigurationAsBoolean(false, - ViewerConfiguration.PROPERTY_DISABLE_SIARD_DELETION); - if (StringUtils.isNotBlank(siardPath) && Paths.get(siardPath).toFile().exists() && deleteSiard) { - deleteSIARDFileFromPath(siardPath, databaseUUID); + if (!database.getVersion().equals(ViewerConstants.SIARD_DK_1007) + && !database.getVersion().equals(ViewerConstants.SIARD_DK_128)) { + if (ViewerFactory.getViewerConfiguration().getApplicationEnvironment() + .equals(ViewerConstants.APPLICATION_ENV_SERVER)) { + String siardPath = database.getPath(); + final boolean deleteSiard = !ViewerConfiguration.getInstance().getViewerConfigurationAsBoolean(false, + ViewerConfiguration.PROPERTY_DISABLE_SIARD_DELETION); + if (StringUtils.isNotBlank(siardPath) && Paths.get(siardPath).toFile().exists() && deleteSiard) { + deleteSIARDFileFromPath(siardPath, databaseUUID); + } } - } - ViewerFactory.getConfigurationManager().deleteDatabaseFolder(databaseUUID); + ViewerFactory.getConfigurationManager().deleteDatabaseFolder(databaseUUID); + } String reportPath = database.getValidatorReportPath(); if (StringUtils.isNotBlank(reportPath) && Paths.get(reportPath).toFile().exists()) {