Revision 9dbe8889
Added by Andreas Müller over 2 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/bogota/BogotaSpecimenImport.java | ||
---|---|---|
21 | 21 |
|
22 | 22 |
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade; |
23 | 23 |
import eu.etaxonomy.cdm.common.CdmUtils; |
24 |
import eu.etaxonomy.cdm.io.common.utils.ImportDeduplicationHelper; |
|
25 | 24 |
import eu.etaxonomy.cdm.model.agent.AgentBase; |
26 | 25 |
import eu.etaxonomy.cdm.model.agent.Institution; |
27 | 26 |
import eu.etaxonomy.cdm.model.agent.Person; |
... | ... | |
118 | 117 |
private static final UUID uuidExtTypeIdentificationHistory = UUID.fromString("7cee5c29-e16b-4e6f-ad57-bf7044259375"); |
119 | 118 |
private static final UUID uuidDetQualVelAff = UUID.fromString("511a0c23-2646-4035-b570-36bdc2eb5557"); |
120 | 119 |
|
121 |
// @SuppressWarnings("unchecked") |
|
122 |
private ImportDeduplicationHelper<SimpleExcelSpecimenImportState<?>> deduplicationHelper; |
|
123 |
|
|
124 | 120 |
private final Map<String, TaxonNode> taxonNodeMap = new HashMap<>(); |
125 | 121 |
private Reference secRef; |
126 | 122 |
|
... | ... | |
258 | 254 |
state.getResult().addWarning("Name not parsable: " + fullName); |
259 | 255 |
} |
260 | 256 |
if (taxonNodeMap.get(titleCache)== null){ |
261 |
getDeduplicationHelper(state).replaceAuthorNamesAndNomRef(state, newName);
|
|
257 |
state.getDeduplicationHelper().replaceAuthorNamesAndNomRef(newName);
|
|
262 | 258 |
newName.addSource(makeOriginalSource(state)); |
263 | 259 |
} |
264 | 260 |
|
... | ... | |
417 | 413 |
Collection collection = Collection.NewInstance(); |
418 | 414 |
collection.setName(collectionName); |
419 | 415 |
collection.setCode(collectionCode); |
420 |
collection = getDeduplicationHelper(state).getExistingCollection(state, collection);
|
|
416 |
collection = state.getDeduplicationHelper().getExistingCollection(collection);
|
|
421 | 417 |
facade.setCollection(collection); |
422 | 418 |
} |
423 | 419 |
|
424 |
|
|
425 |
/** |
|
426 |
* @param state |
|
427 |
* @return |
|
428 |
*/ |
|
429 |
private ImportDeduplicationHelper<SimpleExcelSpecimenImportState<?>> getDeduplicationHelper(SimpleExcelSpecimenImportState<CONFIG> state) { |
|
430 |
if (deduplicationHelper == null){ |
|
431 |
deduplicationHelper = ImportDeduplicationHelper.NewInstance(this, state); |
|
432 |
} |
|
433 |
return deduplicationHelper; |
|
434 |
} |
|
435 |
|
|
436 |
|
|
437 |
/** |
|
438 |
* @param facade |
|
439 |
* @param state |
|
440 |
* @param line |
|
441 |
* @param record |
|
442 |
*/ |
|
443 | 420 |
private void makeHabitus(DerivedUnitFacade facade, SimpleExcelSpecimenImportState<CONFIG> state, String line, |
444 | 421 |
Map<String, String> record) { |
445 | 422 |
String habitus = record.get(COL_HABITUS); |
... | ... | |
648 | 625 |
state.getResult().addError(message, null, line); |
649 | 626 |
collector = null; |
650 | 627 |
} |
651 |
collector = getDeduplicationHelper(state).getExistingAgent(state, collector);
|
|
628 |
collector = state.getDeduplicationHelper().getExistingAgent(collector);
|
|
652 | 629 |
facade.setCollector(collector); |
653 | 630 |
} |
654 | 631 |
|
... | ... | |
751 | 728 |
} |
752 | 729 |
person.setFamilyName(familyName); |
753 | 730 |
person.setInitials(initials); |
754 |
TeamOrPersonBase<?> result = getDeduplicationHelper(state).getExistingAuthor(state, person);
|
|
731 |
TeamOrPersonBase<?> result = state.getDeduplicationHelper().getExistingAuthor(person);
|
|
755 | 732 |
return result; |
756 | 733 |
} |
757 | 734 |
} |
Also available in: Unified diff
ref #9890 move importDeduplicationHelper to import state and include state in helper (cont.) - appimport