Project

General

Profile

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

    
10
package eu.etaxonomy.cdm.io.pesi.faunaEuropaea;
11

    
12
import java.sql.ResultSet;
13
import java.sql.SQLException;
14
import java.util.HashMap;
15
import java.util.UUID;
16

    
17
import org.apache.log4j.Logger;
18

    
19
import eu.etaxonomy.cdm.api.service.ITermService;
20
import eu.etaxonomy.cdm.io.common.TdwgAreaProvider;
21
import eu.etaxonomy.cdm.model.common.Language;
22
import eu.etaxonomy.cdm.model.common.Representation;
23
import eu.etaxonomy.cdm.model.description.AbsenceTerm;
24
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase;
25
import eu.etaxonomy.cdm.model.description.PresenceTerm;
26
import eu.etaxonomy.cdm.model.location.NamedArea;
27
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
28
import eu.etaxonomy.cdm.model.name.Rank;
29
import eu.etaxonomy.cdm.strategy.exceptions.UnknownCdmTypeException;
30

    
31
/**
32
 * @author a.babadshanjan
33
 * @created 12.05.2009
34
 * @version 1.0
35
 */
36

    
37
public final class FaunaEuropaeaTransformer {
38
	private static final Logger logger = Logger.getLogger(FaunaEuropaeaTransformer.class);
39
	
40
	// Query
41
	public static final int Q_NO_RESTRICTION = -1;
42
	
43
	// TaxonStatus
44
	public static final int T_STATUS_ACCEPTED = 1;
45
	public static final int T_STATUS_NOT_ACCEPTED = 0;
46
	
47
	// Author
48
	public static final int A_AUCT = 1;
49
	public static final String A_AUCTNAME = "auct.";
50
	
51
	// Parenthesis
52
	public static final int P_PARENTHESIS = 1;
53
	
54
	//new AbsencePresenceTermUUIDs
55
	
56
	public static UUID noData;
57
	//public static UUID doubtfull_present;
58
	
59
	// Rank
60
	public static final int R_KINGDOM = 1;
61
	public static final int R_SUBKINGDOM = 2;
62
	public static final int R_SUPERPHYLUM = 3;
63
	public static final int R_PHYLUM = 4;
64
	public static final int R_SUBPHYLUM = 5;
65
	public static final int R_INFRAPHYLUM = 6;
66
	public static final int R_CLASS = 7;
67
	public static final int R_SUBCLASS = 8;
68
	public static final int R_INFRACLASS = 9;
69
	public static final int R_SUPERORDER = 10;
70
	public static final int R_ORDER = 11;
71
	public static final int R_SUBORDER = 12;
72
	public static final int R_INFRAORDER = 13;
73
	public static final int R_SUPERFAMILY = 14;
74
	public static final int R_FAMILY = 15;
75
	public static final int R_SUBFAMILY = 16;
76
	public static final int R_TRIBE = 17;
77
	public static final int R_SUBTRIBE = 18;
78
	public static final int R_GENUS = 19;
79
	public static final int R_SUBGENUS = 20;
80
	public static final int R_SPECIES = 21;
81
	public static final int R_SUBSPECIES = 22;
82
	
83
	public static PresenceAbsenceTermBase<?> occStatus2PresenceAbsence(int occStatusId)  throws UnknownCdmTypeException{
84
	
85
		if (Integer.valueOf(occStatusId) == null) {
86
			return PresenceTerm.PRESENT();
87
		}
88
		switch (occStatusId){
89
		case 0: return PresenceTerm.PRESENT();
90
		case 2: return AbsenceTerm.ABSENT();
91
		case 1: return PresenceTerm.PRESENT_DOUBTFULLY();
92

    
93
		default: {
94

    
95
			return null;
96
		
97

    
98
		}
99
		
100
	}
101
	}
102
	public static void setUUIDs(UUID uuid){
103
		noData = uuid;
104
		//doubtfull_present = uuids.get("doubtfullPresent");
105
	
106
	}
107
	
108
	public static PresenceAbsenceTermBase<?> occStatus2PresenceAbsence_ (int occStatusId)  throws UnknownCdmTypeException{
109
		switch (occStatusId){
110
			case 0: return null;
111
			//case 110: return AbsenceTerm.CULTIVATED_REPORTED_IN_ERROR();
112
			case 120: return PresenceTerm.CULTIVATED();
113
		//	case 210: return AbsenceTerm.INTRODUCED_REPORTED_IN_ERROR();
114
			case 220: return PresenceTerm.INTRODUCED_PRESENCE_QUESTIONABLE();
115
			case 230: return AbsenceTerm.INTRODUCED_FORMERLY_INTRODUCED();
116
			case 240: return PresenceTerm.INTRODUCED_DOUBTFULLY_INTRODUCED();
117
			case 250: return PresenceTerm.INTRODUCED();
118
			case 260: return PresenceTerm.INTRODUCED_UNCERTAIN_DEGREE_OF_NATURALISATION();
119
			case 270: return PresenceTerm.INTRODUCED_ADVENTITIOUS();
120
			case 280: return PresenceTerm.INTRODUCED_NATURALIZED();
121
			//case 310: return AbsenceTerm.NATIVE_REPORTED_IN_ERROR();
122
			case 320: return PresenceTerm.NATIVE_PRESENCE_QUESTIONABLE();
123
			case 330: return AbsenceTerm.NATIVE_FORMERLY_NATIVE();
124
			case 340: return PresenceTerm.NATIVE_DOUBTFULLY_NATIVE();
125
			case 350: return PresenceTerm.NATIVE();
126
			case 999: {
127
					logger.warn("endemic for EM can not be transformed in legal status");
128
					//TODO preliminary
129
					return PresenceTerm.PRESENT();
130
				}
131
			default: {
132
				throw new UnknownCdmTypeException("Unknown occurrence status  (id=" + Integer.valueOf(occStatusId).toString() + ")");
133
			}
134
		}
135
	}
136
		
137
	
138
	public static Rank rankId2Rank (ResultSet rs, boolean useUnknown) throws UnknownCdmTypeException {
139
		Rank result;
140
		try {
141
			int rankId = rs.getInt("rnk_id");
142
			int parentRankId = rs.getInt("rnk_rnk_id");
143
			String rankName = rs.getString("rnk_name");
144
			String rankLatinName = rs.getString("rnk_latinname");
145
			int rankCategory = rs.getInt("rnk_category");
146

    
147
			if (logger.isDebugEnabled()) {
148
				logger.debug(rankId + ", " + parentRankId + ", " + rankName + ", " + rankCategory);
149
			}
150

    
151
			try {
152
				result = Rank.getRankByNameOrIdInVoc(rankName);
153
			} catch (UnknownCdmTypeException e1) {
154

    
155
				switch (rankId) {
156
				case 0: return null;
157
				case R_KINGDOM: return Rank.KINGDOM();
158
				case R_SUBKINGDOM: return Rank.SUBKINGDOM();
159
				case R_SUPERPHYLUM: return Rank.SUPERPHYLUM();
160
				case R_PHYLUM: return Rank.PHYLUM();
161
				case R_SUBPHYLUM: return Rank.SUBPHYLUM();
162
				case R_INFRAPHYLUM: return Rank.INFRAPHYLUM();
163
				case R_CLASS: return Rank.CLASS();
164
				case R_SUBCLASS: return Rank.SUBCLASS();
165
				case R_INFRACLASS: return Rank.INFRACLASS();
166
				case R_SUPERORDER: return Rank.SUPERORDER();
167
				case R_ORDER: return Rank.ORDER();
168
				case R_SUBORDER: return Rank.SUBORDER();
169
				case R_INFRAORDER: return Rank.INFRAORDER();
170
				case R_SUPERFAMILY: return Rank.SUPERFAMILY();
171
				case R_FAMILY: return Rank.FAMILY();
172
				case R_SUBFAMILY: return Rank.SUBFAMILY();
173
				case R_TRIBE: return Rank.TRIBE();
174
				case R_SUBTRIBE: return Rank.SUBTRIBE();
175
				case R_GENUS: return Rank.GENUS();
176
				case R_SUBGENUS: return Rank.SUBGENUS();
177
				case R_SPECIES: return Rank.SPECIES();
178
				case R_SUBSPECIES: return Rank.SUBSPECIES();
179

    
180
				default: {
181
					if (useUnknown){
182
						logger.error("Rank unknown. Created UNKNOWN_RANK");
183
						return Rank.UNKNOWN_RANK();
184
					}
185
					throw new UnknownCdmTypeException("Unknown Rank id" + Integer.valueOf(rankId).toString());
186
				}
187
				}
188
			}
189
			return result;
190
		} catch (SQLException e) {
191
			e.printStackTrace();
192
			logger.warn("Exception occurred. Created UNKNOWN_RANK instead");
193
			return Rank.UNKNOWN_RANK();
194
		}		
195
	}
196
	
197
	
198
	public static NamedArea areaId2TdwgArea (FaunaEuropaeaDistribution fauEuDistribution) 
199
	throws UnknownCdmTypeException {
200
		
201
		NamedArea tdwgArea = null;
202
		
203
		try {
204
			int areaId = fauEuDistribution.getAreaId();
205
			String areaName = fauEuDistribution.getAreaName();
206
			String areaCode = fauEuDistribution.getAreaCode();
207
			int extraLimital = fauEuDistribution.getExtraLimital();
208
			
209
			//TODO: Verify mappings with comments. Those don't map to TDWG areas.
210
			
211
			if (areaCode.equals("AD")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SPA-AN");
212
			//else if (areaCode.equals("AFR")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("24"); // Afro-tropical region - Northeast Tropical Africa
213
			else if (areaCode.equals("AL")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ALB-OO");
214
			else if (areaCode.equals("AT")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("AUT-AU");
215
			else if (areaCode.equals("AUS")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("AUS"); // Australian region - Australia
216
			else if (areaCode.equals("BA")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG-BH"); 
217
			else if (areaCode.equals("BE")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BGM-BE");
218
			else if (areaCode.equals("BG")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BUL-OO");
219
			else if (areaCode.equals("BY")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLR-OO");
220
			else if (areaCode.equals("CH")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SWI-OO");
221
			else if (areaCode.equals("CY")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("CYP-OO");
222
			else if (areaCode.equals("CZ")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("CZE-CZ");
223
			else if (areaCode.equals("DE")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("GER-OO");
224
			else if (areaCode.equals("DK-DEN")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("DEN-OO");
225
			else if (areaCode.equals("DK-FOR")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FOR-OO");
226
			else if (areaCode.equals("EE")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLT-ES");
227
			//else if (areaCode.equals("EPA")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("3");   // Palaearctic - Asia-Temperate
228
			else if (areaCode.equals("ES-BAL")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLT-ES");
229
			else if (areaCode.equals("ES-CNY")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("CNY-OO");
230
			else if (areaCode.equals("ES-SPA")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SPA-SP");
231
			else if (areaCode.equals("FI")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FIN-OO");
232
			else if (areaCode.equals("FR-COR")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("COR-OO");
233
			else if (areaCode.equals("FR-FRA")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FRA-FR");
234
			else if (areaCode.equals("GB-CI")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FRA-CI");
235
			else if (areaCode.equals("GB-GI")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SPA-GI");
236
			else if (areaCode.equals("GB-GRB")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("GRB-OO");
237
			else if (areaCode.equals("GB-NI")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("IRE-NI");
238
			//else if (areaCode.equals("GR-AEG")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("EAI-OO"); // North Aegean Is. - East Aegean Is.
239
			//else if (areaCode.equals("GR-CYC")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("GRC-OO"); // Cyclades Is. - Greece
240
			//else if (areaCode.equals("GR-DOD")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("EAI-OO"); // Dodecanese Is. - East Aegean Is.
241
			else if (areaCode.equals("GR-GRC")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("GRC-OO");
242
			//else if (areaCode.equals("GR-KRI")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("KRI-OO");//only Crete
243
			else if (areaCode.equals("HR")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG-CR");
244
			else if (areaCode.equals("HU")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("HUN-OO");
245
			else if (areaCode.equals("IE")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("IRE-IR");
246
			else if (areaCode.equals("IS")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ICE-OO");
247
			else if (areaCode.equals("IT-ITA")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ITA-IT");
248
			else if (areaCode.equals("IT-SAR")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SAR-OO");
249
			else if (areaCode.equals("IT-SI")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SIC-SI");
250
			else if (areaCode.equals("LI")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("AUT-LI");
251
			else if (areaCode.equals("LT")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLT-LI");
252
			else if (areaCode.equals("LU")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BGM-LU");
253
			else if (areaCode.equals("LV")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLT-LA");
254
			else if (areaCode.equals("MC")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("FRA-MO");
255
			else if (areaCode.equals("MD")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("UKR-MO");
256
			else if (areaCode.equals("MK")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG-MA");
257
			else if (areaCode.equals("MT")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SIC-MA");
258
			//else if (areaCode.equals("NAF")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("20");   // North Africa - Northern Africa
259
			//else if (areaCode.equals("NEA")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("7");	// Nearctic region - Northern America
260
			//else if (areaCode.equals("NEO")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("8");    // Neotropical region - Southern America
261
			else if (areaCode.equals("NL")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("NET-OO");
262
			else if (areaCode.equals("NO-NOR")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("NOR-OO");
263
			else if (areaCode.equals("NO-SVA")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SVA-OO");
264
			//else if (areaCode.equals("NRE")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("34");   // Near East - Western Asia
265
			//else if (areaCode.equals("ORR")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("35");	// Oriental region - Arabian Peninsula
266
			else if (areaCode.equals("PL")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("POL-OO");
267
			else if (areaCode.equals("PT-AZO")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("AZO-OO");
268
			else if (areaCode.equals("PT-MDR")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("MDR-OO");
269
			else if (areaCode.equals("PT-POR")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("POR-OO");
270
			else if (areaCode.equals("PT-SEL")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SEL-OO");
271
			else if (areaCode.equals("RO")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ROM-OO");
272
			//else if (areaCode.equals("RU-FJL")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("WSB-OO"); Franz Josef Land
273
			else if (areaCode.equals("RU-KGD")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("BLT-KA");
274
			//else if (areaCode.equals("RU-NOZ")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("WSB-OO"); Novaya Zemla
275
			else if (areaCode.equals("RU-RUC")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUC-OO");
276
			else if (areaCode.equals("RU-RUE")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUE-OO");
277
			else if (areaCode.equals("RU-RUN")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUN-OO");
278
			else if (areaCode.equals("RU-RUS")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUS-OO");
279
			else if (areaCode.equals("RU-RUW")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("RUW-OO");
280
			else if (areaCode.equals("SE")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("SWE-OO");
281
			else if (areaCode.equals("SI")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG-SL");
282
			else if (areaCode.equals("SK")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("CZE-SK");
283
			else if (areaCode.equals("SM")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ITA-SM");
284
			else if (areaCode.equals("TR-TUE")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("TUE-OO");
285
			//else if (areaCode.equals("UA")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("UKR-UK"); //UKraine including Crimea
286
			
287
			else if (areaCode.equals("VA")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("ITA-VC");
288
			else if (areaCode.equals("YU")) tdwgArea = TdwgAreaProvider.getAreaByTdwgAbbreviation("YUG");
289
			else 					
290
				throw new UnknownCdmTypeException("Unknown Area " + areaCode);
291

    
292
			if (logger.isDebugEnabled()) {
293
				logger.debug(areaId + ", " + areaName + ", " + areaCode + ", " + extraLimital);
294
			}
295
			
296
		} catch (Exception e) {
297
			//e.printStackTrace();
298
			logger.debug("Exception occurred. Area could not be mapped." + fauEuDistribution.getAreaName());
299
			return null;
300
		}	
301
		
302
		return tdwgArea;
303
	}
304
	
305
	public static UUID uuidAreaAUS = UUID.fromString("cf979ca8-8cb6-42df-b2ce-1f432ec7c26b");
306
	public static UUID uuidAreaAFR = UUID.fromString("07ac5e75-9fc9-4aa0-938c-1324c9618b97");
307
	public static UUID uuidAreaEPA = UUID.fromString("e83446d7-7379-4beb-be05-295f8da6f5ae");
308
	public static UUID uuidAreaGR_AEG = UUID.fromString("6bd422aa-9911-4b80-8595-0f6d1ecd5eee");
309
	public static UUID uuidAreaGR_CYC = UUID.fromString("8e7d7f1e-3e4d-4f7c-96ec-93ec91e528d6");
310
	public static UUID uuidAreaGR_DOD = UUID.fromString("6d6f6842-924e-440b-9e7e-3df1922bf4a6");
311
	public static UUID uuidAreaNAF = UUID.fromString("d2c54b1e-5f9f-455d-b308-6859cb153c7b");
312
	public static UUID uuidAreaNEA = UUID.fromString("aa87f6b8-110b-44b5-a329-91a08f1a4cc9");
313
	public static UUID uuidAreaNEO = UUID.fromString("0e6e0ce9-c6ab-46bc-80b9-aee4a0620e78");
314
	public static UUID uuidAreaNRE = UUID.fromString("d51876c2-eaf6-4c7f-963e-337dd3e0d729");
315
	public static UUID uuidAreaORR = UUID.fromString("04cab4f8-b316-4e21-9bcc-236a45e4e83d");
316
	public static UUID uuidAreaGR_CR = UUID.fromString("2ef9fa6c-7c3f-431a-96c9-5980c55fc440");
317
	public static UUID uuidAreaGR_GRC = UUID.fromString("b5d33c78-91e7-467a-9c2d-6c337b78d31a");
318
	public static UUID uuidAreaUA = UUID.fromString("859cf055-a208-4f30-8e6e-361f165c6fa9");
319
	public static UUID uuidAreaRU_FJL = UUID.fromString("84671068-2f18-40cb-933a-e7e1c0e37cc8");
320
	public static UUID uuidAreaRU_NOZ = UUID.fromString("64cce0aa-0222-4740-8fa2-dbf0330e9266");
321
	
322
	
323
	public final static HashMap<String, UUID> abbrToUUID = new HashMap<String,UUID>();
324
	 	static
325
	 	{	
326
	 		abbrToUUID.put("AUS", uuidAreaAUS);
327
	 		abbrToUUID.put("AFR", uuidAreaAFR);
328
	 		abbrToUUID.put("EPA", uuidAreaEPA);
329
	 		abbrToUUID.put("GR-AEG", uuidAreaGR_AEG);
330
	 		abbrToUUID.put("GR-CYC", uuidAreaGR_CYC);
331
	 		abbrToUUID.put("GR-DOD", uuidAreaGR_DOD);
332
	 		abbrToUUID.put("NAF", uuidAreaNAF);
333
	 		abbrToUUID.put("NEA", uuidAreaNEA);
334
	 		abbrToUUID.put("NEO", uuidAreaNEO);
335
	 		abbrToUUID.put("NRE", uuidAreaNRE);
336
	 		abbrToUUID.put("ORR", uuidAreaORR);
337
	 		abbrToUUID.put("GR-KRI", uuidAreaGR_CR);
338
	 		abbrToUUID.put("GR-GRC", uuidAreaGR_GRC);
339
	 		abbrToUUID.put("UA", uuidAreaUA);
340
	 		abbrToUUID.put("RU-FJL", uuidAreaRU_FJL);
341
	 		abbrToUUID.put("RU-NOZ", uuidAreaRU_NOZ);
342
	 		
343
	 		
344
	 	}
345
	public static UUID getUUIDByAreaAbbr(String abbr){
346
		return abbrToUUID.get(abbr);
347
	}
348
	
349
	public static UUID uuidNomStatusTempNamed = UUID.fromString("aa6ada5a-ca21-4fef-b76f-9ae237e9c4ae");
350
	
351
	static NomenclaturalStatusType nomStatusTempNamed;
352
	
353
	public static NomenclaturalStatusType getNomStatusTempNamed(ITermService termService){
354
		if (nomStatusTempNamed == null){
355
			nomStatusTempNamed = (NomenclaturalStatusType)termService.find(uuidNomStatusTempNamed);
356
			if (nomStatusTempNamed == null){
357
				nomStatusTempNamed = NomenclaturalStatusType.NewInstance("temporary named", "temporary named", "temp. named", Language.ENGLISH());
358
				Representation repLatin = Representation.NewInstance("", "", "", Language.LATIN());
359
				nomStatusTempNamed.addRepresentation(repLatin);
360
				nomStatusTempNamed.setUuid(uuidNomStatusTempNamed);
361
				NomenclaturalStatusType.ALTERNATIVE().getVocabulary().addTerm(nomStatusTempNamed);
362
				termService.save(nomStatusTempNamed);
363
			}
364
		}
365
		return nomStatusTempNamed;
366
	}
367
	
368
}
(16-16/17)