1
|
/**
|
2
|
* Copyright (C) 2007 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.dwca.in;
|
10
|
|
11
|
import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
|
12
|
|
13
|
import eu.etaxonomy.cdm.common.URI;
|
14
|
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
15
|
import eu.etaxonomy.cdm.io.common.IImportConfigurator;
|
16
|
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;
|
17
|
|
18
|
/**
|
19
|
* @author a.mueller
|
20
|
* @since 05.05.2011
|
21
|
*/
|
22
|
public class DwcaImportConfigurator
|
23
|
extends DwcaDataImportConfiguratorBase<DwcaImportState>
|
24
|
implements IImportConfigurator {
|
25
|
|
26
|
private static final long serialVersionUID = 6932718596034946336L;
|
27
|
@SuppressWarnings("unused")
|
28
|
private static final Logger logger = LogManager.getLogger(DwcaImportConfigurator.class);
|
29
|
|
30
|
private static IInputTransformer defaultTransformer = new DwcaImportTransformer();
|
31
|
|
32
|
private static final String DEFAULT_REF_TITLE = "DwC-A Import";
|
33
|
|
34
|
//csv config
|
35
|
private boolean isNoQuotes = false;
|
36
|
|
37
|
private boolean doTaxa = true;
|
38
|
|
39
|
private boolean doTaxonRelationships = true;
|
40
|
private boolean doExtensions = true;
|
41
|
|
42
|
private boolean keepMappingForFurtherImports = false;
|
43
|
|
44
|
|
45
|
@Override
|
46
|
@SuppressWarnings("unchecked")
|
47
|
protected void makeIoClassList(){
|
48
|
ioClassList = new Class[]{
|
49
|
DwcaImport.class
|
50
|
};
|
51
|
}
|
52
|
|
53
|
public static DwcaImportConfigurator NewInstance(URI uri, ICdmDataSource destination){
|
54
|
return new DwcaImportConfigurator(uri, destination);
|
55
|
}
|
56
|
|
57
|
/**
|
58
|
* @param berlinModelSource
|
59
|
* @param sourceReference
|
60
|
* @param destination
|
61
|
*/
|
62
|
private DwcaImportConfigurator(URI uri, ICdmDataSource destination) {
|
63
|
super(uri, destination, defaultTransformer);
|
64
|
this.setSource(uri);
|
65
|
this.setDestination(destination);
|
66
|
}
|
67
|
|
68
|
@Override
|
69
|
public DwcaImportState getNewState() {
|
70
|
return new DwcaImportState(this);
|
71
|
}
|
72
|
|
73
|
@Override
|
74
|
protected String getDefaultSourceReferenceTitle(){
|
75
|
return DEFAULT_REF_TITLE;
|
76
|
}
|
77
|
|
78
|
|
79
|
public boolean isNoQuotes() {
|
80
|
return isNoQuotes;
|
81
|
}
|
82
|
public void setNoQuotes(boolean isNoQuotes) {
|
83
|
this.isNoQuotes = isNoQuotes;
|
84
|
}
|
85
|
|
86
|
public boolean isDoTaxonRelationships() {
|
87
|
return doTaxonRelationships;
|
88
|
}
|
89
|
public void setDoTaxonRelationships(boolean doTaxonRelationships) {
|
90
|
this.doTaxonRelationships = doTaxonRelationships;
|
91
|
}
|
92
|
|
93
|
public boolean isDoTaxa() {
|
94
|
return doTaxa;
|
95
|
}
|
96
|
public void setDoTaxa(boolean doTaxa) {
|
97
|
this.doTaxa = doTaxa;
|
98
|
}
|
99
|
|
100
|
public boolean isDoExtensions() {
|
101
|
return doExtensions;
|
102
|
}
|
103
|
public void setDoExtensions(boolean doExtensions) {
|
104
|
this.doExtensions = doExtensions;
|
105
|
}
|
106
|
|
107
|
public boolean isKeepMappingForFurtherImports() {
|
108
|
return keepMappingForFurtherImports;
|
109
|
}
|
110
|
public void setKeepMappingForFurtherImports(boolean keepMapping) {
|
111
|
keepMappingForFurtherImports = keepMapping;
|
112
|
}
|
113
|
|
114
|
}
|