Commit c5220d2b authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

Updated some dependency versions

parent 667728cd
Pipeline #31158 passed with stage
in 1 minute and 17 seconds
......@@ -28,12 +28,14 @@ import eu.dariah.de.search.pojo.DatasetPojo;
import eu.dariah.de.search.pojo.DatasourcePojo;
import eu.dariah.de.search.pojo.EndpointPojo;
import eu.dariah.de.search.pojo.conversion.CollectionConverter;
import eu.dariah.de.search.query.execution.AggregationService;
import eu.dariah.de.search.service.CollectionService;
import eu.dariah.de.search.service.DatamodelService;
@Controller
@RequestMapping("/collections")
public class CollectionController extends BaseController {
@Autowired private AggregationService aggregationService;
@Autowired private CollectionService collectionService;
@Autowired private CollectionConverter collectionConverter;
@Autowired private CollectionSyncService crSyncService;
......@@ -72,7 +74,7 @@ public class CollectionController extends BaseController {
for (EndpointPojo ep : c.getEndpoints()) {
for (DatasetPojo ds : ep.getDatasetPojos()) {
if (ds.getDatamodelPojo().getIndexName()!=null && !ds.getDatamodelPojo().getIndexName().isEmpty()) {
ds.setDocs(datamodelService.getDocumentCount(ds.getDatamodelPojo().getIndexName(), ep.getId()));
ds.setDocs(aggregationService.getDocumentCount(ds.getDatamodelPojo().getIndexName(), ep.getId()));
}
datasources.add(new DatasourcePojo(c, ep, ds));
}
......
......@@ -33,6 +33,7 @@ import eu.dariah.de.search.pojo.DatasetPojo;
import eu.dariah.de.search.pojo.EndpointPojo;
import eu.dariah.de.search.pojo.conversion.CollectionConverter;
import eu.dariah.de.search.pojo.conversion.CrawlConverter;
import eu.dariah.de.search.query.execution.AggregationService;
import eu.dariah.de.search.query.execution.DocumentService;
import eu.dariah.de.search.service.CrawlService;
import eu.dariah.de.search.service.CrawlService.CrawlCompleteFlag;
......@@ -44,7 +45,7 @@ import eu.dariah.de.search.service.DatamodelService;
@Controller
@RequestMapping("/collections/{cId}/")
public class CollectionEditorController extends BaseController {
@Autowired private AggregationService aggregationService;
@Autowired private CollectionService collectionService;
@Autowired private CollectionConverter collectionConverter;
......@@ -86,7 +87,7 @@ public class CollectionEditorController extends BaseController {
ExtendedDatamodelContainer esc = datamodelService.findById(dmId);
ModelActionPojo result = new ModelActionPojo();
if (esc!=null) {
result.setPojo(datamodelService.getDocumentCount(esc.getIndexName(), epId));
result.setPojo(aggregationService.getDocumentCount(esc.getIndexName(), epId));
result.setSuccess(true);
}
return result;
......@@ -233,7 +234,7 @@ public class CollectionEditorController extends BaseController {
for (DatasetPojo ds : ep.getDatasetPojos()) {
esc = datamodelService.findById(ds.getId());
if (esc!=null) {
ds.setDocs(datamodelService.getDocumentCount(esc.getIndexName(), ep.getId()));
ds.setDocs(aggregationService.getDocumentCount(esc.getIndexName(), ep.getId()));
}
if (dmId==null || ds.getId().equals(dmId)) {
dmId = ds.getId();
......
......@@ -32,11 +32,13 @@ import eu.dariah.de.search.mapping.MappingGenerationService;
import eu.dariah.de.search.model.ExtendedDatamodelContainer;
import eu.dariah.de.search.pojo.DatamodelPojo;
import eu.dariah.de.search.pojo.conversion.DatamodelConverter;
import eu.dariah.de.search.query.execution.AggregationService;
import eu.dariah.de.search.service.DatamodelService;
@Controller
@RequestMapping("/datamodels")
public class DatamodelController extends BaseController {
@Autowired private AggregationService aggregationService;
@Autowired private DatamodelService datamodelService;
@Autowired private DatamodelConverter datamodelConverter;
@Autowired private MappingGenerationService mappingGenerationService;
......@@ -79,7 +81,7 @@ public class DatamodelController extends BaseController {
}
dmPojo = datamodelConverter.convert(dm);
if (!dmPojo.isDeleted()) {
dmPojo.setDocs(datamodelService.getDocumentCount(dmPojo.getIndexName()));
dmPojo.setDocs(aggregationService.getDocumentCount(dmPojo.getIndexName()));
}
dmPojos.add(dmPojo);
}
......
......@@ -16,6 +16,8 @@ public interface AggregationService {
// Count all of index
public long getDocumentCount(String indexName);
// Count for index and endpointId
public long getDocumentCount(String indexName, String endpointId);
// Count all by query and index
public long getDocumentCount(String indexName, QueryBuilder qry);
......
......@@ -48,6 +48,11 @@ public class AggregationServiceImpl extends BaseQueryService implements Aggregat
return searchService.count(qry, indexName);
}
@Override
public long getDocumentCount(String indexName, String endpointId) {
return this.getDocumentCount(indexName, QueryBuilders.termQuery(Constants.ELEMENT_KEY_ENDPOINT_ID, endpointId));
}
@Override
public long getDocumentCount(QueryBuilder qry) {
return searchService.count(qry);
......
......@@ -29,11 +29,7 @@ public interface DatamodelService {
public List<ExtendedDatamodelContainer> findAll(boolean rebuildCache);
//public void saveOrUpdate(ExtendedDatamodelContainer sc, JsonNode mapping);
public long getDocumentCount(String indexName);
public long getDocumentCount(String indexName, String endpointId);
/**
* Loads individual datamodel from storage. All caching mechanisms of the DatamodelService are bypassed.
*
......
......@@ -4,22 +4,17 @@ import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import org.elasticsearch.index.query.QueryBuilders;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;
import com.fasterxml.jackson.databind.JsonNode;
import de.unibamberg.minf.dme.model.datamodel.base.Datamodel;
import eu.dariah.de.search.Constants;
import eu.dariah.de.search.dao.fs.DatamodelConfigDao;
import eu.dariah.de.search.es.service.AdminService;
import eu.dariah.de.search.model.ExtendedDatamodelContainer;
import eu.dariah.de.search.query.execution.AggregationService;
@Component
public class DatamodelServiceImpl implements DatamodelService, InitializingBean {
......@@ -27,7 +22,6 @@ public class DatamodelServiceImpl implements DatamodelService, InitializingBean
@Autowired private DatamodelConfigDao datamodelConfigDao;
@Autowired private AdminService adminService;
@Autowired private AggregationService aggregationService;
// Hashtable is synchronized
private Hashtable<String, ExtendedDatamodelContainer> schemaMap;
......@@ -158,18 +152,6 @@ public class DatamodelServiceImpl implements DatamodelService, InitializingBean
logger.error("Failed to drop index of deleted datamodel", e);
}
}
@Override
public long getDocumentCount(String indexName, String endpointId) {
Assert.notNull(endpointId);
return aggregationService.getDocumentCount(indexName, QueryBuilders.termQuery(Constants.ELEMENT_KEY_ENDPOINT_ID, endpointId));
}
@Override
public long getDocumentCount(String indexName) {
return aggregationService.getDocumentCount(indexName);
}
@Override
public boolean clearIndex(ExtendedDatamodelContainer sc, JsonNode mapping) {
......
......@@ -133,12 +133,12 @@ public class WebConfig implements WebMvcConfigurer {
return initService;
}
@Bean
/*@Bean
public LocaleResolver localeResolver() {
final SessionLocaleResolver localeResolver = new SessionLocaleResolver();
localeResolver.setDefaultLocale(new Locale("de", "DE"));
return localeResolver;
}
}*/
@Bean
public UserLocaleChangeInterceptor localeChangeInterceptor() {
......
Markdown is supported
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