Revision 539b7820
Added by Andreas Müller over 5 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/bogota/BogotaSpecimenImport.java | ||
---|---|---|
73 | 73 |
extends SimpleExcelSpecimenImport<CONFIG> { |
74 | 74 |
|
75 | 75 |
private static final long serialVersionUID = -884838817884874228L; |
76 |
@SuppressWarnings("unused") |
|
76 | 77 |
private static final Logger logger = Logger.getLogger(BogotaSpecimenImport.class); |
77 | 78 |
|
78 | 79 |
private static final String COL_TAXON_UUID = "Platform Name ID = cdmID"; |
... | ... | |
134 | 135 |
@Override |
135 | 136 |
protected void firstPass(SimpleExcelSpecimenImportState<CONFIG> state) { |
136 | 137 |
|
137 |
HashMap<String, String> record = state.getOriginalRecord();
|
|
138 |
Map<String, String> record = state.getOriginalRecord(); |
|
138 | 139 |
|
139 | 140 |
String voucherId = getValue(record, COL_VOUCHER_ID); |
140 | 141 |
if (!isInInterval(state)){ |
... | ... | |
169 | 170 |
* @return |
170 | 171 |
*/ |
171 | 172 |
private Taxon getOrCreateNewTaxon(SimpleExcelSpecimenImportState<CONFIG> state, |
172 |
HashMap<String, String> record, String line) {
|
|
173 |
Map<String, String> record, String line) { |
|
173 | 174 |
String familyStr = record.get(COL_FAMILY); |
174 | 175 |
String genusStr = record.get(COL_GENUS); |
175 | 176 |
initTaxonMap(state); |
... | ... | |
242 | 243 |
* @return |
243 | 244 |
*/ |
244 | 245 |
private TaxonName makeSpeciesName(SimpleExcelSpecimenImportState<CONFIG> state, String line) { |
245 |
HashMap<String, String> record = state.getOriginalRecord();
|
|
246 |
Map<String, String> record = state.getOriginalRecord(); |
|
246 | 247 |
String genus = record.get(COL_GENUS); |
247 | 248 |
String species = record.get(COL_SPECIFIC_EPI); |
248 | 249 |
String basionymAuthorStr = record.get(COL_BASIONYM_AUTHOR); |
... | ... | |
297 | 298 |
protected void handleRecordForTaxon(SimpleExcelSpecimenImportState<CONFIG> state, |
298 | 299 |
String voucherId, String line, TaxonBase<?> taxonBase) { |
299 | 300 |
|
300 |
HashMap<String, String> record = state.getOriginalRecord();
|
|
301 |
Map<String, String> record = state.getOriginalRecord(); |
|
301 | 302 |
Taxon taxon = getTaxon(taxonBase); |
302 | 303 |
|
303 | 304 |
TaxonDescription taxonDescription = getTaxonDescription(state, line, taxon); |
... | ... | |
353 | 354 |
* @return |
354 | 355 |
*/ |
355 | 356 |
private DerivedUnit makeSpecimen(SimpleExcelSpecimenImportState<CONFIG> state, String line, |
356 |
HashMap<String, String> record, String voucherId, TaxonBase<?> taxonBase) {
|
|
357 |
Map<String, String> record, String voucherId, TaxonBase<?> taxonBase) { |
|
357 | 358 |
|
358 | 359 |
DerivedUnitFacade facade = DerivedUnitFacade.NewPreservedSpecimenInstance(); |
359 | 360 |
facade.setAccessionNumber(voucherId); |
... | ... | |
379 | 380 |
* @param name |
380 | 381 |
*/ |
381 | 382 |
private void makeTypus(DerivedUnit specimen, SimpleExcelSpecimenImportState<CONFIG> state, String line, |
382 |
HashMap<String, String> record, TaxonName name) {
|
|
383 |
Map<String, String> record, TaxonName name) { |
|
383 | 384 |
String typus = record.get(COL_TYPUS); |
384 | 385 |
if (typus != null){ |
385 | 386 |
SpecimenTypeDesignationStatus status; |
... | ... | |
402 | 403 |
* @param record |
403 | 404 |
*/ |
404 | 405 |
private void makeCollection(DerivedUnitFacade facade, SimpleExcelSpecimenImportState<CONFIG> state, |
405 |
String line, HashMap<String, String> record) {
|
|
406 |
String line, Map<String, String> record) { |
|
406 | 407 |
String strCollection = record.get(COL_COLLECTION); |
407 | 408 |
String collectionFormat = ".*\\([A-Z]{2,4}\\)"; |
408 | 409 |
if (!strCollection.matches(collectionFormat)){ |
... | ... | |
440 | 441 |
* @param record |
441 | 442 |
*/ |
442 | 443 |
private void makeHabitus(DerivedUnitFacade facade, SimpleExcelSpecimenImportState<CONFIG> state, String line, |
443 |
HashMap<String, String> record) {
|
|
444 |
Map<String, String> record) { |
|
444 | 445 |
String habitus = record.get(COL_HABITUS); |
445 | 446 |
if (habitus != null){ |
446 | 447 |
facade.setPlantDescription(habitus); |
... | ... | |
456 | 457 |
* @param voucherId |
457 | 458 |
*/ |
458 | 459 |
private void makeLocationFields(DerivedUnitFacade facade, SimpleExcelSpecimenImportState<CONFIG> state, String line, |
459 |
HashMap<String, String> record) {
|
|
460 |
Map<String, String> record) { |
|
460 | 461 |
//Altitude |
461 | 462 |
String strAltitudeFrom = record.get(COL_ALTITUDE_FROM); |
462 | 463 |
String strAltitudeTo = record.get(COL_ALTITUDE_TO); |
... | ... | |
595 | 596 |
* @param record |
596 | 597 |
*/ |
597 | 598 |
private void makeCollectorFields(DerivedUnitFacade facade, SimpleExcelSpecimenImportState<CONFIG> state, String line, |
598 |
HashMap<String, String> record) {
|
|
599 |
Map<String, String> record) { |
|
599 | 600 |
|
600 | 601 |
//collector number |
601 | 602 |
facade.setFieldNumber(record.get(COL_COLLECTOR_NUMBER)); |
... | ... | |
687 | 688 |
* @param taxonBase |
688 | 689 |
*/ |
689 | 690 |
private void makeDetermination(DerivedUnit specimen, SimpleExcelSpecimenImportState<CONFIG> state, String line, |
690 |
HashMap<String, String> record, TaxonName taxonName) {
|
|
691 |
Map<String, String> record, TaxonName taxonName) { |
|
691 | 692 |
|
692 | 693 |
DeterminationEvent determination; |
693 | 694 |
determination = DeterminationEvent.NewInstance(taxonName, specimen); |
... | ... | |
723 | 724 |
* @return |
724 | 725 |
*/ |
725 | 726 |
private TeamOrPersonBase<?> makeDeterminer(SimpleExcelSpecimenImportState<CONFIG> state, |
726 |
HashMap<String, String> record, String line) {
|
|
727 |
Map<String, String> record, String line) { |
|
727 | 728 |
String identifier = record.get(COL_IDENTIFIER); |
728 | 729 |
if (identifier == null){ |
729 | 730 |
return null; |
... | ... | |
763 | 764 |
* @return |
764 | 765 |
*/ |
765 | 766 |
private TimePeriod makeIdentificationDate(SimpleExcelSpecimenImportState<CONFIG> state, |
766 |
HashMap<String, String> record, String line) {
|
|
767 |
Map<String, String> record, String line) { |
|
767 | 768 |
String strDate = record.get(COL_IDENTIFICATION_DATE); |
768 | 769 |
if (strDate == null || strDate.equals("s.n.")){ |
769 | 770 |
return null; |
... | ... | |
788 | 789 |
* @return |
789 | 790 |
*/ |
790 | 791 |
private DefinedTerm makeDeterminationQualifier(SimpleExcelSpecimenImportState<CONFIG> state, |
791 |
HashMap<String, String> record, String line) {
|
|
792 |
Map<String, String> record, String line) { |
|
792 | 793 |
String qualifier = record.get(COL_IDENTIFICATION_QUALIFIER); |
793 | 794 |
if (qualifier != null){ |
794 | 795 |
try { |
... | ... | |
835 | 836 |
* @return |
836 | 837 |
*/ |
837 | 838 |
private TaxonBase<?> getTaxonByCdmId(SimpleExcelSpecimenImportState<CONFIG> state, String line, |
838 |
HashMap<String, String> record, String noStr) {
|
|
839 |
Map<String, String> record, String noStr) { |
|
839 | 840 |
|
840 | 841 |
String strUuidTaxon = record.get(COL_TAXON_UUID); |
841 | 842 |
if (strUuidTaxon != null && ! state.getConfig().isOnlyNonCdmTaxa()){ |
Also available in: Unified diff
cleanup