Search in sources :

Example 1 with CodeListImportTask

use of org.openforis.collect.io.metadata.codelist.CodeListImportTask in project collect by openforis.

the class CodeListsVM method jobFailed.

@GlobalCommand
public void jobFailed(@BindingParam("job") Job job) {
    closeJobStatusPopUp();
    if (job instanceof CodeListBatchImportJob && job.getCurrentTask() != null) {
        CodeListImportTask lastTask = (CodeListImportTask) ((CodeListBatchImportJob) job).getCurrentTask();
        dataImportErrorPopUp = ReferenceDataImportErrorPopUpVM.showPopUp(lastTask.getErrors(), Labels.getLabel("survey.code_list.import_data.error_popup.title", new String[] { lastTask.getEntryName() }));
    } else {
        String errorMessageKey = job.getErrorMessage();
        String errorMessage = StringUtils.defaultIfBlank(Labels.getLabel(errorMessageKey), errorMessageKey);
        MessageUtil.showError("global.job_status.failed.message", errorMessage);
    }
    clearJob(job);
}
Also used : CodeListImportTask(org.openforis.collect.io.metadata.codelist.CodeListImportTask) CodeListBatchImportJob(org.openforis.collect.io.metadata.codelist.CodeListBatchImportJob) GlobalCommand(org.zkoss.bind.annotation.GlobalCommand)

Aggregations

CodeListBatchImportJob (org.openforis.collect.io.metadata.codelist.CodeListBatchImportJob)1 CodeListImportTask (org.openforis.collect.io.metadata.codelist.CodeListImportTask)1 GlobalCommand (org.zkoss.bind.annotation.GlobalCommand)1