Genesys Backend issueshttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues2019-05-01T21:52:50+02:00https://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/439Use ES for text queries2019-05-01T21:52:50+02:00Matija ObrezaUse ES for text queriesWhen user provides `_text` filter (keyword search) the backend should query ES for results (not the database).
We have `_text` filter in `DescriptorListFilter` for example. Add `_text` filter to `AccessionFilter`.
This requires adding ...When user provides `_text` filter (keyword search) the backend should query ES for results (not the database).
We have `_text` filter in `DescriptorListFilter` for example. Add `_text` filter to `AccessionFilter`.
This requires adding support for converting `_text` field to a full-text ES query (https://www.elastic.co/guide/en/elasticsearch/reference/2.3/full-text-queries.html) in `ElasticQueryBuilder`.
Explore if this is possible.
##
```java
public Page<Accession> list(AccessionFilter filter, Pageable page) {
if (StringUtils.isNotBlank(filter._text)) {
// FIXME Use ES to list matches
elasticsearchService.findAll(Accession.class, filter, page);
} else {
List<Accession> content = accessionRepository.findAll(filter, page);
}
long total = countAccessions(filter);
return new PageImpl<>(content, page, total);
}
```2.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/336User registration API2018-09-24T10:45:28+02:00Matija ObrezaUser registration APIAdd `UserRegistrationController` to **server.api.v1** with base at `API_BASE = ApiBaseController.APIv1_BASE + "/user";`
Copy most of the method `addUser` from `org.genesys2.server.mvc.UserRegistrationController` and expose it as API POS...Add `UserRegistrationController` to **server.api.v1** with base at `API_BASE = ApiBaseController.APIv1_BASE + "/user";`
Copy most of the method `addUser` from `org.genesys2.server.mvc.UserRegistrationController` and expose it as API POST to **/register**.
- Check captcha response!
- Add method `validateEMail(String tokenUuid, String key)` that calls `EmailValidationService` as POST to **/validate**.
2.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/355Users API v12018-10-10T19:12:31+02:00Matija ObrezaUsers API v1Copy existing User management API v0 to v1 and update for React.Copy existing User management API v0 to v1 and update for React.2.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/365Using javax.validation2019-02-18T16:20:45+01:00Matija ObrezaUsing javax.validationThe code has reference to `net.sf.oval` validators that are not used by the services.
64a8e983 demonstrates use of Bean Validation 1.1.0 API in services:
```
import javax.validation.Valid;
import org.springframework.validation.annotati...The code has reference to `net.sf.oval` validators that are not used by the services.
64a8e983 demonstrates use of Bean Validation 1.1.0 API in services:
```
import javax.validation.Valid;
import org.springframework.validation.annotation.Validated;
...
@Validated
public <T extends Dimension<?>> T save(@Valid T dimension) {
LOG.debug("Persisting dimension {}", dimension);
return dimensionRepository.save(dimension);
}
```
When implementing new service methods please use `@Valid` on model arguments where applicable.
Models use
```
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
...
@NotNull
@Size(max = 100)
@Column(length = 100, unique = true, nullable = false)
private String name;
```
2.4Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/319Validation tokens expiry2018-09-07T12:22:50+02:00Matija ObrezaValidation tokens expiryUsers happen to return to or find Genesys emails in Junk after a week or so. Extend token validity.Users happen to return to or find Genesys emails in Junk after a week or so. Extend token validity.2.4Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/425Versioned Datasets: update2019-03-25T18:34:15+01:00Matija ObrezaVersioned Datasets: updateUpgrade versioned Datasets to the approach implemented in #421Upgrade versioned Datasets to the approach implemented in #4212.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/421Versioned Subsets2019-03-05T22:24:56+01:00Matija ObrezaVersioned SubsetsWe'd like to implement *versioned subsets*: subset may be updated by the data provider and (when published) both versions should be available through Genesys.
1. Obsolete subsets should not be listed by default
1. Obsolete subset must p...We'd like to implement *versioned subsets*: subset may be updated by the data provider and (when published) both versions should be available through Genesys.
1. Obsolete subsets should not be listed by default
1. Obsolete subset must point to a new version of the subset
## Simple approach
The very simple approach is to add `private Subset nextVersion` to the `Subset` entity and then we know that a subset has been replaced if `nextVersion != null`. And we can display a link to the new version.
**Problem:** This would only work if the new subset would be immediately published. But it has to go through review, and until the updated version is in `PUBLISHED` state we do not have any mechanism to say that the old version is "current" (the latest).
## Dataset approach
We have this implemented for `Dataset` in `DatasetVersions` (but we are not using it at the moment). Subsets are much simpler than datasets, so I suggest we try it here. We will need to introduce `SubsetVersions` (similar to `DatasetVersions`) and implement service methods that allow for the following:
1. The owner of a subset can create a new Subset based on an existing `PUBLISHED` Subset
1. If the existing subset is not published, reject the request.
1. A new `Subset` is created in `DRAFT` mode and **all data is copied** to the new version
1. The old and the new `Subset` both link to `SubsetVersions` entity
1. When the new `Subset` is **published** the `SubsetVersions#currentVersion` is changed to point to this version.
1. Queries for listing Subsets must only return latest versions:
1. `select s from Subset s where s.current = true and s.state = 'PUBLISHED'`.
1. Users can still access a subset that is **not current**, but it is published: `loadSubset` should only check that `state = 'PUBLISHED'`.
1. We cannot inner join `SubsetVersions` because we will not store that in the Elasticsearch.
1. The service methods must update `subset.current` when the new version is `PUBLISHED`.
1. Only one `Subset` of all versions of `SubsetVersions` can be current. This is best achieved with a unique key on `subset.versions + subset.current`, but we have to set `subset.current = null` when the subset is not the current version.
1. This means that `subset.current = true` means it is the currently published version and `subset.current = null` means it is not a current version.
### New Subsets
1. A new subset is created as it is created now, but a `SubsetVersions` is created for as well.
1. The new subset has `subset.current = null` and `SubsetVersions#currentVersion = null`.
1. When the subset is published, both these values are updated: `subset.current = true` and `SubsetVersions#currentVersion = ¤tSubset`.
## Un-publishing Subsets
If a `PUBLISHED` subset is unpublished (by an Administrator) we have the case when:
1. The subset is **not current** and it **must not** be unpublished. Reject.
1. The subset **is current**: we need to pick a subset that is published and that can replace the current version
1. If there is no other version of a subset (this is the first published version): set `subset.current = null` and `SubsetVersions#currentVersion = null`
1. If there are other published versions of the subset (in `SubsetVersions#allVersions`) then make the youngest (by `createdDate`) the currently published version.2.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/369WIEWS Vocabulary2018-11-19T07:13:42+01:00Matija ObrezaWIEWS VocabularyGenesys has two WIEWS vocabulary implementations: as a `Vocabulary` and as `FaoInstitute`.
Remove WIEWS Vocabulary and updaters and update API endpoints for this vocabulary to use data from `InstituteService`. Convert `FaoInstitute` dat...Genesys has two WIEWS vocabulary implementations: as a `Vocabulary` and as `FaoInstitute`.
Remove WIEWS Vocabulary and updaters and update API endpoints for this vocabulary to use data from `InstituteService`. Convert `FaoInstitute` data to `VocabularyTerm` as required.2.4Viacheslav PavlovViacheslav Pavlovhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/234Wrong navigation through the links in the Table of Contents2017-12-22T16:54:05+01:00Aleksandr KirichenkoWrong navigation through the links in the Table of Contents**Steps:**
1. Go to "https://sandbox.genesys-pgr.org/doc/0/brapi" page;
2. Click on the "Germplasm" link in the Table of contents;
See attached video:
![recording_00013](/uploads/1fcec4b71cf69633ef7f00609653e540/recording_00013.gif)
*...**Steps:**
1. Go to "https://sandbox.genesys-pgr.org/doc/0/brapi" page;
2. Click on the "Germplasm" link in the Table of contents;
See attached video:
![recording_00013](/uploads/1fcec4b71cf69633ef7f00609653e540/recording_00013.gif)
**This also applies to "Tables of Contents" on the pages: "Genesis API" and "Accession passport data"**2.4Maxim BabichevMaxim Babichev