From 5c5431651d65e7ef862f9a3352b6868a44cf3e60 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Selent?=
Date: Tue, 28 Nov 2023 16:28:23 +0100
Subject: [PATCH] Merge with all FoKUS patches
---
.../harvard/iq/dataverse/util/FileUtil.java | 44 ++++++++++++-------
src/main/java/propertyFiles/Bundle.properties | 9 ++--
src/main/webapp/metadataFragment.xhtml | 5 +++
.../resources/js/shib/idpselect_config.js | 2 +-
4 files changed, 39 insertions(+), 21 deletions(-)
diff --git a/src/main/java/edu/harvard/iq/dataverse/util/FileUtil.java b/src/main/java/edu/harvard/iq/dataverse/util/FileUtil.java
index 5f7643b3115..3c16321c590 100644
--- a/src/main/java/edu/harvard/iq/dataverse/util/FileUtil.java
+++ b/src/main/java/edu/harvard/iq/dataverse/util/FileUtil.java
@@ -214,6 +214,8 @@ public class FileUtil implements java.io.Serializable {
private static final String FILE_FACET_CLASS_TEXT = "Text";
private static final String FILE_FACET_CLASS_OTHER = "Other";
private static final String FILE_FACET_CLASS_UNKNOWN = "Unknown";
+
+ public static final String OVERWRITE_MIME_TYPE_PREFIX = "force-";
// The file type facets and type-specific thumbnail classes (above) are
// very similar, but not exactly 1:1; so the following map is for
@@ -856,24 +858,32 @@ public static CreateDataFileResult createDataFiles(DatasetVersion version, Input
// than the type supplied:
// -- L.A.
String recognizedType = null;
-
- try {
- recognizedType = determineFileType(tempFile.toFile(), fileName);
- logger.fine("File utility recognized the file as " + recognizedType);
- if (recognizedType != null && !recognizedType.equals("")) {
- if (useRecognizedType(suppliedContentType, recognizedType)) {
- finalType = recognizedType;
- }
- }
-
- } catch (Exception ex) {
- logger.warning("Failed to run the file utility mime type check on file " + fileName);
+
+ // If we detect the dataverse prefix in the supplied mimetype we do no
+ // further recognition
+ if (suppliedContentType.toLowerCase().startsWith(OVERWRITE_MIME_TYPE_PREFIX)) {
+ finalType = suppliedContentType.toLowerCase().substring(OVERWRITE_MIME_TYPE_PREFIX.length());
+ logger.fine("Overwrite prefix detected. Using supplied mime type.");
}
-
- if (finalType == null) {
- finalType = (suppliedContentType == null || suppliedContentType.equals(""))
- ? MIME_TYPE_UNDETERMINED_DEFAULT
- : suppliedContentType;
+ else {
+ try {
+ recognizedType = determineFileType(tempFile.toFile(), fileName);
+ logger.fine("File utility recognized the file as " + recognizedType);
+ if (recognizedType != null && !recognizedType.equals("")) {
+ if (useRecognizedType(suppliedContentType, recognizedType)) {
+ finalType = recognizedType;
+ }
+ }
+
+ } catch (Exception ex) {
+ logger.warning("Failed to run the file utility mime type check on file " + fileName);
+ }
+
+ if (finalType == null) {
+ finalType = (suppliedContentType == null || suppliedContentType.equals(""))
+ ? MIME_TYPE_UNDETERMINED_DEFAULT
+ : suppliedContentType;
+ }
}
// A few special cases:
diff --git a/src/main/java/propertyFiles/Bundle.properties b/src/main/java/propertyFiles/Bundle.properties
index 997f0470cc3..9208518fe98 100644
--- a/src/main/java/propertyFiles/Bundle.properties
+++ b/src/main/java/propertyFiles/Bundle.properties
@@ -91,6 +91,7 @@ selectedFiles=Selected Files
htmlAllowedTitle=Allowed HTML Tags
htmlAllowedMsg=This field supports only certain HTML tags.
htmlAllowedTags=<a>, <b>, <blockquote>, <br>, <code>, <del>, <dd>, <dl>, <dt>, <em>, <hr>, <h1>-<h3>, <i>, <img>, <kbd>, <li>, <ol>, <p>, <pre>, <s>, <sup>, <sub>, <strong>, <strike>, <u>, <ul>
+vocabularyFaqMsg=More information about vocabularies, terms and URLs here.
conditionalRequiredMsg=One or more of these fields may become required if you add to one or more of these optional fields.
conditionalRequiredMsg.tooltip=This field will become required if you choose to enter values in one or more of these optional fields.
toggleNavigation=Toggle navigation
@@ -814,7 +815,7 @@ dataverse.enterName=Enter name...
dataverse.host.title=The dataverse which contains this data.
dataverse.host.tip=Changing the host dataverse will clear any fields you may have entered data into.
dataverse.host.autocomplete.nomatches=No matches
-dataverse.identifier.title=Short name used for the URL of this dataverse.
+dataverse.identifier.title=Short name used for the URL of this dataverse. Use your institutional abbreviation as prefix.
dataverse.affiliation.title=The organization with which this dataverse is affiliated.
dataverse.storage.title=A storage service to be used for datasets in this dataverse.
dataverse.metadatalanguage.title=Metadata entered for datasets in this dataverse will be assumed to be in the selected language.
@@ -1432,7 +1433,7 @@ dataset.publish.header=Publish Dataset
dataset.rejectBtn=Return to Author
dataset.submitBtn=Submit for Review
dataset.disabledSubmittedBtn=Submitted for Review
-dataset.submitMessage=You will not be able to make changes to this dataset while it is in review.
+dataset.submitMessage=Please use the publication checklist for authors ( https://www.izus.uni-stuttgart.de/en/fokus/darus/publication/ ) to ensure publication readiness. You will not be able to make changes to this dataset while it is in review.
dataset.submit.success=Your dataset has been submitted for review.
dataset.inreview.infoMessage=The draft version of this dataset is currently under review prior to publication.
dataset.submit.failure=Dataset Submission Failed - {0}
@@ -1484,7 +1485,7 @@ dataset.share.datasetShare=Share Dataset
dataset.share.datasetShare.tip=Share this dataset on your favorite social media networks.
dataset.share.datasetShare.shareText=View this dataset.
dataset.locked.message=Dataset Locked
-dataset.locked.message.details=This dataset is locked until publication.
+dataset.locked.message.details=This dataset is reviewed prior to publication by the DaRUS-team. You will receive an email with further information in the next days.
dataset.locked.inReview.message=Submitted for Review
dataset.locked.ingest.message=The tabular data files uploaded are being processed and converted into the archival format
dataset.unlocked.ingest.message=The tabular files have been ingested.
@@ -2288,6 +2289,8 @@ dataset.additionalEntry=Additional Entry
#externaltools
externaltools.enable.browser.popups=You must enable popups in your browser to open external tools in a new window or tab.
+externaltools.ViPLab.displayname=Explore in Browser (ViPLab)
+externaltools.ViPLab.description=Execute configured Docker container via ViPLab
#mydata_fragment.xhtml
mydataFragment.infoAccess=Here are all the dataverses, datasets, and files you have access to. You can filter through them by publication status and roles.
diff --git a/src/main/webapp/metadataFragment.xhtml b/src/main/webapp/metadataFragment.xhtml
index 200d2917b9a..2e69d4ecf17 100755
--- a/src/main/webapp/metadataFragment.xhtml
+++ b/src/main/webapp/metadataFragment.xhtml
@@ -339,6 +339,11 @@
+
+
+
+
+
diff --git a/src/main/webapp/resources/js/shib/idpselect_config.js b/src/main/webapp/resources/js/shib/idpselect_config.js
index 8057ba26396..fd738d5439a 100644
--- a/src/main/webapp/resources/js/shib/idpselect_config.js
+++ b/src/main/webapp/resources/js/shib/idpselect_config.js
@@ -31,7 +31,7 @@ function IdPSelectUIParms() {
this.preferredIdP = null; // Array of entityIds to always show
this.hiddenIdPs = null; // Array of entityIds to delete
this.ignoreKeywords = false; // Do we ignore the when looking for candidates
- this.showListFirst = true; // Do we start with a list of IdPs or just the dropdown
+ this.showListFirst = false; // Do we start with a list of IdPs or just the dropdown
this.samlIdPCookieTTL = 730; // in days
this.setFocusTextBox = true; // Set to false to supress focus
this.testGUI = false;