Search in sources :

Example 6 with SurveyBackupJob

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();
}
Also used : SurveyBackupJob(org.openforis.collect.io.SurveyBackupJob) RecordFilter(org.openforis.collect.model.RecordFilter) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

SurveyBackupJob (org.openforis.collect.io.SurveyBackupJob)6 RecordFilter (org.openforis.collect.model.RecordFilter)3 File (java.io.File)2 CollectEarthSurveyExportJob (org.openforis.collect.manager.CollectEarthSurveyExportJob)2 CollectSurvey (org.openforis.collect.model.CollectSurvey)2 Transactional (org.springframework.transaction.annotation.Transactional)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 ExternalizedProperty (org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty)1 SurveySummary (org.openforis.collect.model.SurveySummary)1 JobView (org.openforis.collect.web.controller.CollectJobController.JobView)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1 MultipartFile (org.springframework.web.multipart.MultipartFile)1