Search in sources :

Example 1 with UpdateExplicitGroupCommand

use of edu.harvard.iq.dataverse.engine.command.impl.UpdateExplicitGroupCommand in project dataverse by IQSS.

the class ManageGroupsPage method saveExplicitGroup.

public void saveExplicitGroup(ActionEvent ae) {
    ExplicitGroup eg = selectedGroup;
    if (getSelectedGroupAddRoleAssignees() != null) {
        try {
            for (RoleAssignee ra : getSelectedGroupAddRoleAssignees()) {
                eg.add(ra);
            }
        } catch (GroupException ge) {
            JsfHelper.JH.addMessage(FacesMessage.SEVERITY_ERROR, "Group edit failed.", ge.getMessage());
            return;
        }
    }
    try {
        eg = engineService.submit(new UpdateExplicitGroupCommand(dvRequestService.getDataverseRequest(), eg));
        JsfHelper.addSuccessMessage("Succesfully saved group " + eg.getDisplayName());
    } catch (CommandException ex) {
        JsfHelper.JH.addMessage(FacesMessage.SEVERITY_ERROR, "Group Save failed.", ex.getMessage());
    } catch (Exception ex) {
        JH.addMessage(FacesMessage.SEVERITY_FATAL, "The role was not able to be saved.");
        logger.log(Level.SEVERE, "Error saving role: " + ex.getMessage(), ex);
    }
    showAssignmentMessages();
}
Also used : UpdateExplicitGroupCommand(edu.harvard.iq.dataverse.engine.command.impl.UpdateExplicitGroupCommand) GroupException(edu.harvard.iq.dataverse.authorization.groups.GroupException) CommandException(edu.harvard.iq.dataverse.engine.command.exception.CommandException) CommandException(edu.harvard.iq.dataverse.engine.command.exception.CommandException) GroupException(edu.harvard.iq.dataverse.authorization.groups.GroupException) ExplicitGroup(edu.harvard.iq.dataverse.authorization.groups.impl.explicit.ExplicitGroup) RoleAssignee(edu.harvard.iq.dataverse.authorization.RoleAssignee)

Aggregations

RoleAssignee (edu.harvard.iq.dataverse.authorization.RoleAssignee)1 GroupException (edu.harvard.iq.dataverse.authorization.groups.GroupException)1 ExplicitGroup (edu.harvard.iq.dataverse.authorization.groups.impl.explicit.ExplicitGroup)1 CommandException (edu.harvard.iq.dataverse.engine.command.exception.CommandException)1 UpdateExplicitGroupCommand (edu.harvard.iq.dataverse.engine.command.impl.UpdateExplicitGroupCommand)1