Revision bff8d9fe
Added by Andreas Müller over 5 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/erms/ErmsImportConfigurator.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2007 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
... | ... | |
15 | 15 |
|
16 | 16 |
import eu.etaxonomy.cdm.database.ICdmDataSource; |
17 | 17 |
import eu.etaxonomy.cdm.io.common.DbImportConfiguratorBase; |
18 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator; |
|
19 | 18 |
import eu.etaxonomy.cdm.io.common.ImportStateBase; |
20 | 19 |
import eu.etaxonomy.cdm.io.common.Source; |
21 | 20 |
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer; |
... | ... | |
28 | 27 |
/** |
29 | 28 |
* @author a.mueller |
30 | 29 |
* @since 20.03.2008 |
31 |
* @version 1.0 |
|
32 | 30 |
*/ |
33 |
public class ErmsImportConfigurator extends DbImportConfiguratorBase<ErmsImportState> implements IImportConfigurator{ |
|
34 |
@SuppressWarnings("unused") |
|
31 |
public class ErmsImportConfigurator |
|
32 |
extends DbImportConfiguratorBase<ErmsImportState>{ |
|
33 |
private static final long serialVersionUID = 5434106058744720246L; |
|
34 |
|
|
35 |
@SuppressWarnings("unused") |
|
35 | 36 |
private static Logger logger = Logger.getLogger(ErmsImportConfigurator.class); |
36 | 37 |
|
37 | 38 |
public static ErmsImportConfigurator NewInstance(Source ermsSource, ICdmDataSource destination){ |
... | ... | |
43 | 44 |
|
44 | 45 |
//TODO needed ?? |
45 | 46 |
private Method userTransformationMethod; |
46 |
|
|
47 |
|
|
47 | 48 |
private boolean doVernaculars = true; |
48 | 49 |
private boolean doLinks = true; |
49 | 50 |
private boolean doNotes = true; |
... | ... | |
53 | 54 |
private boolean doTaxa = true; |
54 | 55 |
private boolean doRelTaxa = true; |
55 | 56 |
|
56 |
|
|
57 |
|
|
57 | 58 |
private static IInputTransformer defaultTransformer = new ErmsTransformer(); |
58 |
|
|
59 |
protected void makeIoClassList(){ |
|
59 |
|
|
60 |
@Override |
|
61 |
protected void makeIoClassList(){ |
|
60 | 62 |
ioClassList = new Class[]{ |
61 | 63 |
ErmsGeneralImportValidator.class |
62 | 64 |
, ErmsImportRankMap.class |
... | ... | |
67 | 69 |
, ErmsNotesImport.class |
68 | 70 |
, ErmsVernacularSourcesImport.class |
69 | 71 |
, ErmsNotesSourcesImport.class |
70 |
|
|
72 |
|
|
71 | 73 |
, ErmsAreaImport.class |
72 | 74 |
, ErmsDrImport.class |
73 | 75 |
, ErmsSourceUsesImport.class |
74 | 76 |
, ErmsLinkImport.class //kann weiter hoch |
75 | 77 |
, ErmsImageImport.class |
76 |
};
|
|
78 |
}; |
|
77 | 79 |
} |
78 |
|
|
80 |
|
|
79 | 81 |
|
80 | 82 |
/* (non-Javadoc) |
81 | 83 |
* @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getNewState() |
82 | 84 |
*/ |
83 |
public ImportStateBase getNewState() { |
|
85 |
@Override |
|
86 |
public ImportStateBase getNewState() { |
|
84 | 87 |
return new ErmsImportState(this); |
85 | 88 |
} |
86 | 89 |
|
... | ... | |
94 | 97 |
private ErmsImportConfigurator(Source ermsSource, ICdmDataSource destination) { |
95 | 98 |
super(ermsSource, destination, NomenclaturalCode.ICZN, defaultTransformer);//default for ERMS |
96 | 99 |
} |
97 |
|
|
98 |
|
|
99 |
public Source getSource() { |
|
100 |
return (Source)super.getSource(); |
|
100 |
|
|
101 |
|
|
102 |
@Override |
|
103 |
public Source getSource() { |
|
104 |
return super.getSource(); |
|
101 | 105 |
} |
102 |
public void setSource(Source berlinModelSource) { |
|
106 |
@Override |
|
107 |
public void setSource(Source berlinModelSource) { |
|
103 | 108 |
super.setSource(berlinModelSource); |
104 | 109 |
} |
105 | 110 |
|
106 | 111 |
/* (non-Javadoc) |
107 | 112 |
* @see eu.etaxonomy.cdm.io.tcsrdf.IImportConfigurator#getSourceReference() |
108 | 113 |
*/ |
109 |
public Reference getSourceReference() { |
|
114 |
@Override |
|
115 |
public Reference getSourceReference() { |
|
110 | 116 |
if (sourceReference == null){ |
111 | 117 |
sourceReference = ReferenceFactory.newDatabase(); |
112 | 118 |
if (getSource() != null){ |
... | ... | |
123 | 129 |
/* (non-Javadoc) |
124 | 130 |
* @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getSourceNameString() |
125 | 131 |
*/ |
126 |
public String getSourceNameString() { |
|
132 |
@Override |
|
133 |
public String getSourceNameString() { |
|
127 | 134 |
if (this.getSource() == null){ |
128 | 135 |
return null; |
129 | 136 |
}else{ |
... | ... | |
134 | 141 |
/** |
135 | 142 |
* @return the userTransformationMethod |
136 | 143 |
*/ |
137 |
public Method getUserTransformationMethod() { |
|
144 |
@Override |
|
145 |
public Method getUserTransformationMethod() { |
|
138 | 146 |
return userTransformationMethod; |
139 | 147 |
} |
140 | 148 |
|
141 | 149 |
/** |
142 | 150 |
* @param userTransformationMethod the userTransformationMethod to set |
143 | 151 |
*/ |
144 |
public void setUserTransformationMethod(Method userTransformationMethod) { |
|
152 |
@Override |
|
153 |
public void setUserTransformationMethod(Method userTransformationMethod) { |
|
145 | 154 |
this.userTransformationMethod = userTransformationMethod; |
146 | 155 |
} |
147 | 156 |
|
148 |
|
|
157 |
|
|
149 | 158 |
/** |
150 | 159 |
* @return the limitSave |
151 | 160 |
*/ |
152 |
public int getRecordsPerTransaction() { |
|
161 |
@Override |
|
162 |
public int getRecordsPerTransaction() { |
|
153 | 163 |
return recordsPerTransaction; |
154 | 164 |
} |
155 | 165 |
|
156 | 166 |
/** |
157 | 167 |
* @param limitSave the limitSave to set |
158 | 168 |
*/ |
159 |
public void setRecordsPerTransaction(int recordsPerTransaction) { |
|
169 |
@Override |
|
170 |
public void setRecordsPerTransaction(int recordsPerTransaction) { |
|
160 | 171 |
this.recordsPerTransaction = recordsPerTransaction; |
161 | 172 |
} |
162 | 173 |
|
... | ... | |
227 | 238 |
public boolean isDoImages() { |
228 | 239 |
return doImages; |
229 | 240 |
} |
230 |
|
|
231 |
|
|
241 |
|
|
242 |
|
|
232 | 243 |
public boolean isDoOccurrence() { |
233 | 244 |
return doOccurrence; |
234 | 245 |
} |
235 | 246 |
public void setDoOccurrence(boolean doOccurrence) { |
236 | 247 |
this.doOccurrence = doOccurrence; |
237 | 248 |
} |
238 |
|
|
239 |
|
|
249 |
|
|
250 |
|
|
240 | 251 |
public DO_REFERENCES getDoReferences() { |
241 | 252 |
return doReferences; |
242 | 253 |
} |
Also available in: Unified diff
ref #1444 cleanup erms import code