Search in sources :

Example 16 with MicaConfig

use of org.obiba.mica.micaConfig.domain.MicaConfig in project mica2 by obiba.

the class TaxonomyService method initializeTaxonomyTaxonomy.

private void initializeTaxonomyTaxonomy() {
    if (taxonomyTaxonomy != null)
        return;
    taxonomyTaxonomy = copy(micaConfigService.getTaxonomyTaxonomy());
    MicaConfig config = micaConfigService.getConfig();
    if (!config.isNetworkEnabled() || config.isSingleNetworkEnabled()) {
        taxonomyTaxonomy.removeVocabulary("network");
    }
    if (!config.isStudyDatasetEnabled() && !config.isHarmonizationDatasetEnabled()) {
        taxonomyTaxonomy.removeVocabulary("dataset");
        taxonomyTaxonomy.removeVocabulary("variable");
    }
    if (config.isSingleStudyEnabled() && !config.isHarmonizationDatasetEnabled()) {
        taxonomyTaxonomy.removeVocabulary("study");
    }
}
Also used : MicaConfig(org.obiba.mica.micaConfig.domain.MicaConfig)

Aggregations

MicaConfig (org.obiba.mica.micaConfig.domain.MicaConfig)16 JsonNode (com.fasterxml.jackson.databind.JsonNode)3 IOException (java.io.IOException)2 Before (org.junit.Before)2 Test (org.junit.Test)2 HarmonizationDataset (org.obiba.mica.dataset.domain.HarmonizationDataset)2 StudyDataset (org.obiba.mica.dataset.domain.StudyDataset)2 Timed (com.codahale.metrics.annotation.Timed)1 Strings (com.google.common.base.Strings)1 Lists (com.google.common.collect.Lists)1 Maps (com.google.common.collect.Maps)1 File (java.io.File)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Collectors (java.util.stream.Collectors)1 Nullable (javax.annotation.Nullable)1 Inject (javax.inject.Inject)1