Revision 94dab8de
Added by Andreas Müller over 2 years ago
app-import/src/main/java/eu/etaxonomy/cdm/app/cyprus/CyprusImagesActivator.java | ||
---|---|---|
100 | 100 |
CdmApplicationController app = CdmIoApplicationController.NewInstance(cdmDestination, DbSchemaValidation.VALIDATE); |
101 | 101 |
TransactionStatus tx = app.startTransaction(); |
102 | 102 |
|
103 |
deduplicationHelper = (ImportDeduplicationHelper)ImportDeduplicationHelper.NewInstance(app); |
|
103 |
deduplicationHelper = (ImportDeduplicationHelper)ImportDeduplicationHelper.NewInstance(app, null);
|
|
104 | 104 |
|
105 | 105 |
File file = new File(path); |
106 | 106 |
String[] fileList = file.list(); |
... | ... | |
635 | 635 |
CdmApplicationController app = CdmIoApplicationController.NewInstance(cdmDestination, DbSchemaValidation.VALIDATE); |
636 | 636 |
TransactionStatus tx = app.startTransaction(); |
637 | 637 |
|
638 |
deduplicationHelper = (ImportDeduplicationHelper<SimpleExcelTaxonImportState<?>>)ImportDeduplicationHelper.NewInstance(app);
|
|
638 |
deduplicationHelper = (ImportDeduplicationHelper)ImportDeduplicationHelper.NewInstance(app, null);
|
|
639 | 639 |
|
640 | 640 |
List<Media> list = app.getMediaService().list(Media.class, null, null, null, null); |
641 | 641 |
for (Media media : list){ |
app-import/src/main/java/eu/etaxonomy/cdm/io/bogota/BogotaChecklistTaxonImport.java | ||
---|---|---|
17 | 17 |
import org.springframework.transaction.TransactionStatus; |
18 | 18 |
|
19 | 19 |
import eu.etaxonomy.cdm.common.CdmUtils; |
20 |
import eu.etaxonomy.cdm.io.common.utils.ImportDeduplicationHelper; |
|
21 | 20 |
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImport; |
22 | 21 |
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState; |
23 | 22 |
import eu.etaxonomy.cdm.model.common.IdentifiableSource; |
... | ... | |
57 | 56 |
private static UUID rootUuid = UUID.fromString("d66eda18-4c11-4472-bfe8-f6cd5ed95c9f"); |
58 | 57 |
private static UUID plantaeUuid = UUID.fromString("032fc183-eb4f-4f19-a290-28597a849096"); |
59 | 58 |
|
60 |
@SuppressWarnings("unchecked") |
|
61 |
private ImportDeduplicationHelper<SimpleExcelTaxonImportState<?>> deduplicationHelper |
|
62 |
= (ImportDeduplicationHelper<SimpleExcelTaxonImportState<?>>)ImportDeduplicationHelper.NewStandaloneInstance(); |
|
63 |
|
|
64 | 59 |
private String lastGenus; |
65 | 60 |
private NonViralNameParserImpl parser = NonViralNameParserImpl.NewInstance(); |
66 | 61 |
private BasionymRelationCreator basionymCreator = new BasionymRelationCreator(); |
... | ... | |
174 | 169 |
} |
175 | 170 |
IBotanicalName name = (IBotanicalName)parser.parseFullName(nameStr, state.getConfig().getNomenclaturalCode(), rank); |
176 | 171 |
name.addImportSource(noStr, getNamespace(state.getConfig()), getSourceCitation(state), null); |
177 |
name = deduplicationHelper.getExistingName(state, name);
|
|
172 |
name = state.getDeduplicationHelper().getExistingName(state, name);
|
|
178 | 173 |
if (name.isProtectedTitleCache()){ |
179 | 174 |
logger.warn(line + "Misapplied name could not be parsed: " + nameStr); |
180 | 175 |
} |
181 |
deduplicationHelper.replaceAuthorNamesAndNomRef(state, name);
|
|
176 |
state.getDeduplicationHelper().replaceAuthorNamesAndNomRef(state, name);
|
|
182 | 177 |
|
183 | 178 |
Taxon misApp = Taxon.NewInstance(name, null); |
184 | 179 |
if (auctRequired){ |
... | ... | |
211 | 206 |
Rank rank = Rank.SPECIES(); |
212 | 207 |
IBotanicalName name = (IBotanicalName)parser.parseFullName(nameStr, state.getConfig().getNomenclaturalCode(), rank); |
213 | 208 |
name.addImportSource(noStr, getNamespace(state.getConfig()), getSourceCitation(state), null); |
214 |
name = deduplicationHelper.getExistingName(state, name);
|
|
209 |
name = state.getDeduplicationHelper().getExistingName(state, name);
|
|
215 | 210 |
if (name.isProtectedTitleCache()){ |
216 | 211 |
logger.warn(line + "Synonym could not be parsed: " + nameStr); |
217 | 212 |
} |
218 |
deduplicationHelper.replaceAuthorNamesAndNomRef(state, name);
|
|
213 |
state.getDeduplicationHelper().replaceAuthorNamesAndNomRef(state, name);
|
|
219 | 214 |
|
220 | 215 |
Synonym synonym = Synonym.NewInstance(name, getSecReference(state)); |
221 | 216 |
synonym.addImportSource(noStr, getNamespace(state.getConfig()), getSourceCitation(state), null); |
... | ... | |
242 | 237 |
Rank rank = Rank.SUBSPECIES(); |
243 | 238 |
IBotanicalName name = (IBotanicalName)parser.parseFullName(split.trim(), state.getConfig().getNomenclaturalCode(), rank); |
244 | 239 |
name.addImportSource(noStr, getNamespace(state.getConfig()), getSourceCitation(state), null); |
245 |
name = deduplicationHelper.getExistingName(state, name);
|
|
240 |
name = state.getDeduplicationHelper().getExistingName(state, name);
|
|
246 | 241 |
if (name.isProtectedTitleCache()){ |
247 | 242 |
logger.warn(line + "Infraspecific taxon could not be parsed: " + split.trim()); |
248 | 243 |
} |
249 |
deduplicationHelper.replaceAuthorNamesAndNomRef(state, name);
|
|
244 |
state.getDeduplicationHelper().replaceAuthorNamesAndNomRef(state, name);
|
|
250 | 245 |
|
251 | 246 |
Taxon subSpecies = Taxon.NewInstance(name, getSecReference(state)); |
252 | 247 |
subSpecies.addImportSource(noStr, getNamespace(state.getConfig()), getSourceCitation(state), null); |
... | ... | |
279 | 274 |
Rank rank = Rank.SPECIES(); |
280 | 275 |
IBotanicalName name = (IBotanicalName)parser.parseFullName(nameStr, state.getConfig().getNomenclaturalCode(), rank); |
281 | 276 |
name.addImportSource(noStr, getNamespace(state.getConfig()), getSourceCitation(state), null); |
282 |
name = deduplicationHelper.getExistingName(state, name);
|
|
277 |
name = state.getDeduplicationHelper().getExistingName(state, name);
|
|
283 | 278 |
if (name.isProtectedTitleCache()){ |
284 | 279 |
logger.warn(line + "Name could not be parsed: " + nameStr); |
285 | 280 |
} |
286 |
deduplicationHelper.replaceAuthorNamesAndNomRef(state, name);
|
|
281 |
state.getDeduplicationHelper().replaceAuthorNamesAndNomRef(state, name);
|
|
287 | 282 |
|
288 | 283 |
Taxon taxon = Taxon.NewInstance(name, getSecReference(state)); |
289 | 284 |
|
app-import/src/main/java/eu/etaxonomy/cdm/io/caryo/CaryoAizoaceaeExcelImport.java | ||
---|---|---|
23 | 23 |
import eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator; |
24 | 24 |
import eu.etaxonomy.cdm.common.CdmUtils; |
25 | 25 |
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException; |
26 |
import eu.etaxonomy.cdm.io.common.utils.ImportDeduplicationHelper; |
|
27 | 26 |
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImport; |
28 | 27 |
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState; |
29 | 28 |
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase; |
... | ... | |
68 | 67 |
private Set<UUID> createdNames = new HashSet<>(); |
69 | 68 |
|
70 | 69 |
private SimpleExcelTaxonImportState<CaryoAizoaceaeExcelImportConfigurator> state; |
71 |
private ImportDeduplicationHelper<SimpleExcelTaxonImportState<?>> dedupHelper = null; |
|
72 | 70 |
|
73 | 71 |
@Override |
74 | 72 |
protected void firstPass(SimpleExcelTaxonImportState<CaryoAizoaceaeExcelImportConfigurator> state) { |
... | ... | |
235 | 233 |
|
236 | 234 |
private TaxonName dedupliateNameParts(TaxonName name) { |
237 | 235 |
if (state.getConfig().isDoDeduplicate()){ |
238 |
getDedupHelper().replaceAuthorNamesAndNomRef(state, name);
|
|
236 |
state.getDeduplicationHelper().replaceAuthorNamesAndNomRef(state, name);
|
|
239 | 237 |
} |
240 | 238 |
return name; |
241 | 239 |
} |
242 | 240 |
|
243 |
private ImportDeduplicationHelper<SimpleExcelTaxonImportState<?>> getDedupHelper() { |
|
244 |
if (dedupHelper == null){ |
|
245 |
dedupHelper |
|
246 |
= ImportDeduplicationHelper.NewInstance(this, state); |
|
247 |
} |
|
248 |
return dedupHelper; |
|
249 |
} |
|
250 |
|
|
251 | 241 |
private String getOtherAuthors(List<TaxonName> otherNames) { |
252 | 242 |
String result = ""; |
253 | 243 |
for (TaxonName name : otherNames){ |
... | ... | |
383 | 373 |
private void newTransaction(SimpleExcelTaxonImportState<CaryoAizoaceaeExcelImportConfigurator> state) { |
384 | 374 |
commitTransaction(state.getTransactionStatus()); |
385 | 375 |
secRef = null; |
386 |
dedupHelper = null;
|
|
376 |
state.getDeduplicationHelper().reset();
|
|
387 | 377 |
state.setSourceReference(null); |
388 | 378 |
System.gc(); |
389 | 379 |
state.setTransactionStatus(startTransaction()); |
app-import/src/main/java/eu/etaxonomy/cdm/io/greece/FloraHellenicaImageImport.java | ||
---|---|---|
28 | 28 |
import eu.etaxonomy.cdm.api.service.config.MatchingTaxonConfigurator; |
29 | 29 |
import eu.etaxonomy.cdm.common.URI; |
30 | 30 |
import eu.etaxonomy.cdm.io.common.CdmImportBase; |
31 |
import eu.etaxonomy.cdm.io.common.utils.ImportDeduplicationHelper; |
|
32 | 31 |
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState; |
33 | 32 |
import eu.etaxonomy.cdm.model.agent.Person; |
34 | 33 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
... | ... | |
60 | 59 |
private static final String BASE_URL = "https://media.e-taxonomy.eu/flora-greece/"; |
61 | 60 |
private static final String IMAGE_FOLDER = "////BGBM-PESIHPC/Greece/thumbs/"; |
62 | 61 |
|
63 |
@SuppressWarnings("unchecked") |
|
64 |
private ImportDeduplicationHelper<SimpleExcelTaxonImportState<?>> deduplicationHelper = (ImportDeduplicationHelper<SimpleExcelTaxonImportState<?>>)ImportDeduplicationHelper.NewInstance(this); |
|
65 |
|
|
66 | 62 |
@Override |
67 | 63 |
protected void doInvoke(SimpleExcelTaxonImportState<CONFIG> state) { |
68 | 64 |
TransactionStatus tx = this.startTransaction(); |
... | ... | |
158 | 154 |
}else{ |
159 | 155 |
person.setTitleCache("artistStr", true); |
160 | 156 |
} |
161 |
person = deduplicationHelper.getExistingAuthor(state, person);
|
|
157 |
person = state.getDeduplicationHelper().getExistingAuthor(state, person);
|
|
162 | 158 |
|
163 | 159 |
media.setArtist(person); |
164 | 160 |
//copyright |
165 | 161 |
Rights right = Rights.NewInstance(); |
166 | 162 |
right.setType(RightsType.COPYRIGHT()); |
167 | 163 |
right.setAgent(person); |
168 |
right = deduplicationHelper.getExistingCopyright(state, right);
|
|
164 |
right = state.getDeduplicationHelper().getExistingCopyright(state, right);
|
|
169 | 165 |
media.addRights(right); |
170 | 166 |
} |
171 | 167 |
|
app-import/src/main/java/eu/etaxonomy/cdm/io/greece/FloraHellenicaImportBase.java | ||
---|---|---|
15 | 15 |
|
16 | 16 |
import org.apache.log4j.Logger; |
17 | 17 |
|
18 |
import eu.etaxonomy.cdm.io.common.utils.ImportDeduplicationHelper; |
|
19 | 18 |
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImport; |
20 | 19 |
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState; |
21 | 20 |
import eu.etaxonomy.cdm.model.common.IdentifiableSource; |
... | ... | |
44 | 43 |
private Reference secReference; |
45 | 44 |
private Reference secReference2; |
46 | 45 |
|
47 |
@SuppressWarnings("unchecked") |
|
48 |
private ImportDeduplicationHelper<SimpleExcelTaxonImportState<?>> deduplicationHelper = (ImportDeduplicationHelper<SimpleExcelTaxonImportState<?>>)ImportDeduplicationHelper.NewInstance(this); |
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
/** |
|
53 |
* @param taxon |
|
54 |
* @return |
|
55 |
*/ |
|
56 | 46 |
protected TaxonDescription getTaxonDescription(Taxon taxon) { |
57 | 47 |
if (!taxon.getDescriptions().isEmpty()){ |
58 | 48 |
return taxon.getDescriptions().iterator().next(); |
... | ... | |
161 | 151 |
} |
162 | 152 |
|
163 | 153 |
protected <NAME extends INonViralName> NAME replaceNameAuthorsAndReferences(SimpleExcelTaxonImportState<CONFIG> state, NAME name) { |
164 |
NAME result = deduplicationHelper.getExistingName(state, name);
|
|
165 |
deduplicationHelper.replaceAuthorNamesAndNomRef(state, result);
|
|
154 |
NAME result = state.getDeduplicationHelper().getExistingName(state, name);
|
|
155 |
state.getDeduplicationHelper().replaceAuthorNamesAndNomRef(state, result);
|
|
166 | 156 |
return result; |
167 | 157 |
} |
168 | 158 |
|
app-import/src/main/java/eu/etaxonomy/cdm/io/lichenes/LichenesGeneraTaxonImport.java | ||
---|---|---|
18 | 18 |
import org.springframework.stereotype.Component; |
19 | 19 |
|
20 | 20 |
import eu.etaxonomy.cdm.common.CdmUtils; |
21 |
import eu.etaxonomy.cdm.io.common.utils.ImportDeduplicationHelper; |
|
22 | 21 |
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImport; |
23 | 22 |
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState; |
24 | 23 |
import eu.etaxonomy.cdm.model.common.Annotation; |
... | ... | |
399 | 398 |
} |
400 | 399 |
|
401 | 400 |
private void replaceNameAuthorsAndReferences(SimpleExcelTaxonImportState<CONFIG> state, INonViralName name) { |
402 |
dedupHelper().replaceAuthorNamesAndNomRef(state, name); |
|
403 |
} |
|
404 |
|
|
405 |
private ImportDeduplicationHelper<SimpleExcelTaxonImportState<CONFIG>> dedupHelper; |
|
406 |
private ImportDeduplicationHelper<SimpleExcelTaxonImportState<CONFIG>> dedupHelper() { |
|
407 |
if (dedupHelper == null) { |
|
408 |
dedupHelper = (ImportDeduplicationHelper)ImportDeduplicationHelper.NewStandaloneInstance(); |
|
409 |
} |
|
410 |
return dedupHelper; |
|
401 |
state.getDeduplicationHelper().replaceAuthorNamesAndNomRef(state, name); |
|
411 | 402 |
} |
412 | 403 |
|
413 | 404 |
@Override |
app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/excel/RedListGefaesspflanzenTaxonExcelImport.java | ||
---|---|---|
18 | 18 |
import org.springframework.transaction.TransactionStatus; |
19 | 19 |
|
20 | 20 |
import eu.etaxonomy.cdm.common.CdmUtils; |
21 |
import eu.etaxonomy.cdm.io.common.utils.ImportDeduplicationHelper; |
|
22 | 21 |
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImport; |
23 | 22 |
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState; |
24 | 23 |
import eu.etaxonomy.cdm.model.common.IdentifiableSource; |
... | ... | |
61 | 60 |
private static UUID rootUuid = UUID.fromString("235ae474-227f-438a-b132-4508053fcb1c"); |
62 | 61 |
private static UUID plantaeUuid = UUID.fromString("31bd1b7c-245a-416d-b076-aa090c7469ce"); |
63 | 62 |
|
64 |
@SuppressWarnings("unchecked") |
|
65 |
private ImportDeduplicationHelper<SimpleExcelTaxonImportState<?>> deduplicationHelper |
|
66 |
= (ImportDeduplicationHelper<SimpleExcelTaxonImportState<?>>)ImportDeduplicationHelper.NewStandaloneInstance(); |
|
67 |
|
|
68 | 63 |
private NonViralNameParserImpl parser = NonViralNameParserImpl.NewInstance(); |
69 | 64 |
private BasionymRelationCreator basionymCreator = new BasionymRelationCreator(); |
70 | 65 |
|
... | ... | |
161 | 156 |
Rank rank = Rank.SPECIES(); |
162 | 157 |
IBotanicalName name = (IBotanicalName)parser.parseFullName(nameStr, state.getConfig().getNomenclaturalCode(), rank); |
163 | 158 |
name.addImportSource(noStr, getNamespace(state.getConfig()), getSourceCitation(state), null); |
164 |
name = deduplicationHelper.getExistingName(state, name);
|
|
159 |
name = state.getDeduplicationHelper().getExistingName(state, name);
|
|
165 | 160 |
if (name.isProtectedTitleCache()){ |
166 | 161 |
logger.warn(line + "Name could not be parsed: " + nameStr); |
167 | 162 |
} |
168 | 163 |
|
169 |
deduplicationHelper.replaceAuthorNamesAndNomRef(state, name);
|
|
164 |
state.getDeduplicationHelper().replaceAuthorNamesAndNomRef(state, name);
|
|
170 | 165 |
|
171 | 166 |
TaxonBase<?> taxon; |
172 | 167 |
if ("1".equals(synFlag) || isAuct){ |
app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/germanSL/GermanSLTaxonImport.java | ||
---|---|---|
20 | 20 |
|
21 | 21 |
import eu.etaxonomy.cdm.common.CdmUtils; |
22 | 22 |
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException; |
23 |
import eu.etaxonomy.cdm.io.common.utils.ImportDeduplicationHelper; |
|
24 | 23 |
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState; |
25 | 24 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
26 | 25 |
import eu.etaxonomy.cdm.model.common.Language; |
... | ... | |
76 | 75 |
|
77 | 76 |
private static final String UUID_ = "UUID"; |
78 | 77 |
|
79 |
|
|
80 | 78 |
public static final String TAXON_NAMESPACE = "1.3.4"; |
81 | 79 |
|
82 |
@SuppressWarnings("unchecked") |
|
83 |
protected ImportDeduplicationHelper<SimpleExcelTaxonImportState<?>> deduplicationHelper |
|
84 |
= (ImportDeduplicationHelper<SimpleExcelTaxonImportState<?>>)ImportDeduplicationHelper.NewStandaloneInstance(); |
|
85 |
|
|
86 |
|
|
87 | 80 |
@Override |
88 | 81 |
protected String getWorksheetName(GermanSLImportConfigurator config) { |
89 | 82 |
return "1.3.4"; |
... | ... | |
283 | 276 |
if (fullName.isProtectedTitleCache()){ |
284 | 277 |
logger.warn(line + "Name could not be parsed: " + fullNameStr ); |
285 | 278 |
}else{ |
286 |
getDeduplicationHelper(state).replaceAuthorNamesAndNomRef(state, fullName);
|
|
279 |
state.getDeduplicationHelper().replaceAuthorNamesAndNomRef(state, fullName);
|
|
287 | 280 |
// replaceAuthorNamesAndNomRef(state, fullName); |
288 | 281 |
} |
289 | 282 |
// BotanicalName existingName = getExistingName(state, fullName); |
... | ... | |
296 | 289 |
return result; |
297 | 290 |
} |
298 | 291 |
|
299 |
/** |
|
300 |
* @param state |
|
301 |
* @return |
|
302 |
*/ |
|
303 |
protected ImportDeduplicationHelper<SimpleExcelTaxonImportState<?>> getDeduplicationHelper(SimpleExcelTaxonImportState<?> state) { |
|
304 |
if (deduplicationHelper == null){ |
|
305 |
deduplicationHelper = ImportDeduplicationHelper.NewInstance(this, state); |
|
306 |
} |
|
307 |
return deduplicationHelper; |
|
308 |
} |
|
309 |
|
|
310 |
|
|
311 |
|
|
312 |
/** |
|
313 |
* @param line |
|
314 |
* @param state |
|
315 |
* @param rankStr |
|
316 |
* @return |
|
317 |
*/ |
|
318 | 292 |
private Rank makeRank(String line, SimpleExcelTaxonImportState<GermanSLImportConfigurator> state, String rankStr) { |
319 | 293 |
Rank rank = null; |
320 | 294 |
try { |
app-import/src/main/java/eu/etaxonomy/cdm/io/salvador/SalvadorSpecimenImport.java | ||
---|---|---|
25 | 25 |
|
26 | 26 |
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade; |
27 | 27 |
import eu.etaxonomy.cdm.common.URI; |
28 |
import eu.etaxonomy.cdm.io.common.utils.ImportDeduplicationHelper; |
|
29 | 28 |
import eu.etaxonomy.cdm.io.csv.in.CsvImportBase; |
30 | 29 |
import eu.etaxonomy.cdm.model.agent.Person; |
31 | 30 |
import eu.etaxonomy.cdm.model.agent.Team; |
... | ... | |
63 | 62 |
|
64 | 63 |
private static final long serialVersionUID = -2165916187195347780L; |
65 | 64 |
|
66 |
private ImportDeduplicationHelper<?> dedupHelper; |
|
67 |
|
|
68 |
/** |
|
69 |
* {@inheritDoc} |
|
70 |
*/ |
|
71 | 65 |
@Override |
72 | 66 |
protected void handleSingleLine(SalvadorSpecimenImportState state) { |
73 | 67 |
|
74 |
initDedupHelper(); |
|
75 | 68 |
try { |
76 | 69 |
UUID factUuid = UUID.fromString(state.getCurrentRecord().get("specimenFactUuid")); |
77 | 70 |
|
... | ... | |
101 | 94 |
} |
102 | 95 |
} |
103 | 96 |
|
104 |
|
|
105 |
/** |
|
106 |
* |
|
107 |
*/ |
|
108 |
private void initDedupHelper() { |
|
109 |
if (dedupHelper == null){ |
|
110 |
dedupHelper = ImportDeduplicationHelper.NewStandaloneInstance(); |
|
111 |
} |
|
112 |
} |
|
113 |
|
|
114 |
|
|
115 |
/** |
|
116 |
* @param config |
|
117 |
* @param facade |
|
118 |
* @param importResult |
|
119 |
*/ |
|
120 | 97 |
private void makeSpecimenDuplicate(SalvadorSpecimenImportState state, |
121 | 98 |
DerivedUnitFacade facade) { |
122 | 99 |
|
... | ... | |
285 | 262 |
//collector |
286 | 263 |
TeamOrPersonBase<?> collector = makeCollectorTeam(state, record, row); |
287 | 264 |
if (collector != null){ |
288 |
collector = dedupHelper.getExistingAuthor(null, collector);
|
|
265 |
collector = state.getDeduplicationHelper().getExistingAuthor(null, collector);
|
|
289 | 266 |
facade.setCollector(collector); |
290 | 267 |
} |
291 | 268 |
|
... | ... | |
592 | 569 |
state.getResult().addWarning(message, row); |
593 | 570 |
result.setTitleCache(str, true); |
594 | 571 |
} |
595 |
result = dedupHelper.getExistingAuthor(null, result);
|
|
572 |
result = state.getDeduplicationHelper().getExistingAuthor(null, result);
|
|
596 | 573 |
|
597 | 574 |
team.addTeamMember(result); |
598 | 575 |
return ; |
... | ... | |
605 | 582 |
collectionMap = new HashMap<>(); |
606 | 583 |
fieldUnitMap = new HashMap<>(); |
607 | 584 |
taxonDescMap = new HashMap<>(); |
608 |
dedupHelper.restartSession(this, state.getResult());
|
|
585 |
state.getDeduplicationHelper().restartSession(this, state.getResult());
|
|
609 | 586 |
} |
610 | 587 |
|
611 | 588 |
|
app-import/src/main/java/eu/etaxonomy/cdm/io/uzbekistan/UzbekistanTaxonImport.java | ||
---|---|---|
17 | 17 |
import org.apache.log4j.Logger; |
18 | 18 |
import org.springframework.stereotype.Component; |
19 | 19 |
|
20 |
import eu.etaxonomy.cdm.io.common.utils.ImportDeduplicationHelper; |
|
21 | 20 |
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImport; |
22 | 21 |
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState; |
23 | 22 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
... | ... | |
464 | 463 |
} |
465 | 464 |
|
466 | 465 |
private void replaceNameAuthorsAndReferences(SimpleExcelTaxonImportState<CONFIG> state, INonViralName name) { |
467 |
dedupHelper().replaceAuthorNamesAndNomRef(state, name);
|
|
466 |
state.getDeduplicationHelper().replaceAuthorNamesAndNomRef(state, name);
|
|
468 | 467 |
} |
469 | 468 |
|
470 |
private ImportDeduplicationHelper<SimpleExcelTaxonImportState<CONFIG>> dedupHelper; |
|
471 |
@SuppressWarnings({ "rawtypes", "unchecked" }) |
|
472 |
private ImportDeduplicationHelper<SimpleExcelTaxonImportState<CONFIG>> dedupHelper() { |
|
473 |
if (dedupHelper == null) { |
|
474 |
dedupHelper = (ImportDeduplicationHelper)ImportDeduplicationHelper.NewInstance(this); |
|
475 |
} |
|
476 |
return dedupHelper; |
|
477 |
} |
|
478 | 469 |
|
479 | 470 |
@Override |
480 | 471 |
protected IdentifiableSource makeOriginalSource(SimpleExcelTaxonImportState<CONFIG> state) { |
Also available in: Unified diff
ref #9890 use common state based deduplication helper in app-import