Skip to content

Commit

Permalink
changed container to string
Browse files Browse the repository at this point in the history
  • Loading branch information
rsehr committed Sep 25, 2024
1 parent 21f4f42 commit e87c1c0
Showing 1 changed file with 52 additions and 51 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,52 @@
package de.intranda.goobi.plugins;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;

import org.apache.commons.configuration.HierarchicalConfiguration;
import org.apache.commons.configuration.SubnodeConfiguration;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.ResultSetHandler;
import org.apache.commons.lang.StringUtils;
import org.goobi.beans.Process;
import org.goobi.beans.Processproperty;
import org.goobi.beans.Step;
import org.goobi.production.cli.helper.StringPair;
import org.goobi.production.enums.PluginGuiType;
import org.goobi.production.enums.PluginReturnValue;
import org.goobi.production.enums.PluginType;
import org.goobi.production.enums.StepReturnValue;
import org.goobi.production.flow.statistics.hibernate.FilterHelper;
import org.goobi.production.plugin.interfaces.IStepPluginVersion2;
import org.primefaces.event.CloseEvent;

import de.intranda.goobi.plugins.ProcessMetadata.ProcessMetadataField;
import de.sub.goobi.config.ConfigPlugins;
import de.sub.goobi.helper.FacesContextHelper;
Expand All @@ -23,22 +70,6 @@
import lombok.Setter;
import lombok.extern.log4j.Log4j2;
import net.xeoh.plugins.base.annotations.PluginImplementation;
import org.apache.commons.configuration.HierarchicalConfiguration;
import org.apache.commons.configuration.SubnodeConfiguration;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.ResultSetHandler;
import org.apache.commons.lang.StringUtils;
import org.goobi.beans.Process;
import org.goobi.beans.Processproperty;
import org.goobi.beans.Step;
import org.goobi.production.cli.helper.StringPair;
import org.goobi.production.enums.PluginGuiType;
import org.goobi.production.enums.PluginReturnValue;
import org.goobi.production.enums.PluginType;
import org.goobi.production.enums.StepReturnValue;
import org.goobi.production.flow.statistics.hibernate.FilterHelper;
import org.goobi.production.plugin.interfaces.IStepPluginVersion2;
import org.primefaces.event.CloseEvent;
import ugh.dl.DigitalDocument;
import ugh.dl.DocStruct;
import ugh.dl.Fileformat;
Expand All @@ -51,36 +82,6 @@
import ugh.exceptions.ReadException;
import ugh.exceptions.WriteException;

import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

@Log4j2
@PluginImplementation
public class MetadataEditionPlugin implements IStepPluginVersion2 {
Expand Down Expand Up @@ -203,7 +204,6 @@ public class MetadataEditionPlugin implements IStepPluginVersion2 {
@Setter
private boolean displayMetadataAddPopup = false;


private VocabularyAPIManager vocabularyAPI = VocabularyAPIManager.getInstance();

@Override
Expand Down Expand Up @@ -379,7 +379,8 @@ private void initDisplayFields(SubnodeConfiguration config) {
ExtendedVocabulary vocabulary = vocabularyAPI.vocabularies().findByName(vocabularyName);
vocabularyUrl = vocabulary.getURI();
VocabularySchema schema = vocabularyAPI.vocabularySchemas().get(vocabulary.getSchemaId());
Optional<FieldDefinition> searchField = schema.getDefinitions().stream()
Optional<FieldDefinition> searchField = schema.getDefinitions()
.stream()
.filter(d -> d.getName().equals(searchFieldName))
.findFirst();

Expand Down Expand Up @@ -431,7 +432,7 @@ private void initDisplayFields(SubnodeConfiguration config) {
}
if (!found) {
Processproperty property = new Processproperty();
property.setContainer(0);
property.setContainer("0");
property.setCreationDate(new Date());
property.setProcessId(this.process.getId());
property.setProzess(this.process);
Expand Down Expand Up @@ -1000,7 +1001,7 @@ public void addField() {

if ("property".contains(field.getSource())) {
Processproperty property = new Processproperty();
property.setContainer(0);
property.setContainer("0");
property.setCreationDate(new Date());
property.setProcessId(this.process.getId());
property.setProzess(this.process);
Expand Down Expand Up @@ -1068,7 +1069,7 @@ public void addMetadataField() {
switch (this.selectedField.getSource()) {
case "property":
Processproperty property = new Processproperty();
property.setContainer(0);
property.setContainer("0");
property.setCreationDate(new Date());
property.setProcessId(this.process.getId());
property.setProzess(this.process);
Expand Down

0 comments on commit e87c1c0

Please sign in to comment.