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.berlinModel.out;
|
11
|
|
12
|
import org.apache.log4j.Logger;
|
13
|
|
14
|
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
15
|
import eu.etaxonomy.cdm.io.common.DbExportConfiguratorBase;
|
16
|
import eu.etaxonomy.cdm.io.common.IExportConfigurator;
|
17
|
import eu.etaxonomy.cdm.io.common.Source;
|
18
|
import eu.etaxonomy.cdm.io.common.mapping.out.IExportTransformer;
|
19
|
|
20
|
/**
|
21
|
* @author a.mueller
|
22
|
* @created 20.03.2008
|
23
|
*/
|
24
|
public class BerlinModelExportConfigurator
|
25
|
extends DbExportConfiguratorBase<BerlinModelExportState, IExportTransformer, Source>
|
26
|
implements IExportConfigurator<BerlinModelExportState, IExportTransformer>{
|
27
|
|
28
|
private static final long serialVersionUID = -2346209092417359348L;
|
29
|
|
30
|
@SuppressWarnings("unused")
|
31
|
private static Logger logger = Logger.getLogger(BerlinModelExportConfigurator.class);
|
32
|
|
33
|
// TODO
|
34
|
private static IExportTransformer defaultTransformer = null;
|
35
|
|
36
|
|
37
|
//ID for the isHomotypic relationship in RelName, if not exist null
|
38
|
private Integer isHomotypicId = null;
|
39
|
|
40
|
private boolean doAuthors = true;
|
41
|
//references
|
42
|
private DO_REFERENCES doReferences = DO_REFERENCES.ALL;
|
43
|
//names
|
44
|
private boolean doTaxonNames = true;
|
45
|
private boolean doRelNames = true;
|
46
|
private boolean doNameFacts = true;
|
47
|
|
48
|
//taxa
|
49
|
private boolean doTaxa = true;
|
50
|
private boolean doRelTaxa = true;
|
51
|
private boolean doFacts = true;
|
52
|
private boolean doOccurrence = true;
|
53
|
|
54
|
|
55
|
public static BerlinModelExportConfigurator NewInstance(Source berlinModelDestination, ICdmDataSource source){
|
56
|
return new BerlinModelExportConfigurator(berlinModelDestination, source);
|
57
|
}
|
58
|
|
59
|
@Override
|
60
|
protected void makeIoClassList(){
|
61
|
ioClassList = new Class[]{
|
62
|
BerlinModelAuthorExport.class
|
63
|
, BerlinModelAuthorTeamExport.class
|
64
|
, BerlinModelReferenceExport.class
|
65
|
, BerlinModelTaxonNameExport.class
|
66
|
, BerlinModelNameRelationExport.class
|
67
|
// , BerlinModelNameFactsImport.class
|
68
|
// , BerlinModelTypesImport.class
|
69
|
, BerlinModelTaxonExport.class
|
70
|
, BerlinModelTaxonRelationExport.class
|
71
|
, BerlinModelClassificationExport.class
|
72
|
, BerlinModelFactExport.class
|
73
|
// , BerlinModelOccurrenceImport.class
|
74
|
};
|
75
|
|
76
|
}
|
77
|
|
78
|
/**
|
79
|
* @param berlinModelSource
|
80
|
* @param sourceReference
|
81
|
* @param destination
|
82
|
*/
|
83
|
private BerlinModelExportConfigurator(Source destination, ICdmDataSource cdmSource) {
|
84
|
super(defaultTransformer);
|
85
|
setSource(cdmSource);
|
86
|
setDestination(destination);
|
87
|
// setState((BerlinModelExportState)getNewState());
|
88
|
}
|
89
|
|
90
|
/**
|
91
|
* @return the isHomotypicId
|
92
|
*/
|
93
|
public Integer getIsHomotypicId() {
|
94
|
return isHomotypicId;
|
95
|
}
|
96
|
|
97
|
/**
|
98
|
* @param isHomotypicId the isHomotypicId to set
|
99
|
*/
|
100
|
public void setIsHomotypicId(Integer isHomotypicId) {
|
101
|
this.isHomotypicId = isHomotypicId;
|
102
|
}
|
103
|
|
104
|
/* (non-Javadoc)
|
105
|
* @see eu.etaxonomy.cdm.io.common.IExportConfigurator#getNewState()
|
106
|
*/
|
107
|
@Override
|
108
|
public BerlinModelExportState getNewState() {
|
109
|
return new BerlinModelExportState(this);
|
110
|
}
|
111
|
|
112
|
|
113
|
/**
|
114
|
* Import name relationships yes/no?.
|
115
|
* @return
|
116
|
*/
|
117
|
public boolean isDoRelNames() {
|
118
|
return doRelNames;
|
119
|
}
|
120
|
public void setDoRelNames(boolean doRelNames) {
|
121
|
this.doRelNames = doRelNames;
|
122
|
}
|
123
|
public boolean isDoOccurrence() {
|
124
|
return doOccurrence;
|
125
|
}
|
126
|
public void setDoOccurrence(boolean doOccurrence) {
|
127
|
this.doOccurrence = doOccurrence;
|
128
|
}
|
129
|
|
130
|
public boolean isDoFacts() {
|
131
|
return doFacts;
|
132
|
}
|
133
|
public void setDoFacts(boolean doFacts) {
|
134
|
this.doFacts = doFacts;
|
135
|
}
|
136
|
|
137
|
public boolean isDoNameFacts() {
|
138
|
return doNameFacts;
|
139
|
}
|
140
|
public void setDoNameFacts(boolean doNameFacts) {
|
141
|
this.doNameFacts = doNameFacts;
|
142
|
}
|
143
|
|
144
|
|
145
|
public boolean isDoAuthors() {
|
146
|
return doAuthors;
|
147
|
}
|
148
|
public void setDoAuthors(boolean doAuthors) {
|
149
|
this.doAuthors = doAuthors;
|
150
|
}
|
151
|
|
152
|
public DO_REFERENCES getDoReferences() {
|
153
|
return doReferences;
|
154
|
}
|
155
|
public void setDoReferences(DO_REFERENCES doReferences) {
|
156
|
this.doReferences = doReferences;
|
157
|
}
|
158
|
|
159
|
public boolean isDoTaxonNames() {
|
160
|
return doTaxonNames;
|
161
|
}
|
162
|
public void setDoTaxonNames(boolean doTaxonNames) {
|
163
|
this.doTaxonNames = doTaxonNames;
|
164
|
}
|
165
|
|
166
|
public boolean isDoTaxa() {
|
167
|
return doTaxa;
|
168
|
}
|
169
|
public void setDoTaxa(boolean doTaxa) {
|
170
|
this.doTaxa = doTaxa;
|
171
|
}
|
172
|
|
173
|
public boolean isDoRelTaxa() {
|
174
|
return doRelTaxa;
|
175
|
}
|
176
|
public void setDoRelTaxa(boolean doRelTaxa) {
|
177
|
this.doRelTaxa = doRelTaxa;
|
178
|
}
|
179
|
|
180
|
|
181
|
|
182
|
|
183
|
|
184
|
}
|