(no commit message)
[cdmlib.git] / cdmlib-io / src / main / java / eu / etaxonomy / cdm / io / jaxb / JaxbExportConfigurator.java
1 /**
2 * Copyright (C) 2008 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.jaxb;
11
12 import org.apache.log4j.Logger;
13
14 import eu.etaxonomy.cdm.database.ICdmDataSource;
15 import eu.etaxonomy.cdm.io.common.ExportConfiguratorBase;
16 import eu.etaxonomy.cdm.io.common.ExportStateBase;
17 import eu.etaxonomy.cdm.io.common.IExportConfigurator;
18
19 /**
20 * @author a.babadshanjan
21 * @created 03.09.2008
22 */
23 public class JaxbExportConfigurator extends ExportConfiguratorBase implements IExportConfigurator {
24 private static final Logger logger = Logger.getLogger(JaxbExportConfigurator.class);
25
26 private int maxRows = 0;
27 private boolean formattedOutput = Boolean.TRUE;
28 private String encoding = "UTF-8";
29
30 private boolean doUsers = true;
31 private boolean doAgentData = true;
32 private boolean doLanguageData = true;
33 private boolean doFeatureData = true;
34 private boolean doDescriptions = true;
35 private boolean doMedia = true;
36 // private boolean doOccurrences = true;
37 // private boolean doReferences = true;
38 private boolean doReferencedEntities = true;
39 // private boolean doRelationships = true;
40 private boolean doSynonyms = true;
41 // private boolean doTaxonNames = true;
42 // private boolean doTaxa = true;
43 private boolean doTerms = true;
44 private boolean doTermVocabularies = true;
45 private boolean doHomotypicalGroups = true;
46
47 private boolean doTypeDesignations = true;
48 private boolean doTaxonomicTreeData = true;
49
50
51
52
53 /* (non-Javadoc)
54 * @see eu.etaxonomy.cdm.io.common.IExportConfigurator#getNewState()
55 */
56 public JaxbExportState getNewState() {
57 return new JaxbExportState(this);
58 }
59
60 public int getMaxRows() {
61 return maxRows;
62 }
63
64 public void setMaxRows(int maxRows) {
65 this.maxRows = maxRows;
66 }
67
68 public boolean isFormattedOutput() {
69 return formattedOutput;
70 }
71
72 public void setFormattedOutput(boolean formattedOutput) {
73 this.formattedOutput = formattedOutput;
74 }
75
76 public String getEncoding() {
77 return encoding;
78 }
79
80 public void setEncoding(String encoding) {
81 this.encoding = encoding;
82 }
83
84 public boolean isDoAgentData() {
85 return doAgentData;
86 }
87
88 public void setDoAgentData(boolean doAgentData) {
89 this.doAgentData = doAgentData;
90 }
91
92 public boolean isDoLanguageData() {
93 return doLanguageData;
94 }
95
96
97 public void setDoLanguageData(boolean doLanguageData) {
98 this.doLanguageData = doLanguageData;
99 }
100
101 public boolean isDoFeatureData() {
102 return doFeatureData;
103 }
104
105 public void setDoFeatureData(boolean doFeatureData) {
106 this.doFeatureData = doFeatureData;
107 }
108
109 public boolean isDoTaxonomicTreeData() {
110 return doTaxonomicTreeData;
111 }
112 public void setDoTaxonomicTreeData(boolean doTaxonomicTreeData) {
113 this.doTaxonomicTreeData = doTaxonomicTreeData;
114 }
115 public boolean isDoDescriptions() {
116 return doDescriptions;
117 }
118
119 public void setDoDescriptions(boolean doDescriptions) {
120 this.doDescriptions = doDescriptions;
121 }
122
123 public boolean isDoMedia() {
124 return doMedia;
125 }
126
127 public void setDoMedia(boolean doMedia) {
128 this.doMedia = doMedia;
129 }
130
131 public boolean isDoReferencedEntities() {
132 return doReferencedEntities;
133 }
134
135 public void setDoReferencedEntities(boolean doReferencedEntities) {
136 this.doReferencedEntities = doReferencedEntities;
137 }
138
139
140 public boolean isDoSynonyms() {
141 return doSynonyms;
142 }
143 public boolean isDoUsers() {
144 return doUsers;
145 }
146
147 public void setDoSynonyms(boolean doSynonyms) {
148 this.doSynonyms = doSynonyms;
149 }
150
151
152 public boolean isDoTerms() {
153 return doTerms;
154 }
155
156 public void setDoTerms(boolean doTerms) {
157 this.doTerms = doTerms;
158 }
159
160 public boolean isDoTermVocabularies() {
161 return doTermVocabularies;
162 }
163
164 public void setDoTermVocabularies(boolean doTermVocabularies) {
165 this.doTermVocabularies = doTermVocabularies;
166 }
167
168 public boolean isDoHomotypicalGroups() {
169 return doHomotypicalGroups;
170 }
171
172 public void setDoHomotypicalGroups(boolean doHomotypicalGroups) {
173 this.doHomotypicalGroups = doHomotypicalGroups;
174 }
175
176
177 // @SuppressWarnings("unchecked")
178 protected void makeIoClassList() {
179 ioClassList = new Class[] {
180 JaxbExport.class,
181 };
182 };
183
184
185 public static JaxbExportConfigurator NewInstance(ICdmDataSource source, String url) {
186 return new JaxbExportConfigurator(source, url);
187 }
188
189
190 /**
191 * @param url
192 * @param destination
193 */
194 private JaxbExportConfigurator(ICdmDataSource source, String url) {
195 super();
196 setDestination(url);
197 setSource(source);
198 }
199
200
201 /* (non-Javadoc)
202 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSource()
203 */
204 public String getDestination() {
205 return (String)super.getDestination();
206 }
207
208
209 /**
210 * @param file
211 */
212 public void setDestination(String fileName) {
213 super.setDestination(fileName);
214 }
215
216
217 /* (non-Javadoc)
218 * @see eu.etaxonomy.cdm.io.common.IExportConfigurator#getDestinationNameString()
219 */
220 public String getDestinationNameString() {
221 if (this.getDestination() == null) {
222 return null;
223 } else {
224 return (String)this.getDestination();
225 }
226 }
227
228 public boolean isDoTypeDesignations() {
229 return doTypeDesignations;
230 }
231
232 public void setDoTypeDesignations(boolean doTypeDesignations) {
233 this.doTypeDesignations = doTypeDesignations;
234 }
235
236
237 }