Project

General

Profile

Download (222 KB) Statistics
| Branch: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2009 EDIT
4
* European Distributed Institute of Taxonomy 
5
* http://www.e-taxonomy.eu
6
* 
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.cdm.io.pesi.out;
11

    
12
import java.sql.ResultSet;
13
import java.sql.SQLException;
14
import java.util.BitSet;
15
import java.util.HashMap;
16
import java.util.Map;
17
import java.util.UUID;
18

    
19
import org.apache.commons.lang.StringUtils;
20
import org.apache.log4j.Logger;
21

    
22
import eu.etaxonomy.cdm.common.CdmUtils;
23
import eu.etaxonomy.cdm.io.berlinModel.BerlinModelTransformer;
24
import eu.etaxonomy.cdm.io.common.Source;
25
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException;
26
import eu.etaxonomy.cdm.io.common.mapping.out.ExportTransformerBase;
27
import eu.etaxonomy.cdm.io.common.mapping.out.IExportTransformer;
28
import eu.etaxonomy.cdm.io.pesi.erms.ErmsTransformer;
29
import eu.etaxonomy.cdm.io.pesi.faunaEuropaea.FaunaEuropaeaTransformer;
30
import eu.etaxonomy.cdm.model.common.CdmBase;
31
import eu.etaxonomy.cdm.model.common.Language;
32
import eu.etaxonomy.cdm.model.common.RelationshipBase;
33
import eu.etaxonomy.cdm.model.common.RelationshipTermBase;
34
import eu.etaxonomy.cdm.model.description.AbsenceTerm;
35
import eu.etaxonomy.cdm.model.description.Feature;
36
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase;
37
import eu.etaxonomy.cdm.model.description.PresenceTerm;
38
import eu.etaxonomy.cdm.model.location.NamedArea;
39
import eu.etaxonomy.cdm.model.location.TdwgArea;
40
import eu.etaxonomy.cdm.model.location.WaterbodyOrCountry;
41
import eu.etaxonomy.cdm.model.name.NameRelationshipType;
42
import eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus;
43
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
44
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
45
import eu.etaxonomy.cdm.model.name.Rank;
46
import eu.etaxonomy.cdm.model.occurrence.Fossil;
47
import eu.etaxonomy.cdm.model.reference.Reference;
48
import eu.etaxonomy.cdm.model.reference.ReferenceType;
49
import eu.etaxonomy.cdm.model.taxon.Synonym;
50
import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
51
import eu.etaxonomy.cdm.model.taxon.Taxon;
52
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
53
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
54
import eu.etaxonomy.cdm.strategy.exceptions.UnknownCdmTypeException;
55

    
56
/**
57
 * @author e.-m.lee
58
 * @author a.mueller (update)
59
 * @date 16.02.2010
60
 *
61
 */
62
public final class PesiTransformer extends ExportTransformerBase implements IExportTransformer{
63
	private static final Logger logger = Logger.getLogger(PesiTransformer.class);
64

    
65
	public static final String AUCT_STRING = "auct.";
66
	
67
	
68
	//source identifiers
69
	public static final int SOURCE_EM = 1;
70
	public static final int SOURCE_FE = 2;
71
	public static final int SOURCE_IF = 3;
72
	public static final int SOURCE_ERMS = 4;
73
	
74
	//sourceRefUUIDs
75
	public static final UUID uuidSourceRefEuroMed = UUID.fromString("0603a84a-f024-4454-ab92-9e2ac0139126");
76
	public static final UUID uuidSourceRefFaunaEuropaea = UUID.fromString("6786d863-75d4-4796-b916-c1c3dff4cb70");
77
	public static final UUID uuidSourceRefErms = UUID.fromString("7744bc26-f914-42c4-b54a-dd2a030a8bb7");
78
	public static final UUID uuidSourceRefIndexFungorum = UUID.fromString("8de25d27-7d40-47f4-af3b-59d64935a843");
79
	
80
	public static final String SOURCE_STR_EM = "E+M";
81
	public static final String SOURCE_STR_FE = "FaEu";
82
	public static final String SOURCE_STR_IF = "IF";
83
	public static final String SOURCE_STR_ERMS = "ERMS";
84

    
85
	// status keys
86
	public static int QUALITY_STATUS_CHECKED_EDITOR_ERMS_1_1 = 0;
87
	public static int QUALITY_STATUS_ADD_BY_DBMT= 2;
88
	public static int QUALITY_STATUS_CHECKED_EDITOR = 3;
89
	public static int QUALITY_STATUS_EDITED_BY_DBMT = 4;
90
	
91
	
92
	
93
	//extension type uuids
94
	public static final UUID cacheCitationUuid = UUID.fromString("29656168-32d6-4301-9067-d57c63be5c67");
95
	public static final UUID expertUserIdUuid = UUID.fromString("e25813d3-c67c-4585-9aa0-970fafde50b4");
96
	public static final UUID speciesExpertUserIdUuid = UUID.fromString("6d42abd8-8894-4980-ae07-e918affd4172");
97
	public static final UUID expertNameUuid = UUID.fromString("24becb79-a90c-47d3-be35-efc87bb48fd3");
98
	public static final UUID speciesExpertNameUuid = UUID.fromString("2e8153d2-7412-49e4-87e1-5c38f4c5153a");
99
	public static final UUID lastActionDateUuid = UUID.fromString("8d0a7d81-bb83-4576-84c3-8c906ef039b2");
100
	public static final UUID lastActionUuid = UUID.fromString("bc20d5bc-6161-4279-9499-89ea26ce5f6a");
101
	public static final UUID taxCommentUuid = UUID.fromString("8041a752-0479-4626-ab1b-b266b751f816");
102
	public static final UUID fauCommentUuid = UUID.fromString("054f773a-41c8-4ad5-83e3-981320c1c126");
103
	public static final UUID fauExtraCodesUuid = UUID.fromString("b8c7e77d-9869-4787-bed6-b4b302dbc5f5");
104

    
105
	// References
106
	public static int REF_ARTICLE_IN_PERIODICAL = 1;
107
	public static int REF_PART_OF_OTHER = 2;
108
	public static int REF_BOOK = 3;
109
	public static int REF_DATABASE = 4;
110
	public static int REF_INFORMAL = 5;
111
	public static int REF_NOT_APPLICABLE = 6;
112
	public static int REF_WEBSITE = 7;
113
	public static int REF_PUBLISHED = 8;
114
	public static int REF_JOURNAL = 9;
115
	public static int REF_UNRESOLVED = 10;
116
	public static int REF_PUBLICATION = 11;
117

    
118
	public static String REF_STR_ARTICLE_IN_PERIODICAL = "Article in periodical";
119
	public static String REF_STR_PART_OF_OTHER = "Part of other";
120
	public static String REF_STR_BOOK = "Book";
121
	public static String REF_STR_DATABASE = "Database";
122
	public static String REF_STR_INFORMAL = "Informal";
123
	public static String REF_STR_NOT_APPLICABLE = "Not applicable";
124
	public static String REF_STR_WEBSITE = "Website";
125
	public static String REF_STR_PUBLISHED = "Published";
126
	public static String REF_STR_JOURNAL = "Journal";
127
	public static String REF_STR_UNRESOLVED = "Unresolved";
128
	public static String REF_STR_PUBLICATION = "Publication";
129
	
130
	// NameStatus
131
	public static int NAME_ST_NOM_INVAL = 1;
132
	public static int NAME_ST_NOM_ILLEG = 2;
133
	public static int NAME_ST_NOM_NUD = 3;
134
	public static int NAME_ST_NOM_REJ = 4;
135
	public static int NAME_ST_NOM_REJ_PROP = 5;
136
	public static int NAME_ST_NOM_UTIQUE_REJ = 6;
137
	public static int NAME_ST_NOM_UTIQUE_REJ_PROP = 7;
138
	public static int NAME_ST_NOM_CONS = 8;
139
	public static int NAME_ST_NOM_CONS_PROP = 9;
140
	public static int NAME_ST_ORTH_CONS = 10;
141
	public static int NAME_ST_ORTH_CONS_PROP = 11;
142
	public static int NAME_ST_NOM_SUPERFL = 12;
143
	public static int NAME_ST_NOM_AMBIG = 13;
144
	public static int NAME_ST_NOM_PROVIS = 14;
145
	public static int NAME_ST_NOM_DUB = 15;
146
	public static int NAME_ST_NOM_NOV = 16;
147
	public static int NAME_ST_NOM_CONFUS = 17;
148
	public static int NAME_ST_NOM_ALTERN = 18;
149
	public static int NAME_ST_COMB_INVAL = 19;
150
	public static int NAME_ST_LEGITIMATE = 20; // PESI specific from here
151
	public static int NAME_ST_COMB_INED = 21;
152
	public static int NAME_ST_COMB_AND_STAT_INED = 22;
153
	public static int NAME_ST_NOM_AND_ORTH_CONS = 23;
154
	public static int NAME_ST_NOM_NOV_INED = 24;
155
	public static int NAME_ST_SP_NOV_INED = 25;
156
	public static int NAME_ST_ALTERNATE_REPRESENTATION = 26;
157
	public static int NAME_ST_TEMPORARY_NAME = 27;
158
	public static int NAME_ST_SPECIES_INQUIRENDA = 28;
159

    
160
	// TaxonStatus
161
	public static int T_STATUS_ACCEPTED = 1;
162
	public static int T_STATUS_SYNONYM = 2;
163
	public static int T_STATUS_PARTIAL_SYN = 3;
164
	public static int T_STATUS_PRO_PARTE_SYN = 4;
165
	public static int T_STATUS_UNRESOLVED = 5;
166
	public static int T_STATUS_ORPHANED = 6;
167
	public static int T_STATUS_UNACCEPTED = 7;
168
	
169
	public static String T_STATUS_STR_ACCEPTED = "Accepted";
170
	public static String T_STATUS_STR_SYNONYM = "Synonym";
171
	public static String T_STATUS_STR_PARTIAL_SYN = "Partial Synonym";
172
	public static String T_STATUS_STR_PRO_PARTE_SYN = "Pro Parte Synonym";
173
	public static String T_STATUS_STR_UNRESOLVED = "Unresolved";
174
	public static String T_STATUS_STR_ORPHANED = "Orphaned";
175
	public static String T_STATUS_STR_UNACCEPTED = "Unaccepted";
176
	
177
	// TypeDesginationStatus
178
	public static int TYPE_BY_ORIGINAL_DESIGNATION = 1;
179
	public static int TYPE_BY_SUBSEQUENT_DESIGNATION = 2;
180
	public static int TYPE_BY_MONOTYPY = 3;
181
	
182
	public static String TYPE_STR_BY_ORIGINAL_DESIGNATION = "Type by original designation";
183
	public static String TYPE_STR_BY_SUBSEQUENT_DESIGNATION = "Type by subsequent designation";
184
	public static String TYPE_STR_BY_MONOTYPY = "Type by monotypy";
185
	
186
	// RelTaxonQualifier
187
	public static int IS_BASIONYM_FOR = 1;
188
	public static int IS_LATER_HOMONYM_OF = 2;
189
	public static int IS_REPLACED_SYNONYM_FOR = 3;
190
	public static int IS_VALIDATION_OF = 4;
191
	public static int IS_LATER_VALIDATION_OF = 5;
192
	public static int IS_TYPE_OF = 6;
193
	public static int IS_CONSERVED_TYPE_OF = 7;
194
	public static int IS_REJECTED_TYPE_OF = 8;
195
	public static int IS_FIRST_PARENT_OF = 9;
196
	public static int IS_SECOND_PARENT_OF = 10;
197
	public static int IS_FEMALE_PARENT_OF = 11;
198
	public static int IS_MALE_PARENT_OF = 12;
199
	public static int IS_CONSERVED_AGAINST = 13;
200
	public static int IS_REJECTED_IN_FAVOUR_OF = 14;
201
	public static int IS_TREATED_AS_LATER_HOMONYM_OF = 15;
202
	public static int IS_ORTHOGRAPHIC_VARIANT_OF = 16;
203
	public static int IS_ALTERNATIVE_NAME_FOR = 17;
204
	public static int HAS_SAME_TYPE_AS = 18;
205
	public static int IS_LECTOTYPE_OF = 61;
206
	public static int TYPE_NOT_DESIGNATED = 62;
207
	public static int IS_TAXONOMICALLY_INCLUDED_IN = 101;
208
	public static int IS_SYNONYM_OF = 102;
209
	public static int IS_MISAPPLIED_NAME_FOR = 103;
210
	public static int IS_PRO_PARTE_SYNONYM_OF = 104;
211
	public static int IS_PARTIAL_SYNONYM_OF = 105;
212
	public static int IS_HETEROTYPIC_SYNONYM_OF = 106;
213
	public static int IS_HOMOTYPIC_SYNONYM_OF = 107;
214
	public static int IS_PRO_PARTE_AND_HOMOTYPIC_SYNONYM_OF = 201;
215
	public static int IS_PRO_PARTE_AND_HETEROTYPIC_SYNONYM_OF = 202;
216
	public static int IS_PARTIAL_AND_HOMOTYPIC_SYNONYM_OF = 203;
217
	public static int IS_PARTIAL_AND_HETEROTYPIC_SYNONYM_OF = 204;
218
	public static int IS_INFERRED_EPITHET_FOR = 301;
219
	public static int IS_INFERRED_GENUS_FOR = 302;
220
	public static int IS_POTENTIAL_COMBINATION_FOR = 303;
221

    
222
	public static String STR_IS_BASIONYM_FOR = "is basionym for";
223
	public static String STR_IS_BASIONYM_FOR_ZOOL = "is original combination for";
224
	public static String STR_IS_LATER_HOMONYM_OF = "is later homonym of";
225
	public static String STR_IS_REPLACED_SYNONYM_FOR = "is replaced synonym for";
226
	public static String STR_IS_VALIDATION_OF = "is validation of";
227
	public static String STR_IS_LATER_VALIDATION_OF = "is later validation of";
228
	public static String STR_IS_TYPE_OF = "is type of";
229
	public static String STR_IS_CONSERVED_TYPE_OF = "is conserved type of";
230
	public static String STR_IS_REJECTED_TYPE_OF = "is rejected type of";
231
	public static String STR_IS_FIRST_PARENT_OF = "is first parent of";
232
	public static String STR_IS_SECOND_PARENT_OF = "is second parent of";
233
	public static String STR_IS_FEMALE_PARENT_OF = "is female parent of";
234
	public static String STR_IS_MALE_PARENT_OF = "is male parent of";
235
	public static String STR_IS_CONSERVED_AGAINST = "is conserved against";
236
	public static String STR_IS_REJECTED_IN_FAVOUR_OF = "is rejected in favour of";
237
	public static String STR_IS_TREATED_AS_LATER_HOMONYM_OF = "is treated as later homonym of";
238
	public static String STR_IS_ORTHOGRAPHIC_VARIANT_OF = "is orthographic variant of";
239
	public static String STR_IS_ALTERNATIVE_NAME_FOR = "is alternative name for";
240
	public static String STR_HAS_SAME_TYPE_AS = "has same type as";
241
	public static String STR_IS_LECTOTYPE_OF = "is lectotype of";
242
	public static String STR_TYPE_NOT_DESIGNATED = "type not designated";
243
	public static String STR_IS_TAXONOMICALLY_INCLUDED_IN  = "is taxonomically included in";
244
	public static String STR_IS_SYNONYM_OF = "is synonym of";
245
	public static String STR_IS_MISAPPLIED_NAME_FOR = "is misapplied name for";
246
	public static String STR_IS_PRO_PARTE_SYNONYM_OF = "is pro parte synonym of";
247
	public static String STR_IS_PARTIAL_SYNONYM_OF = "is partial synonym of";
248
	public static String STR_IS_HETEROTYPIC_SYNONYM_OF = "is heterotypic synonym of";
249
	public static String STR_IS_HETEROTYPIC_SYNONYM_OF_ZOOL = "is subjective synonym of";
250
	public static String STR_IS_HOMOTYPIC_SYNONYM_OF = "is homotypic synonym of";
251
	private static final String STR_IS_HOMOTYPIC_SYNONYM_OF_ZOOL = "is objective synonym of";
252
	public static String STR_IS_PRO_PARTE_AND_HOMOTYPIC_SYNONYM_OF = "is pro parte and homotypic synonym of";
253
	public static String STR_IS_PRO_PARTE_AND_HETEROTYPIC_SYNONYM_OF = "is pro parte and heterotypic synonym of";
254
	public static String STR_IS_PARTIAL_AND_HOMOTYPIC_SYNONYM_OF = "is partial and homotypic synonym of";
255
	public static String STR_IS_PARTIAL_AND_HETEROTYPIC_SYNONYM_OF = "is partial and heterotypic synonym of";
256
	public static String STR_IS_INFERRED_EPITHET_FOR = "is inferred epithet for";
257
	public static String STR_IS_INFERRED_GENUS_FOR = "is inferred genus for";
258
	public static String STR_IS_POTENTIAL_COMBINATION_FOR = "is potential combination for";
259
	
260
	public static String STR_NAMESPACE_NOMINAL_TAXON = "Nominal taxon from TAX_ID:";
261
	public static String STR_NAMESPACE_INFERRED_EPITHET = "Inferred epithet from TAX_ID:";
262
	public static String STR_NAMESPACE_INFERRED_GENUS = "Inferred genus from TAX_ID:";
263
	public static String STR_NAMESPACE_POTENTIAL_COMBINATION = "Potential combination from TAX_ID:";
264

    
265
	// Kingdoms
266
	public static int KINGDOM_NULL = 0;
267
	public static int KINGDOM_ANIMALIA = 2;
268
	public static int KINGDOM_PLANTAE = 3;
269
	public static int KINGDOM_FUNGI = 4;
270
	public static int KINGDOM_PROTOZOA = 5;
271
	public static int KINGDOM_BACTERIA = 6;
272
	public static int KINGDOM_CHROMISTA = 7;
273

    
274
	// Animalia Ranks
275
	public static int Animalia_Kingdom = 10;
276
	public static int Animalia_Subkingdom = 20;
277
	public static int Animalia_Superphylum = 23;
278
	public static int Animalia_Phylum = 30;
279
	public static int Animalia_Subphylum = 40;
280
	public static int Animalia_Infraphylum = 45;
281
	public static int Animalia_Superclass = 50;
282
	public static int Animalia_Class = 60;
283
	public static int Animalia_Subclass = 70;
284
	public static int Animalia_Infraclass = 80;
285
	public static int Animalia_Superorder = 90;
286
	public static int Animalia_Order = 100;
287
	public static int Animalia_Suborder = 110;
288
	public static int Animalia_Infraorder = 120;
289
	public static int Animalia_Section = 121;
290
	public static int Animalia_Subsection = 122;
291
	public static int Animalia_Superfamily = 130;
292
	public static int Animalia_Family = 140;
293
	public static int Animalia_Subfamily = 150;
294
	public static int Animalia_Tribe = 160;
295
	public static int Animalia_Subtribe = 170;
296
	public static int Animalia_Genus = 180;
297
	public static int Animalia_Subgenus = 190;
298
	public static int Animalia_Species =220;
299
	public static int Animalia_Subspecies = 230;
300
	public static int Animalia_Natio = 235;
301
	public static int Animalia_Variety = 240;
302
	public static int Animalia_Subvariety = 250;
303
	public static int Animalia_Forma = 260;
304

    
305
	public static String Animalia_STR_Kingdom = "Kingdom";
306
	public static String Animalia_STR_Subkingdom = "Subkingdom";
307
	public static String Animalia_STR_Superphylum = "Superphylum";
308
	public static String Animalia_STR_Phylum = "Phylum";
309
	public static String Animalia_STR_Subphylum = "Subphylum";
310
	public static String Animalia_STR_Infraphylum = "Infraphylum";
311
	public static String Animalia_STR_Superclass = "Superclass";
312
	public static String Animalia_STR_Class = "Class";
313
	public static String Animalia_STR_Subclass = "Subclass";
314
	public static String Animalia_STR_Infraclass = "Infraclass";
315
	public static String Animalia_STR_Superorder = "Superorder";
316
	public static String Animalia_STR_Order = "Order";
317
	public static String Animalia_STR_Suborder = "Suborder";
318
	public static String Animalia_STR_Infraorder = "Infraorder";
319
	public static String Animalia_STR_Section = "Section";
320
	public static String Animalia_STR_Subsection = "Subsection";
321
	public static String Animalia_STR_Superfamily = "Superfamily";
322
	public static String Animalia_STR_Family = "Family";
323
	public static String Animalia_STR_Subfamily = "Subfamily";
324
	public static String Animalia_STR_Tribe = "Tribe";
325
	public static String Animalia_STR_Subtribe = "Subtribe";
326
	public static String Animalia_STR_Genus = "Genus";
327
	public static String Animalia_STR_Subgenus = "Subgenus";
328
	public static String Animalia_STR_Species = "Species";
329
	public static String Animalia_STR_Subspecies = "Subspecies";
330
	public static String Animalia_STR_Natio = "Natio";
331
	public static String Animalia_STR_Variety = "Variety";
332
	public static String Animalia_STR_Subvariety = "Subvariety";
333
	public static String Animalia_STR_Forma = "Forma";
334
	
335
	// Animalia Rank Abbreviations only for used Ranks
336
	public static String Animalia_Abbrev_Subgenus = "subg.";
337
	public static String Animalia_Abbrev_Species = "sp.";
338
	public static String Animalia_Abbrev_Subspecies = "subsp.";
339
	public static String Animalia_Abbrev_Variety = "var.";
340
	public static String Animalia_Abbrev_Subvariety = "subvar.";
341
	public static String Animalia_Abbrev_Forma = "f.";
342

    
343
	// Plantae Ranks
344
	public static int Plantae_Kingdom = 10;
345
	public static int Plantae_Subkingdom = 20;
346
	public static int Plantae_Division = 30;
347
	public static int Plantae_Subdivision = 40;
348
	public static int Plantae_Class = 60;
349
	public static int Plantae_Subclass = 70;
350
	public static int Plantae_Order = 100;
351
	public static int Plantae_Suborder = 110;
352
	public static int Plantae_Family = 140;
353
	public static int Plantae_Subfamily = 150;
354
	public static int Plantae_Tribe	= 160;
355
	public static int Plantae_Subtribe = 170;
356
	public static int Plantae_Genus = 180;
357
	public static int Plantae_Subgenus = 190;
358
	public static int Plantae_Section = 200;
359
	public static int Plantae_Subsection = 210;
360
	public static int Plantae_Series = 212;
361
	public static int Plantae_Subseries	= 214;
362
	public static int Plantae_Aggregate	= 216;
363
	public static int Plantae_Coll_Species = 218;
364
	public static int Plantae_Species = 220;
365
	public static int Plantae_Grex = 225;
366
	public static int Plantae_Subspecies = 230;
367
	public static int Plantae_Proles = 232;
368
	public static int Plantae_Race = 234;
369
	public static int Plantae_Convarietas = 236;
370
	public static int Plantae_Variety = 240;
371
	public static int Plantae_Subvariety = 250;
372
	public static int Plantae_Forma	= 260;
373
	public static int Plantae_Subforma = 270;
374
	public static int Plantae_Forma_spec = 275;
375
	public static int Plantae_Taxa_infragen = 280;
376
	public static int Plantae_Taxa_infraspec = 285;
377
	
378
	public static String Plantae_STR_Kingdom = "Kingdom";
379
	public static String Plantae_STR_Subkingdom = "Subkingdom";
380
	public static String Plantae_STR_Division = "Division";
381
	public static String Plantae_STR_Subdivision = "Subdivision";
382
	public static String Plantae_STR_Class = "Class";
383
	public static String Plantae_STR_Subclass = "Subclass";
384
	public static String Plantae_STR_Order = "Order";
385
	public static String Plantae_STR_Suborder = "Suborder";
386
	public static String Plantae_STR_Family = "Family";
387
	public static String Plantae_STR_Subfamily = "Subfamily";
388
	public static String Plantae_STR_Tribe	= "Tribe";
389
	public static String Plantae_STR_Subtribe = "Subtribe";
390
	public static String Plantae_STR_Genus = "Genus";
391
	public static String Plantae_STR_Subgenus = "Subgenus";
392
	public static String Plantae_STR_Section = "Section";
393
	public static String Plantae_STR_Subsection = "Subsection";
394
	public static String Plantae_STR_Series = "Series";
395
	public static String Plantae_STR_Subseries	= "Subseries";
396
	public static String Plantae_STR_Aggregate	= "Aggregate";
397
	public static String Plantae_STR_Coll_Species = "Coll. Species";
398
	public static String Plantae_STR_Species = "Species";
399
	public static String Plantae_STR_Grex = "Grex";
400
	public static String Plantae_STR_Subspecies = "Subspecies";
401
	public static String Plantae_STR_Proles = "Proles";
402
	public static String Plantae_STR_Race = "Race";
403
	public static String Plantae_STR_Convarietas = "Convariety";
404
	public static String Plantae_STR_Variety = "Variety";
405
	public static String Plantae_STR_Subvariety = "Subvariety";
406
	public static String Plantae_STR_Forma	= "Forma";
407
	public static String Plantae_STR_Subforma = "Subforma";
408
	public static String Plantae_STR_Forma_spec = "Forma spec.";
409
	public static String Plantae_STR_Taxa_infragen = "Tax. infragen.";
410
	public static String Plantae_STR_Taxa_infraspec = "Tax. infraspec.";
411
	
412
	// Plantae Rank Abbreviations
413
	public static String Plantae_Abbrev_Kingdom = "reg.";
414
	public static String Plantae_Abbrev_Subkingdom = "subreg.";
415
	public static String Plantae_Abbrev_Division = "div.";
416
	public static String Plantae_Abbrev_Subdivision = "subdiv.";
417
	public static String Plantae_Abbrev_Class = "cl.";
418
	public static String Plantae_Abbrev_Subclass = "subcl.";
419
	public static String Plantae_Abbrev_Order = "ordo";
420
	public static String Plantae_Abbrev_Suborder = "subor.";
421
	public static String Plantae_Abbrev_Family = "fam.";
422
	public static String Plantae_Abbrev_Subfamily = "subfam.";
423
	public static String Plantae_Abbrev_Tribe	= "trib.";
424
	public static String Plantae_Abbrev_Subtribe = "subtrib.";
425
	public static String Plantae_Abbrev_Genus = "gen.";
426
	public static String Plantae_Abbrev_Subgenus = "subg.";
427
	public static String Plantae_Abbrev_Section = "sect.";
428
	public static String Plantae_Abbrev_Subsection = "subsect.";
429
	public static String Plantae_Abbrev_Series = "ser.";
430
	public static String Plantae_Abbrev_Subseries	= "subser.";
431
	public static String Plantae_Abbrev_Aggregate	= "aggr.";
432
	public static String Plantae_Abbrev_Coll_Species = "coll. sp.";
433
	public static String Plantae_Abbrev_Species = "sp.";
434
	public static String Plantae_Abbrev_Grex = "grex";
435
	public static String Plantae_Abbrev_Subspecies = "subsp.";
436
	public static String Plantae_Abbrev_Proles = "prol.";
437
	public static String Plantae_Abbrev_Race = "race";
438
	public static String Plantae_Abbrev_Convarietas = "convar.";
439
	public static String Plantae_Abbrev_Variety = "var.";
440
	public static String Plantae_Abbrev_Subvariety = "subvar.";
441
	public static String Plantae_Abbrev_Forma	= "f.";
442
	public static String Plantae_Abbrev_Subforma = "subf.";
443
	public static String Plantae_Abbrev_Forma_spec = "f.spec.";
444
	public static String Plantae_Abbrev_Taxa_infragen = "t.infgen.";
445
	public static String Plantae_Abbrev_Taxa_infraspec = "t.infr.";
446
	
447
	// Fungi Ranks
448
	public static int Fungi_Kingdom = 10;
449
	public static int Fungi_Subkingdom = 20;
450
	public static int Fungi_Division = 30;
451
	public static int Fungi_Subdivision = 40;
452
	public static int Fungi_Class	= 60;
453
	public static int Fungi_Subclass = 70;
454
	public static int Fungi_Order	= 100;
455
	public static int Fungi_Suborder = 110;
456
	public static int Fungi_Family = 140;
457
	public static int Fungi_Subfamily = 150;
458
	public static int Fungi_Tribe = 160;
459
	public static int Fungi_Subtribe = 170;
460
	public static int Fungi_Genus = 180;
461
	public static int Fungi_Subgenus = 190;
462
	public static int Fungi_Section = 200;
463
	public static int Fungi_Subsection = 210;
464
	public static int Fungi_Species = 220;
465
	public static int Fungi_Subspecies = 230;
466
	public static int Fungi_Variety = 240;
467
	public static int Fungi_Subvariety = 250;
468
	public static int Fungi_Forma	= 260;
469
	public static int Fungi_Subforma = 270;
470
	
471
	//Protozoa Ranks
472
	public static int Protozoa_Kingdom = 10;
473
	public static int Protozoa_Subkingdom = 20;
474
	public static int Protozoa_Phylum = 30;
475
	public static int Protozoa_Subphylum = 40;
476
	public static int Protozoa_Superclass = 50;
477
	public static int Protozoa_Class	= 60;
478
	public static int Protozoa_Subclass = 70;
479
	public static int Protozoa_Infraclass = 80;
480
	public static int Protozoa_Superorder = 90;
481
	public static int Protozoa_Order	= 100;
482
	public static int Protozoa_Suborder = 110;
483
	public static int Protozoa_Infraorder = 120;
484
	public static int Protozoa_Superfamily = 130;
485
	public static int Protozoa_Family = 140;
486
	public static int Protozoa_Subfamily = 150;
487
	public static int Protozoa_Tribe	= 160;
488
	public static int Protozoa_Subtribe = 170;
489
	public static int Protozoa_Genus	= 180;
490
	public static int Protozoa_Subgenus = 190;
491
	public static int Protozoa_Species = 220;
492
	public static int Protozoa_Subspecies = 230;
493
	public static int Protozoa_Variety = 240;
494
	public static int Protozoa_Forma	= 260;
495
	
496
	// Bacteria Ranks
497
	public static int Bacteria_Kingdom = 10;
498
	public static int Bacteria_Subkingdom = 20;
499
	public static int Bacteria_Phylum = 30;
500
	public static int Bacteria_Subphylum	= 40;
501
	public static int Bacteria_Superclass = 50;
502
	public static int Bacteria_Class	= 60;
503
	public static int Bacteria_Subclass = 70;
504
	public static int Bacteria_Infraclass = 80;
505
	public static int Bacteria_Superorder = 90;
506
	public static int Bacteria_Order	= 100;
507
	public static int Bacteria_Suborder = 110;
508
	public static int Bacteria_Infraorder = 120;
509
	public static int Bacteria_Superfamily = 130;
510
	public static int Bacteria_Family = 140;
511
	public static int Bacteria_Subfamily	= 150;
512
	public static int Bacteria_Tribe	= 160;
513
	public static int Bacteria_Subtribe = 170;
514
	public static int Bacteria_Genus	= 180;
515
	public static int Bacteria_Subgenus = 190;
516
	public static int Bacteria_Species = 220;
517
	public static int Bacteria_Subspecies = 230;
518
	public static int Bacteria_Variety = 240;
519
	public static int Bacteria_Forma	= 260;
520

    
521
	public static String Bacteria_STR_Kingdom = "Kingdom";
522
	public static String Bacteria_STR_Subkingdom = "Subkingdom";
523
	public static String Bacteria_STR_Phylum = "Phylum";
524
	public static String Bacteria_STR_Subphylum = "Subphylum";
525
	public static String Bacteria_STR_Superclass = "Superclass";
526
	public static String Bacteria_STR_Class = "Class";
527
	public static String Bacteria_STR_Subclass = "Subclass";
528
	public static String Bacteria_STR_Infraclass = "Infraclass";
529
	public static String Bacteria_STR_Superorder = "Superorder";
530
	public static String Bacteria_STR_Order = "Order";
531
	public static String Bacteria_STR_Suborder = "Suborder";
532
	public static String Bacteria_STR_Infraorder = "Infraorder";
533
	public static String Bacteria_STR_Superfamily = "Superfamily";
534
	public static String Bacteria_STR_Family = "Family";
535
	public static String Bacteria_STR_Subfamily = "Subfamily";
536
	public static String Bacteria_STR_Tribe = "Tribe";
537
	public static String Bacteria_STR_Subtribe = "Subtribe";
538
	public static String Bacteria_STR_Genus = "Genus";
539
	public static String Bacteria_STR_Subgenus = "Subgenus";
540
	public static String Bacteria_STR_Species = "Species";
541
	public static String Bacteria_STR_Subspecies = "Subspecies";
542
	public static String Bacteria_STR_Variety = "Variety";
543
	public static String Bacteria_STR_Forma = "Forma";
544

    
545
	// Chromista Ranks
546
	public static int Chromista_Kingdom = 10;
547
	public static int Chromista_Subkingdom = 20;
548
	public static int Chromista_Infrakingdom = 25;
549
	public static int Chromista_Phylum = 30;
550
	public static int Chromista_Subphylum = 40;
551
	public static int Chromista_Superclass = 50;
552
	public static int Chromista_Class = 60;
553
	public static int Chromista_Subclass = 70;
554
	public static int Chromista_Infraclass = 80;
555
	public static int Chromista_Superorder = 90;
556
	public static int Chromista_Order = 100;
557
	public static int Chromista_Suborder = 110;
558
	public static int Chromista_Infraorder = 120;
559
	public static int Chromista_Superfamily	= 130;
560
	public static int Chromista_Family = 140;
561
	public static int Chromista_Subfamily = 150;
562
	public static int Chromista_Tribe = 160;
563
	public static int Chromista_Subtribe = 170;
564
	public static int Chromista_Genus = 180;
565
	public static int Chromista_Subgenus = 190;
566
	public static int Chromista_Section = 200;
567
	public static int Chromista_Subsection = 210;
568
	public static int Chromista_Species	= 220;
569
	public static int Chromista_Subspecies = 230;
570
	public static int Chromista_Variety	= 240;
571
	public static int Chromista_Subvariety = 250;
572
	public static int Chromista_Forma = 260;
573
	
574
	// NoteCategory
575
	public static int NoteCategory_description = 1;
576
	public static int NoteCategory_ecology = 4;
577
	public static int NoteCategory_phenology	= 5;
578
	public static int NoteCategory_general_distribution_euromed = 10;
579
	public static int NoteCategory_general_distribution_world = 11;
580
	public static int NoteCategory_Common_names = 12;
581
	public static int NoteCategory_Occurrence = 13;
582
	public static int NoteCategory_Maps =14;
583
	public static int NoteCategory_Link_to_maps = 20;
584
	public static int NoteCategory_Link_to_images = 21;
585
	public static int NoteCategory_Link_to_taxonomy = 22;
586
	public static int NoteCategory_Link_to_general_information = 23;
587
	public static int NoteCategory_undefined_link = 24;
588
	public static int NoteCategory_Editor_Braces = 249;
589
	public static int NoteCategory_Editor_Brackets = 250;
590
	public static int NoteCategory_Editor_Parenthesis = 251;
591
	public static int NoteCategory_Inedited = 252;
592
	public static int NoteCategory_Comments_on_editing_process = 253;
593
	public static int NoteCategory_Publication_date = 254;
594
	public static int NoteCategory_Morphology = 255;
595
	public static int NoteCategory_Acknowledgments = 257;
596
	public static int NoteCategory_Original_publication = 258;
597
	public static int NoteCategory_Type_locality	= 259;
598
	public static int NoteCategory_Environment = 260;
599
	public static int NoteCategory_Spelling = 261;
600
	public static int NoteCategory_Systematics = 262;
601
	public static int NoteCategory_Remark = 263;
602
	public static int NoteCategory_Date_of_publication = 264;
603
	public static int NoteCategory_Additional_information = 266;
604
	public static int NoteCategory_Status = 267;
605
	public static int NoteCategory_Nomenclature = 268;
606
	public static int NoteCategory_Homonymy = 269;
607
	public static int NoteCategory_Taxonomy = 270;
608
	public static int NoteCategory_Taxonomic_status = 272;
609
	public static int NoteCategory_Authority	= 273;
610
	public static int NoteCategory_Identification = 274;
611
	public static int NoteCategory_Validity = 275;
612
	public static int NoteCategory_Classification = 276;
613
	public static int NoteCategory_Distribution = 278;
614
	public static int NoteCategory_Synonymy = 279;
615
	public static int NoteCategory_Habitat = 280;
616
	public static int NoteCategory_Biology = 281;
617
	public static int NoteCategory_Diagnosis	= 282;
618
	public static int NoteCategory_Host = 283;
619
	public static int NoteCategory_Note = 284;
620
	public static int NoteCategory_Rank = 285;
621
	public static int NoteCategory_Taxonomic_Remark = 286;
622
	public static int NoteCategory_Taxonomic_Remarks = 287;
623

    
624
	
625
	public static String NoteCategory_STR_description = "description";
626
	public static String NoteCategory_STR_ecology = "ecology";
627
	public static String NoteCategory_STR_phenology	= "phenology";
628
	public static String NoteCategory_STR_general_distribution_euromed = "general distribution (Euro+Med)";
629
	public static String NoteCategory_STR_general_distribution_world = "general distribution (world)";
630
	public static String NoteCategory_STR_Common_names = "Common names";
631
	public static String NoteCategory_STR_Occurrence = "Occurrence";
632
	public static String NoteCategory_STR_Maps = "Maps";
633
	public static String NoteCategory_STR_Link_to_maps = "Link to maps";
634
	public static String NoteCategory_STR_Link_to_images = "Link to images";
635
	public static String NoteCategory_STR_Link_to_taxonomy = "Link to taxonomy";
636
	public static String NoteCategory_STR_Link_to_general_information = "Link to general information";
637
	public static String NoteCategory_STR_undefined_link = "undefined link";
638
	public static String NoteCategory_STR_Editor_Braces = "Editor_Braces";
639
	public static String NoteCategory_STR_Editor_Brackets = "Editor_Brackets";
640
	public static String NoteCategory_STR_Editor_Parenthesis = "Editor_Parenthesis";
641
	public static String NoteCategory_STR_Inedited = "Inedited";
642
	public static String NoteCategory_STR_Comments_on_editing_process = "Comments on editing process";
643
	public static String NoteCategory_STR_Publication_date = "Publication date";
644
	public static String NoteCategory_STR_Morphology = "Morphology";
645
	public static String NoteCategory_STR_Acknowledgments = "Acknowledgments";
646
	public static String NoteCategory_STR_Original_publication = "Original publication";
647
	public static String NoteCategory_STR_Type_locality	= "Type locality";
648
	public static String NoteCategory_STR_Environment = "Environment";
649
	public static String NoteCategory_STR_Spelling = "Spelling";
650
	public static String NoteCategory_STR_Systematics = "Systematics";
651
	public static String NoteCategory_STR_Remark = "Remark";
652
	public static String NoteCategory_STR_Date_of_publication = "Date of publication";
653
	public static String NoteCategory_STR_Additional_information = "Additional information";
654
	public static String NoteCategory_STR_Status = "Status";
655
	public static String NoteCategory_STR_Nomenclature = "Nomenclature";
656
	public static String NoteCategory_STR_Homonymy = "Homonymy";
657
	public static String NoteCategory_STR_Taxonomy = "Taxonomy";
658
	public static String NoteCategory_STR_Taxonomic_status = "Taxonomic status";
659
	public static String NoteCategory_STR_Authority	= "Authority";
660
	public static String NoteCategory_STR_Identification = "Identification";
661
	public static String NoteCategory_STR_Validity = "Validity";
662
	public static String NoteCategory_STR_Classification = "Classification";
663
	public static String NoteCategory_STR_Distribution = "Distribution";
664
	public static String NoteCategory_STR_Synonymy = "Synonymy";
665
	public static String NoteCategory_STR_Habitat = "Habitat";
666
	public static String NoteCategory_STR_Biology = "Biology";
667
	public static String NoteCategory_STR_Diagnosis	= "Diagnosis";
668
	public static String NoteCategory_STR_Host = "Host";
669
	public static String NoteCategory_STR_Note = "Note";
670
	public static String NoteCategory_STR_Rank = "Rank";
671
	public static String NoteCategory_STR_Taxonomic_Remark = "Taxonomic Remark";
672
	public static String NoteCategory_STR_Taxonomic_Remarks = "Taxonomic Remarks";
673
	
674
	
675
	// Language
676
	public static int Language_Albanian = 1;
677
	public static int Language_Arabic = 2;
678
	public static int Language_Armenian = 3;
679
	public static int Language_Azerbaijan = 4;
680
	public static int Language_Belarusian = 5;
681
	public static int Language_Bulgarian = 6;
682
	public static int Language_Catalan = 7;
683
	public static int Language_Croat = 8;
684
	public static int Language_Czech = 9;
685
	public static int Language_Danish = 10;
686
	public static int Language_Dutch = 11;
687
	public static int Language_English = 12;
688
	public static int Language_Euskera = 13;
689
	public static int Language_Estonian = 14;
690
	public static int Language_Finnish = 15;
691
	public static int Language_French = 16;
692
	public static int Language_Georgian = 17;
693
	public static int Language_German = 18;
694
	public static int Language_Greek = 19;
695
	public static int Language_Hungarian = 20;
696
	public static int Language_Icelandic = 21;
697
	public static int Language_Irish_Gaelic = 22;
698
	public static int Language_Israel_Hebrew = 23;
699
	public static int Language_Italian = 24;
700
	public static int Language_Latvian = 25;
701
	public static int Language_Lithuanian = 26;
702
	public static int Language_Macedonian = 27;
703
	public static int Language_Maltese = 28;
704
	public static int Language_Moldovian = 29;
705
	public static int Language_Norwegian = 30;
706
	public static int Language_Polish = 31;
707
	public static int Language_Portuguese = 32;
708
	public static int Language_Roumanian = 33;
709
	public static int Language_Russian = 34;
710
	public static int Language_Russian_Caucasian = 35;
711
	public static int Language_Russian_Altaic_kalmyk_oirat = 36;
712
	public static int Language_Russian_Altaic_karachay_balkar = 37;
713
	public static int Language_Russian_Altaic_kumyk = 38;
714
	public static int Language_Russian_Altaic_nogai = 39;
715
	public static int Language_Russian_Altaic_north_azerbaijani = 40;
716
	public static int Language_Russian_Indo_european_russian = 41;
717
	public static int Language_Russian_Indo_european_kalmyk_oirat = 42;
718
	public static int Language_Russian_Indo_european_osetin = 43;
719
	public static int Language_Russian_North_caucasian_abaza = 44;
720
	public static int Language_Russian_North_caucasian_adyghe = 45;
721
	public static int Language_Russian_North_caucasian_chechen = 46;
722
	public static int Language_Russian_North_caucasian_kabardian = 47;
723
	public static int Language_Russian_North_caucasian_lak = 48;
724
	public static int Language_Russian_North_caucasian_avar = 49;
725
	public static int Language_Russian_North_caucasian_in = 50;
726
	public static int Language_Russian_Uralic_chuvash = 51;
727
	public static int Language_Russian_Uralic_udmurt = 52;
728
	public static int Language_Serbian = 53;
729
	public static int Language_Slovak = 54;
730
	public static int Language_Slovene = 55;
731
	public static int Language_Spanish_Castillian = 56;
732
	public static int Language_Swedish = 57;
733
	public static int Language_Turkish = 58;
734
	public static int Language_Ukraine = 59;
735
	public static int Language_Welsh = 60;
736
	public static int Language_Corsican = 61;
737

    
738
	public static String STR_LANGUAGE_ALBANIAN = "Albanian";
739
	public static String STR_LANGUAGE_ARABIC = "Arabic";
740
	public static String STR_LANGUAGE_ARMENIAN = "Armenian";
741
	public static String STR_LANGUAGE_AZERBAIJAN = "Azerbaijan";
742
	public static String STR_LANGUAGE_BELARUSIAN = "Belarusian";
743
	public static String STR_LANGUAGE_BULGARIAN = "Bulgarian";
744
	public static String STR_LANGUAGE_CATALAN = "Catalan";
745
	public static String STR_LANGUAGE_CROAT = "Croat";
746
	public static String STR_LANGUAGE_CZECH = "Czech";
747
	public static String STR_LANGUAGE_DANISH = "Danish";
748
	public static String STR_LANGUAGE_DUTCH = "Dutch";
749
	public static String STR_LANGUAGE_ENGLISH = "English";
750
	public static String STR_LANGUAGE_EUSKERA = "Euskera";
751
	public static String STR_LANGUAGE_ESTONIAN = "Estonian";
752
	public static String STR_LANGUAGE_FINNISH = "Finnish";
753
	public static String STR_LANGUAGE_FRENCH = "French";
754
	public static String STR_LANGUAGE_GEORGIAN = "Georgian";
755
	public static String STR_LANGUAGE_GERMAN = "German";
756
	public static String STR_LANGUAGE_GREEK = "Greek";
757
	public static String STR_LANGUAGE_HUNGARIAN = "Hungarian";
758
	public static String STR_LANGUAGE_ICELANDIC = "Icelandic";
759
	public static String STR_LANGUAGE_IRISH_GAELIC = "Irish Gaelic";
760
	public static String STR_LANGUAGE_ISRAEL_HEBREW = "Israel (Hebrew)";
761
	public static String STR_LANGUAGE_ITALIAN = "Italian";
762
	public static String STR_LANGUAGE_LATVIAN = "Latvian";
763
	public static String STR_LANGUAGE_LITHUANIAN = "Lithuanian";
764
	public static String STR_LANGUAGE_MACEDONIAN = "Macedonian";
765
	public static String STR_LANGUAGE_MALTESE = "Maltese";
766
	public static String STR_LANGUAGE_MOLDOVIAN = "Moldovian";
767
	public static String STR_LANGUAGE_NORWEGIAN = "Norwegian";
768
	public static String STR_LANGUAGE_POLISH = "Polish";
769
	public static String STR_LANGUAGE_PORTUGUESE = "Portuguese";
770
	public static String STR_LANGUAGE_ROUMANIAN = "Roumanian";
771
	public static String STR_LANGUAGE_RUSSIAN = "Russian";
772
	public static String STR_LANGUAGE_RUSSIAN_CAUCASIAN = "Russian Caucasian";
773
	public static String STR_LANGUAGE_RUSSIAN_ALTAIC_KALMYK_OIRAT = "Russian (Altaic, kalmyk-oirat)";
774
	public static String STR_LANGUAGE_RUSSIAN_ALTAIC_KARACHAY_BALKAR = "Russian (Altaic, karachay-balkar)";
775
	public static String STR_LANGUAGE_RUSSIAN_ALTAIC_KUMYK = "Russian (Altaic, kumyk)";
776
	public static String STR_LANGUAGE_RUSSIAN_ALTAIC_NOGAI = "Russian (Altaic, nogai)";
777
	public static String STR_LANGUAGE_RUSSIAN_ALTAIC_NORTH_AZERBAIJANI = "Russian (Altaic, north azerbaijani)";
778
	public static String STR_LANGUAGE_RUSSIAN_INDO_EUROPEAN_RUSSIAN = "Russian (Indo-european, russian)";
779
	public static String STR_LANGUAGE_RUSSIAN_INDO_EUROPEAN_KALMYK_OIRAT = "Russian (Indo-european, kalmyk-oirat)";
780
	public static String STR_LANGUAGE_RUSSIAN_INDO_EUROPEAN_OSETIN = "Russian (Indo-european, osetin)";
781
	public static String STR_LANGUAGE_RUSSIAN_NORTH_CAUCASIAN_ABAZA = "Russian (North caucasian, abaza)";
782
	public static String STR_LANGUAGE_RUSSIAN_NORTH_CAUCASIAN_ADYGHE = "Russian (North caucasian, adyghe)";
783
	public static String STR_LANGUAGE_RUSSIAN_NORTH_CAUCASIAN_CHECHEN = "Russian (North caucasian, chechen)";
784
	public static String STR_LANGUAGE_RUSSIAN_NORTH_CAUCASIAN_KABARDIAN = "Russian (North caucasian, kabardian)";
785
	public static String STR_LANGUAGE_RUSSIAN_NORTH_CAUCASIAN_LAK = "Russian (North caucasian, lak)";
786
	public static String STR_LANGUAGE_RUSSIAN_NORTH_CAUCASIAN_AVAR = "Russian (North caucasian, avar)";
787
	public static String STR_LANGUAGE_RUSSIAN_NORTH_CAUCASIAN_IN = "Russian (North caucasian, in)";
788
	public static String STR_LANGUAGE_RUSSIAN_URALIC_CHUVASH = "Russian (Uralic, chuvash)";
789
	public static String STR_LANGUAGE_RUSSIAN_URALIC_UDMURT = "Russian (Uralic, udmurt)";
790
	public static String STR_LANGUAGE_SERBIAN = "Serbian";
791
	public static String STR_LANGUAGE_SLOVAK = "Slovak";
792
	public static String STR_LANGUAGE_SLOVENE = "Slovene";
793
	public static String STR_LANGUAGE_SPANISH_CASTILLIAN = "Spanish, Castillian";
794
	public static String STR_LANGUAGE_SWEDISH = "Swedish";
795
	public static String STR_LANGUAGE_TURKISH = "Turkish";
796
	public static String STR_LANGUAGE_UKRAINE = "Ukraine";
797
	public static String STR_LANGUAGE_WELSH = "Welsh";
798
	public static String STR_LANGUAGE_CORSICAN = "Corsican";
799

    
800
	
801
	// FossilStatus
802
	public static int FOSSILSTATUS_RECENT_ONLY = 1;
803
	public static int FOSSILSTATUS_FOSSIL_ONLY = 2;
804
	public static int FOSSILSTATUS_RECENT_FOSSIL = 3;
805
	
806
	public static String STR_RECENT_ONLY = "recent only";
807
	public static String STR_FOSSIL_ONLY = "fossil only";
808
	public static String STR_RECENT_FOSSIL = "recent + fossil";
809

    
810
	// SourceUse
811
	public static int ORIGINAL_DESCRIPTION = 1;
812
	public static int BASIS_OF_RECORD = 2;
813
	public static int ADDITIONAL_SOURCE = 3;
814
	public static int SOURCE_OF_SYNONYMY = 4;
815
	public static int REDESCRIPTION = 5;
816
	public static int NEW_COMBINATION_REFERENCE = 6;
817
	public static int STATUS_SOURCE = 7;
818
	public static int NOMENCLATURAL_REFERENCE = 8;
819
	
820
	public static String STR_ORIGINAL_DESCRIPTION = "original description";
821
	public static String STR_BASIS_OF_RECORD = "basis of record";
822
	public static String STR_ADDITIONAL_SOURCE = "additional source";
823
	public static String STR_SOURCE_OF_SYNONYMY = "source of synonymy";
824
	public static String STR_REDESCRIPTION = "redescription";
825
	public static String STR_NEW_COMBINATION_REFERENCE = "new combination reference";
826
	public static String STR_STATUS_SOURCE = "status source";
827
	public static String STR_NOMENCLATURAL_REFERENCE = "nomenclatural reference";
828

    
829
	// Area
830
	public static int AREA_EAST_AEGEAN_ISLANDS = 1;
831
	public static int AREA_GREEK_EAST_AEGEAN_ISLANDS = 2;
832
	public static int AREA_TURKISH_EAST_AEGEAN_ISLANDS = 3;
833
	public static int AREA_ALBANIA = 4;
834
	public static int AREA_AUSTRIA_WITH_LIECHTENSTEIN = 5;
835
	public static int AREA_AUSTRIA = 6;
836
	public static int AREA_LIECHTENSTEIN = 7;
837
	public static int AREA_AZORES = 8;
838
	public static int AREA_CORVO = 9;
839
	public static int AREA_FAIAL = 10;
840
	public static int AREA_GRACIOSA = 11;
841
	public static int AREA_SAO_JORGE = 12;
842
	public static int AREA_FLORES = 13;
843
	public static int AREA_SAO_MIGUEL = 14;
844
	public static int AREA_PICO = 15;
845
	public static int AREA_SANTA_MARIA = 16;
846
	public static int AREA_TERCEIRA = 17;
847
	public static int AREA_BELGIUM_WITH_LUXEMBOURG = 18;
848
	public static int AREA_BELGIUM = 19;
849
	public static int AREA_LUXEMBOURG = 20;
850
	public static int AREA_BOSNIA_HERZEGOVINA = 21;
851
	public static int AREA_BALEARES = 22;
852
	public static int AREA_IBIZA_WITH_FORMENTERA = 23;
853
	public static int AREA_MALLORCA = 24;
854
	public static int AREA_MENORCA = 25;
855
	public static int AREA_GREAT_BRITAIN = 26;
856
	public static int AREA_BALTIC_STATES_ESTONIA_LATVIA_LITHUANIA_AND_KALININGRAD_REGION = 27;
857
	public static int AREA_BULGARIA = 28;
858
	public static int AREA_BELARUS = 29;
859
	public static int AREA_CANARY_ISLANDS = 30;
860
	public static int AREA_GRAN_CANARIA = 31;
861
	public static int AREA_FUERTEVENTURA_WITH_LOBOS = 32;
862
	public static int AREA_GOMERA = 33;
863
	public static int AREA_HIERRO = 34;
864
	public static int AREA_LANZAROTE_WITH_GRACIOSA = 35;
865
	public static int AREA_LA_PALMA = 36;
866
	public static int AREA_TENERIFE = 37;
867
	public static int AREA_MONTENEGRO = 38;
868
	public static int AREA_CORSE = 39;
869
	public static int AREA_CRETE_WITH_KARPATHOS_KASOS_AND_GAVDHOS = 40;
870
	public static int AREA_CZECH_REPUBLIC = 41;
871
	public static int AREA_CROATIA = 42;
872
	public static int AREA_CYPRUS = 43;
873
	public static int AREA_FORMER_CZECHOSLOVAKIA = 44;
874
	public static int AREA_DENMARK_WITH_BORNHOLM = 45;
875
	public static int AREA_ESTONIA = 46;
876
	public static int AREA_FAROE_ISLANDS = 47;
877
	public static int AREA_FINLAND_WITH_AHVENANMAA = 48;
878
	public static int AREA_FRANCE = 49;
879
	public static int AREA_CHANNEL_ISLANDS = 50;
880
	public static int AREA_FRENCH_MAINLAND = 51;
881
	public static int AREA_MONACO = 52;
882
	public static int AREA_GERMANY = 53;
883
	public static int AREA_GREECE_WITH_CYCLADES_AND_MORE_ISLANDS = 54;
884
	public static int AREA_IRELAND = 55;
885
	public static int AREA_REPUBLIC_OF_IRELAND = 56;
886
	public static int AREA_NORTHERN_IRELAND = 57;
887
	public static int AREA_SWITZERLAND = 58;
888
	public static int AREA_NETHERLANDS = 59;
889
	public static int AREA_SPAIN = 60;
890
	public static int AREA_ANDORRA = 61;
891
	public static int AREA_GIBRALTAR = 62;
892
	public static int AREA_KINGDOM_OF_SPAIN = 63;
893
	public static int AREA_HUNGARY = 64;
894
	public static int AREA_ICELAND = 65;
895
	public static int AREA_ITALY = 66;
896
	public static int AREA_ITALIAN_MAINLAND = 67;
897
	public static int AREA_SAN_MARINO = 68;
898
	public static int AREA_FORMER_JUGOSLAVIA = 69;
899
	public static int AREA_LATVIA = 70;
900
	public static int AREA_LITHUANIA = 71;
901
	public static int AREA_PORTUGUESE_MAINLAND = 72;
902
	public static int AREA_MADEIRA_ARCHIPELAGO = 73;
903
	public static int AREA_DESERTAS = 74;
904
	public static int AREA_MADEIRA = 75;
905
	public static int AREA_PORTO_SANTO = 76;
906
	public static int AREA_THE_FORMER_JUGOSLAV_REPUBLIC_OF_MAKEDONIJA = 77;
907
	public static int AREA_MOLDOVA = 78;
908
	public static int AREA_NORWEGIAN_MAINLAND = 79;
909
	public static int AREA_POLAND = 80;
910
	public static int AREA_THE_RUSSIAN_FEDERATION = 81;
911
	public static int AREA_NOVAYA_ZEMLYA_AND_FRANZ_JOSEPH_LAND = 82;
912
	public static int AREA_CENTRAL_EUROPEAN_RUSSIA = 83;
913
	public static int AREA_EASTERN_EUROPEAN_RUSSIA = 84;
914
	public static int AREA_KALININGRAD = 85;
915
	public static int AREA_NORTHERN_EUROPEAN_RUSSIA = 86;
916
	public static int AREA_NORTHWEST_EUROPEAN_RUSSIA = 87;
917
	public static int AREA_SOUTH_EUROPEAN_RUSSIA = 88;
918
	public static int AREA_ROMANIA = 89;
919
	public static int AREA_FORMER_USSR = 90;
920
	public static int AREA_RUSSIA_BALTIC = 91;
921
	public static int AREA_RUSSIA_CENTRAL = 92;
922
	public static int AREA_RUSSIA_SOUTHEAST = 93;
923
	public static int AREA_RUSSIA_NORTHERN = 94;
924
	public static int AREA_RUSSIA_SOUTHWEST = 95;
925
	public static int AREA_SARDEGNA = 96;
926
	public static int AREA_SVALBARD_WITH_BJORNOYA_AND_JAN_MAYEN = 97;
927
	public static int AREA_SELVAGENS_ISLANDS = 98;
928
	public static int AREA_SICILY_WITH_MALTA = 99;
929
	public static int AREA_MALTA = 100;
930
	public static int AREA_SICILY = 101;
931
	public static int AREA_SLOVAKIA = 102;
932
	public static int AREA_SLOVENIA = 103;
933
	public static int AREA_SERBIA_WITH_MONTENEGRO = 104;
934
	public static int AREA_SERBIA_INCLUDING_VOJVODINA_AND_WITH_KOSOVO = 105;
935
	public static int AREA_SWEDEN = 106;
936
	public static int AREA_EUROPEAN_TURKEY = 107;
937
	public static int AREA_UKRAINE_INCLUDING_CRIMEA = 108;
938
	public static int AREA_CRIMEA = 109;
939
	public static int AREA_UKRAINE = 110;
940
	public static int AREA_GREEK_MAINLAND = 111;
941
	public static int AREA_CRETE = 112;
942
	public static int AREA_DODECANESE_ISLANDS = 113;
943
	public static int AREA_CYCLADES_ISLANDS = 114;
944
	public static int AREA_NORTH_AEGEAN_ISLANDS = 115;
945
	public static int AREA_VATICAN_CITY = 116;
946
	public static int AREA_FRANZ_JOSEF_LAND = 117;
947
	public static int AREA_NOVAYA_ZEMLYA = 118;
948
	public static int AREA_AZERBAIJAN_INCLUDING_NAKHICHEVAN = 119;
949
	public static int AREA_AZERBAIJAN = 120;
950
	public static int AREA_NAKHICHEVAN = 121;
951
	public static int AREA_ALGERIA = 122;
952
	public static int AREA_ARMENIA = 123;
953
	public static int AREA_CAUCASUS_REGION = 124;
954
	public static int AREA_EGYPT = 125;
955
	public static int AREA_GEORGIA = 126;
956
	public static int AREA_ISRAEL_JORDAN = 127;
957
	public static int AREA_ISRAEL = 128;
958
	public static int AREA_JORDAN = 129;
959
	public static int AREA_LEBANON = 130;
960
	public static int AREA_LIBYA = 131;
961
	public static int AREA_LEBANON_SYRIA = 132;
962
	public static int AREA_MOROCCO = 133;
963
	public static int AREA_NORTH_CAUCASUS = 134;
964
	public static int AREA_SINAI = 135;
965
	public static int AREA_SYRIA = 136;
966
	public static int AREA_TUNISIA = 137;
967
	public static int AREA_ASIATIC_TURKEY = 138;
968
	public static int AREA_TURKEY = 139;
969
	public static int AREA_NORTHERN_AFRICA = 140;
970
	public static int AREA_AFRO_TROPICAL_REGION = 141;
971
	public static int AREA_AUSTRALIAN_REGION = 142;
972
	public static int AREA_EAST_PALAEARCTIC = 143;
973
	public static int AREA_NEARCTIC_REGION = 144;
974
	public static int AREA_NEOTROPICAL_REGION = 145;
975
	public static int AREA_NEAR_EAST = 146;
976
	public static int AREA_ORIENTAL_REGION = 147;
977
	public static int AREA_EUROPEAN_MARINE_WATERS = 148;
978
	public static int AREA_MEDITERRANEAN_SEA = 149;
979
	public static int AREA_WHITE_SEA = 150;
980
	public static int AREA_NORTH_SEA = 151;
981
	public static int AREA_BALTIC_SEA = 152;
982
	public static int AREA_BLACK_SEA = 153;
983
	public static int AREA_BARENTS_SEA = 154;
984
	public static int AREA_CASPIAN_SEA = 155;
985
	public static int AREA_PORTUGUESE_EXCLUSIVE_ECONOMIC_ZONE = 156;
986
	public static int AREA_BELGIAN_EXCLUSIVE_ECONOMIC_ZONE = 157;
987
	public static int AREA_FRENCH_EXCLUSIVE_ECONOMIC_ZONE = 158;
988
	public static int AREA_ENGLISH_CHANNEL = 159;
989
	public static int AREA_ADRIATIC_SEA = 160;
990
	public static int AREA_BISCAY_BAY = 161;
991
	public static int AREA_DUTCH_EXCLUSIVE_ECONOMIC_ZONE = 162;
992
	public static int AREA_UNITED_KINGDOM_EXCLUSIVE_ECONOMIC_ZONE = 163;
993
	public static int AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE = 164;
994
	public static int AREA_EGYPTIAN_EXCLUSIVE_ECONOMIC_ZONE = 165;
995
	public static int AREA_GRECIAN_EXCLUSIVE_ECONOMIC_ZONE = 166;
996
	public static int AREA_TIRRENO_SEA = 167;
997
	public static int AREA_ICELANDIC_EXCLUSIVE_ECONOMIC_ZONE = 168;
998
	public static int AREA_IRISH_EXCLUSIVE_ECONOMIC_ZONE = 169;
999
	public static int AREA_IRISH_SEA = 170;
1000
	public static int AREA_ITALIAN_EXCLUSIVE_ECONOMIC_ZONE = 171;
1001
	public static int AREA_NORWEGIAN_SEA = 172;
1002
	public static int AREA_MOROCCAN_EXCLUSIVE_ECONOMIC_ZONE = 173;
1003
	public static int AREA_NORWEGIAN_EXCLUSIVE_ECONOMIC_ZONE = 174;
1004
	public static int AREA_SKAGERRAK = 175;
1005
	public static int AREA_TUNISIAN_EXCLUSIVE_ECONOMIC_ZONE = 176;
1006
	public static int AREA_WADDEN_SEA = 177;
1007
	public static int AREA_BELT_SEA = 178;
1008
	public static int AREA_MARMARA_SEA = 179;
1009
	public static int AREA_SEA_OF_AZOV = 180;
1010
	public static int AREA_AEGEAN_SEA = 181;
1011
	public static int AREA_BULGARIAN_EXCLUSIVE_ECONOMIC_ZONE = 182;
1012
	public static int AREA_SOUTH_BALTIC_PROPER = 183;
1013
	public static int AREA_BALTIC_PROPER = 184;
1014
	public static int AREA_NORTH_BALTIC_PROPER = 185;
1015
	public static int AREA_ARCHIPELAGO_SEA = 186;
1016
	public static int AREA_BOTHNIAN_SEA = 187;
1017
	public static int AREA_GERMAN_EXCLUSIVE_ECONOMIC_ZONE = 188;
1018
	public static int AREA_SWEDISH_EXCLUSIVE_ECONOMIC_ZONE = 189;
1019
	public static int AREA_UKRAINIAN_EXCLUSIVE_ECONOMIC_ZONE = 190;
1020
	public static int AREA_MADEIRAN_EXCLUSIVE_ECONOMIC_ZONE = 191;
1021
	public static int AREA_LEBANESE_EXCLUSIVE_ECONOMIC_ZONE = 192;
1022
	public static int AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE_MEDITERRANEAN_PART = 193;
1023
	public static int AREA_ESTONIAN_EXCLUSIVE_ECONOMIC_ZONE = 194;
1024
	public static int AREA_CROATIAN_EXCLUSIVE_ECONOMIC_ZONE = 195;
1025
	public static int AREA_BALEAR_SEA = 196;
1026
	public static int AREA_TURKISH_EXCLUSIVE_ECONOMIC_ZONE = 197;
1027
	public static int AREA_DANISH_EXCLUSIVE_ECONOMIC_ZONE = 198;
1028
	public static int AREA_TRANSCAUCASUS = 199;
1029

    
1030

    
1031
	public static String STR_AREA_EAST_AEGEAN_ISLANDS = "East Aegean Islands";
1032
	public static String STR_AREA_GREEK_EAST_AEGEAN_ISLANDS = "Greek East Aegean Islands";
1033
	public static String STR_AREA_TURKISH_EAST_AEGEAN_ISLANDS = "Turkish East Aegean Islands";
1034
	public static String STR_AREA_ALBANIA = "Albania";
1035
	public static String STR_AREA_AUSTRIA_WITH_LIECHTENSTEIN = "Austria with Liechtenstein";
1036
	public static String STR_AREA_AUSTRIA = "Austria";
1037
	public static String STR_AREA_LIECHTENSTEIN = "Liechtenstein";
1038
	public static String STR_AREA_AZORES = "Azores";
1039
	public static String STR_AREA_CORVO = "Corvo";
1040
	public static String STR_AREA_FAIAL = "Faial";
1041
	public static String STR_AREA_GRACIOSA = "Graciosa";
1042
	public static String STR_AREA_SAO_JORGE = "São Jorge";
1043
	public static String STR_AREA_FLORES = "Flores";
1044
	public static String STR_AREA_SAO_MIGUEL = "São Miguel";
1045
	public static String STR_AREA_PICO = "Pico";
1046
	public static String STR_AREA_SANTA_MARIA = "Santa Maria";
1047
	public static String STR_AREA_TERCEIRA = "Terceira";
1048
	public static String STR_AREA_BELGIUM_WITH_LUXEMBOURG = "Belgium with Luxembourg";
1049
	public static String STR_AREA_BELGIUM = "Belgium";
1050
	public static String STR_AREA_LUXEMBOURG = "Luxembourg";
1051
	public static String STR_AREA_BOSNIA_HERZEGOVINA = "Bosnia-Herzegovina";
1052
	public static String STR_AREA_BALEARES = "Baleares";
1053
	public static String STR_AREA_IBIZA_WITH_FORMENTERA = "Ibiza with Formentera";
1054
	public static String STR_AREA_MALLORCA = "Mallorca";
1055
	public static String STR_AREA_MENORCA = "Menorca";
1056
	public static String STR_AREA_GREAT_BRITAIN = "Great Britain";
1057
	public static String STR_AREA_BALTIC_STATES_ESTONIA_LATVIA_LITHUANIA_AND_KALININGRAD_REGION = "Baltic states (Estonia, Latvia, Lithuania) and Kaliningrad region";
1058
	public static String STR_AREA_BULGARIA = "Bulgaria";
1059
	public static String STR_AREA_BELARUS = "Belarus";
1060
	public static String STR_AREA_CANARY_ISLANDS = "Canary Islands";
1061
	public static String STR_AREA_GRAN_CANARIA = "Gran Canaria";
1062
	public static String STR_AREA_FUERTEVENTURA_WITH_LOBOS = "Fuerteventura with Lobos";
1063
	public static String STR_AREA_GOMERA = "Gomera";
1064
	public static String STR_AREA_HIERRO = "Hierro";
1065
	public static String STR_AREA_LANZAROTE_WITH_GRACIOSA = "Lanzarote with Graciosa";
1066
	public static String STR_AREA_LA_PALMA = "La Palma";
1067
	public static String STR_AREA_TENERIFE = "Tenerife";
1068
	public static String STR_AREA_MONTENEGRO = "Montenegro";
1069
	public static String STR_AREA_CORSE = "Corse";
1070
	public static String STR_AREA_CRETE_WITH_KARPATHOS_KASOS_AND_GAVDHOS = "Crete with Karpathos, Kasos & Gavdhos";
1071
	public static String STR_AREA_CZECH_REPUBLIC = "Czech Republic";
1072
	public static String STR_AREA_CROATIA = "Croatia";
1073
	public static String STR_AREA_CYPRUS = "Cyprus";
1074
	public static String STR_AREA_FORMER_CZECHOSLOVAKIA = "Former Czechoslovakia";
1075
	public static String STR_AREA_DENMARK_WITH_BORNHOLM = "Denmark with Bornholm";
1076
	public static String STR_AREA_ESTONIA = "Estonia";
1077
	public static String STR_AREA_FAROE_ISLANDS = "Faroe Islands";
1078
	public static String STR_AREA_FINLAND_WITH_AHVENANMAA = "Finland with Ahvenanmaa";
1079
	public static String STR_AREA_FRANCE = "France";
1080
	public static String STR_AREA_CHANNEL_ISLANDS = "Channel Islands";
1081
	public static String STR_AREA_FRENCH_MAINLAND = "French mainland";
1082
	public static String STR_AREA_MONACO = "Monaco";
1083
	public static String STR_AREA_GERMANY = "Germany";
1084
	public static String STR_AREA_GREECE_WITH_CYCLADES_AND_MORE_ISLANDS = "Greece with Cyclades and more islands";
1085
	public static String STR_AREA_IRELAND = "Ireland";
1086
	public static String STR_AREA_REPUBLIC_OF_IRELAND = "Republic of Ireland";
1087
	public static String STR_AREA_NORTHERN_IRELAND = "Northern Ireland";
1088
	public static String STR_AREA_SWITZERLAND = "Switzerland";
1089
	public static String STR_AREA_NETHERLANDS = "Netherlands";
1090
	public static String STR_AREA_SPAIN = "Spain";
1091
	public static String STR_AREA_ANDORRA = "Andorra";
1092
	public static String STR_AREA_GIBRALTAR = "Gibraltar";
1093
	public static String STR_AREA_KINGDOM_OF_SPAIN = "Kingdom of Spain";
1094
	public static String STR_AREA_HUNGARY = "Hungary";
1095
	public static String STR_AREA_ICELAND = "Iceland";
1096
	public static String STR_AREA_ITALY = "Italy";
1097
	public static String STR_AREA_ITALIAN_MAINLAND = "Italian mainland";
1098
	public static String STR_AREA_SAN_MARINO = "San Marino";
1099
	public static String STR_AREA_FORMER_JUGOSLAVIA = "Former Jugoslavia";
1100
	public static String STR_AREA_LATVIA = "Latvia";
1101
	public static String STR_AREA_LITHUANIA = "Lithuania";
1102
	public static String STR_AREA_PORTUGUESE_MAINLAND = "Portuguese mainland";
1103
	public static String STR_AREA_MADEIRA_ARCHIPELAGO = "Madeira";
1104
	public static String STR_AREA_DESERTAS = "Desertas";
1105
	public static String STR_AREA_MADEIRA = "Madeira";
1106
	public static String STR_AREA_PORTO_SANTO = "Porto Santo";
1107
	public static String STR_AREA_THE_FORMER_JUGOSLAV_REPUBLIC_OF_MAKEDONIJA = "The former Jugoslav Republic of Makedonija";
1108
	public static String STR_AREA_MOLDOVA = "Moldova";
1109
	public static String STR_AREA_NORWEGIAN_MAINLAND = "Norwegian mainland";
1110
	public static String STR_AREA_POLAND = "Poland";
1111
	public static String STR_AREA_THE_RUSSIAN_FEDERATION = "The Russian Federation";
1112
	public static String STR_AREA_NOVAYA_ZEMLYA_AND_FRANZ_JOSEPH_LAND = "Novaya Zemlya & Franz-Joseph Land";
1113
	public static String STR_AREA_CENTRAL_EUROPEAN_RUSSIA = "Central European Russia";
1114
	public static String STR_AREA_EASTERN_EUROPEAN_RUSSIA = "Eastern European Russia";
1115
	public static String STR_AREA_KALININGRAD = "Kaliningrad";
1116
	public static String STR_AREA_NORTHERN_EUROPEAN_RUSSIA = "Northern European Russia";
1117
	public static String STR_AREA_NORTHWEST_EUROPEAN_RUSSIA = "Northwest European Russia";
1118
	public static String STR_AREA_SOUTH_EUROPEAN_RUSSIA = "South European Russia";
1119
	public static String STR_AREA_ROMANIA = "Romania";
1120
	public static String STR_AREA_FORMER_USSR = "Former USSR";
1121
	public static String STR_AREA_RUSSIA_BALTIC = "Russia Baltic";
1122
	public static String STR_AREA_RUSSIA_CENTRAL = "Russia Central";
1123
	public static String STR_AREA_RUSSIA_SOUTHEAST = "Russia Southeast";
1124
	public static String STR_AREA_RUSSIA_NORTHERN = "Russia Northern";
1125
	public static String STR_AREA_RUSSIA_SOUTHWEST = "Russia Southwest";
1126
	public static String STR_AREA_SARDEGNA = "Sardegna";
1127
	public static String STR_AREA_SVALBARD_WITH_BJORNOYA_AND_JAN_MAYEN = "Svalbard with Björnöya and Jan Mayen";
1128
	public static String STR_AREA_SELVAGENS_ISLANDS = "Selvagens Islands";
1129
	public static String STR_AREA_SICILY_WITH_MALTA = "Sicily with Malta";
1130
	public static String STR_AREA_MALTA = "Malta";
1131
	public static String STR_AREA_SICILY = "Sicily";
1132
	public static String STR_AREA_SLOVAKIA = "Slovakia";
1133
	public static String STR_AREA_SLOVENIA = "Slovenia";
1134
	public static String STR_AREA_SERBIA_WITH_MONTENEGRO = "Serbia with Montenegro";
1135
	public static String STR_AREA_SERBIA_INCLUDING_VOJVODINA_AND_WITH_KOSOVO = "Serbia including Vojvodina and with Kosovo";
1136
	public static String STR_AREA_SWEDEN = "Sweden";
1137
	public static String STR_AREA_EUROPEAN_TURKEY = "European Turkey";
1138
	public static String STR_AREA_UKRAINE_INCLUDING_CRIMEA = "Ukraine including Crimea";
1139
	public static String STR_AREA_CRIMEA = "Crimea";
1140
	public static String STR_AREA_UKRAINE = "Ukraine";
1141
	public static String STR_AREA_GREEK_MAINLAND = "Greek mainland";
1142
	public static String STR_AREA_CRETE = "Crete";
1143
	public static String STR_AREA_DODECANESE_ISLANDS = "Dodecanese Islands";
1144
	public static String STR_AREA_CYCLADES_ISLANDS = "Cyclades Islands";
1145
	public static String STR_AREA_NORTH_AEGEAN_ISLANDS = "North Aegean Islands";
1146
	public static String STR_AREA_VATICAN_CITY = "Vatican City";
1147
	public static String STR_AREA_FRANZ_JOSEF_LAND = "Franz Josef Land";
1148
	public static String STR_AREA_NOVAYA_ZEMLYA = "Novaya Zemlya";
1149
	public static String STR_AREA_AZERBAIJAN_INCLUDING_NAKHICHEVAN = "Azerbaijan including Nakhichevan";
1150
	public static String STR_AREA_AZERBAIJAN = "Azerbaijan";
1151
	public static String STR_AREA_NAKHICHEVAN = "Nakhichevan";
1152
	public static String STR_AREA_ALGERIA = "Algeria";
1153
	public static String STR_AREA_ARMENIA = "Armenia";
1154
	public static String STR_AREA_CAUCASUS_REGION = "Caucasus region";
1155
	public static String STR_AREA_EGYPT = "Egypt";
1156
	public static String STR_AREA_GEORGIA = "Georgia";
1157
	public static String STR_AREA_ISRAEL_JORDAN = "Israel-Jordan";
1158
	public static String STR_AREA_ISRAEL = "Israel";
1159
	public static String STR_AREA_JORDAN = "Jordan";
1160
	public static String STR_AREA_LEBANON = "Lebanon";
1161
	public static String STR_AREA_LIBYA = "Libya";
1162
	public static String STR_AREA_LEBANON_SYRIA = "Lebanon-Syria";
1163
	public static String STR_AREA_MOROCCO = "Morocco";
1164
	public static String STR_AREA_NORTH_CAUCASUS = "North Caucasus";
1165
	public static String STR_AREA_SINAI = "Sinai";
1166
	public static String STR_AREA_SYRIA = "Syria";
1167
	public static String STR_AREA_TUNISIA = "Tunisia";
1168
	public static String STR_AREA_ASIATIC_TURKEY = "Asiatic Turkey";
1169
	public static String STR_AREA_TURKEY = "Turkey";
1170
	public static String STR_AREA_NORTHERN_AFRICA = "Northern Africa";
1171
	public static String STR_AREA_AFRO_TROPICAL_REGION = "Afro-tropical region";
1172
	public static String STR_AREA_AUSTRALIAN_REGION = "Australian region";
1173
	public static String STR_AREA_EAST_PALAEARCTIC = "East Palaearctic";
1174
	public static String STR_AREA_NEARCTIC_REGION = "Nearctic region";
1175
	public static String STR_AREA_NEOTROPICAL_REGION = "Neotropical region";
1176
	public static String STR_AREA_NEAR_EAST = "Near East";
1177
	public static String STR_AREA_ORIENTAL_REGION = "Oriental region";
1178
	public static String STR_AREA_EUROPEAN_MARINE_WATERS = "European Marine Waters";
1179
	public static String STR_AREA_MEDITERRANEAN_SEA = "Mediterranean Sea";
1180
	public static String STR_AREA_WHITE_SEA = "White Sea";
1181
	public static String STR_AREA_NORTH_SEA = "North Sea";
1182
	public static String STR_AREA_BALTIC_SEA = "Baltic Sea";
1183
	public static String STR_AREA_BLACK_SEA = "Black Sea";
1184
	public static String STR_AREA_BARENTS_SEA = "Barents Sea";
1185
	public static String STR_AREA_CASPIAN_SEA = "Caspian Sea";
1186
	public static String STR_AREA_PORTUGUESE_EXCLUSIVE_ECONOMIC_ZONE = "Portuguese Exclusive Economic Zone";
1187
	public static String STR_AREA_BELGIAN_EXCLUSIVE_ECONOMIC_ZONE = "Belgian Exclusive Economic Zone";
1188
	public static String STR_AREA_FRENCH_EXCLUSIVE_ECONOMIC_ZONE = "French Exclusive Economic Zone";
1189
	public static String STR_AREA_ENGLISH_CHANNEL = "English Channel";
1190
	public static String STR_AREA_ADRIATIC_SEA = "Adriatic Sea";
1191
	public static String STR_AREA_BISCAY_BAY = "Biscay Bay";
1192
	public static String STR_AREA_DUTCH_EXCLUSIVE_ECONOMIC_ZONE = "Dutch Exclusive Economic Zone";
1193
	public static String STR_AREA_UNITED_KINGDOM_EXCLUSIVE_ECONOMIC_ZONE = "United Kingdom Exclusive Economic Zone";
1194
	public static String STR_AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE = "Spanish Exclusive Economic Zone";
1195
	public static String STR_AREA_EGYPTIAN_EXCLUSIVE_ECONOMIC_ZONE = "Egyptian Exclusive Economic Zone";
1196
	public static String STR_AREA_GRECIAN_EXCLUSIVE_ECONOMIC_ZONE = "Grecian Exclusive Economic Zone";
1197
	public static String STR_AREA_TIRRENO_SEA = "Tirreno Sea";
1198
	public static String STR_AREA_ICELANDIC_EXCLUSIVE_ECONOMIC_ZONE = "Icelandic Exclusive Economic Zone";
1199
	public static String STR_AREA_IRISH_EXCLUSIVE_ECONOMIC_ZONE = "Irish Exclusive economic Zone";
1200
	public static String STR_AREA_IRISH_SEA = "Irish Sea";
1201
	public static String STR_AREA_ITALIAN_EXCLUSIVE_ECONOMIC_ZONE = "Italian Exclusive Economic Zone";
1202
	public static String STR_AREA_NORWEGIAN_SEA = "Norwegian Sea";
1203
	public static String STR_AREA_MOROCCAN_EXCLUSIVE_ECONOMIC_ZONE = "Moroccan Exclusive Economic Zone";
1204
	public static String STR_AREA_NORWEGIAN_EXCLUSIVE_ECONOMIC_ZONE = "Norwegian Exclusive Economic Zone";
1205
	public static String STR_AREA_SKAGERRAK = "Skagerrak";
1206
	public static String STR_AREA_TUNISIAN_EXCLUSIVE_ECONOMIC_ZONE = "Tunisian Exclusive Economic Zone";
1207
	public static String STR_AREA_WADDEN_SEA = "Wadden Sea";
1208
	public static String STR_AREA_BELT_SEA = "Belt Sea";
1209
	public static String STR_AREA_MARMARA_SEA = "Marmara Sea";
1210
	public static String STR_AREA_SEA_OF_AZOV = "Sea of Azov";
1211
	public static String STR_AREA_AEGEAN_SEA = "Aegean Sea";
1212
	public static String STR_AREA_BULGARIAN_EXCLUSIVE_ECONOMIC_ZONE = "Bulgarian Exclusive Economic Zone";
1213
	public static String STR_AREA_SOUTH_BALTIC_PROPER = "South Baltic proper";
1214
	public static String STR_AREA_BALTIC_PROPER = "Baltic Proper";
1215
	public static String STR_AREA_NORTH_BALTIC_PROPER = "North Baltic proper";
1216
	public static String STR_AREA_ARCHIPELAGO_SEA = "Archipelago Sea";
1217
	public static String STR_AREA_BOTHNIAN_SEA = "Bothnian Sea";
1218
	public static String STR_AREA_GERMAN_EXCLUSIVE_ECONOMIC_ZONE = "German Exclusive Economic Zone";
1219
	public static String STR_AREA_SWEDISH_EXCLUSIVE_ECONOMIC_ZONE = "Swedish Exclusive Economic Zone";
1220
	public static String STR_AREA_UKRAINIAN_EXCLUSIVE_ECONOMIC_ZONE = "Ukrainian Exclusive Economic Zone";
1221
	public static String STR_AREA_MADEIRAN_EXCLUSIVE_ECONOMIC_ZONE = "Madeiran Exclusive Economic Zone";
1222
	public static String STR_AREA_LEBANESE_EXCLUSIVE_ECONOMIC_ZONE = "Lebanese Exclusive Economic Zone";
1223
	public static String STR_AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE_MEDITERRANEAN_PART = "Spanish Exclusive Economic Zone [Mediterranean part]";
1224
	public static String STR_AREA_ESTONIAN_EXCLUSIVE_ECONOMIC_ZONE = "Estonian Exclusive Economic Zone";
1225
	public static String STR_AREA_CROATIAN_EXCLUSIVE_ECONOMIC_ZONE = "Croatian Exclusive Economic Zone";
1226
	public static String STR_AREA_BALEAR_SEA = "Balear Sea";
1227
	public static String STR_AREA_TURKISH_EXCLUSIVE_ECONOMIC_ZONE = "Turkish Exclusive Economic Zone";
1228
	public static String STR_AREA_DANISH_EXCLUSIVE_ECONOMIC_ZONE = "Danish Exclusive Economic Zone";
1229
	public static String STR_AREA_TRANSCAUCASUS = "Transcaucasus";
1230

    
1231

    
1232
	
1233
	// OccurrenceStatus
1234
	public static int STATUS_PRESENT = 1;
1235
	public static int STATUS_ABSENT = 2;
1236
	public static int STATUS_NATIVE = 3;
1237
	public static int STATUS_INTRODUCED = 4;
1238
	public static int STATUS_NATURALISED = 5;
1239
	public static int STATUS_INVASIVE = 6;
1240
	public static int STATUS_MANAGED = 7;
1241
	public static int STATUS_DOUBTFUL = 8;
1242

    
1243
	public static String STR_STATUS_PRESENT = "Present";
1244
	public static String STR_STATUS_ABSENT = "Absent";
1245
	public static String STR_STATUS_NATIVE = "Native";
1246
	public static String STR_STATUS_INTRODUCED = "Introduced";
1247
	public static String STR_STATUS_NATURALISED = "Naturalised";
1248
	public static String STR_STATUS_INVASIVE = "Invasive";
1249
	public static String STR_STATUS_MANAGED = "Managed";
1250
	public static String STR_STATUS_DOUBTFUL = "Doubtful";
1251

    
1252
	private Map<String, Integer> tdwgKeyMap = new HashMap<String, Integer>();
1253
	private Map<String, String> tdwgLabelMap = new HashMap<String, String>();
1254
	private Map<Integer, String> nameStatusCacheMap  = new HashMap<Integer, String>();
1255
	private Map<Integer, String> qualityStatusCacheMap  = new HashMap<Integer, String>();
1256
	
1257
	
1258
	private Source destination;
1259
	
1260
	public PesiTransformer(Source destination) {
1261
		super();
1262
		this.destination = destination;
1263
		fillMaps();
1264
	}
1265

    
1266
	private void fillMaps() {
1267
		//TDWG
1268
		try {
1269
			String sql = " SELECT AreaId, AreaName, AreaTdwgCode, AreaEmCode, AreaFaEuCode FROM Area";
1270
			ResultSet rs = destination.getResultSet(sql);
1271
			while (rs.next()){
1272
				String tdwg = rs.getString("AreaTdwgCode");
1273
				Integer id = rs.getInt("AreaId");
1274
				String label = rs.getString("AreaName");
1275
				
1276
				if (StringUtils.isNotBlank(tdwg)){
1277
					this.tdwgKeyMap.put(tdwg, id);
1278
					this.tdwgLabelMap.put(tdwg, label);
1279
				}
1280
			}
1281
			//nameStatusCache
1282
			sql = " SELECT NomStatusId, NomStatus FROM NameStatus ";
1283
			rs = destination.getResultSet(sql);
1284
			while (rs.next()){
1285
				Integer key = rs.getInt("NomStatusId");
1286
				String cache = rs.getString("NomStatus");
1287
				if (StringUtils.isNotBlank(cache)){
1288
					this.nameStatusCacheMap.put(key, cache);
1289
				} 
1290
			}
1291
			//qualityStatusCache
1292
			sql = " SELECT QualityStatusId,QualityStatus FROM QualityStatus ";
1293
			rs = destination.getResultSet(sql);
1294
			while (rs.next()){
1295
				Integer key = rs.getInt("QualityStatusId");
1296
				String cache = rs.getString("QualityStatus");
1297
				if (StringUtils.isNotBlank(cache)){
1298
					this.qualityStatusCacheMap.put(key, cache);
1299
				} 
1300
			}
1301
					
1302
		} catch (SQLException e) {
1303
			logger.error("SQLException when trying to read area map", e);
1304
			e.printStackTrace();
1305
		}
1306
		
1307
	}
1308

    
1309
	/**
1310
	 * Converts the databaseString to its abbreviation if its known.
1311
	 * Otherwise the databaseString is returned.
1312
	 * @param databaseString
1313
	 * @return
1314
	 */
1315
	public static String databaseString2Abbreviation(String databaseString) {
1316
		String result = databaseString;
1317
		if (databaseString.equals("Fauna Europaea database")) {
1318
			result = "FaEu";
1319
		}
1320
		return result;
1321
	}
1322
	
1323
	/**
1324
	 * Returns the OccurrenceStatusId for a given PresenceAbsenceTerm.
1325
	 * @param term
1326
	 * @return
1327
	 * @throws UnknownCdmTypeException 
1328
	 */
1329
	public static String presenceAbsenceTerm2OccurrenceStatusCache(PresenceAbsenceTermBase<?> term) {
1330
		String result = null;
1331
		if (term == null){
1332
			return null;
1333
		//present
1334
		}else if (term.isInstanceOf(PresenceTerm.class)) {
1335
			PresenceTerm presenceTerm = CdmBase.deproxy(term, PresenceTerm.class);
1336
			if (presenceTerm.equals(PresenceTerm.PRESENT()) || 
1337
					presenceTerm.equals(PresenceTerm.INTRODUCED_DOUBTFULLY_INTRODUCED()) || 
1338
					presenceTerm.equals(PresenceTerm.NATIVE_DOUBTFULLY_NATIVE())) {
1339
				result = STR_STATUS_PRESENT;
1340
			} else if (presenceTerm.equals(PresenceTerm.NATIVE())) {
1341
				result = STR_STATUS_NATIVE;
1342
			} else if (presenceTerm.equals(PresenceTerm.INTRODUCED()) || 
1343
					presenceTerm.equals(PresenceTerm.INTRODUCED_ADVENTITIOUS()) ||
1344
					presenceTerm.equals(PresenceTerm.INTRODUCED_UNCERTAIN_DEGREE_OF_NATURALISATION())) {
1345
				result = STR_STATUS_INTRODUCED;
1346
			} else if (presenceTerm.equals(PresenceTerm.NATURALISED()) 
1347
					|| presenceTerm.equals(PresenceTerm.INTRODUCED_NATURALIZED())) {
1348
				result = STR_STATUS_NATURALISED;
1349
			} else if (presenceTerm.equals(PresenceTerm.INVASIVE())) {
1350
				result = STR_STATUS_INVASIVE;
1351
			} else if (presenceTerm.equals(PresenceTerm.CULTIVATED())) {
1352
				result = STR_STATUS_MANAGED;
1353
			} else if (presenceTerm.equals(PresenceTerm.PRESENT_DOUBTFULLY())||
1354
					presenceTerm.equals(PresenceTerm.INTRODUCED_PRESENCE_QUESTIONABLE()) ||
1355
					presenceTerm.equals(PresenceTerm.NATIVE_PRESENCE_QUESTIONABLE() )) {
1356
				result = STR_STATUS_DOUBTFUL;
1357
			} else {
1358
				logger.error("PresenceTerm could not be translated to datawarehouse occurrence status id: " + presenceTerm.getLabel());
1359
			}
1360
		//absent	
1361
		} else if (term.isInstanceOf(AbsenceTerm.class)) {
1362
			AbsenceTerm absenceTerm = CdmBase.deproxy(term, AbsenceTerm.class);
1363
			if (absenceTerm.equals(AbsenceTerm.ABSENT()) || absenceTerm.equals(AbsenceTerm.NATIVE_FORMERLY_NATIVE()) ||
1364
					absenceTerm.equals(AbsenceTerm.CULTIVATED_REPORTED_IN_ERROR()) || absenceTerm.equals(AbsenceTerm.INTRODUCED_REPORTED_IN_ERROR()) ||
1365
					absenceTerm.equals(AbsenceTerm.INTRODUCED_FORMERLY_INTRODUCED()) || absenceTerm.equals(AbsenceTerm.NATIVE_REPORTED_IN_ERROR() ) ) {
1366
				result = STR_STATUS_ABSENT;
1367
			} else {
1368
				logger.error("AbsenceTerm could not be translated to datawarehouse occurrence status id: " + absenceTerm.getLabel());
1369
			}
1370
		}
1371
		return result;
1372
	}
1373
	
1374
	/**
1375
	 * Returns the OccurrenceStatusId for a given PresenceAbsenceTerm.
1376
	 * @param term
1377
	 * @return
1378
	 * @throws UnknownCdmTypeException 
1379
	 */
1380
	public static Integer presenceAbsenceTerm2OccurrenceStatusId(PresenceAbsenceTermBase<?> term) {
1381
		Integer result = null;
1382
		if (term == null){
1383
			return null;
1384
		//present
1385
		}else if (term.isInstanceOf(PresenceTerm.class)) {
1386
			PresenceTerm presenceTerm = CdmBase.deproxy(term, PresenceTerm.class);
1387
			if (presenceTerm.equals(PresenceTerm.PRESENT()) || 
1388
					presenceTerm.equals(PresenceTerm.INTRODUCED_DOUBTFULLY_INTRODUCED()) || 
1389
					presenceTerm.equals(PresenceTerm.NATIVE_DOUBTFULLY_NATIVE())) {
1390
				result = STATUS_PRESENT;
1391
			} else if (presenceTerm.equals(PresenceTerm.NATIVE())) {
1392
				result = STATUS_NATIVE;
1393
			} else if (presenceTerm.equals(PresenceTerm.INTRODUCED()) || 
1394
					presenceTerm.equals(PresenceTerm.INTRODUCED_ADVENTITIOUS()) ||
1395
					presenceTerm.equals(PresenceTerm.INTRODUCED_UNCERTAIN_DEGREE_OF_NATURALISATION())) {
1396
				result = STATUS_INTRODUCED;
1397
			} else if (presenceTerm.equals(PresenceTerm.NATURALISED()) 
1398
					|| presenceTerm.equals(PresenceTerm.INTRODUCED_NATURALIZED())) {
1399
				result = STATUS_NATURALISED;
1400
			} else if (presenceTerm.equals(PresenceTerm.INVASIVE())) {
1401
				result = STATUS_INVASIVE;
1402
			} else if (presenceTerm.equals(PresenceTerm.CULTIVATED())) {
1403
				result = STATUS_MANAGED;
1404
			} else if (presenceTerm.equals(PresenceTerm.PRESENT_DOUBTFULLY())||
1405
					presenceTerm.equals(PresenceTerm.INTRODUCED_PRESENCE_QUESTIONABLE()) ||
1406
					presenceTerm.equals(PresenceTerm.NATIVE_PRESENCE_QUESTIONABLE() )) {
1407
				result = STATUS_DOUBTFUL;
1408
			} else {
1409
				logger.error("PresenceTerm could not be translated to datawarehouse occurrence status id: " + presenceTerm.getLabel());
1410
			}
1411
		//absent	
1412
		} else if (term.isInstanceOf(AbsenceTerm.class)) {
1413
			AbsenceTerm absenceTerm = CdmBase.deproxy(term, AbsenceTerm.class);
1414
			if (absenceTerm.equals(AbsenceTerm.ABSENT()) || absenceTerm.equals(AbsenceTerm.NATIVE_FORMERLY_NATIVE()) ||
1415
					absenceTerm.equals(AbsenceTerm.CULTIVATED_REPORTED_IN_ERROR()) || absenceTerm.equals(AbsenceTerm.INTRODUCED_REPORTED_IN_ERROR()) ||
1416
					absenceTerm.equals(AbsenceTerm.INTRODUCED_FORMERLY_INTRODUCED()) || absenceTerm.equals(AbsenceTerm.NATIVE_REPORTED_IN_ERROR() ) ) {
1417
				result = STATUS_ABSENT;
1418
			} else {
1419
				logger.error("AbsenceTerm could not be translated to datawarehouse occurrence status id: " + absenceTerm.getLabel());
1420
			}
1421
		}
1422
		return result;
1423
	}
1424
	
1425
//	/**
1426
//	 * Returns the AreaCache for a given Area.
1427
//	 * @param area
1428
//	 * @return
1429
//	 */
1430
//	public static String area2AreaCache(NamedArea area) {
1431
//		NamedArea namedArea = CdmBase.deproxy(area, NamedArea.class);
1432
//		if (area == null) {
1433
//			return null;
1434
//		} else if (area.isInstanceOf(TdwgArea.class)) {
1435
//			
1436
//			// TODO: Areas identified by the string "TODO" (for now) have to be identified correctly after additions have been made to the list of NamedArea's according to specific imports, i.e. euro+med
1437
//			if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("EAI")) { return STR_AREA_GREEK_EAST_AEGEAN_ISLANDS; }
1438
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("EAI-OO")) { return STR_AREA_GREEK_EAST_AEGEAN_ISLANDS; }
1439
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_TURKISH_EAST_AEGEAN_ISLANDS; }
1440
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ALB")) { return STR_AREA_ALBANIA; }
1441
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ALB-OO")) { return STR_AREA_ALBANIA; }
1442
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("AUT")) { return STR_AREA_AUSTRIA_WITH_LIECHTENSTEIN; }
1443
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("AUT-AU")) { return STR_AREA_AUSTRIA; }
1444
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("AUT-LI")) { return STR_AREA_LIECHTENSTEIN; }
1445
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("AZO")) { return STR_AREA_AZORES; }
1446
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("AZO-OO")) { return STR_AREA_AZORES; }
1447
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_CORVO; }
1448
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_FAIAL; }
1449
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_GRACIOSA; }
1450
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_SAO_JORGE; }
1451
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_FLORES; }
1452
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_SAO_MIGUEL; }
1453
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_PICO; }
1454
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_SANTA_MARIA; }
1455
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_TERCEIRA; }
1456
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BGM")) { return STR_AREA_BELGIUM_WITH_LUXEMBOURG; }
1457
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BGM-BE")) { return STR_AREA_BELGIUM; }
1458
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BGM-LU")) { return STR_AREA_LUXEMBOURG; }
1459
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("YUG-BH")) { return STR_AREA_BOSNIA_HERZEGOVINA; }
1460
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BAL")) { return STR_AREA_BALEARES; }
1461
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BAL-OO")) { return STR_AREA_BALEARES; }
1462
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_IBIZA_WITH_FORMENTERA; }
1463
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_MALLORCA; }
1464
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_MENORCA; }
1465
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GRB")) { return STR_AREA_GREAT_BRITAIN; }
1466
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GRB-OO")) { return STR_AREA_GREAT_BRITAIN; }
1467
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLT")) { return STR_AREA_BALTIC_STATES_ESTONIA_LATVIA_LITHUANIA_AND_KALININGRAD_REGION; }
1468
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BUL")) { return STR_AREA_BULGARIA; }
1469
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BUL-OO")) { return STR_AREA_BULGARIA; }
1470
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLR")) { return STR_AREA_BELARUS; }
1471
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLR-OO")) { return STR_AREA_BELARUS; }
1472
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CNY")) { return STR_AREA_CANARY_ISLANDS; }
1473
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CNY-OO")) { return STR_AREA_CANARY_ISLANDS; }
1474
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_GRAN_CANARIA; }
1475
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_FUERTEVENTURA_WITH_LOBOS; }
1476
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_GOMERA; }
1477
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_HIERRO; }
1478
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_LANZAROTE_WITH_GRACIOSA; }
1479
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_LA_PALMA; }
1480
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_TENERIFE; }
1481
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("YUG-MN")) { return STR_AREA_MONTENEGRO; }
1482
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("COR")) { return STR_AREA_CORSE; }
1483
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("COR-OO")) { return STR_AREA_CORSE; }
1484
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("KRI")) { return STR_AREA_CRETE_WITH_KARPATHOS_KASOS_AND_GAVDHOS; }
1485
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("KRI-OO")) { return STR_AREA_CRETE_WITH_KARPATHOS_KASOS_AND_GAVDHOS; }
1486
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CZE-CZ")) { return STR_AREA_CZECH_REPUBLIC; }
1487
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("YUG-CR")) { return STR_AREA_CROATIA; }
1488
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CYP")) { return STR_AREA_CYPRUS; }
1489
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CYP-OO")) { return STR_AREA_CYPRUS; }
1490
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CZE")) { return STR_AREA_FORMER_CZECHOSLOVAKIA; }
1491
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("DEN")) { return STR_AREA_DENMARK_WITH_BORNHOLM; }
1492
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("DEN-OO")) { return STR_AREA_DENMARK_WITH_BORNHOLM; }
1493
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLT-ES")) { return STR_AREA_ESTONIA; }
1494
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("FOR")) { return STR_AREA_FAROE_ISLANDS; }
1495
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("FOR-OO")) { return STR_AREA_FAROE_ISLANDS; }
1496
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("FIN")) { return STR_AREA_FINLAND_WITH_AHVENANMAA; }
1497
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("FIN-OO")) { return STR_AREA_FINLAND_WITH_AHVENANMAA; }
1498
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("FRA")) { return STR_AREA_FRANCE; }
1499
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("FRA-CI")) { return STR_AREA_CHANNEL_ISLANDS; }
1500
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("FRA-FR")) { return STR_AREA_FRENCH_MAINLAND; }
1501
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("FRA-MO")) { return STR_AREA_MONACO; }
1502
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GER")) { return STR_AREA_GERMANY; }
1503
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GER-OO")) { return STR_AREA_GERMANY; }
1504
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GRC")) { return STR_AREA_GREECE_WITH_CYCLADES_AND_MORE_ISLANDS; }
1505
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GRC-OO")) { return STR_AREA_GREECE_WITH_CYCLADES_AND_MORE_ISLANDS; }
1506
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("IRE")) { return STR_AREA_IRELAND; }
1507
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("IRE-IR")) { return STR_AREA_REPUBLIC_OF_IRELAND; }
1508
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("IRE-NI")) { return STR_AREA_NORTHERN_IRELAND; }
1509
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SWI")) { return STR_AREA_SWITZERLAND; }
1510
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SWI-OO")) { return STR_AREA_SWITZERLAND; }
1511
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("NET")) { return STR_AREA_NETHERLANDS; }
1512
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("NET-OO")) { return STR_AREA_NETHERLANDS; }
1513
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SPA")) { return STR_AREA_SPAIN; }
1514
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SPA-AN")) { return STR_AREA_ANDORRA; }
1515
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SPA-GI")) { return STR_AREA_GIBRALTAR; }
1516
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SPA-SP")) { return STR_AREA_KINGDOM_OF_SPAIN; }
1517
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("HUN")) { return STR_AREA_HUNGARY; }
1518
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("HUN-OO")) { return STR_AREA_HUNGARY; }
1519
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ICE")) { return STR_AREA_ICELAND; }
1520
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ICE-OO")) { return STR_AREA_ICELAND; }
1521
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ITA")) { return STR_AREA_ITALY; }
1522
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ITA-IT")) { return STR_AREA_ITALIAN_MAINLAND; }
1523
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ITA-SM")) { return STR_AREA_SAN_MARINO; }
1524
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("YUG")) { return STR_AREA_FORMER_JUGOSLAVIA; }
1525
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLT-LA")) { return STR_AREA_LATVIA; }
1526
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLT-LI")) { return STR_AREA_LITHUANIA; }
1527
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("POR")) { return STR_AREA_PORTUGUESE_MAINLAND; }
1528
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("POR-OO")) { return STR_AREA_PORTUGUESE_MAINLAND; }
1529
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("MDR")) { return STR_AREA_MADEIRA_ARCHIPELAGO; }
1530
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("MDR-OO")) { return STR_AREA_MADEIRA_ARCHIPELAGO; }
1531
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("YUG-MA")) { return STR_AREA_THE_FORMER_JUGOSLAV_REPUBLIC_OF_MAKEDONIJA; }
1532
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("UKR-MO")) { return STR_AREA_MOLDOVA; }
1533
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("NOR")) { return STR_AREA_NORWEGIAN_MAINLAND; }
1534
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("NOR-OO")) { return STR_AREA_NORWEGIAN_MAINLAND; }
1535
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("POL")) { return STR_AREA_POLAND; }
1536
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("POL-OO")) { return STR_AREA_POLAND; }
1537
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUS")) { return STR_AREA_THE_RUSSIAN_FEDERATION; }
1538
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("WSB")) { return STR_AREA_NOVAYA_ZEMLYA_AND_FRANZ_JOSEPH_LAND; }
1539
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("WSB-OO")) { return STR_AREA_NOVAYA_ZEMLYA_AND_FRANZ_JOSEPH_LAND; }
1540
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUC")) { return STR_AREA_CENTRAL_EUROPEAN_RUSSIA; }
1541
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUC-OO")) { return STR_AREA_CENTRAL_EUROPEAN_RUSSIA; }
1542
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUE")) { return STR_AREA_EASTERN_EUROPEAN_RUSSIA; }
1543
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUE-OO")) { return STR_AREA_EASTERN_EUROPEAN_RUSSIA; }
1544
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLT-KA")) { return STR_AREA_KALININGRAD; }
1545
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUN")) { return STR_AREA_NORTHERN_EUROPEAN_RUSSIA; }
1546
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUN-OO")) { return STR_AREA_NORTHERN_EUROPEAN_RUSSIA; }
1547
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUW")) { return STR_AREA_NORTHWEST_EUROPEAN_RUSSIA; }
1548
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUW-OO")) { return STR_AREA_NORTHWEST_EUROPEAN_RUSSIA; }
1549
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUS")) { return STR_AREA_SOUTH_EUROPEAN_RUSSIA; }
1550
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUS-OO")) { return STR_AREA_SOUTH_EUROPEAN_RUSSIA; }
1551
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ROM")) { return STR_AREA_ROMANIA; }
1552
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ROM-OO")) { return STR_AREA_ROMANIA; }
1553
//			
1554
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SAR")) { return STR_AREA_SARDEGNA; }
1555
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SAR-OO")) { return STR_AREA_SARDEGNA; }
1556
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SVA")) { return STR_AREA_SVALBARD_WITH_BJORNOYA_AND_JAN_MAYEN; }
1557
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SVA-OO")) { return STR_AREA_SVALBARD_WITH_BJORNOYA_AND_JAN_MAYEN; }
1558
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SEL")) { return STR_AREA_SELVAGENS_ISLANDS; }
1559
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SEL-OO")) { return STR_AREA_SELVAGENS_ISLANDS; }
1560
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SIC")) { return STR_AREA_SICILY_WITH_MALTA; }
1561
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SIC-MA")) { return STR_AREA_MALTA; }
1562
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SIC-SI")) { return STR_AREA_SICILY; }
1563
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CZE-SK")) { return STR_AREA_SLOVAKIA; }
1564
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("YUG-SL")) { return STR_AREA_SLOVENIA; }
1565
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CS")) { return STR_AREA_SERBIA_WITH_MONTENEGRO; }
1566
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("YUG-SE")) { return STR_AREA_SERBIA_INCLUDING_VOJVODINA_AND_WITH_KOSOVO; }
1567
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SWE")) { return STR_AREA_SWEDEN; }
1568
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SWE-OO")) { return STR_AREA_SWEDEN; }
1569
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TUE")) { return STR_AREA_EUROPEAN_TURKEY; }
1570
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TUE-OO")) { return STR_AREA_EUROPEAN_TURKEY; }
1571
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("KRY")) { return STR_AREA_CRIMEA; }
1572
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("KRY-OO")) { return STR_AREA_CRIMEA; }
1573
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("UKR-UK")) { return STR_AREA_UKRAINE; }
1574
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GRE")) { return STR_AREA_GREEK_MAINLAND; }
1575
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GR-KRI")) { return STR_AREA_CRETE; }
1576
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GR-DOD")) { return STR_AREA_DODECANESE_ISLANDS; }
1577
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GR-CYC")) { return STR_AREA_CYCLADES_ISLANDS; }
1578
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GR-AEG")) { return STR_AREA_NORTH_AEGEAN_ISLANDS; }
1579
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ITA-VC")) { return STR_AREA_VATICAN_CITY; }
1580
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_FRANZ_JOSEF_LAND; }
1581
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_NOVAYA_ZEMLYA; }
1582
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TCS-AZ")) { return STR_AREA_AZERBAIJAN; }
1583
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TCS-NA")) { return STR_AREA_NAKHICHEVAN; }
1584
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ALG")) { return STR_AREA_ALGERIA; }
1585
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ALG-OO")) { return STR_AREA_ALGERIA; }
1586
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TCS-AR")) { return STR_AREA_ARMENIA; }
1587
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("33")) { return STR_AREA_CAUCASUS_REGION; }
1588
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("EGY")) { return STR_AREA_EGYPT; }
1589
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("EGY-OO")) { return STR_AREA_EGYPT; }
1590
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("PAL")) { return STR_AREA_ISRAEL_JORDAN; }
1591
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("PAL-IS")) { return STR_AREA_ISRAEL; }
1592
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("PAL-JO")) { return STR_AREA_JORDAN; }
1593
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("LBS-LB")) { return STR_AREA_LEBANON; }
1594
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("LBY-OO")) { return STR_AREA_LIBYA; }
1595
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("LBS")) { return STR_AREA_LEBANON_SYRIA; }
1596
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("MOR")) { return STR_AREA_MOROCCO; }
1597
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("NCS")) { return STR_AREA_NORTH_CAUCASUS; }
1598
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SIN")) { return STR_AREA_SINAI; }
1599
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SIN-OO")) { return STR_AREA_SINAI; }
1600
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("LBS-SY")) { return STR_AREA_SYRIA; }
1601
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TUN")) { return STR_AREA_TUNISIA; }
1602
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TUN-OO")) { return STR_AREA_TUNISIA; }
1603
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TUR-OO")) { return STR_AREA_ASIATIC_TURKEY; }
1604
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("20")) { return STR_AREA_NORTHERN_AFRICA; }
1605
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("AFR")) { return STR_AREA_AFRO_TROPICAL_REGION; }
1606
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("AUS")) { return STR_AREA_AUSTRALIAN_REGION; }
1607
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return STR_AREA_EAST_PALAEARCTIC; }
1608
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("NEA")) { return STR_AREA_NEARCTIC_REGION; }
1609
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("NEO")) { return STR_AREA_NEOTROPICAL_REGION; }
1610
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("NRE")) { return STR_AREA_NEAR_EAST; }
1611
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ORR")) { return STR_AREA_ORIENTAL_REGION; }
1612
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TCS")) { return STR_AREA_TRANSCAUCASUS; }
1613
//			
1614
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidEuropeanMarineWaters)) { return STR_AREA_EUROPEAN_MARINE_WATERS; }
1615
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("MES") ||
1616
//					(namedArea.getUuid().equals(ErmsTransformer.uuidMediterraneanSea))) { return STR_AREA_MEDITERRANEAN_SEA; } // abbreviated label missing
1617
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidWhiteSea)) { return STR_AREA_WHITE_SEA; }
1618
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorthSea)) { return STR_AREA_NORTH_SEA; }
1619
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBalticSea)) { return STR_AREA_BALTIC_SEA; }
1620
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLS") ||
1621
//					(namedArea.getUuid().equals(ErmsTransformer.uuidBlackSea))) { return STR_AREA_BLACK_SEA; } // abbreviated label missing
1622
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBarentsSea)) { return STR_AREA_BARENTS_SEA; }
1623
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CAS") ||
1624
//					(namedArea.getUuid().equals(ErmsTransformer.uuidCaspianSea))) { return STR_AREA_CASPIAN_SEA; } // abbreviated label missing
1625
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidPortugueseExclusiveEconomicZone)) { return STR_AREA_PORTUGUESE_EXCLUSIVE_ECONOMIC_ZONE; }
1626
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBelgianExclusiveEconomicZone)) { return STR_AREA_BELGIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1627
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidFrenchExclusiveEconomicZone)) { return STR_AREA_FRENCH_EXCLUSIVE_ECONOMIC_ZONE; }
1628
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidEnglishChannel)) { return STR_AREA_ENGLISH_CHANNEL; }
1629
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidAdriaticSea)) { return STR_AREA_ADRIATIC_SEA; }
1630
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBiscayBay)) { return STR_AREA_BISCAY_BAY; }
1631
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidDutchExclusiveEconomicZone)) { return STR_AREA_DUTCH_EXCLUSIVE_ECONOMIC_ZONE; }
1632
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidUnitedKingdomExclusiveEconomicZone)) { return STR_AREA_UNITED_KINGDOM_EXCLUSIVE_ECONOMIC_ZONE; }
1633
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSpanishExclusiveEconomicZone)) { return STR_AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE; }
1634
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidEgyptianExclusiveEconomicZone)) { return STR_AREA_EGYPTIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1635
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidGrecianExclusiveEconomicZone)) { return STR_AREA_GRECIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1636
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidTirrenoSea)) { return STR_AREA_TIRRENO_SEA; }
1637
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidIcelandicExclusiveEconomicZone)) { return STR_AREA_ICELANDIC_EXCLUSIVE_ECONOMIC_ZONE; }
1638
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidIrishExclusiveeconomicZone)) { return STR_AREA_IRISH_EXCLUSIVE_ECONOMIC_ZONE; }
1639
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidIrishSea)) { return STR_AREA_IRISH_SEA; }
1640
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidItalianExclusiveEconomicZone)) { return STR_AREA_ITALIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1641
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorwegianSea)) { return STR_AREA_NORWEGIAN_SEA; }
1642
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidMoroccanExclusiveEconomicZone)) { return STR_AREA_MOROCCAN_EXCLUSIVE_ECONOMIC_ZONE; }
1643
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorwegianExclusiveEconomicZone)) { return STR_AREA_NORWEGIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1644
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSkagerrak)) { return STR_AREA_SKAGERRAK; }
1645
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidTunisianExclusiveEconomicZone)) { return STR_AREA_TUNISIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1646
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidWaddenSea)) { return STR_AREA_WADDEN_SEA; }
1647
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBeltSea)) { return STR_AREA_BELT_SEA; }
1648
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidMarmaraSea)) { return STR_AREA_MARMARA_SEA; }
1649
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSeaofAzov)) { return STR_AREA_SEA_OF_AZOV; }
1650
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidAegeanSea)) { return STR_AREA_AEGEAN_SEA; }
1651
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBulgarianExclusiveEconomicZone)) { return STR_AREA_BULGARIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1652
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSouthBalticproper)) { return STR_AREA_SOUTH_BALTIC_PROPER; }
1653
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBalticProper)) { return STR_AREA_BALTIC_PROPER; }
1654
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorthBalticproper)) { return STR_AREA_NORTH_BALTIC_PROPER; }
1655
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidArchipelagoSea)) { return STR_AREA_ARCHIPELAGO_SEA; }
1656
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBothnianSea)) { return STR_AREA_BOTHNIAN_SEA; }
1657
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidGermanExclusiveEconomicZone)) { return STR_AREA_GERMAN_EXCLUSIVE_ECONOMIC_ZONE; }
1658
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSwedishExclusiveEconomicZone)) { return STR_AREA_SWEDISH_EXCLUSIVE_ECONOMIC_ZONE; }
1659
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidUkrainianExclusiveEconomicZone)) { return STR_AREA_UKRAINIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1660
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidMadeiranExclusiveEconomicZone)) { return STR_AREA_MADEIRAN_EXCLUSIVE_ECONOMIC_ZONE; }
1661
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidLebaneseExclusiveEconomicZone)) { return STR_AREA_LEBANESE_EXCLUSIVE_ECONOMIC_ZONE; }
1662
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSpanishExclusiveEconomicZoneMediterraneanpart)) { return STR_AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE_MEDITERRANEAN_PART; }
1663
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidEstonianExclusiveEconomicZone)) { return STR_AREA_ESTONIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1664
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidCroatianExclusiveEconomicZone)) { return STR_AREA_CROATIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1665
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBalearSea)) { return STR_AREA_BALEAR_SEA; }
1666
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidTurkishExclusiveEconomicZone)) { return STR_AREA_TURKISH_EXCLUSIVE_ECONOMIC_ZONE; }
1667
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidDanishExclusiveEconomicZone)) { return STR_AREA_DANISH_EXCLUSIVE_ECONOMIC_ZONE; }
1668
//			else {
1669
//				logger.error("Unknown NamedArea Area: " + area.getTitleCache());
1670
//			}
1671
//		}else if (namedArea.isInstanceOf(WaterbodyOrCountry.class)){
1672
//			if ((namedArea.equals(WaterbodyOrCountry.UKRAINE()))) { return STR_AREA_UKRAINE_INCLUDING_CRIMEA; }
1673
//			else if (namedArea.equals(WaterbodyOrCountry.AZERBAIJANREPUBLICOF())) { return STR_AREA_AZERBAIJAN_INCLUDING_NAKHICHEVAN; }
1674
//			else if (namedArea.equals(WaterbodyOrCountry.GEORGIA())) { return STR_AREA_GEORGIA; }
1675
//			else {
1676
//				logger.warn("Unknown NamedArea Area: " + area.getTitleCache());
1677
//			}
1678
//		}else {
1679
//			if ((namedArea.getUuid().equals(BerlinModelTransformer.uuidMadeira))){ return STR_AREA_MADEIRA; }
1680
//			else if ((namedArea.getUuid().equals(BerlinModelTransformer.uuidDesertas))) { return STR_AREA_DESERTAS; }
1681
//			else if ((namedArea.getUuid().equals(BerlinModelTransformer.uuidPortoSanto))) { return STR_AREA_PORTO_SANTO; }
1682
//			else if ((namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaBaltic))) { return STR_AREA_RUSSIA_BALTIC; }
1683
//			else if ((namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaSouthEast))) { return STR_AREA_RUSSIA_SOUTHEAST; }
1684
//			else if ((namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaSouthWest))) { return STR_AREA_RUSSIA_SOUTHWEST; }
1685
//			else if ((namedArea.getUuid().equals(BerlinModelTransformer.uuidUssr))) { return STR_AREA_FORMER_USSR; }
1686
//			else if ((namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaCentral))) { return STR_AREA_RUSSIA_CENTRAL; }
1687
//			else if ((namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaNorthern))) { return STR_AREA_RUSSIA_NORTHERN; }
1688
//			else if ((namedArea.getUuid().equals(BerlinModelTransformer.uuidTurkey))) { return STR_AREA_TURKEY; }
1689
//			else if ((namedArea.getUuid().equals(BerlinModelTransformer.uuidEastAegeanIslands))) { return STR_AREA_EAST_AEGEAN_ISLANDS; }
1690
//			
1691
//			else {
1692
//				logger.warn("Unknown NamedArea Area: " + area.getTitleCache());
1693
//			}
1694
//		}
1695
//		return null; // Actually the export has to stop here because AreaFk's are not allowed to be NULL.
1696
//	}
1697

    
1698
	@Override
1699
	public String getCacheByPresenceAbsenceTerm(PresenceAbsenceTermBase status) throws UndefinedTransformerMethodException {
1700
		return presenceAbsenceTerm2OccurrenceStatusCache(status);
1701
	}
1702
	
1703
	@Override
1704
	public Object getKeyByPresenceAbsenceTerm(PresenceAbsenceTermBase status) throws UndefinedTransformerMethodException {
1705
		return presenceAbsenceTerm2OccurrenceStatusId(status);
1706
	}
1707
	
1708
	
1709
	
1710
	@Override
1711
	public String getCacheByNamedArea(NamedArea area) throws UndefinedTransformerMethodException {
1712
		NamedArea namedArea = CdmBase.deproxy(area, NamedArea.class);
1713

    
1714
		if (namedArea == null) {
1715
			return null;
1716
		//TDWG areas
1717
		} else if (namedArea.isInstanceOf(TdwgArea.class)) {
1718
			String abbrevLabel = namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel();
1719
			String result = this.tdwgLabelMap.get(abbrevLabel);
1720
			if (result == null){
1721
				logger.warn("Unknown TDWGArea: " + namedArea.getTitleCache());
1722
			}
1723
			return result;
1724
		//countries & Waterbodies
1725
		}else if (namedArea.isInstanceOf(WaterbodyOrCountry.class)){
1726
			if (namedArea.equals(WaterbodyOrCountry.UKRAINE())) { return STR_AREA_UKRAINE_INCLUDING_CRIMEA; }
1727
			else if (namedArea.equals(WaterbodyOrCountry.AZERBAIJANREPUBLICOF())) { return STR_AREA_AZERBAIJAN_INCLUDING_NAKHICHEVAN; }
1728
			else if (namedArea.equals(WaterbodyOrCountry.GEORGIA())) { return STR_AREA_GEORGIA; }
1729
			else if (namedArea.equals(WaterbodyOrCountry.RUSSIANFEDERATION())) { return STR_AREA_THE_RUSSIAN_FEDERATION; }
1730
			else {
1731
				logger.warn("Unknown Waterbody/Country: " + namedArea.getTitleCache());
1732
			}
1733
		}else{  //Non TDWG, non country
1734
			//E+M
1735
			if ( namedArea.getUuid().equals(BerlinModelTransformer.uuidMadeira)){ return STR_AREA_MADEIRA; }
1736
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidDesertas)) { return STR_AREA_DESERTAS; }
1737
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidPortoSanto)) { return STR_AREA_PORTO_SANTO; }
1738
			
1739
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidUssr)) { return STR_AREA_FORMER_USSR; }
1740
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaBaltic)) { return STR_AREA_RUSSIA_BALTIC; }
1741
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaSouthEast)) { return STR_AREA_RUSSIA_SOUTHEAST; }
1742
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaSouthWest)) { return STR_AREA_RUSSIA_SOUTHWEST; }
1743
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaCentral)) { return STR_AREA_RUSSIA_CENTRAL; }
1744
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaNorthern)) { return STR_AREA_RUSSIA_NORTHERN; }
1745
			
1746
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidTurkey)) { return STR_AREA_TURKEY; }
1747
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidEastAegeanIslands)) { return STR_AREA_EAST_AEGEAN_ISLANDS; }
1748
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidFlores)) { return STR_AREA_FLORES; }
1749
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidTurkishEastAegeanIslands)) { return STR_AREA_TURKISH_EAST_AEGEAN_ISLANDS; }
1750
			
1751
			//FE
1752
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaAFR)) { return STR_AREA_AFRO_TROPICAL_REGION; }
1753
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaAUS)) { return STR_AREA_AUSTRALIAN_REGION; }
1754
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaEPA)) { return STR_AREA_EAST_PALAEARCTIC; }
1755
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaGR_AEG)) { return STR_AREA_NORTH_AEGEAN_ISLANDS; }
1756
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaGR_CYC)) { return STR_AREA_CYCLADES_ISLANDS; }
1757
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaGR_DOD)) { return STR_AREA_DODECANESE_ISLANDS; }
1758
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaNAF)) { return STR_AREA_NORTHERN_AFRICA; }
1759
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaNEA)) { return STR_AREA_NEARCTIC_REGION; }
1760
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaNEO)) { return STR_AREA_NEOTROPICAL_REGION; }
1761
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaNRE)) { return STR_AREA_NEAR_EAST; }
1762
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaORR)) { return STR_AREA_ORIENTAL_REGION; }
1763
			
1764
			
1765
			//ERMS
1766
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidEuropeanMarineWaters)) { return STR_AREA_EUROPEAN_MARINE_WATERS; }
1767
			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("MES") ||
1768
					(namedArea.getUuid().equals(ErmsTransformer.uuidMediterraneanSea))) { return STR_AREA_MEDITERRANEAN_SEA; } // abbreviated label missing
1769
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidWhiteSea)) { return STR_AREA_WHITE_SEA; }
1770
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorthSea)) { return STR_AREA_NORTH_SEA; }
1771
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBalticSea)) { return STR_AREA_BALTIC_SEA; }
1772
			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLS") ||
1773
					(namedArea.getUuid().equals(ErmsTransformer.uuidBlackSea))) { return STR_AREA_BLACK_SEA; } // abbreviated label missing
1774
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBarentsSea)) { return STR_AREA_BARENTS_SEA; }
1775
			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CAS") ||
1776
					(namedArea.getUuid().equals(ErmsTransformer.uuidCaspianSea))) { return STR_AREA_CASPIAN_SEA; } // abbreviated label missing
1777
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidPortugueseExclusiveEconomicZone)) { return STR_AREA_PORTUGUESE_EXCLUSIVE_ECONOMIC_ZONE; }
1778
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBelgianExclusiveEconomicZone)) { return STR_AREA_BELGIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1779
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidFrenchExclusiveEconomicZone)) { return STR_AREA_FRENCH_EXCLUSIVE_ECONOMIC_ZONE; }
1780
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidEnglishChannel)) { return STR_AREA_ENGLISH_CHANNEL; }
1781
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidAdriaticSea)) { return STR_AREA_ADRIATIC_SEA; }
1782
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBiscayBay)) { return STR_AREA_BISCAY_BAY; }
1783
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidDutchExclusiveEconomicZone)) { return STR_AREA_DUTCH_EXCLUSIVE_ECONOMIC_ZONE; }
1784
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidUnitedKingdomExclusiveEconomicZone)) { return STR_AREA_UNITED_KINGDOM_EXCLUSIVE_ECONOMIC_ZONE; }
1785
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSpanishExclusiveEconomicZone)) { return STR_AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE; }
1786
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidEgyptianExclusiveEconomicZone)) { return STR_AREA_EGYPTIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1787
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidGrecianExclusiveEconomicZone)) { return STR_AREA_GRECIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1788
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidTirrenoSea)) { return STR_AREA_TIRRENO_SEA; }
1789
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidIcelandicExclusiveEconomicZone)) { return STR_AREA_ICELANDIC_EXCLUSIVE_ECONOMIC_ZONE; }
1790
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidIrishExclusiveeconomicZone)) { return STR_AREA_IRISH_EXCLUSIVE_ECONOMIC_ZONE; }
1791
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidIrishSea)) { return STR_AREA_IRISH_SEA; }
1792
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidItalianExclusiveEconomicZone)) { return STR_AREA_ITALIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1793
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorwegianSea)) { return STR_AREA_NORWEGIAN_SEA; }
1794
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidMoroccanExclusiveEconomicZone)) { return STR_AREA_MOROCCAN_EXCLUSIVE_ECONOMIC_ZONE; }
1795
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorwegianExclusiveEconomicZone)) { return STR_AREA_NORWEGIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1796
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSkagerrak)) { return STR_AREA_SKAGERRAK; }
1797
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidTunisianExclusiveEconomicZone)) { return STR_AREA_TUNISIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1798
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidWaddenSea)) { return STR_AREA_WADDEN_SEA; }
1799
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBeltSea)) { return STR_AREA_BELT_SEA; }
1800
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidMarmaraSea)) { return STR_AREA_MARMARA_SEA; }
1801
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSeaofAzov)) { return STR_AREA_SEA_OF_AZOV; }
1802
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidAegeanSea)) { return STR_AREA_AEGEAN_SEA; }
1803
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBulgarianExclusiveEconomicZone)) { return STR_AREA_BULGARIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1804
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSouthBalticproper)) { return STR_AREA_SOUTH_BALTIC_PROPER; }
1805
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBalticProper)) { return STR_AREA_BALTIC_PROPER; }
1806
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorthBalticproper)) { return STR_AREA_NORTH_BALTIC_PROPER; }
1807
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidArchipelagoSea)) { return STR_AREA_ARCHIPELAGO_SEA; }
1808
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBothnianSea)) { return STR_AREA_BOTHNIAN_SEA; }
1809
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidGermanExclusiveEconomicZone)) { return STR_AREA_GERMAN_EXCLUSIVE_ECONOMIC_ZONE; }
1810
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSwedishExclusiveEconomicZone)) { return STR_AREA_SWEDISH_EXCLUSIVE_ECONOMIC_ZONE; }
1811
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidUkrainianExclusiveEconomicZone)) { return STR_AREA_UKRAINIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1812
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidMadeiranExclusiveEconomicZone)) { return STR_AREA_MADEIRAN_EXCLUSIVE_ECONOMIC_ZONE; }
1813
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidLebaneseExclusiveEconomicZone)) { return STR_AREA_LEBANESE_EXCLUSIVE_ECONOMIC_ZONE; }
1814
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSpanishExclusiveEconomicZoneMediterraneanpart)) { return STR_AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE_MEDITERRANEAN_PART; }
1815
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidEstonianExclusiveEconomicZone)) { return STR_AREA_ESTONIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1816
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidCroatianExclusiveEconomicZone)) { return STR_AREA_CROATIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1817
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBalearSea)) { return STR_AREA_BALEAR_SEA; }
1818
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidTurkishExclusiveEconomicZone)) { return STR_AREA_TURKISH_EXCLUSIVE_ECONOMIC_ZONE; }
1819
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidDanishExclusiveEconomicZone)) { return STR_AREA_DANISH_EXCLUSIVE_ECONOMIC_ZONE; }
1820
			
1821
			else {
1822
				logger.warn("Unknown NamedArea Area: " + namedArea.getTitleCache());
1823
			}
1824

    
1825
		}
1826
		return null;
1827
	}
1828
	
1829
	
1830
	@Override
1831
	public Object getKeyByNamedArea(NamedArea area) throws UndefinedTransformerMethodException {
1832
		NamedArea namedArea = CdmBase.deproxy(area, NamedArea.class);
1833

    
1834
		if (area == null) {
1835
			return null;
1836
		//TDWG areas
1837
		} else if (area.isInstanceOf(TdwgArea.class)) {
1838
			String abbrevLabel = namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel();
1839
			Integer result = this.tdwgKeyMap.get(abbrevLabel);
1840
			if (result == null){
1841
				logger.warn("Unknown TDWGArea: " + area.getTitleCache());
1842
			}
1843
			return result;
1844
		//countries & Waterbodies
1845
		}else if (namedArea.isInstanceOf(WaterbodyOrCountry.class)){
1846
			if (namedArea.equals(WaterbodyOrCountry.UKRAINE())) { return AREA_UKRAINE_INCLUDING_CRIMEA; }
1847
			else if (namedArea.equals(WaterbodyOrCountry.AZERBAIJANREPUBLICOF())) { return AREA_AZERBAIJAN_INCLUDING_NAKHICHEVAN; }
1848
			else if (namedArea.equals(WaterbodyOrCountry.GEORGIA())) { return AREA_GEORGIA; }
1849
			else if (namedArea.equals(WaterbodyOrCountry.RUSSIANFEDERATION())) { return AREA_THE_RUSSIAN_FEDERATION; }
1850
			else {
1851
				logger.warn("Unknown Waterbody/Country: " + area.getTitleCache());
1852
			}
1853
		}else{  //Non TDWG, non country
1854
			if ( namedArea.getUuid().equals(BerlinModelTransformer.uuidMadeira)){ return AREA_MADEIRA; }
1855
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidDesertas)) { return AREA_DESERTAS; }
1856
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidPortoSanto)) { return AREA_PORTO_SANTO; }
1857
			
1858
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidUssr)) { return AREA_FORMER_USSR; }
1859
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaBaltic)) { return AREA_RUSSIA_BALTIC; }
1860
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaSouthEast)) { return AREA_RUSSIA_SOUTHEAST; }
1861
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaSouthWest)) { return AREA_RUSSIA_SOUTHWEST; }
1862
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaCentral)) { return AREA_RUSSIA_CENTRAL; }
1863
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaNorthern)) { return AREA_RUSSIA_NORTHERN; }
1864
			
1865
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidTurkey)) { return AREA_TURKEY; }
1866
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidEastAegeanIslands)) { return AREA_EAST_AEGEAN_ISLANDS; }
1867
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidTurkishEastAegeanIslands)) { return AREA_TURKISH_EAST_AEGEAN_ISLANDS; }
1868
			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidFlores)) { return AREA_FLORES; }
1869
			
1870
			//FE
1871
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaAFR)) { return AREA_AFRO_TROPICAL_REGION; }
1872
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaAUS)) { return AREA_AUSTRALIAN_REGION; }
1873
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaEPA)) { return AREA_EAST_PALAEARCTIC; }
1874
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaGR_AEG)) { return AREA_NORTH_AEGEAN_ISLANDS; }
1875
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaGR_CYC)) { return AREA_CYCLADES_ISLANDS; }
1876
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaGR_DOD)) { return AREA_DODECANESE_ISLANDS; }
1877
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaNAF)) { return AREA_NORTHERN_AFRICA; }
1878
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaNEA)) { return AREA_NEARCTIC_REGION; }
1879
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaNEO)) { return AREA_NEOTROPICAL_REGION; }
1880
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaNRE)) { return AREA_NEAR_EAST; }
1881
			else if (namedArea.getUuid().equals(FaunaEuropaeaTransformer.uuidAreaORR)) { return AREA_ORIENTAL_REGION; }
1882
			
1883
			//ERMS
1884
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidEuropeanMarineWaters)) { return AREA_EUROPEAN_MARINE_WATERS; }
1885
			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("MES") ||
1886
					(namedArea.getUuid().equals(ErmsTransformer.uuidMediterraneanSea))) { return AREA_MEDITERRANEAN_SEA; } // abbreviated label missing
1887
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidWhiteSea)) { return AREA_WHITE_SEA; }
1888
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorthSea)) { return AREA_NORTH_SEA; }
1889
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBalticSea)) { return AREA_BALTIC_SEA; }
1890
			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLS") ||
1891
					(namedArea.getUuid().equals(ErmsTransformer.uuidBlackSea))) { return AREA_BLACK_SEA; } // abbreviated label missing
1892
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBarentsSea)) { return AREA_BARENTS_SEA; }
1893
			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CAS") ||
1894
					(namedArea.getUuid().equals(ErmsTransformer.uuidCaspianSea))) { return AREA_CASPIAN_SEA; } // abbreviated label missingelse if (namedArea.getUuid().equals(ErmsTransformer.uuidPortugueseExclusiveEconomicZone)) { return AREA_PORTUGUESE_EXCLUSIVE_ECONOMIC_ZONE; }
1895
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBelgianExclusiveEconomicZone)) { return AREA_BELGIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1896
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidFrenchExclusiveEconomicZone)) { return AREA_FRENCH_EXCLUSIVE_ECONOMIC_ZONE; }
1897
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidEnglishChannel)) { return AREA_ENGLISH_CHANNEL; }
1898
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidAdriaticSea)) { return AREA_ADRIATIC_SEA; }
1899
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBiscayBay)) { return AREA_BISCAY_BAY; }
1900
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidDutchExclusiveEconomicZone)) { return AREA_DUTCH_EXCLUSIVE_ECONOMIC_ZONE; }
1901
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidUnitedKingdomExclusiveEconomicZone)) { return AREA_UNITED_KINGDOM_EXCLUSIVE_ECONOMIC_ZONE; }
1902
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSpanishExclusiveEconomicZone)) { return AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE; }
1903
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidEgyptianExclusiveEconomicZone)) { return AREA_EGYPTIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1904
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidGrecianExclusiveEconomicZone)) { return AREA_GRECIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1905
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidTirrenoSea)) { return AREA_TIRRENO_SEA; }
1906
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidIcelandicExclusiveEconomicZone)) { return AREA_ICELANDIC_EXCLUSIVE_ECONOMIC_ZONE; }
1907
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidIrishExclusiveeconomicZone)) { return AREA_IRISH_EXCLUSIVE_ECONOMIC_ZONE; }
1908
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidIrishSea)) { return AREA_IRISH_SEA; }
1909
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidItalianExclusiveEconomicZone)) { return AREA_ITALIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1910
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorwegianSea)) { return AREA_NORWEGIAN_SEA; }
1911
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidMoroccanExclusiveEconomicZone)) { return AREA_MOROCCAN_EXCLUSIVE_ECONOMIC_ZONE; }
1912
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorwegianExclusiveEconomicZone)) { return AREA_NORWEGIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1913
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSkagerrak)) { return AREA_SKAGERRAK; }
1914
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidTunisianExclusiveEconomicZone)) { return AREA_TUNISIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1915
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidWaddenSea)) { return AREA_WADDEN_SEA; }
1916
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBeltSea)) { return AREA_BELT_SEA; }
1917
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidMarmaraSea)) { return AREA_MARMARA_SEA; }
1918
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSeaofAzov)) { return AREA_SEA_OF_AZOV; }
1919
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidAegeanSea)) { return AREA_AEGEAN_SEA; }
1920
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBulgarianExclusiveEconomicZone)) { return AREA_BULGARIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1921
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSouthBalticproper)) { return AREA_SOUTH_BALTIC_PROPER; }
1922
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBalticProper)) { return AREA_BALTIC_PROPER; }
1923
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorthBalticproper)) { return AREA_NORTH_BALTIC_PROPER; }
1924
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidArchipelagoSea)) { return AREA_ARCHIPELAGO_SEA; }
1925
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBothnianSea)) { return AREA_BOTHNIAN_SEA; }
1926
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidGermanExclusiveEconomicZone)) { return AREA_GERMAN_EXCLUSIVE_ECONOMIC_ZONE; }
1927
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSwedishExclusiveEconomicZone)) { return AREA_SWEDISH_EXCLUSIVE_ECONOMIC_ZONE; }
1928
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidUkrainianExclusiveEconomicZone)) { return AREA_UKRAINIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1929
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidMadeiranExclusiveEconomicZone)) { return AREA_MADEIRAN_EXCLUSIVE_ECONOMIC_ZONE; }
1930
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidLebaneseExclusiveEconomicZone)) { return AREA_LEBANESE_EXCLUSIVE_ECONOMIC_ZONE; }
1931
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSpanishExclusiveEconomicZoneMediterraneanpart)) { return AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE_MEDITERRANEAN_PART; }
1932
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidEstonianExclusiveEconomicZone)) { return AREA_ESTONIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1933
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidCroatianExclusiveEconomicZone)) { return AREA_CROATIAN_EXCLUSIVE_ECONOMIC_ZONE; }
1934
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBalearSea)) { return AREA_BALEAR_SEA; }
1935
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidTurkishExclusiveEconomicZone)) { return AREA_TURKISH_EXCLUSIVE_ECONOMIC_ZONE; }
1936
			else if (namedArea.getUuid().equals(ErmsTransformer.uuidDanishExclusiveEconomicZone)) { return AREA_DANISH_EXCLUSIVE_ECONOMIC_ZONE; }
1937

    
1938
			
1939
			else {
1940
				logger.warn("Unknown NamedArea Area: " + area.getTitleCache());
1941
			}
1942

    
1943
		}
1944
		return null;
1945
	}
1946
	
1947
	
1948
//	/**
1949
//	 * Returns the AreaId for a given Area.
1950
//	 * @param area
1951
//	 * @return
1952
//	 */
1953
//	public static Integer area2AreaId(NamedArea area) {
1954
//		NamedArea namedArea = CdmBase.deproxy(area, NamedArea.class);
1955
//
1956
//		if (area == null) {
1957
//			return null;
1958
//		} else if (area.isInstanceOf(TdwgArea.class)) {
1959
//			
1960
//			// TODO: Areas identified by the string "TODO" (for now) have to be identified correctly after additions have been made to the list of NamedArea's according to specific imports, i.e. euro+med
1961
//			if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("EAI")) { return AREA_GREEK_EAST_AEGEAN_ISLANDS; }
1962
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("EAI-OO")) { return AREA_GREEK_EAST_AEGEAN_ISLANDS; }
1963
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_TURKISH_EAST_AEGEAN_ISLANDS; }
1964
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ALB")) { return AREA_ALBANIA; }
1965
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ALB-OO")) { return AREA_ALBANIA; }
1966
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("AUT")) { return AREA_AUSTRIA_WITH_LIECHTENSTEIN; }
1967
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("AUT-AU")) { return AREA_AUSTRIA; }
1968
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("AUT-LI")) { return AREA_LIECHTENSTEIN; }
1969
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("AZO")) { return AREA_AZORES; }
1970
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("AZO-OO")) { return AREA_AZORES; }
1971
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_CORVO; }
1972
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_FAIAL; }
1973
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_GRACIOSA; }
1974
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_SAO_JORGE; }
1975
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_FLORES; }
1976
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_SAO_MIGUEL; }
1977
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_PICO; }
1978
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_SANTA_MARIA; }
1979
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_TERCEIRA; }
1980
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BGM")) { return AREA_BELGIUM_WITH_LUXEMBOURG; }
1981
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BGM-BE")) { return AREA_BELGIUM; }
1982
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BGM-LU")) { return AREA_LUXEMBOURG; }
1983
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("YUG-BH")) { return AREA_BOSNIA_HERZEGOVINA; }
1984
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BAL")) { return AREA_BALEARES; }
1985
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BAL-OO")) { return AREA_BALEARES; }
1986
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_IBIZA_WITH_FORMENTERA; }
1987
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_MALLORCA; }
1988
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_MENORCA; }
1989
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GRB")) { return AREA_GREAT_BRITAIN; }
1990
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GRB-OO")) { return AREA_GREAT_BRITAIN; }
1991
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLT")) { return AREA_BALTIC_STATES_ESTONIA_LATVIA_LITHUANIA_AND_KALININGRAD_REGION; }
1992
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BUL")) { return AREA_BULGARIA; }
1993
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BUL-OO")) { return AREA_BULGARIA; }
1994
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLR")) { return AREA_BELARUS; }
1995
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLR-OO")) { return AREA_BELARUS; }
1996
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CNY")) { return AREA_CANARY_ISLANDS; }
1997
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CNY-OO")) { return AREA_CANARY_ISLANDS; }
1998
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_GRAN_CANARIA; }
1999
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_FUERTEVENTURA_WITH_LOBOS; }
2000
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_GOMERA; }
2001
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_HIERRO; }
2002
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_LANZAROTE_WITH_GRACIOSA; }
2003
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_LA_PALMA; }
2004
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_TENERIFE; }
2005
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("YUG-MN")) { return AREA_MONTENEGRO; }
2006
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("COR")) { return AREA_CORSE; }
2007
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("COR-OO")) { return AREA_CORSE; }
2008
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("KRI")) { return AREA_CRETE_WITH_KARPATHOS_KASOS_AND_GAVDHOS; }
2009
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("KRI-OO")) { return AREA_CRETE_WITH_KARPATHOS_KASOS_AND_GAVDHOS; }
2010
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CZE-CZ")) { return AREA_CZECH_REPUBLIC; }
2011
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("YUG-CR")) { return AREA_CROATIA; }
2012
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CYP")) { return AREA_CYPRUS; }
2013
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CYP-OO")) { return AREA_CYPRUS; }
2014
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CZE")) { return AREA_FORMER_CZECHOSLOVAKIA; }
2015
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("DEN")) { return AREA_DENMARK_WITH_BORNHOLM; }
2016
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("DEN-OO")) { return AREA_DENMARK_WITH_BORNHOLM; }
2017
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLT-ES")) { return AREA_ESTONIA; }
2018
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("FOR")) { return AREA_FAROE_ISLANDS; }
2019
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("FOR-OO")) { return AREA_FAROE_ISLANDS; }
2020
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("FIN")) { return AREA_FINLAND_WITH_AHVENANMAA; }
2021
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("FIN-OO")) { return AREA_FINLAND_WITH_AHVENANMAA; }
2022
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("FRA")) { return AREA_FRANCE; }
2023
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("FRA-CI")) { return AREA_CHANNEL_ISLANDS; }
2024
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("FRA-FR")) { return AREA_FRENCH_MAINLAND; }
2025
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("FRA-MO")) { return AREA_MONACO; }
2026
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GER")) { return AREA_GERMANY; }
2027
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GER-OO")) { return AREA_GERMANY; }
2028
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GRC")) { return AREA_GREECE_WITH_CYCLADES_AND_MORE_ISLANDS; }
2029
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GRC-OO")) { return AREA_GREECE_WITH_CYCLADES_AND_MORE_ISLANDS; }
2030
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("IRE")) { return AREA_IRELAND; }
2031
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("IRE-IR")) { return AREA_REPUBLIC_OF_IRELAND; }
2032
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("IRE-NI")) { return AREA_NORTHERN_IRELAND; }
2033
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SWI")) { return AREA_SWITZERLAND; }
2034
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SWI-OO")) { return AREA_SWITZERLAND; }
2035
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("NET")) { return AREA_NETHERLANDS; }
2036
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("NET-OO")) { return AREA_NETHERLANDS; }
2037
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SPA")) { return AREA_SPAIN; }
2038
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SPA-AN")) { return AREA_ANDORRA; }
2039
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SPA-GI")) { return AREA_GIBRALTAR; }
2040
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SPA-SP")) { return AREA_KINGDOM_OF_SPAIN; }
2041
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("HUN")) { return AREA_HUNGARY; }
2042
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("HUN-OO")) { return AREA_HUNGARY; }
2043
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ICE")) { return AREA_ICELAND; }
2044
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ICE-OO")) { return AREA_ICELAND; }
2045
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ITA")) { return AREA_ITALY; }
2046
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ITA-IT")) { return AREA_ITALIAN_MAINLAND; }
2047
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ITA-SM")) { return AREA_SAN_MARINO; }
2048
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("YUG")) { return AREA_FORMER_JUGOSLAVIA; }
2049
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLT-LA")) { return AREA_LATVIA; }
2050
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLT-LI")) { return AREA_LITHUANIA; }
2051
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("POR")) { return AREA_PORTUGUESE_MAINLAND; }
2052
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("POR-OO")) { return AREA_PORTUGUESE_MAINLAND; }
2053
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("MDR")) { return AREA_MADEIRA_ARCHIPELAGO; }
2054
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("MDR-OO")) { return AREA_MADEIRA_ARCHIPELAGO; }
2055
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("YUG-MA")) { return AREA_THE_FORMER_JUGOSLAV_REPUBLIC_OF_MAKEDONIJA; }
2056
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("UKR-MO")) { return AREA_MOLDOVA; }
2057
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("NOR")) { return AREA_NORWEGIAN_MAINLAND; }
2058
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("NOR-OO")) { return AREA_NORWEGIAN_MAINLAND; }
2059
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("POL")) { return AREA_POLAND; }
2060
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("POL-OO")) { return AREA_POLAND; }
2061
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUS")) { return AREA_THE_RUSSIAN_FEDERATION; }
2062
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("WSB")) { return AREA_NOVAYA_ZEMLYA_AND_FRANZ_JOSEPH_LAND; }
2063
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("WSB-OO")) { return AREA_NOVAYA_ZEMLYA_AND_FRANZ_JOSEPH_LAND; }
2064
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUC")) { return AREA_CENTRAL_EUROPEAN_RUSSIA; }
2065
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUC-OO")) { return AREA_CENTRAL_EUROPEAN_RUSSIA; }
2066
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUE")) { return AREA_EASTERN_EUROPEAN_RUSSIA; }
2067
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUE-OO")) { return AREA_EASTERN_EUROPEAN_RUSSIA; }
2068
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLT-KA")) { return AREA_KALININGRAD; }
2069
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUN")) { return AREA_NORTHERN_EUROPEAN_RUSSIA; }
2070
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUN-OO")) { return AREA_NORTHERN_EUROPEAN_RUSSIA; }
2071
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUW")) { return AREA_NORTHWEST_EUROPEAN_RUSSIA; }
2072
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUW-OO")) { return AREA_NORTHWEST_EUROPEAN_RUSSIA; }
2073
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUS")) { return AREA_SOUTH_EUROPEAN_RUSSIA; }
2074
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("RUS-OO")) { return AREA_SOUTH_EUROPEAN_RUSSIA; }
2075
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ROM")) { return AREA_ROMANIA; }
2076
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ROM-OO")) { return AREA_ROMANIA; }
2077
//			
2078
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SAR")) { return AREA_SARDEGNA; }
2079
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SAR-OO")) { return AREA_SARDEGNA; }
2080
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SVA")) { return AREA_SVALBARD_WITH_BJORNOYA_AND_JAN_MAYEN; }
2081
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SVA-OO")) { return AREA_SVALBARD_WITH_BJORNOYA_AND_JAN_MAYEN; }
2082
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SEL")) { return AREA_SELVAGENS_ISLANDS; }
2083
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SEL-OO")) { return AREA_SELVAGENS_ISLANDS; }
2084
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SIC")) { return AREA_SICILY_WITH_MALTA; }
2085
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SIC-MA")) { return AREA_MALTA; }
2086
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SIC-SI")) { return AREA_SICILY; }
2087
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CZE-SK")) { return AREA_SLOVAKIA; }
2088
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("YUG-SL")) { return AREA_SLOVENIA; }
2089
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CS")) { return AREA_SERBIA_WITH_MONTENEGRO; }
2090
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("YUG-SE")) { return AREA_SERBIA_INCLUDING_VOJVODINA_AND_WITH_KOSOVO; }
2091
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SWE")) { return AREA_SWEDEN; }
2092
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SWE-OO")) { return AREA_SWEDEN; }
2093
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TUE")) { return AREA_EUROPEAN_TURKEY; }
2094
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TUE-OO")) { return AREA_EUROPEAN_TURKEY; }
2095
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("KRY")) { return AREA_CRIMEA; }
2096
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("KRY-OO")) { return AREA_CRIMEA; }
2097
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("UKR-UK")) { return AREA_UKRAINE; }
2098
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GRE")) { return AREA_GREEK_MAINLAND; }
2099
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GR-KRI")) { return AREA_CRETE; }
2100
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GR-DOD")) { return AREA_DODECANESE_ISLANDS; }
2101
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GR-CYC")) { return AREA_CYCLADES_ISLANDS; }
2102
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("GR-AEG")) { return AREA_NORTH_AEGEAN_ISLANDS; }
2103
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ITA-VC")) { return AREA_VATICAN_CITY; }
2104
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_FRANZ_JOSEF_LAND; }
2105
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_NOVAYA_ZEMLYA; }
2106
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TCS-AZ")) { return AREA_AZERBAIJAN; }
2107
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TCS-NA")) { return AREA_NAKHICHEVAN; }
2108
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ALG")) { return AREA_ALGERIA; }
2109
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ALG-OO")) { return AREA_ALGERIA; }
2110
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TCS-AR")) { return AREA_ARMENIA; }
2111
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("33")) { return AREA_CAUCASUS_REGION; }
2112
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("EGY")) { return AREA_EGYPT; }
2113
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("EGY-OO")) { return AREA_EGYPT; }
2114
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("PAL")) { return AREA_ISRAEL_JORDAN; }
2115
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("PAL-IS")) { return AREA_ISRAEL; }
2116
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("PAL-JO")) { return AREA_JORDAN; }
2117
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("LBS-LB")) { return AREA_LEBANON; }
2118
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("LBY-OO")) { return AREA_LIBYA; }
2119
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("LBS")) { return AREA_LEBANON_SYRIA; }
2120
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("MOR")) { return AREA_MOROCCO; }
2121
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("MOR-OO")) { return AREA_MOROCCO; }
2122
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("NCS")) { return AREA_NORTH_CAUCASUS; }
2123
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SIN")) { return AREA_SINAI; }
2124
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("SIN-OO")) { return AREA_SINAI; }
2125
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("LBS-SY")) { return AREA_SYRIA; }
2126
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TUN")) { return AREA_TUNISIA; }
2127
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TUN-OO")) { return AREA_TUNISIA; }
2128
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_ASIATIC_TURKEY; }
2129
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TUR-OO")) { return AREA_ASIATIC_TURKEY; }
2130
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("20")) { return AREA_NORTHERN_AFRICA; }
2131
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("AFR")) { return AREA_AFRO_TROPICAL_REGION; }
2132
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("AUS")) { return AREA_AUSTRALIAN_REGION; }
2133
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TODO")) { return AREA_EAST_PALAEARCTIC; }
2134
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("NEA")) { return AREA_NEARCTIC_REGION; }
2135
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("NEO")) { return AREA_NEOTROPICAL_REGION; }
2136
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("NRE")) { return AREA_NEAR_EAST; }
2137
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("ORR")) { return AREA_ORIENTAL_REGION; }
2138
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("TCS")) { return AREA_TRANSCAUCASUS; }
2139
//			
2140
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidEuropeanMarineWaters)) { return AREA_EUROPEAN_MARINE_WATERS; }
2141
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("MES") ||
2142
//					(namedArea.getUuid().equals(ErmsTransformer.uuidMediterraneanSea))) { return AREA_MEDITERRANEAN_SEA; } // abbreviated label missing
2143
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidWhiteSea)) { return AREA_WHITE_SEA; }
2144
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorthSea)) { return AREA_NORTH_SEA; }
2145
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBalticSea)) { return AREA_BALTIC_SEA; }
2146
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("BLS") ||
2147
//					(namedArea.getUuid().equals(ErmsTransformer.uuidBlackSea))) { return AREA_BLACK_SEA; } // abbreviated label missing
2148
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBarentsSea)) { return AREA_BARENTS_SEA; }
2149
//			else if ((namedArea.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel()).equals("CAS") ||
2150
//					(namedArea.getUuid().equals(ErmsTransformer.uuidCaspianSea))) { return AREA_CASPIAN_SEA; } // abbreviated label missing
2151
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidPortugueseExclusiveEconomicZone)) { return AREA_PORTUGUESE_EXCLUSIVE_ECONOMIC_ZONE; }
2152
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBelgianExclusiveEconomicZone)) { return AREA_BELGIAN_EXCLUSIVE_ECONOMIC_ZONE; }
2153
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidFrenchExclusiveEconomicZone)) { return AREA_FRENCH_EXCLUSIVE_ECONOMIC_ZONE; }
2154
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidEnglishChannel)) { return AREA_ENGLISH_CHANNEL; }
2155
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidAdriaticSea)) { return AREA_ADRIATIC_SEA; }
2156
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBiscayBay)) { return AREA_BISCAY_BAY; }
2157
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidDutchExclusiveEconomicZone)) { return AREA_DUTCH_EXCLUSIVE_ECONOMIC_ZONE; }
2158
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidUnitedKingdomExclusiveEconomicZone)) { return AREA_UNITED_KINGDOM_EXCLUSIVE_ECONOMIC_ZONE; }
2159
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSpanishExclusiveEconomicZone)) { return AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE; }
2160
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidEgyptianExclusiveEconomicZone)) { return AREA_EGYPTIAN_EXCLUSIVE_ECONOMIC_ZONE; }
2161
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidGrecianExclusiveEconomicZone)) { return AREA_GRECIAN_EXCLUSIVE_ECONOMIC_ZONE; }
2162
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidTirrenoSea)) { return AREA_TIRRENO_SEA; }
2163
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidIcelandicExclusiveEconomicZone)) { return AREA_ICELANDIC_EXCLUSIVE_ECONOMIC_ZONE; }
2164
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidIrishExclusiveeconomicZone)) { return AREA_IRISH_EXCLUSIVE_ECONOMIC_ZONE; }
2165
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidIrishSea)) { return AREA_IRISH_SEA; }
2166
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidItalianExclusiveEconomicZone)) { return AREA_ITALIAN_EXCLUSIVE_ECONOMIC_ZONE; }
2167
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorwegianSea)) { return AREA_NORWEGIAN_SEA; }
2168
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidMoroccanExclusiveEconomicZone)) { return AREA_MOROCCAN_EXCLUSIVE_ECONOMIC_ZONE; }
2169
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorwegianExclusiveEconomicZone)) { return AREA_NORWEGIAN_EXCLUSIVE_ECONOMIC_ZONE; }
2170
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSkagerrak)) { return AREA_SKAGERRAK; }
2171
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidTunisianExclusiveEconomicZone)) { return AREA_TUNISIAN_EXCLUSIVE_ECONOMIC_ZONE; }
2172
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidWaddenSea)) { return AREA_WADDEN_SEA; }
2173
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBeltSea)) { return AREA_BELT_SEA; }
2174
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidMarmaraSea)) { return AREA_MARMARA_SEA; }
2175
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSeaofAzov)) { return AREA_SEA_OF_AZOV; }
2176
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidAegeanSea)) { return AREA_AEGEAN_SEA; }
2177
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBulgarianExclusiveEconomicZone)) { return AREA_BULGARIAN_EXCLUSIVE_ECONOMIC_ZONE; }
2178
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSouthBalticproper)) { return AREA_SOUTH_BALTIC_PROPER; }
2179
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBalticProper)) { return AREA_BALTIC_PROPER; }
2180
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidNorthBalticproper)) { return AREA_NORTH_BALTIC_PROPER; }
2181
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidArchipelagoSea)) { return AREA_ARCHIPELAGO_SEA; }
2182
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBothnianSea)) { return AREA_BOTHNIAN_SEA; }
2183
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidGermanExclusiveEconomicZone)) { return AREA_GERMAN_EXCLUSIVE_ECONOMIC_ZONE; }
2184
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSwedishExclusiveEconomicZone)) { return AREA_SWEDISH_EXCLUSIVE_ECONOMIC_ZONE; }
2185
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidUkrainianExclusiveEconomicZone)) { return AREA_UKRAINIAN_EXCLUSIVE_ECONOMIC_ZONE; }
2186
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidMadeiranExclusiveEconomicZone)) { return AREA_MADEIRAN_EXCLUSIVE_ECONOMIC_ZONE; }
2187
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidLebaneseExclusiveEconomicZone)) { return AREA_LEBANESE_EXCLUSIVE_ECONOMIC_ZONE; }
2188
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidSpanishExclusiveEconomicZoneMediterraneanpart)) { return AREA_SPANISH_EXCLUSIVE_ECONOMIC_ZONE_MEDITERRANEAN_PART; }
2189
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidEstonianExclusiveEconomicZone)) { return AREA_ESTONIAN_EXCLUSIVE_ECONOMIC_ZONE; }
2190
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidCroatianExclusiveEconomicZone)) { return AREA_CROATIAN_EXCLUSIVE_ECONOMIC_ZONE; }
2191
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidBalearSea)) { return AREA_BALEAR_SEA; }
2192
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidTurkishExclusiveEconomicZone)) { return AREA_TURKISH_EXCLUSIVE_ECONOMIC_ZONE; }
2193
//			else if (namedArea.getUuid().equals(ErmsTransformer.uuidDanishExclusiveEconomicZone)) { return AREA_DANISH_EXCLUSIVE_ECONOMIC_ZONE; }
2194
//			else {
2195
//				logger.warn("Unknown TDWGArea: " + area.getTitleCache());
2196
//			}
2197
//		}else if (namedArea.isInstanceOf(WaterbodyOrCountry.class)){
2198
//			if (namedArea.equals(WaterbodyOrCountry.UKRAINE())) { return AREA_UKRAINE_INCLUDING_CRIMEA; }
2199
//			else if (namedArea.equals(WaterbodyOrCountry.AZERBAIJANREPUBLICOF())) { return AREA_AZERBAIJAN_INCLUDING_NAKHICHEVAN; }
2200
//			else if (namedArea.equals(WaterbodyOrCountry.GEORGIA())) { return AREA_GEORGIA; }
2201
//			else {
2202
//				logger.warn("Unknown Waterbody/Country: " + area.getTitleCache());
2203
//			}
2204
//		}else{  //Non TDWG
2205
//			if ( namedArea.getUuid().equals(BerlinModelTransformer.uuidMadeira)){ return AREA_MADEIRA; }
2206
//			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidDesertas)) { return AREA_DESERTAS; }
2207
//			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidPortoSanto)) { return AREA_PORTO_SANTO; }
2208
//			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaBaltic)) { return AREA_RUSSIA_BALTIC; }
2209
//			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaSouthEast)) { return AREA_RUSSIA_SOUTHEAST; }
2210
//			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaSouthWest)) { return AREA_RUSSIA_SOUTHWEST; }
2211
//			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidUssr)) { return AREA_FORMER_USSR; }
2212
//			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaCentral)) { return AREA_RUSSIA_CENTRAL; }
2213
//			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidRussiaNorthern)) { return AREA_RUSSIA_NORTHERN; }
2214
//			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidTurkey)) { return AREA_TURKEY; }
2215
//			else if (namedArea.getUuid().equals(BerlinModelTransformer.uuidEastAegeanIslands)) { return AREA_EAST_AEGEAN_ISLANDS; }
2216
//			
2217
//			else {
2218
//				logger.warn("Unknown NamedArea Area: " + area.getTitleCache());
2219
//			}
2220
//
2221
//		}
2222
//		return null;
2223
//
2224
//	}
2225

    
2226
	/**
2227
	 * Returns the PESI SourceUseId for a given CDM sourceUseId.
2228
	 * @param sourceUseId
2229
	 * @return
2230
	 */
2231
	public static Integer sourceUseIdSourceUseId(Integer sourceUseId) {
2232
		// TODO: CDM sourceUseId and PESI sourceUseId are equal for now.
2233
		Integer result = null;
2234
		switch (sourceUseId) {
2235
			case 3: return ADDITIONAL_SOURCE;
2236
			case 4: return SOURCE_OF_SYNONYMY;
2237
			case 8: return NOMENCLATURAL_REFERENCE;
2238
		}
2239
		return result;
2240
	}
2241
	
2242
	/**
2243
	 * Returns the SourceUseCache for a tiven sourceUseId.
2244
	 * @param sourceUseId
2245
	 * @return
2246
	 */
2247
	public static String sourceUseId2SourceUseCache(Integer sourceUseId) {
2248
		// TODO: CDM sourceUseId and PESI sourceUseId are equal for now.
2249
		String result = null;
2250
		switch (sourceUseId) {
2251
			case 3: return STR_ADDITIONAL_SOURCE;
2252
			case 4: return STR_SOURCE_OF_SYNONYMY;
2253
			case 8: return STR_NOMENCLATURAL_REFERENCE;
2254
		}
2255
		return result;
2256
	}
2257
	
2258
	/**
2259
	 * Returns the FossilStatusCache to a given Fossil.
2260
	 * @param fossil
2261
	 * @return
2262
	 */
2263
	public static String fossil2FossilStatusCache(Fossil fossil) {
2264
		String result = null;
2265
		return result;
2266
	}
2267

    
2268
	/**
2269
	 * Returns the FossilStatusId to a given Fossil.
2270
	 * @param fossil
2271
	 * @return
2272
	 */
2273
	public static Integer fossil2FossilStatusId(Fossil fossil) {
2274
		Integer result = null;
2275
		return result;
2276
	}
2277
	
2278
	
2279
	
2280
	@Override
2281
	public Object getKeyByLanguage(Language language) throws UndefinedTransformerMethodException {
2282
		return language2LanguageId(language);
2283
	}
2284

    
2285
	@Override
2286
	public String getCacheByLanguage(Language language) throws UndefinedTransformerMethodException {
2287
		return language2LanguageCache(language);
2288
	}
2289

    
2290
	/**
2291
	 * Returns the LanguageCache to a given Language.
2292
	 * @param language
2293
	 * @return
2294
	 */
2295
	public static String language2LanguageCache(Language language) {
2296
		if (language == null ) {
2297
			return null;
2298
		}
2299
		if (language.equals(Language.ALBANIAN())) {
2300
			return STR_LANGUAGE_ALBANIAN;
2301
		} else if (language.equals(Language.ARABIC())) {
2302
			return STR_LANGUAGE_ARABIC;
2303
		} else if (language.equals(Language.ARMENIAN())) {
2304
			return STR_LANGUAGE_ARMENIAN;
2305
		} else if (language.equals(Language.AZERBAIJANI())) {
2306
			return STR_LANGUAGE_AZERBAIJAN;
2307
		} else if (language.equals(Language.BELORUSSIAN())) {
2308
			return STR_LANGUAGE_BELARUSIAN;
2309
		} else if (language.equals(Language.BULGARIAN())) {
2310
			return STR_LANGUAGE_BULGARIAN;
2311
		} else if (language.equals(Language.CATALAN_VALENCIAN())) {
2312
			return STR_LANGUAGE_CATALAN;
2313
		} else if (language.equals(Language.CROATIAN())) {
2314
			return STR_LANGUAGE_CROAT;
2315
		} else if (language.equals(Language.CZECH())) {
2316
			return STR_LANGUAGE_CZECH;
2317
		} else if (language.equals(Language.DANISH())) {
2318
			return STR_LANGUAGE_DANISH;
2319
		} else if (language.equals(Language.DUTCH_MIDDLE())) {
2320
			return STR_LANGUAGE_DUTCH;
2321
		} else if (language.equals(Language.ENGLISH())) {
2322
			return STR_LANGUAGE_ENGLISH;
2323
//		} else if (language.equals(Language.)) {
2324
//			return STR_LANGUAGE_EUSKERA;
2325
		} else if (language.equals(Language.ESTONIAN())) {
2326
			return STR_LANGUAGE_ESTONIAN;
2327
		} else if (language.equals(Language.FINNISH())) {
2328
			return STR_LANGUAGE_FINNISH;
2329
		} else if (language.equals(Language.FRENCH())) {
2330
			return STR_LANGUAGE_FRENCH;
2331
		} else if (language.equals(Language.GEORGIAN())) {
2332
			return STR_LANGUAGE_GEORGIAN;
2333
		} else if (language.equals(Language.GERMAN())) {
2334
			return STR_LANGUAGE_GERMAN;
2335
		} else if (language.equals(Language.GREEK_MODERN())) {
2336
			return STR_LANGUAGE_GREEK;
2337
		} else if (language.equals(Language.HUNGARIAN())) {
2338
			return STR_LANGUAGE_HUNGARIAN;
2339
		} else if (language.equals(Language.ICELANDIC())) {
2340
			return STR_LANGUAGE_ICELANDIC;
2341
		} else if (language.equals(Language.IRISH())) {
2342
			return STR_LANGUAGE_IRISH_GAELIC;
2343
		} else if (language.equals(Language.HEBREW())) {
2344
			return STR_LANGUAGE_ISRAEL_HEBREW;
2345
		} else if (language.equals(Language.ITALIAN())) {
2346
			return STR_LANGUAGE_ITALIAN;
2347
		} else if (language.equals(Language.LATVIAN())) {
2348
			return STR_LANGUAGE_LATVIAN;
2349
		} else if (language.equals(Language.LITHUANIAN())) {
2350
			return STR_LANGUAGE_LITHUANIAN;
2351
		} else if (language.equals(Language.MACEDONIAN())) {
2352
			return STR_LANGUAGE_MACEDONIAN;
2353
		} else if (language.equals(Language.MALTESE())) {
2354
			return STR_LANGUAGE_MALTESE;
2355
		} else if (language.equals(Language.MOLDAVIAN())) {
2356
			return STR_LANGUAGE_MOLDOVIAN;
2357
		} else if (language.equals(Language.NORWEGIAN())) {
2358
			return STR_LANGUAGE_NORWEGIAN;
2359
		} else if (language.equals(Language.POLISH())) {
2360
			return STR_LANGUAGE_POLISH;
2361
		} else if (language.equals(Language.PORTUGUESE())) {
2362
			return STR_LANGUAGE_PORTUGUESE;
2363
		} else if (language.equals(Language.ROMANIAN())) {
2364
			return STR_LANGUAGE_ROUMANIAN;
2365
		} else if (language.equals(Language.RUSSIAN())) {
2366
			return STR_LANGUAGE_RUSSIAN;
2367
//		} else if (language.equals(Language.)) {
2368
//			return STR_LANGUAGE_RUSSIAN_CAUCASIAN;
2369
//		} else if (language.equals(Language.)) {
2370
//			return STR_LANGUAGE_RUSSIAN_ALTAIC_KALMYK_OIRAT;
2371
//		} else if (language.equals(Language.)) {
2372
//			return STR_LANGUAGE_RUSSIAN_ALTAIC_KARACHAY_BALKAR;
2373
//		} else if (language.equals(Language.)) {
2374
//			return STR_LANGUAGE_RUSSIAN_ALTAIC_KUMYK;
2375
//		} else if (language.equals(Language.)) {
2376
//			return STR_LANGUAGE_RUSSIAN_ALTAIC_NOGAI;
2377
//		} else if (language.equals(Language.)) {
2378
//			return STR_LANGUAGE_RUSSIAN_ALTAIC_NORTH_AZERBAIJANI;
2379
//		} else if (language.equals(Language.)) {
2380
//			return STR_LANGUAGE_RUSSIAN_INDO_EUROPEAN_RUSSIAN;
2381
//		} else if (language.equals(Language.)) {
2382
//			return STR_LANGUAGE_RUSSIAN_INDO_EUROPEAN_KALMYK_OIRAT;
2383
//		} else if (language.equals(Language.)) {
2384
//			return STR_LANGUAGE_RUSSIAN_INDO_EUROPEAN_OSETIN;
2385
//		} else if (language.equals(Language.)) {
2386
//			return STR_LANGUAGE_RUSSIAN_NORTH_CAUCASIAN_ABAZA;
2387
//		} else if (language.equals(Language.)) {
2388
//			return STR_LANGUAGE_RUSSIAN_NORTH_CAUCASIAN_ADYGHE;
2389
//		} else if (language.equals(Language.)) {
2390
//			return STR_LANGUAGE_RUSSIAN_NORTH_CAUCASIAN_CHECHEN;
2391
//		} else if (language.equals(Language.)) {
2392
//			return STR_LANGUAGE_RUSSIAN_NORTH_CAUCASIAN_KABARDIAN;
2393
//		} else if (language.equals(Language.)) {
2394
//			return STR_LANGUAGE_RUSSIAN_NORTH_CAUCASIAN_LAK;
2395
//		} else if (language.equals(Language.)) {
2396
//			return STR_LANGUAGE_RUSSIAN_NORTH_CAUCASIAN_AVAR;
2397
//		} else if (language.equals(Language.)) {
2398
//			return STR_LANGUAGE_RUSSIAN_NORTH_CAUCASIAN_IN;
2399
//		} else if (language.equals(Language.)) {
2400
//			return STR_LANGUAGE_RUSSIAN_URALIC_CHUVASH;
2401
//		} else if (language.equals(Language.)) {
2402
//			return STR_LANGUAGE_RUSSIAN_URALIC_UDMURT;
2403
		} else if (language.equals(Language.SERBIAN())) {
2404
			return STR_LANGUAGE_SERBIAN;
2405
		} else if (language.equals(Language.SLOVAK())) {
2406
			return STR_LANGUAGE_SLOVAK;
2407
		} else if (language.equals(Language.SLOVENIAN())) {
2408
			return STR_LANGUAGE_SLOVENE;
2409
		} else if (language.equals(Language.SPANISH_CATALAN())) {
2410
			return STR_LANGUAGE_SPANISH_CASTILLIAN;
2411
		} else if (language.equals(Language.SWEDISH())) {
2412
			return STR_LANGUAGE_SWEDISH;
2413
		} else if (language.equals(Language.TURKISH())) {
2414
			return STR_LANGUAGE_TURKISH;
2415
		} else if (language.equals(Language.UKRAINIAN())) {
2416
			return STR_LANGUAGE_UKRAINE;
2417
		} else if (language.equals(Language.WELSH())) {
2418
			return STR_LANGUAGE_WELSH;
2419
		} else if (language.equals(Language.CORSICAN())) {
2420
			return STR_LANGUAGE_CORSICAN;
2421
		} else {
2422
			logger.debug("Unknown Language: " + language.getTitleCache());
2423
			return null;
2424
		}
2425
	}
2426
	
2427
	/**
2428
	 * Returns the identifier of the given Language.
2429
	 * @param language
2430
	 * @return
2431
	 */
2432
	public static Integer language2LanguageId(Language language) {
2433
		if (language == null ) {
2434
			return null;
2435
		}
2436
		if (language.equals(Language.ALBANIAN())) {
2437
			return Language_Albanian;
2438
		} else if (language.equals(Language.ARABIC())) {
2439
			return Language_Arabic;
2440
		} else if (language.equals(Language.ARMENIAN())) {
2441
			return Language_Armenian;
2442
		} else if (language.equals(Language.AZERBAIJANI())) {
2443
			return Language_Azerbaijan;
2444
		} else if (language.equals(Language.BELORUSSIAN())) {
2445
			return Language_Belarusian;
2446
		} else if (language.equals(Language.BULGARIAN())) {
2447
			return Language_Bulgarian;
2448
		} else if (language.equals(Language.CATALAN_VALENCIAN())) {
2449
			return Language_Catalan;
2450
		} else if (language.equals(Language.CROATIAN())) {
2451
			return Language_Croat;
2452
		} else if (language.equals(Language.CZECH())) {
2453
			return Language_Czech;
2454
		} else if (language.equals(Language.DANISH())) {
2455
			return Language_Danish;
2456
		} else if (language.equals(Language.DUTCH_MIDDLE())) {
2457
			return Language_Dutch;
2458
		} else if (language.equals(Language.ENGLISH())) {
2459
			return Language_English;
2460
//		} else if (language.equals(Language.)) {
2461
//			return Language_Euskera;
2462
		} else if (language.equals(Language.ESTONIAN())) {
2463
			return Language_Estonian;
2464
		} else if (language.equals(Language.FINNISH())) {
2465
			return Language_Finnish;
2466
		} else if (language.equals(Language.FRENCH())) {
2467
			return Language_French;
2468
		} else if (language.equals(Language.GEORGIAN())) {
2469
			return Language_Georgian;
2470
		} else if (language.equals(Language.GERMAN())) {
2471
			return Language_German;
2472
		} else if (language.equals(Language.GREEK_MODERN())) {
2473
			return Language_Greek;
2474
		} else if (language.equals(Language.HUNGARIAN())) {
2475
			return Language_Hungarian;
2476
		} else if (language.equals(Language.ICELANDIC())) {
2477
			return Language_Icelandic;
2478
		} else if (language.equals(Language.IRISH())) {
2479
			return Language_Irish_Gaelic;
2480
		} else if (language.equals(Language.HEBREW())) {
2481
			return Language_Israel_Hebrew;
2482
		} else if (language.equals(Language.ITALIAN())) {
2483
			return Language_Italian;
2484
		} else if (language.equals(Language.LATVIAN())) {
2485
			return Language_Latvian;
2486
		} else if (language.equals(Language.LITHUANIAN())) {
2487
			return Language_Lithuanian;
2488
		} else if (language.equals(Language.MACEDONIAN())) {
2489
			return Language_Macedonian;
2490
		} else if (language.equals(Language.MALTESE())) {
2491
			return Language_Maltese;
2492
		} else if (language.equals(Language.MOLDAVIAN())) {
2493
			return Language_Moldovian;
2494
		} else if (language.equals(Language.NORWEGIAN())) {
2495
			return Language_Norwegian;
2496
		} else if (language.equals(Language.POLISH())) {
2497
			return Language_Polish;
2498
		} else if (language.equals(Language.PORTUGUESE())) {
2499
			return Language_Portuguese;
2500
		} else if (language.equals(Language.ROMANIAN())) {
2501
			return Language_Roumanian;
2502
		} else if (language.equals(Language.RUSSIAN())) {
2503
			return Language_Russian;
2504
//		} else if (language.equals(Language.)) {
2505
//			return Language_Russian_Caucasian;
2506
//		} else if (language.equals(Language.)) {
2507
//			return Language_Russian_Altaic_kalmyk_oirat;
2508
//		} else if (language.equals(Language.)) {
2509
//			return Language_Russian_Altaic_karachay_balkar;
2510
//		} else if (language.equals(Language.)) {
2511
//			return Language_Russian_Altaic_kumyk;
2512
//		} else if (language.equals(Language.)) {
2513
//			return Language_Russian_Altaic_nogai;
2514
//		} else if (language.equals(Language.)) {
2515
//			return Language_Russian_Altaic_north_azerbaijani;
2516
//		} else if (language.equals(Language.)) {
2517
//			return Language_Russian_Indo_european_russian;
2518
//		} else if (language.equals(Language.)) {
2519
//			return Language_Russian_Indo_european_kalmyk_oirat;
2520
//		} else if (language.equals(Language.)) {
2521
//			return Language_Russian_Indo_european_osetin;
2522
//		} else if (language.equals(Language.)) {
2523
//			return Language_Russian_North_caucasian_abaza;
2524
//		} else if (language.equals(Language.)) {
2525
//			return Language_Russian_North_caucasian_adyghe;
2526
//		} else if (language.equals(Language.)) {
2527
//			return Language_Russian_North_caucasian_chechen;
2528
//		} else if (language.equals(Language.)) {
2529
//			return Language_Russian_North_caucasian_kabardian;
2530
//		} else if (language.equals(Language.)) {
2531
//			return Language_Russian_North_caucasian_lak;
2532
//		} else if (language.equals(Language.)) {
2533
//			return Language_Russian_North_caucasian_avar;
2534
//		} else if (language.equals(Language.)) {
2535
//			return Language_Russian_North_caucasian_in;
2536
//		} else if (language.equals(Language.)) {
2537
//			return Language_Russian_Uralic_chuvash;
2538
//		} else if (language.equals(Language.)) {
2539
//			return Language_Russian_Uralic_udmurt;
2540
		} else if (language.equals(Language.SERBIAN())) {
2541
			return Language_Serbian;
2542
		} else if (language.equals(Language.SLOVAK())) {
2543
			return Language_Slovak;
2544
		} else if (language.equals(Language.SLOVENIAN())) {
2545
			return Language_Slovene;
2546
		} else if (language.equals(Language.SPANISH_CATALAN())) {
2547
			return Language_Spanish_Castillian;
2548
		} else if (language.equals(Language.SWEDISH())) {
2549
			return Language_Swedish;
2550
		} else if (language.equals(Language.TURKISH())) {
2551
			return Language_Turkish;
2552
		} else if (language.equals(Language.UKRAINIAN())) {
2553
			return Language_Ukraine;
2554
		} else if (language.equals(Language.WELSH())) {
2555
			return Language_Welsh;
2556
		} else if (language.equals(Language.CORSICAN())) {
2557
			return Language_Corsican;
2558
		} else {
2559
			logger.debug("Unknown Language: " + language.getTitleCache());
2560
			return null;
2561
		}
2562
	}
2563
	
2564
	/**
2565
	 * Returns the NodeCategoryCache for a given TextData.
2566
	 * @param feature
2567
	 * @return
2568
	 */
2569
	public static String textData2NodeCategoryCache(Feature feature) {
2570
		if (feature == null) {
2571
			return null;
2572
		}
2573
		
2574
		if (feature.equals(Feature.DESCRIPTION())) {
2575
			return NoteCategory_STR_description;
2576
		} else if (feature.equals(Feature.ECOLOGY())) {
2577
			return NoteCategory_STR_ecology;
2578
		} else if (feature.equals(Feature.PHENOLOGY())) {
2579
			return NoteCategory_STR_phenology;
2580
		} else if (feature.equals(Feature.COMMON_NAME())) {
2581
			return NoteCategory_STR_Common_names;
2582
		} else if (feature.equals(Feature.OCCURRENCE())) {
2583
			return NoteCategory_STR_Occurrence;
2584
		} else if (feature.getUuid().equals(ErmsTransformer.uuidRemark)) {
2585
			return NoteCategory_STR_Remark;
2586
		} else if (feature.getUuid().equals(ErmsTransformer.uuidAdditionalinformation)) {
2587
			return NoteCategory_STR_Additional_information;
2588
		} else if (feature.getUuid().equals(ErmsTransformer.uuidSpelling)) {
2589
			return NoteCategory_STR_Spelling;
2590
		} else if (feature.getUuid().equals(ErmsTransformer.uuidDateofPublication)) {
2591
			return NoteCategory_STR_Date_of_publication;
2592
		} else if (feature.getUuid().equals(ErmsTransformer.uuidSystematics)) {
2593
			return NoteCategory_STR_Systematics;
2594
		} else if (feature.getUuid().equals(ErmsTransformer.uuidClassification)) {
2595
			return NoteCategory_STR_Classification;
2596
		} else if (feature.getUuid().equals(ErmsTransformer.uuidEnvironment)) {
2597
			return NoteCategory_STR_Environment;
2598
		} else if (feature.getUuid().equals(ErmsTransformer.uuidHabitat)) {
2599
			return NoteCategory_STR_Habitat;
2600
		} else if (feature.getUuid().equals(ErmsTransformer.uuidAuthority)) {
2601
			return NoteCategory_STR_Authority;
2602
		} else if (feature.getUuid().equals(ErmsTransformer.uuidMorphology)) {
2603
			return NoteCategory_STR_Morphology;
2604
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomicRemarks)) {
2605
			return NoteCategory_STR_Taxonomic_Remarks;
2606
		} else if (feature.getUuid().equals(ErmsTransformer.uuidNote)){
2607
			return NoteCategory_STR_Note;
2608
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomy)) {
2609
			return NoteCategory_STR_Taxonomy;
2610
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomicstatus)) {
2611
			return NoteCategory_STR_Taxonomic_status;
2612
		} else if (feature.getUuid().equals(ErmsTransformer.uuidStatus)){
2613
			return NoteCategory_STR_Status;
2614
		} else if (feature.getUuid().equals(ErmsTransformer.uuidRank)) {
2615
			return NoteCategory_STR_Rank;
2616
		} else if (feature.getUuid().equals(ErmsTransformer.uuidHomonymy)) {
2617
			return NoteCategory_STR_Homonymy;
2618
		} else if (feature.getUuid().equals(ErmsTransformer.uuidNomenclature)) {
2619
			return NoteCategory_STR_Nomenclature;
2620
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomicRemark)) {
2621
			return NoteCategory_STR_Taxonomic_Remark;
2622
		} else if (feature.getUuid().equals(ErmsTransformer.uuidAcknowledgments)){
2623
			return NoteCategory_STR_Acknowledgments;
2624
		} else if (feature.getUuid().equals(ErmsTransformer.uuidOriginalpublication)) {
2625
			return NoteCategory_STR_Original_publication;
2626
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTypelocality)) {
2627
			return NoteCategory_STR_Type_locality;
2628
		} else if (feature.getUuid().equals(ErmsTransformer.uuidValidity)) {
2629
			return NoteCategory_STR_Validity;
2630
		} else if (feature.getUuid().equals(ErmsTransformer.uuidIdentification)) {
2631
			return NoteCategory_STR_Identification;
2632
		} else if (feature.getUuid().equals(ErmsTransformer.uuidSynonymy)) {
2633
			return NoteCategory_STR_Synonymy;
2634
//		} else if (feature.equals(Feature.CITATION())) {
2635
//			return;
2636
			
2637
			// TODO: Unknown NodeCategories
2638
//			NoteCategory_STR_general_distribution_euromed = 10;
2639
//			NoteCategory_STR_general_distribution_world = 11;
2640
//			NoteCategory_STR_Common_names = 12;
2641
//			NoteCategory_STR_Maps =14;
2642
//			NoteCategory_STR_Link_to_maps = 20;
2643
//			NoteCategory_STR_Link_to_images = 21;
2644
//			NoteCategory_STR_Link_to_taxonomy = 22;
2645
//			NoteCategory_STR_Link_to_general_information = 23;
2646
//			NoteCategory_STR_undefined_link = 24;
2647
//			NoteCategory_STR_Editor_Braces = 249;
2648
//			NoteCategory_STR_Editor_Brackets = 250;
2649
//			NoteCategory_STR_Editor_Parenthesis = 251;
2650
//			NoteCategory_STR_Inedited = 252;
2651
//			NoteCategory_STR_Comments_on_editing_process = 253;
2652
//			NoteCategory_STR_Publication_date = 254;
2653
//			NoteCategory_STR_Distribution = 278;
2654
//			NoteCategory_STR_Biology = 281;
2655
//			NoteCategory_STR_Diagnosis	= 282;
2656
//			NoteCategory_STR_Host = 283;
2657
		
2658
 		} else {
2659
			logger.debug("Unknown Feature.");
2660
			return null;
2661
		}
2662
	}
2663

    
2664
	/**
2665
	 * Returns the NodeCategoryFk for a given TextData.
2666
	 * @param feature
2667
	 * @return
2668
	 */
2669
	public static Integer feature2NodeCategoryFk(Feature feature) {
2670
		if (feature == null) {
2671
			return null;
2672
		}
2673

    
2674
		if (feature.equals(Feature.DESCRIPTION())) {
2675
			return NoteCategory_description;
2676
		} else if (feature.equals(Feature.ECOLOGY())) {
2677
			return NoteCategory_ecology;
2678
		} else if (feature.equals(Feature.PHENOLOGY())) {
2679
			return NoteCategory_phenology;
2680
		} else if (feature.equals(Feature.COMMON_NAME())) {
2681
			return NoteCategory_Common_names;
2682
		} else if (feature.equals(Feature.OCCURRENCE())) {
2683
			return NoteCategory_Occurrence;
2684
		} else if (feature.equals(Feature.DISTRIBUTION())) {
2685
			return NoteCategory_Distribution;
2686
		} else if (feature.getUuid().equals(ErmsTransformer.uuidRemark)) {
2687
			return NoteCategory_Remark;
2688
		} else if (feature.getUuid().equals(ErmsTransformer.uuidAdditionalinformation)) {
2689
			return NoteCategory_Additional_information;
2690
		} else if (feature.getUuid().equals(ErmsTransformer.uuidSpelling)) {
2691
			return NoteCategory_Spelling;
2692
		} else if (feature.getUuid().equals(ErmsTransformer.uuidDateofPublication)) {
2693
			return NoteCategory_Date_of_publication;
2694
		} else if (feature.getUuid().equals(ErmsTransformer.uuidSystematics)) {
2695
			return NoteCategory_Systematics;
2696
		} else if (feature.getUuid().equals(ErmsTransformer.uuidClassification)) {
2697
			return NoteCategory_Classification;
2698
		} else if (feature.getUuid().equals(ErmsTransformer.uuidEnvironment)) {
2699
			return NoteCategory_Environment;
2700
		} else if (feature.getUuid().equals(ErmsTransformer.uuidHabitat)) {
2701
			return NoteCategory_Habitat;
2702
		} else if (feature.getUuid().equals(ErmsTransformer.uuidAuthority)) {
2703
			return NoteCategory_Authority;
2704
		} else if (feature.getUuid().equals(ErmsTransformer.uuidMorphology)) {
2705
			return NoteCategory_Morphology;
2706
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomicRemarks)) {
2707
			return NoteCategory_Taxonomic_Remarks;
2708
		} else if (feature.getUuid().equals(ErmsTransformer.uuidNote)){
2709
			return NoteCategory_Note;
2710
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomy)) {
2711
			return NoteCategory_Taxonomy;
2712
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomicstatus)) {
2713
			return NoteCategory_Taxonomic_status;
2714
		} else if (feature.getUuid().equals(ErmsTransformer.uuidStatus)){
2715
			return NoteCategory_Status;
2716
		} else if (feature.getUuid().equals(ErmsTransformer.uuidRank)) {
2717
			return NoteCategory_Rank;
2718
		} else if (feature.getUuid().equals(ErmsTransformer.uuidHomonymy)) {
2719
			return NoteCategory_Homonymy;
2720
		} else if (feature.getUuid().equals(ErmsTransformer.uuidNomenclature)) {
2721
			return NoteCategory_Nomenclature;
2722
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTaxonomicRemark)) {
2723
			return NoteCategory_Taxonomic_Remark;
2724
		} else if (feature.getUuid().equals(ErmsTransformer.uuidAcknowledgments)){
2725
			return NoteCategory_Acknowledgments;
2726
		} else if (feature.getUuid().equals(ErmsTransformer.uuidOriginalpublication)) {
2727
			return NoteCategory_Original_publication;
2728
		} else if (feature.getUuid().equals(ErmsTransformer.uuidTypelocality)) {
2729
			return NoteCategory_Type_locality;
2730
		} else if (feature.getUuid().equals(ErmsTransformer.uuidValidity)) {
2731
			return NoteCategory_Validity;
2732
		} else if (feature.getUuid().equals(ErmsTransformer.uuidIdentification)) {
2733
			return NoteCategory_Identification;
2734
		} else if (feature.getUuid().equals(ErmsTransformer.uuidSynonymy)) {
2735
			return NoteCategory_Synonymy;
2736
		} else if (feature.equals(Feature.CITATION())) {
2737
			return null;  //citations are handled differently
2738
			
2739
			// TODO: Unknown NodeCategories
2740
//			NoteCategory_general_distribution_euromed = 10;
2741
//			NoteCategory_general_distribution_world = 11;
2742
//			NoteCategory_Common_names = 12;
2743
//			NoteCategory_Maps =14;
2744
//			NoteCategory_Link_to_maps = 20;
2745
//			NoteCategory_Link_to_images = 21;
2746
//			NoteCategory_Link_to_taxonomy = 22;
2747
//			NoteCategory_Link_to_general_information = 23;
2748
//			NoteCategory_undefined_link = 24;
2749
//			NoteCategory_Editor_Braces = 249;
2750
//			NoteCategory_Editor_Brackets = 250;
2751
//			NoteCategory_Editor_Parenthesis = 251;
2752
//			NoteCategory_Inedited = 252;
2753
//			NoteCategory_Comments_on_editing_process = 253;
2754
//			NoteCategory_Publication_date = 254;
2755
//			NoteCategory_Distribution = 278;
2756
//			NoteCategory_Biology = 281;
2757
//			NoteCategory_Diagnosis	= 282;
2758
//			NoteCategory_Host = 283;
2759

    
2760
		}else{
2761
			logger.warn("Unhandled Feature: " + feature.getTitleCache());
2762
			return null;
2763
		}
2764
	}
2765

    
2766
	/**
2767
	 * Returns the string representation for a given rank.
2768
	 * @param rank
2769
	 * @param pesiKingdomId
2770
	 * @return
2771
	 */
2772
	public static String rank2RankCache(Rank rank, Integer pesiKingdomId) {
2773
		String result = null;
2774
		if (rank == null) {
2775
			return null;
2776
		}
2777
		
2778
		// We differentiate between Animalia and Plantae only for now.
2779
		if (pesiKingdomId != null && pesiKingdomId.intValue() == KINGDOM_ANIMALIA) {
2780
			if (rank.equals(Rank.KINGDOM())) {
2781
				result = Animalia_STR_Kingdom;
2782
			} else if (rank.equals(Rank.SUBKINGDOM())) {
2783
				result = Animalia_STR_Subkingdom;
2784
			} else if (rank.equals(Rank.SUPERPHYLUM())) {
2785
				result = Animalia_STR_Superphylum;
2786
			} else if (rank.equals(Rank.PHYLUM())) {
2787
				result = Animalia_STR_Phylum;
2788
			} else if (rank.equals(Rank.SUBPHYLUM())) {
2789
				result = Animalia_STR_Subphylum;
2790
			} else if (rank.equals(Rank.INFRAPHYLUM())) {
2791
				result = Animalia_STR_Infraphylum;
2792
			} else if (rank.equals(Rank.SUPERCLASS())) {
2793
				result = Animalia_STR_Superclass;
2794
			} else if (rank.equals(Rank.CLASS())) {
2795
				result = Animalia_STR_Class;
2796
			} else if (rank.equals(Rank.SUBCLASS())) {
2797
				result = Animalia_STR_Subclass;
2798
			} else if (rank.equals(Rank.INFRACLASS())) {
2799
				result = Animalia_STR_Infraclass;
2800
			} else if (rank.equals(Rank.SUPERORDER())) {
2801
				result = Animalia_STR_Superorder;
2802
			} else if (rank.equals(Rank.ORDER())) {
2803
				result = Animalia_STR_Order;
2804
			} else if (rank.equals(Rank.SUBORDER())) {
2805
				result = Animalia_STR_Suborder;
2806
			} else if (rank.equals(Rank.INFRAORDER())) {
2807
				result = Animalia_STR_Infraorder;
2808
			} else if (rank.equals(Rank.SECTION_ZOOLOGY())) {
2809
				result = Animalia_STR_Section;
2810
			} else if (rank.equals(Rank.SUBSECTION_ZOOLOGY())) {
2811
				result = Animalia_STR_Subsection;
2812
			} else if (rank.equals(Rank.SUPERFAMILY())) {
2813
				result = Animalia_STR_Superfamily;
2814
			} else if (rank.equals(Rank.FAMILY())) {
2815
				result = Animalia_STR_Family;
2816
			} else if (rank.equals(Rank.SUBFAMILY())) {
2817
				result = Animalia_STR_Subfamily;
2818
			} else if (rank.equals(Rank.TRIBE())) {
2819
				result = Animalia_STR_Tribe;
2820
			} else if (rank.equals(Rank.SUBTRIBE())) {
2821
				result = Animalia_STR_Subtribe;
2822
			} else if (rank.equals(Rank.GENUS())) {
2823
				result = Animalia_STR_Genus;
2824
			} else if (rank.equals(Rank.SUBGENUS())) {
2825
				result = Animalia_STR_Subgenus;
2826
			} else if (rank.equals(Rank.SPECIES())) {
2827
				result = Animalia_STR_Species;
2828
			} else if (rank.equals(Rank.SUBSPECIES())) {
2829
				result = Animalia_STR_Subspecies;
2830
//			} else if (rank.equals(Rank.)) { // not yet specified
2831
//				result = Animalia_STR_Natio;
2832
			} else if (rank.equals(Rank.VARIETY())) {
2833
				result = Animalia_STR_Variety;
2834
			} else if (rank.equals(Rank.SUBVARIETY())) {
2835
				result = Animalia_STR_Subvariety;
2836
			} else if (rank.equals(Rank.FORM())) {
2837
				result = Animalia_STR_Forma;
2838
			} else {
2839
				//TODO Exception
2840
				logger.warn("Rank for Kingdom Animalia not yet supported in CDM: "+ rank.getLabel());
2841
				return null;
2842
			}
2843
		} else if (pesiKingdomId != null && pesiKingdomId.intValue() == KINGDOM_PLANTAE) {
2844
			if (rank.equals(Rank.KINGDOM())) {
2845
				result = Plantae_STR_Kingdom;
2846
			} else if (rank.equals(Rank.SUBKINGDOM())) {
2847
				result = Plantae_STR_Subkingdom;
2848
			} else if (rank.equals(Rank.DIVISION())) {
2849
				result = Plantae_STR_Division;
2850
			} else if (rank.equals(Rank.SUBDIVISION())) {
2851
				result = Plantae_STR_Subdivision;
2852
			} else if (rank.equals(Rank.CLASS())) {
2853
				result = Plantae_STR_Class;
2854
			} else if (rank.equals(Rank.SUBCLASS())) {
2855
				result = Plantae_STR_Subclass;
2856
			} else if (rank.equals(Rank.ORDER())) {
2857
				result = Plantae_STR_Order;
2858
			} else if (rank.equals(Rank.SUBORDER())) {
2859
				result = Plantae_STR_Suborder;
2860
			} else if (rank.equals(Rank.FAMILY())) {
2861
				result = Plantae_STR_Family;
2862
			} else if (rank.equals(Rank.SUBFAMILY())) {
2863
				result = Plantae_STR_Subfamily;
2864
			} else if (rank.equals(Rank.TRIBE())) {
2865
				result = Plantae_STR_Tribe;
2866
			} else if (rank.equals(Rank.SUBTRIBE())) {
2867
				result = Plantae_STR_Subtribe;
2868
			} else if (rank.equals(Rank.GENUS())) {
2869
				result = Plantae_STR_Genus;
2870
			} else if (rank.equals(Rank.SUBGENUS())) {
2871
				result = Plantae_STR_Subgenus;
2872
			} else if (rank.equals(Rank.SECTION_BOTANY())) {
2873
				result = Plantae_STR_Section;
2874
			} else if (rank.equals(Rank.SUBSECTION_BOTANY())) {
2875
				result = Plantae_STR_Subsection;
2876
			} else if (rank.equals(Rank.SERIES())) {
2877
				result = Plantae_STR_Series;
2878
			} else if (rank.equals(Rank.SUBSERIES())) {
2879
				result = Plantae_STR_Subseries;
2880
			} else if (rank.equals(Rank.SPECIESAGGREGATE() )) {
2881
				result = Plantae_STR_Aggregate;
2882
			} else if (rank.equals(Rank.SPECIESGROUP())) {
2883
				logger.warn("Rank Species Group not yet implemented");
2884
				result = null;
2885
			} else if (rank.getUuid().equals(BerlinModelTransformer.uuidRankCollSpecies)) { 
2886
				result = Plantae_STR_Coll_Species;
2887
			} else if (rank.equals(Rank.SPECIES())) {
2888
				result = Plantae_STR_Species;
2889
			} else if (rank.equals(Rank.SUBSPECIES())) {
2890
				result = Plantae_STR_Subspecies;
2891
			} else if (rank.equals(Rank.GREX())) {
2892
				result = Plantae_STR_Grex;
2893
			} else if (rank.getUuid().equals(BerlinModelTransformer.uuidRankProles)) {
2894
				result = Plantae_STR_Proles;
2895
			} else if (rank.getUuid().equals(BerlinModelTransformer.uuidRankRace)) {
2896
				result = Plantae_STR_Race;
2897
			} else if (rank.equals(Rank.CONVAR())) {
2898
				result = Plantae_STR_Convarietas;
2899
			} else if (rank.equals(Rank.VARIETY())) {
2900
				result = Plantae_STR_Variety;
2901
			} else if (rank.equals(Rank.SUBVARIETY())) {
2902
				result = Plantae_STR_Subvariety;
2903
			} else if (rank.equals(Rank.FORM())) {
2904
				result = Plantae_STR_Forma;
2905
			} else if (rank.equals(Rank.SUBFORM())) {
2906
				result = Plantae_STR_Subforma;
2907
//			} else if (rank.equals(Rank.)) { // not yet specified
2908
//				result = Plantae_STR_Forma_spec;
2909
			} else if (rank.equals(Rank.INFRAGENERICTAXON())) { 
2910
				result = Plantae_STR_Taxa_infragen;
2911
			} else if (rank.equals(Rank.INFRASPECIFICTAXON())) { 
2912
				result = Plantae_STR_Taxa_infraspec;
2913
			} else {
2914
				//TODO Exception
2915
				logger.warn("Rank for Kingdom Plantae not yet supported in CDM: "+ rank.getLabel());
2916
				return null;
2917
			}
2918
		} else if (pesiKingdomId != null && pesiKingdomId.intValue() == KINGDOM_BACTERIA) {
2919
			if (rank.equals(Rank.KINGDOM())) { result = Bacteria_STR_Kingdom; }
2920
			else if (rank.equals(Rank.SUBKINGDOM())) { result = Bacteria_STR_Subkingdom; }
2921
			else if (rank.equals(Rank.PHYLUM())) { result = Bacteria_STR_Phylum; }
2922
			else if (rank.equals(Rank.SUBPHYLUM())) { result = Bacteria_STR_Subphylum; }
2923
			else if (rank.equals(Rank.SUPERCLASS())) { result = Bacteria_STR_Superclass; }
2924
			else if (rank.equals(Rank.CLASS())) { result = Bacteria_STR_Class; }
2925
			else if (rank.equals(Rank.SUBCLASS())) { result = Bacteria_STR_Subclass; }
2926
			else if (rank.equals(Rank.INFRACLASS())) { result = Bacteria_STR_Infraclass; }
2927
			else if (rank.equals(Rank.SUPERORDER())) { result = Bacteria_STR_Superorder; }
2928
			else if (rank.equals(Rank.ORDER())) { result = Bacteria_STR_Order; }
2929
			else if (rank.equals(Rank.SUBORDER())) { result = Bacteria_STR_Suborder; }
2930
			else if (rank.equals(Rank.INFRAORDER())) { result = Bacteria_STR_Infraorder; }
2931
			else if (rank.equals(Rank.SUPERFAMILY())) { result = Bacteria_STR_Superfamily; }
2932
			else if (rank.equals(Rank.FAMILY())) { result = Bacteria_STR_Family; }
2933
			else if (rank.equals(Rank.SUBFAMILY())) { result = Bacteria_STR_Subfamily; }
2934
			else if (rank.equals(Rank.TRIBE())) { result = Bacteria_STR_Tribe; }
2935
			else if (rank.equals(Rank.SUBTRIBE())) { result = Bacteria_STR_Subtribe; }
2936
			else if (rank.equals(Rank.GENUS())) { result = Bacteria_STR_Genus; }
2937
			else if (rank.equals(Rank.SUBGENUS())) { result = Bacteria_STR_Subgenus; }
2938
			else if (rank.equals(Rank.SPECIES())) { result = Bacteria_STR_Species; }
2939
			else if (rank.equals(Rank.SUBSPECIES())) { result = Bacteria_STR_Subspecies; }
2940
			else if (rank.equals(Rank.VARIETY())) { result = Bacteria_STR_Variety; }
2941
			else if (rank.equals(Rank.FORM())) { result = Bacteria_STR_Forma; }
2942
		} else {
2943
			//TODO Exception
2944
			logger.warn("Kingdom not yet supported in CDM: "+ pesiKingdomId);
2945
			return null;
2946
		}
2947
		return result;
2948
	}
2949
	
2950
	/**
2951
	 * Returns the abbreviation for a given rank.
2952
	 * @param rank
2953
	 * @param pesiKingdomId
2954
	 * @return
2955
	 */
2956
	public static String rank2RankAbbrev(Rank rank, Integer pesiKingdomId) {
2957
		String result = null;
2958
		if (rank == null) {
2959
			return null;
2960
		}
2961
		
2962
		// We differentiate between Animalia and Plantae only for now.
2963
		if (pesiKingdomId != null && pesiKingdomId.intValue() == KINGDOM_ANIMALIA) {
2964
			if (rank.equals(Rank.SUBGENUS())) {
2965
				result = Animalia_Abbrev_Subgenus;
2966
			} else if (rank.equals(Rank.SPECIES())) {
2967
				result = Animalia_Abbrev_Species;
2968
			} else if (rank.equals(Rank.SUBSPECIES())) {
2969
				result = Animalia_Abbrev_Subspecies;
2970
//			} else if (rank.equals(Rank.)) { // not yet specified
2971
//				result = Animalia_STR_Natio;
2972
			} else if (rank.equals(Rank.VARIETY())) {
2973
				result = Animalia_Abbrev_Variety;
2974
			} else if (rank.equals(Rank.SUBVARIETY())) {
2975
				result = Animalia_Abbrev_Subvariety;
2976
			} else if (rank.equals(Rank.FORM())) {
2977
				result = Animalia_Abbrev_Forma;
2978
			} else {
2979
				//TODO Exception
2980
				logger.warn("Abbreviation for Rank of Kingdom Animalia not supported in CDM: "+ rank.getLabel());
2981
				return null;
2982
			}
2983
		} else if (pesiKingdomId != null && pesiKingdomId.intValue() == KINGDOM_PLANTAE) {
2984
			if (rank.equals(Rank.KINGDOM())) {
2985
				result = Plantae_Abbrev_Kingdom;
2986
			} else if (rank.equals(Rank.SUBKINGDOM())) {
2987
				result = Plantae_Abbrev_Subkingdom;
2988
			} else if (rank.equals(Rank.DIVISION())) {
2989
				result = Plantae_Abbrev_Division;
2990
			} else if (rank.equals(Rank.SUBDIVISION())) {
2991
				result = Plantae_Abbrev_Subdivision;
2992
			} else if (rank.equals(Rank.CLASS())) {
2993
				result = Plantae_Abbrev_Class;
2994
			} else if (rank.equals(Rank.SUBCLASS())) {
2995
				result = Plantae_Abbrev_Subclass;
2996
			} else if (rank.equals(Rank.ORDER())) {
2997
				result = Plantae_Abbrev_Order;
2998
			} else if (rank.equals(Rank.SUBORDER())) {
2999
				result = Plantae_Abbrev_Suborder;
3000
			} else if (rank.equals(Rank.FAMILY())) {
3001
				result = Plantae_Abbrev_Family;
3002
			} else if (rank.equals(Rank.SUBFAMILY())) {
3003
				result = Plantae_Abbrev_Subfamily;
3004
			} else if (rank.equals(Rank.TRIBE())) {
3005
				result = Plantae_Abbrev_Tribe;
3006
			} else if (rank.equals(Rank.SUBTRIBE())) {
3007
				result = Plantae_Abbrev_Subtribe;
3008
			} else if (rank.equals(Rank.GENUS())) {
3009
				result = Plantae_Abbrev_Genus;
3010
			} else if (rank.equals(Rank.SUBGENUS())) {
3011
				result = Plantae_Abbrev_Subgenus;
3012
			} else if (rank.equals(Rank.SECTION_BOTANY())) {
3013
				result = Plantae_Abbrev_Section;
3014
			} else if (rank.equals(Rank.SUBSECTION_BOTANY())) {
3015
				result = Plantae_Abbrev_Subsection;
3016
			} else if (rank.equals(Rank.SERIES())) {
3017
				result = Plantae_Abbrev_Series;
3018
			} else if (rank.equals(Rank.SUBSERIES())) {
3019
				result = Plantae_Abbrev_Subseries;
3020
			} else if (rank.equals(Rank.SPECIESAGGREGATE() )) { 
3021
				result = Plantae_Abbrev_Aggregate;
3022
			} else if (rank.getUuid().equals(BerlinModelTransformer.uuidRankCollSpecies)) { 
3023
				result = Plantae_Abbrev_Coll_Species;
3024
			} else if (rank.equals(Rank.SPECIES())) {
3025
				result = Plantae_Abbrev_Species;
3026
			} else if (rank.equals(Rank.GREX())) {
3027
				result = Plantae_Abbrev_Grex;
3028
			} else if (rank.equals(Rank.SUBSPECIES())) {
3029
				result = Plantae_Abbrev_Subspecies;
3030
			} else if (rank.getUuid().equals(BerlinModelTransformer.uuidRankProles)) {
3031
				result = Plantae_Abbrev_Proles;
3032
			} else if (rank.getUuid().equals(BerlinModelTransformer.uuidRankRace)) {
3033
				result = Plantae_Abbrev_Race;
3034
			} else if (rank.equals(Rank.CONVAR())) {
3035
				result = Plantae_Abbrev_Convarietas;
3036
			} else if (rank.equals(Rank.VARIETY())) {
3037
				result = Plantae_Abbrev_Variety;
3038
			} else if (rank.equals(Rank.SUBVARIETY())) {
3039
				result = Plantae_Abbrev_Subvariety;
3040
			} else if (rank.equals(Rank.FORM())) {
3041
				result = Plantae_Abbrev_Forma;
3042
			} else if (rank.equals(Rank.SUBFORM())) {
3043
				result = Plantae_Abbrev_Subforma;
3044
//			} else if (rank.equals(Rank.)) { // not yet specified
3045
//				result = Plantae_Abbrev_Forma_spec;
3046
			} else if (rank.equals(Rank.INFRAGENERICTAXON())) { 
3047
				result = Plantae_Abbrev_Taxa_infragen;
3048
			} else if (rank.equals(Rank.INFRASPECIFICTAXON())) { 
3049
				result = Plantae_Abbrev_Taxa_infraspec;
3050
			} else {
3051
				//TODO Exception
3052
				logger.warn("Abbreviation for Rank of Kingdom Plantae not supported in CDM: "+ rank.getLabel());
3053
				return null;
3054
			}
3055
		} else {
3056
			//TODO Exception
3057
			logger.warn("Kingdom not yet supported in CDM: "+ pesiKingdomId);
3058
			return null;
3059
		}
3060
		return result;
3061
	}
3062

    
3063
	/**
3064
	 * Returns the identifier of a PESI specific kingdom for a given CDM nomenclatural code.
3065
	 * @param nomenclaturalCode
3066
	 * @return KINGDOM_ANIMALIA for NomenclaturalCode.ICZN, KINGDOM_PLANTAE for NomenclaturalCode.ICBN
3067
	 */
3068
	public static Integer nomenClaturalCode2Kingdom(NomenclaturalCode nomenclaturalCode) {
3069
		Integer result = null;
3070
		// TODO: This needs to be refined. For now we differentiate between Animalia and Plantae only.
3071
		if (nomenclaturalCode.equals(NomenclaturalCode.ICZN)) {
3072
			result = KINGDOM_ANIMALIA;
3073
		} else if (nomenclaturalCode.equals(NomenclaturalCode.ICBN)) {
3074
			result = KINGDOM_PLANTAE;
3075
		} else if (nomenclaturalCode.equals(NomenclaturalCode.ICNB)) {
3076
			result = KINGDOM_BACTERIA;
3077
//		} else if (nomenclaturalCode.equals(NomenclaturalCode.)) { // Biota
3078
//			result = 
3079
		} else {
3080
			logger.error("NomenclaturalCode not yet considered: " + nomenclaturalCode.getUuid() + " (" +  nomenclaturalCode.getTitleCache() + ")");
3081
		}
3082
		return result;
3083
	}
3084
	
3085
	/**
3086
	 * Returns the RankId for a Rank.
3087
	 * @param rank
3088
	 * @return
3089
	 */
3090
	public static Integer rank2RankId (Rank rank, Integer pesiKingdomId) {
3091
		Integer result = null;
3092
		if (rank == null) {
3093
			return null;
3094
		}
3095
		
3096
		// We differentiate between Animalia and Plantae only for now.
3097
		if (pesiKingdomId != null && pesiKingdomId.intValue() == KINGDOM_ANIMALIA) {
3098
			if (rank.equals(Rank.KINGDOM())) {
3099
				result = Animalia_Kingdom;
3100
			} else if (rank.equals(Rank.SUBKINGDOM())) {
3101
				result = Animalia_Subkingdom;
3102
			} else if (rank.equals(Rank.SUPERPHYLUM())) {
3103
				result = Animalia_Superphylum;
3104
			} else if (rank.equals(Rank.PHYLUM())) {
3105
				result = Animalia_Phylum;
3106
			} else if (rank.equals(Rank.SUBPHYLUM())) {
3107
				result = Animalia_Subphylum;
3108
			} else if (rank.equals(Rank.INFRAPHYLUM())) {
3109
				result = Animalia_Infraphylum;
3110
			} else if (rank.equals(Rank.SUPERCLASS())) {
3111
				result = Animalia_Superclass;
3112
			} else if (rank.equals(Rank.CLASS())) {
3113
				result = Animalia_Class;
3114
			} else if (rank.equals(Rank.SUBCLASS())) {
3115
				result = Animalia_Subclass;
3116
			} else if (rank.equals(Rank.INFRACLASS())) {
3117
				result = Animalia_Infraclass;
3118
			} else if (rank.equals(Rank.SUPERORDER())) {
3119
				result = Animalia_Superorder;
3120
			} else if (rank.equals(Rank.ORDER())) {
3121
				result = Animalia_Order;
3122
			} else if (rank.equals(Rank.SUBORDER())) {
3123
				result = Animalia_Suborder;
3124
			} else if (rank.equals(Rank.INFRAORDER())) {
3125
				result = Animalia_Infraorder;
3126
			} else if (rank.equals(Rank.SECTION_ZOOLOGY())) {
3127
				result = Animalia_Section;
3128
			} else if (rank.equals(Rank.SUBSECTION_ZOOLOGY())) {
3129
				result = Animalia_Subsection;
3130
			} else if (rank.equals(Rank.SUPERFAMILY())) {
3131
				result = Animalia_Superfamily;
3132
			} else if (rank.equals(Rank.FAMILY())) {
3133
				result = Animalia_Family;
3134
			} else if (rank.equals(Rank.SUBFAMILY())) {
3135
				result = Animalia_Subfamily;
3136
			} else if (rank.equals(Rank.TRIBE())) {
3137
				result = Animalia_Tribe;
3138
			} else if (rank.equals(Rank.SUBTRIBE())) {
3139
				result = Animalia_Subtribe;
3140
			} else if (rank.equals(Rank.GENUS())) {
3141
				result = Animalia_Genus;
3142
			} else if (rank.equals(Rank.SUBGENUS())) {
3143
				result = Animalia_Subgenus;
3144
			} else if (rank.equals(Rank.SPECIES())) {
3145
				result = Animalia_Species;
3146
			} else if (rank.equals(Rank.SUBSPECIES())) {
3147
				result = Animalia_Subspecies;
3148
//			} else if (rank.equals(Rank.)) { // not yet specified
3149
//				result = Animalia_Natio;
3150
			} else if (rank.equals(Rank.VARIETY())) {
3151
				result = Animalia_Variety;
3152
			} else if (rank.equals(Rank.SUBVARIETY())) {
3153
				result = Animalia_Subvariety;
3154
			} else if (rank.equals(Rank.FORM())) {
3155
				result = Animalia_Forma;
3156
			} else {
3157
				//TODO Exception
3158
				logger.warn("Rank for Kingdom Animalia not yet supported in CDM: "+ rank.getLabel());
3159
				return null;
3160
			}
3161
		} else if (pesiKingdomId != null && pesiKingdomId.intValue() == KINGDOM_PLANTAE) {
3162
			if (rank.equals(Rank.KINGDOM())) {
3163
				result = Plantae_Kingdom;
3164
			} else if (rank.equals(Rank.SUBKINGDOM())) {
3165
				result = Plantae_Subkingdom;
3166
			} else if (rank.equals(Rank.DIVISION())) {
3167
				result = Plantae_Division;
3168
			} else if (rank.equals(Rank.SUBDIVISION())) {
3169
				result = Plantae_Subdivision;
3170
			} else if (rank.equals(Rank.CLASS())) {
3171
				result = Plantae_Class;
3172
			} else if (rank.equals(Rank.SUBCLASS())) {
3173
				result = Plantae_Subclass;
3174
			} else if (rank.equals(Rank.ORDER())) {
3175
				result = Plantae_Order;
3176
			} else if (rank.equals(Rank.SUBORDER())) {
3177
				result = Plantae_Suborder;
3178
			} else if (rank.equals(Rank.FAMILY())) {
3179
				result = Plantae_Family;
3180
			} else if (rank.equals(Rank.SUBFAMILY())) {
3181
				result = Plantae_Subfamily;
3182
			} else if (rank.equals(Rank.TRIBE())) {
3183
				result = Plantae_Tribe;
3184
			} else if (rank.equals(Rank.SUBTRIBE())) {
3185
				result = Plantae_Subtribe;
3186
			} else if (rank.equals(Rank.GENUS())) {
3187
				result = Plantae_Genus;
3188
			} else if (rank.equals(Rank.SUBGENUS())) {
3189
				result = Plantae_Subgenus;
3190
			} else if (rank.equals(Rank.SECTION_BOTANY())) {
3191
				result = Plantae_Section;
3192
			} else if (rank.equals(Rank.SUBSECTION_BOTANY())) {
3193
				result = Plantae_Subsection;
3194
			} else if (rank.equals(Rank.SERIES())) {
3195
				result = Plantae_Series;
3196
			} else if (rank.equals(Rank.SUBSERIES())) {
3197
				result = Plantae_Subseries;
3198
			} else if (rank.equals(Rank.SPECIESAGGREGATE() )) {
3199
				result = Plantae_Aggregate;
3200
			} else if (rank.equals(Rank.SPECIESGROUP())) {
3201
				logger.warn("Rank Species Group not yet implemented");
3202
				result = null;
3203
			} else if (rank.getUuid().equals(BerlinModelTransformer.uuidRankCollSpecies)) { 
3204
				result = Plantae_Coll_Species;
3205
			} else if (rank.equals(Rank.SPECIES())) {
3206
				result = Plantae_Species;
3207
			} else if (rank.equals(Rank.SUBSPECIES())) {
3208
				result = Plantae_Subspecies;
3209
			} else if (rank.equals(Rank.GREX())) {
3210
				result = Plantae_Grex;
3211
			} else if (rank.getUuid().equals(BerlinModelTransformer.uuidRankProles) ) {
3212
				result = Plantae_Proles;
3213
			} else if (rank.getUuid().equals(BerlinModelTransformer.uuidRankRace)) {
3214
				result = Plantae_Race;
3215
			} else if (rank.equals(Rank.CONVAR())) {
3216
				result = Plantae_Convarietas;
3217
			} else if (rank.equals(Rank.VARIETY())) {
3218
				result = Plantae_Variety;
3219
			} else if (rank.equals(Rank.SUBVARIETY())) {
3220
				result = Plantae_Subvariety;
3221
			} else if (rank.equals(Rank.FORM())) {
3222
				result = Plantae_Forma;
3223
			} else if (rank.equals(Rank.SUBFORM())) {
3224
				result = Plantae_Subforma;
3225
//			} else if (rank.equals(Rank.)) { // not yet specified
3226
//				result = Plantae_Forma_spec;
3227
			} else if (rank.equals(Rank.INFRAGENERICTAXON())) { 
3228
				result = Plantae_Taxa_infragen;
3229
			} else if (rank.equals(Rank.INFRASPECIFICTAXON())) { 
3230
				result = Plantae_Taxa_infraspec;
3231
			} else {
3232
				//TODO Exception
3233
				logger.warn("Rank for Kingdom Plantae not yet supported in CDM: "+ rank.getLabel());
3234
				return null;
3235
			}
3236
		} else if (pesiKingdomId != null && pesiKingdomId.intValue() == KINGDOM_BACTERIA) {
3237
			if (rank.equals(Rank.KINGDOM())) { result = Bacteria_Kingdom; }
3238
			else if (rank.equals(Rank.SUBKINGDOM())) { result = Bacteria_Subkingdom; }
3239
			else if (rank.equals(Rank.PHYLUM())) { result = Bacteria_Phylum; }
3240
			else if (rank.equals(Rank.SUBPHYLUM())) { result = Bacteria_Subphylum; }
3241
			else if (rank.equals(Rank.SUPERCLASS())) { result = Bacteria_Superclass; }
3242
			else if (rank.equals(Rank.CLASS())) { result = Bacteria_Class; }
3243
			else if (rank.equals(Rank.SUBCLASS())) { result = Bacteria_Subclass; }
3244
			else if (rank.equals(Rank.INFRACLASS())) { result = Bacteria_Infraclass; }
3245
			else if (rank.equals(Rank.SUPERORDER())) { result = Bacteria_Superorder; }
3246
			else if (rank.equals(Rank.ORDER())) { result = Bacteria_Order; }
3247
			else if (rank.equals(Rank.SUBORDER())) { result = Bacteria_Suborder; }
3248
			else if (rank.equals(Rank.INFRAORDER())) { result = Bacteria_Infraorder; }
3249
			else if (rank.equals(Rank.SUPERFAMILY())) { result = Bacteria_Superfamily; }
3250
			else if (rank.equals(Rank.FAMILY())) { result = Bacteria_Family; }
3251
			else if (rank.equals(Rank.SUBFAMILY())) { result = Bacteria_Subfamily; }
3252
			else if (rank.equals(Rank.TRIBE())) { result = Bacteria_Tribe; }
3253
			else if (rank.equals(Rank.SUBTRIBE())) { result = Bacteria_Subtribe; }
3254
			else if (rank.equals(Rank.GENUS())) { result = Bacteria_Genus; }
3255
			else if (rank.equals(Rank.SUBGENUS())) { result = Bacteria_Subgenus; }
3256
			else if (rank.equals(Rank.SPECIES())) { result = Bacteria_Species; }
3257
			else if (rank.equals(Rank.SUBSPECIES())) { result = Bacteria_Subspecies; }
3258
			else if (rank.equals(Rank.VARIETY())) { result = Bacteria_Variety; }
3259
			else if (rank.equals(Rank.FORM())) { result = Bacteria_Forma; }
3260
		} else {
3261
			//TODO Exception
3262
			logger.warn("Kingdom not yet supported in CDM: "+ pesiKingdomId);
3263
			return null;
3264
		}
3265
		return result;
3266
	}
3267

    
3268
	/**
3269
	 * 
3270
	 * @param nameTypeDesignationStatus
3271
	 * @return
3272
	 */
3273
	public static Integer nameTypeDesignationStatus2TypeDesignationStatusId(NameTypeDesignationStatus nameTypeDesignationStatus) {
3274
		if (nameTypeDesignationStatus == null) {
3275
			return null;
3276
		}
3277
		if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.ORIGINAL_DESIGNATION())) {
3278
			return TYPE_BY_ORIGINAL_DESIGNATION;
3279
		} else if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.SUBSEQUENT_DESIGNATION())) {
3280
			return TYPE_BY_SUBSEQUENT_DESIGNATION;
3281
		} else if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.MONOTYPY())) {
3282
			return TYPE_BY_MONOTYPY;
3283
		} else {
3284
			//TODO Figure out a way to handle this gracefully.
3285
			logger.warn("Name Type Designation Status not yet supported in PESI: "+ nameTypeDesignationStatus.getLabel());
3286
			return null;
3287
		}
3288

    
3289
	}
3290

    
3291
	/**
3292
	 * 
3293
	 * @param nameTypeDesignationStatus
3294
	 * @return
3295
	 */
3296
	public static String nameTypeDesignationStatus2TypeDesignationStatusCache(NameTypeDesignationStatus nameTypeDesignationStatus) {
3297
		if (nameTypeDesignationStatus == null) {
3298
			return null;
3299
		}
3300
		if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.ORIGINAL_DESIGNATION())) {
3301
			return TYPE_STR_BY_ORIGINAL_DESIGNATION;
3302
		} else if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.SUBSEQUENT_DESIGNATION())) {
3303
			return TYPE_STR_BY_SUBSEQUENT_DESIGNATION;
3304
		} else if (nameTypeDesignationStatus.equals(NameTypeDesignationStatus.MONOTYPY())) {
3305
			return TYPE_STR_BY_MONOTYPY;
3306
		} else {
3307
			//TODO Figure out a way to handle this gracefully.
3308
			logger.warn("Name Type Designation Status not yet supported in PESI: "+ nameTypeDesignationStatus.getLabel());
3309
			return null;
3310
		}
3311

    
3312
	}
3313

    
3314
	/**
3315
	 * 
3316
	 * @param taxonBase
3317
	 * @return
3318
	 */
3319
	public static Integer taxonBase2statusFk (TaxonBase<?> taxonBase){
3320
		if (taxonBase == null){return null;}		
3321
		if (taxonBase.isInstanceOf(Taxon.class)){
3322
			return T_STATUS_ACCEPTED;
3323
		}else if (taxonBase.isInstanceOf(Synonym.class)){
3324
			return T_STATUS_SYNONYM;
3325
		}else{
3326
			logger.warn("Unknown ");
3327
			return T_STATUS_UNRESOLVED;
3328
		}
3329
		//TODO 
3330
//		public static int T_STATUS_PARTIAL_SYN = 3;
3331
//		public static int T_STATUS_PRO_PARTE_SYN = 4;
3332
//		public static int T_STATUS_UNRESOLVED = 5;
3333
//		public static int T_STATUS_ORPHANED = 6;
3334
	}
3335

    
3336
	/**
3337
	 * 
3338
	 * @param taxonBase
3339
	 * @return
3340
	 */
3341
	public static String taxonBase2statusCache (TaxonBase<?> taxonBase){
3342
		if (taxonBase == null){return null;}
3343
		if (taxonBase.isInstanceOf(Taxon.class)){
3344
			return T_STATUS_STR_ACCEPTED;
3345
		}else if (taxonBase.isInstanceOf(Synonym.class)){
3346
			return T_STATUS_STR_SYNONYM;
3347
		}else{
3348
			logger.warn("Unknown ");
3349
			return T_STATUS_STR_UNRESOLVED;
3350
		}
3351
		//TODO 
3352
//		public static int T_STATUS_STR_PARTIAL_SYN = 3;
3353
//		public static int T_STATUS_STR_PRO_PARTE_SYN = 4;
3354
//		public static int T_STATUS_STR_UNRESOLVED = 5;
3355
//		public static int T_STATUS_STR_ORPHANED = 6;
3356
	}
3357
		
3358
	/**
3359
	 * Returns the {@link SourceCategory SourceCategory} representation of the given {@link ReferenceType ReferenceType} in PESI.
3360
	 * @param reference The {@link Reference Reference}.
3361
	 * @return The {@link SourceCategory SourceCategory} representation in PESI.
3362
	 */
3363
	public static Integer reference2SourceCategoryFK(Reference<?> reference) {
3364
		if (reference == null){
3365
			return null;
3366
		} else if (reference.getType().equals(ReferenceType.Article)) {
3367
			return REF_ARTICLE_IN_PERIODICAL;
3368
		} else if (reference.getType().equals(ReferenceType.Book)) {
3369
			return REF_BOOK;
3370
		} else if (reference.getType().equals(ReferenceType.BookSection)) {
3371
			return REF_PART_OF_OTHER;
3372
		} else if (reference.getType().equals(ReferenceType.Database)) {
3373
			return REF_DATABASE;
3374
		} else if (reference.getType().equals(ReferenceType.WebPage)) {
3375
			return REF_WEBSITE;
3376
		} else if (reference.getType().equals(ReferenceType.CdDvd)) {
3377
			return REF_NOT_APPLICABLE;
3378
		} else if (reference.getType().equals(ReferenceType.Journal)) {
3379
			return REF_JOURNAL;
3380
		} else if (reference.getType().equals(ReferenceType.Generic)) {
3381
			return REF_UNRESOLVED;
3382
		} else if (reference.getType().equals(ReferenceType.PrintSeries)) {
3383
			return REF_PUBLISHED;
3384
		} else if (reference.getType().equals(ReferenceType.Proceedings)) {
3385
			return REF_PUBLISHED;
3386
		} else if (reference.getType().equals(ReferenceType.Patent)) {
3387
			return REF_NOT_APPLICABLE;
3388
		} else if (reference.getType().equals(ReferenceType.PersonalCommunication)) {
3389
			return REF_INFORMAL;
3390
		} else if (reference.getType().equals(ReferenceType.Report)) {
3391
			return REF_NOT_APPLICABLE;
3392
		} else if (reference.getType().equals(ReferenceType.Thesis)) {
3393
			return REF_NOT_APPLICABLE;
3394
		} else {
3395
			logger.warn("Reference type not yet supported in PESI: "+ reference.getType());
3396
			return null;
3397
		}
3398
	}
3399
	
3400
	/**
3401
	 * Returns the {@link SourceCategoryCache SourceCategoryCache}.
3402
	 * @param reference The {@link Reference Reference}.
3403
	 * @return The {@link SourceCategoryCache SourceCategoryCache}.
3404
	 */
3405
	public static String getSourceCategoryCache(Reference<?> reference) {
3406
		if (reference == null){
3407
			return null;
3408
		} else if (reference.getType().equals(ReferenceType.Article)) {
3409
			return REF_STR_ARTICLE_IN_PERIODICAL;
3410
		} else if (reference.getType().equals(ReferenceType.Book)) {
3411
			return REF_STR_BOOK;
3412
		} else if (reference.getType().equals(ReferenceType.BookSection)) {
3413
			return REF_STR_PART_OF_OTHER;
3414
		} else if (reference.getType().equals(ReferenceType.Database)) {
3415
			return REF_STR_DATABASE;
3416
		} else if (reference.getType().equals(ReferenceType.WebPage)) {
3417
			return REF_STR_WEBSITE;
3418
		} else if (reference.getType().equals(ReferenceType.CdDvd)) {
3419
			return REF_STR_NOT_APPLICABLE;
3420
		} else if (reference.getType().equals(ReferenceType.Journal)) {
3421
			return REF_STR_JOURNAL;
3422
		} else if (reference.getType().equals(ReferenceType.Generic)) {
3423
			return REF_STR_UNRESOLVED;
3424
		} else if (reference.getType().equals(ReferenceType.PrintSeries)) {
3425
			return REF_STR_PUBLISHED;
3426
		} else if (reference.getType().equals(ReferenceType.Proceedings)) {
3427
			return REF_STR_PUBLISHED;
3428
		} else if (reference.getType().equals(ReferenceType.Patent)) {
3429
			return REF_STR_NOT_APPLICABLE;
3430
		} else if (reference.getType().equals(ReferenceType.PersonalCommunication)) {
3431
			return REF_STR_INFORMAL;
3432
		} else if (reference.getType().equals(ReferenceType.Report)) {
3433
			return REF_STR_NOT_APPLICABLE;
3434
		} else if (reference.getType().equals(ReferenceType.Thesis)) {
3435
			return REF_STR_NOT_APPLICABLE;
3436
		} else {
3437
			logger.warn("Reference type not yet supported in PESI: "+ reference.getType());
3438
			return null;
3439
		}
3440
	}
3441

    
3442
	/**
3443
	 * 
3444
	 * @param status
3445
	 * @return
3446
	 */
3447
	public String getCacheByNomStatus(NomenclaturalStatusType status) {
3448
		if (status == null){
3449
			return null;
3450
		}else{
3451
			return this.nameStatusCacheMap.get(nomStatus2nomStatusFk(status)); 
3452
		}
3453
	}
3454
	
3455
	/**
3456
	 * 
3457
	 * @param status
3458
	 * @return
3459
	 */
3460
	public static Integer nomStatus2nomStatusFk (NomenclaturalStatusType status){
3461
		if (status == null){
3462
			return null;
3463
		}
3464
		if (status.equals(NomenclaturalStatusType.INVALID())) {return NAME_ST_NOM_INVAL;
3465
		}else if (status.equals(NomenclaturalStatusType.ILLEGITIMATE())) {return NAME_ST_NOM_ILLEG;
3466
		}else if (status.equals(NomenclaturalStatusType.NUDUM())) {return NAME_ST_NOM_NUD;
3467
		}else if (status.equals(NomenclaturalStatusType.REJECTED())) {return NAME_ST_NOM_REJ;
3468
		}else if (status.equals(NomenclaturalStatusType.REJECTED_PROP())) {return NAME_ST_NOM_REJ_PROP;
3469
		}else if (status.equals(NomenclaturalStatusType.UTIQUE_REJECTED())) {return NAME_ST_NOM_UTIQUE_REJ;
3470
		}else if (status.equals(NomenclaturalStatusType.UTIQUE_REJECTED_PROP())) {return NAME_ST_NOM_UTIQUE_REJ_PROP;
3471
		}else if (status.equals(NomenclaturalStatusType.CONSERVED())) {return NAME_ST_NOM_CONS;
3472
		
3473
		}else if (status.equals(NomenclaturalStatusType.CONSERVED_PROP())) {return NAME_ST_NOM_CONS_PROP;
3474
		}else if (status.equals(NomenclaturalStatusType.ORTHOGRAPHY_CONSERVED())) {return NAME_ST_ORTH_CONS;
3475
		}else if (status.equals(NomenclaturalStatusType.ORTHOGRAPHY_CONSERVED_PROP())) {return NAME_ST_ORTH_CONS_PROP;
3476
		}else if (status.equals(NomenclaturalStatusType.SUPERFLUOUS())) {return NAME_ST_NOM_SUPERFL;
3477
		}else if (status.equals(NomenclaturalStatusType.AMBIGUOUS())) {return NAME_ST_NOM_AMBIG;
3478
		}else if (status.equals(NomenclaturalStatusType.PROVISIONAL())) {return NAME_ST_NOM_PROVIS;
3479
		}else if (status.equals(NomenclaturalStatusType.DOUBTFUL())) {return NAME_ST_NOM_DUB;
3480
		}else if (status.equals(NomenclaturalStatusType.NOVUM())) {return NAME_ST_NOM_NOV;
3481
		
3482
		}else if (status.equals(NomenclaturalStatusType.CONFUSUM())) {return NAME_ST_NOM_CONFUS;
3483
		}else if (status.equals(NomenclaturalStatusType.ALTERNATIVE())) {return NAME_ST_NOM_ALTERN;
3484
		}else if (status.equals(NomenclaturalStatusType.COMBINATION_INVALID())) {return NAME_ST_COMB_INVAL;
3485
		}else if (status.equals(NomenclaturalStatusType.LEGITIMATE())) {return NAME_ST_LEGITIMATE;
3486
		
3487
		}else if (status.getUuid().equals(BerlinModelTransformer.uuidNomStatusCombIned)) {return NAME_ST_COMB_INED;
3488
		}else if (status.getUuid().equals(BerlinModelTransformer.uuidNomStatusNomOrthCons)) {return NAME_ST_NOM_AND_ORTH_CONS;
3489
		}else if (status.getUuid().equals(BerlinModelTransformer.uuidNomStatusSpNovIned)) {return NAME_ST_SP_NOV_INED;
3490
		
3491
		
3492
		// The following are non-existent in CDM
3493
//		}else if (status.equals(NomenclaturalStatusType.)) {return NAME_ST_COMB_AND_STAT_INED;
3494
//		}else if (status.equals(NomenclaturalStatusType.)) {return NAME_ST_NOM_NOV_INED;
3495
//		}else if (status.equals(NomenclaturalStatusType.)) {return NAME_ST_ALTERNATE_REPRESENTATION;
3496
//		}else if (status.equals(NomenclaturalStatusType.)) {return NAME_ST_TEMPORARY_NAME;
3497
//		}else if (status.equals(NomenclaturalStatusType.)) {return NAME_ST_SPECIES_INQUIRENDA;
3498

    
3499
		//TODO
3500
		}else {
3501
			//TODO Exception
3502
			logger.warn("NomStatus type not yet supported by PESI export: "+ status);
3503
			return null;
3504
		}
3505
	}
3506
	
3507
	/**
3508
	 * Returns the RelTaxonQualifierCache for a given taxonRelation.
3509
	 * @param relation
3510
	 * @return
3511
	 */
3512
	public static String taxonRelation2RelTaxonQualifierCache(RelationshipBase<?,?,?> relation, NomenclaturalCode code){
3513
		if (relation == null) {
3514
			return null;
3515
		}
3516
		RelationshipTermBase<?> type = relation.getType();
3517
		if (type.equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())) {
3518
			return STR_IS_MISAPPLIED_NAME_FOR;
3519
		} else if (type.equals(SynonymRelationshipType.SYNONYM_OF())) {
3520
			return STR_IS_SYNONYM_OF;
3521
		} else if (type.equals(SynonymRelationshipType.HOMOTYPIC_SYNONYM_OF())) {
3522
			if (code.equals(NomenclaturalCode.ICZN)){
3523
				return STR_IS_HOMOTYPIC_SYNONYM_OF_ZOOL;
3524
			}else{
3525
				return STR_IS_HOMOTYPIC_SYNONYM_OF;
3526
			}
3527
		} else if (type.equals(SynonymRelationshipType.HETEROTYPIC_SYNONYM_OF())) {
3528
			if (code.equals(NomenclaturalCode.ICZN)){
3529
				return STR_IS_HETEROTYPIC_SYNONYM_OF_ZOOL;
3530
			}else{
3531
				return STR_IS_HETEROTYPIC_SYNONYM_OF;
3532
			}
3533
		} else if (type.equals(SynonymRelationshipType.INFERRED_EPITHET_OF())) {
3534
			return STR_IS_INFERRED_EPITHET_FOR;
3535
		} else if (type.equals(SynonymRelationshipType.INFERRED_GENUS_OF())) {
3536
			return STR_IS_INFERRED_GENUS_FOR;
3537
		} else if (type.equals(SynonymRelationshipType.POTENTIAL_COMBINATION_OF())) {
3538
			return STR_IS_POTENTIAL_COMBINATION_FOR;
3539
		} else if (type.equals(NameRelationshipType.BASIONYM())) {
3540
			if (code.equals(NomenclaturalCode.ICZN)){
3541
				return STR_IS_BASIONYM_FOR_ZOOL;
3542
			}else{
3543
				return STR_IS_BASIONYM_FOR;
3544
			}
3545
		} else if (type.equals(NameRelationshipType.LATER_HOMONYM())) {
3546
			return STR_IS_LATER_HOMONYM_OF;
3547
		} else if (type.equals(NameRelationshipType.REPLACED_SYNONYM())) {
3548
			return STR_IS_REPLACED_SYNONYM_FOR;
3549
		} else if (type.equals(NameRelationshipType.VALIDATED_BY_NAME())) {
3550
			return STR_IS_VALIDATION_OF;
3551
		} else if (type.equals(NameRelationshipType.LATER_VALIDATED_BY_NAME())) {
3552
			return STR_IS_LATER_VALIDATION_OF;
3553
		} else if (type.equals(NameRelationshipType.CONSERVED_AGAINST())) {
3554
			return STR_IS_CONSERVED_AGAINST;
3555
		} else if (type.equals(NameRelationshipType.TREATED_AS_LATER_HOMONYM())) {
3556
			return STR_IS_TREATED_AS_LATER_HOMONYM_OF;
3557
		} else if (type.equals(NameRelationshipType.ORTHOGRAPHIC_VARIANT())) {
3558
			return STR_IS_ORTHOGRAPHIC_VARIANT_OF;
3559
		} else if (type.equals(NameRelationshipType.ALTERNATIVE_NAME())) {
3560
			return STR_IS_ALTERNATIVE_NAME_FOR;
3561
		} else {
3562
			logger.warn("No equivalent RelationshipType found in datawarehouse for: " + type.getTitleCache());
3563
		}
3564
			
3565
		// The following have no equivalent attribute in CDM
3566
//		IS_TYPE_OF
3567
//		IS_CONSERVED_TYPE_OF
3568
//		IS_REJECTED_TYPE_OF
3569
//		IS_FIRST_PARENT_OF
3570
//		IS_SECOND_PARENT_OF
3571
//		IS_FEMALE_PARENT_OF
3572
//		IS_MALE_PARENT_OF
3573
//		IS_REJECTED_IN_FAVOUR_OF
3574
//		HAS_SAME_TYPE_AS
3575
//		IS_LECTOTYPE_OF
3576
//		TYPE_NOT_DESIGNATED
3577
//		IS_PRO_PARTE_SYNONYM_OF
3578
//		IS_PARTIAL_SYNONYM_OF
3579
//		IS_PRO_PARTE_AND_HOMOTYPIC_SYNONYM_OF
3580
//		IS_PRO_PARTE_AND_HETEROTYPIC_SYNONYM_OF
3581
//		IS_PARTIAL_AND_HOMOTYPIC_SYNONYM_OF
3582
//		IS_PARTIAL_AND_HETEROTYPIC_SYNONYM_OF
3583

    
3584
		return null;
3585
	}
3586
	
3587
	/**
3588
	 * Returns the RelTaxonQualifierFk for a TaxonRelation.
3589
	 * @param relation
3590
	 * @return
3591
	 */
3592
	public static Integer taxonRelation2RelTaxonQualifierFk(RelationshipBase<?,?,?> relation) {
3593
		if (relation == null) {
3594
			return null;
3595
		}
3596
		RelationshipTermBase<?> type = relation.getType();
3597
		if (type.equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())) {
3598
			return IS_MISAPPLIED_NAME_FOR;
3599
		} else if (type.equals(SynonymRelationshipType.SYNONYM_OF())) {
3600
			return IS_SYNONYM_OF;
3601
		} else if (type.equals(SynonymRelationshipType.HOMOTYPIC_SYNONYM_OF())) {
3602
			return IS_HOMOTYPIC_SYNONYM_OF;
3603
		} else if (type.equals(SynonymRelationshipType.HETEROTYPIC_SYNONYM_OF())) {
3604
			return IS_HETEROTYPIC_SYNONYM_OF;
3605
		} else if (type.equals(SynonymRelationshipType.INFERRED_EPITHET_OF())) {
3606
			return IS_INFERRED_EPITHET_FOR;
3607
		} else if (type.equals(SynonymRelationshipType.INFERRED_GENUS_OF())) {
3608
			return IS_INFERRED_GENUS_FOR;
3609
		} else if (type.equals(SynonymRelationshipType.POTENTIAL_COMBINATION_OF())) {
3610
			return IS_POTENTIAL_COMBINATION_FOR;
3611
		} else if (type.equals(NameRelationshipType.BASIONYM())) {
3612
			return IS_BASIONYM_FOR;
3613
		} else if (type.equals(NameRelationshipType.LATER_HOMONYM())) {
3614
			return IS_LATER_HOMONYM_OF;
3615
		} else if (type.equals(NameRelationshipType.REPLACED_SYNONYM())) {
3616
			return IS_REPLACED_SYNONYM_FOR;
3617
		} else if (type.equals(NameRelationshipType.VALIDATED_BY_NAME())) {
3618
			return IS_VALIDATION_OF;
3619
		} else if (type.equals(NameRelationshipType.LATER_VALIDATED_BY_NAME())) {
3620
			return IS_LATER_VALIDATION_OF;
3621
		} else if (type.equals(NameRelationshipType.CONSERVED_AGAINST())) {
3622
			return IS_CONSERVED_AGAINST;
3623
		} else if (type.equals(NameRelationshipType.TREATED_AS_LATER_HOMONYM())) {
3624
			return IS_TREATED_AS_LATER_HOMONYM_OF;
3625
		} else if (type.equals(NameRelationshipType.ORTHOGRAPHIC_VARIANT())) {
3626
			return IS_ORTHOGRAPHIC_VARIANT_OF;
3627
		} else if (type.equals(NameRelationshipType.ALTERNATIVE_NAME())) {
3628
			return IS_ALTERNATIVE_NAME_FOR;
3629
		} else {
3630
			logger.warn("No equivalent RelationshipType found in datawarehouse for: " + type.getTitleCache());
3631
		}
3632

    
3633
		// The following have no equivalent attribute in CDM
3634
//		IS_TYPE_OF
3635
//		IS_CONSERVED_TYPE_OF
3636
//		IS_REJECTED_TYPE_OF
3637
//		IS_FIRST_PARENT_OF
3638
//		IS_SECOND_PARENT_OF
3639
//		IS_FEMALE_PARENT_OF
3640
//		IS_MALE_PARENT_OF
3641
//		IS_REJECTED_IN_FAVOUR_OF
3642
//		HAS_SAME_TYPE_AS
3643
//		IS_LECTOTYPE_OF
3644
//		TYPE_NOT_DESIGNATED
3645
//		IS_PRO_PARTE_SYNONYM_OF
3646
//		IS_PARTIAL_SYNONYM_OF
3647
//		IS_PRO_PARTE_AND_HOMOTYPIC_SYNONYM_OF
3648
//		IS_PRO_PARTE_AND_HETEROTYPIC_SYNONYM_OF
3649
//		IS_PARTIAL_AND_HOMOTYPIC_SYNONYM_OF
3650
//		IS_PARTIAL_AND_HETEROTYPIC_SYNONYM_OF
3651

    
3652
		return null;
3653
	}
3654
	
3655
	/**
3656
	 * Returns the StatusFk for a given StatusCache.
3657
	 * @param StatusCache
3658
	 * @return
3659
	 */
3660
	public Integer StatusCache2StatusFk(String StatusCache) {
3661
		Integer result = null;
3662
		if (StatusCache.equalsIgnoreCase("Checked by Taxonomic Editor: included in ERMS 1.1")) {
3663
			return 0;
3664
		} else if (StatusCache.equalsIgnoreCase("Added by Database Management Team")) {
3665
			return 2;
3666
		} else if (StatusCache.equalsIgnoreCase("Checked by Taxonomic Editor")) {
3667
			return 3;
3668
		} else if (StatusCache.equalsIgnoreCase("Edited by Database Management Team")) {
3669
			return 4;
3670
		} else {
3671
			logger.error("StatusFk could not be determined. StatusCache unknown: " + StatusCache);
3672
		}
3673
		
3674
		return result;
3675
	}
3676
	
3677
	/**
3678
	 * Returns the FossilStatusFk for a given FossilStatusCache.
3679
	 * @param fossilStatusCache
3680
	 * @return
3681
	 */
3682
	public Integer FossilStatusCache2FossilStatusFk(String fossilStatusCache) {
3683
		Integer result = null;
3684
		if (fossilStatusCache.equalsIgnoreCase("recent only")) {
3685
			return 1;
3686
		} else if (fossilStatusCache.equalsIgnoreCase("fossil only")) {
3687
			return 2;
3688
		} else if (fossilStatusCache.equalsIgnoreCase("recent + fossil")) {
3689
			return 3;
3690
		} else {
3691
			logger.error("FossilStatusFk could not be determined. FossilStatusCache unknown: " + fossilStatusCache);
3692
		}
3693
		
3694
		return result;
3695
	}
3696

    
3697
	/**
3698
	 * Returns the NoteCategoryFk for a given UUID representing an ExtensionType.
3699
	 * @param uuid
3700
	 * @return
3701
	 */
3702
	public static Integer getNoteCategoryFk(UUID uuid) {
3703
		Integer result = null;
3704
		if (uuid.equals(taxCommentUuid)) {
3705
			result = 270;
3706
		} else if (uuid.equals(fauCommentUuid)) {
3707
			result = 281;
3708
		} else if (uuid.equals(fauExtraCodesUuid)) {
3709
			result = 278;
3710
		}
3711
		return result;
3712
	}
3713
	
3714
	/**
3715
	 * Returns the NoteCategoryCache for a given UUID representing an ExtensionType.
3716
	 * @param uuid
3717
	 * @return
3718
	 */
3719
	public static String getNoteCategoryCache(UUID uuid) {
3720
		String result = null;
3721
		if (uuid.equals(taxCommentUuid)) {
3722
			result = "Taxonomy";
3723
		} else if (uuid.equals(fauCommentUuid)) {
3724
			result = "Biology";
3725
		} else if (uuid.equals(fauExtraCodesUuid)) {
3726
			result = "Distribution";
3727
		}
3728
		return result;
3729
	}
3730

    
3731
	public static Integer getQualityStatusKeyBySource(BitSet sources) {
3732
		if (sources.get(SOURCE_EM)){
3733
			return QUALITY_STATUS_ADD_BY_DBMT;
3734
		}else{
3735
			return null;   // TODO needs to be implemented for others 
3736
		}
3737
	}
3738
	
3739
	@Override
3740
	public String getQualityStatusCacheByKey(Integer qualityStatusId) throws UndefinedTransformerMethodException {
3741
		if (qualityStatusId == null){
3742
			return null;
3743
		}else{
3744
			return this.qualityStatusCacheMap.get(qualityStatusId); 
3745
		}
3746

    
3747
	}
3748

    
3749
	public static String getOriginalDbBySources(BitSet sources) {
3750
		String result = "";
3751
		if (sources.get(SOURCE_EM)){
3752
			result = CdmUtils.concat(",", result,  SOURCE_STR_EM);
3753
		}
3754
		if (sources.get(SOURCE_FE)){
3755
			result = CdmUtils.concat(",", result,  SOURCE_STR_FE);
3756
		}
3757
		if (sources.get(SOURCE_IF)){
3758
			result = CdmUtils.concat(",", result,  SOURCE_STR_IF);
3759
		}
3760
		if (sources.get(SOURCE_ERMS)){
3761
			result = CdmUtils.concat(",", result,  SOURCE_STR_ERMS);
3762
		}
3763
		
3764
		return result;
3765
	}
3766

    
3767
	
3768
}
(17-17/17)