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