use of org.apache.wicket.validation.RawValidationError in project midpoint by Evolveum.
the class PageReport method createFullXmlValidator.
private IValidator<String> createFullXmlValidator() {
return new IValidator<String>() {
@Override
public void validate(IValidatable<String> validatable) {
String value = validatable.getValue();
OperationResult result = new OperationResult(OPERATION_VALIDATE_REPORT);
Holder<PrismObject<ReportType>> reportHolder = new Holder<>(null);
OpResult opResult = null;
try {
validateObject(value, reportHolder, PrismContext.LANG_XML, true, result);
if (!result.isAcceptable()) {
result.recordFatalError("Could not validate object", result.getCause());
opResult = OpResult.getOpResult((PageBase) getPage(), result);
validatable.error(new RawValidationError(opResult));
}
} catch (Exception e) {
LOGGER.error("Validation problem occured." + e.getMessage());
result.recordFatalError("Could not validate object.", e);
try {
opResult = OpResult.getOpResult((PageBase) getPage(), result);
validatable.error(new RawValidationError(opResult));
} catch (Exception ex) {
error(ex);
}
}
}
};
}
Aggregations