use of org.hisp.dhis.dxf2.dataset.tasks.ImportCompleteDataSetRegistrationsTask in project dhis2-core by dhis2.
the class CompleteDataSetRegistrationController method asyncImport.
private void asyncImport(ImportOptions importOptions, String format, HttpServletRequest request, HttpServletResponse response) throws IOException {
Pair<InputStream, Path> tmpFile = saveTmpFile(request.getInputStream());
TaskId taskId = new TaskId(TaskCategory.COMPLETE_DATA_SET_REGISTRATION_IMPORT, currentUserService.getCurrentUser());
scheduler.executeTask(new ImportCompleteDataSetRegistrationsTask(registrationExchangeService, sessionFactory, tmpFile.getLeft(), tmpFile.getRight(), importOptions, format, taskId));
response.setHeader("Location", ContextUtils.getRootPath(request) + "/system/tasks/" + TaskCategory.COMPLETE_DATA_SET_REGISTRATION_IMPORT);
response.setStatus(HttpServletResponse.SC_ACCEPTED);
}
Aggregations