break FINDID;
}
}
if ( validateMe ) {
Collection<TaxonVariant> variants = getTaxonLabelService().findTaxonVariants(taxonlabel);
TaxonVariant variant = null;
// one variant, no homonyms
if ( variants.size() == 1 ) {
variant = variants.iterator().next();
}
// homonyms
else if ( variants.size() > 1 ){
homonyms.put(taxonlabel.getId(), taxonlabel.getTaxonLabel());
variant = variants.iterator().next();
}
// no variants were found locally in the db
else {
variant = getTaxonLabelService().createFromUBIOService(taxonlabel);
// no variants were found by uBio
if ( variant == null ) {
if (getTaxonLabelService().getuBioTimeOutError()) {
ubioResultMessages.add("uBio service was unavailable when checking " + taxonlabel.getTaxonLabel() + ".");
ubioResultErrors.add("uBio service was unavailable when checking " + taxonlabel.getTaxonLabel() +
" try <a href=" + UBIOSEARCHTAXONLABEL
+ taxonlabel.getTaxonLabel().replace(EMPTYSPACE, "%20")
+ " target=_blank>UBIO</a> site.");
}
else {
ubioResultMessages.add(taxonlabel.getTaxonLabel() + " is **UNRECOGNIZED**.");
ubioResultErrors.add(taxonlabel.getTaxonLabel()
+ " is **UNRECOGNIZED** try <a href=" + UBIOSEARCHTAXONLABEL
+ taxonlabel.getTaxonLabel().replace(EMPTYSPACE, "%20")
+ " target=_blank>UBIO</a> site.");
}
}
// variants stored by uBio,TODO now check for homonyms
else {
ubioResultErrors.add(taxonlabel.getTaxonLabel()
+ " was located in uBio, see: <a href=" + UBIOTAXONRECORD
+ variant.getNamebankID()
+ " target=_blank>UBIO</a> site.");
}
}
setStoreTaxonVariant(variant,taxonlabel);
ubioResultMessages.add("Validated "+taxonlabel.getTaxonLabel());