Search in sources :

Example 1 with SpeciesBackupExportTask

use of org.openforis.collect.io.metadata.species.SpeciesBackupExportTask in project collect by openforis.

the class SurveyBackupJob method addSpeciesExportTask.

private void addSpeciesExportTask() {
    List<CollectTaxonomy> taxonomies = speciesManager.loadTaxonomiesBySurvey(survey);
    for (CollectTaxonomy taxonomy : taxonomies) {
        // if ( speciesManager.hasTaxons(taxonomy.getId()) ) {
        SpeciesBackupExportTask task = createTask(SpeciesBackupExportTask.class);
        task.setSpeciesManager(speciesManager);
        task.setOutputStream(zipOutputStream);
        task.setSurvey(survey);
        task.setTaxonomyId(taxonomy.getId());
        String entryName = String.format(SPECIES_ENTRY_FORMAT, taxonomy.getName());
        task.addStatusChangeListener(new ZipEntryCreatorTaskStatusChangeListener(zipOutputStream, entryName));
        addTask(task);
    // }
    }
}
Also used : SpeciesBackupExportTask(org.openforis.collect.io.metadata.species.SpeciesBackupExportTask) CollectTaxonomy(org.openforis.collect.model.CollectTaxonomy)

Aggregations

SpeciesBackupExportTask (org.openforis.collect.io.metadata.species.SpeciesBackupExportTask)1 CollectTaxonomy (org.openforis.collect.model.CollectTaxonomy)1