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