private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target) {
try {
BulkActionResult bulkActionResult;
if (subjectTO instanceof UserTO) {
bulkActionResult = userRestClient.deprovision(
subjectTO.getETagValue(),
subjectTO.getId(),
new ArrayList<StatusBean>(table.getModelObject()));
} else {
bulkActionResult = roleRestClient.deprovision(
subjectTO.getETagValue(),
subjectTO.getId(),
new ArrayList<StatusBean>(table.getModelObject()));
}
((BasePage) pageRef.getPage()).setModalResult(true);
loadBulkActionResultPage(table.getModelObject(), bulkActionResult);
} catch (Exception e) {
LOG.error("Error de-provisioning user", e);
error(getString(Constants.ERROR) + ": " + e.getMessage());
feedbackPanel.refresh(target);
}
}
}, ActionLink.ActionType.DEPROVISION, pageId);
table.addAction(new ActionLink() {
private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target) {
if (subjectTO instanceof UserTO) {
StatusModalPage.this.passwordManagement(
target, ResourceAssociationActionType.PROVISION, table.getModelObject());
} else {
try {
final BulkActionResult bulkActionResult = roleRestClient.provision(
subjectTO.getETagValue(),
subjectTO.getId(),
new ArrayList<StatusBean>(table.getModelObject()));
((BasePage) pageRef.getPage()).setModalResult(true);
loadBulkActionResultPage(table.getModelObject(), bulkActionResult);
} catch (Exception e) {
LOG.error("Error provisioning user", e);
error(getString(Constants.ERROR) + ": " + e.getMessage());
feedbackPanel.refresh(target);
}
}
}
}.feedbackPanelAutomaticReload(!(subjectTO instanceof UserTO)), ActionLink.ActionType.PROVISION, pageId);
table.addAction(new ActionLink() {
private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target) {
try {
final BulkActionResult bulkActionResult;
if (subjectTO instanceof UserTO) {
bulkActionResult = userRestClient.unassign(
subjectTO.getETagValue(),
subjectTO.getId(),
new ArrayList<StatusBean>(table.getModelObject()));
} else {
bulkActionResult = roleRestClient.unassign(
subjectTO.getETagValue(),
subjectTO.getId(),
new ArrayList<StatusBean>(table.getModelObject()));
}
((BasePage) pageRef.getPage()).setModalResult(true);
loadBulkActionResultPage(table.getModelObject(), bulkActionResult);
} catch (Exception e) {
LOG.error("Error unassigning resources", e);
error(getString(Constants.ERROR) + ": " + e.getMessage());
feedbackPanel.refresh(target);
}
}
}, ActionLink.ActionType.UNASSIGN, pageId);
table.addAction(new ActionLink() {
private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target) {
if (subjectTO instanceof UserTO) {
StatusModalPage.this.passwordManagement(
target, ResourceAssociationActionType.ASSIGN, table.getModelObject());
} else {
try {
final BulkActionResult bulkActionResult = roleRestClient.assign(
subjectTO.getETagValue(),
subjectTO.getId(),
new ArrayList<StatusBean>(table.getModelObject()));
((BasePage) pageRef.getPage()).setModalResult(true);