From 153ee90add2b7aa7adf73300227d573c547578a1 Mon Sep 17 00:00:00 2001 From: Stephen Kraffmiller Date: Thu, 20 Oct 2016 13:37:46 -0400 Subject: [PATCH] Add File Level Citation --- .../java/edu/harvard/iq/dataverse/FileMetadata.java | 13 +++++++++++++ src/main/webapp/file.xhtml | 8 +------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/FileMetadata.java b/src/main/java/edu/harvard/iq/dataverse/FileMetadata.java index 18f6356eec8..1ab616915b7 100644 --- a/src/main/java/edu/harvard/iq/dataverse/FileMetadata.java +++ b/src/main/java/edu/harvard/iq/dataverse/FileMetadata.java @@ -249,6 +249,19 @@ public String getFileDateToDisplay() { } return ""; } + + public String getFileCitation(){ + String citation = this.getDatasetVersion().getCitation(); + /* + ", #{FilePage.fileMetadata.label} [fileName]" + + */ + citation += ", " + this.getLabel() + " [fileName]" ; + if (this.dataFile.isTabularData() && this.dataFile.getUnf() != null && !this.dataFile.getUnf().isEmpty()){ + citation += ", " + this.dataFile.getUnf(); + } + return citation; + } public DatasetVersion getDatasetVersion() { return datasetVersion; diff --git a/src/main/webapp/file.xhtml b/src/main/webapp/file.xhtml index 912c421f012..ad1e7a77f97 100644 --- a/src/main/webapp/file.xhtml +++ b/src/main/webapp/file.xhtml @@ -182,13 +182,7 @@
- - - - - - - +