Project

General

Profile

Download (5.59 KB) Statistics
| Branch: | Tag: | Revision:
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.logging.log4j.LogManager;import org.apache.logging.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
 * @since 09.12.2008
23
 */
24
public class SDDExportConfigurator extends XmlExportConfiguratorBase<SDDExportState> {
25

    
26
    private static final long serialVersionUID = 2416094455247924084L;
27

    
28
    @SuppressWarnings("unused")
29
	private static final Logger logger = LogManager.getLogger(SDDExportConfigurator.class);
30

    
31
	private int maxRows = 0;
32

    
33
	private boolean doAgentData = true;
34
	private boolean doLanguageData = true;
35
	private boolean doFeatureData = true;
36
	private boolean doDescriptions = true;
37
	private boolean doMedia = true;
38
	private boolean doReferencedEntities = true;
39
	private boolean doSynonyms = true;
40
	private boolean doTerms = true;
41
	private boolean doTermVocabularies = true;
42
	private boolean doHomotypicalGroups = true;
43
	private boolean doOccurrence = true;
44
	private boolean doAuthors = true;
45
	private DO_REFERENCES doReferences = DO_REFERENCES.ALL;
46
	private boolean doTaxonNames = true;
47
	private boolean doTaxa = true;
48
	private boolean doRelTaxa = true;
49

    
50

    
51
	//TODO
52
	private static IExportTransformer defaultTransformer = null;
53

    
54

    
55
	public static SDDExportConfigurator NewInstance(ICdmDataSource source, String url, String destinationFolder) {
56
		return new SDDExportConfigurator(source, destinationFolder + File.separator + url);
57
	}
58

    
59
	public static SDDExportConfigurator NewInstance(ICdmDataSource source, String url) {
60
		return new SDDExportConfigurator(source, url);
61
	}
62

    
63

    
64
	public int getMaxRows() {
65
		return maxRows;
66
	}
67

    
68
	public void setMaxRows(int maxRows) {
69
		this.maxRows = maxRows;
70
	}
71

    
72

    
73
	public boolean isDoAgentData() {
74
		return doAgentData;
75
	}
76

    
77
	public void setDoAgentData(boolean doAgentData) {
78
		this.doAgentData = doAgentData;
79
	}
80

    
81
	public boolean isDoLanguageData() {
82
		return doLanguageData;
83
	}
84

    
85
	public void setDoLanguageData(boolean doLanguageData) {
86
		this.doLanguageData = doLanguageData;
87
	}
88

    
89
	public boolean isDoFeatureData() {
90
		return doFeatureData;
91
	}
92

    
93
	public void setDoFeatureData(boolean doFeatureData) {
94
		this.doFeatureData = doFeatureData;
95
	}
96

    
97
	public boolean isDoDescriptions() {
98
		return doDescriptions;
99
	}
100

    
101
	public void setDoDescriptions(boolean doDescriptions) {
102
		this.doDescriptions = doDescriptions;
103
	}
104

    
105
	public boolean isDoMedia() {
106
		return doMedia;
107
	}
108

    
109
	public void setDoMedia(boolean doMedia) {
110
		this.doMedia = doMedia;
111
	}
112

    
113
	public boolean isDoReferencedEntities() {
114
		return doReferencedEntities;
115
	}
116

    
117
	public void setDoReferencedEntities(boolean doReferencedEntities) {
118
		this.doReferencedEntities = doReferencedEntities;
119
	}
120

    
121

    
122
	public boolean isDoSynonyms() {
123
		return doSynonyms;
124
	}
125

    
126
	public void setDoSynonyms(boolean doSynonyms) {
127
		this.doSynonyms = doSynonyms;
128
	}
129

    
130

    
131
	public boolean isDoTerms() {
132
		return doTerms;
133
	}
134

    
135
	public void setDoTerms(boolean doTerms) {
136
		this.doTerms = doTerms;
137
	}
138

    
139
	public boolean isDoTermVocabularies() {
140
		return doTermVocabularies;
141
	}
142

    
143
	public void setDoTermVocabularies(boolean doTermVocabularies) {
144
		this.doTermVocabularies = doTermVocabularies;
145
	}
146

    
147
	public boolean isDoHomotypicalGroups() {
148
		return doHomotypicalGroups;
149
	}
150

    
151
	public void setDoHomotypicalGroups(boolean doHomotypicalGroups) {
152
		this.doHomotypicalGroups = doHomotypicalGroups;
153
	}
154

    
155
	public boolean isDoOccurrence() {
156
		return doOccurrence;
157
	}
158
	public void setDoOccurrence(boolean doOccurrence) {
159
		this.doOccurrence = doOccurrence;
160
	}
161

    
162

    
163
	public boolean isDoAuthors() {
164
		return doAuthors;
165
	}
166
	public void setDoAuthors(boolean doAuthors) {
167
		this.doAuthors = doAuthors;
168
	}
169

    
170
	public DO_REFERENCES getDoReferences() {
171
		return doReferences;
172
	}
173
	public void setDoReferences(DO_REFERENCES doReferences) {
174
		this.doReferences = doReferences;
175
	}
176

    
177
	public boolean isDoTaxonNames() {
178
		return doTaxonNames;
179
	}
180
	public void setDoTaxonNames(boolean doTaxonNames) {
181
		this.doTaxonNames = doTaxonNames;
182
	}
183

    
184
	public boolean isDoTaxa() {
185
		return doTaxa;
186
	}
187
	public void setDoTaxa(boolean doTaxa) {
188
		this.doTaxa = doTaxa;
189
	}
190

    
191
	public boolean isDoRelTaxa() {
192
		return doRelTaxa;
193
	}
194
	public void setDoRelTaxa(boolean doRelTaxa) {
195
		this.doRelTaxa = doRelTaxa;
196
	}
197

    
198

    
199

    
200

    
201
	@SuppressWarnings("unchecked")
202
	@Override
203
    protected void makeIoClassList() {
204
		ioClassList = new Class[] {
205
				SDDCdmExporter.class,
206
		};
207
	};
208

    
209

    
210

    
211

    
212
	/**
213
	 * @param url
214
	 * @param destination
215
	 */
216
	private SDDExportConfigurator(ICdmDataSource source, String url) {
217
		super(new File(url), source, defaultTransformer);
218
	}
219

    
220
	@Override
221
    public File getDestination() {
222
		File file = super.getDestination();
223
		return file;
224
	}
225

    
226

    
227
	/**
228
	 * @param file
229
	 */
230
	@Override
231
    public void setDestination(File fileName) {
232
		super.setDestination(fileName);
233
	}
234

    
235
	@Override
236
    public String getDestinationNameString() {
237
		if (this.getDestination() == null) {
238
			return null;
239
		} else {
240
			return this.getDestination().toString();
241
		}
242
	}
243

    
244

    
245
	@Override
246
    public SDDExportState getNewState() {
247
		return new SDDExportState(this);
248
	}
249

    
250

    
251
}
(4-4/5)