1 |
0451b182
|
h.fradin
|
/**
|
2 |
01be5674
|
Andreas Müller
|
* Copyright (C) 2007 EDIT
|
3 |
0451b182
|
h.fradin
|
* European Distributed Institute of Taxonomy
|
4 |
|
|
* http://www.e-taxonomy.eu
|
5 |
01be5674
|
Andreas Müller
|
*
|
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 |
0451b182
|
h.fradin
|
*/
|
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.ExportConfiguratorBase;
|
18 |
|
|
import eu.etaxonomy.cdm.io.common.IExportConfigurator;
|
19 |
|
|
import eu.etaxonomy.cdm.io.sdd.SDDCdmExporter;
|
20 |
|
|
|
21 |
|
|
/**
|
22 |
|
|
* @author h.fradin (from a.babadshanjan JaxbExportConfigurator)
|
23 |
|
|
* @created 09.12.2008
|
24 |
01be5674
|
Andreas Müller
|
* @version 1.0
|
25 |
0451b182
|
h.fradin
|
*/
|
26 |
|
|
public class SDDExportConfigurator extends ExportConfiguratorBase implements IExportConfigurator {
|
27 |
|
|
|
28 |
ad5965e7
|
Andreas Müller
|
@SuppressWarnings("unused")
|
29 |
0451b182
|
h.fradin
|
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 |
ad5965e7
|
Andreas Müller
|
public static SDDExportConfigurator NewInstance(ICdmDataSource source, String url, String destinationFolder) {
|
52 |
f38e10cd
|
h.fradin
|
return new SDDExportConfigurator(source, destinationFolder + File.separator + url);
|
53 |
ad5965e7
|
Andreas Müller
|
}
|
54 |
|
|
|
55 |
|
|
|
56 |
0451b182
|
h.fradin
|
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 |
ad5965e7
|
Andreas Müller
|
|
156 |
0451b182
|
h.fradin
|
|
157 |
|
|
|
158 |
|
|
/**
|
159 |
|
|
* @param url
|
160 |
|
|
* @param destination
|
161 |
|
|
*/
|
162 |
|
|
private SDDExportConfigurator(ICdmDataSource source, String url) {
|
163 |
|
|
super();
|
164 |
|
|
setDestination(url);
|
165 |
|
|
setSource(source);
|
166 |
|
|
}
|
167 |
|
|
|
168 |
|
|
|
169 |
|
|
/* (non-Javadoc)
|
170 |
|
|
* @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSource()
|
171 |
|
|
*/
|
172 |
1aa6256f
|
h.fradin
|
public String getDestination() {
|
173 |
|
|
return (String) super.getDestination();
|
174 |
0451b182
|
h.fradin
|
}
|
175 |
|
|
|
176 |
|
|
|
177 |
|
|
/**
|
178 |
|
|
* @param file
|
179 |
|
|
*/
|
180 |
|
|
public void setDestination(String fileName) {
|
181 |
|
|
super.setDestination(fileName);
|
182 |
|
|
}
|
183 |
|
|
|
184 |
|
|
|
185 |
|
|
/* (non-Javadoc)
|
186 |
|
|
* @see eu.etaxonomy.cdm.io.common.IExportConfigurator#getDestinationNameString()
|
187 |
|
|
*/
|
188 |
|
|
public String getDestinationNameString() {
|
189 |
|
|
if (this.getDestination() == null) {
|
190 |
|
|
return null;
|
191 |
|
|
} else {
|
192 |
|
|
return this.getDestination().toString();
|
193 |
|
|
}
|
194 |
|
|
}
|
195 |
ad5965e7
|
Andreas Müller
|
|
196 |
0451b182
|
h.fradin
|
|
197 |
|
|
}
|