1 |
2e90726e
|
Katja Luther
|
/**
|
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 |
3510f376
|
Katja Luther
|
package eu.etaxonomy.cdm.io.cdmLight;
|
10 |
2e90726e
|
Katja Luther
|
|
11 |
|
|
import java.io.File;
|
12 |
539106f0
|
Katja Luther
|
import java.util.Comparator;
|
13 |
2e90726e
|
Katja Luther
|
|
14 |
|
|
import eu.etaxonomy.cdm.io.common.CsvIOConfigurator;
|
15 |
|
|
import eu.etaxonomy.cdm.io.common.ExportConfiguratorBase;
|
16 |
03ebde9e
|
Katja Luther
|
import eu.etaxonomy.cdm.io.common.ExportResultType;
|
17 |
2e90726e
|
Katja Luther
|
import eu.etaxonomy.cdm.io.common.mapping.out.IExportTransformer;
|
18 |
2faa1a56
|
Katja Luther
|
import eu.etaxonomy.cdm.model.common.Language;
|
19 |
539106f0
|
Katja Luther
|
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
|
20 |
2e90726e
|
Katja Luther
|
|
21 |
|
|
/**
|
22 |
|
|
* @author k.luther
|
23 |
53db84af
|
Andreas Müller
|
* @since 15.03.2017
|
24 |
2e90726e
|
Katja Luther
|
*
|
25 |
|
|
*/
|
26 |
e6bec461
|
Andreas Müller
|
public class CdmLightExportConfigurator
|
27 |
|
|
extends ExportConfiguratorBase<CdmLightExportState, IExportTransformer, File>{
|
28 |
2e90726e
|
Katja Luther
|
|
29 |
|
|
private static final long serialVersionUID = -1562074221435082060L;
|
30 |
|
|
|
31 |
d1ff240b
|
Andreas Müller
|
|
32 |
48efa785
|
Katja Luther
|
// private Set<UUID> classificationUuids = new HashSet<>();
|
33 |
|
|
//
|
34 |
|
|
// private Set<UUID> taxonNodeUuids = new HashSet<>();
|
35 |
9b7bec58
|
Katja Luther
|
|
36 |
2e90726e
|
Katja Luther
|
|
37 |
|
|
private CsvIOConfigurator csvIOConfig = CsvIOConfigurator.NewInstance();
|
38 |
69f5b141
|
Andreas Müller
|
{
|
39 |
|
|
csvIOConfig.setFieldsTerminatedBy(",");
|
40 |
|
|
}
|
41 |
2e90726e
|
Katja Luther
|
|
42 |
d4bf18c9
|
Katja Luther
|
private boolean isHighlightPrimaryCollector = false;
|
43 |
|
|
|
44 |
c7794cca
|
Katja Luther
|
private boolean createZipFile = false;
|
45 |
|
|
|
46 |
2d006ce7
|
Katja Luther
|
private boolean isFilterIntextReferences = true;
|
47 |
c0babef0
|
Katja Luther
|
//private boolean isCreateCondensedDistributionString = true;
|
48 |
|
|
//private CondensedDistributionRecipe recipe = CondensedDistributionRecipe.EuroPlusMed;
|
49 |
0a7237ca
|
Katja Luther
|
private boolean isFilterImportSources = true;
|
50 |
2d006ce7
|
Katja Luther
|
|
51 |
539106f0
|
Katja Luther
|
private Comparator<TaxonNodeDto> comparator;
|
52 |
|
|
|
53 |
2faa1a56
|
Katja Luther
|
|
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 |
2e90726e
|
Katja Luther
|
/**
|
69 |
|
|
* @param transformer
|
70 |
|
|
*/
|
71 |
3510f376
|
Katja Luther
|
public CdmLightExportConfigurator(IExportTransformer transformer) {
|
72 |
2e90726e
|
Katja Luther
|
super(transformer);
|
73 |
03ebde9e
|
Katja Luther
|
this.resultType = ExportResultType.MAP_BYTE_ARRAY;
|
74 |
11d3f2a9
|
Katja Luther
|
this.setTarget(TARGET.EXPORT_DATA);
|
75 |
cad668ac
|
Katja Luther
|
setUserFriendlyIOName("Cdm Light Export");
|
76 |
2e90726e
|
Katja Luther
|
}
|
77 |
|
|
|
78 |
|
|
|
79 |
|
|
public String getEncoding() {
|
80 |
|
|
return csvIOConfig.getEncoding();
|
81 |
|
|
}
|
82 |
|
|
public void setEncoding(String encoding) {
|
83 |
|
|
this.csvIOConfig.setEncoding(encoding);
|
84 |
|
|
}
|
85 |
e6bec461
|
Andreas Müller
|
|
86 |
2e90726e
|
Katja Luther
|
public String getLinesTerminatedBy() {
|
87 |
|
|
return csvIOConfig.getLinesTerminatedBy();
|
88 |
|
|
}
|
89 |
|
|
public void setLinesTerminatedBy(String linesTerminatedBy) {
|
90 |
|
|
this.csvIOConfig.setLinesTerminatedBy(linesTerminatedBy);
|
91 |
|
|
}
|
92 |
e6bec461
|
Andreas Müller
|
|
93 |
2e90726e
|
Katja Luther
|
public String getFieldsEnclosedBy() {
|
94 |
|
|
return csvIOConfig.getFieldsEnclosedBy();
|
95 |
|
|
}
|
96 |
|
|
public void setFieldsEnclosedBy(String fieldsEnclosedBy) {
|
97 |
|
|
this.csvIOConfig.setFieldsEnclosedBy(fieldsEnclosedBy);
|
98 |
|
|
}
|
99 |
e6bec461
|
Andreas Müller
|
|
100 |
2e90726e
|
Katja Luther
|
public boolean isHasHeaderLines() {
|
101 |
|
|
return csvIOConfig.isHasHeaderLines();
|
102 |
|
|
}
|
103 |
|
|
public void setHasHeaderLines(boolean hasHeaderLines) {
|
104 |
|
|
this.csvIOConfig.setHasHeaderLines(hasHeaderLines);
|
105 |
|
|
}
|
106 |
e6bec461
|
Andreas Müller
|
|
107 |
2e90726e
|
Katja Luther
|
public String getFieldsTerminatedBy() {
|
108 |
|
|
return csvIOConfig.getFieldsTerminatedBy();
|
109 |
|
|
}
|
110 |
|
|
public void setFieldsTerminatedBy(String fieldsTerminatedBy) {
|
111 |
|
|
this.csvIOConfig.setFieldsTerminatedBy(fieldsTerminatedBy);
|
112 |
|
|
}
|
113 |
e6bec461
|
Andreas Müller
|
|
114 |
2e90726e
|
Katja Luther
|
@Override
|
115 |
3510f376
|
Katja Luther
|
public CdmLightExportState getNewState() {
|
116 |
|
|
return new CdmLightExportState(this);
|
117 |
2e90726e
|
Katja Luther
|
}
|
118 |
e6bec461
|
Andreas Müller
|
|
119 |
2e90726e
|
Katja Luther
|
@Override
|
120 |
|
|
public String getDestinationNameString() {
|
121 |
|
|
// TODO Auto-generated method stub
|
122 |
|
|
return null;
|
123 |
|
|
}
|
124 |
2faa1a56
|
Katja Luther
|
/**
|
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 |
2e90726e
|
Katja Luther
|
}
|
311 |
|
|
|
312 |
69f5b141
|
Andreas Müller
|
|
313 |
d4bf18c9
|
Katja Luther
|
public boolean isHighLightPrimaryCollector() {
|
314 |
|
|
return isHighlightPrimaryCollector;
|
315 |
|
|
}
|
316 |
|
|
|
317 |
c7794cca
|
Katja Luther
|
public boolean isCreateZipFile() {
|
318 |
|
|
return createZipFile;
|
319 |
|
|
}
|
320 |
|
|
public void setCreateZipFile(boolean createZipFile) {
|
321 |
|
|
this.createZipFile = createZipFile;
|
322 |
|
|
}
|
323 |
|
|
|
324 |
48efa785
|
Katja Luther
|
|
325 |
2d006ce7
|
Katja Luther
|
public boolean isFilterIntextReferences() {
|
326 |
|
|
return isFilterIntextReferences;
|
327 |
|
|
}
|
328 |
|
|
public void setRemoveIntextReferences(boolean isRemoveIntextReferences) {
|
329 |
|
|
this.isFilterIntextReferences = isRemoveIntextReferences;
|
330 |
|
|
}
|
331 |
|
|
|
332 |
|
|
|
333 |
539106f0
|
Katja Luther
|
public Comparator<TaxonNodeDto> getComparator() {
|
334 |
|
|
return comparator;
|
335 |
|
|
}
|
336 |
|
|
public void setComparator(Comparator<TaxonNodeDto> comparator) {
|
337 |
|
|
this.comparator = comparator;
|
338 |
|
|
}
|
339 |
|
|
|
340 |
|
|
|
341 |
0a7237ca
|
Katja Luther
|
public boolean isFilterImportSources() {
|
342 |
|
|
return isFilterImportSources;
|
343 |
|
|
}
|
344 |
|
|
public void setFilterImportSources(boolean isFilterImportSources) {
|
345 |
|
|
this.isFilterImportSources = isFilterImportSources;
|
346 |
|
|
}
|
347 |
|
|
|
348 |
2faa1a56
|
Katja Luther
|
@Override
|
349 |
|
|
@SuppressWarnings("unchecked")
|
350 |
|
|
protected void makeIoClassList() {
|
351 |
|
|
ioClassList = new Class[] {
|
352 |
|
|
CdmLightClassificationExport.class
|
353 |
|
|
};
|
354 |
|
|
}
|
355 |
|
|
|
356 |
2e90726e
|
Katja Luther
|
}
|