1
|
/**
|
2
|
* Copyright (C) 2008 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.pesi.faunaEuropaea;
|
10
|
|
11
|
import org.apache.log4j.Logger;
|
12
|
|
13
|
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
14
|
import eu.etaxonomy.cdm.io.common.ImportConfiguratorBase;
|
15
|
import eu.etaxonomy.cdm.io.common.Source;
|
16
|
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;
|
17
|
import eu.etaxonomy.cdm.io.pesi.out.PesiTransformer;
|
18
|
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
|
19
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
20
|
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
|
21
|
|
22
|
/**
|
23
|
* @author a.babadshanjan
|
24
|
* @since 08.05.2009
|
25
|
*/
|
26
|
public class FaunaEuropaeaImportConfigurator
|
27
|
extends ImportConfiguratorBase<FaunaEuropaeaImportState, Source>{
|
28
|
|
29
|
private static final long serialVersionUID = 3218446329444903409L;
|
30
|
private static final Logger logger = Logger.getLogger(FaunaEuropaeaImportConfigurator.class);
|
31
|
|
32
|
private static IInputTransformer defaultTransformer = null;
|
33
|
|
34
|
private boolean doBasionyms = true;
|
35
|
private boolean doTaxonomicallyIncluded = true;
|
36
|
private boolean doMisappliedNames = true;
|
37
|
private boolean doHeterotypicSynonyms = true;
|
38
|
private boolean doHeterotypicSynonymsForBasionyms ;
|
39
|
private boolean doOccurrence = true;
|
40
|
private boolean doVernacularNames = true;
|
41
|
private boolean doAssociatedSpecialists = true;
|
42
|
private boolean doInferredSynonyms = true;
|
43
|
|
44
|
public boolean isDoVernacularNames() {
|
45
|
return doVernacularNames;
|
46
|
}
|
47
|
|
48
|
public void setDoVernacularNames(boolean doVernacularNames) {
|
49
|
this.doVernacularNames = doVernacularNames;
|
50
|
}
|
51
|
|
52
|
public boolean isDoTypes() {
|
53
|
return doTypes;
|
54
|
}
|
55
|
|
56
|
/* Max number of taxa to be saved with one service call */
|
57
|
private int limitSave = 5000;
|
58
|
private Reference auctReference;
|
59
|
|
60
|
@Override
|
61
|
@SuppressWarnings("unchecked")
|
62
|
protected void makeIoClassList() {
|
63
|
ioClassList = new Class[] {
|
64
|
FaunaEuropaeaAuthorImport.class,
|
65
|
FaunaEuropaeaUsersImport.class,
|
66
|
FaunaEuropaeaTaxonNameImport.class,
|
67
|
FaunaEuropaeaRelTaxonIncludeImport.class,
|
68
|
FaunaEuropaeaDistributionImport.class,
|
69
|
FaunaEuropaeaHeterotypicSynonymImport.class,
|
70
|
FaunaEuropaeaRefImport.class,
|
71
|
FaunaEuropaeaAdditionalTaxonDataImport.class,
|
72
|
FaunaEuropaeaVernacularNamesImport.class
|
73
|
};
|
74
|
}
|
75
|
|
76
|
public static FaunaEuropaeaImportConfigurator NewInstance(Source source, ICdmDataSource destination){
|
77
|
return new FaunaEuropaeaImportConfigurator(source, destination);
|
78
|
}
|
79
|
|
80
|
private FaunaEuropaeaImportConfigurator(Source source, ICdmDataSource destination) {
|
81
|
super(defaultTransformer);
|
82
|
setSource(source);
|
83
|
setDestination(destination);
|
84
|
setNomenclaturalCode(NomenclaturalCode.ICZN);
|
85
|
}
|
86
|
|
87
|
// public static FaunaEuropaeaImportConfigurator NewInstance(ICdmDataSource source, ICdmDataSource destination){
|
88
|
// return new FaunaEuropaeaImportConfigurator(source, destination);
|
89
|
//}
|
90
|
|
91
|
// private FaunaEuropaeaImportConfigurator(ICdmDataSource source, ICdmDataSource destination) {
|
92
|
// super(defaultTransformer);
|
93
|
// setSource(source);
|
94
|
// setDestination(destination);
|
95
|
// setNomenclaturalCode(NomenclaturalCode.ICBN);
|
96
|
// }
|
97
|
|
98
|
|
99
|
@Override
|
100
|
public Reference getSourceReference() {
|
101
|
//TODO
|
102
|
if (this.sourceReference == null){
|
103
|
logger.warn("getSource Reference not yet fully implemented");
|
104
|
|
105
|
sourceReference = ReferenceFactory.newDatabase();
|
106
|
|
107
|
sourceReference.setTitleCache("Fauna Europaea database", true);
|
108
|
if (this.getSourceRefUuid() != null){
|
109
|
sourceReference.setUuid(this.getSourceRefUuid());
|
110
|
}
|
111
|
}
|
112
|
return sourceReference;
|
113
|
}
|
114
|
|
115
|
public Reference getAuctReference() {
|
116
|
//TODO
|
117
|
if (auctReference == null){
|
118
|
auctReference = ReferenceFactory.newPersonalCommunication();
|
119
|
|
120
|
auctReference.setTitleCache("auct.", true);
|
121
|
auctReference.setUuid(PesiTransformer.uuidSourceRefAuct);
|
122
|
}
|
123
|
return auctReference;
|
124
|
}
|
125
|
|
126
|
@Override
|
127
|
public String getSourceNameString() {
|
128
|
if (this.getSource() == null) {
|
129
|
return null;
|
130
|
}else{
|
131
|
return this.getSource().toString();
|
132
|
}
|
133
|
}
|
134
|
|
135
|
@SuppressWarnings("unchecked")
|
136
|
@Override
|
137
|
public FaunaEuropaeaImportState getNewState() {
|
138
|
return new FaunaEuropaeaImportState(this);
|
139
|
}
|
140
|
|
141
|
public boolean isDoBasionyms() {
|
142
|
return doBasionyms;
|
143
|
}
|
144
|
public void setDoBasionyms(boolean doBasionyms) {
|
145
|
this.doBasionyms = doBasionyms;
|
146
|
}
|
147
|
|
148
|
public boolean isDoTaxonomicallyIncluded() {
|
149
|
return doTaxonomicallyIncluded;
|
150
|
}
|
151
|
public void setDoTaxonomicallyIncluded(boolean doTaxonomicallyIncluded) {
|
152
|
this.doTaxonomicallyIncluded = doTaxonomicallyIncluded;
|
153
|
}
|
154
|
|
155
|
public boolean isDoMisappliedNames() {
|
156
|
return doMisappliedNames;
|
157
|
}
|
158
|
public void setDoMisappliedNames(boolean doMisappliedNames) {
|
159
|
this.doMisappliedNames = doMisappliedNames;
|
160
|
}
|
161
|
|
162
|
public boolean isDoHeterotypicSynonyms() {
|
163
|
return doHeterotypicSynonyms;
|
164
|
}
|
165
|
public void setDoHeterotypicSynonyms(boolean doHeterotypicSynonyms) {
|
166
|
this.doHeterotypicSynonyms = doHeterotypicSynonyms;
|
167
|
}
|
168
|
|
169
|
public void setAuctReference(Reference auctReference) {
|
170
|
this.auctReference = auctReference;
|
171
|
}
|
172
|
|
173
|
public int getLimitSave() {
|
174
|
return limitSave;
|
175
|
}
|
176
|
public void setLimitSave(int limitSave) {
|
177
|
this.limitSave = limitSave;
|
178
|
}
|
179
|
|
180
|
public void setDoHeterotypicSynonymsForBasionyms(
|
181
|
boolean doHeterotypicSynonymsForBasionyms) {
|
182
|
this.doHeterotypicSynonymsForBasionyms = doHeterotypicSynonymsForBasionyms;
|
183
|
}
|
184
|
public boolean isDoHeterotypicSynonymsForBasionyms() {
|
185
|
return doHeterotypicSynonymsForBasionyms;
|
186
|
}
|
187
|
|
188
|
public boolean isDoOccurrence() {
|
189
|
return doOccurrence;
|
190
|
}
|
191
|
public void setDoOccurrence(boolean doOccurrence) {
|
192
|
this.doOccurrence = doOccurrence;
|
193
|
}
|
194
|
|
195
|
|
196
|
private boolean doAuthors = true;
|
197
|
//references
|
198
|
private DO_REFERENCES doReferences = DO_REFERENCES.ALL;
|
199
|
//names
|
200
|
private final boolean doTypes = true;
|
201
|
|
202
|
//taxa
|
203
|
private boolean doTaxa = true;
|
204
|
private boolean doRelTaxa = true;
|
205
|
|
206
|
public boolean isDoAuthors() {
|
207
|
return doAuthors;
|
208
|
}
|
209
|
public void setDoAuthors(boolean doAuthors) {
|
210
|
this.doAuthors = doAuthors;
|
211
|
}
|
212
|
|
213
|
public DO_REFERENCES getDoReferences() {
|
214
|
return doReferences;
|
215
|
}
|
216
|
public void setDoReferences(DO_REFERENCES doReferences) {
|
217
|
this.doReferences = doReferences;
|
218
|
}
|
219
|
|
220
|
public boolean isDoTaxa() {
|
221
|
return doTaxa;
|
222
|
}
|
223
|
public void setDoTaxa(boolean doTaxa) {
|
224
|
this.doTaxa = doTaxa;
|
225
|
}
|
226
|
|
227
|
public boolean isDoRelTaxa() {
|
228
|
return doRelTaxa;
|
229
|
}
|
230
|
public void setDoRelTaxa(boolean doRelTaxa) {
|
231
|
this.doRelTaxa = doRelTaxa;
|
232
|
}
|
233
|
|
234
|
public boolean isDoAssociatedSpecialists() {
|
235
|
|
236
|
return this.doAssociatedSpecialists;
|
237
|
}
|
238
|
|
239
|
public void setDoAssociatedSpecialists(boolean doAssociatedSpecialists){
|
240
|
this.doAssociatedSpecialists = doAssociatedSpecialists;
|
241
|
}
|
242
|
|
243
|
public boolean isDoInferredSynonyms() {
|
244
|
return doInferredSynonyms;
|
245
|
}
|
246
|
public void setDoInferredSynonyms(boolean doInferredSynonyms){
|
247
|
this.doInferredSynonyms = doInferredSynonyms;
|
248
|
}
|
249
|
}
|