Commit 2d9faed7 authored by Matija Obreza's avatar Matija Obreza

Fix: Undo incorrect renames

- FilterConstants are used in JSP, must be unmodified
parent 582968fe
......@@ -189,7 +189,7 @@ public class CropsController extends ApiBaseController {
}
/**
* Get crop taxonomies /crops/{shortName}/taxonomy
* Get crop taxonomies /crops/{shortName}/taxa
* @return
*
* @return
......@@ -197,7 +197,7 @@ public class CropsController extends ApiBaseController {
*/
@RequestMapping(value = "/{shortName}/taxa", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE })
public Page<CropTaxonomy> getCropTaxa(@PathVariable("shortName") String shortName) throws AuthorizationException {
LOG.info("Getting crop taxonomy {}", shortName);
LOG.info("Getting crop taxa {}", shortName);
final Crop crop = cropService.getCrop(shortName);
final Page<CropTaxonomy> cropTaxa = cropService.getCropTaxonomies(crop, new PageRequest(0, 50));
return OAuth2Cleanup.clean(cropTaxa);
......
......@@ -215,7 +215,7 @@ public class CropsController extends ApiBaseController {
}
/**
* Get crop taxonomies /crops/{shortName}/taxonomy
* Get crop taxonomies /crops/{shortName}/taxa
* @return
*
* @return
......@@ -223,7 +223,7 @@ public class CropsController extends ApiBaseController {
*/
@RequestMapping(value = "/{shortName}/taxa", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE })
public Page<CropTaxonomy> getCropTaxa(@PathVariable("shortName") String shortName) throws AuthorizationException {
LOG.info("Getting crop taxonomy {}", shortName);
LOG.info("Getting crop taxa {}", shortName);
final Crop crop = cropService.getCrop(shortName);
final Page<CropTaxonomy> cropTaxa = cropService.getCropTaxonomies(crop, new PageRequest(0, 50));
return OAuth2Cleanup.clean(cropTaxa);
......
......@@ -145,7 +145,7 @@ public class DescriptorControllerRdf extends RdfBaseController {
*
* cco:MusaTrait a skos:Concept; cco:category cco:GeneralTrait ;
* skos:prefLabel "Musa taxonomic traits"@en; skos:definition
* "Nomenclature for Characterization traits for species in the Musa taxonomy."
* "Nomenclature for Characterization traits for species in the Musa taxa."
* @en; skos:prefLabel "Rasgos taxonómicos de Musa."@es; skos:definition
* "Nomenclatura de los rasgos de caracterización de las especies en el taxón Musa."
* @es; skos:prefLabel "Муса таксономические черты"@ru; skos:definition
......
......@@ -30,7 +30,7 @@ public interface FilterConstants {
public static final String AVAILABLE = "available";
public static final String ART15 = "inTrust";
public static final String ART15 = "art15";
public static final String MLSSTATUS = "mlsStatus";
......@@ -38,7 +38,7 @@ public interface FilterConstants {
public static final String ALIAS = "alias";
public static final String ACCENUMB = "accessionNumber";
public static final String ACCENUMB = "acceNumb";
public static final String INSTCODE = "institute.code";
......
......@@ -16,13 +16,9 @@
package org.genesys2.server.service.filter;
import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import org.genesys.blocks.model.filters.NumberFilter;
import org.genesys.blocks.model.filters.StringFilter;
......@@ -108,7 +104,7 @@ public class AccessionFilter extends UuidModelFilter<AccessionFilter, Accession>
public Set<UUID> lists;
/** accession aliases */
public StringFilter aliasses;
public StringFilter aliases;
/** accessions with images */
public Boolean images;
......@@ -202,8 +198,8 @@ public class AccessionFilter extends UuidModelFilter<AccessionFilter, Accession>
if (CollectionUtil.isNotEmpty(uuid)) {
and.and(qAccessionId.uuid.in(uuid));
}
if (aliasses != null) {
and.and(aliasses.buildQuery(accession.accessionId.aliases.any().name));
if (aliases != null) {
and.and(aliases.buildQuery(accession.accessionId.aliases.any().name));
}
// TODO Do we have to change this?
if (sgsv != null) {
......@@ -296,8 +292,8 @@ public class AccessionFilter extends UuidModelFilter<AccessionFilter, Accession>
if (CollectionUtil.isNotEmpty(uuid)) {
and.and(accession.accessionId.uuid.in(uuid));
}
if (aliasses != null) {
and.and(aliasses.buildQuery(accession.accessionId.aliases.any().name));
if (aliases != null) {
and.and(aliases.buildQuery(accession.accessionId.aliases.any().name));
}
// TODO Do we have to change this?
if (sgsv != null) {
......
......@@ -25,8 +25,8 @@ import org.genesys2.server.service.impl.FilterHandler.FilterValue;
import org.genesys2.server.service.impl.FilterHandler.LiteralValueFilter;
import org.genesys2.server.service.impl.FilterHandler.MaxValueFilter;
import org.genesys2.server.service.impl.FilterHandler.MinValueFilter;
import org.genesys2.server.service.impl.FilterHandler.ValueRangeFilter;
import org.genesys2.server.service.impl.FilterHandler.StartsWithFilter;
import org.genesys2.server.service.impl.FilterHandler.ValueRangeFilter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -251,7 +251,7 @@ public class AppliedFiltersConverter {
break;
}
case FilterConstants.ALIAS: {
f.aliasses = convertStringFilter(af);
f.aliases = convertStringFilter(af);
break;
}
default:
......@@ -259,14 +259,6 @@ public class AppliedFiltersConverter {
}
}
private static String take1String(AppliedFilter af) {
try {
return (String) ((LiteralValueFilter) af.getValues().iterator().next()).getValue();
} catch (NoSuchElementException e) {
return null;
}
}
private static Set<Double> takeNumbers(AppliedFilter af) {
try {
return af.getValues().stream().map(fv -> ((LiteralValueFilter)fv).getValue()).map(v -> v == null ? null : ((Number)v).doubleValue()).collect(Collectors.toSet());
......
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