GGCE Server issueshttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues2022-01-06T10:34:34+01:00https://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/265Update date formatting2022-01-06T10:34:34+01:00Matija ObrezaUpdate date formatting`DATE_FORMAT` group of `CodeValues` defines formats supported by GG-CE and the CT. The CT uses the `CodeValue.value` to parse user string input to Date and render Date using the format string. GG-CE uses `CodeValueLang.title` as the form...`DATE_FORMAT` group of `CodeValues` defines formats supported by GG-CE and the CT. The CT uses the `CodeValue.value` to parse user string input to Date and render Date using the format string. GG-CE uses `CodeValueLang.title` as the formatting string.
`CodeValueLang.title` use *momentjs* date formatting tokens since 9ca07531, which are different from Java's or browser Intl API. This also affects the string escape (`[Pre] yyyy` vs `'Pre' yyyy`) that were updated using liquibase in the same commit.
In this ticket we revert `CodeValueLang.title` from momentjs tokens to Intl API tokens.2022.1Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/263Log4j v22022-01-12T19:04:49+01:00Matija ObrezaLog4j v2We use slf4j in our application code with log4j v1 as the underlying logging implementation. This version of log4j is unsupported.
Switch to Log4j `2.15.0` (requires migrating the `log4j.properties` to `XML`) and update dependencies so ...We use slf4j in our application code with log4j v1 as the underlying logging implementation. This version of log4j is unsupported.
Switch to Log4j `2.15.0` (requires migrating the `log4j.properties` to `XML`) and update dependencies so that log4j v2 is the underlying implementation for other loggers:
![image](/uploads/57b6c4b319786f25f8f043a10db88f35/image.png)2022.1Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/261Generating PDFs with JasperReport2022-03-16T08:38:00+01:00Matija ObrezaGenerating PDFs with JasperReportThis is to add support to generate reports on the server using JasperReports.
One Jasper report will receive one GG-CE "root entity". Let's take `OrderRequest` as an example.
The Jasper report file/code will be stored in the *file rep...This is to add support to generate reports on the server using JasperReports.
One Jasper report will receive one GG-CE "root entity". Let's take `OrderRequest` as an example.
The Jasper report file/code will be stored in the *file repository* in path `reports/OrderRequest` with name `packinglist.???`. The admin may upload additional report "templates" to this folder or update existing ones.
## API updates
1. Extend `CRUDController` with *GET /report/list* to get the list of report templates stored in the file repository for this entity. The method returns `List<RepositoryFile>`.
1. Extend `CRUDController` with *POST /report/generate/{reportTemplate}* that receives the name of the Jasper report (in file repository) and a set of entity `Long id`s from the client. The service will load the list of entities (in a read-only transaction) and return the PDF generated by Jasper for the provided entities.2022.1Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/469Customizable KPI notification template2024-03-27T15:10:53+01:00Matija ObrezaCustomizable KPI notification templateAfter #468 we wish to support **template customization**.
Templates are stored in `AppResources`. `ApplicationStartup` should add `kpi-execution-template.mustache` as one of dynamic liquibase changesets. Then we can load it with:
```ja...After #468 we wish to support **template customization**.
Templates are stored in `AppResources`. `ApplicationStartup` should add `kpi-execution-template.mustache` as one of dynamic liquibase changesets. Then we can load it with:
```java
var template = appResourceService.getResource(AppResourceService.APP_NAME_GG_CE, "kpi.execution.template", Locale.getDefault());
if (template == null) { // Use resource
```2024.3Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/468Send KPI execution results on a schedule2024-03-27T14:25:41+01:00Matija ObrezaSend KPI execution results on a scheduleWe would like to send the latest KPI execution results by email to all `SysUsers` that have `READ` permission on that `Execution`.
The schedule is fixed and runs every Sunday at 12:00 UTC.
## Implementation
Add a new class `org.gringl...We would like to send the latest KPI execution results by email to all `SysUsers` that have `READ` permission on that `Execution`.
The schedule is fixed and runs every Sunday at 12:00 UTC.
## Implementation
Add a new class `org.gringlobal.notification.KPINotifications` with:
```java
@Scheduled(...)
@Transactional(readOnly = true)
public void generateLastKPIExecutions() {
for (var execution : executionRepository.listActiveExecutions()) {
notifyLastKPIExecution(execution.getName())
}
}
@Transactional(readOnly = true)
public void notifyLastKPIExecution(String executionName) {
var execution = executionService.load...
var sysUserRecipients = makeRecipientList(execution)
if (sysUserRecipients.isEmpty()) return;
// TODO load last run and generate the message body
// TODO send emails to sysUserRecipients using EmailService
}
```
## Notification recipients
The list of active `SysUsers` that will receive the email is based on all SIDs that have `READ` permission on the execution. When SID is an active `SysGroup` then active members of that group (`SysUsers[active=true]`) are added to the list. OAuth clients and web users are ignored.
## Notification message
The title of the message is the name of the execution.
The body of the message is generated by loading the last execution run and passing it through `TemplateService` to generate the message. The default template `kpi-execution-template.mustache` is bundled with server code in `src/main/resources/notifications`.
The default template should generate a body similar to how the execution run is displayed in the UI:
> ## KPI {{execution.name}} run {{executionRun.timestamp}}
>
> | genus | COUNT |
> |-------------|-------|
> | Aa | 33 |
> | Abarema | 26 |
> | Abelmoschus | |
> ...
> | Total | {{executionRun.total}} |
>
> View it in GGCE +Link to GGCE UI for this execution2024.3Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/467Handling of partial dates for DOI registration2024-03-13T19:32:29+01:00Matija ObrezaHandling of partial dates for DOI registrationDOI registration uses `yyyy-MM-dd` format and supports partial dates `yyyy-MM` and `yyyy`.
Code in `GlisDOIRegistrationManager#convertMcpdDateToRequest` is unable to handle partial MCPD dates like `2023----`, `20230000`, `202403--` or `...DOI registration uses `yyyy-MM-dd` format and supports partial dates `yyyy-MM` and `yyyy`.
Code in `GlisDOIRegistrationManager#convertMcpdDateToRequest` is unable to handle partial MCPD dates like `2023----`, `20230000`, `202403--` or `20240300` (`00` and `--` are interchangeable in MCPD but GGCE only uses `--`) and is unable to translate them to DOI registration format.2024.2Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/466Unable to download folders in repository2024-03-07T03:52:08+01:00Antonio RiveraUnable to download folders in repositoryWe are trying to download a while folder from the repository but it crases after a while.
![image](/uploads/d3bdafbbb9912e3c92e35577d82f4682/image.png)
![image](/uploads/585947016895991ded3c68e07110a077/image.png)
![image](/uploads/c5...We are trying to download a while folder from the repository but it crases after a while.
![image](/uploads/d3bdafbbb9912e3c92e35577d82f4682/image.png)
![image](/uploads/585947016895991ded3c68e07110a077/image.png)
![image](/uploads/c54f167db3b4cc173f177914b2f04e45/image.png)
This error only happens with root, first and second level. So I think it could be due to the folder size.
![image](/uploads/3cf9673767850ee117de00a620a218c8/image.png)
![image](/uploads/f200287c830e2e1384bd7291ea2b99e5/image.png)
![image](/uploads/7370ae1553ac773585a3f81846d4b30b/image.png)2024.2Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/463Save Data Error on Curator Tool2024-03-13T19:32:29+01:00Antonio RiveraSave Data Error on Curator ToolAfter upgrade to 2024.1 version we have had several errors while trying to save the data in Curator Tool
**Order Items DataView**
![image.png](/uploads/16fe97678090e4bff9fca17b806ffbe7/image.png)
In relation to the order of the above...After upgrade to 2024.1 version we have had several errors while trying to save the data in Curator Tool
**Order Items DataView**
![image.png](/uploads/16fe97678090e4bff9fca17b806ffbe7/image.png)
In relation to the order of the above error, the user reports that in Order of type Phytosanitary testing the order items are not being saved. Is this related to the Session error?
**Order Wizard**
![image.png](/uploads/2c13f50166febc3ec4dfb88fac494490/image.png)
Session error in the crop trait, inventory and accesion dataviews.
![image.png](/uploads/f9f2204bc48c13c1a3f5a71902f26756/image.png)
![image.png](/uploads/88e070523c571a8cacf16a40d6437557/image.png)
In addition, the following window is shown suddenly without any interaction with Curator Tool or Dataview
![image.png](/uploads/6f07de71c5ad39fc2d8c58b7a09285af/image.png)2024.2Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/462Seed moisture content2024-03-14T07:45:54+01:00Matija ObrezaSeed moisture contentAdd to `SeedInventoryExtra` the fields to record the moisture content (MC) of seed and the date when it was measured.
```java
@Min(0) @Max(100)
private Float moistureContent;
private Instant moistureContentDate;
@CodeValue(DATE_FORMAT...Add to `SeedInventoryExtra` the fields to record the moisture content (MC) of seed and the date when it was measured.
```java
@Min(0) @Max(100)
private Float moistureContent;
private Instant moistureContentDate;
@CodeValue(DATE_FORMAT)
private String moistureContentDateCode;
```
These properties should be copied over to any split inventory, similar to how we copy `intialSeedViability`.
In the `InventoryController` we need an extra endpoint `.../moisture-content` to update only the MC fields.
/cc @jarias @jalarcon2024.2Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/461Replace input control for the Availability Status Note field2024-02-22T15:27:28+01:00Antonio RiveraReplace input control for the Availability Status Note fieldWe need to replace the input control for the field **Availability Status Code**.
![image](/uploads/c0a7a4c3e9cefed8e626ac41afebaf2c/image.png)
We would like to use a Dropdown control or a typeahead control instead. The data source for ...We need to replace the input control for the field **Availability Status Code**.
![image](/uploads/c0a7a4c3e9cefed8e626ac41afebaf2c/image.png)
We would like to use a Dropdown control or a typeahead control instead. The data source for the Dropdown we need is the Code Values with the group_name = INVENTORY_STATUS_NOTE
![image](/uploads/c801fe4059ab40c417c7d6eb9c637d63/image.png)
![image](/uploads/9515870a53098ef8a571f8bc7701f0cd/image.png)2024.2Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/460Extend search for similar Cooperators2024-02-19T13:36:57+01:00Matija ObrezaExtend search for similar CooperatorsDocumented in grin-global/grin-global-ui#651, the similarity search for Cooperators needs extending to include more fields in the search.Documented in grin-global/grin-global-ui#651, the similarity search for Cooperators needs extending to include more fields in the search.2024.1Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/458SOAP: CT assigns Cooperator ID to created/owned by fields2024-02-19T15:17:32+01:00Matija ObrezaSOAP: CT assigns Cooperator ID to created/owned by fieldsCT assigns current user's Cooperator ID to `ownedBy` field when a new record is added. But with the upgraded GGCE that checks that references are valid, this now causes a problem.
Also, no error message is returned, the table in CT is s...CT assigns current user's Cooperator ID to `ownedBy` field when a new record is added. But with the upgraded GGCE that checks that references are valid, this now causes a problem.
Also, no error message is returned, the table in CT is simply cleared.
![Foo](/uploads/9aa57ba47075c9e963c47ca8ee282eb7/Foo.m4v)2024.1Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/456Viability test's "completed date" is not recorded.2024-02-20T21:02:02+01:00Juan Carlos Alarcon MaldonadoViability test's "completed date" is not recorded.The "completed date" field of the Viability test action is not recorded after the test is finished.
The viability test finished:
![image](/uploads/a659798821f190d45b144be565454199/image.png)
The `Complete date` is missing:
![image]...The "completed date" field of the Viability test action is not recorded after the test is finished.
The viability test finished:
![image](/uploads/a659798821f190d45b144be565454199/image.png)
The `Complete date` is missing:
![image](/uploads/52749310163062667cb4281f70cf9442/image.png)2024.2Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/455Check MCPD Availability2024-01-24T08:04:52+01:00Matija ObrezaCheck MCPD AvailabilityAccording to grin-global/grin-global-server#274 this accession's availability should be `false` while GGCE generates `null`:
![image](https://gitlab.croptrust.org/genesys-pgr/genesys-ui/uploads/52d9a45a82348f10462b545c297c21a7/image.png)According to grin-global/grin-global-server#274 this accession's availability should be `false` while GGCE generates `null`:
![image](https://gitlab.croptrust.org/genesys-pgr/genesys-ui/uploads/52d9a45a82348f10462b545c297c21a7/image.png)2024.1Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/454Add entity names2024-01-29T05:56:11+01:00Antonio RiveraAdd entity namesWe need to see the entity name form the Geography and Accession in the Accession details screen instead of the entity id.
**Accession Details**
![image](/uploads/47f00786386dfe0fc078fd2cb8a151c6/image.png)
**Accession source history**...We need to see the entity name form the Geography and Accession in the Accession details screen instead of the entity id.
**Accession Details**
![image](/uploads/47f00786386dfe0fc078fd2cb8a151c6/image.png)
**Accession source history**
![image](/uploads/a607b1e3e97a0b87bbea46f913050458/image.png)
**Intellectual Property Rights/Restrictions**
![image](/uploads/8aa1d4c54e3d9fdd812a9e79f5710722/image.png)2024.1Maksym TishchenkoMaksym Tishchenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/451Increase the Organization Abbreviation field length2024-01-22T13:47:41+01:00Antonio RiveraIncrease the Organization Abbreviation field lengthWe need to increase the **Organization Abbreviation** field length to the same length that Genesys has. The length is not the same so we had to remove some characters to avoid an error
![image](/uploads/71f1bc0dafe63401cf7e97c4f7fa4d73/...We need to increase the **Organization Abbreviation** field length to the same length that Genesys has. The length is not the same so we had to remove some characters to avoid an error
![image](/uploads/71f1bc0dafe63401cf7e97c4f7fa4d73/image.png)
![image](/uploads/45d14a58509425906283a321a7dcc5ce/image.png)2024.1Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/445Space not working in permissions windows2024-01-12T13:45:31+01:00Antonio RiveraSpace not working in permissions windowsScreens like "Permissions: Inventory management" do not display any result with the "space key"
**Before**
![image](/uploads/daebe78e13ec80a6624f820c0418e7be/image.png)
**After**
![image](/uploads/dc4519ebd00dedbc67683f10c10f35ef/ima...Screens like "Permissions: Inventory management" do not display any result with the "space key"
**Before**
![image](/uploads/daebe78e13ec80a6624f820c0418e7be/image.png)
**After**
![image](/uploads/dc4519ebd00dedbc67683f10c10f35ef/image.png)
The JSON response is empty
![image](/uploads/9f393b5275e08f213cd962a95da0c365/image.png)
What is the purpose of the "space key" in this kind of controls?
**Note:** It is working with another keys
![image](/uploads/e6504c7fda78291506da9fa7baa8bf95/image.png)
**Note 2:** Indexes were regenerated2024.1Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/444Inventory update error in Curator Tool and GGCE Web2024-02-10T16:49:22+01:00Antonio RiveraInventory update error in Curator Tool and GGCE WebWe are trying to update the availability_status_code in Curator Tool and GGCE Web but changes are not saved. There are not any server error o error message or window.
In Curator Tool
**Before**
![image](/uploads/f9a409675c3ab95a76b22f...We are trying to update the availability_status_code in Curator Tool and GGCE Web but changes are not saved. There are not any server error o error message or window.
In Curator Tool
**Before**
![image](/uploads/f9a409675c3ab95a76b22fa3a8ab0da8/image.png)
**After**
![image](/uploads/f8285ab7b48022a2de5a4a8488e3ac05/image.png)
**After refresh**
![image](/uploads/f39c05672861b9d75e754e7e373ff7fb/image.png)
In GGCE Web
**Before**
![image](/uploads/abbb8ce5205c294b7aa4ae874a58761d/image.png)
![image](/uploads/e7fa25f8449d670ffcc9d63d68aca5d9/image.png)
**After**
![image](/uploads/bf652ac562de91207c633811ec19ac9c/image.png)
**After refresh**
![image](/uploads/47e48e3f010b007951545cab80aab237/image.png)
All inventories with this problem were updated first using the API. Any inventory that was not updated from the API has not this problem (Take a look to my latest issue)
I attached the request and response files from GGCE Web
[update_inventory_request.json](/uploads/b5f16cc77f30b5f5fdfda8c5b7bf8bf5/update_inventory_request.json)
[update_inventory_response.json](/uploads/fd5ebf02a206f15248f0da3f28654f15/update_inventory_response.json)2024.1Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/441@LookupDisplay2023-12-04T16:35:55+01:00Matija Obreza@LookupDisplayThe current implementation of display "labels" in GGCE that are used in the Curator Tool *lookup tables* allows for `@LookupDisplay` to be defined on a field and on a method. When defined on a field we are able to make a very fast query ...The current implementation of display "labels" in GGCE that are used in the Curator Tool *lookup tables* allows for `@LookupDisplay` to be defined on a field and on a method. When defined on a field we are able to make a very fast query to the database and only select the `id + field`, but when defined on a method, we need to fetch entire objects to generate a simple string. The `lookupDisplay()` method generally just concatenates a few fields. Using `lookupDisplay` method is a performance issue in large GGCE databases.
In this ticket we allow `@LookupDisplay` to be defined on a **class** as a JPA expression:
```java
@LookupDisplay("{JPA expresion}")
public class ...
```
We remove the option to define `@LookupDisplay` on a method (and remove handling methods in `VirutalLookupServiceImpl`).
When `LookupDisplay` is not declared we already use the `id` field as a label.
Instead of fetching entire objects to memory, we let the database do the string generation. This approach comes with some limitations, but it eliminates a big bottleneck that may even cause the server to OOM.
## Example
For `Cooperator` to generate the label `Last, First, My Organization` we can use:
```java
@LookupDisplay("concat(lastName, ', ', firstName, ', ', coalesce(organization, ''))")
public class Cooperator extends ... {
```2024.1Artem HrybeniukArtem Hrybeniukhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/439Switch to mapstruct2023-11-28T08:52:20+01:00Matija ObrezaSwitch to mapstructWe are now using manually prepared mapping functions. Switch to [mapstruct](https://mapstruct.org/).We are now using manually prepared mapping functions. Switch to [mapstruct](https://mapstruct.org/).2024.1Artem HrybeniukArtem Hrybeniuk