private static final long serialVersionUID = 2054811145491901166L;
@Override
public ActionLinksPanel getActions(final String componentId, final IModel<AbstractTaskTO> model) {
final PushTaskTO taskTO = (PushTaskTO) 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 PushTaskModalPage(window, taskTO, pageRef);
}
});
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(Constants.OPERATION_SUCCEEDED));
} catch (SyncopeClientException scce) {
error(scce.getMessage());
}
target.add(container);
((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
}
}, ActionLink.ActionType.EXECUTE, TASKS);
panel.add(new ActionLink() {
private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target) {
try {
restClient.startExecution(taskTO.getId(), true);
getSession().info(getString(Constants.OPERATION_SUCCEEDED));
} catch (SyncopeClientException scce) {
error(scce.getMessage());
}
target.add(container);
((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
}
}, ActionLink.ActionType.DRYRUN, TASKS);
panel.add(new ActionLink() {
private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target) {
try {
restClient.delete(taskTO.getId(), SyncTaskTO.class);
info(getString(Constants.OPERATION_SUCCEEDED));
} catch (SyncopeClientException scce) {
error(scce.getMessage());
}
target.add(container);