Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/new data model #36

Merged
merged 22 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
53 changes: 0 additions & 53 deletions kubernetes-biocase.yaml

This file was deleted.

53 changes: 0 additions & 53 deletions kubernetes-dwca.yaml

This file was deleted.

35 changes: 28 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.2</version>
<version>3.1.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>eu.dissco.core</groupId>
Expand All @@ -19,11 +19,11 @@
<dwca-io.version>2.16</dwca-io.version>
<commons-beanutils.version>1.9.4</commons-beanutils.version>
<jaxb2-maven-plugin.version>3.1.0</jaxb2-maven-plugin.version>
<jakarta.activation-api.version>2.1.0</jakarta.activation-api.version>
<jakarta.xml.bind-api.version>4.0.0</jakarta.xml.bind-api.version>
<spring-kafka.version>3.0.10</spring-kafka.version>
<jakarta.activation-api.version>2.1.2</jakarta.activation-api.version>
<jakarta.xml.bind-api.version>4.0.1</jakarta.xml.bind-api.version>
<snappy-java.version>1.1.10.5</snappy-java.version>
<mockito-inline.version>5.2.0</mockito-inline.version>
<testcontainers.version>1.17.5</testcontainers.version>
<testcontainers.version>1.19.0</testcontainers.version>
<sonar.organization>dissco</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.coverage.jacoco.xmlReportPaths>../app-it/target/site/jacoco-aggregate/jacoco.xml
Expand Down Expand Up @@ -80,11 +80,11 @@
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
<!-- Overwrite kafka client snappy version as it contains high prio security issues (24-07-2023) -->
<!-- Overwrite kafka client snappy version as it contains high prio security issues (02-10-2023) -->
<dependency>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
<version>1.1.10.3</version>
<version>${snappy-java.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -273,6 +273,27 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<sourceDirectory>${basedir}/src/main/resources/json-schema/</sourceDirectory>
<targetPackage>eu.dissco.core.translator.schema</targetPackage>
<generateBuilders>true</generateBuilders>
<includeDynamicBuilders>true</includeDynamicBuilders>
<includeAdditionalProperties>false</includeAdditionalProperties>
</configuration>
<executions>
<execution>
<goals>
<goal>
generate
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
1 change: 1 addition & 0 deletions src/main/java/eu/dissco/core/translator/Profiles.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package eu.dissco.core.translator;

public class Profiles {

public static final String BIOCASE = "biocase";
public static final String DWCA = "dwca";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import jakarta.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
Expand All @@ -18,14 +19,16 @@ public class MappingComponent {
private final WebClientProperties properties;
private final MappingRepository repository;

@Getter
private final Map<String, String> fieldMappings = new HashMap<>();
@Getter
private final Map<String, String> defaults = new HashMap<>();

@PostConstruct
void setup() throws DisscoRepositoryException {
var objectNode = repository.retrieveMapping(properties.getSourceSystemId());
var mappingObject = objectNode.get("mapping");
if (mappingObject != null){
if (mappingObject != null) {
mappingObject.iterator().forEachRemaining(node -> node.fields()
.forEachRemaining(field -> fieldMappings.put(field.getKey(), field.getValue().asText())));
}
southeo marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -34,12 +37,4 @@ void setup() throws DisscoRepositoryException {
.forEachRemaining(field -> defaults.put(field.getKey(), field.getValue().asText())));
}

public Map<String, String> getFieldMappings() {
return fieldMappings;
}

public Map<String, String> getDefaultMappings() {
return defaults;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class RorComponent {
private final WebClient webClient;

@Cacheable("ror")
public String getRoRId(String ror) {
public String getRorName(String ror) {
log.info("Requesting organisation details for organisation: {} with ror", ror);
String url = "https://api.ror.org/organizations/" + ror;
var response = webClient.get().uri(url).retrieve().bodyToMono(JsonNode.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

@Configuration
public class ApplicationConfiguration {

public static final String DATE_STRING = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX";

@Bean
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 11 additions & 9 deletions src/main/java/eu/dissco/core/translator/database/jooq/Keys.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading