15 |
15 |
import org.apache.commons.lang.StringUtils;
|
16 |
16 |
import org.apache.log4j.Logger;
|
17 |
17 |
|
18 |
|
import eu.etaxonomy.cdm.common.CdmUtils;
|
19 |
18 |
import eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase;
|
20 |
19 |
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException;
|
21 |
20 |
import eu.etaxonomy.cdm.model.common.ExtensionType;
|
... | ... | |
98 |
97 |
public NamedArea getNamedAreaByKey(String key) throws UndefinedTransformerMethodException {
|
99 |
98 |
if (StringUtils.isBlank(key)){return null;
|
100 |
99 |
}else if (key.equalsIgnoreCase("DRC")){return TdwgArea.getAreaByTdwgAbbreviation("CON-OO");
|
101 |
|
}else if (key.matches("C[�o]t[e��] d'Ivoire")){return TdwgArea.getAreaByTdwgAbbreviation("IVO-OO");
|
|
100 |
}else if (key.matches("C[\u00F4o]t[e��] d'Ivoire")){return TdwgArea.getAreaByTdwgAbbreviation("IVO-OO");
|
102 |
101 |
}else if (key.equalsIgnoreCase("Gambia")){return TdwgArea.getAreaByTdwgAbbreviation("GAM-OO");
|
103 |
102 |
}else if (key.matches("Sout?h Af?rica")){return WaterbodyOrCountry.getWaterbodyOrCountryByLabel("South Africa, Republic of");
|
104 |
103 |
}else if (key.matches("Equ[ai]torial? Guinea")){return TdwgArea.getAreaByTdwgAbbreviation("EQG-OO");
|
105 |
104 |
}else if (key.equalsIgnoreCase("Spanish Moroco")){return TdwgArea.getAreaByTdwgAbbreviation("MOR-SP");
|
106 |
105 |
}else if (key.matches("Co?[mn]o[rl][oe] [iI]sl?\\.")|| key.equalsIgnoreCase("Comores")){return TdwgArea.getAreaByTdwgAbbreviation("COM-CO");
|
107 |
|
}else if (key.matches("(La )?R[\u00c9]un?ion\\.?")){return TdwgArea.getAreaByTdwgAbbreviation("REU-OO");
|
|
106 |
}else if (key.matches("(La )?R[e\u00c9]un?ion\\.?")){return TdwgArea.getAreaByTdwgAbbreviation("REU-OO");
|
108 |
107 |
}else if (key.equalsIgnoreCase("Lybia")){return TdwgArea.getAreaByTdwgAbbreviation("LBY-OO");
|
109 |
108 |
}else if (key.matches("St He[lr]ena")){return TdwgArea.getAreaByTdwgAbbreviation("STH-OO");
|
110 |
109 |
}else if (key.equalsIgnoreCase("Amsterdam Isl.")){return TdwgArea.getAreaByTdwgAbbreviation("ASP-OO");
|
... | ... | |
116 |
115 |
}else if (key.equalsIgnoreCase("Azores")){return TdwgArea.getAreaByTdwgAbbreviation("AZO-OO");
|
117 |
116 |
}else if (key.matches("Rodri[gq]ue[sz]( Isl?(and)?\\.?)?")){return TdwgArea.getAreaByTdwgAbbreviation("ROD-OO");
|
118 |
117 |
}else if (key.equalsIgnoreCase("Ascension Island")){return TdwgArea.getAreaByTdwgAbbreviation("ASC-OO");
|
119 |
|
}else if (key.matches("S[a�]o Tom[\u00c9]")){return TdwgArea.getAreaByTdwgAbbreviation("GGI-ST");
|
|
118 |
}else if (key.matches("S[a\u00E3]o Tom[e\u00c9]")){return TdwgArea.getAreaByTdwgAbbreviation("GGI-ST");
|
120 |
119 |
}else if (key.matches("Marquesas Is.")){return TdwgArea.getAreaByTdwgAbbreviation("MRQ-OO");
|
121 |
120 |
}else if (key.matches("Equador")){return TdwgArea.getAreaByTdwgAbbreviation("ECU-OO");
|
122 |
121 |
}else if (key.matches("Norfolk Isl.")){return TdwgArea.getAreaByTdwgAbbreviation("NFK");
|
... | ... | |
156 |
155 |
|
157 |
156 |
@Override
|
158 |
157 |
public UUID getNamedAreaUuid(String key) throws UndefinedTransformerMethodException {
|
159 |
|
if (CdmUtils.isEmpty(key)){return null;
|
|
158 |
if (StringUtils.isBlank(key)){return null;
|
160 |
159 |
//Teilstaat des Unionsstaates Tansania
|
161 |
160 |
}else if (key.equalsIgnoreCase("Zanzibar")){return uuidZanzibar;
|
162 |
|
//Annob�n (port. Ano Bom) ist eine Insel im Golf von Guinea und gleichzeitig eine der sieben Provinzen �quatorialguineas mit der Hauptstadt San Antonio de Pal�.
|
|
161 |
//Annobon (port. Ano Bom) ist eine Insel im Golf von Guinea und gleichzeitig eine der sieben Provinzen �quatorialguineas mit der Hauptstadt San Antonio de Pal�.
|
163 |
162 |
}else if (key.matches("Anno?[bn]on")){return uuidAnnobon;
|
164 |
163 |
//Diego Garcia ist nach der Landfl�che das gr��te Atoll des Chagos-Archipels,
|
165 |
164 |
}else if (key.equalsIgnoreCase("Diego Garcia")){return uuidDiegoGarcia;
|
166 |
165 |
//Pemba ist die zweitgr��te Insel des ostafrikanischen Sansibar-Archipels. Gemeinsam mit der 50 km s�dlich gelegenen Insel Unguja und zahlreichen kleinen Nebeninseln bildet Pemba den halbautonomen Teilstaat �Sansibar� in Tansania.
|
167 |
166 |
}else if (key.matches("Pemba( Isl.)?")){return uuidPemba;
|
168 |
167 |
//Santo Ant�o (port. f�r Heiliger Antonius) ist mit 779 km� die zweitgr��te der Kapverdischen Inseln im Atlantik.
|
169 |
|
}else if (key.matches("S(an)?(to?)?\\.? Ant[�a]o") ){return uuidStoAntao;
|
170 |
|
//S�o Vicente ist eine der kleineren Kapverdischen Inseln im Atlantik
|
171 |
|
}else if (key.matches("S(�o)?\\.? Vicente")){return uuidSaoVicente;
|
172 |
|
//S�o Nicolau (dt.: �Sankt Nikolaus�) ist eine der kleineren (388 km�) und gebirgigen Kapverdischen Inseln im Norden des Archipels.
|
173 |
|
}else if (key.matches("S(\\.|�o) Nicolau")){return uuidSaoNicolau;
|
|
168 |
}else if (key.matches("S(an)?(to?)?\\.? Ant[\u00E3a]o") ){return uuidStoAntao;
|
|
169 |
//Sao Vicente ist eine der kleineren Kapverdischen Inseln im Atlantik
|
|
170 |
}else if (key.matches("S(\u00E3o)?\\.? Vicente")){return uuidSaoVicente;
|
|
171 |
//Sao Nicolau (dt.: �Sankt Nikolaus�) ist eine der kleineren (388 km�) und gebirgigen Kapverdischen Inseln im Norden des Archipels.
|
|
172 |
}else if (key.matches("S(\\.|\u00E3o) Nicolau")){return uuidSaoNicolau;
|
174 |
173 |
//Fogo - Kap Verde
|
175 |
174 |
}else if (key.equalsIgnoreCase("Fogo")){return uuidFogo;
|
176 |
175 |
//Brava ist die kleinste der bewohnten Kapverdischen Inseln im Atlantik.
|
... | ... | |
226 |
225 |
//Santa Maria ist die geologisch �lteste Insel der Azoren im Atlantischen Ozean
|
227 |
226 |
}else if (key.matches("Santa Maria")){return uuidSantaMaria;
|
228 |
227 |
//S�o Miguel ist die gr��te Insel der Azoren.
|
229 |
|
}else if (key.matches("S�o Miguel")){return uuidSaoMiguel;
|
|
228 |
}else if (key.matches("S\u00E3o Miguel")){return uuidSaoMiguel;
|
230 |
229 |
//Terceira geh�rt zur Zentralgruppe der Azoren.
|
231 |
230 |
}else if (key.matches("Terceira")){return uuidTerceira;
|
232 |
231 |
//Desertas - Madeira
|
... | ... | |
283 |
282 |
*/
|
284 |
283 |
@Override
|
285 |
284 |
public Feature getFeatureByKey(String key) throws UndefinedTransformerMethodException {
|
286 |
|
if (CdmUtils.isEmpty(key)){return null;
|
|
285 |
if (StringUtils.isBlank(key)){return null;
|
287 |
286 |
// }else if (key.equalsIgnoreCase("distribution")){return Feature.DISTRIBUTION();
|
288 |
287 |
// }else if (key.equalsIgnoreCase("habitatecology")){return Feature.ECOLOGY();
|
289 |
288 |
}else{
|
... | ... | |
296 |
295 |
*/
|
297 |
296 |
@Override
|
298 |
297 |
public UUID getFeatureUuid(String key) throws UndefinedTransformerMethodException {
|
299 |
|
if (CdmUtils.isEmpty(key)){return null;
|
|
298 |
if (StringUtils.isBlank(key)){return null;
|
300 |
299 |
// }else if (key.equalsIgnoreCase("Chromosomes")){return uuidChromosomes;
|
301 |
300 |
// }else if (key.equalsIgnoreCase("Inflorescence")){return uuidInflorescence;
|
302 |
301 |
|
... | ... | |
315 |
314 |
*/
|
316 |
315 |
@Override
|
317 |
316 |
public MarkerType getMarkerTypeByKey(String key) throws UndefinedTransformerMethodException {
|
318 |
|
if (CdmUtils.isEmpty(key)){return null;
|
|
317 |
if (StringUtils.isBlank(key)){return null;
|
319 |
318 |
// }else if (key.equalsIgnoreCase("distribution")){return MarkerType.;
|
320 |
319 |
// }else if (key.equalsIgnoreCase("habitatecology")){return Feature.ECOLOGY();
|
321 |
320 |
}else{
|
... | ... | |
325 |
324 |
|
326 |
325 |
@Override
|
327 |
326 |
public UUID getMarkerTypeUuid(String key) throws UndefinedTransformerMethodException {
|
328 |
|
if (CdmUtils.isEmpty(key)){return null;
|
|
327 |
if (StringUtils.isBlank(key)){return null;
|
329 |
328 |
// }else if (key.equalsIgnoreCase("IMPERFECTLY KNOWN SPECIES")){return uuidIncompleteTaxon;
|
330 |
329 |
}else{
|
331 |
330 |
return null;
|
... | ... | |
336 |
335 |
|
337 |
336 |
@Override
|
338 |
337 |
public PresenceTerm getPresenceTermByKey(String key) throws UndefinedTransformerMethodException {
|
339 |
|
if (CdmUtils.isEmpty(key)){return null;
|
|
338 |
if (StringUtils.isBlank(key)){return null;
|
340 |
339 |
}else if (key.equalsIgnoreCase("introduced")){return PresenceTerm.INTRODUCED();
|
341 |
340 |
}else if (key.equalsIgnoreCase("endemic")){return PresenceTerm.ENDEMIC_FOR_THE_RELEVANT_AREA();
|
342 |
341 |
}else if (key.equalsIgnoreCase("naturalised")){return PresenceTerm.NATURALISED();
|
... | ... | |
348 |
347 |
|
349 |
348 |
@Override
|
350 |
349 |
public UUID getPresenceTermUuid(String key) throws UndefinedTransformerMethodException {
|
351 |
|
if (CdmUtils.isEmpty(key)){return null;
|
|
350 |
if (StringUtils.isBlank(key)){return null;
|
352 |
351 |
// }else if (key.equalsIgnoreCase("IN")){return indigenousUuid;
|
353 |
352 |
// }else if (key.equalsIgnoreCase("CA")){return casualUuid;
|
354 |
353 |
// }else if (key.equalsIgnoreCase("NN")){return nonInvasiveUuid;
|
some more unicodes in eflora