Revision 6cb0766e
Added by Andreas Müller over 4 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/faunaEuropaea/FaunaEuropaeaTransformer.java | ||
---|---|---|
31 | 31 |
* @author a.babadshanjan |
32 | 32 |
* @since 12.05.2009 |
33 | 33 |
*/ |
34 |
|
|
35 | 34 |
public final class FaunaEuropaeaTransformer { |
36 | 35 |
private static final Logger logger = Logger.getLogger(FaunaEuropaeaTransformer.class); |
37 | 36 |
|
... | ... | |
187 | 186 |
} |
188 | 187 |
|
189 | 188 |
|
190 |
// public static NamedArea areaId2TdwgArea (FaunaEuropaeaDistribution fauEuDistribution) |
|
191 |
// throws UnknownCdmTypeException { |
|
192 |
// |
|
193 |
// NamedArea tdwgArea = null; |
|
194 |
// |
|
195 |
// try { |
|
196 |
// int areaId = fauEuDistribution.getAreaId(); |
|
197 |
// String areaName = fauEuDistribution.getAreaName(); |
|
198 |
// String areaCode = fauEuDistribution.getAreaCode(); |
|
199 |
// int extraLimital = fauEuDistribution.getExtraLimital(); |
|
200 |
// |
|
201 |
// //TODO: Verify mappings with comments. Those don't map to TDWG areas. |
|
202 |
// |
|
203 |
// if (areaCode.equals("AD")) { |
|
204 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SPA-AN"); |
|
205 |
// } else if (areaCode.equals("AL")) { |
|
206 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ALB-OO"); |
|
207 |
// } else if (areaCode.equals("AT")) { |
|
208 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("AUT-AU"); |
|
209 |
// } else if (areaCode.equals("AUS")) { |
|
210 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("AUS"); // Australian region - Australia |
|
211 |
// } else if (areaCode.equals("BA")) { |
|
212 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG-BH"); |
|
213 |
// } else if (areaCode.equals("BE")) { |
|
214 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BGM-BE"); |
|
215 |
// } else if (areaCode.equals("BG")) { |
|
216 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BUL-OO"); |
|
217 |
// } else if (areaCode.equals("BY")) { |
|
218 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLR-OO"); |
|
219 |
// } else if (areaCode.equals("CH")) { |
|
220 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SWI-OO"); |
|
221 |
// } else if (areaCode.equals("CY")) { |
|
222 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("CYP-OO"); |
|
223 |
// } else if (areaCode.equals("CZ")) { |
|
224 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("CZE-CZ"); |
|
225 |
// } else if (areaCode.equals("DE")) { |
|
226 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("GER-OO"); |
|
227 |
// } else if (areaCode.equals("DK-DEN")) { |
|
228 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("DEN-OO"); |
|
229 |
// } else if (areaCode.equals("DK-FOR")) { |
|
230 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FOR-OO"); |
|
231 |
// } else if (areaCode.equals("EE")) { |
|
232 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLT-ES"); |
|
233 |
// } else if (areaCode.equals("ES-BAL")) { |
|
234 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BAL-OO"); |
|
235 |
// } else if (areaCode.equals("ES-CNY")) { |
|
236 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("CNY-OO"); |
|
237 |
// } else if (areaCode.equals("ES-SPA")) { |
|
238 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SPA-SP"); |
|
239 |
// } else if (areaCode.equals("FI")) { |
|
240 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FIN-OO"); |
|
241 |
// } else if (areaCode.equals("FR-COR")) { |
|
242 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("COR-OO"); |
|
243 |
// } else if (areaCode.equals("FR-FRA")) { |
|
244 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FRA-FR"); |
|
245 |
// } else if (areaCode.equals("GB-CI")) { |
|
246 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FRA-CI"); |
|
247 |
// } else if (areaCode.equals("GB-GI")) { |
|
248 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SPA-GI"); |
|
249 |
// } else if (areaCode.equals("GB-GRB")) { |
|
250 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("GRB-OO"); |
|
251 |
// } else if (areaCode.equals("GB-NI")) { |
|
252 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("IRE-NI"); |
|
253 |
// } else if (areaCode.equals("GR-GRC")) { |
|
254 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("GRC-OO"); |
|
255 |
// } else if (areaCode.equals("HR")) { |
|
256 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG-CR"); |
|
257 |
// } else if (areaCode.equals("HU")) { |
|
258 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("HUN-OO"); |
|
259 |
// } else if (areaCode.equals("IE")) { |
|
260 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("IRE-IR"); |
|
261 |
// } else if (areaCode.equals("IS")) { |
|
262 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ICE-OO"); |
|
263 |
// } else if (areaCode.equals("IT-ITA")) { |
|
264 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ITA-IT"); |
|
265 |
// } else if (areaCode.equals("IT-SAR")) { |
|
266 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SAR-OO"); |
|
267 |
// } else if (areaCode.equals("IT-SI")) { |
|
268 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SIC-SI"); |
|
269 |
// } else if (areaCode.equals("LI")) { |
|
270 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("AUT-LI"); |
|
271 |
// } else if (areaCode.equals("LT")) { |
|
272 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLT-LI"); |
|
273 |
// } else if (areaCode.equals("LU")) { |
|
274 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BGM-LU"); |
|
275 |
// } else if (areaCode.equals("LV")) { |
|
276 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLT-LA"); |
|
277 |
// } else if (areaCode.equals("MC")) { |
|
278 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FRA-MO"); |
|
279 |
// } else if (areaCode.equals("MD")) { |
|
280 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("UKR-MO"); |
|
281 |
// } else if (areaCode.equals("MK")) { |
|
282 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG-MA"); |
|
283 |
// } else if (areaCode.equals("MT")) { |
|
284 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SIC-MA"); |
|
285 |
// } else if (areaCode.equals("NL")) { |
|
286 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("NET-OO"); |
|
287 |
// } else if (areaCode.equals("NO-NOR")) { |
|
288 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("NOR-OO"); |
|
289 |
// } else if (areaCode.equals("NO-SVA")) { |
|
290 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SVA-OO"); |
|
291 |
// } else if (areaCode.equals("PL")) { |
|
292 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("POL-OO"); |
|
293 |
// } else if (areaCode.equals("PT-AZO")) { |
|
294 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("AZO-OO"); |
|
295 |
// } else if (areaCode.equals("PT-MDR")) { |
|
296 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("MDR-OO"); |
|
297 |
// } else if (areaCode.equals("PT-POR")) { |
|
298 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("POR-OO"); |
|
299 |
// } else if (areaCode.equals("PT-SEL")) { |
|
300 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SEL-OO"); |
|
301 |
// } else if (areaCode.equals("RO")) { |
|
302 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ROM-OO"); |
|
303 |
// } else if (areaCode.equals("RU-KGD")) { |
|
304 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLT-KA"); |
|
305 |
// } else if (areaCode.equals("RU-RUC")) { |
|
306 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUC-OO"); |
|
307 |
// } else if (areaCode.equals("RU-RUE")) { |
|
308 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUE-OO"); |
|
309 |
// } else if (areaCode.equals("RU-RUN")) { |
|
310 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUN-OO"); |
|
311 |
// } else if (areaCode.equals("RU-RUS")) { |
|
312 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUS-OO"); |
|
313 |
// } else if (areaCode.equals("RU-RUW")) { |
|
314 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUW-OO"); |
|
315 |
// } else if (areaCode.equals("SE")) { |
|
316 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SWE-OO"); |
|
317 |
// } else if (areaCode.equals("SI")) { |
|
318 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG-SL"); |
|
319 |
// } else if (areaCode.equals("SK")) { |
|
320 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("CZE-SK"); |
|
321 |
// } else if (areaCode.equals("SM")) { |
|
322 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ITA-SM"); |
|
323 |
// } else if (areaCode.equals("TR-TUE")) { |
|
324 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("TUE-OO"); |
|
325 |
// }else if (areaCode.equals("UA")) { |
|
326 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("UKR-UK"); //UKraine including Crimea |
|
327 |
// } else if (areaCode.equals("VA")) { |
|
328 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ITA-VC"); |
|
329 |
// } else if (areaCode.equals("YU")) { |
|
330 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG"); |
|
331 |
// } else { |
|
332 |
// throw new UnknownCdmTypeException("Unknown Area " + areaCode); |
|
333 |
// } |
|
334 |
// |
|
335 |
// if (logger.isDebugEnabled()) { |
|
336 |
// logger.debug(areaId + ", " + areaName + ", " + areaCode + ", " + extraLimital); |
|
337 |
// } |
|
338 |
// |
|
339 |
// } catch (Exception e) { |
|
340 |
// //e.printStackTrace(); |
|
341 |
// logger.debug("Exception occurred. Area could not be mapped." + fauEuDistribution.getAreaName()); |
|
342 |
// return null; |
|
343 |
// } |
|
344 |
// |
|
345 |
// return tdwgArea; |
|
346 |
// } |
|
347 |
|
|
348 |
// public static UUID uuidAreaAUS = UUID.fromString("cf979ca8-8cb6-42df-b2ce-1f432ec7c26b"); |
|
349 |
// public static UUID uuidAreaAFR = UUID.fromString("07ac5e75-9fc9-4aa0-938c-1324c9618b97"); |
|
350 |
// public static UUID uuidAreaEPA = UUID.fromString("e83446d7-7379-4beb-be05-295f8da6f5ae"); |
|
351 |
// public static UUID uuidAreaGR_AEG = UUID.fromString("6bd422aa-9911-4b80-8595-0f6d1ecd5eee"); |
|
352 |
// public static UUID uuidAreaGR_CYC = UUID.fromString("8e7d7f1e-3e4d-4f7c-96ec-93ec91e528d6"); |
|
353 |
// public static UUID uuidAreaGR_DOD = UUID.fromString("6d6f6842-924e-440b-9e7e-3df1922bf4a6"); |
|
354 |
// public static UUID uuidAreaNAF = UUID.fromString("d2c54b1e-5f9f-455d-b308-6859cb153c7b"); |
|
355 |
// public static UUID uuidAreaNEA = UUID.fromString("aa87f6b8-110b-44b5-a329-91a08f1a4cc9"); |
|
356 |
// public static UUID uuidAreaNEO = UUID.fromString("0e6e0ce9-c6ab-46bc-80b9-aee4a0620e78"); |
|
357 |
// public static UUID uuidAreaNRE = UUID.fromString("d51876c2-eaf6-4c7f-963e-337dd3e0d729"); |
|
358 |
// public static UUID uuidAreaORR = UUID.fromString("04cab4f8-b316-4e21-9bcc-236a45e4e83d"); |
|
359 |
// public static UUID uuidAreaGR_CR = UUID.fromString("2ef9fa6c-7c3f-431a-96c9-5980c55fc440"); |
|
360 |
// public static UUID uuidAreaGR_GRC = UUID.fromString("b5d33c78-91e7-467a-9c2d-6c337b78d31a"); |
|
361 |
// public static UUID uuidAreaUA = UUID.fromString("859cf055-a208-4f30-8e6e-361f165c6fa9"); |
|
362 |
// public static UUID uuidAreaRU_FJL = UUID.fromString("84671068-2f18-40cb-933a-e7e1c0e37cc8"); |
|
363 |
// public static UUID uuidAreaRU_NOZ = UUID.fromString("64cce0aa-0222-4740-8fa2-dbf0330e9266"); |
|
364 |
|
|
365 |
|
|
366 |
|
|
367 |
// public final static HashMap<String, UUID> abbrToUUID = new HashMap<String,UUID>(); |
|
368 |
// static |
|
369 |
// { |
|
370 |
// abbrToUUID.put("AUS", uuidAreaAUS); |
|
371 |
// abbrToUUID.put("AFR", uuidAreaAFR); |
|
372 |
// abbrToUUID.put("EPA", uuidAreaEPA); |
|
373 |
// abbrToUUID.put("GR-AEG", uuidAreaGR_AEG); |
|
374 |
// abbrToUUID.put("GR-CYC", uuidAreaGR_CYC); |
|
375 |
// abbrToUUID.put("GR-DOD", uuidAreaGR_DOD); |
|
376 |
// abbrToUUID.put("NAF", uuidAreaNAF); |
|
377 |
// abbrToUUID.put("NEA", uuidAreaNEA); |
|
378 |
// abbrToUUID.put("NEO", uuidAreaNEO); |
|
379 |
// abbrToUUID.put("NRE", uuidAreaNRE); |
|
380 |
// abbrToUUID.put("ORR", uuidAreaORR); |
|
381 |
// abbrToUUID.put("GR-KRI", uuidAreaGR_CR); |
|
382 |
// abbrToUUID.put("GR-GRC", uuidAreaGR_GRC); |
|
383 |
// abbrToUUID.put("UA", uuidAreaUA); |
|
384 |
// abbrToUUID.put("RU-FJL", uuidAreaRU_FJL); |
|
385 |
// abbrToUUID.put("RU-NOZ", uuidAreaRU_NOZ); |
|
386 |
// |
|
387 |
// |
|
388 |
// } |
|
389 |
|
|
390 |
|
|
391 | 189 |
public final static HashMap<Integer, Language> languageFK2Language = new HashMap<>(); |
392 | 190 |
|
393 | 191 |
static |
... | ... | |
443 | 241 |
languageFK2Language.put(117, Language.SWAHILI()); |
444 | 242 |
languageFK2Language.put(118, Language.SPANISH_CASTILIAN()); |
445 | 243 |
} |
446 |
// public static UUID getUUIDByAreaAbbr(String abbr){ |
|
447 |
// return abbrToUUID.get(abbr); |
|
448 |
// } |
|
449 | 244 |
|
450 | 245 |
static NomenclaturalStatusType nomStatusTempNamed; |
451 | 246 |
|
... | ... | |
465 | 260 |
|
466 | 261 |
private static UUID uuidEnglishUS; |
467 | 262 |
|
468 |
|
|
469 |
|
|
470 | 263 |
public static NomenclaturalStatusType getNomStatusTempNamed(ITermService termService){ |
471 | 264 |
if (nomStatusTempNamed == null){ |
472 | 265 |
nomStatusTempNamed = (NomenclaturalStatusType)termService.find(PesiTransformer.uuidNomStatusTemporaryName); |
... | ... | |
496 | 289 |
} |
497 | 290 |
return langEnglishUS; |
498 | 291 |
} |
499 |
/** |
|
500 |
* @return |
|
501 |
*/ |
|
502 |
public static DefinedTerm getTaxonomicSpecialistType(ITermService termService) { |
|
292 |
|
|
293 |
public static DefinedTerm getTaxonomicSpecialistType(ITermService termService) { |
|
503 | 294 |
if (taxonomicSpecialistType == null){ |
504 | 295 |
taxonomicSpecialistType = (DefinedTerm)termService.find(uuidTaxonomicSpecialistType); |
505 | 296 |
if (taxonomicSpecialistType == null){ |
... | ... | |
513 | 304 |
} |
514 | 305 |
return taxonomicSpecialistType; |
515 | 306 |
} |
516 |
/** |
|
517 |
* @return |
|
518 |
*/ |
|
519 |
public static DefinedTerm getGroupCoordinatorType(ITermService termService) { |
|
307 |
|
|
308 |
public static DefinedTerm getGroupCoordinatorType(ITermService termService) { |
|
520 | 309 |
if (groupCoordinatorType == null){ |
521 | 310 |
groupCoordinatorType = (DefinedTerm)termService.find(uuidGroupCoordinatorType); |
522 | 311 |
if (groupCoordinatorType == null){ |
... | ... | |
530 | 319 |
return groupCoordinatorType; |
531 | 320 |
} |
532 | 321 |
|
533 |
|
|
534 |
|
|
535 |
/** |
|
536 |
* @return |
|
537 |
*/ |
|
538 | 322 |
public static DefinedTerm getAssociateSpecialistType(ITermService termService) { |
539 | 323 |
if (associateSpecialistType == null){ |
540 | 324 |
associateSpecialistType = (DefinedTerm)termService.find(uuidAssociateSpecialistType); |
... | ... | |
548 | 332 |
} |
549 | 333 |
return associateSpecialistType; |
550 | 334 |
} |
551 |
public static Language langFK2Language( |
|
552 |
Integer languageFk) { |
|
553 |
|
|
554 |
Language result = languageFK2Language.get(languageFk); |
|
555 | 335 |
|
336 |
public static Language langFK2Language(Integer languageFk) { |
|
337 |
Language result = languageFK2Language.get(languageFk); |
|
556 | 338 |
return result; |
557 | 339 |
} |
558 |
|
|
559 |
|
|
560 | 340 |
} |
Also available in: Unified diff
ref #8643 multiple changes to adapt FauEuPesiExport to current situation