Skip to content

Commit

Permalink
Add File Level Citation
Browse files Browse the repository at this point in the history
  • Loading branch information
sekmiller committed Oct 20, 2016
1 parent 9874363 commit 153ee90
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
13 changes: 13 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/FileMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,19 @@ public String getFileDateToDisplay() {
}
return "";
}

public String getFileCitation(){
String citation = this.getDatasetVersion().getCitation();
/*
", #{FilePage.fileMetadata.label} [fileName]"
<h:outputText value=", #{FilePage.file.unf}" rendered="#{FilePage.file.tabularData and !(empty FilePage.file.unf)}"/>
*/
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;
Expand Down
8 changes: 1 addition & 7 deletions src/main/webapp/file.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,7 @@
<div class="row">
<div id="citation" class="#{DatasetPage.workingVersion.deaccessioned ? 'col-xs-12' : 'col-xs-7 col-md-8'}">
<div id="citation-select" onclick="if (event.target) { selectText(event.target); } else{ selectText(this); }">
<h:outputText value="#{FilePage.file.owner.citation}" escape="false"/>
<!-- TODO: ADD THIS SECTION TO THE DYNAMIC CITATION MANAGE BEAN -->
<!-- TODO: 'fileName' needs to be dynamic {file.name.label} -->
<h:outputText value=", #{FilePage.fileMetadata.label} [fileName]" />

<h:outputText value=", #{FilePage.file.unf}" rendered="#{FilePage.file.tabularData and !(empty FilePage.file.unf)}"/>
<!-- END: TODO -->
<h:outputText value="#{FilePage.fileMetadata.fileCitation}" escape="false"/>
</div>
<span class="glyphicon glyphicon-question-sign text-primary" jsf:rendered="#{!FilePage.fileMetadata.datasetVersion.dataset.released}" data-toggle="tooltip" data-trigger="hover" data-placement="top" data-original-title="#{bundle['dataset.cite.title.released']}"/>
<span class="glyphicon glyphicon-question-sign text-primary" jsf:rendered="#{FilePage.fileMetadata.datasetVersion.dataset.released and FilePage.fileMetadata.datasetVersion.draft}" data-toggle="tooltip" data-trigger="hover" data-placement="top" data-original-title="#{bundle['dataset.cite.title.draft']}"/>
Expand Down

3 comments on commit 153ee90

@pdurbin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sekmiller is this a fix for #3140? If so, can that issue go through QA?

@sekmiller
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pdurbin No. this is a clean up of the file level citation for display in the landing page.

@pdurbin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sekmiller ah. Bummer! 😄

Please sign in to comment.