@Override
public ActionLinksPanel getActions(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");
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_succeeded"));
} catch (SyncopeClientCompositeErrorException scce) {
error(scce.getMessage());
}
target.add(getPage().get("feedback"));
target.add(container);
}
}, ActionLink.ActionType.EXECUTE, "Tasks");
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_succeeded"));
} catch (SyncopeClientCompositeErrorException scce) {
error(scce.getMessage());
}
target.add(container);
target.add(getPage().get("feedback"));
}
}, ActionLink.ActionType.DELETE, "Tasks");
return panel;
}
@Override
public Component getHeader(String componentId) {
final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(), pageRef);
panel.add(new ActionLink() {
private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target) {