Project

General

Profile

« Previous | Next » 

Revision 9a6fb38b

Added by Andreas Müller almost 9 years ago

Improve E+M-Activator and E+M occurrence import

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/io/berlinModel/in/BerlinModelOccurrenceImport.java
164 164
			NamedArea newArea = makeSingleEuroMedArea(rs, eurMarkerType, euroMedAreaMarkerType,
165 165
					isoCodeExtType, tdwgCodeExtType, mclCodeExtType,
166 166
					areaLevelTop, areaLevelEm1 , areaLevelEm2, sourceReference, euroMedArea, lastLevel2Area);
167
			euroMedAreas.addTerm(newArea);
168
			if (newArea.getPartOf().equals(euroMedArea)){
169
				lastLevel2Area = newArea;
167
			if (newArea != null){
168
    			euroMedAreas.addTerm(newArea);
169
    			if (newArea.getPartOf().equals(euroMedArea)){
170
    				lastLevel2Area = newArea;
171
    			}
170 172
			}
171
			getVocabularyService().saveOrUpdate(euroMedAreas);
172 173
		}
174
		getVocabularyService().saveOrUpdate(euroMedAreas);
173 175

  
174 176
		commitTransaction(txStatus);
175 177
		logger.warn("Created E+M areas");
......
219 221
		String mclCode = nullSafeTrim(rs.getString("MCLCode"));
220 222
		String geoSearch = nullSafeTrim(rs.getString("NameForGeoSearch"));
221 223

  
224

  
225

  
222 226
		if (isBlank(emCode)){
223 227
			emCode = unit;
224 228
		}
......
232 236
			if (uuid != null){
233 237
				area.setUuid(uuid);
234 238
			}else{
235
				logger.warn("Uuuid for emCode could not be defined: " + emCode);
239
			    if (areaId == 211 || areaId == 213){  //Additional Azores and Canary Is. area are merged into primary area, see also area.addSource part below
240
			        return null;
241
			    }
242
				logger.warn("Uuid for emCode could not be defined: " + emCode);
236 243
			}
237 244
		}
238 245

  
......
263 270

  
264 271
		//source
265 272
		area.addSource(OriginalSourceType.Import, String.valueOf(areaId), EM_AREA_NAMESPACE, sourceReference, null);
273
		//add duplicate area ids for canary
274
		if (areaId == 624){ //Canary Is.
275
		    area.addSource(OriginalSourceType.Import, String.valueOf(213), EM_AREA_NAMESPACE, sourceReference, null);
276
		}
277
		if (areaId == 210){//Azores
278
            area.addSource(OriginalSourceType.Import, String.valueOf(211), EM_AREA_NAMESPACE, sourceReference, null);
279
        }
266 280

  
267 281
		//parent
268 282
		if (euroMedArea != null){

Also available in: Unified diff