@Override
public void populateItem(final Item<ICellPopulator<TaskTO>> cellItem, final String componentId,
final IModel<TaskTO> model) {
final TaskTO taskTO = model.getObject();
final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, pageRef);
panel.add(new ActionLink() {
private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target) {
window.setPageCreator(new ModalWindow.PageCreator() {
private static final long serialVersionUID = -7834632442532690940L;
@Override
public Page createPage() {
return new NotificationTaskModalPage(taskTO);
}
});
window.show(target);
}
}, ActionLink.ActionType.EDIT, "Tasks", "read");
panel.add(new ActionLink() {
private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target) {
try {
restClient.startExecution(taskTO.getId(), false);
getSession().info(getString("operation_succeded"));
} catch (SyncopeClientCompositeErrorException scce) {
error(scce.getMessage());
}
target.add(getPage().get("feedback"));
target.add(container);
}
}, ActionLink.ActionType.EXECUTE, "Tasks", "execute");
panel.add(new ActionLink() {
private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target) {
try {
restClient.delete(taskTO.getId(), NotificationTaskTO.class);
info(getString("operation_succeded"));
} catch (SyncopeClientCompositeErrorException scce) {
error(scce.getMessage());
}
target.add(container);