Skip to content

Commit

Permalink
Merge pull request 'Release v24.08.1' (#17) from release_24.08.1 into…
Browse files Browse the repository at this point in the history
… master
  • Loading branch information
janvonde committed Sep 7, 2024
2 parents f8aa522 + 1c90a50 commit 958a0a0
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 101 deletions.
11 changes: 10 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pipeline {
anyOf {
branch 'master'
branch 'release_*'
branch 'hotfix_release_*'
allOf {
branch 'PR-*'
expression { env.CHANGE_BRANCH.startsWith("release_") }
Expand All @@ -43,6 +44,7 @@ pipeline {
anyOf {
branch 'master'
branch 'release_*'
branch 'hotfix_release_*'
allOf {
branch 'PR-*'
expression { env.CHANGE_BRANCH.startsWith("release_") }
Expand All @@ -59,6 +61,7 @@ pipeline {
anyOf {
branch 'master'
branch 'release_*'
branch 'hotfix_release_*'
branch 'sonar_*'
allOf {
branch 'PR-*'
Expand All @@ -83,6 +86,7 @@ pipeline {
anyOf {
branch 'master'
branch 'develop'
branch 'hotfix_release_*'
}
}
steps {
Expand All @@ -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')]) {
Expand Down
84 changes: 39 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,39 @@
Goobi workflow Plugin: goobi-plugin-dashboard-delivery
===========================================================================

<img src="https://goobi.io/wp-content/uploads/logo_goobi_plugin.png" align="right" style="margin:0 0 20px 20px;" alt="Plugin for Goobi workflow" width="175" height="109">

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
# Goobi workflow Plugin: goobi-plugin-dashboard-delivery

<img src="https://goobi.io/wp-content/uploads/logo_goobi_plugin.png" align="right" style="margin:0 0 20px 20px;" alt="Plugin for Goobi workflow" width="175" height="109">

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
2 changes: 0 additions & 2 deletions install/plugin_intranda_dashboard_delivery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
<journal>Datenablieferung</journal>
</processtemplates>


<vocabularyServerUrl>https://example.com/vocabulary/records/</vocabularyServerUrl>
<!-- metadata fields for monographic items -->


Expand Down
2 changes: 1 addition & 1 deletion module-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.goobi.workflow.plugin</groupId>
<artifactId>plugin-dashboard-delivery</artifactId>
<version>24.06</version>
<version>24.08.1</version>
</parent>
<artifactId>plugin-dashboard-delivery-base</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion module-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.goobi.workflow.plugin</groupId>
<artifactId>plugin-dashboard-delivery</artifactId>
<version>24.06</version>
<version>24.08.1</version>
</parent>
<artifactId>plugin-dashboard-delivery-gui</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion module-lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.goobi.workflow.plugin</groupId>
<artifactId>plugin-dashboard-delivery</artifactId>
<version>24.06</version>
<version>24.08.1</version>
</parent>
<artifactId>plugin-dashboard-delivery-lib</artifactId>
</project>
4 changes: 0 additions & 4 deletions module-lib/src/main/java/de/intranda/beans/DeliveryBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ public class DeliveryBean implements Serializable {
private static final String NEWLINE = "<br />";
private static final String COLON = ": ";

public static String vocabularyUrl; //NOSONAR

@Getter
@Setter
private String focusField;
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
@@ -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.helper.ExtendedVocabularyRecord;
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
Expand All @@ -42,8 +42,9 @@ public class MetadataField implements Serializable {

private List<SelectItem> selectList = new ArrayList<>(); // list of selectable values

private List<VocabRecord> vocabList = new ArrayList<>(); // list of selectable values
private List<ExtendedVocabularyRecord> vocabularyRecords = new ArrayList<>(); // list of selectable values

private final VocabularyAPIManager vocabularyAPIManager = VocabularyAPIManager.getInstance();
private String vocabularyName;
private String vocabularyDisplayField;
private String vocabularyImportField;
Expand Down Expand Up @@ -101,30 +102,45 @@ 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()
.list(vocabulary.getId())
.all()
.request()
.getContent();

Optional<FieldDefinition> 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<FieldDefinition> 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 (ExtendedVocabularyRecord vr : vocabularyRecords) {
String label = vr.getMainValue();
if (displayFieldDefinition.isPresent()) {
label = vr.getFieldValueForDefinition(displayFieldDefinition.get()).orElseThrow();
}

String value = vr.getFieldValueForDefinition(importFieldDefinition.get()).orElseThrow();

// This should never be blank, but let's stay safe
if (StringUtils.isNotBlank(value)) {
selectList.add(new SelectItem(value, label));
}
}
}
Expand Down Expand Up @@ -214,9 +230,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;
}
}
Expand Down Expand Up @@ -315,7 +329,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
Expand All @@ -325,7 +339,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) {
Expand Down Expand Up @@ -357,7 +371,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);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.goobi.workflow</groupId>
<artifactId>workflow-base</artifactId>
<version>24.06</version>
<version>24.08.1</version>
<relativePath />
</parent>
<groupId>io.goobi.workflow.plugin</groupId>
Expand Down

0 comments on commit 958a0a0

Please sign in to comment.