use of org.hisp.dhis.dxf2.webmessage.responses.TypeReportWebMessageResponse in project dhis2-core by dhis2.
the class WebMessageUtils method typeReport.
public static WebMessage typeReport(TypeReport typeReport) {
WebMessage webMessage = new WebMessage();
webMessage.setResponse(new TypeReportWebMessageResponse(typeReport));
if (typeReport.getErrorReports().isEmpty()) {
webMessage.setStatus(Status.OK);
webMessage.setHttpStatus(HttpStatus.OK);
} else {
webMessage.setMessage("One more more errors occurred, please see full details in import report.");
webMessage.setStatus(Status.ERROR);
webMessage.setHttpStatus(HttpStatus.CONFLICT);
}
return webMessage;
}
Aggregations