From df7f36fa0a0a4df304273c8b1b0b5e67010d86a9 Mon Sep 17 00:00:00 2001 From: Dominick Leppich Date: Thu, 24 Oct 2024 14:55:58 +0200 Subject: [PATCH 1/3] version: set to version 1.1.5-SNAPSHOT --- module-core/pom.xml | 4 ++-- module-exchange/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module-core/pom.xml b/module-core/pom.xml index d5f656f..c841f79 100644 --- a/module-core/pom.xml +++ b/module-core/pom.xml @@ -10,7 +10,7 @@ io.goobi.vocabulary vocabulary-server-core - 1.1.4 + 1.1.5-SNAPSHOT Vocabulary-Server-Core Spring Boot based RESTful web service for vocabulary management jar @@ -26,7 +26,7 @@ io.goobi.vocabulary vocabulary-server-exchange - 1.1.4 + 1.1.5-SNAPSHOT compile diff --git a/module-exchange/pom.xml b/module-exchange/pom.xml index 9bfc74b..0e40dde 100644 --- a/module-exchange/pom.xml +++ b/module-exchange/pom.xml @@ -4,7 +4,7 @@ 4.0.0 io.goobi.vocabulary vocabulary-server-exchange - 1.1.4 + 1.1.5-SNAPSHOT Vocabulary Exchange Vocabulary data exchange classes jar diff --git a/pom.xml b/pom.xml index 869d41e..df26e74 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 io.goobi.vocabulary vocabulary-server - 1.1.4 + 1.1.5-SNAPSHOT Vocabulary-Server pom RESTful webservice for vocabulary management From e2ae422847c785e3022631570daa42a4b269372a Mon Sep 17 00:00:00 2001 From: Dominick Leppich Date: Thu, 24 Oct 2024 15:37:09 +0200 Subject: [PATCH 2/3] fix: title fields don't need to be required --- migration/lib/data/field_definition.py | 2 -- .../validation/SchemaValidatorImpl.java | 15 --------------- .../validation/SchemaValidationTests.java | 16 ---------------- 3 files changed, 33 deletions(-) diff --git a/migration/lib/data/field_definition.py b/migration/lib/data/field_definition.py index ef0556d..a4852bc 100644 --- a/migration/lib/data/field_definition.py +++ b/migration/lib/data/field_definition.py @@ -69,8 +69,6 @@ def post_process(self, fallback_language): logging.warning(f'Fallback language {fallback_language} is not defined for field definition:\n{self.__str__()}') fallback_translations[0]['fallback'] = True fallback_translations[0]['required'] = True - if self['titleField']: - self['required'] = True if self['mainEntry']: self['required'] = True diff --git a/module-core/src/main/java/io/goobi/vocabulary/validation/SchemaValidatorImpl.java b/module-core/src/main/java/io/goobi/vocabulary/validation/SchemaValidatorImpl.java index 2039345..ae531bb 100644 --- a/module-core/src/main/java/io/goobi/vocabulary/validation/SchemaValidatorImpl.java +++ b/module-core/src/main/java/io/goobi/vocabulary/validation/SchemaValidatorImpl.java @@ -28,7 +28,6 @@ public SchemaValidatorImpl(Validator fieldDefinitionValid this::checkFieldDefinitionExistence, this::checkSingleMainFieldDefinition, this::checkMainFieldIsRequired, - this::checkTitleFieldsAreRequired, this::perFieldDefinitionChecks )); } @@ -70,20 +69,6 @@ private void checkMainFieldIsRequired(VocabularySchemaEntity schema) throws Voca } } - private void checkTitleFieldsAreRequired(VocabularySchemaEntity schema) throws VocabularyException { - List titleFieldsThatAreNotRequired = schema.getDefinitions().stream() - .filter(d -> Boolean.TRUE.equals(d.isTitleField())) - .filter(d -> Boolean.FALSE.equals(d.isRequired())) - .map(FieldDefinitionEntity::getName) - .collect(Collectors.toList()); - if (!titleFieldsThatAreNotRequired.isEmpty()) { - throw new VocabularyException(SchemaValidationTitleFieldsAreNotRequired, null, Map.of( - "titleFieldNames", String.join(",", titleFieldsThatAreNotRequired) - ), - params -> "Title fields need to be required: " + params.get("titleFieldNames")); - } - } - private void perFieldDefinitionChecks(VocabularySchemaEntity schema) throws VocabularyException { List errors = new LinkedList<>(); for (FieldDefinitionEntity d : schema.getDefinitions()) { diff --git a/module-core/src/test/java/io/goobi/vocabulary/validation/SchemaValidationTests.java b/module-core/src/test/java/io/goobi/vocabulary/validation/SchemaValidationTests.java index 0beb144..6456143 100644 --- a/module-core/src/test/java/io/goobi/vocabulary/validation/SchemaValidationTests.java +++ b/module-core/src/test/java/io/goobi/vocabulary/validation/SchemaValidationTests.java @@ -92,22 +92,6 @@ void exactlyOneMainFieldDefinitionThatIsNotRequired_fails() { assertThrows(VocabularyException.class, () -> validator.validate(schema)); } - @Test - void titleFieldsThatIsNotRequired_fails() { - VocabularySchemaEntity schema = new VocabularySchemaEntity(); - - FieldDefinitionEntity mainEntryField = validMainField(schema, "Main"); - FieldDefinitionEntity titleField = new FieldDefinitionEntity(); - titleField.setSchema(schema); - titleField.setName("Title"); - titleField.setTitleField(true); - titleField.setRequired(false); - - schema.setDefinitions(List.of(mainEntryField, titleField)); - - assertThrows(VocabularyException.class, () -> validator.validate(schema)); - } - @Test void titleFieldsThatIsRequired_success() throws VocabularyException { VocabularySchemaEntity schema = new VocabularySchemaEntity(); From d21701ec1d5cdbed2f1e4cff3aaafc2ce0a37b4f Mon Sep 17 00:00:00 2001 From: Dominick Leppich Date: Thu, 24 Oct 2024 15:38:48 +0200 Subject: [PATCH 3/3] version: set to version 1.1.5 --- module-core/pom.xml | 4 ++-- module-exchange/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module-core/pom.xml b/module-core/pom.xml index c841f79..4b336c6 100644 --- a/module-core/pom.xml +++ b/module-core/pom.xml @@ -10,7 +10,7 @@ io.goobi.vocabulary vocabulary-server-core - 1.1.5-SNAPSHOT + 1.1.5 Vocabulary-Server-Core Spring Boot based RESTful web service for vocabulary management jar @@ -26,7 +26,7 @@ io.goobi.vocabulary vocabulary-server-exchange - 1.1.5-SNAPSHOT + 1.1.5 compile diff --git a/module-exchange/pom.xml b/module-exchange/pom.xml index 0e40dde..16803a7 100644 --- a/module-exchange/pom.xml +++ b/module-exchange/pom.xml @@ -4,7 +4,7 @@ 4.0.0 io.goobi.vocabulary vocabulary-server-exchange - 1.1.5-SNAPSHOT + 1.1.5 Vocabulary Exchange Vocabulary data exchange classes jar diff --git a/pom.xml b/pom.xml index df26e74..ccb544d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 io.goobi.vocabulary vocabulary-server - 1.1.5-SNAPSHOT + 1.1.5 Vocabulary-Server pom RESTful webservice for vocabulary management