2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.io
.sdd
;
14 import org
.apache
.log4j
.Logger
;
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
;
22 * @author h.fradin (from a.babadshanjan JaxbExportConfigurator)
26 public class SDDExportConfigurator
extends XmlExportConfiguratorBase
implements IExportConfigurator
{
28 @SuppressWarnings("unused")
29 private static final Logger logger
= Logger
.getLogger(SDDExportConfigurator
.class);
31 private int maxRows
= 0;
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;
51 public static SDDExportConfigurator
NewInstance(ICdmDataSource source
, String url
, String destinationFolder
) {
52 return new SDDExportConfigurator(source
, destinationFolder
+ File
.separator
+ url
);
56 public int getMaxRows() {
60 public void setMaxRows(int maxRows
) {
61 this.maxRows
= maxRows
;
65 public boolean isDoAgentData() {
69 public void setDoAgentData(boolean doAgentData
) {
70 this.doAgentData
= doAgentData
;
73 public boolean isDoLanguageData() {
74 return doLanguageData
;
77 public void setDoLanguageData(boolean doLanguageData
) {
78 this.doLanguageData
= doLanguageData
;
81 public boolean isDoFeatureData() {
85 public void setDoFeatureData(boolean doFeatureData
) {
86 this.doFeatureData
= doFeatureData
;
89 public boolean isDoDescriptions() {
90 return doDescriptions
;
93 public void setDoDescriptions(boolean doDescriptions
) {
94 this.doDescriptions
= doDescriptions
;
97 public boolean isDoMedia() {
101 public void setDoMedia(boolean doMedia
) {
102 this.doMedia
= doMedia
;
105 public boolean isDoReferencedEntities() {
106 return doReferencedEntities
;
109 public void setDoReferencedEntities(boolean doReferencedEntities
) {
110 this.doReferencedEntities
= doReferencedEntities
;
114 public boolean isDoSynonyms() {
118 public void setDoSynonyms(boolean doSynonyms
) {
119 this.doSynonyms
= doSynonyms
;
123 public boolean isDoTerms() {
127 public void setDoTerms(boolean doTerms
) {
128 this.doTerms
= doTerms
;
131 public boolean isDoTermVocabularies() {
132 return doTermVocabularies
;
135 public void setDoTermVocabularies(boolean doTermVocabularies
) {
136 this.doTermVocabularies
= doTermVocabularies
;
139 public boolean isDoHomotypicalGroups() {
140 return doHomotypicalGroups
;
143 public void setDoHomotypicalGroups(boolean doHomotypicalGroups
) {
144 this.doHomotypicalGroups
= doHomotypicalGroups
;
148 // @SuppressWarnings("unchecked")
149 protected void makeIoClassList() {
150 ioClassList
= new Class
[] {
151 SDDCdmExporter
.class,
162 private SDDExportConfigurator(ICdmDataSource source
, String url
) {
163 super(new File(url
), source
);
164 // setDestination(url);
165 // setSource(source);
170 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSource()
172 public File
getDestination() {
173 File file
= super.getDestination();
175 // return super.getDestination();
182 public void setDestination(File fileName
) {
183 super.setDestination(fileName
);
188 * @see eu.etaxonomy.cdm.io.common.IExportConfigurator#getDestinationNameString()
190 public String
getDestinationNameString() {
191 if (this.getDestination() == null) {
194 return this.getDestination().toString();
200 * @see eu.etaxonomy.cdm.io.common.IExportConfigurator#getNewState()
202 public ExportStateBase
getNewState() {
203 return new SDDExportState(this);