From d8f6f59deafbd48dfa63075213d05ffdb5413f04 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Thu, 10 Oct 2024 17:34:42 +0000 Subject: [PATCH 01/13] Allow to define which metadata attribute is used as title of structure tree nodes in ruleset. Remove old kitodo config property. --- .../rulesetmanagement/FunctionalMetadata.java | 5 ++++ .../kitodo/config/enums/ParameterCore.java | 6 ----- .../forms/dataeditor/DataEditorForm.java | 27 ++++++++++++++++--- .../forms/dataeditor/StructurePanel.java | 13 --------- .../dataeditor/DataEditorService.java | 15 ++--------- .../main/resources/kitodo_config.properties | 3 --- .../resources/messages/messages_de.properties | 1 + .../resources/messages/messages_en.properties | 1 + .../resources/messages/messages_es.properties | 2 ++ .../metadataEditor/logicalStructure.xhtml | 14 +++++++--- .../services/data/DataEditorServiceIT.java | 10 ------- 11 files changed, 45 insertions(+), 52 deletions(-) diff --git a/Kitodo-API/src/main/java/org/kitodo/api/dataeditor/rulesetmanagement/FunctionalMetadata.java b/Kitodo-API/src/main/java/org/kitodo/api/dataeditor/rulesetmanagement/FunctionalMetadata.java index fa3de16b9d4..dacb3cf53e8 100644 --- a/Kitodo-API/src/main/java/org/kitodo/api/dataeditor/rulesetmanagement/FunctionalMetadata.java +++ b/Kitodo-API/src/main/java/org/kitodo/api/dataeditor/rulesetmanagement/FunctionalMetadata.java @@ -66,6 +66,11 @@ public enum FunctionalMetadata { */ RECORD_IDENTIFIER("recordIdentifier"), + /** + * In case the metadata key shall be used as node label in the structure tree. + */ + STRUCTURE_TREE_TITLE("structureTreeTitle"), + /** * The title. It is used to form the author-title key or the title key. */ diff --git a/Kitodo/src/main/java/org/kitodo/config/enums/ParameterCore.java b/Kitodo/src/main/java/org/kitodo/config/enums/ParameterCore.java index 29ea0699e9e..bf16370eb22 100644 --- a/Kitodo/src/main/java/org/kitodo/config/enums/ParameterCore.java +++ b/Kitodo/src/main/java/org/kitodo/config/enums/ParameterCore.java @@ -317,12 +317,6 @@ public enum ParameterCore implements ParameterInterface { */ PAGE_SEPARATORS(new Parameter<>("metsEditor.pageSeparators", "\" \"")), - /** - # Priority list of metadata keys used to display title information in the metadata editors structure and gallery - panels. - */ - TITLE_KEYS(new Parameter<>("metsEditor.titleMetadata", "")), - /* * backup of metadata configuration */ diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java index 66e27669f08..9714f709b2a 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java @@ -20,6 +20,7 @@ import java.nio.file.Paths; import java.text.MessageFormat; import java.util.ArrayList; +import java.util.Collection; import java.util.HashSet; import java.util.LinkedList; import java.util.List; @@ -44,6 +45,7 @@ import org.apache.commons.lang3.tuple.Pair; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.kitodo.api.dataeditor.rulesetmanagement.FunctionalMetadata; import org.kitodo.api.dataeditor.rulesetmanagement.RulesetManagementInterface; import org.kitodo.api.dataformat.LogicalDivision; import org.kitodo.api.dataformat.PhysicalDivision; @@ -191,6 +193,12 @@ public class DataEditorForm implements MetadataTreeTableInterface, RulesetSetupI */ private int templateTaskId; + /** + * The list of metadata keys that are annotated with use="structureTreeTitle", meaning, + * they are used to generate the tree node label in case the title is requested by the user. + */ + private Collection structureTreeTitles = new ArrayList<>(); + private DataEditorSetting dataEditorSetting; private static final String DESKTOP_LINK = "/pages/desktop.jsf"; @@ -284,6 +292,7 @@ public void open(String processID, String referringView, String taskId) { String metadataLanguage = user.getMetadataLanguage(); priorityList = LanguageRange.parse(metadataLanguage.isEmpty() ? "en" : metadataLanguage); ruleset = ServiceManager.getRulesetService().openRuleset(process.getRuleset()); + this.loadStructureTreeTitlesFromRuleset(); try { mediaUpdated = openMetsFile(); } catch (MediaNotFoundException e) { @@ -337,6 +346,15 @@ private void checkProjectFolderConfiguration() { } } + private void loadStructureTreeTitlesFromRuleset() { + structureTreeTitles = getRulesetManagement().getFunctionalKeys(FunctionalMetadata.STRUCTURE_TREE_TITLE); + logger.error("structure tree titles are: " + String.join(",", structureTreeTitles)); + if (structureTreeTitles.isEmpty()) { + Locale locale = LocaleHelper.getCurrentLocale(); + Helper.setWarnMessage(Helper.getString(locale, "dataEditor.noStructureTreeTitleFoundWarning")); + } + } + private void loadDataEditorSettings() { if (templateTaskId > 0) { dataEditorSetting = ServiceManager.getDataEditorSettingService().loadDataEditorSetting(user.getId(), @@ -934,8 +952,7 @@ void unassignView(LogicalDivision logicalDivision, View view, boolean removeLast /** * Retrieve and return 'title' value of given Object 'dataObject' if Object is instance of - * 'LogicalDivision' and if it does have a title. Uses a configurable list of metadata keys to determine - * which metadata keys should be considered. + * 'LogicalDivision' and if it does have a title. * Return empty string otherwise. * * @param dataObject @@ -946,7 +963,11 @@ public String getStructureElementTitle(Object dataObject) { String title = ""; if (dataObject instanceof LogicalDivision) { LogicalDivision logicalDivision = ((LogicalDivision) dataObject); - title = DataEditorService.getTitleValue(logicalDivision, structurePanel.getTitleMetadata()); + + title = structureTreeTitles.stream() + .map((key) -> DataEditorService.getTitleValue(logicalDivision, key)) + .filter(Optional::isPresent).findFirst().get().orElse(""); + if (StringUtils.isBlank(title)) { title = logicalDivision.getLabel(); if (StringUtils.isBlank(title)) { diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/StructurePanel.java b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/StructurePanel.java index 0c55b5d313f..a40ee34d535 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/StructurePanel.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/StructurePanel.java @@ -50,7 +50,6 @@ import org.kitodo.production.metadata.MetadataEditor; import org.kitodo.production.model.Subfolder; import org.kitodo.production.services.ServiceManager; -import org.kitodo.production.services.dataeditor.DataEditorService; import org.primefaces.event.NodeCollapseEvent; import org.primefaces.event.NodeExpandEvent; import org.primefaces.event.NodeSelectEvent; @@ -1851,18 +1850,6 @@ public void setTitleMetadata(String titleMetadata) { this.titleMetadata = titleMetadata; } - /** - * Get list of metadata keys that are used for displaying title information from the Kitodo configuration file. - * @return list of title metadata keys - */ - public List getTitleMetadataItems() { - return DataEditorService.getTitleKeys() - .stream() - .map(key -> new SelectItem(key,dataEditor.getRulesetManagement().getTranslationForKey( - key,dataEditor.getPriorityList()).orElse(key))) - .collect(Collectors.toList()); - } - /** * Returns true if the logical structure tree is a combined tree of structure nodes and view nodes (media). * diff --git a/Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java b/Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java index b1ef4c23c48..a858d254de8 100644 --- a/Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java +++ b/Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java @@ -86,17 +86,6 @@ private String getXsltFolder() { return ConfigCore.getParameter(ParameterCore.DIR_XSLT); } - /** - * Retrieve and return list of metadata keys that are used for displaying title information in the metadata editors - * structure and gallery panels from the Kitodo configuration file. - * - * @return list of title metadata keys - */ - public static List getTitleKeys() { - return Arrays.stream(ConfigCore.getParameter(ParameterCore.TITLE_KEYS, "").split(",")) - .map(String::trim).collect(Collectors.toList()); - } - /** * Retrieve and return title value from given IncludedStructuralElement. * @@ -104,7 +93,7 @@ public static List getTitleKeys() { * @param metadataTitleKey as a String that its value will be displayed. * @return title value of given element */ - public static String getTitleValue(LogicalDivision element, String metadataTitleKey) { + public static Optional getTitleValue(LogicalDivision element, String metadataTitleKey) { String[] metadataPath = metadataTitleKey.split("@"); int lastIndex = metadataPath.length - 1; Collection metadata = element.getMetadata(); @@ -122,7 +111,7 @@ public static String getTitleValue(LogicalDivision element, String metadataTitle .map(MetadataEntry::getValue) .filter(value -> !value.isEmpty()) .findFirst(); - return metadataTitle.orElse(" - "); + return metadataTitle; } /** diff --git a/Kitodo/src/main/resources/kitodo_config.properties b/Kitodo/src/main/resources/kitodo_config.properties index 22b3a1f0b0a..af281c49384 100644 --- a/Kitodo/src/main/resources/kitodo_config.properties +++ b/Kitodo/src/main/resources/kitodo_config.properties @@ -289,9 +289,6 @@ metsEditor.displayFileManipulation=true # Defaults to one single white space: metsEditor.pageSeparators=" " -# Priority list of metadata keys used to display title information in the metadata editors structure and gallery panels -metsEditor.titleMetadata=TitleDocMain - #Maximum number of media to be uploaded. metsEditor.maxUploadedMedia=3 diff --git a/Kitodo/src/main/resources/messages/messages_de.properties b/Kitodo/src/main/resources/messages/messages_de.properties index 8b5d2ddeb61..8590a6a816a 100644 --- a/Kitodo/src/main/resources/messages/messages_de.properties +++ b/Kitodo/src/main/resources/messages/messages_de.properties @@ -313,6 +313,7 @@ dataEditor.saveLayout=Aktuelle Spaltenaufteilung als Standard f\u00FCr diese Auf dataEditor.mediaNotFound=Es wurden keine Medien gefunden, aber mindestens eine Dateireferenz ist vorhanden. Die automatische Entfernung der fehlenden Medien aus dem Werkst\u00FCck wurde \u00FCbersprungen. dataEditor.multipleMetadataTasksText=Sie haben mehrere Aufgaben zum Editieren von Metadaten in Bearbeitung. Bitte w\u00E4hlen Sie eine dieser Aufgaben aus! dataEditor.noParentsError=Elternelement von {0} konnte nicht gefunden werden! +dataEditor.noStructureTreeTitleFoundWarning=Es wurden keine Matadaten-Attribute als Titel-Attribute für den Strukturbaum im Ruleset angegeben (use="structureTreeTitle"). dataEditor.numberOfScans=Anzahl von Scans dataEditor.position.afterCurrentElement=Hinter das aktuelle Element dataEditor.position.asFirstChildOfCurrentElement=Als erstes Subelement des aktuellen Elementes diff --git a/Kitodo/src/main/resources/messages/messages_en.properties b/Kitodo/src/main/resources/messages/messages_en.properties index ffaabc80ab9..6528af13a14 100644 --- a/Kitodo/src/main/resources/messages/messages_en.properties +++ b/Kitodo/src/main/resources/messages/messages_en.properties @@ -313,6 +313,7 @@ dataEditor.saveLayout=Save current layout as preset for this task dataEditor.mediaNotFound=No media found, but at least one file reference is present. The automatic removal of missing media from the workpiece was skipped. dataEditor.multipleMetadataTasksText=There are multiple metadata editing tasks assigned to you for the current process. Please select the task you want to work on! dataEditor.noParentsError=No parents of structure {0} found! +dataEditor.noStructureTreeTitleFoundWarning=There are no metadata keys that are selected to be used as title attributes in the structure tree (use="structureTreeTitle"). dataEditor.numberOfScans=Number of scans dataEditor.position.afterCurrentElement=After current element dataEditor.position.asFirstChildOfCurrentElement=As first child of current element diff --git a/Kitodo/src/main/resources/messages/messages_es.properties b/Kitodo/src/main/resources/messages/messages_es.properties index 32deac1a1b6..fbfb0c97959 100644 --- a/Kitodo/src/main/resources/messages/messages_es.properties +++ b/Kitodo/src/main/resources/messages/messages_es.properties @@ -313,6 +313,8 @@ dataEditor.saveLayout=Guarda el diseño de columna actual como el predeterminado dataEditor.mediaNotFound=No se encontraron los medios, pero al menos un archivo de referencia está presente. La eleminación de los medios faltantes de la pieza de trabajo fue omitida. dataEditor.multipleMetadataTasksText=Tiene varias tareas de edición de metadatos en curso. Por favor, seleccione una de estas tareas. dataEditor.noParentsError=No se ha encontrado el elemento padre de {0}. +# please check google translation below and remove comment if translation is acceptable +dataEditor.noStructureTreeTitleFoundWarning=No hay claves de metadatos seleccionadas para usarse como atributos de título en el árbol de estructura (use="structureTreeTitle"). dataEditor.numberOfScans=Número de imágenes escaneadas dataEditor.position.afterCurrentElement=Después del elemento actual dataEditor.position.asFirstChildOfCurrentElement=Como primer subelemento del elemento actual diff --git a/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/logicalStructure.xhtml b/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/logicalStructure.xhtml index 4406dbc9572..fee79633241 100644 --- a/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/logicalStructure.xhtml +++ b/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/logicalStructure.xhtml @@ -21,8 +21,10 @@ - - + + + + @@ -123,9 +125,13 @@ value="<#{fn:length(fn:split(defaultTreeNode.rowKey, '_'))}> "/> + rendered="#{DataEditorForm.structurePanel.titleMetadata.contains('type') or logicalNode.linked}"/> + + rendered="#{DataEditorForm.structurePanel.titleMetadata.contains('title') and !logicalNode.linked}"/> + diff --git a/Kitodo/src/test/java/org/kitodo/production/services/data/DataEditorServiceIT.java b/Kitodo/src/test/java/org/kitodo/production/services/data/DataEditorServiceIT.java index 8f55ae55a21..0781bcbbbc8 100644 --- a/Kitodo/src/test/java/org/kitodo/production/services/data/DataEditorServiceIT.java +++ b/Kitodo/src/test/java/org/kitodo/production/services/data/DataEditorServiceIT.java @@ -77,16 +77,6 @@ public void removeTestProcess() throws DAOException { } } - /** - * Test retrieving title keys. - */ - @Test - public void shouldGetTitleKeys() { - List titleKeys = DataEditorService.getTitleKeys(); - assertTrue(titleKeys.contains(TITLE_DOC_MAIN), - String.format("List of title keys should contain '%s'", TITLE_DOC_MAIN)); - } - /** * Test retrieving title value. * @throws DAOException when adding test process fails. From 21330d064fe1b45ebdc11494916c1797d10678b3 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Mon, 21 Oct 2024 12:38:17 +0000 Subject: [PATCH 02/13] Add structureTreeTitle attribute to ruleset definition. --- Kitodo-DataEditor/src/test/resources/ruleset.xsd | 4 ++++ Kitodo/rulesets/ruleset.xsd | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Kitodo-DataEditor/src/test/resources/ruleset.xsd b/Kitodo-DataEditor/src/test/resources/ruleset.xsd index 012ee754c96..b465717d10e 100644 --- a/Kitodo-DataEditor/src/test/resources/ruleset.xsd +++ b/Kitodo-DataEditor/src/test/resources/ruleset.xsd @@ -465,6 +465,9 @@ 'recordIdentifier' Identifier of the data record fetched from an external data source, so that the imported metadata entries from the data source can be updated later. + 'structureTreeTitle' will be displayed as node titles of the structure tree of the metadata editor + if title is selected as the preferred display option. + 'title' This field is used as the title to form the author-title key. @@ -481,6 +484,7 @@ + diff --git a/Kitodo/rulesets/ruleset.xsd b/Kitodo/rulesets/ruleset.xsd index 012ee754c96..b465717d10e 100644 --- a/Kitodo/rulesets/ruleset.xsd +++ b/Kitodo/rulesets/ruleset.xsd @@ -465,6 +465,9 @@ 'recordIdentifier' Identifier of the data record fetched from an external data source, so that the imported metadata entries from the data source can be updated later. + 'structureTreeTitle' will be displayed as node titles of the structure tree of the metadata editor + if title is selected as the preferred display option. + 'title' This field is used as the title to form the author-title key. @@ -481,6 +484,7 @@ + From 662d3d40289f7eed64cc954ec6dd8992de89c9d4 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Mon, 21 Oct 2024 16:45:12 +0000 Subject: [PATCH 03/13] Add integration and selenium test for structureTreeTitle ruleset attribute. --- .../ruleset/RulesetManagementIT.java | 3 ++ .../testAnExtensiveRulesetCanBeLoaded.xml | 2 +- .../forms/dataeditor/DataEditorForm.java | 2 +- .../webapp/WEB-INF/resources/css/kitodo.css | 2 +- .../metadataEditor/logicalStructure.xhtml | 2 +- .../java/org/kitodo/selenium/MetadataST.java | 38 +++++++++++++++++++ .../metadataFiles/testRenameMediaMeta.xml | 13 ++++++- .../test/resources/rulesets/ruleset_test.xml | 2 +- 8 files changed, 58 insertions(+), 6 deletions(-) diff --git a/Kitodo-DataEditor/src/test/java/org/kitodo/dataeditor/ruleset/RulesetManagementIT.java b/Kitodo-DataEditor/src/test/java/org/kitodo/dataeditor/ruleset/RulesetManagementIT.java index 456425c1a6c..fefdfc340b8 100644 --- a/Kitodo-DataEditor/src/test/java/org/kitodo/dataeditor/ruleset/RulesetManagementIT.java +++ b/Kitodo-DataEditor/src/test/java/org/kitodo/dataeditor/ruleset/RulesetManagementIT.java @@ -768,6 +768,9 @@ public void testGettingOfSpecialFields() throws Exception { assertThat("Periodical was not found!", rulesetManagement.getFunctionalDivisions(FunctionalDivision.CREATE_CHILDREN_FROM_PARENT), contains("Periodical")); + assertThat("structureTreeTitle was not found!", + rulesetManagement.getFunctionalKeys(FunctionalMetadata.STRUCTURE_TREE_TITLE), + contains("LABEL")); // not existing uses assertThat("Something was found!", diff --git a/Kitodo-DataEditor/src/test/resources/testAnExtensiveRulesetCanBeLoaded.xml b/Kitodo-DataEditor/src/test/resources/testAnExtensiveRulesetCanBeLoaded.xml index 044dae712d5..82896edc871 100644 --- a/Kitodo-DataEditor/src/test/resources/testAnExtensiveRulesetCanBeLoaded.xml +++ b/Kitodo-DataEditor/src/test/resources/testAnExtensiveRulesetCanBeLoaded.xml @@ -314,7 +314,7 @@ - + diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java index 9714f709b2a..81c8ae4ee5e 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java @@ -966,7 +966,7 @@ public String getStructureElementTitle(Object dataObject) { title = structureTreeTitles.stream() .map((key) -> DataEditorService.getTitleValue(logicalDivision, key)) - .filter(Optional::isPresent).findFirst().get().orElse(""); + .filter(Optional::isPresent).map(Optional::get).findFirst().orElse(""); if (StringUtils.isBlank(title)) { title = logicalDivision.getLabel(); diff --git a/Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css b/Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css index 0af10140564..e2ece61cb6a 100644 --- a/Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css +++ b/Kitodo/src/main/webapp/WEB-INF/resources/css/kitodo.css @@ -2778,7 +2778,7 @@ Column content padding: var(--default-half-size); } -#logicalStructureHeader .logicalStructureTitle { +#logicalStructureTitle { flex-grow: 1; flex-shrink: 1; margin-right: var(--default-half-size); diff --git a/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/logicalStructure.xhtml b/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/logicalStructure.xhtml index fee79633241..80ccdb95a86 100644 --- a/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/logicalStructure.xhtml +++ b/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/logicalStructure.xhtml @@ -19,7 +19,7 @@ xmlns:fn="http://xmlns.jcp.org/jsp/jstl/functions" xmlns:p="http://primefaces.org/ui"> - diff --git a/Kitodo/src/test/java/org/kitodo/selenium/MetadataST.java b/Kitodo/src/test/java/org/kitodo/selenium/MetadataST.java index 031fc461cb4..5caaeb64fe4 100644 --- a/Kitodo/src/test/java/org/kitodo/selenium/MetadataST.java +++ b/Kitodo/src/test/java/org/kitodo/selenium/MetadataST.java @@ -353,6 +353,44 @@ public void showPhysicalPageNumberBelowThumbnailTest() throws Exception { assertFalse(Browser.getDriver().findElements(By.cssSelector(".thumbnail-banner")).isEmpty()); } + /** + * Verifies that the label of a node in the logical structure tree changes according to the + * "structureTreeTitle" option from the ruleset after switching to the "title" display option. + */ + @Test + public void selectStructureTreeTitleTest() throws Exception { + login("kowal"); + + // open the metadata editor + Pages.getProcessesPage().goTo().editMetadata(MockDatabase.MEDIA_RENAMING_TEST_PROCESS_TITLE); + + // wait until logical tree is shown + await().ignoreExceptions().pollDelay(100, TimeUnit.MILLISECONDS).atMost(5, TimeUnit.SECONDS) + .until(() -> Browser.getDriver().findElement(By.id("logicalTree")).isDisplayed()); + + // check that first tree node label shows type label "Band" + assertEquals("Band", + Browser.getDriver().findElement(By.cssSelector("#logicalTree\\:0 .ui-treenode-label")).getText()); + + // open select menu + Browser.getDriver().findElement(By.id("logicalStructureTitle")).click(); + + // wait until select menu is open + await().ignoreExceptions().pollDelay(100, TimeUnit.MILLISECONDS).atMost(5, TimeUnit.SECONDS) + .until(() -> Browser.getDriver().findElement(By.id("logicalStructureTitle_panel")).isDisplayed()); + + // click on title menu entry + Browser.getDriver().findElement(By.id("logicalStructureTitle_1")).click(); + + // wait until menu disappears + await().ignoreExceptions().pollDelay(100, TimeUnit.MILLISECONDS).atMost(5, TimeUnit.SECONDS) + .until(() -> !Browser.getDriver().findElement(By.id("logicalStructureTitle_panel")).isDisplayed()); + + // check that node title has changed to metadata value of "HauptTitel" + assertEquals("Der Titel des Bandes", + Browser.getDriver().findElement(By.cssSelector("#logicalTree\\:0 .ui-treenode-label")).getText()); + } + /** * Close metadata editor and logout after every test. * @throws Exception when page navigation fails diff --git a/Kitodo/src/test/resources/metadata/metadataFiles/testRenameMediaMeta.xml b/Kitodo/src/test/resources/metadata/metadataFiles/testRenameMediaMeta.xml index 28b98611bc1..69d62d093d1 100644 --- a/Kitodo/src/test/resources/metadata/metadataFiles/testRenameMediaMeta.xml +++ b/Kitodo/src/test/resources/metadata/metadataFiles/testRenameMediaMeta.xml @@ -23,6 +23,17 @@ + + + + + + Der Titel des Bandes + + + + + @@ -81,7 +92,7 @@ - + diff --git a/Kitodo/src/test/resources/rulesets/ruleset_test.xml b/Kitodo/src/test/resources/rulesets/ruleset_test.xml index ae346f9ce23..d3f8211b642 100644 --- a/Kitodo/src/test/resources/rulesets/ruleset_test.xml +++ b/Kitodo/src/test/resources/rulesets/ruleset_test.xml @@ -31,7 +31,7 @@ - + From 2f65773ca189681c4808806469d680a3931f6bc8 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Mon, 21 Oct 2024 17:25:39 +0000 Subject: [PATCH 04/13] Remove unnecessary log statement. --- .../org/kitodo/production/forms/dataeditor/DataEditorForm.java | 1 - 1 file changed, 1 deletion(-) diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java index 81c8ae4ee5e..decea847bea 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java @@ -348,7 +348,6 @@ private void checkProjectFolderConfiguration() { private void loadStructureTreeTitlesFromRuleset() { structureTreeTitles = getRulesetManagement().getFunctionalKeys(FunctionalMetadata.STRUCTURE_TREE_TITLE); - logger.error("structure tree titles are: " + String.join(",", structureTreeTitles)); if (structureTreeTitles.isEmpty()) { Locale locale = LocaleHelper.getCurrentLocale(); Helper.setWarnMessage(Helper.getString(locale, "dataEditor.noStructureTreeTitleFoundWarning")); From d1f90a9f47263ab37e208367d27b98e05a2937b0 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Mon, 21 Oct 2024 17:52:37 +0000 Subject: [PATCH 05/13] Add structureTreeTitle attribute to example rulesets 'subhh.xml' and 'simple-book.xml'. --- Kitodo/rulesets/simple-book.xml | 2 +- Kitodo/rulesets/subhh.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Kitodo/rulesets/simple-book.xml b/Kitodo/rulesets/simple-book.xml index ba43f82cac5..50365cddb01 100644 --- a/Kitodo/rulesets/simple-book.xml +++ b/Kitodo/rulesets/simple-book.xml @@ -36,7 +36,7 @@ - + diff --git a/Kitodo/rulesets/subhh.xml b/Kitodo/rulesets/subhh.xml index 7eb5ce2694d..ed7d23d8951 100644 --- a/Kitodo/rulesets/subhh.xml +++ b/Kitodo/rulesets/subhh.xml @@ -378,7 +378,7 @@ - + From 556f23eb4f0897dfc0fe2c74bdb3291e6a2fc5f6 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Mon, 21 Oct 2024 17:54:46 +0000 Subject: [PATCH 06/13] Refactor method to get structure tree node title as static method to fix unit test. --- .../forms/dataeditor/DataEditorForm.java | 23 ++++++++++++--- .../forms/dataeditor/StructurePanel.java | 28 +++++++++++-------- .../includes/metadataEditor/gallery.xhtml | 2 +- .../metadataEditor/logicalStructure.xhtml | 12 ++++---- .../forms/dataeditor/DataEditorFormTest.java | 9 +++--- 5 files changed, 48 insertions(+), 26 deletions(-) diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java index decea847bea..7dc0905af8a 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java @@ -950,20 +950,22 @@ void unassignView(LogicalDivision logicalDivision, View view, boolean removeLast } /** - * Retrieve and return 'title' value of given Object 'dataObject' if Object is instance of - * 'LogicalDivision' and if it does have a title. + * Retrieve and return title of dataObject if it is a 'LogicalDivision' and if it has a title. + * Uses metadata value as title if one of the provided keys exists. * Return empty string otherwise. * * @param dataObject * StructureTreeNode containing the LogicalDivision whose title is returned + * @param metadataKeys + * the list of metadata keys that are annotated with "structureTreeTitle" * @return 'title' value of the LogicalDivision contained in the given StructureTreeNode 'treeNode' */ - public String getStructureElementTitle(Object dataObject) { + public static String getStructureElementTitle(Object dataObject, Collection metadataKeys) { String title = ""; if (dataObject instanceof LogicalDivision) { LogicalDivision logicalDivision = ((LogicalDivision) dataObject); - title = structureTreeTitles.stream() + title = metadataKeys.stream() .map((key) -> DataEditorService.getTitleValue(logicalDivision, key)) .filter(Optional::isPresent).map(Optional::get).findFirst().orElse(""); @@ -977,6 +979,19 @@ public String getStructureElementTitle(Object dataObject) { return title; } + /** + * Retrieve and return title of dataObject if it is a 'LogicalDivision' and if it has a title. + * Uses metadata value as title if one of the provided keys exists. + * Return empty string otherwise. + * + * @param dataObject + * StructureTreeNode containing the LogicalDivision whose title is returned + * @return 'title' value of the LogicalDivision contained in the given StructureTreeNode 'treeNode' + */ + public String getStructureElementTitle(Object dataObject) { + return DataEditorForm.getStructureElementTitle(dataObject, structureTreeTitles); + } + /** * Get referringView. * diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/StructurePanel.java b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/StructurePanel.java index a40ee34d535..138f598d1b0 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/StructurePanel.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/StructurePanel.java @@ -15,6 +15,7 @@ import java.io.Serializable; import java.net.URI; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Comparator; @@ -30,8 +31,6 @@ import java.util.Set; import java.util.stream.Collectors; -import javax.faces.model.SelectItem; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; import org.apache.logging.log4j.LogManager; @@ -125,7 +124,11 @@ public class StructurePanel implements Serializable { */ private String activeTabs; - private String titleMetadata = "type"; + /** + * Stores the users choice of the drop down selection above the logical structure tree. Can be either "type" + * (default), "title" (uses metadata key annotated with "structureTreeTitle" in ruleset) or "type+title". + */ + private String nodeLabelOption = "type"; /** * Determines whether the logical tree is built as a combination of physical media nodes and @@ -1835,19 +1838,22 @@ public void unassign() { } /** - * Get title metadata. - * @return value of titleMetadata + * Get the node label option (either "type", "title" or "type+title") + * @return value of node label option */ - public String getTitleMetadata() { - return titleMetadata; + public String getNodeLabelOption() { + return nodeLabelOption; } /** - * Set title metadata. - * @param titleMetadata as java.lang.String + * Set node label option. + * @param nodeLabelOption as java.lang.String */ - public void setTitleMetadata(String titleMetadata) { - this.titleMetadata = titleMetadata; + public void setNodeLabelOption(String nodeLabelOption) { + if(!Arrays.asList("type", "title", "type+title").contains(nodeLabelOption)) { + throw new IllegalArgumentException("node label option must be either type, title or type+title"); + } + this.nodeLabelOption = nodeLabelOption; } /** diff --git a/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/gallery.xhtml b/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/gallery.xhtml index 963816c6116..28de6669ecf 100644 --- a/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/gallery.xhtml +++ b/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/gallery.xhtml @@ -87,7 +87,7 @@ styleClass="pageList" binding="#{currentElement}"> - - @@ -125,13 +125,13 @@ value="<#{fn:length(fn:split(defaultTreeNode.rowKey, '_'))}> "/> + rendered="#{DataEditorForm.structurePanel.nodeLabelOption.contains('type') or logicalNode.linked}"/> + rendered="#{DataEditorForm.structurePanel.nodeLabelOption.contains('+') and !logicalNode.linked}" /> + rendered="#{DataEditorForm.structurePanel.nodeLabelOption.contains('title') and !logicalNode.linked}"/> + rendered="#{DataEditorForm.structurePanel.nodeLabelOption.contains('count') and !logicalNode.linked}"/> --> @@ -148,7 +148,7 @@ icon="ui-icon-media-partial"> + rendered="#{DataEditorForm.structurePanel.nodeLabelOption eq 'type'}"/> diff --git a/Kitodo/src/test/java/org/kitodo/production/forms/dataeditor/DataEditorFormTest.java b/Kitodo/src/test/java/org/kitodo/production/forms/dataeditor/DataEditorFormTest.java index c83d90dabff..81acba322d8 100644 --- a/Kitodo/src/test/java/org/kitodo/production/forms/dataeditor/DataEditorFormTest.java +++ b/Kitodo/src/test/java/org/kitodo/production/forms/dataeditor/DataEditorFormTest.java @@ -15,6 +15,8 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import java.util.Arrays; +import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.Objects; @@ -73,16 +75,15 @@ public void shouldCheckIfMediaIsSelected() { */ @Test public void shouldGetStructuralElementTitle() { - // configure data editor form - DataEditorForm dataEditorForm = new DataEditorForm(); - dataEditorForm.getStructurePanel().setTitleMetadata(TITLE_METADATA_KEY); + // define which metadata keys to use as title + Collection metadataKeys = Arrays.asList(TITLE_METADATA_KEY); // prepare test structure LogicalDivision structure = new LogicalDivision(); MetadataEntry titleMetadata = new MetadataEntry(); titleMetadata.setKey(TITLE_METADATA_KEY); titleMetadata.setValue(TITLE_METADATA); structure.getMetadata().add(titleMetadata); - assertEquals(TITLE_METADATA, dataEditorForm.getStructureElementTitle(structure), + assertEquals(TITLE_METADATA, DataEditorForm.getStructureElementTitle(structure, metadataKeys), "Wrong title metadata value retrieved from structure element"); } From 642ce5c606747612b9f2391c280ef8512f339404 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Mon, 21 Oct 2024 17:58:58 +0000 Subject: [PATCH 07/13] Fix checkstyle issues. --- .../kitodo/production/forms/dataeditor/StructurePanel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/StructurePanel.java b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/StructurePanel.java index 138f598d1b0..9829d727a61 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/StructurePanel.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/StructurePanel.java @@ -1838,7 +1838,7 @@ public void unassign() { } /** - * Get the node label option (either "type", "title" or "type+title") + * Get the node label option (either "type", "title" or "type+title"). * @return value of node label option */ public String getNodeLabelOption() { @@ -1850,7 +1850,7 @@ public String getNodeLabelOption() { * @param nodeLabelOption as java.lang.String */ public void setNodeLabelOption(String nodeLabelOption) { - if(!Arrays.asList("type", "title", "type+title").contains(nodeLabelOption)) { + if (!Arrays.asList("type", "title", "type+title").contains(nodeLabelOption)) { throw new IllegalArgumentException("node label option must be either type, title or type+title"); } this.nodeLabelOption = nodeLabelOption; From 510f9a311303801f448f34a743cdba0008ec0d74 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Mon, 21 Oct 2024 18:15:41 +0000 Subject: [PATCH 08/13] Fix integration test DataEditorServiceIT.shouldGetTitleValue. --- .../production/forms/dataeditor/DataEditorForm.java | 2 +- .../services/dataeditor/DataEditorService.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java index 7dc0905af8a..f9d09fb9cb1 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java @@ -967,7 +967,7 @@ public static String getStructureElementTitle(Object dataObject, Collection DataEditorService.getTitleValue(logicalDivision, key)) - .filter(Optional::isPresent).map(Optional::get).findFirst().orElse(""); + .filter((t) -> !t.isEmpty()).findFirst().orElse(""); if (StringUtils.isBlank(title)) { title = logicalDivision.getLabel(); diff --git a/Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java b/Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java index a858d254de8..0a0e27fa1a5 100644 --- a/Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java +++ b/Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java @@ -15,7 +15,6 @@ import java.net.URI; import java.nio.file.Paths; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Comparator; @@ -91,9 +90,9 @@ private String getXsltFolder() { * * @param element IncludedStructuralElement for which the title value is returned. * @param metadataTitleKey as a String that its value will be displayed. - * @return title value of given element + * @return title value of given element or an empty string */ - public static Optional getTitleValue(LogicalDivision element, String metadataTitleKey) { + public static String getTitleValue(LogicalDivision element, String metadataTitleKey) { String[] metadataPath = metadataTitleKey.split("@"); int lastIndex = metadataPath.length - 1; Collection metadata = element.getMetadata(); @@ -105,12 +104,13 @@ public static Optional getTitleValue(LogicalDivision element, String met .flatMap(metadataGroup -> metadataGroup.getMetadata().stream()) .collect(Collectors.toList()); } - Optional metadataTitle = metadata.stream() + String metadataTitle = metadata.stream() .filter(currentMetadata -> Objects.equals(currentMetadata.getKey(), metadataPath[lastIndex])) .filter(MetadataEntry.class::isInstance).map(MetadataEntry.class::cast) .map(MetadataEntry::getValue) .filter(value -> !value.isEmpty()) - .findFirst(); + .findFirst() + .orElse(""); return metadataTitle; } From 03afb90e981183ee1255c23c644cd5a50bbd4fe8 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Wed, 30 Oct 2024 11:07:08 +0000 Subject: [PATCH 09/13] Gallery stripe labels consider the node label option of the structure tree and show the same label. --- .../templates/includes/metadataEditor/gallery.xhtml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/gallery.xhtml b/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/gallery.xhtml index 28de6669ecf..5512feda1c7 100644 --- a/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/gallery.xhtml +++ b/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/gallery.xhtml @@ -87,11 +87,17 @@ styleClass="pageList" binding="#{currentElement}"> - + rendered="#{DataEditorForm.galleryPanel.stripes.indexOf(stripe) ne 0}"> + + + + Date: Tue, 5 Nov 2024 11:35:06 +0000 Subject: [PATCH 10/13] Fix checkstyle issue. --- .../org/kitodo/production/forms/dataeditor/DataEditorForm.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java index 26e9dbece7c..1aa60f686ec 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java @@ -45,8 +45,8 @@ import org.apache.commons.lang3.tuple.Pair; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.kitodo.api.dataeditor.rulesetmanagement.FunctionalMetadata; import org.kitodo.api.MetadataGroup; +import org.kitodo.api.dataeditor.rulesetmanagement.FunctionalMetadata; import org.kitodo.api.dataeditor.rulesetmanagement.RulesetManagementInterface; import org.kitodo.api.dataformat.LogicalDivision; import org.kitodo.api.dataformat.PhysicalDivision; From 4245b4a5bea837315d540c53eee40fa16a3a154f Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 5 Nov 2024 11:43:38 +0000 Subject: [PATCH 11/13] Fix checkstyle issue. --- .../org/kitodo/production/forms/dataeditor/DataEditorForm.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java index 1aa60f686ec..fb64e70134d 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/DataEditorForm.java @@ -1155,7 +1155,7 @@ public void updateNumberOfScans() { */ public void saveDataEditorSetting() { if (Objects.nonNull(dataEditorSetting)) { - if (Objects.nonNull(templateTask) && !templateTask.getId().equals(dataEditorSetting.getTaskId())) { + if (Objects.nonNull(templateTask) && !templateTask.getId().equals(dataEditorSetting.getTaskId())) { // create a copy of the task-independent configuration // in case the user wants to save it as task-specific config dataEditorSetting = new DataEditorSetting(dataEditorSetting); From 89c93833b4a2e20880ca103e622bd6da8d59a61e Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Tue, 5 Nov 2024 12:41:15 +0000 Subject: [PATCH 12/13] Fix id of select menu to change label in structure tree of metadata editor. --- .../templates/includes/metadataEditor/logicalStructure.xhtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/logicalStructure.xhtml b/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/logicalStructure.xhtml index e4c1618f631..0eca44db2a4 100644 --- a/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/logicalStructure.xhtml +++ b/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/logicalStructure.xhtml @@ -20,7 +20,7 @@ xmlns:p="http://primefaces.org/ui"> - From 195855c739a09722e704707b8a4e8d766e40eca0 Mon Sep 17 00:00:00 2001 From: Thomas Low Date: Fri, 15 Nov 2024 11:58:41 +0000 Subject: [PATCH 13/13] Include pull request feedback. --- .../production/services/dataeditor/DataEditorService.java | 3 +-- .../templates/includes/metadataEditor/logicalStructure.xhtml | 3 --- .../kitodo/production/forms/dataeditor/DataEditorFormTest.java | 3 +-- Kitodo/src/test/resources/kitodo_config.properties | 1 - 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java b/Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java index 636c87c2556..6538efc8b61 100644 --- a/Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java +++ b/Kitodo/src/main/java/org/kitodo/production/services/dataeditor/DataEditorService.java @@ -131,14 +131,13 @@ public static String getTitleValue(LogicalDivision element, String metadataTitle .flatMap(metadataGroup -> metadataGroup.getMetadata().stream()) .collect(Collectors.toList()); } - String metadataTitle = metadata.stream() + return metadata.stream() .filter(currentMetadata -> Objects.equals(currentMetadata.getKey(), metadataPath[lastIndex])) .filter(MetadataEntry.class::isInstance).map(MetadataEntry.class::cast) .map(MetadataEntry::getValue) .filter(value -> !value.isEmpty()) .findFirst() .orElse(""); - return metadataTitle; } /** diff --git a/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/logicalStructure.xhtml b/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/logicalStructure.xhtml index d89470ddaa8..5339212ce60 100644 --- a/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/logicalStructure.xhtml +++ b/Kitodo/src/main/webapp/WEB-INF/templates/includes/metadataEditor/logicalStructure.xhtml @@ -25,7 +25,6 @@ - @@ -132,8 +131,6 @@ rendered="#{DataEditorForm.structurePanel.nodeLabelOption.contains('+') and !logicalNode.linked}" /> - diff --git a/Kitodo/src/test/java/org/kitodo/production/forms/dataeditor/DataEditorFormTest.java b/Kitodo/src/test/java/org/kitodo/production/forms/dataeditor/DataEditorFormTest.java index 81acba322d8..cd275e21c1d 100644 --- a/Kitodo/src/test/java/org/kitodo/production/forms/dataeditor/DataEditorFormTest.java +++ b/Kitodo/src/test/java/org/kitodo/production/forms/dataeditor/DataEditorFormTest.java @@ -15,7 +15,6 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -import java.util.Arrays; import java.util.Collection; import java.util.LinkedList; import java.util.List; @@ -76,7 +75,7 @@ public void shouldCheckIfMediaIsSelected() { @Test public void shouldGetStructuralElementTitle() { // define which metadata keys to use as title - Collection metadataKeys = Arrays.asList(TITLE_METADATA_KEY); + Collection metadataKeys = List.of(TITLE_METADATA_KEY); // prepare test structure LogicalDivision structure = new LogicalDivision(); MetadataEntry titleMetadata = new MetadataEntry(); diff --git a/Kitodo/src/test/resources/kitodo_config.properties b/Kitodo/src/test/resources/kitodo_config.properties index 7c6bdbfa4a3..fdd97355e43 100644 --- a/Kitodo/src/test/resources/kitodo_config.properties +++ b/Kitodo/src/test/resources/kitodo_config.properties @@ -39,7 +39,6 @@ metadataLanguage.list=Deutsch-de&English-en # ----------------------------------- # backup of metadata configuration # ----------------------------------- -metsEditor.titleMetadata=TitleDocMain numberOfMetaBackups=2 directory.modules=modules/ elasticsearch.port=9205