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