Revision bb38665e
Added by Andreas Müller over 10 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/out/PesiTransformer.java | ||
---|---|---|
38 | 38 |
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase; |
39 | 39 |
import eu.etaxonomy.cdm.model.description.PresenceTerm; |
40 | 40 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
41 |
import eu.etaxonomy.cdm.model.location.TdwgArea; |
|
42 |
import eu.etaxonomy.cdm.model.location.WaterbodyOrCountry; |
|
41 |
import eu.etaxonomy.cdm.model.location.Country; |
|
43 | 42 |
import eu.etaxonomy.cdm.model.name.HybridRelationshipType; |
44 | 43 |
import eu.etaxonomy.cdm.model.name.NameRelationshipType; |
45 | 44 |
import eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus; |
... | ... | |
47 | 46 |
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType; |
48 | 47 |
import eu.etaxonomy.cdm.model.name.Rank; |
49 | 48 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
50 |
import eu.etaxonomy.cdm.model.occurrence.Fossil;
|
|
49 |
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
|
|
51 | 50 |
import eu.etaxonomy.cdm.model.reference.Reference; |
52 | 51 |
import eu.etaxonomy.cdm.model.reference.ReferenceType; |
53 | 52 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
... | ... | |
996 | 995 |
if (area == null) { |
997 | 996 |
return null; |
998 | 997 |
//TDWG areas |
999 |
} else if (area.isInstanceOf(TdwgArea.class)) {
|
|
998 |
} else if (area.getVocabulary().getUuid().equals(NamedArea.uuidTdwgAreaVocabulary)) {
|
|
1000 | 999 |
String abbrevLabel = namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel(); |
1001 | 1000 |
Integer result = this.tdwgKeyMap.get(abbrevLabel); |
1002 | 1001 |
if (result == null){ |
1003 | 1002 |
logger.warn("Unknown TDWGArea: " + area.getTitleCache()); |
1004 | 1003 |
} |
1005 | 1004 |
return result; |
1006 |
//countries & Waterbodies
|
|
1007 |
}else if (namedArea.isInstanceOf(WaterbodyOrCountry.class)){
|
|
1008 |
if (namedArea.equals(WaterbodyOrCountry.UKRAINE())) { return AREA_UKRAINE_INCLUDING_CRIMEA; }
|
|
1009 |
else if (namedArea.equals(WaterbodyOrCountry.AZERBAIJANREPUBLICOF())) { return AREA_AZERBAIJAN_INCLUDING_NAKHICHEVAN; }
|
|
1010 |
else if (namedArea.equals(WaterbodyOrCountry.GEORGIA())) { return AREA_GEORGIA; }
|
|
1011 |
else if (namedArea.equals(WaterbodyOrCountry.RUSSIANFEDERATION())) { return AREA_THE_RUSSIAN_FEDERATION; }
|
|
1012 |
else if (namedArea.equals(WaterbodyOrCountry.UNITEDKINGDOMOFGREATBRITAINANDNORTHERNIRELAND())) { return AREA_UNITED_KINGDOM; }
|
|
1013 |
else if (namedArea.equals(WaterbodyOrCountry.DENMARKKINGDOMOF())) { return AREA_DENMARK_COUNTRY; }
|
|
1014 |
else if (namedArea.equals(WaterbodyOrCountry.TURKEYREPUBLICOF())) { return AREA_TURKEY_COUNTRY; }
|
|
1005 |
//countries |
|
1006 |
}else if (namedArea.isInstanceOf(Country.class)){ |
|
1007 |
if (namedArea.equals(Country.UKRAINE())) { return AREA_UKRAINE_INCLUDING_CRIMEA; } |
|
1008 |
else if (namedArea.equals(Country.AZERBAIJANREPUBLICOF())) { return AREA_AZERBAIJAN_INCLUDING_NAKHICHEVAN; } |
|
1009 |
else if (namedArea.equals(Country.GEORGIA())) { return AREA_GEORGIA; } |
|
1010 |
else if (namedArea.equals(Country.RUSSIANFEDERATION())) { return AREA_THE_RUSSIAN_FEDERATION; } |
|
1011 |
else if (namedArea.equals(Country.UNITEDKINGDOMOFGREATBRITAINANDNORTHERNIRELAND())) { return AREA_UNITED_KINGDOM; } |
|
1012 |
else if (namedArea.equals(Country.DENMARKKINGDOMOF())) { return AREA_DENMARK_COUNTRY; } |
|
1013 |
else if (namedArea.equals(Country.TURKEYREPUBLICOF())) { return AREA_TURKEY_COUNTRY; } |
|
1015 | 1014 |
else { |
1016 |
logger.warn("Unknown Waterbody/Country: " + area.getTitleCache());
|
|
1015 |
logger.warn("Unknown Country: " + area.getTitleCache()); |
|
1017 | 1016 |
} |
1018 | 1017 |
}else{ //Non TDWG, non country |
1019 | 1018 |
//EM |
... | ... | |
1162 | 1161 |
* @param fossil |
1163 | 1162 |
* @return |
1164 | 1163 |
*/ |
1165 |
public static String fossil2FossilStatusCache(Fossil fossil) {
|
|
1164 |
public static String fossil2FossilStatusCache(DerivedUnit fossil) {
|
|
1166 | 1165 |
String result = null; |
1167 | 1166 |
return result; |
1168 | 1167 |
} |
... | ... | |
1172 | 1171 |
* @param fossil |
1173 | 1172 |
* @return |
1174 | 1173 |
*/ |
1175 |
public static Integer fossil2FossilStatusId(Fossil fossil) {
|
|
1174 |
public static Integer fossil2FossilStatusId(DerivedUnit fossil) {
|
|
1176 | 1175 |
Integer result = null; |
1177 | 1176 |
return result; |
1178 | 1177 |
} |
... | ... | |
1503 | 1502 |
// TODO: This needs to be refined. For now we differentiate between Animalia and Plantae only. |
1504 | 1503 |
if (nomenclaturalCode.equals(NomenclaturalCode.ICZN)) { |
1505 | 1504 |
result = KINGDOM_ANIMALIA; |
1506 |
} else if (nomenclaturalCode.equals(NomenclaturalCode.ICBN)) {
|
|
1505 |
} else if (nomenclaturalCode.equals(NomenclaturalCode.ICNAFP)) {
|
|
1507 | 1506 |
result = KINGDOM_PLANTAE; |
1508 | 1507 |
} else if (nomenclaturalCode.equals(NomenclaturalCode.ICNB)) { |
1509 | 1508 |
result = KINGDOM_BACTERIA; |
Also available in: Unified diff
reintegrate cdmlib-app-3.3 branch into trunk