use of org.openforis.collect.designer.viewmodel.SurveyFileVM in project collect by openforis.
the class SurveyFileFormValidator method loadSurveyFilesDifferentFromThis.
private List<SurveyFile> loadSurveyFilesDifferentFromThis(ValidationContext ctx) {
List<SurveyFile> result = new ArrayList<SurveyFile>();
SurveyFileVM vm = getVM(ctx);
CollectSurvey survey = vm.getSurvey();
SurveyManager surveyManager = getSurveyManager(ctx);
List<SurveyFile> surveyFiles = surveyManager.loadSurveyFileSummaries(survey);
SurveyFile editedSurveyFile = vm.getEditedItem();
for (SurveyFile surveyFile : surveyFiles) {
if (!surveyFile.getId().equals(editedSurveyFile.getId())) {
result.add(surveyFile);
}
}
return result;
}
Aggregations