Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DD-1450: External vocabulary value not indexed when saving draft dataset #186

Draft
wants to merge 2 commits into
base: v5.14-DANS-DataStation
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.nio.charset.StandardCharsets;
import java.sql.Timestamp;
import java.text.MessageFormat;
import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -52,6 +53,8 @@

import edu.harvard.iq.dataverse.settings.SettingsServiceBean;

import static org.apache.commons.lang3.ThreadUtils.sleep;

/**
*
* @author xyang
Expand Down Expand Up @@ -430,6 +433,7 @@ public Set<String> getStringsFor(String termUri) {
*/
public JsonObject getExternalVocabularyValue(String termUri) {
try {
sleep(Duration.ofSeconds(10));
ExternalVocabularyValue evv = em
.createQuery("select object(o) from ExternalVocabularyValue as o where o.uri=:uri",
ExternalVocabularyValue.class)
Expand All @@ -443,6 +447,9 @@ public JsonObject getExternalVocabularyValue(String termUri) {
} catch (NoResultException nre) {
logger.warning("No external vocab value for uri: " + termUri);
}
catch (InterruptedException e) { // sleep
throw new RuntimeException(e);
}
return null;
}

Expand Down
Loading