Taxonomy2: Update reference to GRIN Taxonomy
The references to GRIN taxonomy grinTaxonomySpecies
(and its current variant currentTaxonomySpecies
) are automatically detected with the Taxonomy2GRINMatcher
.
The detection method is not 100% accurate and may not always detect a matching GRIN record or an incorrect one is assigned.
The UI changes are described in genesys-ui#733 (closed)
- Add
FilteredPage<TaxonomySpecies> listSpecies(TaxonomySpeciesFilter filter, Pagination..
method at /taxonomy/grin-species to the Taxonomy controller - Add
Taxonomy2 setGrinSpecies(long taxonomy2Id, Long customGrinSpecies)
method at /taxonomy/set-grin-species
class TaxonomySpeciesFilter {
String _text;
Set<String> genus;
Set<String> species;
StringFilter subtaxa;
}
The setGrinSpecies()
method in the TaxonomyService
will:
- if
grinSpeciesId != null
, loadTaxonomySpecies
and set- new property
overrideTaxonomySpecies
grinTaxonomySpecies = loaded.id
-
currentTaxonomySpecies = loaded.currentTaxonomySpecies.id
.
- new property
- if
grinSpeciesId == null
, cleargrinTaxonomySpecies
,currentTaxonomySpecies
andoverrideTaxonomySpecies
Taxonomy2GRINMatcher
Update Update Taxonomy2GRINMatcher
so that it will use overrideTaxonomySpecies
if it is declared.
When the detected TaxonomySpecies.id === overrideTaxonomySpecies.id
, then set overrideTaxonomySpecies = null
, because now the override is no longer required.
TaxonomyExtraFilter
Extended Update the existing controller endpoint to list Taxonomy2
records with an enhanced TaxonomyFilter
with extra options:
class TaxonomyExtraFilter extends TaxonomyFilter {
Boolean overrides; // if null, ignore. if true, then add `taxonomy2.overrideTaxonomySpecies.notNull()` else `isNull()`
Boolean grin; // if true, add `taxonomy2.grinTaxonomySpecies.notNull()` else `isNull`
}
The /list endpoint is accessible to all authenticated users.