Revision 94f696f9
Added by Katja Luther about 8 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/faunaEuropaea/FaunaEuropaeaTransformer.java | ||
---|---|---|
17 | 17 |
import org.apache.log4j.Logger; |
18 | 18 |
|
19 | 19 |
import eu.etaxonomy.cdm.api.service.ITermService; |
20 |
import eu.etaxonomy.cdm.io.common.TdwgAreaProvider; |
|
21 | 20 |
import eu.etaxonomy.cdm.model.common.DefinedTerm; |
22 | 21 |
import eu.etaxonomy.cdm.model.common.Language; |
23 | 22 |
import eu.etaxonomy.cdm.model.common.Representation; |
24 | 23 |
import eu.etaxonomy.cdm.model.common.TermType; |
25 | 24 |
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm; |
26 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
|
27 | 25 |
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType; |
28 | 26 |
import eu.etaxonomy.cdm.model.name.Rank; |
29 | 27 |
import eu.etaxonomy.cdm.strategy.exceptions.UnknownCdmTypeException; |
... | ... | |
192 | 190 |
} |
193 | 191 |
|
194 | 192 |
|
195 |
public static NamedArea areaId2TdwgArea (FaunaEuropaeaDistribution fauEuDistribution) |
|
196 |
throws UnknownCdmTypeException { |
|
193 |
// public static NamedArea areaId2TdwgArea (FaunaEuropaeaDistribution fauEuDistribution) |
|
194 |
// throws UnknownCdmTypeException { |
|
195 |
// |
|
196 |
// NamedArea tdwgArea = null; |
|
197 |
// |
|
198 |
// try { |
|
199 |
// int areaId = fauEuDistribution.getAreaId(); |
|
200 |
// String areaName = fauEuDistribution.getAreaName(); |
|
201 |
// String areaCode = fauEuDistribution.getAreaCode(); |
|
202 |
// int extraLimital = fauEuDistribution.getExtraLimital(); |
|
203 |
// |
|
204 |
// //TODO: Verify mappings with comments. Those don't map to TDWG areas. |
|
205 |
// |
|
206 |
// if (areaCode.equals("AD")) { |
|
207 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SPA-AN"); |
|
208 |
// } else if (areaCode.equals("AL")) { |
|
209 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ALB-OO"); |
|
210 |
// } else if (areaCode.equals("AT")) { |
|
211 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("AUT-AU"); |
|
212 |
// } else if (areaCode.equals("AUS")) { |
|
213 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("AUS"); // Australian region - Australia |
|
214 |
// } else if (areaCode.equals("BA")) { |
|
215 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG-BH"); |
|
216 |
// } else if (areaCode.equals("BE")) { |
|
217 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BGM-BE"); |
|
218 |
// } else if (areaCode.equals("BG")) { |
|
219 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BUL-OO"); |
|
220 |
// } else if (areaCode.equals("BY")) { |
|
221 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLR-OO"); |
|
222 |
// } else if (areaCode.equals("CH")) { |
|
223 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SWI-OO"); |
|
224 |
// } else if (areaCode.equals("CY")) { |
|
225 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("CYP-OO"); |
|
226 |
// } else if (areaCode.equals("CZ")) { |
|
227 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("CZE-CZ"); |
|
228 |
// } else if (areaCode.equals("DE")) { |
|
229 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("GER-OO"); |
|
230 |
// } else if (areaCode.equals("DK-DEN")) { |
|
231 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("DEN-OO"); |
|
232 |
// } else if (areaCode.equals("DK-FOR")) { |
|
233 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FOR-OO"); |
|
234 |
// } else if (areaCode.equals("EE")) { |
|
235 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLT-ES"); |
|
236 |
// } else if (areaCode.equals("ES-BAL")) { |
|
237 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BAL-OO"); |
|
238 |
// } else if (areaCode.equals("ES-CNY")) { |
|
239 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("CNY-OO"); |
|
240 |
// } else if (areaCode.equals("ES-SPA")) { |
|
241 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SPA-SP"); |
|
242 |
// } else if (areaCode.equals("FI")) { |
|
243 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FIN-OO"); |
|
244 |
// } else if (areaCode.equals("FR-COR")) { |
|
245 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("COR-OO"); |
|
246 |
// } else if (areaCode.equals("FR-FRA")) { |
|
247 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FRA-FR"); |
|
248 |
// } else if (areaCode.equals("GB-CI")) { |
|
249 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FRA-CI"); |
|
250 |
// } else if (areaCode.equals("GB-GI")) { |
|
251 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SPA-GI"); |
|
252 |
// } else if (areaCode.equals("GB-GRB")) { |
|
253 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("GRB-OO"); |
|
254 |
// } else if (areaCode.equals("GB-NI")) { |
|
255 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("IRE-NI"); |
|
256 |
// } else if (areaCode.equals("GR-GRC")) { |
|
257 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("GRC-OO"); |
|
258 |
// } else if (areaCode.equals("HR")) { |
|
259 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG-CR"); |
|
260 |
// } else if (areaCode.equals("HU")) { |
|
261 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("HUN-OO"); |
|
262 |
// } else if (areaCode.equals("IE")) { |
|
263 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("IRE-IR"); |
|
264 |
// } else if (areaCode.equals("IS")) { |
|
265 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ICE-OO"); |
|
266 |
// } else if (areaCode.equals("IT-ITA")) { |
|
267 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ITA-IT"); |
|
268 |
// } else if (areaCode.equals("IT-SAR")) { |
|
269 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SAR-OO"); |
|
270 |
// } else if (areaCode.equals("IT-SI")) { |
|
271 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SIC-SI"); |
|
272 |
// } else if (areaCode.equals("LI")) { |
|
273 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("AUT-LI"); |
|
274 |
// } else if (areaCode.equals("LT")) { |
|
275 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLT-LI"); |
|
276 |
// } else if (areaCode.equals("LU")) { |
|
277 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BGM-LU"); |
|
278 |
// } else if (areaCode.equals("LV")) { |
|
279 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLT-LA"); |
|
280 |
// } else if (areaCode.equals("MC")) { |
|
281 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FRA-MO"); |
|
282 |
// } else if (areaCode.equals("MD")) { |
|
283 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("UKR-MO"); |
|
284 |
// } else if (areaCode.equals("MK")) { |
|
285 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG-MA"); |
|
286 |
// } else if (areaCode.equals("MT")) { |
|
287 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SIC-MA"); |
|
288 |
// } else if (areaCode.equals("NL")) { |
|
289 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("NET-OO"); |
|
290 |
// } else if (areaCode.equals("NO-NOR")) { |
|
291 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("NOR-OO"); |
|
292 |
// } else if (areaCode.equals("NO-SVA")) { |
|
293 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SVA-OO"); |
|
294 |
// } else if (areaCode.equals("PL")) { |
|
295 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("POL-OO"); |
|
296 |
// } else if (areaCode.equals("PT-AZO")) { |
|
297 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("AZO-OO"); |
|
298 |
// } else if (areaCode.equals("PT-MDR")) { |
|
299 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("MDR-OO"); |
|
300 |
// } else if (areaCode.equals("PT-POR")) { |
|
301 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("POR-OO"); |
|
302 |
// } else if (areaCode.equals("PT-SEL")) { |
|
303 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SEL-OO"); |
|
304 |
// } else if (areaCode.equals("RO")) { |
|
305 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ROM-OO"); |
|
306 |
// } else if (areaCode.equals("RU-KGD")) { |
|
307 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLT-KA"); |
|
308 |
// } else if (areaCode.equals("RU-RUC")) { |
|
309 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUC-OO"); |
|
310 |
// } else if (areaCode.equals("RU-RUE")) { |
|
311 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUE-OO"); |
|
312 |
// } else if (areaCode.equals("RU-RUN")) { |
|
313 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUN-OO"); |
|
314 |
// } else if (areaCode.equals("RU-RUS")) { |
|
315 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUS-OO"); |
|
316 |
// } else if (areaCode.equals("RU-RUW")) { |
|
317 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUW-OO"); |
|
318 |
// } else if (areaCode.equals("SE")) { |
|
319 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SWE-OO"); |
|
320 |
// } else if (areaCode.equals("SI")) { |
|
321 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG-SL"); |
|
322 |
// } else if (areaCode.equals("SK")) { |
|
323 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("CZE-SK"); |
|
324 |
// } else if (areaCode.equals("SM")) { |
|
325 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ITA-SM"); |
|
326 |
// } else if (areaCode.equals("TR-TUE")) { |
|
327 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("TUE-OO"); |
|
328 |
// }else if (areaCode.equals("UA")) { |
|
329 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("UKR-UK"); //UKraine including Crimea |
|
330 |
// } else if (areaCode.equals("VA")) { |
|
331 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ITA-VC"); |
|
332 |
// } else if (areaCode.equals("YU")) { |
|
333 |
// tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG"); |
|
334 |
// } else { |
|
335 |
// throw new UnknownCdmTypeException("Unknown Area " + areaCode); |
|
336 |
// } |
|
337 |
// |
|
338 |
// if (logger.isDebugEnabled()) { |
|
339 |
// logger.debug(areaId + ", " + areaName + ", " + areaCode + ", " + extraLimital); |
|
340 |
// } |
|
341 |
// |
|
342 |
// } catch (Exception e) { |
|
343 |
// //e.printStackTrace(); |
|
344 |
// logger.debug("Exception occurred. Area could not be mapped." + fauEuDistribution.getAreaName()); |
|
345 |
// return null; |
|
346 |
// } |
|
347 |
// |
|
348 |
// return tdwgArea; |
|
349 |
// } |
|
350 |
|
|
351 |
// public static UUID uuidAreaAUS = UUID.fromString("cf979ca8-8cb6-42df-b2ce-1f432ec7c26b"); |
|
352 |
// public static UUID uuidAreaAFR = UUID.fromString("07ac5e75-9fc9-4aa0-938c-1324c9618b97"); |
|
353 |
// public static UUID uuidAreaEPA = UUID.fromString("e83446d7-7379-4beb-be05-295f8da6f5ae"); |
|
354 |
// public static UUID uuidAreaGR_AEG = UUID.fromString("6bd422aa-9911-4b80-8595-0f6d1ecd5eee"); |
|
355 |
// public static UUID uuidAreaGR_CYC = UUID.fromString("8e7d7f1e-3e4d-4f7c-96ec-93ec91e528d6"); |
|
356 |
// public static UUID uuidAreaGR_DOD = UUID.fromString("6d6f6842-924e-440b-9e7e-3df1922bf4a6"); |
|
357 |
// public static UUID uuidAreaNAF = UUID.fromString("d2c54b1e-5f9f-455d-b308-6859cb153c7b"); |
|
358 |
// public static UUID uuidAreaNEA = UUID.fromString("aa87f6b8-110b-44b5-a329-91a08f1a4cc9"); |
|
359 |
// public static UUID uuidAreaNEO = UUID.fromString("0e6e0ce9-c6ab-46bc-80b9-aee4a0620e78"); |
|
360 |
// public static UUID uuidAreaNRE = UUID.fromString("d51876c2-eaf6-4c7f-963e-337dd3e0d729"); |
|
361 |
// public static UUID uuidAreaORR = UUID.fromString("04cab4f8-b316-4e21-9bcc-236a45e4e83d"); |
|
362 |
// public static UUID uuidAreaGR_CR = UUID.fromString("2ef9fa6c-7c3f-431a-96c9-5980c55fc440"); |
|
363 |
// public static UUID uuidAreaGR_GRC = UUID.fromString("b5d33c78-91e7-467a-9c2d-6c337b78d31a"); |
|
364 |
// public static UUID uuidAreaUA = UUID.fromString("859cf055-a208-4f30-8e6e-361f165c6fa9"); |
|
365 |
// public static UUID uuidAreaRU_FJL = UUID.fromString("84671068-2f18-40cb-933a-e7e1c0e37cc8"); |
|
366 |
// public static UUID uuidAreaRU_NOZ = UUID.fromString("64cce0aa-0222-4740-8fa2-dbf0330e9266"); |
|
367 |
|
|
368 |
|
|
369 |
|
|
370 |
// public final static HashMap<String, UUID> abbrToUUID = new HashMap<String,UUID>(); |
|
371 |
// static |
|
372 |
// { |
|
373 |
// abbrToUUID.put("AUS", uuidAreaAUS); |
|
374 |
// abbrToUUID.put("AFR", uuidAreaAFR); |
|
375 |
// abbrToUUID.put("EPA", uuidAreaEPA); |
|
376 |
// abbrToUUID.put("GR-AEG", uuidAreaGR_AEG); |
|
377 |
// abbrToUUID.put("GR-CYC", uuidAreaGR_CYC); |
|
378 |
// abbrToUUID.put("GR-DOD", uuidAreaGR_DOD); |
|
379 |
// abbrToUUID.put("NAF", uuidAreaNAF); |
|
380 |
// abbrToUUID.put("NEA", uuidAreaNEA); |
|
381 |
// abbrToUUID.put("NEO", uuidAreaNEO); |
|
382 |
// abbrToUUID.put("NRE", uuidAreaNRE); |
|
383 |
// abbrToUUID.put("ORR", uuidAreaORR); |
|
384 |
// abbrToUUID.put("GR-KRI", uuidAreaGR_CR); |
|
385 |
// abbrToUUID.put("GR-GRC", uuidAreaGR_GRC); |
|
386 |
// abbrToUUID.put("UA", uuidAreaUA); |
|
387 |
// abbrToUUID.put("RU-FJL", uuidAreaRU_FJL); |
|
388 |
// abbrToUUID.put("RU-NOZ", uuidAreaRU_NOZ); |
|
389 |
// |
|
390 |
// |
|
391 |
// } |
|
197 | 392 |
|
198 |
NamedArea tdwgArea = null; |
|
199 | 393 |
|
200 |
try { |
|
201 |
int areaId = fauEuDistribution.getAreaId(); |
|
202 |
String areaName = fauEuDistribution.getAreaName(); |
|
203 |
String areaCode = fauEuDistribution.getAreaCode(); |
|
204 |
int extraLimital = fauEuDistribution.getExtraLimital(); |
|
205 |
|
|
206 |
//TODO: Verify mappings with comments. Those don't map to TDWG areas. |
|
207 |
|
|
208 |
if (areaCode.equals("AD")) { |
|
209 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SPA-AN"); |
|
210 |
} else if (areaCode.equals("AL")) { |
|
211 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ALB-OO"); |
|
212 |
} else if (areaCode.equals("AT")) { |
|
213 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("AUT-AU"); |
|
214 |
} else if (areaCode.equals("AUS")) { |
|
215 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("AUS"); // Australian region - Australia |
|
216 |
} else if (areaCode.equals("BA")) { |
|
217 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG-BH"); |
|
218 |
} else if (areaCode.equals("BE")) { |
|
219 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BGM-BE"); |
|
220 |
} else if (areaCode.equals("BG")) { |
|
221 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BUL-OO"); |
|
222 |
} else if (areaCode.equals("BY")) { |
|
223 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLR-OO"); |
|
224 |
} else if (areaCode.equals("CH")) { |
|
225 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SWI-OO"); |
|
226 |
} else if (areaCode.equals("CY")) { |
|
227 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("CYP-OO"); |
|
228 |
} else if (areaCode.equals("CZ")) { |
|
229 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("CZE-CZ"); |
|
230 |
} else if (areaCode.equals("DE")) { |
|
231 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("GER-OO"); |
|
232 |
} else if (areaCode.equals("DK-DEN")) { |
|
233 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("DEN-OO"); |
|
234 |
} else if (areaCode.equals("DK-FOR")) { |
|
235 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FOR-OO"); |
|
236 |
} else if (areaCode.equals("EE")) { |
|
237 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLT-ES"); |
|
238 |
} else if (areaCode.equals("ES-BAL")) { |
|
239 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BAL-OO"); |
|
240 |
} else if (areaCode.equals("ES-CNY")) { |
|
241 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("CNY-OO"); |
|
242 |
} else if (areaCode.equals("ES-SPA")) { |
|
243 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SPA-SP"); |
|
244 |
} else if (areaCode.equals("FI")) { |
|
245 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FIN-OO"); |
|
246 |
} else if (areaCode.equals("FR-COR")) { |
|
247 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("COR-OO"); |
|
248 |
} else if (areaCode.equals("FR-FRA")) { |
|
249 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FRA-FR"); |
|
250 |
} else if (areaCode.equals("GB-CI")) { |
|
251 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FRA-CI"); |
|
252 |
} else if (areaCode.equals("GB-GI")) { |
|
253 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SPA-GI"); |
|
254 |
} else if (areaCode.equals("GB-GRB")) { |
|
255 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("GRB-OO"); |
|
256 |
} else if (areaCode.equals("GB-NI")) { |
|
257 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("IRE-NI"); |
|
258 |
} else if (areaCode.equals("GR-GRC")) { |
|
259 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("GRC-OO"); |
|
260 |
} else if (areaCode.equals("HR")) { |
|
261 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG-CR"); |
|
262 |
} else if (areaCode.equals("HU")) { |
|
263 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("HUN-OO"); |
|
264 |
} else if (areaCode.equals("IE")) { |
|
265 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("IRE-IR"); |
|
266 |
} else if (areaCode.equals("IS")) { |
|
267 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ICE-OO"); |
|
268 |
} else if (areaCode.equals("IT-ITA")) { |
|
269 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ITA-IT"); |
|
270 |
} else if (areaCode.equals("IT-SAR")) { |
|
271 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SAR-OO"); |
|
272 |
} else if (areaCode.equals("IT-SI")) { |
|
273 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SIC-SI"); |
|
274 |
} else if (areaCode.equals("LI")) { |
|
275 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("AUT-LI"); |
|
276 |
} else if (areaCode.equals("LT")) { |
|
277 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLT-LI"); |
|
278 |
} else if (areaCode.equals("LU")) { |
|
279 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BGM-LU"); |
|
280 |
} else if (areaCode.equals("LV")) { |
|
281 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLT-LA"); |
|
282 |
} else if (areaCode.equals("MC")) { |
|
283 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FRA-MO"); |
|
284 |
} else if (areaCode.equals("MD")) { |
|
285 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("UKR-MO"); |
|
286 |
} else if (areaCode.equals("MK")) { |
|
287 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG-MA"); |
|
288 |
} else if (areaCode.equals("MT")) { |
|
289 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SIC-MA"); |
|
290 |
} else if (areaCode.equals("NL")) { |
|
291 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("NET-OO"); |
|
292 |
} else if (areaCode.equals("NO-NOR")) { |
|
293 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("NOR-OO"); |
|
294 |
} else if (areaCode.equals("NO-SVA")) { |
|
295 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SVA-OO"); |
|
296 |
} else if (areaCode.equals("PL")) { |
|
297 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("POL-OO"); |
|
298 |
} else if (areaCode.equals("PT-AZO")) { |
|
299 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("AZO-OO"); |
|
300 |
} else if (areaCode.equals("PT-MDR")) { |
|
301 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("MDR-OO"); |
|
302 |
} else if (areaCode.equals("PT-POR")) { |
|
303 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("POR-OO"); |
|
304 |
} else if (areaCode.equals("PT-SEL")) { |
|
305 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SEL-OO"); |
|
306 |
} else if (areaCode.equals("RO")) { |
|
307 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ROM-OO"); |
|
308 |
} else if (areaCode.equals("RU-KGD")) { |
|
309 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLT-KA"); |
|
310 |
} else if (areaCode.equals("RU-RUC")) { |
|
311 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUC-OO"); |
|
312 |
} else if (areaCode.equals("RU-RUE")) { |
|
313 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUE-OO"); |
|
314 |
} else if (areaCode.equals("RU-RUN")) { |
|
315 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUN-OO"); |
|
316 |
} else if (areaCode.equals("RU-RUS")) { |
|
317 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUS-OO"); |
|
318 |
} else if (areaCode.equals("RU-RUW")) { |
|
319 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUW-OO"); |
|
320 |
} else if (areaCode.equals("SE")) { |
|
321 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SWE-OO"); |
|
322 |
} else if (areaCode.equals("SI")) { |
|
323 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG-SL"); |
|
324 |
} else if (areaCode.equals("SK")) { |
|
325 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("CZE-SK"); |
|
326 |
} else if (areaCode.equals("SM")) { |
|
327 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ITA-SM"); |
|
328 |
} else if (areaCode.equals("TR-TUE")) { |
|
329 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("TUE-OO"); |
|
330 |
}else if (areaCode.equals("UA")) { |
|
331 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("UKR-UK"); //UKraine including Crimea |
|
332 |
} else if (areaCode.equals("VA")) { |
|
333 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ITA-VC"); |
|
334 |
} else if (areaCode.equals("YU")) { |
|
335 |
tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG"); |
|
336 |
} else { |
|
337 |
throw new UnknownCdmTypeException("Unknown Area " + areaCode); |
|
338 |
} |
|
339 |
|
|
340 |
if (logger.isDebugEnabled()) { |
|
341 |
logger.debug(areaId + ", " + areaName + ", " + areaCode + ", " + extraLimital); |
|
342 |
} |
|
343 |
|
|
344 |
} catch (Exception e) { |
|
345 |
//e.printStackTrace(); |
|
346 |
logger.debug("Exception occurred. Area could not be mapped." + fauEuDistribution.getAreaName()); |
|
347 |
return null; |
|
348 |
} |
|
349 |
|
|
350 |
return tdwgArea; |
|
351 |
} |
|
352 |
|
|
353 |
public static UUID uuidAreaAUS = UUID.fromString("cf979ca8-8cb6-42df-b2ce-1f432ec7c26b"); |
|
354 |
public static UUID uuidAreaAFR = UUID.fromString("07ac5e75-9fc9-4aa0-938c-1324c9618b97"); |
|
355 |
public static UUID uuidAreaEPA = UUID.fromString("e83446d7-7379-4beb-be05-295f8da6f5ae"); |
|
356 |
public static UUID uuidAreaGR_AEG = UUID.fromString("6bd422aa-9911-4b80-8595-0f6d1ecd5eee"); |
|
357 |
public static UUID uuidAreaGR_CYC = UUID.fromString("8e7d7f1e-3e4d-4f7c-96ec-93ec91e528d6"); |
|
358 |
public static UUID uuidAreaGR_DOD = UUID.fromString("6d6f6842-924e-440b-9e7e-3df1922bf4a6"); |
|
359 |
public static UUID uuidAreaNAF = UUID.fromString("d2c54b1e-5f9f-455d-b308-6859cb153c7b"); |
|
360 |
public static UUID uuidAreaNEA = UUID.fromString("aa87f6b8-110b-44b5-a329-91a08f1a4cc9"); |
|
361 |
public static UUID uuidAreaNEO = UUID.fromString("0e6e0ce9-c6ab-46bc-80b9-aee4a0620e78"); |
|
362 |
public static UUID uuidAreaNRE = UUID.fromString("d51876c2-eaf6-4c7f-963e-337dd3e0d729"); |
|
363 |
public static UUID uuidAreaORR = UUID.fromString("04cab4f8-b316-4e21-9bcc-236a45e4e83d"); |
|
364 |
public static UUID uuidAreaGR_CR = UUID.fromString("2ef9fa6c-7c3f-431a-96c9-5980c55fc440"); |
|
365 |
public static UUID uuidAreaGR_GRC = UUID.fromString("b5d33c78-91e7-467a-9c2d-6c337b78d31a"); |
|
366 |
public static UUID uuidAreaUA = UUID.fromString("859cf055-a208-4f30-8e6e-361f165c6fa9"); |
|
367 |
public static UUID uuidAreaRU_FJL = UUID.fromString("84671068-2f18-40cb-933a-e7e1c0e37cc8"); |
|
368 |
public static UUID uuidAreaRU_NOZ = UUID.fromString("64cce0aa-0222-4740-8fa2-dbf0330e9266"); |
|
369 |
|
|
370 |
|
|
371 |
public final static HashMap<String, UUID> abbrToUUID = new HashMap<String,UUID>(); |
|
372 |
static |
|
373 |
{ |
|
374 |
abbrToUUID.put("AUS", uuidAreaAUS); |
|
375 |
abbrToUUID.put("AFR", uuidAreaAFR); |
|
376 |
abbrToUUID.put("EPA", uuidAreaEPA); |
|
377 |
abbrToUUID.put("GR-AEG", uuidAreaGR_AEG); |
|
378 |
abbrToUUID.put("GR-CYC", uuidAreaGR_CYC); |
|
379 |
abbrToUUID.put("GR-DOD", uuidAreaGR_DOD); |
|
380 |
abbrToUUID.put("NAF", uuidAreaNAF); |
|
381 |
abbrToUUID.put("NEA", uuidAreaNEA); |
|
382 |
abbrToUUID.put("NEO", uuidAreaNEO); |
|
383 |
abbrToUUID.put("NRE", uuidAreaNRE); |
|
384 |
abbrToUUID.put("ORR", uuidAreaORR); |
|
385 |
abbrToUUID.put("GR-KRI", uuidAreaGR_CR); |
|
386 |
abbrToUUID.put("GR-GRC", uuidAreaGR_GRC); |
|
387 |
abbrToUUID.put("UA", uuidAreaUA); |
|
388 |
abbrToUUID.put("RU-FJL", uuidAreaRU_FJL); |
|
389 |
abbrToUUID.put("RU-NOZ", uuidAreaRU_NOZ); |
|
390 |
|
|
391 |
|
|
392 |
} |
|
393 | 394 |
|
394 | 395 |
public final static HashMap<Integer, Language> languageFK2Language = new HashMap<Integer,Language>(); |
395 | 396 |
static |
... | ... | |
450 | 451 |
|
451 | 452 |
|
452 | 453 |
} |
453 |
public static UUID getUUIDByAreaAbbr(String abbr){ |
|
454 |
return abbrToUUID.get(abbr); |
|
455 |
} |
|
454 |
// public static UUID getUUIDByAreaAbbr(String abbr){
|
|
455 |
// return abbrToUUID.get(abbr);
|
|
456 |
// }
|
|
456 | 457 |
|
457 | 458 |
public static UUID uuidNomStatusTempNamed = UUID.fromString("aa6ada5a-ca21-4fef-b76f-9ae237e9c4ae"); |
458 | 459 |
|
Also available in: Unified diff
changes for fauna europaea import (misapplied names, improved taxonnode agent relationship)