use of org.openforis.collect.designer.util.SuccessHandler in project collect by openforis.
the class SurveyExportParametersVM method export.
@Command
public void export() {
rdbExportJob = null;
surveyBackupJob = null;
String uri = surveySummary.getUri();
final CollectSurvey loadedSurvey;
if (surveySummary.isTemporary() && SurveyType.valueOf(formObject.getType()) == TEMPORARY) {
loadedSurvey = surveyManager.loadSurvey(surveySummary.getId());
} else {
loadedSurvey = surveyManager.getByUri(uri);
}
switch(formObject.getOutputFormatEnum()) {
case EARTH:
validateSurvey(loadedSurvey, collectEarthSurveyValidator, new SuccessHandler() {
public void onSuccess() {
exportCollectEarthSurvey(loadedSurvey, formObject);
}
}, true);
return;
case RDB:
startRDBSurveyExportJob(loadedSurvey, formObject);
break;
case MOBILE:
validateSurvey(loadedSurvey, surveyValidator, new SuccessHandler() {
public void onSuccess() {
startCollectSurveyExportJob(loadedSurvey, formObject);
}
}, true);
break;
default:
startCollectSurveyExportJob(loadedSurvey, formObject);
break;
}
}
Aggregations