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.sdd.out;
|
11
|
|
12
|
import java.io.File;
|
13
|
|
14
|
import org.apache.log4j.Logger;
|
15
|
|
16
|
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
17
|
import eu.etaxonomy.cdm.io.common.XmlExportConfiguratorBase;
|
18
|
import eu.etaxonomy.cdm.io.common.mapping.out.IExportTransformer;
|
19
|
|
20
|
/**
|
21
|
* @author h.fradin (from a.babadshanjan JaxbExportConfigurator)
|
22
|
* @created 09.12.2008
|
23
|
* @version 1.0
|
24
|
*/
|
25
|
public class SDDExportConfigurator extends XmlExportConfiguratorBase<SDDExportState> {
|
26
|
|
27
|
@SuppressWarnings("unused")
|
28
|
private static final Logger logger = Logger.getLogger(SDDExportConfigurator.class);
|
29
|
|
30
|
private int maxRows = 0;
|
31
|
|
32
|
private boolean doAgentData = true;
|
33
|
private boolean doLanguageData = true;
|
34
|
private boolean doFeatureData = true;
|
35
|
private boolean doDescriptions = true;
|
36
|
private boolean doMedia = true;
|
37
|
private boolean doReferencedEntities = true;
|
38
|
private boolean doSynonyms = true;
|
39
|
private boolean doTerms = true;
|
40
|
private boolean doTermVocabularies = true;
|
41
|
private boolean doHomotypicalGroups = true;
|
42
|
private boolean doOccurrence = true;
|
43
|
private boolean doAuthors = true;
|
44
|
private DO_REFERENCES doReferences = DO_REFERENCES.ALL;
|
45
|
private boolean doTaxonNames = true;
|
46
|
private boolean doTaxa = true;
|
47
|
private boolean doRelTaxa = true;
|
48
|
|
49
|
|
50
|
//TODO
|
51
|
private static IExportTransformer defaultTransformer = null;
|
52
|
|
53
|
|
54
|
public static SDDExportConfigurator NewInstance(ICdmDataSource source, String url, String destinationFolder) {
|
55
|
return new SDDExportConfigurator(source, destinationFolder + File.separator + url);
|
56
|
}
|
57
|
|
58
|
public static SDDExportConfigurator NewInstance(ICdmDataSource source, String url) {
|
59
|
return new SDDExportConfigurator(source, url);
|
60
|
}
|
61
|
|
62
|
|
63
|
public int getMaxRows() {
|
64
|
return maxRows;
|
65
|
}
|
66
|
|
67
|
public void setMaxRows(int maxRows) {
|
68
|
this.maxRows = maxRows;
|
69
|
}
|
70
|
|
71
|
|
72
|
public boolean isDoAgentData() {
|
73
|
return doAgentData;
|
74
|
}
|
75
|
|
76
|
public void setDoAgentData(boolean doAgentData) {
|
77
|
this.doAgentData = doAgentData;
|
78
|
}
|
79
|
|
80
|
public boolean isDoLanguageData() {
|
81
|
return doLanguageData;
|
82
|
}
|
83
|
|
84
|
public void setDoLanguageData(boolean doLanguageData) {
|
85
|
this.doLanguageData = doLanguageData;
|
86
|
}
|
87
|
|
88
|
public boolean isDoFeatureData() {
|
89
|
return doFeatureData;
|
90
|
}
|
91
|
|
92
|
public void setDoFeatureData(boolean doFeatureData) {
|
93
|
this.doFeatureData = doFeatureData;
|
94
|
}
|
95
|
|
96
|
public boolean isDoDescriptions() {
|
97
|
return doDescriptions;
|
98
|
}
|
99
|
|
100
|
public void setDoDescriptions(boolean doDescriptions) {
|
101
|
this.doDescriptions = doDescriptions;
|
102
|
}
|
103
|
|
104
|
public boolean isDoMedia() {
|
105
|
return doMedia;
|
106
|
}
|
107
|
|
108
|
public void setDoMedia(boolean doMedia) {
|
109
|
this.doMedia = doMedia;
|
110
|
}
|
111
|
|
112
|
public boolean isDoReferencedEntities() {
|
113
|
return doReferencedEntities;
|
114
|
}
|
115
|
|
116
|
public void setDoReferencedEntities(boolean doReferencedEntities) {
|
117
|
this.doReferencedEntities = doReferencedEntities;
|
118
|
}
|
119
|
|
120
|
|
121
|
public boolean isDoSynonyms() {
|
122
|
return doSynonyms;
|
123
|
}
|
124
|
|
125
|
public void setDoSynonyms(boolean doSynonyms) {
|
126
|
this.doSynonyms = doSynonyms;
|
127
|
}
|
128
|
|
129
|
|
130
|
public boolean isDoTerms() {
|
131
|
return doTerms;
|
132
|
}
|
133
|
|
134
|
public void setDoTerms(boolean doTerms) {
|
135
|
this.doTerms = doTerms;
|
136
|
}
|
137
|
|
138
|
public boolean isDoTermVocabularies() {
|
139
|
return doTermVocabularies;
|
140
|
}
|
141
|
|
142
|
public void setDoTermVocabularies(boolean doTermVocabularies) {
|
143
|
this.doTermVocabularies = doTermVocabularies;
|
144
|
}
|
145
|
|
146
|
public boolean isDoHomotypicalGroups() {
|
147
|
return doHomotypicalGroups;
|
148
|
}
|
149
|
|
150
|
public void setDoHomotypicalGroups(boolean doHomotypicalGroups) {
|
151
|
this.doHomotypicalGroups = doHomotypicalGroups;
|
152
|
}
|
153
|
|
154
|
public boolean isDoOccurrence() {
|
155
|
return doOccurrence;
|
156
|
}
|
157
|
public void setDoOccurrence(boolean doOccurrence) {
|
158
|
this.doOccurrence = doOccurrence;
|
159
|
}
|
160
|
|
161
|
|
162
|
public boolean isDoAuthors() {
|
163
|
return doAuthors;
|
164
|
}
|
165
|
public void setDoAuthors(boolean doAuthors) {
|
166
|
this.doAuthors = doAuthors;
|
167
|
}
|
168
|
|
169
|
public DO_REFERENCES getDoReferences() {
|
170
|
return doReferences;
|
171
|
}
|
172
|
public void setDoReferences(DO_REFERENCES doReferences) {
|
173
|
this.doReferences = doReferences;
|
174
|
}
|
175
|
|
176
|
public boolean isDoTaxonNames() {
|
177
|
return doTaxonNames;
|
178
|
}
|
179
|
public void setDoTaxonNames(boolean doTaxonNames) {
|
180
|
this.doTaxonNames = doTaxonNames;
|
181
|
}
|
182
|
|
183
|
public boolean isDoTaxa() {
|
184
|
return doTaxa;
|
185
|
}
|
186
|
public void setDoTaxa(boolean doTaxa) {
|
187
|
this.doTaxa = doTaxa;
|
188
|
}
|
189
|
|
190
|
public boolean isDoRelTaxa() {
|
191
|
return doRelTaxa;
|
192
|
}
|
193
|
public void setDoRelTaxa(boolean doRelTaxa) {
|
194
|
this.doRelTaxa = doRelTaxa;
|
195
|
}
|
196
|
|
197
|
|
198
|
|
199
|
|
200
|
// @SuppressWarnings("unchecked")
|
201
|
protected void makeIoClassList() {
|
202
|
ioClassList = new Class[] {
|
203
|
SDDCdmExporter.class,
|
204
|
};
|
205
|
};
|
206
|
|
207
|
|
208
|
|
209
|
|
210
|
/**
|
211
|
* @param url
|
212
|
* @param destination
|
213
|
*/
|
214
|
private SDDExportConfigurator(ICdmDataSource source, String url) {
|
215
|
super(new File(url), source, defaultTransformer);
|
216
|
// setDestination(url);
|
217
|
// setSource(source);
|
218
|
}
|
219
|
|
220
|
|
221
|
/* (non-Javadoc)
|
222
|
* @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSource()
|
223
|
*/
|
224
|
public File getDestination() {
|
225
|
File file = super.getDestination();
|
226
|
return file;
|
227
|
// return super.getDestination();
|
228
|
}
|
229
|
|
230
|
|
231
|
/**
|
232
|
* @param file
|
233
|
*/
|
234
|
public void setDestination(File fileName) {
|
235
|
super.setDestination(fileName);
|
236
|
}
|
237
|
|
238
|
|
239
|
/* (non-Javadoc)
|
240
|
* @see eu.etaxonomy.cdm.io.common.IExportConfigurator#getDestinationNameString()
|
241
|
*/
|
242
|
public String getDestinationNameString() {
|
243
|
if (this.getDestination() == null) {
|
244
|
return null;
|
245
|
} else {
|
246
|
return this.getDestination().toString();
|
247
|
}
|
248
|
}
|
249
|
|
250
|
|
251
|
/* (non-Javadoc)
|
252
|
* @see eu.etaxonomy.cdm.io.common.IExportConfigurator#getNewState()
|
253
|
*/
|
254
|
public SDDExportState getNewState() {
|
255
|
return new SDDExportState(this);
|
256
|
}
|
257
|
|
258
|
|
259
|
}
|