use of pl.edu.icm.unity.webui.common.FormValidationException in project unity by unity-idm.
the class EditTranslationProfileSubView method initUI.
private void initUI() {
VerticalLayout main = new VerticalLayout();
main.addComponent(editor);
main.addComponent(StandardButtonsHelper.buildConfirmEditButtonsBar(msg, () -> {
try {
onConfirm.accept(editor.getProfile());
} catch (FormValidationException e) {
NotificationPopup.showError(msg, msg.getMessage("EditTranslationProfileSubView.inconsistentConfiguration"), e);
}
}, onCancel));
setCompositionRoot(main);
}
use of pl.edu.icm.unity.webui.common.FormValidationException in project unity by unity-idm.
the class RestAdminServiceEditorComponent method getServiceDefiniton.
ServiceDefinition getServiceDefiniton() throws FormValidationException {
boolean hasErrors = serviceBinder.validate().hasErrors();
hasErrors |= restBinder.validate().hasErrors();
if (hasErrors) {
setErrorInTabs();
throw new FormValidationException();
}
DefaultServiceDefinition service = serviceBinder.getBean();
service.setConfiguration(restBinder.getBean().toProperties());
return service;
}
use of pl.edu.icm.unity.webui.common.FormValidationException in project unity by unity-idm.
the class EntityCreationDialog method onConfirm.
@Override
protected void onConfirm() {
final IdentityParam toAdd;
try {
toAdd = identityEditor.getValue();
} catch (IllegalIdentityValueException e) {
return;
}
try {
newEntityCredentialsPanel.getCredentials();
} catch (FormValidationRTException e) {
tabs.setSelectedTab(1);
NotificationPopup.showFormError(msg, msg.getMessage("EntityCreation.invalidCredential"));
return;
}
Set<String> requiredInRoot;
try {
requiredInRoot = groupHelper.getRequiredAttributes("/");
} catch (EngineException e) {
return;
}
List<Attribute> attrsToAddInRoot;
try {
attrsToAddInRoot = getPresetAttributes();
} catch (FormValidationException e) {
return;
}
for (Attribute a : attrsToAddInRoot) requiredInRoot.remove(a.getName());
if (requiredInRoot.isEmpty()) {
doCreate(toAdd, attrsToAddInRoot);
} else {
RequiredAttributesDialog attrDialog = new RequiredAttributesDialog(msg, msg.getMessage("EntityCreation.requiredAttributesInfo"), requiredInRoot, groupHelper.getAttrHandlerRegistry(), allTypes, "/", new RequiredAttributesDialog.Callback() {
@Override
public void onConfirm(List<Attribute> attributes) {
doCreate(toAdd, attributes);
}
@Override
public void onCancel() {
}
});
attrDialog.show();
}
}
use of pl.edu.icm.unity.webui.common.FormValidationException in project unity by unity-idm.
the class EditAttributeClassView method onConfirm.
private void onConfirm() {
AttributesClass attrClass;
try {
attrClass = editor.getAttributesClass();
} catch (FormValidationException e) {
return;
}
if (attrClass == null)
return;
try {
controller.updateAttributeClass(attrClass);
} catch (ControllerException e) {
NotificationPopup.showError(msg, e);
return;
}
NavigationHelper.goToView(AttributeClassesView.VIEW_NAME);
}
use of pl.edu.icm.unity.webui.common.FormValidationException in project unity by unity-idm.
the class NewAttributeClassView method onConfirm.
private void onConfirm() {
AttributesClass attrClass;
try {
attrClass = editor.getAttributesClass();
} catch (FormValidationException e) {
return;
}
if (attrClass == null)
return;
try {
controller.addAttributeClass(attrClass);
} catch (ControllerException e) {
NotificationPopup.showError(msg, e);
return;
}
NavigationHelper.goToView(AttributeClassesView.VIEW_NAME);
}
Aggregations