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

OpenAIRE guidelines for Data Archives #4664

Merged
merged 43 commits into from
May 7, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
a769ea1
OpenAIRE Datacite 4.1 exporter
francescopioscognamiglio May 11, 2018
1d0a72a
Merge branch 'develop' into openaire
abollini May 12, 2018
06ce109
minor version is now a proper long
francescopioscognamiglio May 14, 2018
32e5544
OpenAIRE compliance
May 24, 2018
d9ef102
Merge pull request #2 from Consorcio-Madrono/openaire
lap82 May 24, 2018
ccf419a
Merge branch 'develop' into openaire
lap82 May 24, 2018
b6743d8
- clean code
francescopioscognamiglio May 24, 2018
4b28306
add "DataCite OpenAIRE" to list of export formats #4257
pdurbin May 29, 2018
7c11bc0
put DataCite OpenAire export in dropdown #4257 #3697
pdurbin May 30, 2018
a51743b
add some JUnit tests #4257 #3697
pdurbin May 30, 2018
272290c
Merge branch 'develop' into openaire #4257 #3697
pdurbin May 30, 2018
5336e67
increase code coverage of openaire exporter #4257 #3697
pdurbin May 31, 2018
0a5ad78
Merged with develop branch
Apr 2, 2019
02aabcf
Openaire export reviewed, more tests added
Apr 10, 2019
103925a
Merge remote-tracking branch 'upstream/develop' into openaire
Apr 10, 2019
fd15d15
Revised metadata (restricted access, language, funder)
Apr 12, 2019
b691b3a
Merge remote-tracking branch 'upstream/develop' into openaire
Apr 12, 2019
3347b50
creator nametype improved using DataCite algorithm
Apr 17, 2019
578bf89
creator nametype improved using DataCite algorithm
Apr 17, 2019
02c6af9
Fix FirstNameTest tests
Apr 17, 2019
32565e3
Minor fixes
Apr 18, 2019
b6c6045
Merge remote-tracking branch 'contributor/openaire' into openaire
Apr 18, 2019
a745e18
Merge remote-tracking branch 'upstream/develop' into openaire
Apr 18, 2019
b6215ef
Minor fixes
Apr 18, 2019
d5571dd
Merge branch 'openaire' of https://github.com/fcadili/dataverse into …
Apr 18, 2019
fdc2328
Merge remote-tracking branch 'contributor/openaire' into openaire
Apr 18, 2019
78c1768
Merge branch 'develop' into openaire #4257
pdurbin Apr 22, 2019
5e9e924
note that some partial renaming of variables was done #4257
pdurbin Apr 22, 2019
03c959b
reference related tests about first name #4257
pdurbin Apr 22, 2019
68c0a93
DataCite algorithm was applied to handle contributors nametype properly
Apr 24, 2019
6b8d524
Merge remote-tracking branch 'upstream/develop' into openaire
Apr 24, 2019
cc1c6f9
Merge branch 'openaire' of https://github.com/4Science/dataverse into…
Apr 24, 2019
0311179
fix Organizational value of contributor's nameType
Apr 24, 2019
3a8247c
change button to "OpenAIRE", update guides #4257
pdurbin Apr 25, 2019
5f0a81a
Added hint file
Apr 26, 2019
8030521
Merge branch 'openaire' of https://github.com/4Science/dataverse into…
Apr 26, 2019
9496718
Added firstName resources to generated war
May 2, 2019
3a79173
Merge remote-tracking branch 'upstream/develop' into openaire
May 2, 2019
bd9a3e3
Adding organization recognition with NPL
May 6, 2019
c214229
Fixing Organizational nameType
May 6, 2019
62d5fc0
Merge remote-tracking branch 'upstream/develop' into openaire
May 6, 2019
4d4ef39
Adding NPL tokenizer to handle organization names with comma
May 7, 2019
5d876aa
Merge remote-tracking branch 'upstream/develop' into openaire
May 7, 2019
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
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
nb-configuration.xml
target
nbactions.xml
# eclipse IDE
.settings/
.classpath
.project
michael-local
GPATH
GTAGS
Expand Down Expand Up @@ -41,4 +45,4 @@ conf/docker-aio/dv/deps/
conf/docker-aio/dv/install/dvinstall.zip
# or copy of test data
conf/docker-aio/testdata/
scripts/installer/default.config
scripts/installer/default.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class DataFileDTO {
private String id;
private String storageIdentifier;
private String contentType;
private Long filesize;
private String filename;
private String originalFileFormat;
private String originalFormatLabel;
Expand Down Expand Up @@ -51,6 +52,14 @@ public String getContentType() {
public void setContentType(String contentType) {
this.contentType = contentType;
}

public Long getFileSize() {
return filesize;
}

public void setFileSize(Long fileSize) {
this.filesize = fileSize;
}

public String getFilename() {
return filename;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class DatasetVersionDTO {
String archiveNote;
String deacessionLink;
Long versionNumber;
String minorVersionNumber;
Long versionMinorNumber;
long id;
VersionState versionState;
String releaseDate;
Expand All @@ -36,7 +36,8 @@ public class DatasetVersionDTO {
String availabilityStatus;
String contactForAccess;
String sizeOfCollection;
String studyCompletion;
String studyCompletion;
boolean fileAccessRequest;
String citation;
String license;
boolean inReview;
Expand Down Expand Up @@ -172,7 +173,15 @@ public String getStudyCompletion() {
public void setStudyCompletion(String studyCompletion) {
this.studyCompletion = studyCompletion;
}


public boolean isFileAccessRequest() {
return fileAccessRequest;
}

public void setFileAccessRequest(boolean fileAccessRequest) {
this.fileAccessRequest = fileAccessRequest;
}

public String getCitation() {
return citation;
}
Expand Down Expand Up @@ -229,12 +238,12 @@ public void setVersionNumber(Long versionNumber) {
this.versionNumber = versionNumber;
}

public String getMinorVersionNumber() {
return minorVersionNumber;
public Long getMinorVersionNumber() {
return versionMinorNumber;
}

public void setMinorVersionNumber(String minorVersionNumber) {
this.minorVersionNumber = minorVersionNumber;
public void setMinorVersionNumber(Long minorVersionNumber) {
this.versionMinorNumber = minorVersionNumber;
}

public long getId() {
Expand Down Expand Up @@ -320,7 +329,7 @@ public List<FieldDTO> getDatasetFields() {

@Override
public String toString() {
return "DatasetVersionDTO{" + "archiveNote=" + archiveNote + ", deacessionLink=" + deacessionLink + ", versionNumber=" + versionNumber + ", minorVersionNumber=" + minorVersionNumber + ", id=" + id + ", versionState=" + versionState + ", releaseDate=" + releaseDate + ", lastUpdateTime=" + lastUpdateTime + ", createTime=" + createTime + ", archiveTime=" + archiveTime + ", UNF=" + UNF + ", metadataBlocks=" + metadataBlocks + ", fileMetadatas=" + fileMetadatas + '}';
return "DatasetVersionDTO{" + "archiveNote=" + archiveNote + ", deacessionLink=" + deacessionLink + ", versionNumber=" + versionNumber + ", minorVersionNumber=" + versionMinorNumber + ", id=" + id + ", versionState=" + versionState + ", releaseDate=" + releaseDate + ", lastUpdateTime=" + lastUpdateTime + ", createTime=" + createTime + ", archiveTime=" + archiveTime + ", UNF=" + UNF + ", metadataBlocks=" + metadataBlocks + ", fileMetadatas=" + fileMetadatas + '}';
}


Expand Down
22 changes: 20 additions & 2 deletions src/main/java/edu/harvard/iq/dataverse/api/dto/FileDTO.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
package edu.harvard.iq.dataverse.api.dto;

public class FileDTO {


String label;
boolean restricted;
DataFileDTO dataFile;


public String getLabel() {
return label;
}

public void setLabel(String label) {
this.label = label;
}

public boolean isRestricted() {
return restricted;
}

public void setRestricted(boolean restricted) {
this.restricted = restricted;
}

public DataFileDTO getDataFile() {
return dataFile;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ private InputStream getCachedExportFormat(Dataset dataset, String formatName) th
try {
dataAccess = DataAccess.getStorageIO(dataset);
} catch (IOException ioex) {
throw new IOException("IO Exception thrown exporting as " + "export_" + formatName + ".cached");
throw new IOException("IO Exception thrown exporting as " + "export_" + formatName + ".cached", ioex);
}

InputStream cachedExportInputStream = null;
Expand All @@ -317,7 +317,7 @@ private InputStream getCachedExportFormat(Dataset dataset, String formatName) th
return cachedExportInputStream;
}
} catch (IOException ioex) {
throw new IOException("IO Exception thrown exporting as " + "export_" + formatName + ".cached");
throw new IOException("IO Exception thrown exporting as " + "export_" + formatName + ".cached", ioex);
}
return null;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package edu.harvard.iq.dataverse.export;

import java.io.OutputStream;
import java.util.logging.Logger;

import javax.json.JsonObject;
import javax.xml.stream.XMLStreamException;

import com.google.auto.service.AutoService;

import edu.harvard.iq.dataverse.DatasetVersion;
import edu.harvard.iq.dataverse.export.openaire.OpenAireExportUtil;
import edu.harvard.iq.dataverse.export.spi.Exporter;
import edu.harvard.iq.dataverse.util.BundleUtil;

@AutoService(Exporter.class)
public class OpenAireExporter implements Exporter {
Logger logger = Logger.getLogger(OpenAireExporter.class.getCanonicalName());

public OpenAireExporter() {
logger.info("entering in OpenAireExporter constructor");
}

@Override
public String getProviderName() {
logger.info("entering in the method getProviderName() of OpenAIRE");
return "oai_datacite";
}

@Override
public String getDisplayName() {
logger.info("entering in getDisplayName() of OpenAIRE");
// add this into the dataverse/src/main/java/Bundle.properties (it is present into applications/dataverse-4.8.6/WEB-INF/classes)
return BundleUtil.getStringFromBundle("dataset.exportBtn.itemLabel.dataciteOpenAIRE") != null ? BundleUtil.getStringFromBundle("dataset.exportBtn.itemLabel.dataciteOpenAIRE") : "DataCite OpenAIRE";
}

@Override
public void exportDataset(DatasetVersion version, JsonObject json, OutputStream outputStream)
throws ExportException {
logger.info("entering into exportDataset() of OpenAIRE");
try {
OpenAireExportUtil.datasetJson2openaire(json, outputStream);
} catch (XMLStreamException xse) {
throw new ExportException("Caught XMLStreamException performing DataCite OpenAIRE export", xse);
}
}

@Override
public Boolean isXMLFormat() {
return true;
}

@Override
public Boolean isHarvestable() {
return true;
}

@Override
public Boolean isAvailableToUsers() {
return false;
}

@Override
public String getXMLNameSpace() throws ExportException {
return OpenAireExportUtil.OAI_DATACITE_NAMESPACE;
}

@Override
public String getXMLSchemaLocation() throws ExportException {
return OpenAireExportUtil.OAI_DATACITE_SCHEMA_LOCATION;
}

@Override
public String getXMLSchemaVersion() throws ExportException {
return OpenAireExportUtil.SCHEMA_VERSION;
}

@Override
public void setParam(String name, Object value) {
// not used
}

}
Loading