Genesys Backend issueshttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues2022-12-01T07:33:48+01:00https://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/652COLLSRC not filled in MCPD Excel2022-12-01T07:33:48+01:00Matija ObrezaCOLLSRC not filled in MCPD ExcelA user reports:
> I downloaded the list of accessions using the DOWNLOAD MCPD avec i have login.
> But the column COLLSRC is empty.
> While when browsing, you can see it.
Indeed `COLLSRC` is blank for https://www.genesys-pgr.org/10...A user reports:
> I downloaded the list of accessions using the DOWNLOAD MCPD avec i have login.
> But the column COLLSRC is empty.
> While when browsing, you can see it.
Indeed `COLLSRC` is blank for https://www.genesys-pgr.org/10.18730/W5CN
JSON has `coll.collSrc = 20`.2022.6Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/651API controllers with UUID2022-11-29T17:06:13+01:00Matija ObrezaAPI controllers with UUIDUse `@PathVariable("uuid") UUID uuid` instead of `String uuid` in API controllers as it will generate better OAI3 spec.
Controller code can use `uuid.toString()` until we upgrade services and models to use `UUID uuid` instead of `String...Use `@PathVariable("uuid") UUID uuid` instead of `String uuid` in API controllers as it will generate better OAI3 spec.
Controller code can use `uuid.toString()` until we upgrade services and models to use `UUID uuid` instead of `String uuid`.2022.6Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/650JUnit deleteAllInBatch2022-12-13T18:17:53+01:00Matija ObrezaJUnit deleteAllInBatchgrin-global/grin-global-server!476 demonstrates that using `deleteAllInBatch()` instead of `deleteAll()` works. I think this will help with unit tests that fail when `...AccessionRefs` are involved.
Please update our unit tests.
Note t...grin-global/grin-global-server!476 demonstrates that using `deleteAllInBatch()` instead of `deleteAll()` works. I think this will help with unit tests that fail when `...AccessionRefs` are involved.
Please update our unit tests.
Note that `deleteAll()` automatically deletes child entities and batch does not. Please add any missing `...Repository.deleteAllInBatch()`.2022.6Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/649TilesController with separate threadpool2022-12-01T06:16:58+01:00Matija ObrezaTilesController with separate threadpoolWith the increased use of the Subsetting Tool, the API gets hit with tons of `/acn/tile...` requests.
I'd like to process the requests for tile images using `@Async` in `TileController` and a separate thread pool that will process 5 req...With the increased use of the Subsetting Tool, the API gets hit with tons of `/acn/tile...` requests.
I'd like to process the requests for tile images using `@Async` in `TileController` and a separate thread pool that will process 5 requests in parallel and reject new requests if the queue is already full. Something like:
```java
@Bean(name = "tileGeneratorPool", destroyMethod = "shutdown")
public ThreadPoolTaskExecutor tileGeneratorPool() {
final ThreadPoolTaskExecutor pool = new ThreadPoolTaskExecutor();
pool.setCorePoolSize(1);
pool.setMaxPoolSize(5);
pool.setQueueCapacity(200);
pool.setThreadPriority(Thread.MIN_PRIORITY);
pool.setThreadNamePrefix("genesys-tile-");
pool.setRejectedExecutionHandler((Runnable r, ThreadPoolExecutor e) -> {
throw new RejectedExecutionException("Tile generator queue is full");
});
return pool;
}
```2022.6Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/648MaterialSubRequest: Ignore DRAFT states2022-10-26T16:04:45+02:00Matija ObrezaMaterialSubRequest: Ignore DRAFT statesGGCE makes an API request to retrieve `MaterialSubRequests` for a selected institute. The server response now includes records in DRAFT state. Please exclude DRAFT from the response.
Updated for GGCE in https://gitlab.croptrust.org/grin...GGCE makes an API request to retrieve `MaterialSubRequests` for a selected institute. The server response now includes records in DRAFT state. Please exclude DRAFT from the response.
Updated for GGCE in https://gitlab.croptrust.org/grin-global/grin-global-server/-/merge_requests/4752022.5Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/647mariadb UUID helper functions2022-10-17T15:00:31+02:00Matija Obrezamariadb UUID helper functionsAdd to `liquibase` a changeset that registers `UUID_TO_BIN()` and `BIN_TO_UUID()`. These two allow for querying the database with string UUIDs.
```sql
DROP FUNCTION IF EXISTS BIN_TO_UUID;
DROP FUNCTION IF EXISTS UUID_TO_BIN;
DELIM...Add to `liquibase` a changeset that registers `UUID_TO_BIN()` and `BIN_TO_UUID()`. These two allow for querying the database with string UUIDs.
```sql
DROP FUNCTION IF EXISTS BIN_TO_UUID;
DROP FUNCTION IF EXISTS UUID_TO_BIN;
DELIMITER $$
CREATE FUNCTION BIN_TO_UUID(b BINARY(16))
RETURNS CHAR(36)
DETERMINISTIC
BEGIN
DECLARE hexStr CHAR(32);
SET hexStr = HEX(b);
RETURN LOWER(CONCAT(
SUBSTR(hexStr, 1, 8), '-',
SUBSTR(hexStr, 9, 4), '-',
SUBSTR(hexStr, 13, 4), '-',
SUBSTR(hexStr, 17, 4), '-',
SUBSTR(hexStr, 21)
));
END$$
CREATE FUNCTION UUID_TO_BIN(_uuid CHAR(36))
RETURNS BINARY(16)
DETERMINISTIC
BEGIN
RETURN UNHEX(CONCAT(
SUBSTR(_uuid, 1, 8),
SUBSTR(_uuid, 10, 4),
SUBSTR(_uuid, 15, 4),
SUBSTR(_uuid, 20, 4),
SUBSTR(_uuid, 25)
));
END$$
DELIMITER ;
```
## Example
```sql
select id, latitude, longitude, tileIndex, tileIndex3min from acce A where A.uuid in (
UUID_TO_BIN('4d57a8f7-14ec-45d9-b415-7e7dd1dc2885'),
UUID_TO_BIN('c6034fee-d616-4262-9433-2a1f2db621d2')
)
```2022.5Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/646Admin send email to users2022-10-17T17:24:04+02:00Matija ObrezaAdmin send email to usersAdd an API endpoint for Administrator to send emails to the selected list of users.
It needs to also accept the message template in HTML (to be populated for each `User` individually).
The populated **HTML message** is then wrapped in...Add an API endpoint for Administrator to send emails to the selected list of users.
It needs to also accept the message template in HTML (to be populated for each `User` individually).
The populated **HTML message** is then wrapped in the Genesys email template (!709) and scheduled for sending.
I think the endpoint can be `void sendEmail(Set<UUID> userUuids, String template)` or something similar. It needs `@PreAuthorize("hasAuthority('ROLE_ADMIN')")` on the service.
## Template variables
- `frontendUrl`
- `apiUrl`
- `user`: the user we're sending to2022.5Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/645OAuth upgrade2023-03-22T14:32:21+01:00Matija ObrezaOAuth upgradeUpgrade Genesys to appblocks-4.1 with the new OAuth implementation (grin-global/grin-global-server#304).
Depends on:
- [x] grin-global/grin-global-server#361Upgrade Genesys to appblocks-4.1 with the new OAuth implementation (grin-global/grin-global-server#304).
Depends on:
- [x] grin-global/grin-global-server#3612023.3Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/643Cannot create article in Sandbox2022-09-22T15:36:27+02:00Christelle RabilCannot create article in SandboxI'm trying to add a new article in Sandbox and after hitting save I got the following error message:
![Screenshot_2022-09-13_at_10.08.12](/uploads/f47c85fb0d70f4c8bb8b8614feec589f/Screenshot_2022-09-13_at_10.08.12.png)I'm trying to add a new article in Sandbox and after hitting save I got the following error message:
![Screenshot_2022-09-13_at_10.08.12](/uploads/f47c85fb0d70f4c8bb8b8614feec589f/Screenshot_2022-09-13_at_10.08.12.png)Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/642Genesys email template2023-02-23T00:56:32+01:00Matija ObrezaGenesys email templateAll emails sent by Genesys should follow an HTML template (TBD) that is automatically applied by the `EmailServiceImpl`. The email template is loaded from `src/main/resources/email/template.html`.
Please use a dummy HTML template until ...All emails sent by Genesys should follow an HTML template (TBD) that is automatically applied by the `EmailServiceImpl`. The email template is loaded from `src/main/resources/email/template.html`.
Please use a dummy HTML template until we have the final layouts available.2023.1Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/641Dropdown hint for field "Country of holding institute" isn`t contains request...2022-07-01T08:13:46+02:00Kiril MorhalenkoDropdown hint for field "Country of holding institute" isn`t contains request of user.**Steps to reproduce:**
1. Go to "https://sandbox.genesys-pgr.org/a/overview/".
2. Enter to the field "Country of holding institute" text "NGA".
**Expected result:**
In the dropdown hint contains "NGA" result.
**Actual result**:
In the...**Steps to reproduce:**
1. Go to "https://sandbox.genesys-pgr.org/a/overview/".
2. Enter to the field "Country of holding institute" text "NGA".
**Expected result:**
In the dropdown hint contains "NGA" result.
**Actual result**:
In the dropdown hint NGA result is missing.
The same situation whis "Provenance of material" filter.
![NGA_isn_t_displayed](/uploads/17304fe5bd6495f9e70456befcf53b84/NGA_isn_t_displayed.gif)2022.4Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/640MaterialSubRequests for all accessions2022-09-22T06:32:33+02:00Matija ObrezaMaterialSubRequests for all accessionsIn the initiation of request for material, the UI will inform the user that `X of Y accessions can be requested via Genesys`. When the number is 0, the user cannot proceed to complete the request, but they can proceed when at least one c...In the initiation of request for material, the UI will inform the user that `X of Y accessions can be requested via Genesys`. When the number is 0, the user cannot proceed to complete the request, but they can proceed when at least one can be requested through Genesys.
This change request modifies how UI and API handle requests for accessions that cannot be requested:
1. On "Request for material" click, the list of **all** selected accession `ids` is sent to the API and the API returns a **new** `DRAFT` `MaterialRequest` with `MaterialSubRequests` for different genebanks.
- If the user is logged in, API can also initiate a validation against Easy-SMTA and obtain PID and update the request data.
- When the user is anonymous, this is registered as under `Guest` without Easy-SMTA lookup.
1. The UI then displays a list of `MaterialSubRequests` and indicates the number of requested accessions for each genebank. User can expand the list to display the list of accessions in each sub request.
- If the genebank does not allow for requests via Genesys, the UI displays a message saying "Sorry, XYZ does not allow for initiating requests for material from Genesys. We cannot relay your request directly."
- Otherwise we indicate "XYZ allows initiating requests for material from Genesys"
1. If there is at least one `MaterialSubRequest` that can be relayed, then "Continue..." leads the user to provide additional info (same as now) and submit the request for validation
- When there are no such requests, "Continue..." is disabled, same as now.
1. Upon validation only the subrequests for "allowed" genebanks are relayed, others remain in `DRAFT` state.
This approach allows us to handle sending sub requests to genebanks using different mechanisms, including a POST to the genebank website where the user can fill out any additional forms. It also allows us to capture which genebanks could receive requests if they allowed it.
UI will need a section in the *Dashboard* with the list of *Requests for material* the user has already made.
## API changes
`MaterialRequest` and `MaterialSubRequest` need a new `DRAFT` state as are created much earlier in the process. `MaterialSubRequest` also needs `SENT` state.
@ahrybeniuk Let me know what other information you require before starting implementation.Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/639Subset owner optimistic lock2022-06-21T11:41:52+02:00Matija ObrezaSubset owner optimistic lockThere's an issue with adding a new `Subset` on Sandbox:
> Object of class [org.genesys.catalog.model.Partner] with identifier [45]: optimistic locking failed
This is a brand new Partner registration and the API should reload the `Partn...There's an issue with adding a new `Subset` on Sandbox:
> Object of class [org.genesys.catalog.model.Partner] with identifier [45]: optimistic locking failed
This is a brand new Partner registration and the API should reload the `Partner` by `id` only when adding a Subset **or Dataset**.2022.4Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/638Amphibian update2023-05-26T11:01:48+02:00Matija ObrezaAmphibian updateAmphibian `3.1-SNAPSHOT` has updated APIs for Previews and Trait observations.Amphibian `3.1-SNAPSHOT` has updated APIs for Previews and Trait observations.Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/637Update to java.time2022-07-18T22:07:54+02:00Matija ObrezaUpdate to java.timeSwitch to app-blocks and file-repo `4.0-SNAPSHOT`. Dates in Genesys models need switching from `java.util.Date` to `java.time.Instant` or `LocalDate` when only a date is recorded.
This will be followed by a ticked for the UI to update t...Switch to app-blocks and file-repo `4.0-SNAPSHOT`. Dates in Genesys models need switching from `java.util.Date` to `java.time.Instant` or `LocalDate` when only a date is recorded.
This will be followed by a ticked for the UI to update the display and handling of timezones.2022.4Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/636Download MCPD2022-03-31T13:53:03+02:00Matija ObrezaDownload MCPDGenerating MCPD can take quite a while with the current implementation. The main performance bottleneck in generating MCPD Excel rows are the subqueries to fetch properties with `@ElementCollection`.
For each `Accession` this requires a...Generating MCPD can take quite a while with the current implementation. The main performance bottleneck in generating MCPD Excel rows are the subqueries to fetch properties with `@ElementCollection`.
For each `Accession` this requires a separate query to the database and this number of queries is the main bottleneck. You can inspect the number of queries by enabling hibernate SQL logging.
In this ticket we develop and implement a more efficient way of generating Excel rows for MCPD.2022.3Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/635Networks with accession filter2022-03-24T15:01:22+01:00Matija ObrezaNetworks with accession filterThe MusaNet PGRFA network (https://sandbox.genesys-pgr.org/partners/65a7b4e1-14c4-42a5-99e5-4be6cbe854da) has several members that have accessions that are not `banana` and are not if interest to the MusaNet.
I need to be able to define...The MusaNet PGRFA network (https://sandbox.genesys-pgr.org/partners/65a7b4e1-14c4-42a5-99e5-4be6cbe854da) has several members that have accessions that are not `banana` and are not if interest to the MusaNet.
I need to be able to define an `accessionFilter` on the `Network`, in this case the filter will be `{ "crop": [ "banana" ] }` or `{ "genus": { "eq": [ "Musa" ] } }`.
The Network overviews data must be properly filtered.2022.3Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/634Drop KPI MVC2022-03-23T14:16:34+01:00Matija ObrezaDrop KPI MVCPlease remove jsps and MVC controllers related to KPI.Please remove jsps and MVC controllers related to KPI.2022.3Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/633Pageable default page size2022-03-18T16:22:43+01:00Matija ObrezaPageable default page sizeIn 7f3aa83ef I limited the max page size for Subset and Dataset lists, but that was not really my intention: I wanted to set the default page size if `l` parameter is not specified by the user.
This piece of code `Integer.min(l == null ...In 7f3aa83ef I limited the max page size for Subset and Dataset lists, but that was not really my intention: I wanted to set the default page size if `l` parameter is not specified by the user.
This piece of code `Integer.min(l == null ? maxPageSize : l, maxPageSize)` in `Pagination` needs to be updated to support a new `defaultPageSize` parameter:
```java
Integer.min(l == null ? defaultPageSize : l, maxPageSize)
```
In Subset and Dataset API controllers, the `defaultPageSize` should be 20 and `maxPageSize` set at `50`.2022.3Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/632Filtered Similarity Search2022-03-30T21:08:47+02:00Matija ObrezaFiltered Similarity SearchThe Similarity Search function considers the entire database when searching for potential matches.
Please add support to specify a `filter` that will allow us to say "find similar accessions to this XYZ accession, but search only within...The Similarity Search function considers the entire database when searching for potential matches.
Please add support to specify a `filter` that will allow us to say "find similar accessions to this XYZ accession, but search only within `{ institute: { code: [ "NGA039" ] }, crop: [ "cassava" ] }`"
This feature will be useful for **Embedded Genesys** where we need to limit this search to only the records of one institute.
The implementation needs to be generic.2022.3Artem HrybeniukArtem Hrybeniuk