Skip to content

Commit

Permalink
Mica without Opal (#4393)
Browse files Browse the repository at this point in the history
* #4376 WIP. StudyTableSource interface added. New property sourceURN replaces opal project/table in dataset's study tables and variables. Requires ES index config update.

* sourceURN property/getter/setter renamed to source

* source package added, with unit tests

* Excel table source added, reads excel from Mica's file system

* Edit/create study tables with opal or file source. WIP.

* File path can be copied. Study table's file source can be relative to the dataset's folder

* Study table context added. Opal dtos (aggregations) are not exposed in the source plugin interface.

* Deferred init of excel datasource. Less verbose log messages when study table source operation is not supported

* SPI mica-source testing

* Deferred attachment stream extraction

* Handle disposable table sources

* Mica source plugin could be an Initialisable

* #4381 Variable taxonomies service added to support other taxonomies providers, in addition to the opal one

* mica-source plugin type renamed to mica-tables. Ne plugin type: mica-taxonomies for loading taxonomies provider services.

* Taxonomy of taxonomies is configurable. Added attribute to have a taxonomy declared but not visible.

* Variable taxonomies can be read from local folder: MICA_HOME/conf/taxonomies/variable

* AbstractTaxonomiesProviderService added

* Caching of taxonomies refactored, not functional yet

* Variable taxonomies are cached

* Fix dataset taxonomy init

* Opal taxonomies cache replaced by generic variable taxonomies cache. Variable taxonomies are decorated with variable attributes

* Code cleaning: Opal service helper merged into opal service

* classifications administration

* make sure variable taxo title/description in the meta taxo matches the one of the original taxo

* hide instead of remove a target vocabulary if type is disabled

* Plugins REST API added

* Plugin REST API added

* Service Plugin REST API added

* Update the search plugin in the upgrade procedure

* ng-obiba-mica version

* No server error when opal projects cannot be retrieved

* Fix some wording and showVariableStatistics template setting added

* Fix some wording and showVariableStatistics template setting added

* Fix harmonized variable id encoding for url

* Fix harmonized variable id encoding for url for reverse proxy

* NoSuchTableSourceException added with their web service mapper

* ng-obiba-mica latest release

* prepare for upgrade to 5.2

* StudyTableSource does not need to return the table name, this is implementation specific

* Modifying the meta txonomy requires admin role

* Plugin management requires admin role

* Clean Opal projects web services

* Helper class to read a taxonomy in YAML format from a stream

* Other study table source handled in the admin
  • Loading branch information
ymarcon authored Feb 1, 2023
1 parent 6ea5af8 commit 2101d87
Show file tree
Hide file tree
Showing 150 changed files with 4,633 additions and 2,587 deletions.
4 changes: 4 additions & 0 deletions mica-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
<groupId>org.obiba.mica</groupId>
<artifactId>mica-web-model</artifactId>
</dependency>
<dependency>
<groupId>org.obiba.magma</groupId>
<artifactId>magma-datasource-excel</artifactId>
</dependency>
<dependency>
<groupId>com.codahale.metrics</groupId>
<artifactId>metrics-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import org.obiba.mica.core.service.MailService;
import org.obiba.mica.core.service.SchemaFormContentFileService;
import org.obiba.mica.core.support.IdentifierGenerator;
import org.obiba.mica.core.support.YamlClassPathResourceReader;
import org.obiba.mica.core.support.YamlResourceReader;
import org.obiba.mica.dataset.service.VariableSetService;
import org.obiba.mica.micaConfig.domain.DataAccessConfig;
import org.obiba.mica.micaConfig.service.DataAccessConfigService;
Expand Down Expand Up @@ -396,7 +396,7 @@ protected void setAndLogStatus(T request, DataAccessEntityStatus to) {
protected String generateId() {
DataAccessConfig dataAccessConfig = dataAccessConfigService.getOrCreateConfig();

Object exclusions = YamlClassPathResourceReader.read(EXCLUSION_IDS_YAML_RESOURCE_PATH, Map.class).get("exclusions");
Object exclusions = YamlResourceReader.readClassPath(EXCLUSION_IDS_YAML_RESOURCE_PATH, Map.class).get("exclusions");

IdentifierGenerator.Builder builder = IdentifierGenerator.newBuilder().prefix(dataAccessConfig.getIdPrefix())
.size(dataAccessConfig.getIdLength());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import org.obiba.mica.core.upgrade.Mica460Upgrade;
import org.obiba.mica.core.upgrade.Mica500Upgrade;
import org.obiba.mica.core.upgrade.Mica510upgrade;
import org.obiba.mica.core.upgrade.Mica520upgrade;
import org.obiba.mica.core.upgrade.MicaVersionModifier;
import org.obiba.mica.core.upgrade.RuntimeVersionProvider;
import org.obiba.runtime.upgrade.UpgradeManager;
Expand All @@ -31,8 +31,8 @@ public class UpgradeConfiguration {

private List<UpgradeStep> upgradeSteps;

public UpgradeConfiguration(Mica460Upgrade mica460Upgrade, Mica500Upgrade mica500Upgrade, Mica510upgrade mica510upgrade) {
upgradeSteps = Arrays.asList(mica460Upgrade, mica500Upgrade, mica510upgrade);
public UpgradeConfiguration(Mica460Upgrade mica460Upgrade, Mica500Upgrade mica500Upgrade, Mica520upgrade mica520upgrade) {
upgradeSteps = Arrays.asList(mica460Upgrade, mica500Upgrade, mica520upgrade);
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,32 @@

import com.google.common.base.MoreObjects;
import com.google.common.base.Strings;
import org.obiba.mica.core.source.OpalTableSource;

import java.io.Serializable;

public class BaseStudyTable extends OpalTable {
public class BaseStudyTable {

protected String studyId;

protected String populationId;

protected int populationWeight;

private LocalizedString name;

private LocalizedString description;

private LocalizedString additionalInformation;

private int weight;

private String source;

// legacy
private String project;

// legacy
private String table;

public String getStudyId() {
return studyId;
}
Expand Down Expand Up @@ -72,13 +87,66 @@ public void setPopulationWeight(int populationWeight) {

@Override
public String toString() {
return MoreObjects.toStringHelper(this).add("project", getProject()).add("table", getTable())
return MoreObjects.toStringHelper(this).add("source", getSource())
.add("studyId", getStudyId()).add("populationId", getPopulationId())
.toString();
}

@Override
protected String getEntityId() {
return studyId;
public void setName(LocalizedString name) {
this.name = name;
}

public LocalizedString getName() {
return name;
}

public void setDescription(LocalizedString description) {
this.description = description;
}

public LocalizedString getDescription() {
return description;
}

public LocalizedString getAdditionalInformation() {
return additionalInformation;
}

public void setAdditionalInformation(LocalizedString additionalInformation) {
this.additionalInformation = additionalInformation;
}

public int getWeight() {
return weight;
}

public void setWeight(int weight) {
this.weight = weight;
}

public boolean isFor(String studyId, String source) {
return this.studyId.equals(studyId) && getSource().equals(source);
}

public void setSource(String source) {
this.source = source;
}

public String getSource() {
// legacy
if (Strings.isNullOrEmpty(source)) {
this.source = OpalTableSource.newSource(project, table).getURN();
}
return source;
}

@Deprecated
public void setProject(String project) {
this.project = project;
}

@Deprecated
public void setTable(String table) {
this.table = table;
}
}
88 changes: 0 additions & 88 deletions mica-core/src/main/java/org/obiba/mica/core/domain/OpalTable.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

package org.obiba.mica.core.domain;

import java.io.Serializable;

import com.google.common.base.MoreObjects;

import java.io.Serializable;

/**
* Represents a opal table that is associated to a {@link org.obiba.mica.study.domain.Study}
* {@link org.obiba.mica.study.domain.Population} {@link org.obiba.mica.study.domain.DataCollectionEvent}.
Expand Down Expand Up @@ -63,7 +63,7 @@ public boolean appliesTo(String studyId, String populationId, String dataCollect

@Override
public String toString() {
return MoreObjects.toStringHelper(this).add("project", getProject()).add("table", getTable())
return MoreObjects.toStringHelper(this).add("source", getSource())
.add("dceId", getDataCollectionEventUId()).toString();
}

Expand Down
Loading

0 comments on commit 2101d87

Please sign in to comment.