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
|
import eu.etaxonomy.cdm.io.stream.StreamImportConfiguratorBase;
|
21
|
|
22
|
/**
|
23
|
* @author a.mueller
|
24
|
* @since 04.06.2013
|
25
|
*/
|
26
|
public abstract class DwcaDataImportConfiguratorBase<STATE extends DwcaDataImportStateBase>
|
27
|
extends StreamImportConfiguratorBase<STATE, URI> implements IImportConfigurator {
|
28
|
|
29
|
private static final long serialVersionUID = 7091818889753715572L;
|
30
|
|
31
|
@SuppressWarnings("unused")
|
32
|
private static final Logger logger = Logger.getLogger(DwcaDataImportConfiguratorBase.class);
|
33
|
|
34
|
private boolean doSplitRelationshipImport = false;
|
35
|
private boolean doSynonymRelationships = true;
|
36
|
private boolean doHigherRankRelationships = true;
|
37
|
private boolean doLowerRankRelationships = true;
|
38
|
|
39
|
//taxon
|
40
|
private boolean deduplicateNamePublishedIn = true;
|
41
|
private boolean scientificNameIdAsOriginalSourceId = false;
|
42
|
private DatasetUse datasetUse = DatasetUse.CLASSIFICATION;
|
43
|
private boolean useSourceReferenceAsSec = false;
|
44
|
private boolean useParentAsAcceptedIfAcceptedNotExists = true;
|
45
|
|
46
|
//distribution
|
47
|
//if set to true the dwc locality is not considered during distribution import
|
48
|
private boolean excludeLocality = false;
|
49
|
|
50
|
//reference
|
51
|
private boolean guessNomenclaturalReferences = false;
|
52
|
private boolean handleAllRefsAsCitation = false;
|
53
|
|
54
|
//validation
|
55
|
private boolean validateRankConsistency = true;
|
56
|
|
57
|
public enum DatasetUse{
|
58
|
CLASSIFICATION,
|
59
|
SECUNDUM,
|
60
|
ORIGINAL_SOURCE
|
61
|
}
|
62
|
|
63
|
public enum ModifiedUse{
|
64
|
UPDATED,
|
65
|
MARKER
|
66
|
}
|
67
|
|
68
|
|
69
|
/**
|
70
|
* @param uri
|
71
|
* @param destination
|
72
|
* @param defaultTransformer
|
73
|
*/
|
74
|
protected DwcaDataImportConfiguratorBase(URI uri, ICdmDataSource destination, IInputTransformer defaultTransformer) {
|
75
|
super(defaultTransformer);
|
76
|
this.setSource(uri);
|
77
|
this.setDestination(destination);
|
78
|
}
|
79
|
|
80
|
//************************** GETTER / SETTER **********************************/
|
81
|
|
82
|
public boolean isDeduplicateNamePublishedIn() {
|
83
|
return deduplicateNamePublishedIn;
|
84
|
}
|
85
|
public void setDeduplicateNamePublishedIn(boolean deduplicateNamePublishedIn) {
|
86
|
this.deduplicateNamePublishedIn = deduplicateNamePublishedIn;
|
87
|
}
|
88
|
|
89
|
public void setScientificNameIdAsOriginalSourceId(
|
90
|
boolean scientificNameIdAsOriginalSourceId) {
|
91
|
this.scientificNameIdAsOriginalSourceId = scientificNameIdAsOriginalSourceId;
|
92
|
}
|
93
|
public boolean isScientificNameIdAsOriginalSourceId() {
|
94
|
return scientificNameIdAsOriginalSourceId;
|
95
|
}
|
96
|
|
97
|
public boolean isDatasetsAsClassifications() {
|
98
|
return this.datasetUse.equals(DatasetUse.CLASSIFICATION);
|
99
|
}
|
100
|
|
101
|
//exclude Locality
|
102
|
/**
|
103
|
* Should the locality attribute in distributions be excluded from creating
|
104
|
* named areas used in distributions?
|
105
|
*/
|
106
|
public boolean isExcludeLocality() {
|
107
|
return excludeLocality;
|
108
|
}
|
109
|
/**
|
110
|
* @see #isExcludeLocality()
|
111
|
*/
|
112
|
public void setExcludeLocality(boolean excludeLocality) {
|
113
|
this.excludeLocality = excludeLocality;
|
114
|
}
|
115
|
|
116
|
public boolean isValidateRankConsistency() {
|
117
|
return validateRankConsistency;
|
118
|
}
|
119
|
public void setValidateRankConsistency(boolean validateRankConsistency) {
|
120
|
this.validateRankConsistency = validateRankConsistency;
|
121
|
}
|
122
|
|
123
|
public boolean isDatasetsAsSecundumReference() {
|
124
|
return this.datasetUse.equals(DatasetUse.SECUNDUM);
|
125
|
}
|
126
|
public boolean isDatasetsAsOriginalSource() {
|
127
|
return this.datasetUse.equals(DatasetUse.ORIGINAL_SOURCE);
|
128
|
}
|
129
|
|
130
|
public void setDatasetUse(DatasetUse datasetUse) {
|
131
|
this.datasetUse = datasetUse;
|
132
|
}
|
133
|
|
134
|
public boolean isGuessNomenclaturalReferences() {
|
135
|
return guessNomenclaturalReferences;
|
136
|
}
|
137
|
public void setGuessNomenclaturalReferences(boolean guessNomenclaturalReferences) {
|
138
|
this.guessNomenclaturalReferences = guessNomenclaturalReferences;
|
139
|
}
|
140
|
|
141
|
public boolean isHandleAllRefsAsCitation() {
|
142
|
return handleAllRefsAsCitation;
|
143
|
}
|
144
|
public void setHandleAllRefsAsCitation(boolean handleAllRefsAsCitation) {
|
145
|
this.handleAllRefsAsCitation = handleAllRefsAsCitation;
|
146
|
}
|
147
|
|
148
|
public boolean isUseSourceReferenceAsSec() {
|
149
|
return useSourceReferenceAsSec;
|
150
|
}
|
151
|
public void setUseSourceReferenceAsSec(boolean useSourceReferenceAsSec) {
|
152
|
this.useSourceReferenceAsSec = useSourceReferenceAsSec;
|
153
|
}
|
154
|
|
155
|
public boolean isUseParentAsAcceptedIfAcceptedNotExists() {
|
156
|
return useParentAsAcceptedIfAcceptedNotExists;
|
157
|
}
|
158
|
public void setUseParentAsAcceptedIfAcceptedNotExists(boolean useParentAsAcceptedIfAcceptedNotExists) {
|
159
|
this.useParentAsAcceptedIfAcceptedNotExists = useParentAsAcceptedIfAcceptedNotExists;
|
160
|
}
|
161
|
|
162
|
public boolean isDoSplitRelationshipImport() {
|
163
|
return doSplitRelationshipImport;
|
164
|
}
|
165
|
public void setDoSplitRelationshipImport(boolean doSplitRelationshipImport) {
|
166
|
this.doSplitRelationshipImport = doSplitRelationshipImport;
|
167
|
}
|
168
|
|
169
|
public boolean isDoSynonymRelationships() {
|
170
|
return doSynonymRelationships;
|
171
|
}
|
172
|
public void setDoSynonymRelationships(boolean doSynonymRelationships) {
|
173
|
this.doSynonymRelationships = doSynonymRelationships;
|
174
|
}
|
175
|
|
176
|
|
177
|
public boolean isDoHigherRankRelationships() {
|
178
|
return doHigherRankRelationships;
|
179
|
}
|
180
|
public void setDoHigherRankRelationships(boolean doHigherRankRelationships) {
|
181
|
this.doHigherRankRelationships = doHigherRankRelationships;
|
182
|
}
|
183
|
|
184
|
|
185
|
public boolean isDoLowerRankRelationships() {
|
186
|
return doLowerRankRelationships;
|
187
|
}
|
188
|
public void setDoLowerRankRelationships(boolean doLowerRankRelationships) {
|
189
|
this.doLowerRankRelationships = doLowerRankRelationships;
|
190
|
}
|
191
|
}
|