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;
|
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.ExportStateBase;
|
18
|
import eu.etaxonomy.cdm.io.common.IExportConfigurator;
|
19
|
import eu.etaxonomy.cdm.io.common.XmlExportConfiguratorBase;
|
20
|
|
21
|
/**
|
22
|
* @author h.fradin (from a.babadshanjan JaxbExportConfigurator)
|
23
|
* @created 09.12.2008
|
24
|
* @version 1.0
|
25
|
*/
|
26
|
public class SDDExportConfigurator extends XmlExportConfiguratorBase implements IExportConfigurator {
|
27
|
|
28
|
@SuppressWarnings("unused")
|
29
|
private static final Logger logger = Logger.getLogger(SDDExportConfigurator.class);
|
30
|
|
31
|
private int maxRows = 0;
|
32
|
|
33
|
// private boolean doAgents = true;
|
34
|
private boolean doAgentData = true;
|
35
|
private boolean doLanguageData = true;
|
36
|
private boolean doFeatureData = true;
|
37
|
private boolean doDescriptions = true;
|
38
|
private boolean doMedia = true;
|
39
|
// private boolean doOccurrences = true;
|
40
|
// private boolean doReferences = true;
|
41
|
private boolean doReferencedEntities = true;
|
42
|
// private boolean doRelationships = true;
|
43
|
private boolean doSynonyms = true;
|
44
|
// private boolean doTaxonNames = true;
|
45
|
// private boolean doTaxa = true;
|
46
|
private boolean doTerms = true;
|
47
|
private boolean doTermVocabularies = true;
|
48
|
private boolean doHomotypicalGroups = true;
|
49
|
|
50
|
|
51
|
public static SDDExportConfigurator NewInstance(ICdmDataSource source, String url, String destinationFolder) {
|
52
|
return new SDDExportConfigurator(source, destinationFolder + File.separator + url);
|
53
|
}
|
54
|
|
55
|
|
56
|
public int getMaxRows() {
|
57
|
return maxRows;
|
58
|
}
|
59
|
|
60
|
public void setMaxRows(int maxRows) {
|
61
|
this.maxRows = maxRows;
|
62
|
}
|
63
|
|
64
|
|
65
|
public boolean isDoAgentData() {
|
66
|
return doAgentData;
|
67
|
}
|
68
|
|
69
|
public void setDoAgentData(boolean doAgentData) {
|
70
|
this.doAgentData = doAgentData;
|
71
|
}
|
72
|
|
73
|
public boolean isDoLanguageData() {
|
74
|
return doLanguageData;
|
75
|
}
|
76
|
|
77
|
public void setDoLanguageData(boolean doLanguageData) {
|
78
|
this.doLanguageData = doLanguageData;
|
79
|
}
|
80
|
|
81
|
public boolean isDoFeatureData() {
|
82
|
return doFeatureData;
|
83
|
}
|
84
|
|
85
|
public void setDoFeatureData(boolean doFeatureData) {
|
86
|
this.doFeatureData = doFeatureData;
|
87
|
}
|
88
|
|
89
|
public boolean isDoDescriptions() {
|
90
|
return doDescriptions;
|
91
|
}
|
92
|
|
93
|
public void setDoDescriptions(boolean doDescriptions) {
|
94
|
this.doDescriptions = doDescriptions;
|
95
|
}
|
96
|
|
97
|
public boolean isDoMedia() {
|
98
|
return doMedia;
|
99
|
}
|
100
|
|
101
|
public void setDoMedia(boolean doMedia) {
|
102
|
this.doMedia = doMedia;
|
103
|
}
|
104
|
|
105
|
public boolean isDoReferencedEntities() {
|
106
|
return doReferencedEntities;
|
107
|
}
|
108
|
|
109
|
public void setDoReferencedEntities(boolean doReferencedEntities) {
|
110
|
this.doReferencedEntities = doReferencedEntities;
|
111
|
}
|
112
|
|
113
|
|
114
|
public boolean isDoSynonyms() {
|
115
|
return doSynonyms;
|
116
|
}
|
117
|
|
118
|
public void setDoSynonyms(boolean doSynonyms) {
|
119
|
this.doSynonyms = doSynonyms;
|
120
|
}
|
121
|
|
122
|
|
123
|
public boolean isDoTerms() {
|
124
|
return doTerms;
|
125
|
}
|
126
|
|
127
|
public void setDoTerms(boolean doTerms) {
|
128
|
this.doTerms = doTerms;
|
129
|
}
|
130
|
|
131
|
public boolean isDoTermVocabularies() {
|
132
|
return doTermVocabularies;
|
133
|
}
|
134
|
|
135
|
public void setDoTermVocabularies(boolean doTermVocabularies) {
|
136
|
this.doTermVocabularies = doTermVocabularies;
|
137
|
}
|
138
|
|
139
|
public boolean isDoHomotypicalGroups() {
|
140
|
return doHomotypicalGroups;
|
141
|
}
|
142
|
|
143
|
public void setDoHomotypicalGroups(boolean doHomotypicalGroups) {
|
144
|
this.doHomotypicalGroups = doHomotypicalGroups;
|
145
|
}
|
146
|
|
147
|
|
148
|
// @SuppressWarnings("unchecked")
|
149
|
protected void makeIoClassList() {
|
150
|
ioClassList = new Class[] {
|
151
|
SDDCdmExporter.class,
|
152
|
};
|
153
|
};
|
154
|
|
155
|
|
156
|
|
157
|
|
158
|
/**
|
159
|
* @param url
|
160
|
* @param destination
|
161
|
*/
|
162
|
private SDDExportConfigurator(ICdmDataSource source, String url) {
|
163
|
super(new File(url), source);
|
164
|
// setDestination(url);
|
165
|
// setSource(source);
|
166
|
}
|
167
|
|
168
|
|
169
|
/* (non-Javadoc)
|
170
|
* @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSource()
|
171
|
*/
|
172
|
public File getDestination() {
|
173
|
File file = super.getDestination();
|
174
|
return file;
|
175
|
// return super.getDestination();
|
176
|
}
|
177
|
|
178
|
|
179
|
/**
|
180
|
* @param file
|
181
|
*/
|
182
|
public void setDestination(File fileName) {
|
183
|
super.setDestination(fileName);
|
184
|
}
|
185
|
|
186
|
|
187
|
/* (non-Javadoc)
|
188
|
* @see eu.etaxonomy.cdm.io.common.IExportConfigurator#getDestinationNameString()
|
189
|
*/
|
190
|
public String getDestinationNameString() {
|
191
|
if (this.getDestination() == null) {
|
192
|
return null;
|
193
|
} else {
|
194
|
return this.getDestination().toString();
|
195
|
}
|
196
|
}
|
197
|
|
198
|
|
199
|
/* (non-Javadoc)
|
200
|
* @see eu.etaxonomy.cdm.io.common.IExportConfigurator#getNewState()
|
201
|
*/
|
202
|
public ExportStateBase getNewState() {
|
203
|
return new SDDExportState(this);
|
204
|
}
|
205
|
|
206
|
|
207
|
}
|