1
|
/**
|
2
|
* Copyright (C) 2009 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.out;
|
10
|
|
11
|
import org.apache.log4j.Logger;
|
12
|
|
13
|
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
14
|
import eu.etaxonomy.cdm.io.common.DbExportConfiguratorBase;
|
15
|
import eu.etaxonomy.cdm.io.common.Source;
|
16
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
17
|
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
|
18
|
|
19
|
/**
|
20
|
* @author e.-m.lee
|
21
|
* @since 12.02.2010
|
22
|
*/
|
23
|
public class PesiExportConfigurator
|
24
|
extends DbExportConfiguratorBase<PesiExportState, PesiTransformer, Source> {
|
25
|
|
26
|
private static final long serialVersionUID = -4855001834616976415L;
|
27
|
@SuppressWarnings("unused")
|
28
|
private static Logger logger = Logger.getLogger(PesiExportConfigurator.class);
|
29
|
|
30
|
private int limitSave = 2000;
|
31
|
private int limitSaveDescription = 500;
|
32
|
|
33
|
private Reference auctReference;
|
34
|
|
35
|
private DO_REFERENCES doReferences = DO_REFERENCES.ALL;
|
36
|
private boolean doTaxa = true;
|
37
|
private boolean doRelTaxa = true;
|
38
|
private boolean doNotes = true;
|
39
|
private boolean doNoteSources = true;
|
40
|
private boolean doAdditionalTaxonSource = true;
|
41
|
private boolean doOccurrence = true;
|
42
|
private boolean doOccurrenceSource = true;
|
43
|
private boolean doImages = true;
|
44
|
private boolean doTreeIndex = true;
|
45
|
private boolean doParentAndBiota = true;
|
46
|
private boolean doInferredSynonyms = true;
|
47
|
private boolean doPureNames = true;
|
48
|
private boolean doDescription = true;
|
49
|
private boolean doEcologyAndLink = true;
|
50
|
|
51
|
private int nameIdStart = 10000000;
|
52
|
|
53
|
public static PesiExportConfigurator NewInstance(Source pesiDestination, ICdmDataSource source, PesiTransformer transformer) {
|
54
|
return new PesiExportConfigurator(pesiDestination, source, transformer);
|
55
|
}
|
56
|
|
57
|
@Override
|
58
|
@SuppressWarnings("unchecked")
|
59
|
protected void makeIoClassList() {
|
60
|
ioClassList = new Class[]{
|
61
|
PesiSourceExport.class,
|
62
|
PesiTaxonExport.class,
|
63
|
PesiRelTaxonExport.class, // RelTaxonId's could be deleted from state hashmap
|
64
|
PesiAdditionalSourceExport.class,
|
65
|
PesiDescriptionExport.class,
|
66
|
PesiEcologyAndLinkExport.class,
|
67
|
PesiFinalUpdateExport.class
|
68
|
};
|
69
|
}
|
70
|
|
71
|
private PesiExportConfigurator(Source pesiSource, ICdmDataSource cdmSource, PesiTransformer transformer) {
|
72
|
super(transformer);
|
73
|
setSource(cdmSource);
|
74
|
setDestination(pesiSource);
|
75
|
}
|
76
|
|
77
|
@Override
|
78
|
public PesiExportState getNewState() {
|
79
|
return new PesiExportState(this);
|
80
|
}
|
81
|
|
82
|
public int getLimitSave() {
|
83
|
return limitSave;
|
84
|
}
|
85
|
public void setLimitSave(int limitSave) {
|
86
|
this.limitSave = limitSave;
|
87
|
}
|
88
|
|
89
|
public int getLimitSaveDescription() {
|
90
|
return limitSaveDescription;
|
91
|
}
|
92
|
public void setLimitSaveDescription(int limitSaveDescription) {
|
93
|
this.limitSaveDescription = limitSaveDescription;
|
94
|
}
|
95
|
|
96
|
/**
|
97
|
* Returns the Reference for a Misapplied Name.
|
98
|
* Copied from FaunaEuropaeaImportConfigurator.
|
99
|
* @return
|
100
|
*/
|
101
|
public Reference getAuctReference() {
|
102
|
if (auctReference == null){
|
103
|
auctReference = ReferenceFactory.newGeneric();
|
104
|
|
105
|
auctReference.setTitleCache("auct.", true);
|
106
|
}
|
107
|
return auctReference;
|
108
|
}
|
109
|
|
110
|
public boolean isDoOccurrence() {
|
111
|
return doOccurrence;
|
112
|
}
|
113
|
public void setDoOccurrence(boolean doOccurrence) {
|
114
|
this.doOccurrence = doOccurrence;
|
115
|
}
|
116
|
|
117
|
|
118
|
public boolean isDoImages() {
|
119
|
return doImages;
|
120
|
}
|
121
|
public void setDoImages(boolean doImages) {
|
122
|
this.doImages = doImages;
|
123
|
}
|
124
|
|
125
|
public DO_REFERENCES getDoReferences() {
|
126
|
return doReferences;
|
127
|
}
|
128
|
public void setDoReferences(DO_REFERENCES doReferences) {
|
129
|
this.doReferences = doReferences;
|
130
|
}
|
131
|
|
132
|
public boolean isDoTaxa() {
|
133
|
return doTaxa;
|
134
|
}
|
135
|
public void setDoTaxa(boolean doTaxa) {
|
136
|
this.doTaxa = doTaxa;
|
137
|
}
|
138
|
|
139
|
public boolean isDoRelTaxa() {
|
140
|
return doRelTaxa;
|
141
|
}
|
142
|
public void setDoRelTaxa(boolean doRelTaxa) {
|
143
|
this.doRelTaxa = doRelTaxa;
|
144
|
}
|
145
|
|
146
|
/**
|
147
|
* Number that is added to the cdm id in case a name is stored by its own id
|
148
|
* not the taxons id.
|
149
|
* @return
|
150
|
*/
|
151
|
public int getNameIdStart() {
|
152
|
return nameIdStart;
|
153
|
}
|
154
|
public void setNameIdStart(int nameIdStart) {
|
155
|
this.nameIdStart = nameIdStart;
|
156
|
}
|
157
|
|
158
|
public boolean isDoNotes() {
|
159
|
return doNotes;
|
160
|
}
|
161
|
public void setDoNotes(boolean doNotes) {
|
162
|
this.doNotes = doNotes;
|
163
|
}
|
164
|
|
165
|
public boolean isDoNoteSources() {
|
166
|
return doNoteSources;
|
167
|
}
|
168
|
public void setDoNoteSources(boolean doNoteSources) {
|
169
|
this.doNoteSources = doNoteSources;
|
170
|
}
|
171
|
|
172
|
public boolean isDoAdditionalTaxonSource() {
|
173
|
return doAdditionalTaxonSource;
|
174
|
}
|
175
|
public void setDoAdditionalTaxonSource(boolean doAdditionalTaxonSource) {
|
176
|
this.doAdditionalTaxonSource = doAdditionalTaxonSource;
|
177
|
}
|
178
|
|
179
|
public boolean isDoOccurrenceSource() {
|
180
|
return doOccurrenceSource;
|
181
|
}
|
182
|
public void setDoOccurrenceSource(boolean doOccurrenceSource) {
|
183
|
this.doOccurrenceSource = doOccurrenceSource;
|
184
|
}
|
185
|
|
186
|
public boolean isDoTreeIndex() {
|
187
|
return this.doTreeIndex;
|
188
|
}
|
189
|
public void setDoTreeIndex(boolean doTreeIndex) {
|
190
|
this.doTreeIndex = doTreeIndex;
|
191
|
}
|
192
|
|
193
|
public boolean isDoInferredSynonyms() {
|
194
|
return doInferredSynonyms;
|
195
|
}
|
196
|
public void setDoInferredSynonyms(boolean doInferredSynonyms) {
|
197
|
this.doInferredSynonyms = doInferredSynonyms;
|
198
|
}
|
199
|
|
200
|
public boolean isDoPureNames() {
|
201
|
return doPureNames;
|
202
|
}
|
203
|
public void setDoPureNames(boolean doPureNames) {
|
204
|
this.doPureNames = doPureNames;
|
205
|
}
|
206
|
|
207
|
public boolean isDoDescription() {
|
208
|
return doDescription;
|
209
|
}
|
210
|
public void setDoDescription(boolean doDescription) {
|
211
|
this.doDescription = doDescription;
|
212
|
}
|
213
|
|
214
|
public boolean isDoParentAndBiota() {
|
215
|
return doParentAndBiota;
|
216
|
}
|
217
|
public void setDoParentAndBiota(boolean doParentAndBiota) {
|
218
|
this.doParentAndBiota = doParentAndBiota;
|
219
|
}
|
220
|
|
221
|
public boolean isDoEcologyAndLink() {
|
222
|
return doEcologyAndLink;
|
223
|
}
|
224
|
public void setDoEcologyAndLink(boolean doEcologyAndLink) {
|
225
|
this.doEcologyAndLink = doEcologyAndLink;
|
226
|
}
|
227
|
|
228
|
}
|