From 6665e105dd072bf2553f4d37f4102903805d8800 Mon Sep 17 00:00:00 2001 From: Release-Tool Date: Wed, 10 Jul 2024 12:49:44 +0200 Subject: [PATCH 1/7] Change project version to 24.07-SNAPSHOT --- module-base/pom.xml | 2 +- module-gui/pom.xml | 2 +- module-lib/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module-base/pom.xml b/module-base/pom.xml index 07e3e0f..64134a9 100644 --- a/module-base/pom.xml +++ b/module-base/pom.xml @@ -3,7 +3,7 @@ io.goobi.workflow.plugin plugin-dashboard-delivery - 24.06 + 24.07-SNAPSHOT plugin-dashboard-delivery-base jar diff --git a/module-gui/pom.xml b/module-gui/pom.xml index 128c8f7..49431d5 100644 --- a/module-gui/pom.xml +++ b/module-gui/pom.xml @@ -3,7 +3,7 @@ io.goobi.workflow.plugin plugin-dashboard-delivery - 24.06 + 24.07-SNAPSHOT plugin-dashboard-delivery-gui jar diff --git a/module-lib/pom.xml b/module-lib/pom.xml index bc00f27..2a0e0c9 100644 --- a/module-lib/pom.xml +++ b/module-lib/pom.xml @@ -3,7 +3,7 @@ io.goobi.workflow.plugin plugin-dashboard-delivery - 24.06 + 24.07-SNAPSHOT plugin-dashboard-delivery-lib \ No newline at end of file diff --git a/pom.xml b/pom.xml index fceb4e8..1337ffb 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ io.goobi.workflow workflow-base - 24.06 + 24.07-SNAPSHOT io.goobi.workflow.plugin From 88719c4356d66cf6da425c7d632021a5383a0486 Mon Sep 17 00:00:00 2001 From: Dominick Leppich Date: Thu, 4 Jul 2024 09:26:28 +0200 Subject: [PATCH 2/7] fix: vocabulary rework --- .../plugin_intranda_dashboard_delivery.xml | 2 - .../java/de/intranda/beans/DeliveryBean.java | 4 - .../goobi/plugins/utils/MetadataField.java | 100 ++++++++++-------- 3 files changed, 55 insertions(+), 51 deletions(-) diff --git a/install/plugin_intranda_dashboard_delivery.xml b/install/plugin_intranda_dashboard_delivery.xml index 9a10b44..6fd6543 100644 --- a/install/plugin_intranda_dashboard_delivery.xml +++ b/install/plugin_intranda_dashboard_delivery.xml @@ -24,8 +24,6 @@ Datenablieferung - - https://example.com/vocabulary/records/ diff --git a/module-lib/src/main/java/de/intranda/beans/DeliveryBean.java b/module-lib/src/main/java/de/intranda/beans/DeliveryBean.java index ac1af80..4fd033c 100644 --- a/module-lib/src/main/java/de/intranda/beans/DeliveryBean.java +++ b/module-lib/src/main/java/de/intranda/beans/DeliveryBean.java @@ -95,8 +95,6 @@ public class DeliveryBean implements Serializable { private static final String NEWLINE = "
"; private static final String COLON = ": "; - public static String vocabularyUrl; //NOSONAR - @Getter @Setter private String focusField; @@ -226,8 +224,6 @@ private void readConfiguration() { metadataDisplayList = Arrays.asList(config.getStringArray("/metadata")); - vocabularyUrl = config.getString("/vocabularyServerUrl"); //NOSONAR - monographicDocType = config.getString("/doctypes/monographic", "Monograph"); zdbTitleDocType = config.getString("/doctypes/zdbRecordType", "ZdbTitle"); journalDocType = config.getString("/doctypes/journalType", "Periodical"); diff --git a/module-lib/src/main/java/de/intranda/goobi/plugins/utils/MetadataField.java b/module-lib/src/main/java/de/intranda/goobi/plugins/utils/MetadataField.java index 91ca59b..a749885 100644 --- a/module-lib/src/main/java/de/intranda/goobi/plugins/utils/MetadataField.java +++ b/module-lib/src/main/java/de/intranda/goobi/plugins/utils/MetadataField.java @@ -1,28 +1,28 @@ package de.intranda.goobi.plugins.utils; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; +import io.goobi.vocabulary.exchange.FieldDefinition; +import io.goobi.vocabulary.exchange.Vocabulary; +import io.goobi.vocabulary.exchange.VocabularySchema; +import io.goobi.workflow.api.vocabulary.VocabularyAPIManager; +import io.goobi.workflow.api.vocabulary.jsfwrapper.JSFVocabularyRecord; +import lombok.Data; +import lombok.extern.java.Log; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.validator.routines.checkdigit.EAN13CheckDigit; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.model.SelectItem; - -import org.apache.commons.lang.StringUtils; -import org.apache.commons.validator.routines.checkdigit.EAN13CheckDigit; -import org.goobi.vocabulary.Field; -import org.goobi.vocabulary.VocabRecord; -import org.goobi.vocabulary.Vocabulary; - -import de.intranda.beans.DeliveryBean; -import de.sub.goobi.persistence.managers.VocabularyManager; -import lombok.Data; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; @Data +@Log public class MetadataField implements Serializable { - private static final long serialVersionUID = -2601314844043091136L; + private String rulesetName; // ruleset name private String label; // display name in UI private String displayType; // input, textarea, dropdown, person, corporate, picklist @@ -42,8 +42,9 @@ public class MetadataField implements Serializable { private List selectList = new ArrayList<>(); // list of selectable values - private List vocabList = new ArrayList<>(); // list of selectable values + private List vocabularyRecords = new ArrayList<>(); // list of selectable values + private final VocabularyAPIManager vocabularyAPIManager = VocabularyAPIManager.getInstance(); private String vocabularyName; private String vocabularyDisplayField; private String vocabularyImportField; @@ -101,30 +102,41 @@ public void setVocabulary(String name, String displayField, String importFied) { vocabularyDisplayField = displayField; vocabularyImportField = importFied; - Vocabulary currentVocabulary = VocabularyManager.getVocabularyByTitle(vocabularyName); - vocabularyUrl = DeliveryBean.vocabularyUrl + currentVocabulary.getId(); - VocabularyManager.getAllRecords(currentVocabulary); - vocabList = currentVocabulary.getRecords(); - Collections.sort(vocabList); - selectList = new ArrayList<>(vocabList.size()); - if (currentVocabulary.getId() != null) { - for (VocabRecord vr : vocabList) { - String val = null; - String lab = null; - - for (Field f : vr.getFields()) { - if ((StringUtils.isBlank(vocabularyDisplayField) && f.getDefinition().isMainEntry()) - || f.getDefinition().getLabel().equals(vocabularyDisplayField)) { - lab = f.getValue(); - } - if (f.getDefinition().getLabel().equals(vocabularyImportField)) { - val = f.getValue(); - } - } - if (StringUtils.isNotBlank(val)) { - selectList.add(new SelectItem(val, lab)); - } + Vocabulary vocabulary = vocabularyAPIManager.vocabularies().findByName(vocabularyName); + VocabularySchema schema = vocabularyAPIManager.vocabularySchemas().get(vocabulary.getSchemaId()); + vocabularyUrl = vocabulary.get_links().get("self").getHref(); + vocabularyRecords = vocabularyAPIManager.vocabularyRecords().all(vocabulary.getId()); + + Optional displayFieldDefinition = Optional.empty(); + if (!StringUtils.isBlank(vocabularyDisplayField)) { + displayFieldDefinition = schema.getDefinitions().stream() + .filter(d -> d.getName().equals(vocabularyDisplayField)) + .findFirst(); + if (displayFieldDefinition.isEmpty()) { + log.warning("Vocabulary display field \"" + vocabularyDisplayField + "\" not present in vocabulary \"" + vocabularyName + "\""); + } + } + Optional importFieldDefinition = schema.getDefinitions().stream() + .filter(d -> d.getName().equals(vocabularyImportField)) + .findFirst(); + if (importFieldDefinition.isEmpty()) { + log.warning("Vocabulary import field \"" + vocabularyImportField + "\" not present in vocabulary \"" + vocabularyName + "\""); + return; + } + + selectList = new ArrayList<>(vocabularyRecords.size()); + for (JSFVocabularyRecord vr : vocabularyRecords) { + String label = vr.getMainValue(); + if (displayFieldDefinition.isPresent()) { + label = vr.getFieldValue(displayFieldDefinition.get()); + } + + String value = vr.getFieldValue(importFieldDefinition.get()); + + // This should never be blank, but let's stay safe + if (StringUtils.isNotBlank(value)) { + selectList.add(new SelectItem(value, label)); } } } @@ -214,9 +226,7 @@ public void validateField(FacesContext context, UIComponent comp, Object obj) { if (required) { fieldValid = false; } - } - - else if (StringUtils.isNotBlank(testValue) && StringUtils.isNotBlank(validationExpression) && !testValue.matches(validationExpression)) { + } else if (StringUtils.isNotBlank(testValue) && StringUtils.isNotBlank(validationExpression) && !testValue.matches(validationExpression)) { fieldValid = false; } } @@ -315,7 +325,7 @@ private String validateContent(String role, String value) { /* * Validate, if the given string is a valid identifier - * + * * Algorithm: * remove optional hyphens * Take all but the last digits of the identifier @@ -325,7 +335,7 @@ private String validateContent(String role, String value) { * Divide this sum by the modulus 11 * Substract the remainder from 11 * Compare the remainder with the most right position. If the remainder is 10, expect 'X' or 'x' - * + * */ public static boolean validateIdentifier(String value) { @@ -357,7 +367,7 @@ public MetadataField cloneField() { mf.setSelectList(selectList); mf.setValidationErrorText(validationErrorText); mf.setValidationExpression(validationExpression); - mf.setVocabList(vocabList); + mf.setVocabularyRecords(vocabularyRecords); mf.setVocabularyDisplayField(vocabularyDisplayField); mf.setVocabularyImportField(vocabularyImportField); mf.setVocabularyName(vocabularyName); From c46433acab86ec38de7a3e68f498ead6c2e091c4 Mon Sep 17 00:00:00 2001 From: Dominick Leppich Date: Tue, 30 Jul 2024 10:37:57 +0200 Subject: [PATCH 3/7] fix: adapt to vocabulary core API changes --- .../goobi/plugins/utils/MetadataField.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/module-lib/src/main/java/de/intranda/goobi/plugins/utils/MetadataField.java b/module-lib/src/main/java/de/intranda/goobi/plugins/utils/MetadataField.java index a749885..cb10c93 100644 --- a/module-lib/src/main/java/de/intranda/goobi/plugins/utils/MetadataField.java +++ b/module-lib/src/main/java/de/intranda/goobi/plugins/utils/MetadataField.java @@ -4,7 +4,7 @@ import io.goobi.vocabulary.exchange.Vocabulary; import io.goobi.vocabulary.exchange.VocabularySchema; import io.goobi.workflow.api.vocabulary.VocabularyAPIManager; -import io.goobi.workflow.api.vocabulary.jsfwrapper.JSFVocabularyRecord; +import io.goobi.workflow.api.vocabulary.helper.ExtendedVocabularyRecord; import lombok.Data; import lombok.extern.java.Log; import org.apache.commons.lang.StringUtils; @@ -42,7 +42,7 @@ public class MetadataField implements Serializable { private List selectList = new ArrayList<>(); // list of selectable values - private List vocabularyRecords = new ArrayList<>(); // list of selectable values + private List vocabularyRecords = new ArrayList<>(); // list of selectable values private final VocabularyAPIManager vocabularyAPIManager = VocabularyAPIManager.getInstance(); private String vocabularyName; @@ -105,7 +105,11 @@ public void setVocabulary(String name, String displayField, String importFied) { Vocabulary vocabulary = vocabularyAPIManager.vocabularies().findByName(vocabularyName); VocabularySchema schema = vocabularyAPIManager.vocabularySchemas().get(vocabulary.getSchemaId()); vocabularyUrl = vocabulary.get_links().get("self").getHref(); - vocabularyRecords = vocabularyAPIManager.vocabularyRecords().all(vocabulary.getId()); + vocabularyRecords = vocabularyAPIManager.vocabularyRecords() + .list(vocabulary.getId()) + .all() + .request() + .getContent(); Optional displayFieldDefinition = Optional.empty(); if (!StringUtils.isBlank(vocabularyDisplayField)) { @@ -126,13 +130,13 @@ public void setVocabulary(String name, String displayField, String importFied) { selectList = new ArrayList<>(vocabularyRecords.size()); - for (JSFVocabularyRecord vr : vocabularyRecords) { + for (ExtendedVocabularyRecord vr : vocabularyRecords) { String label = vr.getMainValue(); if (displayFieldDefinition.isPresent()) { - label = vr.getFieldValue(displayFieldDefinition.get()); + label = vr.getFieldValueForDefinition(displayFieldDefinition.get()); } - String value = vr.getFieldValue(importFieldDefinition.get()); + String value = vr.getFieldValueForDefinition(importFieldDefinition.get()); // This should never be blank, but let's stay safe if (StringUtils.isNotBlank(value)) { From b9a352b6a116bf1233f258feebe97dd730aad78e Mon Sep 17 00:00:00 2001 From: Dominick Leppich Date: Tue, 30 Jul 2024 10:59:36 +0200 Subject: [PATCH 4/7] fix: adapt to vocabulary core API changes --- .../java/de/intranda/goobi/plugins/utils/MetadataField.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module-lib/src/main/java/de/intranda/goobi/plugins/utils/MetadataField.java b/module-lib/src/main/java/de/intranda/goobi/plugins/utils/MetadataField.java index cb10c93..6cca833 100644 --- a/module-lib/src/main/java/de/intranda/goobi/plugins/utils/MetadataField.java +++ b/module-lib/src/main/java/de/intranda/goobi/plugins/utils/MetadataField.java @@ -133,10 +133,10 @@ public void setVocabulary(String name, String displayField, String importFied) { for (ExtendedVocabularyRecord vr : vocabularyRecords) { String label = vr.getMainValue(); if (displayFieldDefinition.isPresent()) { - label = vr.getFieldValueForDefinition(displayFieldDefinition.get()); + label = vr.getFieldValueForDefinition(displayFieldDefinition.get()).orElseThrow(); } - String value = vr.getFieldValueForDefinition(importFieldDefinition.get()); + String value = vr.getFieldValueForDefinition(importFieldDefinition.get()).orElseThrow(); // This should never be blank, but let's stay safe if (StringUtils.isNotBlank(value)) { From f465aabf8ed728787bc19f9c687d39f5e7822e8c Mon Sep 17 00:00:00 2001 From: Steffen Hankiewicz Date: Sun, 18 Aug 2024 10:34:03 +0200 Subject: [PATCH 5/7] updated readme file --- README.md | 84 ++++++++++++++++++++++++++----------------------------- 1 file changed, 39 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 019bf07..db83bd5 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,39 @@ -Goobi workflow Plugin: goobi-plugin-dashboard-delivery -=========================================================================== - -Plugin for Goobi workflow - -This is a dashboard plugin for Goobi workflow which allows external users to login into Goobi to deliver content (aka epflicht). - -This is a plugin for Goobi workflow, the open source workflow tracking software for digitisation projects. More information about Goobi workflow is available under https://goobi.io. If you want to get in touch with the user community simply go to https://community.goobi.io. - - -Plugin details ---------------------------------------------------------------------------- - -More information about the functionality of this plugin and the complete documentation can be found in the central documentation area at https://docs.goobi.io - -Detail | Description ---------------------------- | ------------------------------- -**Plugin identifier** | intranda_dashboard_delivery -**Plugin type** | Dashboard Plugin -**Licence** | GPL 2.0 or newer -**Documentation (German)** | - no documentation available - -**Documentation (English)** | - no documentation available - - - -Goobi details ---------------------------------------------------------------------------- -Goobi workflow is an open source web application to manage small and large digitisation projects mostly in cultural heritage institutions all around the world. More information about Goobi can be found here: - -Detail | Description -------------------- | -------------------------- -**Goobi web site** | https://www.goobi.io -**Twitter** | https://twitter.com/goobi -**Goobi community** | https://community.goobi.io - - -Development ---------------------------------------------------------------------------- -This plugin was developed by intranda. If you have any issues, feedback, question or if you are looking for more information about Goobi workflow, Goobi viewer and all our other developments that are used in digitisation projects please get in touch with us. - -Contact | Details ------------------ | ---------------------------------------------------- -**Company name** | intranda GmbH -**Address** | Bertha-von-Suttner-Str. 9, 37085 Göttingen, Germany -**Web site** | https://www.intranda.com -**Twitter** | https://twitter.com/intranda \ No newline at end of file +# Goobi workflow Plugin: goobi-plugin-dashboard-delivery + +Plugin for Goobi workflow + +This Dashboard plugin for Goobi workflow which allows external users to login into Goobi to deliver content (aka epflicht). + +This is a plugin for Goobi workflow, the open source workflow tracking software for digitisation projects. More information about Goobi workflow is available under https://goobi.io. If you want to get in touch with the user community simply go to https://community.goobi.io. + +## Plugin details + +More information about the functionality of this plugin and the complete documentation can be found in the central documentation area at https://docs.goobi.io + +Detail | Description +--------------------------- | ---------------------- +**Plugin identifier** | - +**Plugin type** | dashboard +**Licence** | GPL 2.0 or newer +**Documentation (German)** | This plugin is not yet documented. +**Documentation (English)** | This plugin is not yet documented. + +## Goobi details + +Goobi workflow is an open source web application to manage small and large digitisation projects mostly in cultural heritage institutions all around the world. More information about Goobi can be found here: + +Detail | Description +--------------------------- | --------------------------- +**Goobi web site** | https://www.goobi.io +**Goobi community** | https://community.goobi.io +**Goobi documentation** | https://docs.goobi.io + +## Development + +This plugin was developed by intranda. If you have any issues, feedback, question or if you are looking for more information about Goobi workflow, Goobi viewer and all our other developments that are used in digitisation projects please get in touch with us. + +Contact | Details +--------------------------- | ---------------------------------------------------- +**Company name** | intranda GmbH +**Address** | Bertha-von-Suttner-Str. 9, 37085 Göttingen, Germany +**Web site** | https://www.intranda.com From 8137858da82a1dd6cd7c7b2cd5ea031256b6f1a9 Mon Sep 17 00:00:00 2001 From: Dominick Leppich Date: Tue, 27 Aug 2024 14:43:23 +0200 Subject: [PATCH 6/7] ci: enable hotfix releases for plugins --- Jenkinsfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2b2e562..6d1a6cb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,6 +27,7 @@ pipeline { anyOf { branch 'master' branch 'release_*' + branch 'hotfix_release_*' allOf { branch 'PR-*' expression { env.CHANGE_BRANCH.startsWith("release_") } @@ -43,6 +44,7 @@ pipeline { anyOf { branch 'master' branch 'release_*' + branch 'hotfix_release_*' allOf { branch 'PR-*' expression { env.CHANGE_BRANCH.startsWith("release_") } @@ -59,6 +61,7 @@ pipeline { anyOf { branch 'master' branch 'release_*' + branch 'hotfix_release_*' branch 'sonar_*' allOf { branch 'PR-*' @@ -83,6 +86,7 @@ pipeline { anyOf { branch 'master' branch 'develop' + branch 'hotfix_release_*' } } steps { @@ -95,7 +99,12 @@ pipeline { } } stage('tag release') { - when { branch 'master' } + when { + anyOf { + branch 'master' + branch 'hotfix_release_*' + } + } steps { withCredentials([gitUsernamePassword(credentialsId: '93f7e7d3-8f74-4744-a785-518fc4d55314', gitToolName: 'git-tool')]) { From 1c90a504edb93431b422da3ac6c5aceab42f4f1c Mon Sep 17 00:00:00 2001 From: Release-Tool Date: Sat, 7 Sep 2024 08:27:32 +0200 Subject: [PATCH 7/7] Change project version to 24.08.1 --- module-base/pom.xml | 2 +- module-gui/pom.xml | 2 +- module-lib/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module-base/pom.xml b/module-base/pom.xml index 64134a9..df26465 100644 --- a/module-base/pom.xml +++ b/module-base/pom.xml @@ -3,7 +3,7 @@ io.goobi.workflow.plugin plugin-dashboard-delivery - 24.07-SNAPSHOT + 24.08.1 plugin-dashboard-delivery-base jar diff --git a/module-gui/pom.xml b/module-gui/pom.xml index 49431d5..287714a 100644 --- a/module-gui/pom.xml +++ b/module-gui/pom.xml @@ -3,7 +3,7 @@ io.goobi.workflow.plugin plugin-dashboard-delivery - 24.07-SNAPSHOT + 24.08.1 plugin-dashboard-delivery-gui jar diff --git a/module-lib/pom.xml b/module-lib/pom.xml index 2a0e0c9..b4e7104 100644 --- a/module-lib/pom.xml +++ b/module-lib/pom.xml @@ -3,7 +3,7 @@ io.goobi.workflow.plugin plugin-dashboard-delivery - 24.07-SNAPSHOT + 24.08.1 plugin-dashboard-delivery-lib \ No newline at end of file diff --git a/pom.xml b/pom.xml index 1337ffb..0e04fe8 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ io.goobi.workflow workflow-base - 24.07-SNAPSHOT + 24.08.1 io.goobi.workflow.plugin