Search in sources :

Example 1 with ObjectReportWebMessageResponse

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

the class WebMessageUtils method objectReport.

public static WebMessage objectReport(ObjectReport objectReport) {
    WebMessage webMessage = new WebMessage();
    webMessage.setResponse(new ObjectReportWebMessageResponse(objectReport));
    if (objectReport.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.WARNING);
        webMessage.setHttpStatus(HttpStatus.CONFLICT);
    }
    return webMessage;
}
Also used : ObjectReportWebMessageResponse(org.hisp.dhis.dxf2.webmessage.responses.ObjectReportWebMessageResponse)

Aggregations

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