use of org.openforis.collect.io.data.DataBackupError in project collect by openforis.
the class SurveyExportParametersVM method jobCompleted.
@GlobalCommand
public void jobCompleted(@BindingParam("job") Job job) {
boolean jobStartedByThis = isJobStartedByThis(job);
if (job == surveyBackupJob) {
File file = surveyBackupJob.getOutputFile();
downloadFile(file, surveyBackupJob.getOutputFormat().getOutputFileExtension(), MediaType.APPLICATION_OCTET_STREAM_VALUE, surveyBackupJob.getSurvey(), surveyBackupJob.getOutputSurveyDefaultLanguage());
final List<DataBackupError> dataBackupErrors = surveyBackupJob.getDataBackupErrors();
if (!dataBackupErrors.isEmpty()) {
DataExportErrorsPopUpVM.showPopUp(dataBackupErrors);
}
} else if (job == rdbExportJob) {
File file = rdbExportJob.getOutputFile();
CollectSurvey survey = rdbExportJob.getSurvey();
String extension = "sql";
downloadFile(file, extension, MediaType.TEXT_PLAIN_VALUE, survey, survey.getDefaultLanguage());
}
if (jobStartedByThis) {
onJobEnd(job);
}
}
Aggregations