Skip to content

Commit

Permalink
Internationization DAT-593
Browse files Browse the repository at this point in the history
ingest/reingest the file
  • Loading branch information
JayanthyChengan committed May 15, 2024
1 parent df8c061 commit 46bc37f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/edu/harvard/iq/dataverse/FilePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ public String ingestFile() throws CommandException{
dataFile.getIngestRequest().setForceTypeCheck(true);

// update the datafile, to save the newIngest request in the database:
datafileService.save(file);
datafileService.save(dataFile);

// queue the data ingest job for asynchronous execution:
String status = ingestService.startIngestJobs(editDataset.getId(), new ArrayList<>(Arrays.asList(dataFile)), (AuthenticatedUser) session.getUser());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,13 @@ private boolean assignRole(RoleAssignee ra, DataFile file, DataverseRole r) {
);
JsfHelper.addSuccessMessage(BundleUtil.getStringFromBundle("permission.roleAssignedToFor", args));
} catch (PermissionException ex) {
JH.addMessage(FacesMessage.SEVERITY_ERROR, BundleUtil.getStringFromBundle("permission.roleNotAbleToBeAssigned"), BundleUtil.getStringFromBundle("permission.permissionsMissing", Arrays.asList(ex.getRequiredPermissions().toString())));
List<String> retlist = new ArrayList<>();
for (String s : Arrays.asList(ex.getRequiredPermissions().toString())) {
logger.log(Level.INFO, " Internationalization : " + ex.getMessage(), ex);
retlist.add(BundleUtil.getStringFromBundle("permission."+s+".label",BundleUtil.getCurrentLocale()));
}

JH.addMessage(FacesMessage.SEVERITY_ERROR, BundleUtil.getStringFromBundle("permission.roleNotAbleToBeAssigned"), BundleUtil.getStringFromBundle("permission.permissionsMissing", retlist));
return false;
} catch (CommandException ex) {
//JH.addMessage(FacesMessage.SEVERITY_FATAL, "The role was not able to be assigned.");
Expand Down

0 comments on commit 46bc37f

Please sign in to comment.