1
|
/**
|
2
|
* Copyright (C) 2017 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.cdmLight;
|
10
|
|
11
|
import java.io.File;
|
12
|
import java.util.Comparator;
|
13
|
|
14
|
import eu.etaxonomy.cdm.io.common.CsvIOConfigurator;
|
15
|
import eu.etaxonomy.cdm.io.common.ExportConfiguratorBase;
|
16
|
import eu.etaxonomy.cdm.io.common.ExportResultType;
|
17
|
import eu.etaxonomy.cdm.io.common.mapping.out.IExportTransformer;
|
18
|
import eu.etaxonomy.cdm.model.common.Language;
|
19
|
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
|
20
|
|
21
|
/**
|
22
|
* @author k.luther
|
23
|
* @since 15.03.2017
|
24
|
*
|
25
|
*/
|
26
|
public class CdmLightExportConfigurator
|
27
|
extends ExportConfiguratorBase<CdmLightExportState, IExportTransformer, File>{
|
28
|
|
29
|
private static final long serialVersionUID = -1562074221435082060L;
|
30
|
|
31
|
|
32
|
// private Set<UUID> classificationUuids = new HashSet<>();
|
33
|
//
|
34
|
// private Set<UUID> taxonNodeUuids = new HashSet<>();
|
35
|
|
36
|
|
37
|
private CsvIOConfigurator csvIOConfig = CsvIOConfigurator.NewInstance();
|
38
|
{
|
39
|
csvIOConfig.setFieldsTerminatedBy(",");
|
40
|
}
|
41
|
|
42
|
private boolean isHighlightPrimaryCollector = false;
|
43
|
|
44
|
private boolean createZipFile = false;
|
45
|
|
46
|
private boolean isFilterIntextReferences = true;
|
47
|
//private boolean isCreateCondensedDistributionString = true;
|
48
|
//private CondensedDistributionRecipe recipe = CondensedDistributionRecipe.EuroPlusMed;
|
49
|
private boolean isFilterImportSources = true;
|
50
|
|
51
|
private Comparator<TaxonNodeDto> comparator;
|
52
|
|
53
|
|
54
|
//metadata /gfbio
|
55
|
private String description;
|
56
|
private String creator;
|
57
|
private String contributor;
|
58
|
private String title;
|
59
|
private Language language;
|
60
|
private String dataSet_landing_page;
|
61
|
private String dataset_download_link;
|
62
|
private String base_url;
|
63
|
private String recommended_citation;
|
64
|
private String location;
|
65
|
private String keywords;
|
66
|
private String licence;
|
67
|
|
68
|
/**
|
69
|
* @param transformer
|
70
|
*/
|
71
|
public CdmLightExportConfigurator(IExportTransformer transformer) {
|
72
|
super(transformer);
|
73
|
this.resultType = ExportResultType.MAP_BYTE_ARRAY;
|
74
|
this.setTarget(TARGET.EXPORT_DATA);
|
75
|
setUserFriendlyIOName("Cdm Light Export");
|
76
|
}
|
77
|
|
78
|
|
79
|
public String getEncoding() {
|
80
|
return csvIOConfig.getEncoding();
|
81
|
}
|
82
|
public void setEncoding(String encoding) {
|
83
|
this.csvIOConfig.setEncoding(encoding);
|
84
|
}
|
85
|
|
86
|
public String getLinesTerminatedBy() {
|
87
|
return csvIOConfig.getLinesTerminatedBy();
|
88
|
}
|
89
|
public void setLinesTerminatedBy(String linesTerminatedBy) {
|
90
|
this.csvIOConfig.setLinesTerminatedBy(linesTerminatedBy);
|
91
|
}
|
92
|
|
93
|
public String getFieldsEnclosedBy() {
|
94
|
return csvIOConfig.getFieldsEnclosedBy();
|
95
|
}
|
96
|
public void setFieldsEnclosedBy(String fieldsEnclosedBy) {
|
97
|
this.csvIOConfig.setFieldsEnclosedBy(fieldsEnclosedBy);
|
98
|
}
|
99
|
|
100
|
public boolean isHasHeaderLines() {
|
101
|
return csvIOConfig.isHasHeaderLines();
|
102
|
}
|
103
|
public void setHasHeaderLines(boolean hasHeaderLines) {
|
104
|
this.csvIOConfig.setHasHeaderLines(hasHeaderLines);
|
105
|
}
|
106
|
|
107
|
public String getFieldsTerminatedBy() {
|
108
|
return csvIOConfig.getFieldsTerminatedBy();
|
109
|
}
|
110
|
public void setFieldsTerminatedBy(String fieldsTerminatedBy) {
|
111
|
this.csvIOConfig.setFieldsTerminatedBy(fieldsTerminatedBy);
|
112
|
}
|
113
|
|
114
|
@Override
|
115
|
public CdmLightExportState getNewState() {
|
116
|
return new CdmLightExportState(this);
|
117
|
}
|
118
|
|
119
|
@Override
|
120
|
public String getDestinationNameString() {
|
121
|
// TODO Auto-generated method stub
|
122
|
return null;
|
123
|
}
|
124
|
/**
|
125
|
* @return the description
|
126
|
*/
|
127
|
public String getDescription() {
|
128
|
return description;
|
129
|
}
|
130
|
|
131
|
|
132
|
/**
|
133
|
* @param description the description to set
|
134
|
*/
|
135
|
public void setDescription(String description) {
|
136
|
this.description = description;
|
137
|
}
|
138
|
|
139
|
|
140
|
/**
|
141
|
* @return the creator
|
142
|
*/
|
143
|
public String getCreator() {
|
144
|
return creator;
|
145
|
}
|
146
|
|
147
|
|
148
|
/**
|
149
|
* @param creator the creator to set
|
150
|
*/
|
151
|
public void setCreator(String creator) {
|
152
|
this.creator = creator;
|
153
|
}
|
154
|
|
155
|
|
156
|
public String getContributor() {
|
157
|
return contributor;
|
158
|
}
|
159
|
|
160
|
|
161
|
public void setContributor(String contributor) {
|
162
|
this.contributor = contributor;
|
163
|
}
|
164
|
|
165
|
|
166
|
/**
|
167
|
* @return the title
|
168
|
*/
|
169
|
public String getTitle() {
|
170
|
return title;
|
171
|
}
|
172
|
|
173
|
|
174
|
/**
|
175
|
* @param title the title to set
|
176
|
*/
|
177
|
public void setTitle(String title) {
|
178
|
this.title = title;
|
179
|
}
|
180
|
|
181
|
|
182
|
/**
|
183
|
* @return the language
|
184
|
*/
|
185
|
public Language getLanguage() {
|
186
|
return language;
|
187
|
}
|
188
|
|
189
|
|
190
|
/**
|
191
|
* @param language the language to set
|
192
|
*/
|
193
|
public void setLanguage(Language language) {
|
194
|
this.language = language;
|
195
|
}
|
196
|
|
197
|
|
198
|
|
199
|
|
200
|
|
201
|
/**
|
202
|
* @return the dataSet_landing_page
|
203
|
*/
|
204
|
public String getDataSet_landing_page() {
|
205
|
return dataSet_landing_page;
|
206
|
}
|
207
|
|
208
|
|
209
|
/**
|
210
|
* @param dataSet_landing_page the dataSet_landing_page to set
|
211
|
*/
|
212
|
public void setDataSet_landing_page(String dataSet_landing_page) {
|
213
|
this.dataSet_landing_page = dataSet_landing_page;
|
214
|
}
|
215
|
|
216
|
|
217
|
/**
|
218
|
* @return the dataset_download_link
|
219
|
*/
|
220
|
public String getDataset_download_link() {
|
221
|
return dataset_download_link;
|
222
|
}
|
223
|
|
224
|
|
225
|
/**
|
226
|
* @param dataset_download_link the dataset_download_link to set
|
227
|
*/
|
228
|
public void setDataset_download_link(String dataset_download_link) {
|
229
|
this.dataset_download_link = dataset_download_link;
|
230
|
}
|
231
|
|
232
|
|
233
|
/**
|
234
|
* @return the base_url
|
235
|
*/
|
236
|
public String getBase_url() {
|
237
|
return base_url;
|
238
|
}
|
239
|
|
240
|
|
241
|
/**
|
242
|
* @param base_url the base_url to set
|
243
|
*/
|
244
|
public void setBase_url(String base_url) {
|
245
|
this.base_url = base_url;
|
246
|
}
|
247
|
|
248
|
|
249
|
/**
|
250
|
* @return the recommended_citation
|
251
|
*/
|
252
|
public String getRecommended_citation() {
|
253
|
return recommended_citation;
|
254
|
}
|
255
|
|
256
|
|
257
|
/**
|
258
|
* @param recommended_citation the recommended_citation to set
|
259
|
*/
|
260
|
public void setRecommended_citation(String recommended_citation) {
|
261
|
this.recommended_citation = recommended_citation;
|
262
|
}
|
263
|
|
264
|
|
265
|
/**
|
266
|
* @return the location
|
267
|
*/
|
268
|
public String getLocation() {
|
269
|
return location;
|
270
|
}
|
271
|
|
272
|
|
273
|
/**
|
274
|
* @param location the location to set
|
275
|
*/
|
276
|
public void setLocation(String location) {
|
277
|
this.location = location;
|
278
|
}
|
279
|
|
280
|
|
281
|
/**
|
282
|
* @return the keywords
|
283
|
*/
|
284
|
public String getKeywords() {
|
285
|
return keywords;
|
286
|
}
|
287
|
|
288
|
|
289
|
/**
|
290
|
* @param keywords the keywords to set
|
291
|
*/
|
292
|
public void setKeywords(String keywords) {
|
293
|
this.keywords = keywords;
|
294
|
}
|
295
|
|
296
|
|
297
|
/**
|
298
|
* @return the licence
|
299
|
*/
|
300
|
public String getLicence() {
|
301
|
return licence;
|
302
|
}
|
303
|
|
304
|
|
305
|
/**
|
306
|
* @param licence the licence to set
|
307
|
*/
|
308
|
public void setLicence(String licence) {
|
309
|
this.licence = licence;
|
310
|
}
|
311
|
|
312
|
|
313
|
public boolean isHighLightPrimaryCollector() {
|
314
|
return isHighlightPrimaryCollector;
|
315
|
}
|
316
|
|
317
|
public boolean isCreateZipFile() {
|
318
|
return createZipFile;
|
319
|
}
|
320
|
public void setCreateZipFile(boolean createZipFile) {
|
321
|
this.createZipFile = createZipFile;
|
322
|
}
|
323
|
|
324
|
|
325
|
public boolean isFilterIntextReferences() {
|
326
|
return isFilterIntextReferences;
|
327
|
}
|
328
|
public void setRemoveIntextReferences(boolean isRemoveIntextReferences) {
|
329
|
this.isFilterIntextReferences = isRemoveIntextReferences;
|
330
|
}
|
331
|
|
332
|
|
333
|
public Comparator<TaxonNodeDto> getComparator() {
|
334
|
return comparator;
|
335
|
}
|
336
|
public void setComparator(Comparator<TaxonNodeDto> comparator) {
|
337
|
this.comparator = comparator;
|
338
|
}
|
339
|
|
340
|
|
341
|
public boolean isFilterImportSources() {
|
342
|
return isFilterImportSources;
|
343
|
}
|
344
|
public void setFilterImportSources(boolean isFilterImportSources) {
|
345
|
this.isFilterImportSources = isFilterImportSources;
|
346
|
}
|
347
|
|
348
|
@Override
|
349
|
@SuppressWarnings("unchecked")
|
350
|
protected void makeIoClassList() {
|
351
|
ioClassList = new Class[] {
|
352
|
CdmLightClassificationExport.class
|
353
|
};
|
354
|
}
|
355
|
|
356
|
}
|