30 |
30 |
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException;
|
31 |
31 |
import eu.etaxonomy.cdm.model.agent.AgentBase;
|
32 |
32 |
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
|
|
33 |
import eu.etaxonomy.cdm.model.common.Annotation;
|
|
34 |
import eu.etaxonomy.cdm.model.common.AnnotationType;
|
33 |
35 |
import eu.etaxonomy.cdm.model.common.CdmBase;
|
34 |
36 |
import eu.etaxonomy.cdm.model.common.Language;
|
35 |
37 |
import eu.etaxonomy.cdm.model.description.CommonTaxonName;
|
... | ... | |
242 |
244 |
String trivialString = rs.getString(RedListUtil.TRIVIAL);
|
243 |
245 |
String authorBasiString = rs.getString(RedListUtil.AUTOR_BASI);
|
244 |
246 |
String hybString = rs.getString(RedListUtil.HYB);
|
|
247 |
String florString = rs.getString(RedListUtil.FLOR);
|
|
248 |
String atlasIdxString = rs.getString(RedListUtil.ATLAS_IDX);
|
|
249 |
String kartString = rs.getString(RedListUtil.KART);
|
|
250 |
String rl2015String = rs.getString(RedListUtil.RL2015);
|
|
251 |
String ehrdString = rs.getString(RedListUtil.EHRD);
|
|
252 |
String wisskString = rs.getString(RedListUtil.WISSK);
|
245 |
253 |
|
246 |
254 |
TaxonBase<?> taxonBase = null;
|
247 |
255 |
if(authorBasiString.trim().contains(RedListUtil.AUCT)){
|
... | ... | |
265 |
273 |
description.addElement(CommonTaxonName.NewInstance(trivialString, Language.GERMAN()));
|
266 |
274 |
}
|
267 |
275 |
|
|
276 |
//add annotations
|
|
277 |
addAnnotation(RedListUtil.FLOR+": "+florString, taxonBase);
|
|
278 |
addAnnotation(RedListUtil.ATLAS_IDX+": "+atlasIdxString, taxonBase);
|
|
279 |
addAnnotation(RedListUtil.KART+": "+kartString, taxonBase);
|
|
280 |
addAnnotation(RedListUtil.RL2015+": "+rl2015String, taxonBase);
|
|
281 |
addAnnotation(RedListUtil.EHRD+": "+ehrdString, taxonBase);
|
|
282 |
addAnnotation(RedListUtil.WISSK+": "+wisskString, taxonBase);
|
|
283 |
|
268 |
284 |
//check taxon name consistency
|
269 |
285 |
checkTaxonNameConsistency(id, taxNameString, hybString, taxonBase);
|
270 |
286 |
return taxonBase;
|
271 |
287 |
}
|
272 |
288 |
|
|
289 |
private void addAnnotation(String string, TaxonBase<?> taxonBase) {
|
|
290 |
if(CdmUtils.isNotBlank(string)){
|
|
291 |
taxonBase.addAnnotation(Annotation.NewInstance(string, AnnotationType.TECHNICAL(), Language.GERMAN()));
|
|
292 |
}
|
|
293 |
}
|
|
294 |
|
273 |
295 |
private void importAuthors(RedListGefaesspflanzenImportState state, ResultSet rs, NonViralName<?> name) throws SQLException {
|
274 |
296 |
|
275 |
297 |
long id = rs.getLong(RedListUtil.NAMNR);
|
... | ... | |
359 |
381 |
String ep3String = rs.getString(RedListUtil.EPI3);
|
360 |
382 |
String nomZusatzString = rs.getString(RedListUtil.NOM_ZUSATZ);
|
361 |
383 |
String hybString = rs.getString(RedListUtil.HYB);
|
|
384 |
String formelString = rs.getString(RedListUtil.FORMEL);
|
362 |
385 |
|
363 |
386 |
if(CdmUtils.isBlank(taxNameString) && CdmUtils.isBlank(ep1String)){
|
364 |
387 |
RedListUtil.logMessage(id, "No name found!", logger);
|
... | ... | |
402 |
425 |
}
|
403 |
426 |
//hybrid
|
404 |
427 |
if(CdmUtils.isNotBlank(hybString)){
|
|
428 |
//save hybrid formula
|
|
429 |
if(CdmUtils.isNotBlank(formelString)){
|
|
430 |
Annotation annotation = Annotation.NewDefaultLanguageInstance(formelString);
|
|
431 |
annotation.setAnnotationType(AnnotationType.TECHNICAL());
|
|
432 |
name.addAnnotation(annotation);
|
|
433 |
}
|
|
434 |
|
405 |
435 |
if(hybString.equals(RedListUtil.HYB_X)){
|
406 |
436 |
name.setBinomHybrid(true);
|
407 |
437 |
}
|
... | ... | |
449 |
479 |
RedListUtil.logMessage(id, "HYB is "+hybString+" but "+RedListUtil.HYB+" does not contain "+RedListUtil.HYB_SIGN, logger);
|
450 |
480 |
}
|
451 |
481 |
}
|
|
482 |
else if(hybString.equals(RedListUtil.HYB_XS)){
|
|
483 |
//nothing to do
|
|
484 |
}
|
452 |
485 |
else{
|
453 |
486 |
logger.error("HYB value "+hybString+" not yet handled");
|
454 |
487 |
}
|
... | ... | |
480 |
513 |
}
|
481 |
514 |
}
|
482 |
515 |
else{
|
483 |
|
if(!authorString.startsWith(authorshipCache)){
|
|
516 |
if(CdmUtils.isNotBlank(authorString) && !authorString.startsWith(authorshipCache)){
|
484 |
517 |
RedListUtil.logMessage(id, "Authorship inconsistent! name.authorhshipCache <-> Column "+RedListUtil.AUTOR+": "+authorshipCache+" <-> "+authorString, logger);
|
485 |
518 |
}
|
486 |
519 |
}
|
#5448 Import annotation infos