Skip to content

Commit a3871e3

Browse files
authored
Merge pull request #5022 from IQSS/5021-respect_file_pid_packages
5021 respect file pid packages
2 parents 948ff3b + df53f37 commit a3871e3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

doc/sphinx-guides/source/user/appendix.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ Detailed below are what metadata schemas we support for Citation and Domain Spec
2424
: These metadata elements can be mapped/exported to the International Virtual Observatory Alliance’s (IVOA)
2525
`VOResource Schema format <http://www.ivoa.net/documents/latest/RM.html>`__ and is based on
2626
`Virtual Observatory (VO) Discovery and Provenance Metadata <http://perma.cc/H5ZJ-4KKY>`__ (`see .tsv version <https://github.com/IQSS/dataverse/blob/master/scripts/api/data/metadatablocks/astrophysics.tsv>`__).
27-
- `Life Sciences Metadata <https://docs.google.com/spreadsheet/ccc?key=0AjeLxEN77UZodHFEWGpoa19ia3pldEFyVFR0aFVGa0E#gid=2>`__: based on `ISA-Tab Specification <http://isa-tools.org/format/specification/>`__, along with controlled vocabulary from subsets of the `OBI Ontology <http://bioportal.bioontology.org/ontologies/OBI>`__ and the `NCBI Taxonomy for Organisms <http://www.ncbi.nlm.nih.gov/Taxonomy/taxonomyhome.html/>`__ (`see .tsv version <https://github.com/IQSS/dataverse/blob/master/scripts/api/data/metadatablocks/biomedical.tsv>`__).
27+
- `Life Sciences Metadata <https://docs.google.com/spreadsheet/ccc?key=0AjeLxEN77UZodHFEWGpoa19ia3pldEFyVFR0aFVGa0E#gid=2>`__: based on `ISA-Tab Specification <https://isa-specs.readthedocs.io/en/latest/isamodel.html>`__, along with controlled vocabulary from subsets of the `OBI Ontology <http://bioportal.bioontology.org/ontologies/OBI>`__ and the `NCBI Taxonomy for Organisms <http://www.ncbi.nlm.nih.gov/Taxonomy/taxonomyhome.html/>`__ (`see .tsv version <https://github.com/IQSS/dataverse/blob/master/scripts/api/data/metadatablocks/biomedical.tsv>`__).
2828

2929
See also the `Dataverse 4.0 Metadata Crosswalk: DDI, DataCite, DC, DCTerms, VO, ISA-Tab <https://docs.google.com/spreadsheets/d/10Luzti7svVTVKTA-px27oq3RxCUM-QbiTkm8iMd5C54/edit?usp=sharing>`__ document.

src/main/java/edu/harvard/iq/dataverse/batch/jobs/importer/filesystem/FileRecordWriter.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ private DataFile createPackageDataFile(List<File> files) {
358358
dataset.getLatestVersion().getFileMetadatas().add(fmd);
359359
fmd.setDatasetVersion(dataset.getLatestVersion());
360360

361+
String isFilePIDsEnabled = commandEngine.getContext().settings().getValueForKey(SettingsServiceBean.Key.FilePIDsEnabled, "true"); //default value for file PIDs is 'true'
362+
if ("true".contentEquals( isFilePIDsEnabled )) {
363+
361364
GlobalIdServiceBean idServiceBean = GlobalIdServiceBean.getBean(packageFile.getProtocol(), commandEngine.getContext());
362365
if (packageFile.getIdentifier() == null || packageFile.getIdentifier().isEmpty()) {
363366
packageFile.setIdentifier(dataFileServiceBean.generateDataFileIdentifier(packageFile, idServiceBean));
@@ -387,6 +390,7 @@ private DataFile createPackageDataFile(List<File> files) {
387390
packageFile.setGlobalIdCreateTime(new Date());
388391
}
389392
}
393+
}
390394

391395
getJobLogger().log(Level.INFO, "Successfully created a file of type package");
392396

@@ -467,4 +471,4 @@ private Logger getJobLogger() {
467471
return Logger.getLogger("job-"+jobContext.getInstanceId());
468472
}
469473

470-
}
474+
}

0 commit comments

Comments
 (0)