Commit 9e339bd9 authored by Matija Obreza's avatar Matija Obreza

Merge branch '25-filter-accessions-by-georegion' into 'master'

Resolve "Filter accessions by GeoRegion"

Closes #25

See merge request !12
parents 2ee0ffbf 892b0ec1
......@@ -85,5 +85,8 @@ public interface FilterConstants {
public static final String PDCI = "pdci";
public static final String REGION_ORIGIN = "regionOrigin";
public static final String REGION_HOLD_INSTITUTE= "regionHoldInst";
}
......@@ -41,4 +41,5 @@ public interface GenesysFilterService {
void listGeoTile(boolean distinct, AppliedFilters filters, Integer limit, int zoom, int xtile, int ytile, RowCallbackHandler rowHandler);
AppliedFilters transformFiltersIfNeed(AppliedFilters appliedFilters);
}
......@@ -7,6 +7,7 @@ import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.util.List;
import java.util.Locale;
public interface GeoRegionService {
......@@ -18,10 +19,16 @@ public interface GeoRegionService {
List<GeoRegion> findAll();
List<GeoRegion> findAll(Locale locale);
void updateGeoRegionData() throws IOException, ParserConfigurationException, SAXException;
GeoRegion getRegion(Country country);
List<GeoRegion> getGeoRegionsForFilter();
List<GeoRegion> conversionToSubRegionsList(GeoRegion parentGeo);
List<GeoRegion> getChildren(String regionIsoCode);
}
......@@ -99,6 +99,9 @@ public class ElasticsearchSearchServiceImpl implements ElasticService, Initializ
@Autowired
private FilterHandler filterHandler;
@Autowired
private GenesysFilterService filterService;
private final Map<String, Class<?>> clazzMap;
@Autowired
......@@ -160,6 +163,7 @@ public class ElasticsearchSearchServiceImpl implements ElasticService, Initializ
@Override
public String getBoundingBox(final AppliedFilters filters) {
filterService.transformFiltersIfNeed(filters);
AndFilterBuilder filterBuilder = getFilterBuilder(filters);
final FilterAggregationBuilder builder = AggregationBuilders
......@@ -223,6 +227,8 @@ public class ElasticsearchSearchServiceImpl implements ElasticService, Initializ
*/
@Override
public TermResult termStatisticsAuto(AppliedFilters appliedFilters, String term, int size) throws SearchException {
filterService.transformFiltersIfNeed(appliedFilters);
TermResult termResult = null;
int newSize = size;
do {
......
......@@ -81,6 +81,8 @@ public class FilterHandler {
this.availableFilters.add(new BasicFilter(FilterConstants.CROPNAME, DataType.STRING));
this.availableFilters.add(new BasicFilter(FilterConstants.LISTS, DataType.STRING));
this.availableFilters.add(new BasicFilter(FilterConstants.REGION_ORIGIN, DataType.STRING));
this.availableFilters.add(new BasicFilter(FilterConstants.REGION_HOLD_INSTITUTE, DataType.STRING));
this.availableFilters.add(new I18nListFilter<Integer>(FilterConstants.SAMPSTAT, DataType.NUMERIC).build("accession.sampleStatus",
new Integer[] { 100, 110, 120, 130, 200, 300, 400, 410, 411, 412, 413, 414, 415, 416, 420, 421, 422, 423, 500, 600, 999 }));
this.availableFilters.add(new AutocompleteFilter(FilterConstants.TAXONOMY_GENUS, "/explore/ac/" + FilterConstants.TAXONOMY_GENUS));
......@@ -89,7 +91,7 @@ public class FilterHandler {
this.availableFilters.add(new AutocompleteFilter(FilterConstants.TAXONOMY_SCINAME, "/explore/ac/" + FilterConstants.TAXONOMY_SCINAME));
this.availableFilters.add(new AutocompleteFilter(FilterConstants.ORGCTY_ISO3, "/explore/ac/" + FilterConstants.ORGCTY_ISO3));
this.availableFilters.add(new AutocompleteFilter(FilterConstants.INSTITUTE_COUNTRY_ISO3, "/explore/ac/" + FilterConstants.ORGCTY_ISO3));
this.availableFilters.add(new AutocompleteFilter(FilterConstants.INSTITUTE_COUNTRY_ISO3, "/explore/ac/" + FilterConstants.INSTITUTE_COUNTRY_ISO3));
this.availableFilters.add(new BasicFilter(FilterConstants.GEO_LATITUDE, DataType.NUMERIC));
this.availableFilters.add(new BasicFilter(FilterConstants.GEO_LONGITUDE, DataType.NUMERIC));
this.availableFilters.add(new BasicFilter(FilterConstants.GEO_ELEVATION, DataType.NUMERIC));
......@@ -135,6 +137,17 @@ public class FilterHandler {
return null;
}
public List<GenesysFilter> getAdditionalFilters(String[] selectedFilters) {
List<String> gmFilterList = new ArrayList<>();
for (String filter : selectedFilters) {
if (filter.startsWith("gm:")) {
gmFilterList.add(filter);
}
}
String[] gmFilters = gmFilterList.toArray(new String[gmFilterList.size()]);
return selectFilters(gmFilters);
}
public List<GenesysFilter> selectFilters(String[] selectedFilters) {
LOG.debug("Loading filter definitions sel=" + ArrayUtils.toString(selectedFilters));
final List<GenesysFilter> filters = new ArrayList<GenesysFilter>();
......
......@@ -2,7 +2,10 @@ package org.genesys2.server.service.impl;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
import java.util.stream.Collectors;
......@@ -17,6 +20,7 @@ import org.genesys2.server.service.worker.GeoRegionDataCLDR;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.xml.sax.SAXException;
......@@ -83,6 +87,18 @@ public class GeoRegionServiceImpl implements GeoRegionService {
return geoRegionRepository.findAll();
}
@Override
public List<GeoRegion> findAll(final Locale locale) {
final List<GeoRegion> all = findAll();
Collections.sort(all, new Comparator<GeoRegion>() {
@Override
public int compare(GeoRegion o1, GeoRegion o2) {
return o1.getName(locale).compareTo(o2.getName(locale));
}
});
return all;
}
@Override
@Transactional(readOnly = false)
public void updateGeoRegionData() throws IOException, ParserConfigurationException, SAXException {
......@@ -125,6 +141,40 @@ public class GeoRegionServiceImpl implements GeoRegionService {
}
}
@Override
public List<GeoRegion> getGeoRegionsForFilter() {
List<GeoRegion> geoRegionList = findAll();
geoRegionList.removeIf(geoRegion -> geoRegion.getName().equals("World") || geoRegion.getName().equals("Americas"));
List<GeoRegion> resultList = new ArrayList<>();
for (GeoRegion geoRegion: geoRegionList) {
if (geoRegion.getParentRegion().getName().equals("World") || geoRegion.getParentRegion().getName().equals("Americas")) {
geoRegion.setParentRegion(null);
resultList.add(geoRegion);
}
else resultList.add(geoRegion);
}
Locale locale = LocaleContextHolder.getLocale();
resultList.sort(Comparator.comparing(o -> o.getName(locale)));
return resultList;
}
@Override
public List<GeoRegion> conversionToSubRegionsList(final GeoRegion parentGeo) {
List<GeoRegion> geoRegionList = findAll();
List<GeoRegion> subRegionsList = new ArrayList<>();
geoRegionList.removeIf(geoRegion -> geoRegion.getName().equals("World"));
subRegionsList.addAll(geoRegionList.stream().
filter(geoRegion -> parentGeo.getName().equals(geoRegion.getParentRegion().getName()))
.collect(Collectors.toList()));
return subRegionsList;
}
private boolean isChild(GeoRegion region, String parentIsoCode) {
return region.getParentRegion() != null && (region.getParentRegion().getIsoCode().equals(parentIsoCode) || isChild(region.getParentRegion(), parentIsoCode));
......
......@@ -154,6 +154,7 @@ public class MappingServiceImpl implements MappingService {
@Override
@Cacheable(value = "tileserver", key = "'tile-' + #zoom + '-' + #xtile + '-' + #ytile + '-' + #filters")
public byte[] getTile(AppliedFilters filters, final int zoom, final int xtile, final int ytile) {
filterService.transformFiltersIfNeed(filters);
final BufferedImage bi = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB);
// final int pixelSize = (int) Math.round(1.0 + (1 << (zoom / 2))) / 2;
......
......@@ -430,6 +430,8 @@ filter.seqNo=Detected sequential number
filter.alias=Accession name
filter.crops=Crop name
filter.cropName=Provided crop name
filter.regionOfOrigin=Region of Origin
filter.regionOfHoldingInstitute=Region of Holding Institute
filter.orgCty.iso3=Country of Origin
filter.institute.code=Holding Institute name
filter.institute.country.iso3=Country of holding institute
......
......@@ -77,38 +77,38 @@ var BrowseUtil = {
},
applySuggestions: function (jsonData, messages) {
$.ajax({
url: '/explore/listFilterSuggestions',
method: 'get',
data: {
filter: JSON.stringify(jsonData)
},
success: function (response) {
BrowseUtil.renderListFilterSuggestions(response, messages);
}
});
$.ajax({
url: '/explore/booleanSuggestions',
method: 'get',
data: {
filter: JSON.stringify(jsonData)
},
success: function (response) {
BrowseUtil.renderBooleanSuggestions(response);
}
});
$.ajax({
url: '/explore/cropSuggestions',
method: 'get',
data: {
filter: JSON.stringify(jsonData)
},
success: function (response) {
BrowseUtil.renderCropSuggestions(response);
}
});
$.ajax({
url: '/explore/listFilterSuggestions',
method: 'get',
data: {
filter: JSON.stringify(jsonData)
},
success: function (response) {
BrowseUtil.renderListFilterSuggestions(response, messages);
}
});
$.ajax({
url: '/explore/booleanSuggestions',
method: 'get',
data: {
filter: JSON.stringify(jsonData)
},
success: function (response) {
BrowseUtil.renderBooleanSuggestions(response);
}
});
$.ajax({
url: '/explore/cropSuggestions',
method: 'get',
data: {
filter: JSON.stringify(jsonData)
},
success: function (response) {
BrowseUtil.renderCropSuggestions(response);
}
});
},
enableFilter: function (btn, jsonData) {
......
......@@ -372,6 +372,21 @@ var GenesysFilterUtil = {
var GenesysFilter = {
normKey : GenesysFilterUtil.normKey,
// add filter with select option
filterSelectList: function (element, jsonData) {
var key = $(element).attr('i-key');
var optionSelected = element.find('option:selected');
var valueSelected = optionSelected.val();
var textSelected = optionSelected.text();
if (!GenesysFilterUtil.existInJson(valueSelected, key, jsonData)) {
GenesysFilterUtil.appendHtml(key, textSelected, valueSelected, element);
jsonData[key] = GenesysFilterUtil.collectData(key, valueSelected, jsonData);
$('.geo-switcher option').removeAttr('selected').filter('[value=empty]').attr('selected', true);
}
return jsonData;
},
// add filter with autocomplete or exact field
filterAutocomplete : function(element, jsonData) {
......
......@@ -49,7 +49,7 @@
<!--Filters-->
<filters:filter-list availableFilters="${availableFilters}" filters="${filters}"
additionalFilters="${additionalFilters}" appliedFilters="${appliedFilters}"
crops="${crops}" crop="${crop}"/>
crops="${crops}" crop="${crop}" geoRegions="${geoRegions}"/>
<!--List-->
<div class="col-lg-10 col-md-9 col-sm-9 col-xs-12 main-col-header">
<div class="nav-header clearfix">
......@@ -352,6 +352,13 @@
}
});
$("body").on("change", ".geo-switcher", function () {
if (jsonData[$(this).attr("i-key")] === undefined) {
BrowseUtil.enableFilter(this, jsonData);
}
GenesysFilter.filterSelectList($(this), jsonData);
});
$("body").on("click", ".filter-list", function () {
if (jsonData[$(this).attr("i-key")] === undefined) {
BrowseUtil.enableFilter(this, jsonData);
......
......@@ -11,6 +11,10 @@ var messages = new Array();
messages["geo.iso3166-3.<spring:message text='${country.getCode3()}' javaScriptEscape='true'/>"] = "<c:out value='${country.getName(locale)}'/>";
</c:forEach>
<c:forEach var="geoRegion" items="${geoRegions}">
messages["<spring:message text='${geoRegion.getName()}' javaScriptEscape='true'/>"] = "<c:out value='${geoRegion.getName(locale)}'/>";
</c:forEach>
<c:forEach items="${cropsNames}" var="cropName">
messages["${cropName.key}"] = "${cropName.value}";
</c:forEach>
\ No newline at end of file
......@@ -24,7 +24,7 @@
<div class="">
<filters:filter-list availableFilters="${availableFilters}" filters="${filters}"
additionalFilters="${additionalFilters}" appliedFilters="${appliedFilters}"
crops="${crops}" crop="${crop}"/>
crops="${crops}" crop="${crop}" geoRegions="${geoRegions}"/>
<div class="col-lg-10 col-md-9 col-sm-9 col-xs-12 main-col-header">
<div class="nav-header clearfix">
......@@ -272,6 +272,13 @@
}
});
$("body").on("change", ".geo-switcher", function () {
if (jsonData[$(this).attr("i-key")] === undefined) {
BrowseUtil.enableFilter(this, jsonData);
}
GenesysFilter.filterSelectList($(this), jsonData);
});
$("body").on("click", ".filter-list", function () {
if (jsonData[$(this).attr("i-key")] === undefined) {
BrowseUtil.enableFilter(this, jsonData);
......
......@@ -29,8 +29,9 @@
<div class="">
<%-- filter list --%>
<filters:filter-list availableFilters="${availableFilters}" filters="${filters}"
appliedFilters="${appliedFilters}" crops="${crops}" crop="${crop}"/>
<filters:filter-list availableFilters="${availableFilters}" filters="${filters}"
additionalFilters="${additionalFilters}" appliedFilters="${appliedFilters}"
crops="${crops}" crop="${crop}" geoRegions="${geoRegions}"/>
<div class="col-lg-10 col-md-9 col-sm-9 col-xs-12 main-col-header">
<div class="nav-header clearfix">
......@@ -187,20 +188,12 @@
$("body").on("keypress", ".string-type", function (e) {
if (e.keyCode == 13) {
console.log("press")
var btn = $(this).parent().find("button");
console.log("1")
var selectedValue = $(this).parent().parent().find(".like-switcher option:selected").val();
console.log("2")
if (selectedValue == "like") {
GenesysFilter.filterLike(btn, jsonData, BrowseUtil.i18nFilterMessage);
} else {
console.log("btn", btn)
console.log("jsonData", jsonData)
console.log("03")
GenesysFilter.filterAutocomplete(btn, jsonData);
console.log("04")
}
}
});
......@@ -218,6 +211,13 @@
}
});
$("body").on("change", ".geo-switcher", function () {
if (jsonData[$(this).attr("i-key")] === undefined) {
BrowseUtil.enableFilter(this, jsonData);
}
GenesysFilter.filterSelectList($(this), jsonData);
});
$("body").on("click", ".filter-list", function () {
if (jsonData[$(this).attr("i-key")] === undefined) {
BrowseUtil.enableFilter(this, jsonData);
......@@ -308,9 +308,7 @@
var stepValue = (parseInt(localStorage.getItem("historyStep")) + 1);
localStorage.setItem("historyStep", stepValue);
document.getElementById('loading-popup-id').style.display = "block";
console.log("json data appl1", jsonData);
BrowseUtil.cleanJsonData(jsonData);
console.log("json data appl2", jsonData);
var filter = JSON.stringify(jsonData);
var requestUrl = '//' + location.host + location.pathname + "/json" +
......
......@@ -4,6 +4,7 @@
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ attribute name="geoRegions" required="true" type="java.util.List" %>
<%@ attribute name="additionalFilters" required="false" type="java.util.List" %>
<%@ attribute name="availableFilters" required="true" type="java.util.Map" %>
<%@ attribute name="filters" required="true" type="java.util.Map" %>
......@@ -44,6 +45,11 @@
appliedFilters="${appliedFilters}" type="autocomplete"/>
</filters:panel>
<filters:panel id="regionOfHoldingInstitute" title="filter.regionOfHoldingInstitute">
<filters:filter availableFilters="${availableFilters}" filterMap="${filters}" filterKey="regionHoldInst"
appliedFilters="${appliedFilters}" type="geoSelect"/>
</filters:panel>
<filters:panel id="instcountry" title="filter.institute.country.iso3">
<filters:filter availableFilters="${availableFilters}" filterMap="${filters}"
filterKey="institute.country.iso3" appliedFilters="${appliedFilters}"
......@@ -104,6 +110,11 @@
appliedFilters="${appliedFilters}" type="option"/>
</filters:panel>
<filters:panel id="regionOfOrigin" title="filter.regionOfOrigin">
<filters:filter availableFilters="${availableFilters}" filterMap="${filters}" filterKey="regionOrigin"
appliedFilters="${appliedFilters}" type="geoSelect"/>
</filters:panel>
<filters:panel id="origcty" title="filter.orgCty.iso3">
<filters:filter availableFilters="${availableFilters}" filterMap="${filters}"
filterKey="orgCty.iso3"
......
......@@ -13,6 +13,7 @@
<%@ attribute name="type" required="true" type="java.lang.String" %>
<%@ attribute name="cropList" required="false" type="java.util.Map" %>
<%@ attribute name="currentCrop" required="false" type="org.genesys2.server.model.impl.Crop" %>
<%@ attribute name="geoRegions" required="false" type="java.util.List" %>
<spring:message code="filter.internal.message.between" var="between" arguments=" "/>
<spring:message code="filter.internal.message.and" var="varEnd" arguments=" "/>
......@@ -26,6 +27,7 @@
<c:set var="filter" value="${availableFilters[filterKey]}"/>
<c:set var="normalizedKey" value="${filter.key.replace('.', '-').replace(':', '_')}"/>
<c:set var="appliedFilter" value="${appliedFilters.get(filter.key)}"/>
<c:set var="localeCode" value='"${pageContext.response.locale}"' />
<div id="collapse_filt_${filterKey}" class="${filterKey} col-xs-12">
......@@ -46,6 +48,37 @@
</c:forEach>
<!-- </select> -->
</c:when>
<c:when test="${type eq 'geoSelect'}">
<span class="glyphicon glyphicon-menu-down"></span>
<select class="form-control geo-switcher" i-key="${filterKey}" >
<option value="empty"></option>
<c:forEach items="${geoRegions}" var="geoRegion">
<c:if test="${geoRegion.parentRegion eq null}">
<c:set var="string" value="${geoRegion.nameL}"/>
<c:set var="index" value="${fn:indexOf(string, localeCode )}"/>
<c:set var="string" value="${fn:substring(geoRegion.nameL, index, fn:length(geoRegion.nameL))}" />
<c:set var="string" value="${fn:substring(string, 6, fn:length(geoRegion.nameL))}" />
<c:set var="index" value="${fn:indexOf(string, '\"' )}"/>
<c:set var="string" value="${fn:substring(string, 0, index)}" />
<optgroup label="${string}">
<option value="${geoRegion.isoCode}">${string}</option>
<c:forEach items="${geoRegions}" var="subRegion">
<c:remove var="string"/>
<c:if test="${subRegion.parentRegion.name eq geoRegion.name}">
<c:set var="string" value="${subRegion.nameL}"/>
<c:set var="index" value="${fn:indexOf(string, localeCode )}"/>
<c:set var ="string" value="${fn:substring(subRegion.nameL, index, fn:length(subRegion.nameL))}" />
<c:set var="string" value="${fn:substring(string, 6, fn:length(subRegion.nameL))}" />
<c:set var="index" value="${fn:indexOf(string, '\"' )}"/>
<c:set var="string" value="${fn:substring(string, 0, index)}" />
<option value="${subRegion.isoCode}">${string}</option>
</c:if>
</c:forEach>
</optgroup>
</c:if>
</c:forEach>
</select>
</c:when>
<c:when test="${type eq 'like'}">
<span class="glyphicon glyphicon-menu-down"></span>
<select class="form-control like-switcher">
......@@ -144,16 +177,32 @@
<c:otherwise/>
</c:choose>
<c:if test="${type ne 'range'}">
<c:forEach items="${filterMap[appliedFilter.key]}" var="value">
<%@include file="filtval.jspf" %>
<%--<div class="filtval complex"--%>
<%--x-key="<c:out value="${normalizedKey}" /><c:out value="${value}"/>"--%>
<%--i-key="<c:out value="${filter.key}" />"><c:out value="${string}"/>--%>
<%--</div>--%>
<%--<c:remove var="string"/>--%>
</c:forEach>
</c:if>
<c:if test="${type ne 'range'}">
<c:choose>
<c:when test="${type eq 'geoSelect'}">
<c:forEach items="${filterMap[appliedFilter.key]}" var="value">
<c:set var="isoCode" value="${value}"/>
<c:forEach items="${geoRegions}" var="subRegion">
<c:if test="${subRegion.isoCode eq value}">
<c:set var="string" value="${subRegion.nameL}"/>
<c:set var="index" value="${fn:indexOf(string, localeCode )}"/>
<c:set var="string"
value="${fn:substring(subRegion.nameL, index, fn:length(subRegion.nameL))}"/>
<c:set var="string" value="${fn:substring(string, 6, fn:length(subRegion.nameL))}"/>
<c:set var="index" value="${fn:indexOf(string, '\"' )}"/>
<c:set var="value" value="${fn:substring(string, 0, index)}"/>
<%@include file="filtval.jspf" %>
</c:if>
</c:forEach>
</c:forEach>
</c:when>
<c:otherwise>
<c:forEach items="${filterMap[appliedFilter.key]}" var="value">
<%@include file="filtval.jspf" %>
</c:forEach>
</c:otherwise>
</c:choose>
</c:if>
......
......@@ -47,8 +47,18 @@
<spring:message code='accession.sampleStatus.${value}' var="string"/>
</c:if>
<div class="filtval complex"
x-key="<c:out value="${normalizedKey}" /><c:out value="${value}"/>"
i-key="<c:out value="${filter.key}" />"><c:out value="${string}"/>
</div>
<c:choose>
<c:when test="${type eq 'geoSelect'}">
<div class="filtval complex"
x-key="<c:out value="${normalizedKey}"/><c:out value="${isoCode}"/>"
i-key="<c:out value="${filter.key}" />"><c:out value="${string}"/>
</div>
</c:when>
<c:otherwise>
<div class="filtval complex"
x-key="<c:out value="${normalizedKey}" /><c:out value="${value}"/>"
i-key="<c:out value="${filter.key}" />"><c:out value="${string}"/>
</div>
</c:otherwise>
</c:choose>
<c:remove var="string"/>
......@@ -17,6 +17,7 @@
package org.genesys2.tests.resttests;
import java.io.File;
import java.util.Set;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.SerializationFeature;
......@@ -24,6 +25,7 @@ import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.IQueue;
import org.apache.velocity.app.VelocityEngine;
import org.elasticsearch.common.collect.Sets;
import org.genesys2.brapi.service.impl.BrAPIServiceImpl;
import org.genesys2.server.aspect.AsAdminAspect;
import org.genesys2.server.filerepository.service.BytesStorageService;
......@@ -83,6 +85,7 @@ import org.genesys2.server.service.ElasticService;
import org.genesys2.server.service.GenesysFilterService;
import org.genesys2.server.service.GenesysRESTService;
import org.genesys2.server.service.GenesysService;
import org.genesys2.server.service.GeoRegionService;
import org.genesys2.server.service.GeoService;
import org.genesys2.server.service.HtmlSanitizer;
import org.genesys2.server.service.InstituteFilesService;
......@@ -112,6 +115,7 @@ import org.genesys2.server.service.impl.FilterHandler;
import org.genesys2.server.service.impl.GenesysFilterServiceImpl;
import org.genesys2.server.service.impl.GenesysRESTServiceImpl;
import org.genesys2.server.service.impl.GenesysServiceImpl;
import org.genesys2.server.service.impl.GeoRegionServiceImpl;
import org.genesys2.server.service.impl.GeoServiceImpl;
import org.genesys2.server.service.impl.InstituteFilesServiceImpl;
import org.genesys2.server.service.impl.InstituteServiceImpl;
......@@ -129,6 +133,7 @@ import org.genesys2.server.service.impl.TeamServiceImpl;
import org.genesys2.server.service.impl.TokenVerificationServiceImpl;
import org.genesys2.server.service.impl.UserServiceImpl;
import org.genesys2.server.service.worker.ElasticUpdater;
import org.genesys2.server.service.worker.GeoRegionDataCLDR;
import org.genesys2.server.servlet.controller.rest.AccessionController;
import org.genesys2.server.servlet.controller.rest.CacheController;
import org.genesys2.server.servlet.controller.rest.CropsController;
......@@ -524,7 +529,22 @@ public abstract class AbstractRestTest extends BaseSpringTest {
public BrAPIServiceImpl brapiService() {
return new BrAPIServiceImpl();
}
@Bean
public GeoRegionService geoRegionService() {
return new GeoRegionServiceImpl();
}
@Bean
public GeoRegionDataCLDR geoRegionDataCldr() {
return new GeoRegionDataCLDR();
}
@Bean
public static Set<String> supportedLocales() {