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 {
group = 'eu.dariah.de.minfba'
version = '1.19.0-SNAPSHOT'
version = '1.19.1-SNAPSHOT'
description = 'DARIAH-DE Search Commons'
sourceCompatibility = '1.8'
......@@ -57,7 +57,9 @@ dependencies {
implementation "de.unibamberg.minf.gtf:gtf-extension-dai:$gtfVersion"
implementation "de.unibamberg.minf.processing:processing:$processingVersion"
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-beans:$springVersion"
implementation "org.springframework:spring-core:$springVersion"
......
......@@ -75,7 +75,11 @@ public class DatamodelServiceImpl implements DatamodelService, InitializingBean
@Override
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
......@@ -90,6 +94,9 @@ public class DatamodelServiceImpl implements DatamodelService, InitializingBean
@Override
public ExtendedDatamodelContainer findById(String id) {
if (!this.schemaMap.containsKey(id)) {
logger.warn("Attempt to find nonexisting datamodel {}", id);
}
return this.schemaMap.get(id);
}
......@@ -166,19 +173,20 @@ public class DatamodelServiceImpl implements DatamodelService, InitializingBean
@Override
public boolean clearIndex(ExtendedDatamodelContainer sc, JsonNode mapping) {
if (adminService.dropIndex(sc.getIndexName())) {
if (adminService.getIndexExists(sc.getIndexName())) {
if (!adminService.dropIndex(sc.getIndexName())) {
logger.warn("Could not drop existing index [{}]", sc.getIndexName());
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;
}
return false;
}
@Override
......
......@@ -189,7 +189,7 @@ public class ResourceEnrichmentServiceImpl implements ResourceEnrichmentService
private String findProcessingRootElementId(String entityId) {
if (entityId!=null) {
ExtendedDatamodelContainer dmc = datamodelService.findById(entityId);
Nonterminal root = (Nonterminal)dmc.getOrRenderElementHierarchy();
Element root = dmc.getOrRenderElementHierarchy();
Element processingRoot = NonterminalImpl.findProcessingRoot(root);
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