Skip to content

Commit

Permalink
limit to non-published, not just non-drafts IQSS#2243
Browse files Browse the repository at this point in the history
Also add helper method.
  • Loading branch information
pdurbin committed Nov 2, 2017
1 parent ad71c6a commit 80b5a88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/DatasetVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,10 @@ public boolean isReleased() {
return versionState.equals(VersionState.RELEASED);
}

public boolean isPublished() {
return isReleased();
}

public boolean isDraft() {
return versionState.equals(VersionState.DRAFT);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ public static List<DatasetField> getDatasetSummaryFields(DatasetVersion datasetV
// TODO: Make this more performant by writing the output to the database or a file?
public static String getJsonLd(DatasetVersion workingVersion) {
// We show published datasets only for "datePublished" field below.
if (workingVersion.isDraft()) {
if (!workingVersion.isPublished()) {
return "";
}
JsonObjectBuilder job = Json.createObjectBuilder();
Expand Down

0 comments on commit 80b5a88

Please sign in to comment.