Commit dc4f83db authored by Matija Obreza's avatar Matija Obreza
Browse files

Added filtering by Accession Name

parent f952aeb7
......@@ -90,6 +90,11 @@ public class DirectMysqlQuery {
innerJoin("accessiongeo", "geo", "geo.accessionId=a.id");
}
if (hasFilter(jsonTree, "acceName")) {
innerJoin("accessionalias", "accename", "accename.accessionId=a.id");
}
return this;
}
......@@ -118,6 +123,7 @@ public class DirectMysqlQuery {
createQuery(whereBuffer, "geo.latitude", jsonTree.get("latitude"), params);
createQuery(whereBuffer, "geo.elevation", jsonTree.get("elevation"), params);
createQuery(whereBuffer, "crop.shortName", jsonTree.get("crop"), params);
createQuery(whereBuffer, "accename.name", jsonTree.get("acceName"), params);
for (Iterator<String> it = jsonTree.fieldNames(); it.hasNext();) {
String fieldName = it.next();
......
......@@ -44,6 +44,7 @@ import org.genesys2.server.persistence.domain.MethodRepository;
import org.genesys2.server.persistence.domain.TraitValueRepository;
import org.genesys2.server.service.GenesysFilterService;
import org.genesys2.server.service.GenesysFilterService.GenesysFilter.DataType;
import org.genesys2.server.service.GenesysFilterService.GenesysFilter.FilterType;
import org.genesys2.server.service.InstituteService;
import org.genesys2.server.service.SearchService;
import org.genesys2.server.service.TaxonomyService;
......@@ -120,7 +121,8 @@ public class GenesysFilterServiceImpl implements GenesysFilterService {
this.availableFilters.add(new GenesysFilterImpl("organization", DataType.STRING));
this.availableFilters.add(new GenesysAutocompleteFilterImpl("instCode", "/explore/ac/instCode"));
this.availableFilters.add(new GenesysFilterImpl("acceNumb", DataType.NUMERIC));
this.availableFilters.add(new GenesysFilterImpl("acceNumb", DataType.STRING, FilterType.RANGE));
this.availableFilters.add(new GenesysFilterImpl("acceName", DataType.STRING, FilterType.RANGE));
this.availableFilters.add(new GenesysFilterImpl("inSvalbard", DataType.BOOLEAN));
this.availableFilters.add(new GenesysFilterImpl("mlsStat", DataType.BOOLEAN));
this.availableFilters.add(new GenesysFilterImpl("inTrust", DataType.BOOLEAN));
......
......@@ -320,7 +320,8 @@ filters.data-is-filtered=The data is filtered.
filters.toggle-filters=Filters
filter.taxonomy=Taxonomy
filter.inTrust=ITPGRFA Art. 15 accession
filter.acceNumb=Accession name
filter.acceNumb=Accession number
filter.acceName=Accession name
filter.crop=Crop name
filter.countryOfOrigin=Country of Origin
filter.holdingInstitute=Holding Institute name
......
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