use of org.apache.wicket.markup.html.basic.MultiLineLabel in project midpoint by Evolveum.
the class PageSelfRegistration method submitRegistration.
@Override
protected void submitRegistration(AjaxRequestTarget target) {
OperationResult result = new OperationResult(OPERATION_SAVE_USER);
saveUser(result);
result.computeStatus();
if (result.getStatus() == OperationResultStatus.SUCCESS) {
getSession().success(createStringResource("PageSelfRegistration.registration.success").getString());
String sequenceName = getSelfRegistrationConfiguration().getAdditionalAuthentication();
if (SecurityUtils.getSequenceByName(sequenceName, getSelfRegistrationConfiguration().getAuthenticationPolicy()) != null) {
target.add(PageSelfRegistration.this);
} else {
switch(getSelfRegistrationConfiguration().getAuthenticationMethod()) {
case MAIL:
target.add(PageSelfRegistration.this);
break;
case SMS:
throw new UnsupportedOperationException();
case NONE:
setResponsePage(PageLogin.class);
}
}
LOGGER.trace("Registration for user {} was successfull.", getUserModel().getObject());
} else {
String message;
if (result.getUserFriendlyMessage() != null) {
message = WebModelServiceUtils.translateMessage(result, this);
} else {
message = result.getMessage();
}
getSession().error(createStringResource("PageSelfRegistration.registration.error", message).getString());
// removePassword(target);
updateCaptcha(target);
target.add(getFeedbackPanel());
LOGGER.error("Failed to register user {}. Reason {}", getUserModel().getObject(), result.getMessage());
return;
}
target.add(getFeedbackPanel());
MultiLineLabel label = new MultiLineLabel(ID_REGISTRATION_SUBMITED, createStringResource("PageSelfRegistration.registration.confirm.message"));
Fragment messageContent = new Fragment("contentArea", "messageContent", this);
messageContent.add(label);
getMainForm().replace(messageContent);
target.add(this);
}
use of org.apache.wicket.markup.html.basic.MultiLineLabel in project midpoint by Evolveum.
the class PageEmailNonse method initCustomLayer.
protected void initCustomLayer() {
MidpointForm form = new MidpointForm(ID_MAIN_FORM);
form.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return !submited;
}
});
add(form);
initStaticLayout(form);
initDynamicLayout(form, PageEmailNonse.this);
initButtons(form);
MultiLineLabel label = new MultiLineLabel(ID_PASSWORD_RESET_SUBMITED, createStringResource("PageForgotPassword.form.submited.message"));
add(label);
label.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return submited;
}
@Override
public boolean isEnabled() {
return submited;
}
});
}
Aggregations