1
|
/**
|
2
|
* Copyright (C) 2023 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.io.caryo;
|
10
|
|
11
|
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImport;
|
12
|
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState;
|
13
|
import eu.etaxonomy.cdm.model.name.TaxonName;
|
14
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
15
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
16
|
|
17
|
/**
|
18
|
* @author a.mueller
|
19
|
* @date 02.02.2023
|
20
|
*/
|
21
|
public abstract class CaryoSileneaeImportBase extends SimpleExcelTaxonImport<CaryoSileneaeImportConfigurator> {
|
22
|
|
23
|
private static final long serialVersionUID = -299606747509423614L;
|
24
|
|
25
|
private Reference secRef = null;
|
26
|
|
27
|
protected Taxon getTaxon(SimpleExcelTaxonImportState<CaryoSileneaeImportConfigurator> state, Integer taxonLinkId) {
|
28
|
// TODO Auto-generated method stub
|
29
|
return null;
|
30
|
}
|
31
|
|
32
|
protected TaxonName getName(SimpleExcelTaxonImportState<CaryoSileneaeImportConfigurator> state, Integer nameLinkID) {
|
33
|
// TODO Auto-generated method stub
|
34
|
return null;
|
35
|
}
|
36
|
|
37
|
protected Reference getSecRef(SimpleExcelTaxonImportState<CaryoSileneaeImportConfigurator> state) {
|
38
|
if (secRef == null){
|
39
|
secRef = getReferenceService().find(state.getConfig().getSecUuid());
|
40
|
}
|
41
|
return secRef;
|
42
|
}
|
43
|
|
44
|
protected void newTransaction(SimpleExcelTaxonImportState<CaryoSileneaeImportConfigurator> state) {
|
45
|
commitTransaction(state.getTransactionStatus());
|
46
|
secRef = null;
|
47
|
state.getDeduplicationHelper().reset();
|
48
|
state.setSourceReference(null);
|
49
|
System.gc();
|
50
|
state.setTransactionStatus(startTransaction());
|
51
|
}
|
52
|
|
53
|
protected Integer getInt(String value) {
|
54
|
return isBlank(value) ? null : Integer.valueOf(value);
|
55
|
}
|
56
|
}
|