From b6c94a07e5dd7315d4fe027d16476c0205130717 Mon Sep 17 00:00:00 2001 From: alindo Date: Mon, 25 Nov 2024 11:58:25 +0000 Subject: [PATCH] wip --- .../common/client/ViewerConstants.java | 3 ++- .../manager/SIARDPanel/SIARDManagerPage.java | 9 ++++++--- .../SIARDPanel/navigation/SIARDNavigationPanel.java | 5 +++-- .../common/server/controller/SIARDController.java | 10 ++++++---- src/main/java/config/i18n/client/ClientMessages.java | 6 ++++++ .../config/i18n/client/ClientMessages.properties | 3 +++ .../config/i18n/client/ClientMessages_pt_PT.properties | 3 +++ 7 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/databasepreservation/common/client/ViewerConstants.java b/src/main/java/com/databasepreservation/common/client/ViewerConstants.java index bd38104f8..2750df444 100644 --- a/src/main/java/com/databasepreservation/common/client/ViewerConstants.java +++ b/src/main/java/com/databasepreservation/common/client/ViewerConstants.java @@ -91,7 +91,8 @@ public class ViewerConstants { public static final String DENORMALIZATION_STATUS_PREFIX = "denormalization-"; public static final String INTERNAL_ZIP_LOB_FOLDER = "lobs/"; - public static final String SIARDDK_RESEARCH_INDEX_PATH = "/Schemas/standard/researchIndex.xsd"; + public static final String SIARDDK_DEFAULT_SCHEMA_NAME = "public"; + /* * SOLR CONFIGSETS */ 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 031e82e4b..8d1ded178 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,9 +208,11 @@ 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)) { + 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"); + messages.SIARDHomePageDialogTextForDeleteNotAvailable(ViewerConstants.SIARD_V21), + messages.basicActionUnderstood(), "btn btn-link"); } else { CommonDialogs.showConfirmDialog(messages.SIARDHomePageDialogTitleForDelete(), message, messages.basicActionCancel(), messages.basicActionConfirm(), CommonDialogs.Level.DANGER, "500px", diff --git a/src/main/java/com/databasepreservation/common/client/common/visualization/manager/SIARDPanel/navigation/SIARDNavigationPanel.java b/src/main/java/com/databasepreservation/common/client/common/visualization/manager/SIARDPanel/navigation/SIARDNavigationPanel.java index c29273c2c..cbf534315 100644 --- a/src/main/java/com/databasepreservation/common/client/common/visualization/manager/SIARDPanel/navigation/SIARDNavigationPanel.java +++ b/src/main/java/com/databasepreservation/common/client/common/visualization/manager/SIARDPanel/navigation/SIARDNavigationPanel.java @@ -118,8 +118,9 @@ public NavigationPanel build() { btnDelete.addClickHandler(event -> { if (database.getVersion().equals(ViewerConstants.SIARD_DK_1007) || database.getVersion().equals(ViewerConstants.SIARD_DK_128)) { - Dialogs.showInformationDialog("Delete metadata information", - "Metadata deletion only supports SIARD version 2.1.", messages.basicActionUnderstood(), "btn btn-link"); + Dialogs.showInformationDialog(messages.SIARDHomePageTitleForDeleteSIARDNotAvailable(), + messages.SIARDHomePageTextForDeleteSIARDNotAvailable(ViewerConstants.SIARD_V21), + messages.basicActionUnderstood(), "btn btn-link"); } else { if (!database.getStatus().equals(ViewerDatabaseStatus.REMOVING) && !database.getStatus().equals(ViewerDatabaseStatus.INGESTING)) { 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 18d82e34f..f40437ce4 100644 --- a/src/main/java/com/databasepreservation/common/server/controller/SIARDController.java +++ b/src/main/java/com/databasepreservation/common/server/controller/SIARDController.java @@ -606,8 +606,8 @@ private static void convertSIARDMetadataToSolr(Path siardPath, String databaseUU Reporter reporter = new NoOpReporter(); SIARDEdition siardEdition = SIARDEdition.newInstance(); if (siardVersion.equals(ViewerConstants.SIARD_DK)) { - siardEdition.editModule(new SIARDDKEditFactory()).editModuleParameter( - SIARDDKEditFactory.PARAMETER_FOLDER, Collections.singletonList(siardPath.toAbsolutePath().toString())); + siardEdition.editModule(new SIARDDKEditFactory()).editModuleParameter(SIARDDKEditFactory.PARAMETER_FOLDER, + Collections.singletonList(siardPath.toAbsolutePath().toString())); } else if (siardVersion.equals(ViewerConstants.SIARD_V21)) { siardEdition.editModule(new SIARDEditFactory()).editModuleParameter(SIARDEditFactory.PARAMETER_FILE, Collections.singletonList(siardPath.toAbsolutePath().toString())); @@ -719,11 +719,13 @@ private static void convertSIARDtoSolr(Path siardPath, String databaseUUID, Stri if (siardVersion.equals(ViewerConstants.SIARD_DK_128)) { databaseMigration.importModule(new SIARDDK128ModuleFactory()) .importModuleParameter(SIARDDK128ModuleFactory.PARAMETER_FOLDER, siardPath.toAbsolutePath().toString()) - .importModuleParameter(SIARDDK128ModuleFactory.PARAMETER_AS_SCHEMA, "public"); + .importModuleParameter(SIARDDK128ModuleFactory.PARAMETER_AS_SCHEMA, + ViewerConstants.SIARDDK_DEFAULT_SCHEMA_NAME); } else if (siardVersion.equals(ViewerConstants.SIARD_DK_1007)) { databaseMigration.importModule(new SIARDDK1007ModuleFactory()) .importModuleParameter(SIARDDK1007ModuleFactory.PARAMETER_FOLDER, siardPath.toAbsolutePath().toString()) - .importModuleParameter(SIARDDK1007ModuleFactory.PARAMETER_AS_SCHEMA, "public"); + .importModuleParameter(SIARDDK1007ModuleFactory.PARAMETER_AS_SCHEMA, + ViewerConstants.SIARDDK_DEFAULT_SCHEMA_NAME); } else if (siardVersion.equals(ViewerConstants.SIARD_V21)) { databaseMigration.importModule(new SIARD2ModuleFactory()) .importModuleParameter(SIARD2ModuleFactory.PARAMETER_FILE, siardPath.toAbsolutePath().toString()) diff --git a/src/main/java/config/i18n/client/ClientMessages.java b/src/main/java/config/i18n/client/ClientMessages.java index 2a58a46c9..b95531b7d 100644 --- a/src/main/java/config/i18n/client/ClientMessages.java +++ b/src/main/java/config/i18n/client/ClientMessages.java @@ -829,6 +829,8 @@ public interface ClientMessages extends Messages { String SIARDHomePageDialogTitleForDelete(); + String SIARDHomePageDialogTextForDeleteNotAvailable(String version); + String SIARDHomePageDialogTitleForDeleteBrowseContent(); String SIARDHomePageDialogTitleForDeleteValidationReport(); @@ -841,6 +843,10 @@ public interface ClientMessages extends Messages { SafeHtml SIARDHomePageTextForDeleteSIARD(); + String SIARDHomePageTitleForDeleteSIARDNotAvailable(); + + String SIARDHomePageTextForDeleteSIARDNotAvailable(String version); + SafeHtml SIARDHomePageTextForDeleteSIARDReportValidation(); String SIARDHomePageTextForIngestNotSupported(); diff --git a/src/main/resources/config/i18n/client/ClientMessages.properties b/src/main/resources/config/i18n/client/ClientMessages.properties index 707d58241..3029a883e 100644 --- a/src/main/resources/config/i18n/client/ClientMessages.properties +++ b/src/main/resources/config/i18n/client/ClientMessages.properties @@ -329,6 +329,7 @@ SIARDHomePageDialogTitleForBrowsing=Browsing SIARDHomePageTextForIngestNotSupported=Browsing the data only supports SIARD version 2.1, in order to browse the SIARD export it using the option '"'migrate to SIARD'"' available in the '"'SIARD'"' options. SIARDHomePageTextForIngestSuccess=SIARD data successfully imported SIARDHomePageDialogTitleForDelete=Delete +SIARDHomePageDialogTextForDeleteNotAvailable=SIARD deletion only supports SIARD version {} SIARDHomePageDialogTitleForDeleteValidationReport=Delete validation report SIARDHomePageDialogTitleForDeleteBrowseContent=Delete browse content SIARDHomePageTextForDeleteAllFromServer=Are you sure you want to {startBold,}remove{endBold,} the SIARD structure, data and the file from the server? If you are aware of the consequences confirm the action, otherwise cancel. @@ -336,6 +337,8 @@ SIARDHomePageTextForDeleteAllFromDesktop=Are you sure you want to {startBold, SIARDHomePageTextForDeleteFromSolr=Are you sure you want to {startBold,}remove{endBold,} the SIARD data from the application? If you are aware of the consequences confirm the action, otherwise cancel. SIARDHomePageTextForDeleteSIARD=Are you sure you want to {startBold,}remove{endBold,} the SIARD file from the server? Removing the SIARD will make the download of LOBs unavailable. If you are aware of the consequences confirm the action, otherwise cancel. SIARDHomePageTextForDeleteSIARDReportValidation=Are you sure you want to {startBold,}delete{endBold,} the validation report file? If you are aware of the consequences confirm the action, otherwise cancel. +SIARDHomePageTitleForDeleteSIARDNotAvailable=Delete metadata information +SIARDHomePageTextForDeleteSIARDNotAvailable=Metadata deletion only supports SIARD version {} SIARDHomePageTextForRequiredSIARDFile=SIARD file not found on the system and is required to perform this action. SIARDHomePageOptionsHeaderForPermissions=Permissions SIARDHomePageOptionsDescriptionForPermissions=See the roles that are authorized to browse this database. diff --git a/src/main/resources/config/i18n/client/ClientMessages_pt_PT.properties b/src/main/resources/config/i18n/client/ClientMessages_pt_PT.properties index 1fe6e2900..d942718f3 100644 --- a/src/main/resources/config/i18n/client/ClientMessages_pt_PT.properties +++ b/src/main/resources/config/i18n/client/ClientMessages_pt_PT.properties @@ -326,6 +326,7 @@ SIARDHomePageDialogTitleForBrowsing=Navegação SIARDHomePageTextForIngestNotSupported=A navegação pelos dados é apenas suportada para a versão 2.1 do SIARD. SIARDHomePageTextForIngestSuccess=Os dados do SIARD foram importados com sucesso SIARDHomePageDialogTitleForDelete=Eliminar +SIARDHomePageDialogTextForDeleteNotAvailable=Eliminação de SIARDs apenas suportada para a versão {} SIARDHomePageDialogTitleForDeleteValidationReport=Eliminar o relatório de validação SIARDHomePageDialogTitleForDeleteBrowseContent=Eliminar o conteúdo da navegação SIARDHomePageTextForDeleteAllFromServer=Tem a certeza que deseja {startBold,}eliminar endBold,} o SIARD da aplicação? Esta operação irá eliminar os metadados, dados (se ingerido) e o ficheiro SIARD. Se está consciente das consequências confirme a ação, caso contrário cancele. @@ -333,6 +334,8 @@ SIARDHomePageTextForDeleteAllFromDesktop=Tem a certeza que deseja {startBold, SIARDHomePageTextForDeleteFromSolr=Tem a certeza que deseja {startBold,}apagar{endBold,} os dados do SIARD? Essa ação irá remover da aplicação o conteudo do SIARD. Se está consciente das consequências confirme a ação, caso contrário cancele. SIARDHomePageTextForDeleteSIARD=Tem a certeza que deseja {startBold,}eliminar{endBold,} o ficheiro SIARD? Esta operação irá eliminar o ficheiro SIARD do sistema. A remoção fará com que os LOB fiquem indisponíveis para descarregar. Se está consciente das consequências confirme a ação, caso contrário cancele. SIARDHomePageTextForDeleteSIARDReportValidation=Tem a certeza que deseja {startBold,}eliminar{endBold,} o relatório de validação do SIARD? Esta operação irá eliminar o ficheiro do sistema. Se está consciente das consequências confirme a ação, caso contrário cancele. +SIARDHomePageTitleForDeleteSIARDNotAvailable=Informação sobre eliminação de metadados +SIARDHomePageTextForDeleteSIARDNotAvailable=A eliminação de metadados de SIARDs é apenas suportada na versão {} SIARDHomePageTextForRequiredSIARDFile=Ficheiro SIARD não encontrado no sistema e é necessário para executar essa ação SIARDHomePageOptionsHeaderForPermissions=Permissões SIARDHomePageOptionsDescriptionForPermissions=Consulte as funções que estão autorizadas a navegar nesta base de dados.