Skip to content

Commit

Permalink
rename to publicationDateAsString and improve javadoc IQSS#2243
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Nov 3, 2017
1 parent 8f3083c commit b1db8ee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions src/main/java/edu/harvard/iq/dataverse/DatasetVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -1111,9 +1111,9 @@ public List<WorkflowComment> getWorkflowComments() {
* dataset publication date unpublished datasets will return an empty
* string.
*
* @return String dataset publication date (dd MMM yyyy).
* @return String dataset publication date in ISO 8601 format (yyyy-MM-dd).
*/
public String getPublicationDate() {
public String getPublicationDateAsString() {
if (DatasetVersion.VersionState.DRAFT == this.getVersionState()) {
return "";
}
Expand Down Expand Up @@ -1146,7 +1146,16 @@ public String getJsonLd() {
authors.add(author);
}
job.add("author", authors);
job.add("dateModified", this.getPublicationDate());
/**
* We are aware that there is a "datePublished" field but it means "Date
* of first broadcast/publication." This only makes sense for a 1.0
* version.
*
* "dateModified" is more appropriate for a version: "The date on which
* the CreativeWork was most recently modified or when the item's entry
* was modified within a DataFeed."
*/
job.add("dateModified", this.getPublicationDateAsString());
job.add("schemaVersion", "https://schema.org/version/3.3");
job.add("publisher", Json.createObjectBuilder()
.add("@type", "Organization")
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="DC.identifier" content="#{DatasetPage.persistentId}"/>
<meta name="DC.type" content="Dataset"/>
<meta name="DC.title" content="#{DatasetPage.title}"/>
<meta name="DC.date" content="#{DatasetPage.workingVersion.publicationDate}"/>
<meta name="DC.date" content="#{DatasetPage.workingVersion.publicationDateAsString}"/>
<meta name="DC.publisher" content="#{DatasetPage.publisher}" />
<meta name="DC.description" content="#{DatasetPage.description}" />
<ui:repeat var="author" value="#{DatasetPage.datasetAuthors}">
Expand Down

0 comments on commit b1db8ee

Please sign in to comment.