Revision c5d04eba
Added by Andreas Müller over 2 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/greece/FloraHellenicaTaxonImport.java | ||
---|---|---|
29 | 29 |
import eu.etaxonomy.cdm.model.description.State; |
30 | 30 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
31 | 31 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
32 |
import eu.etaxonomy.cdm.model.name.IBotanicalName; |
|
33 | 32 |
import eu.etaxonomy.cdm.model.name.Rank; |
33 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
34 | 34 |
import eu.etaxonomy.cdm.model.name.TaxonNameFactory; |
35 | 35 |
import eu.etaxonomy.cdm.model.reference.Reference; |
36 | 36 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
... | ... | |
393 | 393 |
nameStr = nameStr.substring(0, nameStr.length() - "s.str.".length() ).trim(); |
394 | 394 |
} |
395 | 395 |
Rank rank = isSubSpecies ? Rank.SUBSPECIES() : Rank.SPECIES(); |
396 |
IBotanicalName name = (IBotanicalName)parser.parseFullName(nameStr, state.getConfig().getNomenclaturalCode(), rank);
|
|
396 |
TaxonName name = (TaxonName)parser.parseFullName(nameStr, state.getConfig().getNomenclaturalCode(), rank);
|
|
397 | 397 |
if (name.isProtectedTitleCache()){ |
398 | 398 |
logger.warn(line + "Name could not be parsed: " + nameStr); |
399 | 399 |
} |
... | ... | |
450 | 450 |
return CdmUtils.concat(" ", new String[]{genusStr, speciesStr, speciesAuthorStr}); |
451 | 451 |
} |
452 | 452 |
|
453 |
/** |
|
454 |
* @param state |
|
455 |
* @param record |
|
456 |
* @param genusStr |
|
457 |
* @return |
|
458 |
*/ |
|
459 | 453 |
private TaxonNode makeGenusNode(SimpleExcelTaxonImportState<CONFIG> state, |
460 | 454 |
Map<String, String> record, String genusStr) { |
461 |
IBotanicalName name = TaxonNameFactory.NewBotanicalInstance(Rank.GENUS());
|
|
455 |
TaxonName name = TaxonNameFactory.NewBotanicalInstance(Rank.GENUS());
|
|
462 | 456 |
name.setGenusOrUninomial(genusStr); |
463 | 457 |
name = replaceNameAuthorsAndReferences(state, name); |
464 | 458 |
Taxon genus = Taxon.NewInstance(name, getSecReference(state)); |
... | ... | |
470 | 464 |
return genusNode; |
471 | 465 |
} |
472 | 466 |
|
473 |
/** |
|
474 |
* @param state |
|
475 |
* @param parentStr |
|
476 |
* @return |
|
477 |
*/ |
|
478 | 467 |
private TaxonNode getParent(SimpleExcelTaxonImportState<CONFIG> state, String parentStr) { |
479 | 468 |
Taxon taxon = state.getHigherTaxon(parentStr); |
480 | 469 |
|
481 | 470 |
return taxon == null ? null : taxon.getTaxonNodes().iterator().next(); |
482 | 471 |
} |
483 | 472 |
|
484 |
/** |
|
485 |
* @param record |
|
486 |
* @param state |
|
487 |
* @return |
|
488 |
*/ |
|
489 | 473 |
private TaxonNode getFamilyTaxon(Map<String, String> record, SimpleExcelTaxonImportState<CONFIG> state) { |
490 | 474 |
String familyStr = getValue(record, "Family"); |
491 | 475 |
if (familyStr == null){ |
... | ... | |
498 | 482 |
if (family != null){ |
499 | 483 |
familyNode = family.getTaxonNodes().iterator().next(); |
500 | 484 |
}else{ |
501 |
IBotanicalName name = makeFamilyName(state, familyStr);
|
|
485 |
TaxonName name = makeFamilyName(state, familyStr);
|
|
502 | 486 |
name = replaceNameAuthorsAndReferences(state, name); |
503 | 487 |
|
504 | 488 |
Reference sec = getSecReference(state); |
... | ... | |
530 | 514 |
if (group != null){ |
531 | 515 |
groupNode = group.getTaxonNodes().iterator().next(); |
532 | 516 |
}else{ |
533 |
IBotanicalName name = makeFamilyName(state, groupStr);
|
|
517 |
TaxonName name = makeFamilyName(state, groupStr);
|
|
534 | 518 |
name = replaceNameAuthorsAndReferences(state, name); |
535 | 519 |
|
536 | 520 |
Reference sec = getSecReference(state); |
... | ... | |
554 | 538 |
classification.setUuid(state.getConfig().getClassificationUuid()); |
555 | 539 |
classification.getRootNode().setUuid(rootUuid); |
556 | 540 |
|
557 |
IBotanicalName plantaeName = TaxonNameFactory.NewBotanicalInstance(Rank.KINGDOM());
|
|
541 |
TaxonName plantaeName = TaxonNameFactory.NewBotanicalInstance(Rank.KINGDOM());
|
|
558 | 542 |
plantaeName.setGenusOrUninomial("Plantae"); |
559 | 543 |
plantaeName = replaceNameAuthorsAndReferences(state, plantaeName); |
560 | 544 |
|
... | ... | |
568 | 552 |
return rootNode; |
569 | 553 |
} |
570 | 554 |
|
571 |
/** |
|
572 |
* @param desc |
|
573 |
* @param string |
|
574 |
* @param uuidUserDefinedAnnotationTypeVocabulary |
|
575 |
*/ |
|
576 | 555 |
private void handleDistribution(SimpleExcelTaxonImportState<CONFIG> state, |
577 | 556 |
TaxonDescription desc, String key, UUID uuid, String line, String id) { |
578 | 557 |
Map<String, String> record = state.getOriginalRecord(); |
Also available in: Unified diff
cleanup