use of org.pentaho.reporting.engine.classic.core.parameters.ValidationResult in project head by mifos.
the class PentahoReportsServiceImpl method validate.
private void validate(MasterReport report, List<PentahoValidationError> errors) throws ReportProcessingException {
ReportParameterDefinition paramDefinition = report.getParameterDefinition();
ReportParameterValidator validator = paramDefinition.getValidator();
ParameterContext paramContext = new DefaultParameterContext(report);
ValidationResult validationResult = validator.validate(null, paramDefinition, paramContext);
for (ValidationMessage msg : validationResult.getErrors()) {
PentahoValidationError error = new PentahoValidationError(msg.getMessage());
errors.add(error);
}
String[] properties = validationResult.getProperties();
for (String prop : properties) {
for (ValidationMessage msg : validationResult.getErrors(prop)) {
PentahoValidationError error = new PentahoValidationError(prop, msg.getMessage());
errors.add(error);
}
}
}
Aggregations