Revision 52abc79a
Added by Andreas Müller over 12 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/markup/MarkupTransformer.java | ||
---|---|---|
20 | 20 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
21 | 21 |
import eu.etaxonomy.cdm.model.description.Feature; |
22 | 22 |
import eu.etaxonomy.cdm.model.description.PresenceTerm; |
23 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
|
23 | 24 |
import eu.etaxonomy.cdm.model.location.NamedAreaLevel; |
25 |
import eu.etaxonomy.cdm.model.location.TdwgArea; |
|
24 | 26 |
|
25 | 27 |
/** |
26 | 28 |
* @author a.mueller |
... | ... | |
31 | 33 |
@SuppressWarnings("unused") |
32 | 34 |
private static final Logger logger = Logger.getLogger(MarkupTransformer.class); |
33 | 35 |
|
36 |
//preliminary |
|
37 |
public static final UUID uuidKalimantan = UUID.fromString("05c6bce3-2e55-48cb-a414-707e936066d1"); |
|
38 |
public static final UUID uuidBorneo = UUID.fromString("e615e7e6-5b64-4903-b794-816baab689b3"); |
|
39 |
// public static final UUID uuidCelebes = UUID.fromString(""); |
|
40 |
public static final UUID uuidMoluccas = UUID.fromString("0ac8fc74-a081-45e5-b96d-aad367b5f48b"); |
|
41 |
public static final UUID uuidPeninsularMalaysia = UUID.fromString("9f95af33-ae9e-4031-92f7-9f79d22eecf2"); |
|
42 |
public static final UUID uuidJava = UUID.fromString("36b93871-0bee-4380-b47e-56a843ce6aa3"); |
|
43 |
public static final UUID uuidBismarckArchipelago = UUID.fromString("d9a11144-447c-4e72-b75f-9daeb254e7c4"); |
|
44 |
// public static final UUID uuidNewIreland = UUID.fromString(""); |
|
45 |
public static final UUID uuidSumatra = UUID.fromString("4395d5e0-64e2-4309-a2ec-b1240919c34d"); |
|
46 |
// public static final UUID uuidBangka = UUID.fromString(""); |
|
47 |
public static final UUID uuidSabah = UUID.fromString("8d34b675-7de1-4623-a16a-1e0ca989df0c"); |
|
48 |
public static final UUID uuidBali = UUID.fromString("3cc15dc7-bc55-4a9b-85af-e1eb733ad845"); |
|
49 |
|
|
50 |
public static final UUID uuidPhilippines = UUID.fromString("9dee4b0d-d864-4b6f-bd41-39a1ea7c56c3"); |
|
51 |
|
|
52 |
|
|
53 |
|
|
34 | 54 |
|
35 | 55 |
//extension type uuids |
36 | 56 |
public static final UUID uuidTaxonTitle = UUID.fromString("5d9ca987-81f1-4d6c-b06a-eaa8311ca249"); |
... | ... | |
56 | 76 |
public static final UUID uuidLocality = UUID.fromString("224a4140-da1f-4046-91bb-fb948916d797"); |
57 | 77 |
public static final UUID uuidLevelOther = UUID.fromString("4b483cc8-b42d-40ba-9cc7-a656faf629e2"); |
58 | 78 |
|
79 |
public static final UUID uuidContinentalRegion = UUID.fromString("06d3a74d-cf2e-4842-8c89-87722b9486a4"); |
|
80 |
|
|
81 |
|
|
82 |
|
|
59 | 83 |
//feature uuids |
60 | 84 |
|
61 | 85 |
public static final UUID uuidFigure = UUID.fromString("5165cd6a-9b31-4a1f-8b30-04ab740c502c"); |
... | ... | |
406 | 430 |
public NamedAreaLevel getNamedAreaLevelByKey(String key )throws UndefinedTransformerMethodException { |
407 | 431 |
if (CdmUtils.isEmpty(key)){return null; |
408 | 432 |
}else if (key.equalsIgnoreCase("country")){return NamedAreaLevel.COUNTRY(); |
409 |
// }else if (key.equalsIgnoreCase("continent")){return NamedAreaLevel.C(); |
|
410 | 433 |
}else if (key.equalsIgnoreCase("province")){return NamedAreaLevel.PROVINCE(); |
411 |
// }else if (key.equalsIgnoreCase("region")){return NamedAreaLevel.REGION; |
|
412 |
// }else if (key.equalsIgnoreCase("county")){return NamedAreaLevel.COUNTRY(); |
|
434 |
}else if (key.equalsIgnoreCase("town")){return NamedAreaLevel.TOWN(); |
|
413 | 435 |
}else if (key.equalsIgnoreCase("state")){return NamedAreaLevel.STATE(); |
414 |
|
|
415 |
// }else if (key.equalsIgnoreCase("habitatecology")){return Feature.ECOLOGY(); |
|
436 |
}else if (key.equalsIgnoreCase("tdwg1")){return NamedAreaLevel.TDWG_LEVEL1(); |
|
437 |
}else if (key.equalsIgnoreCase("tdwg2")){return NamedAreaLevel.TDWG_LEVEL2(); |
|
438 |
}else if (key.equalsIgnoreCase("tdwg3")){return NamedAreaLevel.TDWG_LEVEL3(); |
|
439 |
}else if (key.equalsIgnoreCase("tdwg4")){return NamedAreaLevel.TDWG_LEVEL4(); |
|
416 | 440 |
}else{ |
417 | 441 |
return null; |
418 | 442 |
} |
... | ... | |
425 | 449 |
public UUID getNamedAreaLevelUuid(String key) throws UndefinedTransformerMethodException { |
426 | 450 |
if (CdmUtils.isEmpty(key)){return null; |
427 | 451 |
}else if (key.equalsIgnoreCase("region")){return uuidRegion; |
452 |
}else if (key.equalsIgnoreCase("continental region")){return uuidContinentalRegion; |
|
428 | 453 |
}else if (key.equalsIgnoreCase("world")){return uuidWorld; |
429 | 454 |
}else if (key.equalsIgnoreCase("county")){return uuidCounty; |
430 | 455 |
}else if (key.equalsIgnoreCase("continent")){return uuidContinent; |
... | ... | |
435 | 460 |
return null; |
436 | 461 |
} |
437 | 462 |
} |
463 |
|
|
464 |
|
|
465 |
|
|
466 |
/* (non-Javadoc) |
|
467 |
* @see eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase#getNamedAreaByKey(java.lang.String) |
|
468 |
*/ |
|
469 |
@Override |
|
470 |
public NamedArea getNamedAreaByKey(String key) throws UndefinedTransformerMethodException { |
|
471 |
if (CdmUtils.isEmpty(key)){return null; |
|
472 |
}else if (key.equalsIgnoreCase("Kalimantan")){return TdwgArea.getAreaByTdwgAbbreviation("BOR-KA"); |
|
473 |
}else if (key.equalsIgnoreCase("Borneo")){return TdwgArea.getAreaByTdwgAbbreviation("BOR"); |
|
474 |
}else if (key.equalsIgnoreCase("Peninsular Malaysia")){return TdwgArea.getAreaByTdwgAbbreviation("MLY-PM"); |
|
475 |
}else if (key.equalsIgnoreCase("Malay Peninsula")){return TdwgArea.getAreaByTdwgAbbreviation("MLY-PM"); |
|
476 |
}else if (key.equalsIgnoreCase("Java")){return TdwgArea.getAreaByTdwgAbbreviation("JAW-OO"); |
|
477 |
}else if (key.equalsIgnoreCase("Bismarck Archipelago")){return TdwgArea.getAreaByTdwgAbbreviation("BIS-OO"); |
|
478 |
}else if (key.equalsIgnoreCase("Sumatra")){return TdwgArea.getAreaByTdwgAbbreviation("SUM-OO"); |
|
479 |
}else if (key.equalsIgnoreCase("Sabah")){return TdwgArea.getAreaByTdwgAbbreviation("BOR-SB"); |
|
480 |
}else if (key.equalsIgnoreCase("North Borneo")){return TdwgArea.getAreaByTdwgAbbreviation("BOR-SB"); |
|
481 |
|
|
482 |
}else if (key.equalsIgnoreCase("Bali")){return TdwgArea.getAreaByTdwgAbbreviation("LSI-BA"); |
|
483 |
}else if (key.equalsIgnoreCase("Moluccas")){return TdwgArea.getAreaByTdwgAbbreviation("MOL-OO"); |
|
484 |
|
|
485 |
}else if (key.equalsIgnoreCase("Indochina")){return TdwgArea.getAreaByTdwgAbbreviation("41"); |
|
486 |
}else if (key.equalsIgnoreCase("Lesser Sunda Islands")){return TdwgArea.getAreaByTdwgAbbreviation("LSI"); |
|
487 |
}else if (key.equalsIgnoreCase("Sulawesi")){return TdwgArea.getAreaByTdwgAbbreviation("SUL-OO"); |
|
488 |
}else if (key.equalsIgnoreCase("Celebes")){return TdwgArea.getAreaByTdwgAbbreviation("SUL-OO"); |
|
489 |
|
|
490 |
}else if (key.equalsIgnoreCase("south-east United States")){return TdwgArea.getAreaByTdwgAbbreviation("78"); |
|
491 |
}else if (key.equalsIgnoreCase("West Indies")){return TdwgArea.getAreaByTdwgAbbreviation("81"); |
|
492 |
|
|
493 |
}else{ |
|
494 |
return null; |
|
495 |
} |
|
496 |
|
|
497 |
} |
|
498 |
|
|
499 |
/* (non-Javadoc) |
|
500 |
* @see eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase#getNamedAreaUuid(java.lang.String) |
|
501 |
*/ |
|
502 |
@Override |
|
503 |
public UUID getNamedAreaUuid(String key) throws UndefinedTransformerMethodException { |
|
504 |
if (CdmUtils.isEmpty(key)){return null; |
|
505 |
}else if (key.equalsIgnoreCase("Kalimantan")){return uuidKalimantan; |
|
506 |
}else if (key.equalsIgnoreCase("Borneo")){return uuidBorneo; |
|
507 |
}else if (key.equalsIgnoreCase("Moluccas")){return uuidMoluccas; |
|
508 |
}else if (key.equalsIgnoreCase("Peninsular Malaysia")){return uuidPeninsularMalaysia; |
|
509 |
}else if (key.equalsIgnoreCase("Java")){return uuidJava; |
|
510 |
}else if (key.equalsIgnoreCase("Bismarck Archipelago")){return uuidBismarckArchipelago; |
|
511 |
// }else if (key.equalsIgnoreCase("New Ireland")){return uuidNewIreland; |
|
512 |
// }else if (key.equalsIgnoreCase("Celebes")){return uuidSulawesi; |
|
513 |
}else if (key.equalsIgnoreCase("Sumatra")){return uuidSumatra; |
|
514 |
|
|
515 |
// }else if (key.equalsIgnoreCase("Bangka")){return uuidBangka; |
|
516 |
}else if (key.equalsIgnoreCase("Sabah")){return uuidSabah; |
|
517 |
}else if (key.equalsIgnoreCase("Bali")){return uuidBali; |
|
518 |
|
|
519 |
// |
|
520 |
//Celebes (Sulawesi) |
|
521 |
//Moluccas (Ceram, Halmahera, Ambon) |
|
522 |
//Peninsular Malaysia (Kedah, Perak, Kelantan, Trengganu, Pahang, Selangor, Negri Sembilan, Malacca, Johore) |
|
523 |
//Borneo (Sabah, Sarawak, Kalimantan) |
|
524 |
//Sumatra (Aceh, Sumatera Barat, Sumatera Utara) |
|
525 |
//Lesser Sunda Islands (Bali, Lombok, Flores, Timor) |
|
526 |
|
|
527 |
|
|
528 |
//countries |
|
529 |
}else if (key.equalsIgnoreCase("Philippines")){return uuidPhilippines; |
|
530 |
|
|
531 |
|
|
532 |
|
|
533 |
}else{ |
|
534 |
return null; |
|
535 |
} |
|
536 |
} |
|
438 | 537 |
|
439 | 538 |
/* (non-Javadoc) |
440 | 539 |
* @see eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase#getPresenceTermByKey(java.lang.String) |
Also available in: Unified diff
lasted Markup updates