use of org.openforis.collect.model.CollectTaxonomy in project collect by openforis.
the class SpeciesService method findByCode.
@Secured("ROLE_ENTRY")
public List<TaxonOccurrenceProxy> findByCode(String taxonomyName, String searchString, int maxResults, TaxonSearchParameters parameters) {
CollectTaxonomy taxonomy = loadTaxonomyByActiveSurvey(taxonomyName);
List<TaxonOccurrence> list = speciesManager.findByCode(taxonomy, searchString, maxResults, parameters);
return Proxies.fromList(list, TaxonOccurrenceProxy.class);
}
use of org.openforis.collect.model.CollectTaxonomy in project collect by openforis.
the class SurveyValidator method validateTaxonomy.
private SurveyValidationResult validateTaxonomy(TaxonAttributeDefinition attrDef) {
CollectSurvey survey = (CollectSurvey) attrDef.getSurvey();
boolean surveyIsStored = survey.getId() != null;
if (surveyIsStored) {
// validate taxonomies only when survey is stored
String taxonomyName = attrDef.getTaxonomy();
CollectTaxonomy taxonomy = findTaxonomy(survey, taxonomyName);
if (taxonomy == null) {
return new SurveyValidationResult(attrDef.getPath(), "survey.validation.attribute.taxon.invalid_taxonomy", taxonomyName);
}
}
return new SurveyValidationResult();
}
use of org.openforis.collect.model.CollectTaxonomy in project collect by openforis.
the class TaxonAttributeVM method getTaxonomyNames.
@DependsOn("surveyId")
public List<String> getTaxonomyNames() {
List<CollectTaxonomy> taxonomies = speciesManager.loadTaxonomiesBySurvey(survey);
List<String> result = new ArrayList<String>();
for (CollectTaxonomy taxonomy : taxonomies) {
result.add(taxonomy.getName());
}
return result;
}
Aggregations