Skip to content

Commit

Permalink
display metadata in process creation screen
Browse files Browse the repository at this point in the history
  • Loading branch information
rsehr authored and Dominick Leppich committed Sep 20, 2024
1 parent 1ad1716 commit ca3a664
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/main/java/de/sub/goobi/forms/ProzesskopieForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
import javax.naming.NamingException;
import javax.servlet.http.Part;

import io.goobi.vocabulary.exchange.FieldDefinition;
import io.goobi.vocabulary.exchange.VocabularySchema;
import org.apache.commons.configuration.HierarchicalConfiguration;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.SystemUtils;
Expand Down Expand Up @@ -114,7 +112,9 @@
import de.unigoettingen.sub.search.opac.ConfigOpac;
import de.unigoettingen.sub.search.opac.ConfigOpacCatalogue;
import de.unigoettingen.sub.search.opac.ConfigOpacDoctype;
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;
Expand Down Expand Up @@ -460,6 +460,11 @@ private AdditionalField readAdditionalFieldConfiguration(HierarchicalConfigurati
/* Children durchlaufen und SelectItems erzeugen */

if (!parameterList.isEmpty()) {
if (item.getBoolean("@multiselect", true)) { // NOSONAR
fa.setMultiselect(true);
} else {
fa.setMultiselect(false);
}
fa.setSelectList(new ArrayList<>());
}

Expand Down Expand Up @@ -488,7 +493,8 @@ private AdditionalField readAdditionalFieldConfiguration(HierarchicalConfigurati
String value = parts[1];

String finalFieldName = field;
Optional<FieldDefinition> searchField = schema.getDefinitions().stream()
Optional<FieldDefinition> searchField = schema.getDefinitions()
.stream()
.filter(d -> d.getName().equals(finalFieldName))
.findFirst();

Expand All @@ -514,13 +520,6 @@ private AdditionalField readAdditionalFieldConfiguration(HierarchicalConfigurati
.map(v -> new SelectItem(v, v))
.collect(Collectors.toList()));
}

if (item.getBoolean("@multiselect", true)) { // NOSONAR
fa.setMultiselect(true);
} else {
fa.setMultiselect(false);
}
// TODO: FIX
return fa;
}

Expand Down Expand Up @@ -730,7 +729,8 @@ public String readMetadataFromTemplate() throws DAOException {
DocStruct colStruct = this.myRdf.getDigitalDocument().getLogicalDocStruct();

List<Metadata> firstChildMetadata =
colStruct.getAllChildren() == null || colStruct.getAllChildren().isEmpty() ? Collections.emptyList() : colStruct.getAllChildren().get(0).getAllMetadata();
colStruct.getAllChildren() == null || colStruct.getAllChildren().isEmpty() ? Collections.emptyList()
: colStruct.getAllChildren().get(0).getAllMetadata();
fillTemplateFromMetadata(colStruct.getAllMetadata(), firstChildMetadata);

removeCollections(colStruct);
Expand Down Expand Up @@ -1240,7 +1240,8 @@ private void createMetadata(DocStruct myTempStruct, MetadataType mdt, String sel
private void writeJournalEntry(LoginBean loginForm) {
User user = loginForm.getMyBenutzer();
JournalEntry logEntry =
new JournalEntry(prozessKopie.getId(), new Date(), user.getNachVorname(), importantWikiField ? LogType.IMPORTANT_USER : LogType.USER, addToWikiField, EntryType.PROCESS);
new JournalEntry(prozessKopie.getId(), new Date(), user.getNachVorname(), importantWikiField ? LogType.IMPORTANT_USER : LogType.USER,
addToWikiField, EntryType.PROCESS);
JournalManager.saveJournalEntry(logEntry);
prozessKopie.getJournal().add(logEntry);
}
Expand Down

0 comments on commit ca3a664

Please sign in to comment.