Commit 4c6a9508 authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

Minor issues with transitive bcprov dependency, index creation

parent 8ed46308
...@@ -16,7 +16,7 @@ plugins { ...@@ -16,7 +16,7 @@ plugins {
group = 'eu.dariah.de.minfba' group = 'eu.dariah.de.minfba'
version = '1.19.0-SNAPSHOT' version = '1.19.1-SNAPSHOT'
description = 'DARIAH-DE Search Commons' description = 'DARIAH-DE Search Commons'
sourceCompatibility = '1.8' sourceCompatibility = '1.8'
...@@ -57,7 +57,9 @@ dependencies { ...@@ -57,7 +57,9 @@ dependencies {
implementation "de.unibamberg.minf.gtf:gtf-extension-dai:$gtfVersion" implementation "de.unibamberg.minf.gtf:gtf-extension-dai:$gtfVersion"
implementation "de.unibamberg.minf.processing:processing:$processingVersion" implementation "de.unibamberg.minf.processing:processing:$processingVersion"
implementation "eu.dariah.de:colreg-model:$colregModelVersion" implementation "eu.dariah.de:colreg-model:$colregModelVersion"
implementation "eu.dariah.de:dariahsp-core:$dariahSpVersion" implementation ("eu.dariah.de:dariahsp-core:$dariahSpVersion") {
exclude group: 'org.bouncycastle', module: 'bcprov-jdk15'
}
implementation "org.springframework:spring-context:$springVersion" implementation "org.springframework:spring-context:$springVersion"
implementation "org.springframework:spring-beans:$springVersion" implementation "org.springframework:spring-beans:$springVersion"
implementation "org.springframework:spring-core:$springVersion" implementation "org.springframework:spring-core:$springVersion"
......
...@@ -75,7 +75,11 @@ public class DatamodelServiceImpl implements DatamodelService, InitializingBean ...@@ -75,7 +75,11 @@ public class DatamodelServiceImpl implements DatamodelService, InitializingBean
@Override @Override
public ExtendedDatamodelContainer loadById(String modelId) { public ExtendedDatamodelContainer loadById(String modelId) {
return datamodelConfigDao.findById(modelId); ExtendedDatamodelContainer edc = datamodelConfigDao.findById(modelId);
if (edc==null) {
logger.warn("Attempt to load nonexisting datamodel {}", modelId);
}
return edc;
} }
@Override @Override
...@@ -90,6 +94,9 @@ public class DatamodelServiceImpl implements DatamodelService, InitializingBean ...@@ -90,6 +94,9 @@ public class DatamodelServiceImpl implements DatamodelService, InitializingBean
@Override @Override
public ExtendedDatamodelContainer findById(String id) { public ExtendedDatamodelContainer findById(String id) {
if (!this.schemaMap.containsKey(id)) {
logger.warn("Attempt to find nonexisting datamodel {}", id);
}
return this.schemaMap.get(id); return this.schemaMap.get(id);
} }
...@@ -166,18 +173,19 @@ public class DatamodelServiceImpl implements DatamodelService, InitializingBean ...@@ -166,18 +173,19 @@ public class DatamodelServiceImpl implements DatamodelService, InitializingBean
@Override @Override
public boolean clearIndex(ExtendedDatamodelContainer sc, JsonNode mapping) { public boolean clearIndex(ExtendedDatamodelContainer sc, JsonNode mapping) {
if (adminService.dropIndex(sc.getIndexName())) { if (adminService.getIndexExists(sc.getIndexName())) {
adminService.putMapping(sc.getIndexName(), mapping); if (!adminService.dropIndex(sc.getIndexName())) {
logger.warn("Could not drop existing index [{}]", sc.getIndexName());
boolean outdated = adminService.getIsOutdated(sc.getIndexName(), mapping); return false;
if (sc.isOutdated()!=outdated) {
sc.setOutdated(outdated);
this.saveOrUpdate(sc);
} }
return true;
} }
return false; adminService.putMapping(sc.getIndexName(), mapping);
boolean outdated = adminService.getIsOutdated(sc.getIndexName(), mapping);
if (sc.isOutdated()!=outdated) {
sc.setOutdated(outdated);
this.saveOrUpdate(sc);
}
return true;
} }
......
...@@ -189,7 +189,7 @@ public class ResourceEnrichmentServiceImpl implements ResourceEnrichmentService ...@@ -189,7 +189,7 @@ public class ResourceEnrichmentServiceImpl implements ResourceEnrichmentService
private String findProcessingRootElementId(String entityId) { private String findProcessingRootElementId(String entityId) {
if (entityId!=null) { if (entityId!=null) {
ExtendedDatamodelContainer dmc = datamodelService.findById(entityId); ExtendedDatamodelContainer dmc = datamodelService.findById(entityId);
Nonterminal root = (Nonterminal)dmc.getOrRenderElementHierarchy(); Element root = dmc.getOrRenderElementHierarchy();
Element processingRoot = NonterminalImpl.findProcessingRoot(root); Element processingRoot = NonterminalImpl.findProcessingRoot(root);
return processingRoot==null ? root.getId() : processingRoot.getId(); return processingRoot==null ? root.getId() : processingRoot.getId();
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment