use of org.openforis.collect.io.SurveyBackupJob in project collect by openforis.
the class BackupRestoreController method startFullExport.
@Transactional
public JobProxy startFullExport(CollectSurvey survey, boolean includeRecordFiles, boolean onlyOwnedRecords, String[] rootEntityKeyValues, boolean full) {
if (backupJob == null || !backupJob.isRunning()) {
resetJobs();
RecordFilter filter = createRecordFilter(survey, null, onlyOwnedRecords, rootEntityKeyValues);
SurveyBackupJob job = jobManager.createJob(SurveyBackupJob.class);
job.setFull(full);
if (full) {
job.setOutputFormat(OutputFormat.DESKTOP_FULL);
} else {
job.setOutputFormat(OutputFormat.ONLY_DATA);
}
job.setSurvey(survey);
job.setIncludeData(true);
job.setIncludeRecordFiles(includeRecordFiles);
job.setRecordFilter(filter);
backupJob = job;
jobManager.start(job);
}
return getCurrentJob();
}
Aggregations