1
|
/**
|
2
|
* Copyright (C) 2016 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.greece;
|
10
|
|
11
|
import java.util.List;
|
12
|
|
13
|
import org.apache.log4j.Logger;
|
14
|
import org.springframework.stereotype.Component;
|
15
|
import org.springframework.transaction.TransactionStatus;
|
16
|
|
17
|
import eu.etaxonomy.cdm.io.common.CdmImportBase;
|
18
|
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState;
|
19
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
20
|
import eu.etaxonomy.cdm.strategy.homotypicgroup.BasionymRelationCreator;
|
21
|
/**
|
22
|
* Creates basionym relationships for all taxa.
|
23
|
*
|
24
|
* @author a.mueller
|
25
|
* @date 03.04.2017
|
26
|
*/
|
27
|
|
28
|
@Component
|
29
|
public class FloraHellenicaBasionymImport<CONFIG extends FloraHellenicaImportConfigurator>
|
30
|
extends CdmImportBase<CONFIG,SimpleExcelTaxonImportState<CONFIG>>{
|
31
|
|
32
|
private static final long serialVersionUID = -7066421762179411758L;
|
33
|
@SuppressWarnings("unused")
|
34
|
private static final Logger logger = Logger.getLogger(FloraHellenicaBasionymImport.class);
|
35
|
|
36
|
/**
|
37
|
* {@inheritDoc}
|
38
|
*/
|
39
|
@Override
|
40
|
protected void doInvoke(SimpleExcelTaxonImportState<CONFIG> state) {
|
41
|
|
42
|
TransactionStatus tx = this.startTransaction();
|
43
|
|
44
|
List<Taxon> list = getTaxonService().list(Taxon.class, null, null, null, null);
|
45
|
for (Taxon taxon : list){
|
46
|
BasionymRelationCreator creator = new BasionymRelationCreator();
|
47
|
creator.invoke(taxon);
|
48
|
}
|
49
|
this.commitTransaction(tx);
|
50
|
}
|
51
|
|
52
|
|
53
|
|
54
|
/**
|
55
|
* {@inheritDoc}
|
56
|
*/
|
57
|
@Override
|
58
|
protected boolean doCheck(SimpleExcelTaxonImportState<CONFIG> state) {
|
59
|
return false;
|
60
|
}
|
61
|
|
62
|
/**
|
63
|
* {@inheritDoc}
|
64
|
*/
|
65
|
@Override
|
66
|
protected boolean isIgnore(SimpleExcelTaxonImportState<CONFIG> state) {
|
67
|
return false;
|
68
|
}
|
69
|
|
70
|
|
71
|
|
72
|
}
|