Commit eff6e8d6 authored by Matija Obreza's avatar Matija Obreza

Merge branch 'ui-383-use-generated-models-and-services' into 'master'

Ui 383 use generated models and services

See merge request genesys-pgr/genesys-server!257
parents dadfbf70 bd886140
......@@ -25,7 +25,7 @@ import java.util.stream.Collectors;
import org.genesys.blocks.model.JsonViews;
import org.genesys.catalog.api.FilteredPage;
import org.genesys.catalog.exceptions.NotFoundElement;
import org.genesys.catalog.model.dataset.AccessionIdentifier;
import org.genesys2.server.model.genesys.AccessionRef;
import org.genesys.catalog.model.dataset.Dataset;
import org.genesys.catalog.model.dataset.DatasetCreator;
import org.genesys.catalog.model.dataset.DatasetLocation;
......@@ -150,28 +150,6 @@ public class DatasetController {
return new FilteredPage<>(filterCode, filter, datasetService.listDatasets(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
}
/**
* Filter datasets by filter code.
*
* @param page the page
* @param pageSize the page size
* @param direction the direction
* @param sort the sort
* @param filterCode the filter code
* @return the filtered page
* @throws IOException Signals that an I/O exception has occurred.
* @deprecated Use {@link #datasetList(int, int, org.springframework.data.domain.Sort.Direction, String[], String, DatasetFilter)}
*/
@PostMapping(value = "/list/{filterCode}")
public FilteredPage<Dataset> datasetListShort(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort, @PathVariable("filterCode") final String filterCode) throws IOException {
final DatasetFilter filter = shortFilterService.filterByCode(filterCode, DatasetFilter.class);
return new FilteredPage<>(filterCode, filter, datasetService.listDatasets(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
}
/**
* Gets the dataset.
*
......@@ -216,15 +194,15 @@ public class DatasetController {
*
* @param uuid the uuid
* @param version the version
* @param accessionIdentifiers the accession identifiers
* @param accessionRefs the accession identifiers
* @return the dataset
* @throws NotFoundElement the not found element
*/
@PostMapping(value = "/upsertaccessions/{UUID},{version}")
public Dataset upsertAccessions(@PathVariable("UUID") final UUID uuid, @PathVariable("version") final int version,
@RequestBody final Set<AccessionIdentifier> accessionIdentifiers) throws NotFoundElement {
@RequestBody final Set<AccessionRef> accessionRefs) throws NotFoundElement {
final Dataset dataset = datasetService.loadDataset(uuid, version);
return datasetService.upsertAccessions(dataset, accessionIdentifiers);
return datasetService.upsertAccessions(dataset, accessionRefs);
}
/**
......
......@@ -236,7 +236,7 @@ public class DescriptorController {
*/
@RequestMapping(value = "/upsert", method = RequestMethod.POST)
@PreAuthorize("hasRole('ADMINISTRATOR')")
public List<Descriptor> updateDescriptor(@RequestBody final List<Descriptor> source) {
public List<Descriptor> updateDescriptors(@RequestBody final List<Descriptor> source) {
return descriptorService.upsertDescriptors(source);
}
......
......@@ -32,9 +32,10 @@ import org.genesys.catalog.mvc.DescriptorListExporter;
import org.genesys.catalog.service.DescriptorListService;
import org.genesys.catalog.service.DescriptorService;
import org.genesys.catalog.service.ShortFilterService;
import org.genesys.catalog.service.ShortFilterService.FilterInfo;
import org.genesys2.server.api.ApiBaseController;
import org.genesys2.server.api.Pagination;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
......@@ -194,77 +195,35 @@ public class DescriptorListController {
/**
* My descriptor lists.
*
* @param filterCode the filter code
* @param page the page
* @param pageSize the page size
* @param direction the direction
* @param sort the sort
* @param descriptorListFilter the descriptor list filter
* @param filter the filter
* @return the page
* @throws IOException
* @throws IOException Signals that an I/O exception has occurred.
*/
@PostMapping(value = "/list-mine")
public FilteredPage<DescriptorList> myDescriptorLists(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "DESC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "lastModifiedDate") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode,
public FilteredPage<DescriptorList> myDescriptorLists(@RequestParam(name = "f", required = false) String filterCode, final Pagination page,
@RequestBody(required = false) DescriptorListFilter filter) throws IOException {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DescriptorListFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
}
return new FilteredPage<>(filterCode, filter, descriptorListService.listDescriptorListsForCurrentUser(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
FilterInfo<DescriptorListFilter> filterInfo = shortFilterService.processFilter(filterCode, filter, DescriptorListFilter.class);
return new FilteredPage<>(filterInfo.filterCode, filterInfo.filter, descriptorListService.listDescriptorListsForCurrentUser(filterInfo.filter, page.toPageRequest(100, Sort.Direction.DESC, "lastModifiedDate")));
}
/**
* List descriptor lists.
*
* @param page the page
* @param pageSize the page size
* @param direction the direction
* @param sort the sort
* @param filterCode short filter code -- overrides filter in body
* @param page the page
* @param filter the descriptor list filter
* @return the page
* @throws IOException Signals that an I/O exception has occurred.
*/
@PostMapping(value = "/list")
public FilteredPage<DescriptorList> listDescriptorLists(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode,
public FilteredPage<DescriptorList> listDescriptorLists(@RequestParam(name = "f", required = false) String filterCode, final Pagination page,
@RequestBody(required = false) DescriptorListFilter filter) throws IOException {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DescriptorListFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
}
return new FilteredPage<>(filterCode, filter, descriptorListService.listDescriptorLists(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
}
/**
* Filter descriptor lists by filter code.
*
* @param page the page
* @param pageSize the page size
* @param direction the direction
* @param sort the sort
* @param filterCode the filter code
* @return the filtered page
* @throws IOException Signals that an I/O exception has occurred.
* @deprecated Use {@link #listDescriptorLists(int, int, org.springframework.data.domain.Sort.Direction, String[], String, DescriptorListFilter)}
*/
@PostMapping(value = "/list/{filterCode}")
public FilteredPage<DescriptorList> listDescriptorListsByCode(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort, @PathVariable("filterCode") final String filterCode) throws IOException {
final DescriptorListFilter filter = shortFilterService.filterByCode(filterCode, DescriptorListFilter.class);
return new FilteredPage<>(filterCode, filter, descriptorListService.listDescriptorLists(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
FilterInfo<DescriptorListFilter> filterInfo = shortFilterService.processFilter(filterCode, filter, DescriptorListFilter.class);
return new FilteredPage<>(filterInfo.filterCode, filterInfo.filter, descriptorListService.listDescriptorLists(filterInfo.filter, page.toPageRequest(100)));
}
/**
......
......@@ -72,7 +72,7 @@ public class LanguagesController {
*/
@PreAuthorize("hasRole('ADMINISTRATOR')")
@PostMapping(value = "/update")
public @ResponseBody String updateLanguages() throws IOException {
public @ResponseBody String updateLanguageVocabulary() throws IOException {
LOG.info("Updating ISO language codes");
vocabularyService.autoUpdateOrCreateVocabulary(ISO639_3, iso639VocabularyUpdater.getISO639Vocabulary());
return "OK";
......@@ -85,7 +85,7 @@ public class LanguagesController {
* @return the vocabulary term
*/
@GetMapping(value = "/{code}", produces = MediaType.APPLICATION_JSON_VALUE)
public VocabularyTerm get(@PathVariable("code") final String code) {
public VocabularyTerm getLanguageTerm(@PathVariable("code") final String code) {
return vocabularyService.getVocabularyTerm(ISO639_3, code);
}
......@@ -97,7 +97,7 @@ public class LanguagesController {
* @throws IOException Signals that an I/O exception has occurred.
*/
@GetMapping(value = "/autocomplete", produces = MediaType.APPLICATION_JSON_VALUE)
public List<VocabularyTerm> autocomplete(@RequestParam("l") final String text) throws IOException {
public List<VocabularyTerm> autocompleteLanguageTerm(@RequestParam("l") final String text) throws IOException {
if (text.length() < 3) {
return Collections.emptyList();
}
......
......@@ -24,15 +24,15 @@ import org.genesys.catalog.model.filters.PartnerFilter;
import org.genesys.catalog.service.PartnerService;
import org.genesys.catalog.service.ShortFilterService;
import org.genesys2.server.api.ApiBaseController;
import org.genesys2.server.api.Pagination;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -72,12 +72,9 @@ public class PartnerController {
* @return the page
*/
@PostMapping(value = "/list-mine")
public Page<Partner> myPartners(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "name") final String[] sort, @RequestBody final PartnerFilter partnerFilter) {
public Page<Partner> myPartners(final Pagination page, @RequestBody final PartnerFilter partnerFilter) {
return partnerService.listPartnersForCurrentUser(partnerFilter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort));
return partnerService.listPartnersForCurrentUser(partnerFilter, page.toPageRequest(100));
}
/**
......@@ -92,41 +89,15 @@ public class PartnerController {
* @throws IOException
*/
@PostMapping(value = "/list")
public FilteredPage<Partner> listPartners(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode,
@RequestBody(required = false) PartnerFilter filter) throws IOException {
public FilteredPage<Partner> listPartners(@RequestParam(name = "f", required = false) String filterCode, final Pagination page,
@RequestBody(required = false) PartnerFilter filter) throws IOException {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, PartnerFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
}
return new FilteredPage<>(filterCode, filter, partnerService.listPartners(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
}
/**
* Filter partners by filter code.
*
* @param page the page
* @param pageSize the page size
* @param direction the direction
* @param sort the sort
* @param filterCode the filter code
* @return the filtered page
* @throws IOException Signals that an I/O exception has occurred.
* @deprecated Use {@link #listPartners(int, int, org.springframework.data.domain.Sort.Direction, String[], String, PartnerFilter)}
*/
@PostMapping(value = "/list/{filterCode}")
public FilteredPage<Partner> listPartners2(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort, @PathVariable("filterCode") final String filterCode) throws IOException {
final PartnerFilter filter = shortFilterService.filterByCode(filterCode, PartnerFilter.class);
return new FilteredPage<>(filterCode, filter, partnerService.listPartners(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
return new FilteredPage<>(filterCode, filter, partnerService.listPartners(filter, page.toPageRequest(100)));
}
/**
......@@ -161,8 +132,8 @@ public class PartnerController {
* @return the partner
*/
@PreAuthorize("hasRole('ADMINISTRATOR') or hasPermission(#source.getId(), #source.class.getName(), 'write')")
@PostMapping(value = "/update/{UUID},{version}")
public Partner updatePartner(@PathVariable("UUID") final UUID uuid, @PathVariable("version") final int version, @RequestBody final Partner source) {
@PutMapping(value = "/update")
public Partner updatePartner(@RequestBody final Partner source) {
return partnerService.updatePartner(source);
}
......
......@@ -32,7 +32,7 @@ import org.genesys.blocks.model.BasicModel;
import org.genesys.blocks.model.JsonViews;
import org.genesys.catalog.exceptions.InvalidApiUsageException;
import org.genesys.catalog.model.Partner;
import org.genesys.catalog.model.dataset.AccessionIdentifier;
import org.genesys2.server.model.genesys.AccessionRef;
import org.genesys.catalog.model.dataset.Dataset;
import org.genesys.catalog.model.filters.DatasetFilter;
import org.genesys.catalog.model.traits.Descriptor;
......@@ -90,7 +90,7 @@ public class SearchController {
Map<String, SearchResults<?>> suggestions = new HashMap<>();
suggestions.put("search.group.crop", SearchResults.from("code", Arrays.asList("crop"), hitsByEntity.get(Crop.class)));
suggestions.put("search.group.partner", SearchResults.from("uuid", Arrays.asList("owner.uuid"), hitsByEntity.get(Partner.class)));
suggestions.put("search.group.accession", SearchResults.from("doi", Arrays.asList("accessionIdentifier.doi"), hitsByEntity.get(AccessionIdentifier.class)));
suggestions.put("search.group.accession", SearchResults.from("doi", Arrays.asList("accessionRef.doi"), hitsByEntity.get(AccessionRef.class)));
suggestions.put("search.group.descriptor", SearchResults.from("uuid", Arrays.asList("descriptor.uuid"), hitsByEntity.get(Descriptor.class)));
// Search datasets
......
......@@ -181,25 +181,4 @@ public class VocabularyController {
return new FilteredPage<>(filterCode, filter, vocabularyService.listVocabularies(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
}
/**
* Filter controlled vocabularies by filter code.
*
* @param page the page
* @param pageSize the page size
* @param direction the direction
* @param sort the sort
* @param filterCode the filter code
* @return the filtered page
* @throws IOException Signals that an I/O exception has occurred.
*/
@PostMapping(value = "/list/{filterCode}")
public FilteredPage<ControlledVocabulary> list(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort, @PathVariable("filterCode") final String filterCode) throws IOException {
final ControlledVocabularyFilter filter = shortFilterService.filterByCode(filterCode, ControlledVocabularyFilter.class);
return new FilteredPage<>(filterCode, filter, vocabularyService.listVocabularies(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
}
}
......@@ -75,7 +75,7 @@ public class WiewsController {
*/
@PreAuthorize("hasRole('ADMINISTRATOR')")
@PostMapping(value = "/update")
public @ResponseBody String updateLanguages() throws IOException {
public @ResponseBody String updateWiewsVocabulary() throws IOException {
LOG.info("Updating FAO WIEWS codes");
vocabularyService.autoUpdateOrCreateVocabulary(FAO_WIEWS_UUID, wiewsVocabularyUpdater.getWiewsVocabulary());
return "OK";
......@@ -88,7 +88,7 @@ public class WiewsController {
* @return the vocabulary term
*/
@GetMapping(value = "/{code}", produces = MediaType.APPLICATION_JSON_VALUE)
public VocabularyTerm get(@PathVariable("code") final String code) {
public VocabularyTerm getWiewsTerm(@PathVariable("code") final String code) {
return vocabularyService.getVocabularyTerm(FAO_WIEWS_UUID, code);
}
......@@ -100,7 +100,7 @@ public class WiewsController {
* @throws IOException Signals that an I/O exception has occurred.
*/
@GetMapping(value = "/autocomplete", produces = MediaType.APPLICATION_JSON_VALUE)
public List<VocabularyTerm> autocomplete(@RequestParam("term") final String text) throws IOException {
public List<VocabularyTerm> autocompleteWiewsTerm(@RequestParam("term") final String text) throws IOException {
if (text.length() < 3) {
return Collections.emptyList();
}
......
......@@ -29,6 +29,7 @@ import org.genesys.catalog.model.traits.Descriptor;
import org.genesys.catalog.service.PublishValidationInterface;
import org.genesys.filerepository.model.RepositoryFile;
import org.genesys2.server.model.PublishState;
import org.genesys2.server.model.genesys.AccessionRef;
import org.genesys2.server.model.impl.Crop;
import org.genesys2.util.MCPDUtil;
import org.springframework.data.elasticsearch.annotations.Document;
......@@ -78,7 +79,7 @@ public class Dataset extends UuidModel implements Publishable, SelfCleaning, Pub
indexes = { @Index(columnList = "datasetId, instCode, acceNumb"), @Index(columnList = "datasetId, genus") })
@Field(type = FieldType.Object)
@JsonView({ JsonViews.Public.class })
private Set<AccessionIdentifier> accessionIdentifiers;
private Set<AccessionRef> accessionRefs;
/** The descriptors. */
@ManyToMany(fetch = FetchType.LAZY, cascade = {})
......@@ -119,7 +120,7 @@ public class Dataset extends UuidModel implements Publishable, SelfCleaning, Pub
private String endDate;
/** The accession count. */
// Number of accessions in the {@link #accessionIdentifiers} list
// Number of accessions in the {@link #accessionRefs} list
@Column(name = "accessions")
private Integer accessionCount;
......@@ -188,8 +189,8 @@ public class Dataset extends UuidModel implements Publishable, SelfCleaning, Pub
@PreUpdate
@PrePersist
private void preupdate() {
if (accessionIdentifiers != null) {
this.accessionCount = accessionIdentifiers.size();
if (accessionRefs != null) {
this.accessionCount = accessionRefs.size();
}
if (descriptors != null) {
this.descriptorCount = descriptors.size();
......@@ -515,19 +516,19 @@ public class Dataset extends UuidModel implements Publishable, SelfCleaning, Pub
/**
* Gets the accession identifiers.
*
* @return the accessionIdentifiers
* @return the accessionRefs
*/
public final Set<AccessionIdentifier> getAccessionIdentifiers() {
return accessionIdentifiers;
public final Set<AccessionRef> getAccessionRefs() {
return accessionRefs;
}
/**
* Sets the accession identifiers.
*
* @param accessionIdentifiers the accessionIdentifiers to set
* @param accessionRefs the accessionRefs to set
*/
public final void setAccessionIdentifiers(final Set<AccessionIdentifier> accessionIdentifiers) {
this.accessionIdentifiers = accessionIdentifiers;
public final void setAccessionRefs(final Set<AccessionRef> accessionRefs) {
this.accessionRefs = accessionRefs;
}
/**
......
......@@ -19,19 +19,21 @@ import java.util.HashSet;
import java.util.Set;
import org.genesys.blocks.model.filters.StringFilter;
import org.genesys.catalog.model.dataset.AccessionIdentifier;
import org.genesys.catalog.model.dataset.QAccessionIdentifier;
import org.genesys2.server.model.genesys.AccessionRef;
import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.Predicate;
import com.querydsl.core.types.dsl.SetPath;
import org.genesys2.server.model.genesys.QAccessionRef;
import org.genesys2.server.service.filter.AccessionFilter;
/**
* The Class AccessionIdentifierFilter.
* The Class AccessionRefFilter.
*
* @author Viacheslav Pavlov
* @author Matija Obreza
*/
public class AccessionIdentifierFilter {
public class AccessionRefFilter {
/** The doi. */
public Set<String> doi;
......@@ -47,31 +49,37 @@ public class AccessionIdentifierFilter {
/** The acce numb. */
public StringFilter acceNumb;
/** Matched accession filter */
public AccessionFilter accession;
/**
* Builds the query.
*
* @param accessionIdentifiers the accession identifiers
* @param accessionRefs the accession identifiers
* @return the predicate
*/
public Predicate buildQuery(final SetPath<AccessionIdentifier, QAccessionIdentifier> accessionIdentifiers) {
public Predicate buildQuery(final SetPath<AccessionRef, QAccessionRef> accessionRefs) {
final BooleanBuilder and = new BooleanBuilder();
final QAccessionIdentifier identifier = accessionIdentifiers.any();
final QAccessionRef accessionRef = accessionRefs.any();
if (doi != null && !doi.isEmpty()) {
and.and(identifier.doi.in(doi));
and.and(accessionRef.doi.in(doi));
}
if (instCode != null && !instCode.isEmpty()) {
and.and(identifier.instCode.in(instCode));
and.and(accessionRef.instCode.in(instCode));
}
if (genus != null && !genus.isEmpty()) {
and.and(identifier.genus.in(genus));
and.and(accessionRef.genus.in(genus));
}
if (species != null && !species.isEmpty()) {
and.and(identifier.species.in(species));
and.and(accessionRef.species.in(species));
}
if (acceNumb != null) {
and.and(acceNumb.buildQuery(identifier.acceNumb));
and.and(acceNumb.buildQuery(accessionRef.acceNumb));
}
if (accession != null) {
and.and(accession.buildQuery(accessionRef.accession));
}
return and;
......@@ -83,7 +91,7 @@ public class AccessionIdentifierFilter {
* @param value the instCode to add
* @return the updated filter
*/
public AccessionIdentifierFilter instCode(final String value) {
public AccessionRefFilter instCode(final String value) {
if (instCode == null) {
instCode = new HashSet<>();
}
......@@ -97,7 +105,7 @@ public class AccessionIdentifierFilter {
* @param value the doi to add
* @return the updated filter
*/
public AccessionIdentifierFilter doi(final String value) {
public AccessionRefFilter doi(final String value) {
if (doi == null) {
doi = new HashSet<>();
}
......@@ -111,7 +119,7 @@ public class AccessionIdentifierFilter {
* @param value the genus to add
* @return the updated filter
*/
public AccessionIdentifierFilter genus(final String value) {
public AccessionRefFilter genus(final String value) {
if (genus == null) {
genus = new HashSet<>();
}
......
......@@ -45,11 +45,13 @@ public class DatasetFilter extends UuidModelFilter<DatasetFilter, Dataset> {
/** The owner. */
public PartnerFilter owner;
/** The accession identifier. */
public AccessionIdentifierFilter accessionIdentifier;
/** The accession reference. */
public AccessionRefFilter accessionRef;
/** Dataset location filter */
public DatasetLocationFilter location;
/** Descriptor filter */
public DescriptorFilter descriptor;
/** The title. */
......@@ -90,8 +92,8 @@ public class DatasetFilter extends UuidModelFilter<DatasetFilter, Dataset> {
if (owner != null) {
and.and(owner.buildQuery(dataset.owner));
}
if (accessionIdentifier != null) {
and.and(accessionIdentifier.buildQuery(dataset.accessionIdentifiers));
if (accessionRef != null) {
and.and(accessionRef.buildQuery(dataset.accessionRefs));
}
if (descriptor != null) {
and.and(descriptor.buildQuery(dataset.descriptors.any()));
......@@ -120,7 +122,7 @@ public class DatasetFilter extends UuidModelFilter<DatasetFilter, Dataset> {
dataset.owner.shortName,
dataset.crops.any(),