Revision 15d48661
Added by Andreas Müller over 4 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/validate/PesiErmsValidator.java | ||
---|---|---|
304 | 304 |
|
305 | 305 |
private boolean testSingleTaxon(ResultSet srcRS, ResultSet destRS) throws SQLException { |
306 | 306 |
String id = String.valueOf(srcRS.getInt("id")); |
307 |
//not complete yet
|
|
307 |
//complete
|
|
308 | 308 |
boolean success = equals("Taxon ID", "tu_id: " + srcRS.getInt("id"), destRS.getString("IdInSource"), id); |
309 | 309 |
success &= equals("Taxon source", "ERMS export for PESI", destRS.getString("sourceName"), id); |
310 | 310 |
|
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/erms/ErmsTaxonImport.java | ||
---|---|---|
177 | 177 |
return; |
178 | 178 |
} |
179 | 179 |
|
180 |
Integer lastTaxonId = null;
|
|
180 |
Integer lastTaxonId = null;
|
|
181 | 181 |
@Override |
182 | 182 |
protected boolean ignoreRecord(ResultSet rs) throws SQLException { |
183 | 183 |
Integer id = rs.getInt("id"); |
... | ... | |
262 | 262 |
private void handleNameStatus(TaxonName name, ResultSet rs, ErmsImportState state) throws SQLException { |
263 | 263 |
NomenclaturalStatusType nomStatus = null; |
264 | 264 |
int tuStatus = rs.getInt("tu_status"); |
265 |
//the order is bottom up from SQL script as there values are overriden from top to bottom
|
|
265 |
//the order is bottom up from SQL script as their values are overridden from top to bottom
|
|
266 | 266 |
if (tuStatus == 8){ |
267 | 267 |
//species inquirenda |
268 | 268 |
nomStatus = getNomenclaturalStatusType(state, ErmsTransformer.uuidNomStatusSpeciesInquirenda, "species inquirenda", "species inquirenda", null, Language.LATIN(), null); |
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/erms/ErmsTransformer.java | ||
---|---|---|
715 | 715 |
synType = null; |
716 | 716 |
taxonRelType = TaxonRelationshipType.PRO_PARTE_SYNONYM_FOR(); |
717 | 717 |
}else if (unacceptreason.matches("(?i)(misidentifications?|misapplied .*name|.*misapplication.*|incorrect identification)")){ |
718 |
//see ErmsTaxonImport.getAcceptedTaxaKeys() |
|
718 |
//see ErmsTaxonImport.getAcceptedTaxaKeys(); this differs from SQL script
|
|
719 | 719 |
synType = null; |
720 | 720 |
taxonRelType = TaxonRelationshipType.MISAPPLIED_NAME_FOR(); |
721 | 721 |
}else if (unacceptreason.matches("(?i)(.*jun.*syn.*|\\(synonym\\)|reverted genus transfer)")){ |
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/faunaEuropaea/FaunaEuropaeaImportConfigurator.java | ||
---|---|---|
11 | 11 |
import org.apache.log4j.Logger; |
12 | 12 |
|
13 | 13 |
import eu.etaxonomy.cdm.database.ICdmDataSource; |
14 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator; |
|
15 | 14 |
import eu.etaxonomy.cdm.io.common.ImportConfiguratorBase; |
16 | 15 |
import eu.etaxonomy.cdm.io.common.Source; |
17 | 16 |
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer; |
... | ... | |
24 | 23 |
* @author a.babadshanjan |
25 | 24 |
* @since 08.05.2009 |
26 | 25 |
*/ |
27 |
public class FaunaEuropaeaImportConfigurator extends ImportConfiguratorBase<FaunaEuropaeaImportState, Source> implements IImportConfigurator { |
|
26 |
public class FaunaEuropaeaImportConfigurator |
|
27 |
extends ImportConfiguratorBase<FaunaEuropaeaImportState, Source>{ |
|
28 | 28 |
|
29 | 29 |
private static final long serialVersionUID = 3218446329444903409L; |
30 | 30 |
private static final Logger logger = Logger.getLogger(FaunaEuropaeaImportConfigurator.class); |
31 | 31 |
|
32 |
//TODO |
|
33 | 32 |
private static IInputTransformer defaultTransformer = null; |
34 | 33 |
|
35 | 34 |
private boolean doBasionyms = true; |
... | ... | |
54 | 53 |
return doTypes; |
55 | 54 |
} |
56 | 55 |
|
57 |
|
|
58 |
|
|
59 |
|
|
60 | 56 |
/* Max number of taxa to be saved with one service call */ |
61 | 57 |
private int limitSave = 5000; |
62 | 58 |
private Reference auctReference; |
... | ... | |
75 | 71 |
FaunaEuropaeaAdditionalTaxonDataImport.class, |
76 | 72 |
FaunaEuropaeaVernacularNamesImport.class |
77 | 73 |
}; |
78 |
};
|
|
74 |
} |
|
79 | 75 |
|
80 | 76 |
public static FaunaEuropaeaImportConfigurator NewInstance(Source source, ICdmDataSource destination){ |
81 | 77 |
return new FaunaEuropaeaImportConfigurator(source, destination); |
82 |
} |
|
78 |
}
|
|
83 | 79 |
|
84 | 80 |
private FaunaEuropaeaImportConfigurator(Source source, ICdmDataSource destination) { |
85 | 81 |
super(defaultTransformer); |
... | ... | |
100 | 96 |
// } |
101 | 97 |
|
102 | 98 |
|
103 |
/* (non-Javadoc) |
|
104 |
* @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSourceReference() |
|
105 |
*/ |
|
106 | 99 |
@Override |
107 | 100 |
public Reference getSourceReference() { |
108 | 101 |
//TODO |
... | ... | |
119 | 112 |
return sourceReference; |
120 | 113 |
} |
121 | 114 |
|
122 |
|
|
123 |
/* (non-Javadoc) |
|
124 |
* @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSourceReference() |
|
125 |
*/ |
|
126 | 115 |
public Reference getAuctReference() { |
127 | 116 |
//TODO |
128 | 117 |
if (auctReference == null){ |
... | ... | |
134 | 123 |
return auctReference; |
135 | 124 |
} |
136 | 125 |
|
137 |
/* (non-Javadoc) |
|
138 |
* @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getSourceNameString() |
|
139 |
*/ |
|
140 | 126 |
@Override |
141 | 127 |
public String getSourceNameString() { |
142 | 128 |
if (this.getSource() == null) { |
... | ... | |
146 | 132 |
} |
147 | 133 |
} |
148 | 134 |
|
149 |
/* (non-Javadoc) |
|
150 |
* @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getNewState() |
|
151 |
*/ |
|
152 |
@Override |
|
135 |
@SuppressWarnings("unchecked") |
|
136 |
@Override |
|
153 | 137 |
public FaunaEuropaeaImportState getNewState() { |
154 | 138 |
return new FaunaEuropaeaImportState(this); |
155 | 139 |
} |
156 | 140 |
|
157 |
/** |
|
158 |
* @return the doBasionyms |
|
159 |
*/ |
|
160 | 141 |
public boolean isDoBasionyms() { |
161 | 142 |
return doBasionyms; |
162 | 143 |
} |
163 |
|
|
164 |
/** |
|
165 |
* @param doBasionyms the doBasionyms to set |
|
166 |
*/ |
|
167 | 144 |
public void setDoBasionyms(boolean doBasionyms) { |
168 | 145 |
this.doBasionyms = doBasionyms; |
169 | 146 |
} |
170 | 147 |
|
171 |
/** |
|
172 |
* @return the doTaxonomicallyIncluded |
|
173 |
*/ |
|
174 | 148 |
public boolean isDoTaxonomicallyIncluded() { |
175 | 149 |
return doTaxonomicallyIncluded; |
176 | 150 |
} |
177 |
|
|
178 |
/** |
|
179 |
* @param doTaxonomicallyIncluded the doTaxonomicallyIncluded to set |
|
180 |
*/ |
|
181 | 151 |
public void setDoTaxonomicallyIncluded(boolean doTaxonomicallyIncluded) { |
182 | 152 |
this.doTaxonomicallyIncluded = doTaxonomicallyIncluded; |
183 | 153 |
} |
184 | 154 |
|
185 |
/** |
|
186 |
* @return the doMisappliedNames |
|
187 |
*/ |
|
188 | 155 |
public boolean isDoMisappliedNames() { |
189 | 156 |
return doMisappliedNames; |
190 | 157 |
} |
191 |
|
|
192 |
/** |
|
193 |
* @param doMisappliedNames the doMisappliedNames to set |
|
194 |
*/ |
|
195 | 158 |
public void setDoMisappliedNames(boolean doMisappliedNames) { |
196 | 159 |
this.doMisappliedNames = doMisappliedNames; |
197 | 160 |
} |
198 | 161 |
|
199 |
/** |
|
200 |
* @return the doHeterotypicSynonyms |
|
201 |
*/ |
|
202 | 162 |
public boolean isDoHeterotypicSynonyms() { |
203 | 163 |
return doHeterotypicSynonyms; |
204 | 164 |
} |
205 |
|
|
206 |
/** |
|
207 |
* @param doHeterotypicSynonyms the doHeterotypicSynonyms to set |
|
208 |
*/ |
|
209 | 165 |
public void setDoHeterotypicSynonyms(boolean doHeterotypicSynonyms) { |
210 | 166 |
this.doHeterotypicSynonyms = doHeterotypicSynonyms; |
211 | 167 |
} |
212 | 168 |
|
213 |
/** |
|
214 |
* @param auctReference the auctReference to set |
|
215 |
*/ |
|
216 | 169 |
public void setAuctReference(Reference auctReference) { |
217 | 170 |
this.auctReference = auctReference; |
218 | 171 |
} |
219 | 172 |
|
220 |
/** |
|
221 |
* @return the limitSave |
|
222 |
*/ |
|
223 | 173 |
public int getLimitSave() { |
224 | 174 |
return limitSave; |
225 | 175 |
} |
226 |
|
|
227 |
/** |
|
228 |
* @param limitSave the limitSave to set |
|
229 |
*/ |
|
230 | 176 |
public void setLimitSave(int limitSave) { |
231 | 177 |
this.limitSave = limitSave; |
232 | 178 |
} |
233 | 179 |
|
234 |
/** |
|
235 |
* @param doHeterotypicSynonymsForBasionyms the doHeterotypicSynonymsForBasionyms to set |
|
236 |
*/ |
|
237 | 180 |
public void setDoHeterotypicSynonymsForBasionyms( |
238 | 181 |
boolean doHeterotypicSynonymsForBasionyms) { |
239 | 182 |
this.doHeterotypicSynonymsForBasionyms = doHeterotypicSynonymsForBasionyms; |
240 | 183 |
} |
241 |
|
|
242 |
/** |
|
243 |
* @return the doHeterotypicSynonymsForBasionyms |
|
244 |
*/ |
|
245 | 184 |
public boolean isDoHeterotypicSynonymsForBasionyms() { |
246 | 185 |
return doHeterotypicSynonymsForBasionyms; |
247 | 186 |
} |
248 | 187 |
|
249 |
|
|
250 |
/* (non-Javadoc) |
|
251 |
* @see eu.etaxonomy.cdm.io.tcsrdf.IImportConfigurator#isDoOccurrence() |
|
252 |
*/ |
|
253 | 188 |
public boolean isDoOccurrence() { |
254 | 189 |
return doOccurrence; |
255 | 190 |
} |
256 |
/* (non-Javadoc) |
|
257 |
* @see eu.etaxonomy.cdm.io.tcsrdf.IImportConfigurator#setDoOccurrence(boolean) |
|
258 |
*/ |
|
259 | 191 |
public void setDoOccurrence(boolean doOccurrence) { |
260 | 192 |
this.doOccurrence = doOccurrence; |
261 | 193 |
} |
... | ... | |
285 | 217 |
this.doReferences = doReferences; |
286 | 218 |
} |
287 | 219 |
|
288 |
// public boolean isDoTypes() { |
|
289 |
// return doTypes; |
|
290 |
// } |
|
291 |
// public void setDoTypes(boolean doTypes) { |
|
292 |
// this.doTypes = doTypes; |
|
293 |
// } |
|
294 |
|
|
295 | 220 |
public boolean isDoTaxa() { |
296 | 221 |
return doTaxa; |
297 | 222 |
} |
... | ... | |
315 | 240 |
this.doAssociatedSpecialists = doAssociatedSpecialists; |
316 | 241 |
} |
317 | 242 |
|
318 |
/** |
|
319 |
* @return the doInferredSynonyms |
|
320 |
*/ |
|
321 | 243 |
public boolean isDoInferredSynonyms() { |
322 | 244 |
return doInferredSynonyms; |
323 | 245 |
} |
324 |
|
|
325 | 246 |
public void setDoInferredSynonyms(boolean doInferredSynonyms){ |
326 | 247 |
this.doInferredSynonyms = doInferredSynonyms; |
327 | 248 |
} |
328 |
|
|
329 | 249 |
} |
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/out/PesiTaxonExport.java | ||
---|---|---|
418 | 418 |
for (TaxonNode node : taxon.getTaxonNodes()){ |
419 | 419 |
doCount(count++, modCount, pluralString); |
420 | 420 |
TaxonNode parentNode = node.getParent(); |
421 |
if (parentNode != null && isPesiTaxon(parentNode.getTaxon())){//exclude root taxa and unpublished parents (relevant for "Valueless" parent for E+M Rubus taxa). Usually a parent should not be unpublished |
|
421 |
if (parentNode != null && isPesiTaxon(parentNode.getTaxon())){ //exclude root taxa and unpublished parents (relevant for "Valueless" parent for E+M Rubus taxa). Usually a parent should not be unpublished
|
|
422 | 422 |
int childId = state.getDbId( taxon); |
423 | 423 |
int parentId = state.getDbId(parentNode.getTaxon()); |
424 | 424 |
success &= invokeParentTaxonFk(parentId, childId); |
... | ... | |
1387 | 1387 |
} |
1388 | 1388 |
|
1389 | 1389 |
private static String getDisplayName(TaxonName taxonName, boolean useNameCache) { |
1390 |
// TODO: extension? |
|
1391 | 1390 |
if (taxonName == null) { |
1392 | 1391 |
return null; |
1393 | 1392 |
}else{ |
... | ... | |
1418 | 1417 |
} |
1419 | 1418 |
} |
1420 | 1419 |
|
1421 |
@SuppressWarnings("unused") |
|
1422 |
private static String getGUID(TaxonName taxonName) { |
|
1423 |
UUID uuid = taxonName.getUuid(); |
|
1424 |
String result = "NameUUID:" + uuid.toString(); |
|
1425 |
return result; |
|
1426 |
} |
|
1427 |
|
|
1428 | 1420 |
/** |
1429 | 1421 |
* Returns the <code>WebShowName</code> attribute for a taxon. |
1430 | 1422 |
* See {@link #getWebShowName(TaxonName)} for further explanations. |
... | ... | |
1461 | 1453 |
* @see MethodMapper |
1462 | 1454 |
*/ |
1463 | 1455 |
private static String getWebShowName(TaxonName taxonName) { |
1464 |
//TODO extensions? |
|
1465 | 1456 |
if (taxonName == null) { |
1466 | 1457 |
return null; |
1467 | 1458 |
}else{ |
1468 |
INonViralNameCacheStrategy cacheStrategy = getCacheStrategy(taxonName); |
|
1459 |
taxonName = CdmBase.deproxy(taxonName); |
|
1460 |
INonViralNameCacheStrategy cacheStrategy = getCacheStrategy(taxonName); |
|
1469 | 1461 |
|
1470 | 1462 |
HTMLTagRules tagRules = new HTMLTagRules().addRule(TagEnum.name, "i"); |
1471 | 1463 |
String result = cacheStrategy.getTitleCache(taxonName, tagRules); |
... | ... | |
1521 | 1513 |
return result; |
1522 | 1514 |
} |
1523 | 1515 |
|
1516 |
@SuppressWarnings("unused") |
|
1517 |
private static String getGUID(TaxonName taxonName) { |
|
1518 |
UUID uuid = taxonName.getUuid(); |
|
1519 |
String result = "NameUUID:" + uuid.toString(); |
|
1520 |
return result; |
|
1521 |
} |
|
1522 |
|
|
1523 |
static boolean isFirstAbbrevTitle = true; |
|
1524 | 1524 |
/** |
1525 | 1525 |
* Returns the SourceNameCache for the AdditionalSource table |
1526 |
* @param taxonName |
|
1527 |
* @return |
|
1528 | 1526 |
*/ |
1529 |
static boolean isFirstAbbrevTitle = true; |
|
1530 | 1527 |
@SuppressWarnings("unused") |
1531 | 1528 |
private static String getSourceNameCache(TaxonName taxonName) { |
1532 | 1529 |
if (taxonName != null){ |
Also available in: Unified diff
cleanup