Revision a96b340e
Added by Andreas Müller almost 9 years ago
app-import/src/main/java/eu/etaxonomy/cdm/app/berlinModelImport/EuroMedActivator.java | ||
---|---|---|
35 | 35 |
import eu.etaxonomy.cdm.io.berlinModel.BerlinModelTransformer; |
36 | 36 |
import eu.etaxonomy.cdm.io.berlinModel.in.BerlinModelImportConfigurator; |
37 | 37 |
import eu.etaxonomy.cdm.io.common.CdmDefaultImport; |
38 |
import eu.etaxonomy.cdm.io.common.CdmImportBase; |
|
38 | 39 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator.CHECK; |
39 | 40 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator.DO_REFERENCES; |
40 | 41 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator.EDITOR; |
41 | 42 |
import eu.etaxonomy.cdm.io.common.Source; |
42 | 43 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
43 | 44 |
import eu.etaxonomy.cdm.model.common.Language; |
45 |
import eu.etaxonomy.cdm.model.common.Marker; |
|
46 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
44 | 47 |
import eu.etaxonomy.cdm.model.common.Representation; |
48 |
import eu.etaxonomy.cdm.model.common.TermVocabulary; |
|
45 | 49 |
import eu.etaxonomy.cdm.model.description.Feature; |
46 | 50 |
import eu.etaxonomy.cdm.model.description.FeatureNode; |
47 | 51 |
import eu.etaxonomy.cdm.model.description.FeatureTree; |
... | ... | |
323 | 327 |
// //import shapefile attributes #3979 .2 |
324 | 328 |
if (config.isDoOccurrence() && (config.getCheck().isImport())){ |
325 | 329 |
|
326 |
UUID areaVocabularyUuid = BerlinModelTransformer.uuidVocEuroMedAreas;
|
|
330 |
UUID areaVocabularyUuid = BerlinModelTransformer.uuidVocEuroMedAreas; |
|
327 | 331 |
List<String> idSearchFields = Arrays.asList(new String[]{"EMAREA","PARENT"}); |
328 | 332 |
String wmsLayerName = "euromed_2013"; |
329 | 333 |
Set<UUID> areaUuidSet = null; |
... | ... | |
351 | 355 |
} |
352 | 356 |
} |
353 | 357 |
|
358 |
//5.Mark areas to be hidden #3979 .5 |
|
359 |
if (config.isDoOccurrence() && (config.getCheck().isImport())){ |
|
360 |
ICdmApplicationConfiguration app = bmImport.getCdmAppController(); |
|
354 | 361 |
|
362 |
MarkerType hiddenAreaMarkerType = MarkerType.NewInstance("", "Hidden area", null); |
|
363 |
hiddenAreaMarkerType.setUuid(BerlinModelTransformer.uuidHiddenArea); |
|
364 |
@SuppressWarnings("unchecked") |
|
365 |
TermVocabulary<MarkerType> vocUserDefinedMarkerTypes = app.getVocabularyService().find(CdmImportBase.uuidUserDefinedMarkerTypeVocabulary); |
|
366 |
if (vocUserDefinedMarkerTypes == null){ |
|
367 |
String message = "Marker type vocabulary could not be found. Hidden areas not added."; |
|
368 |
logger.error(message); |
|
369 |
System.out.println(message); |
|
370 |
}else{ |
|
371 |
vocUserDefinedMarkerTypes.addTerm(hiddenAreaMarkerType); |
|
372 |
app.getVocabularyService().saveOrUpdate(vocUserDefinedMarkerTypes); |
|
373 |
|
|
374 |
//Add hidden area marker to Rs(C) and Rs(N) |
|
375 |
NamedArea rs_c = (NamedArea)app.getTermService().find(BerlinModelTransformer.uuidRs_C); |
|
376 |
rs_c.addMarker(Marker.NewInstance(hiddenAreaMarkerType, true)); |
|
377 |
app.getTermService().saveOrUpdate(rs_c); |
|
378 |
NamedArea rs_n = (NamedArea)app.getTermService().find(BerlinModelTransformer.uuidRs_N); |
|
379 |
rs_n.addMarker(Marker.NewInstance(hiddenAreaMarkerType, true)); |
|
380 |
app.getTermService().saveOrUpdate(rs_n); |
|
381 |
} |
|
382 |
} |
|
355 | 383 |
|
356 | 384 |
System.out.println("End import from BerlinModel ("+ source.getDatabase() + ")..."); |
357 | 385 |
|
Also available in: Unified diff
Add hidden areas to Euro+Med import #3979 .5