Skip to content

Commit

Permalink
Fix for broken dataset URLs on harvested *file* cards.
Browse files Browse the repository at this point in the history
  • Loading branch information
landreev committed Feb 9, 2016
1 parent 78bbdd2 commit 9c2effc
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -899,13 +899,21 @@ public String getFileParentIdentifier() {
}

public String getFileUrl() {
// Nothing special needs to be done for harvested file URLs:
// simply directing these to the local dataset.xhtml for this dataset
// will take care of it - because DatasetPage will issue a redirect
// to the remote archive URL.
// This is true AS OF 4.2.4, FEB. 2016! - We'll probably want to make
// .getRemoteArchiveURL() methods, both in DataFile and Dataset objects,
// work again at some point in the future.
/*
if (entity != null && entity instanceof DataFile && this.isHarvested()) {
String remoteArchiveUrl = ((DataFile) entity).getRemoteArchiveURL();
if (remoteArchiveUrl != null) {
return remoteArchiveUrl;
}
return null;
}
}*/

return "/file.xhtml?fileId=" + entity.getId() + "&datasetVersionId=" + datasetVersionId;

Expand All @@ -918,13 +926,15 @@ public String getFileUrl() {
}

public String getFileDatasetUrl() {
// See the comment in the getFileUrl() method above. -- L.A. 4.2.4
/*
if (entity != null && entity instanceof DataFile && this.isHarvested()) {
String remoteArchiveUrl = ((DataFile) entity).getRemoteArchiveURL();
if (remoteArchiveUrl != null) {
return remoteArchiveUrl;
}
return null;
}
}*/

String parentDatasetGlobalId = parent.get(PARENT_IDENTIFIER);

Expand Down

0 comments on commit 9c2effc

Please sign in to comment.