use of org.apache.syncope.client.console.wizards.DynRealmWrapper in project syncope by apache.
the class DynRealmDirectoryPanel method getActions.
@Override
public ActionsPanel<DynRealmTO> getActions(final IModel<DynRealmTO> model) {
final ActionsPanel<DynRealmTO> panel = super.getActions(model);
panel.add(new ActionLink<DynRealmTO>() {
private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target, final DynRealmTO ignore) {
modal.header(new StringResourceModel("any.edit", model));
modal.setContent(new DynRealmModalPanel(new DynRealmWrapper(model.getObject()), false, modal, pageRef));
modal.show(true);
target.add(modal);
}
}, ActionLink.ActionType.EDIT, StandardEntitlement.DYNREALM_UPDATE);
panel.add(new ActionLink<DynRealmTO>() {
private static final long serialVersionUID = 3766262567901552032L;
@Override
public void onClick(final AjaxRequestTarget target, final DynRealmTO ignore) {
try {
restClient.delete(model.getObject().getKey());
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
target.add(container);
} catch (SyncopeClientException e) {
LOG.error("While deleting dynamic realm {}", model.getObject().getKey(), e);
SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage());
}
((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
}
}, ActionLink.ActionType.DELETE, StandardEntitlement.DYNREALM_DELETE, true);
return panel;
}
Aggregations