Search in sources :

Example 1 with ImportReportWebMessageResponse

use of org.hisp.dhis.dxf2.webmessage.responses.ImportReportWebMessageResponse in project dhis2-core by dhis2.

the class WebMessageUtils method importReport.

public static WebMessage importReport(ImportReport importReport) {
    WebMessage webMessage = new WebMessage();
    webMessage.setResponse(new ImportReportWebMessageResponse(importReport));
    webMessage.setStatus(importReport.getStatus());
    if (webMessage.getStatus() != Status.OK) {
        webMessage.setMessage("One more more errors occurred, please see full details in import report.");
        webMessage.setStatus(Status.WARNING);
        webMessage.setHttpStatus(HttpStatus.CONFLICT);
    }
    return webMessage;
}
Also used : ImportReportWebMessageResponse(org.hisp.dhis.dxf2.webmessage.responses.ImportReportWebMessageResponse)

Aggregations

ImportReportWebMessageResponse (org.hisp.dhis.dxf2.webmessage.responses.ImportReportWebMessageResponse)1