Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved dataset version message text to bundle. [ref #1953] #3909

Merged
merged 1 commit into from
Jun 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/main/java/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1460,6 +1460,10 @@ file.viewDiffDialog.description=Description
file.viewDiffDialog.fileReplaced=File Replaced
file.viewDiffDialog.filesReplaced=File(s) Replaced
file.viewDiffDialog.files.header=Files
file.viewDiffDialog.msg.draftFound= This is the "DRAFT" version.
file.viewDiffDialog.msg.draftNotFound=The "DRAFT" version was not found.
file.viewDiffDialog.msg.versionFound= This is version "{0}".
file.viewDiffDialog.msg.versionNotFound=Version "{0}" was not found.
file.metadataTip=Metadata Tip: After adding the dataset, click the Edit Dataset button to add more metadata.
file.addBtn=Save Dataset
file.dataset.allFiles=All Files from this Dataset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import edu.harvard.iq.dataverse.authorization.users.AuthenticatedUser;
import edu.harvard.iq.dataverse.search.SolrSearchResult;
import edu.harvard.iq.dataverse.settings.SettingsServiceBean;
import edu.harvard.iq.dataverse.util.BundleUtil;
import edu.harvard.iq.dataverse.util.SystemConfig;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -91,27 +92,26 @@ public RetrieveDatasetVersionResponse(DatasetVersion datasetVersion, String requ
this.checkVersion();
}


public String getDifferentVersionMessage(){

if (this.wasSpecificVersionRequested && !this.didSpecificVersionMatch){
String userMsg;
if (DatasetVersionServiceBean.this.isVersionAskingForDraft(this.requestedVersion)){
userMsg = "The \"DRAFT\" version was not found.";
userMsg = BundleUtil.getStringFromBundle("file.viewDiffDialog.msg.draftNotFound");
}else{
userMsg = "Version \"" + this.requestedVersion + "\" was not found.";
userMsg = BundleUtil.getStringFromBundle("file.viewDiffDialog.msg.versionNotFound", Arrays.asList(this.requestedVersion));
}

if (DatasetVersionServiceBean.this.isVersionAskingForDraft(this.actualVersion)){
userMsg += " This is the \"DRAFT\" version.";
userMsg += BundleUtil.getStringFromBundle("file.viewDiffDialog.msg.draftFound");
}else{
userMsg += " This is version \"" + this.actualVersion + "\".";
userMsg += BundleUtil.getStringFromBundle("file.viewDiffDialog.msg.versionFound", Arrays.asList(this.actualVersion));
}

return userMsg;
}
return null;
}
}

private void checkVersion(){
if (actualVersion==null){ // this shouldn't happen
Expand Down