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
|
protected DwcaDataImportConfiguratorBase(URI uri, ICdmDataSource destination, IInputTransformer defaultTransformer) {
|
69
|
super(defaultTransformer);
|
70
|
this.setSource(uri);
|
71
|
this.setDestination(destination);
|
72
|
}
|
73
|
|
74
|
//************************** GETTER / SETTER **********************************/
|
75
|
|
76
|
public boolean isDeduplicateNamePublishedIn() {
|
77
|
return deduplicateNamePublishedIn;
|
78
|
}
|
79
|
public void setDeduplicateNamePublishedIn(boolean deduplicateNamePublishedIn) {
|
80
|
this.deduplicateNamePublishedIn = deduplicateNamePublishedIn;
|
81
|
}
|
82
|
|
83
|
public void setScientificNameIdAsOriginalSourceId(
|
84
|
boolean scientificNameIdAsOriginalSourceId) {
|
85
|
this.scientificNameIdAsOriginalSourceId = scientificNameIdAsOriginalSourceId;
|
86
|
}
|
87
|
public boolean isScientificNameIdAsOriginalSourceId() {
|
88
|
return scientificNameIdAsOriginalSourceId;
|
89
|
}
|
90
|
|
91
|
public boolean isDatasetsAsClassifications() {
|
92
|
return this.datasetUse.equals(DatasetUse.CLASSIFICATION);
|
93
|
}
|
94
|
|
95
|
//exclude Locality
|
96
|
/**
|
97
|
* Should the locality attribute in distributions be excluded from creating
|
98
|
* named areas used in distributions?
|
99
|
*/
|
100
|
public boolean isExcludeLocality() {
|
101
|
return excludeLocality;
|
102
|
}
|
103
|
/**
|
104
|
* @see #isExcludeLocality()
|
105
|
*/
|
106
|
public void setExcludeLocality(boolean excludeLocality) {
|
107
|
this.excludeLocality = excludeLocality;
|
108
|
}
|
109
|
|
110
|
public boolean isValidateRankConsistency() {
|
111
|
return validateRankConsistency;
|
112
|
}
|
113
|
public void setValidateRankConsistency(boolean validateRankConsistency) {
|
114
|
this.validateRankConsistency = validateRankConsistency;
|
115
|
}
|
116
|
|
117
|
public boolean isDatasetsAsSecundumReference() {
|
118
|
return this.datasetUse.equals(DatasetUse.SECUNDUM);
|
119
|
}
|
120
|
public boolean isDatasetsAsOriginalSource() {
|
121
|
return this.datasetUse.equals(DatasetUse.ORIGINAL_SOURCE);
|
122
|
}
|
123
|
|
124
|
public void setDatasetUse(DatasetUse datasetUse) {
|
125
|
this.datasetUse = datasetUse;
|
126
|
}
|
127
|
|
128
|
public boolean isGuessNomenclaturalReferences() {
|
129
|
return guessNomenclaturalReferences;
|
130
|
}
|
131
|
public void setGuessNomenclaturalReferences(boolean guessNomenclaturalReferences) {
|
132
|
this.guessNomenclaturalReferences = guessNomenclaturalReferences;
|
133
|
}
|
134
|
|
135
|
public boolean isHandleAllRefsAsCitation() {
|
136
|
return handleAllRefsAsCitation;
|
137
|
}
|
138
|
public void setHandleAllRefsAsCitation(boolean handleAllRefsAsCitation) {
|
139
|
this.handleAllRefsAsCitation = handleAllRefsAsCitation;
|
140
|
}
|
141
|
|
142
|
public boolean isUseSourceReferenceAsSec() {
|
143
|
return useSourceReferenceAsSec;
|
144
|
}
|
145
|
public void setUseSourceReferenceAsSec(boolean useSourceReferenceAsSec) {
|
146
|
this.useSourceReferenceAsSec = useSourceReferenceAsSec;
|
147
|
}
|
148
|
|
149
|
public boolean isUseParentAsAcceptedIfAcceptedNotExists() {
|
150
|
return useParentAsAcceptedIfAcceptedNotExists;
|
151
|
}
|
152
|
public void setUseParentAsAcceptedIfAcceptedNotExists(boolean useParentAsAcceptedIfAcceptedNotExists) {
|
153
|
this.useParentAsAcceptedIfAcceptedNotExists = useParentAsAcceptedIfAcceptedNotExists;
|
154
|
}
|
155
|
|
156
|
public boolean isDoSplitRelationshipImport() {
|
157
|
return doSplitRelationshipImport;
|
158
|
}
|
159
|
public void setDoSplitRelationshipImport(boolean doSplitRelationshipImport) {
|
160
|
this.doSplitRelationshipImport = doSplitRelationshipImport;
|
161
|
}
|
162
|
|
163
|
public boolean isDoSynonymRelationships() {
|
164
|
return doSynonymRelationships;
|
165
|
}
|
166
|
public void setDoSynonymRelationships(boolean doSynonymRelationships) {
|
167
|
this.doSynonymRelationships = doSynonymRelationships;
|
168
|
}
|
169
|
|
170
|
public boolean isDoHigherRankRelationships() {
|
171
|
return doHigherRankRelationships;
|
172
|
}
|
173
|
public void setDoHigherRankRelationships(boolean doHigherRankRelationships) {
|
174
|
this.doHigherRankRelationships = doHigherRankRelationships;
|
175
|
}
|
176
|
|
177
|
public boolean isDoLowerRankRelationships() {
|
178
|
return doLowerRankRelationships;
|
179
|
}
|
180
|
public void setDoLowerRankRelationships(boolean doLowerRankRelationships) {
|
181
|
this.doLowerRankRelationships = doLowerRankRelationships;
|
182
|
}
|
183
|
}
|