GGCE Server issueshttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues2020-05-22T18:04:36+02:00https://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/22GeographyController2020-05-22T18:04:36+02:00Matija ObrezaGeographyControllerAdd `GeographyController` with `filter`, `add`, `update`, `delete` methods.
Wait for !22.Add `GeographyController` with `filter`, `add`, `update`, `delete` methods.
Wait for !22.1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/23Sorting by multiple columns2020-05-26T16:50:04+02:00Matija ObrezaSorting by multiple columnsThe API now allows for sorting on multiple columns, but they all share the same `Sort.Direction`.
Add support for the client to specify sort direction **by column**:
```json
{ "sort": { "foo": "asc", "bar": "asc", "xxx": "desc" } }
```...The API now allows for sorting on multiple columns, but they all share the same `Sort.Direction`.
Add support for the client to specify sort direction **by column**:
```json
{ "sort": { "foo": "asc", "bar": "asc", "xxx": "desc" } }
```
Also upgrade support for `DEFAULT_SORT` in `SpeciesController` to:
```java
DEFAULT_SORT = { QTaxonomySpecies.taxonomySpecies.taxonomyGenus.genusName.asc(), QTaxonomySpecies.taxonomySpecies.speciesName.asc() };
```1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/24ES JSON serialization2020-05-22T20:52:41+02:00Matija ObrezaES JSON serializationES complains that we have duplicate JSON fields:
```
Caused by: com.fasterxml.jackson.core.JsonParseException: Duplicate field 'createdBy'
```
```json
{
"id": 22635,
"createdBy": 4,
"createdBy": 4,
"createdDate": "2005-01-02T23:00:...ES complains that we have duplicate JSON fields:
```
Caused by: com.fasterxml.jackson.core.JsonParseException: Duplicate field 'createdBy'
```
```json
{
"id": 22635,
"createdBy": 4,
"createdBy": 4,
"createdDate": "2005-01-02T23:00:00.000+00:00",
"modifiedBy": 4,
"modifiedDate": "2011-04-27T22:00:00.000+00:00",
"ownedBy": {
"id": 4,
"createdDate": "2019-08-06T06:04:04.000+00:00",
"categoryCode": "UARS",
"city": "Beltsville",
"currentCooperator": 4,
"firstName": "Taxonomist",
"job": "(NPGS Taxonomist)",
"lastName": "SYSTEM",
"note": "Various NPGS Taxonomists",
"organization": "USDA-ARS",
"postalIndex": "20705",
"site": {
"createdDate": "2019-10-24T17:21:53.000+00:00",
"ownedDate": "2019-10-24T17:21:53.000+00:00",
"id": 5,
"isDistributionSite": "N",
"isInternal": "N",
"siteLongName": "SYSTEM",
"siteShortName": "SYS",
"_class": "Site"
},
"statusCode": "INACTIVE",
"_class": "Cooperator"
},
"ownedDate": "2005-01-02T23:00:00.000+00:00",
"currentTaxonomyGenus": 6280,
"genusAuthority": "(M. Roem.) Post & Kuntze",
"genusName": "Gijefa",
"qualifyingCode": "=",
"taxonomyFamily": {
"id": 2932,
"id": 2932,
"createdDate": "2011-04-27T22:00:00.000+00:00",
"modifiedDate": "2017-01-12T22:57:54.000+00:00",
"ownedDate": "2011-04-27T22:00:00.000+00:00",
"familyAuthority": "Juss., nom. cons.",
"familyName": "Cucurbitaceae",
"suprafamilyRankCode": "ORDER",
"suprafamilyRankName": "Cucurbitales",
"tribeName": "Coniandreae",
"_class": "TaxonomyFamily"
},
"_class": "TaxonomyGenus"
}
```1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/25ES Client2020-05-28T15:55:05+02:00Matija ObrezaES ClientThe HighLevelRestClient seems to pool connections and they get closed by ES, resulting in:
![image](/uploads/21c9fd5f6c49aab44bd825dba14a8904/image.png)
This is the same as reported in genesys-pgr/genesys-server#521
Any ideas how to m...The HighLevelRestClient seems to pool connections and they get closed by ES, resulting in:
![image](/uploads/21c9fd5f6c49aab44bd825dba14a8904/image.png)
This is the same as reported in genesys-pgr/genesys-server#521
Any ideas how to manage reconnecting and timeouts better?1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/26Retrieve AccessionDetails2020-06-04T11:27:09+02:00Matija ObrezaRetrieve AccessionDetailsAdd API endpoint at */a/details/{id}* that loads accession and related data and returns `AccessionDetails`:
```java
class AccessionDetails {
@JsonWrapped
Accession accession;
List<AccessionSource> sources;
List<AccessionAction> act...Add API endpoint at */a/details/{id}* that loads accession and related data and returns `AccessionDetails`:
```java
class AccessionDetails {
@JsonWrapped
Accession accession;
List<AccessionSource> sources;
List<AccessionAction> actions;
List<AccessionIpr> ipr;
List<AccessionPedigree> pedigree;
List<AccessionQuarantine> quarantine;
List<Citation> citations;
}
```1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/27Site locations2020-06-15T12:34:52+02:00Matija ObrezaSite locationsA controlled list of available storage locations for a `Site` helps users with picking valid locations of *Inventory* recors.
Add a new entity `SiteLocation` with:
```java
class SiteLocation extends EmptyModel {
Long id;
Site site;
...A controlled list of available storage locations for a `Site` helps users with picking valid locations of *Inventory* recors.
Add a new entity `SiteLocation` with:
```java
class SiteLocation extends EmptyModel {
Long id;
Site site;
@Column(name = "storage_location_part1", length = 20, nullable = false)
private String storageLocationPart1;
@Column(name = "storage_location_part2", length = 20)
private String storageLocationPart2;
@Column(name = "storage_location_part3", length = 20)
private String storageLocationPart3;
@Column(name = "storage_location_part4", length = 20)
private String storageLocationPart4;
}
```
Only administrator can create, modify and delete `SiteLocation` records, but all can read.
The filter class:
```java
class SiteLocationFilter {
long site; // site id
Set<String> storageLocationPart1; // multiple values
Set<String> storageLocationPart2; // ..
Set<String> storageLocationPart3;
}
```
Add model, filter, repository, filtered CRUD service and extends SiteController API.
## Additional properties
We also wish to record the "type" of storage location. This can be one of `LTS`, `MTS`, `Cryo`, `TC`, `Backup`, ... We will use `CodeValue` group **LOCATION_TYPE**, in the database this is `@Column(length=20) String locationType`.
1.0Edwin RojasEdwin Rojashttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/28Actions2020-06-10T18:39:21+02:00Matija ObrezaActionsgrin-global/grin-global-ui#27 is a use case that relies on `RequestOrderItemAction` and we need new APIs to manage action records.
## Superclass
We have a number of `...Action` entities (e.g. `InventoryAction`, `AccessionAction`, `Requ...grin-global/grin-global-ui#27 is a use case that relies on `RequestOrderItemAction` and we need new APIs to manage action records.
## Superclass
We have a number of `...Action` entities (e.g. `InventoryAction`, `AccessionAction`, `RequestOrderItemAction`, `RequestOrderAction`) that can extend from a new `@MappedEntity` superclass `AbstractAction`.
The `@ManyToOne` entity that owns the action should always be serialized as id.
## Services and API
Actions are identified by the `actionNameCode`. These are declared as `CodeValue`. We should not use `@PathVariable` because we cannot assure values are sensible.
We want to record in the system that an action was initiated (`startedDate = now()`) and that an action was completed (`completedDate = now()`).
Add API endpoints to **add** action records for request orders as a demo:
- POST */order/action/start*
- POST */order/action/complete*
- POST */order/action/reopen* (resets `completedDate` to null and `startDate = now()` on the last action only)
The API should receive a set of IDs of `RequestOrder` (or `RequestOrderItem`) and the action data. This could probably be a small utility class:
```java
{
public String actionNameCode; // action code
public Set<Long> id; // entities
// data
public Double actionCost;
public String actionInformation;
public String actionNameCode....
}
```
# Listing actions
We want to retrieve action records by entity ID set (and optionally `actionNameCode` and `closed`):
- POST */order/action/list*
This returns all `RequestOrderAction` records where
```java
RequestOrder.id.in(entityIds)
// if actionNameCode
.and(RequestOrderAction.actionNameCode.eq(actionNameCode)
// if closed
.and(....completedDate.notNull())
// if ! closed
...completedDate.isNull()
```
The filter object:
```java
public class ActionFilter {
public Set<String> actionNameCode; // action code
public Set<Long> id; // entities
public Boolean closed;
}
```
1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/29Empty caches2020-06-07T00:34:14+02:00Matija ObrezaEmpty cachesAdd admin action to empty caches. Copy from Genesys.Add admin action to empty caches. Copy from Genesys.1.0Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/30File repository2020-06-07T09:22:18+02:00Matija ObrezaFile repositoryIntegrate `file-repository` and `ImageGalleryAspects`.Integrate `file-repository` and `ImageGalleryAspects`.1.0Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/31AccessionDetails with AccessionInvAttach2020-06-07T10:33:27+02:00Matija ObrezaAccessionDetails with AccessionInvAttach#30 adds file repository support and we should add `AccessionInvAttach` to `AccessionDetails`.#30 adds file repository support and we should add `AccessionInvAttach` to `AccessionDetails`.1.0Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/32GG PW and GG-CE2023-09-05T06:51:22+02:00Matija ObrezaGG PW and GG-CE@gcapilit You're now running the GG PW at gringlobal.irri.org. This is running on the Windows server and probably a different database.
What level of interaction do you see between GG PW and GG-CE Server?
@jalarcon Do you run two datab...@gcapilit You're now running the GG PW at gringlobal.irri.org. This is running on the Windows server and probably a different database.
What level of interaction do you see between GG PW and GG-CE Server?
@jalarcon Do you run two databases and PWs (external and internal) at CIMMYT?
## `Web*` tables
These tables are generally updated by web users. What kinds of integration would you want to put in place?
My assumption is that `web_*` tables would somehow be copied directly from the public database to the internal database to make the records available for processing.
In the other direction, `accession_*` and `order_*` tables would be copied from the internal server to the public database. I could be wrong.https://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/33Liquibase migration error2020-06-12T10:41:36+02:00Oleksii SavranLiquibase migration error```
11:03:23,704 main WARN AnnotationConfigWebApplicationContext:558 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with n...```
11:03:23,704 main WARN AnnotationConfigWebApplicationContext:558 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'databaseMigration' defined in org.gringlobal.application.config.DatabaseConfig: Invocation of init method failed; nested exception is liquibase.exception.MigrationFailedException: Migration failed for change set classpath:liquibase/liquibase-changeLog.yml::1591376792000-2::mobreza:
Reason: liquibase.exception.DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete from oauthclient; delete from acl_sid;
set identity_insert acl_sid on; in' at line 1 [Failed SQL: (1064) delete from oauthclientrole; delete from oauthclient; delete from acl_sid;
set identity_insert acl_sid on; insert into acl_sid (id, type, version, active, principal, sid, createdDate, lastModifiedDate) (select sys_user_id, 1, 1, iif(is_enabled = 'Y', 1, 0), 1, user_name, created_date, modified_date from sys_user);
declare @max_sid bigint; select @max_sid = max(id) from acl_sid; insert into acl_sid (id, type, version, active, principal, sid, createdDate, lastModifiedDate) (select web_user_id + @max_sid, 3, 1, 1, 1, user_name, created_date, modified_date from web_user); set identity_insert acl_sid off;]
11:03:23,721 main ERROR ContextLoader:313 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'databaseMigration' defined in org.gringlobal.application.config.DatabaseConfig: Invocation of init method failed; nested exception is liquibase.exception.MigrationFailedException: Migration failed for change set classpath:liquibase/liquibase-changeLog.yml::1591376792000-2::mobreza:
Reason: liquibase.exception.DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete from oauthclient; delete from acl_sid;
set identity_insert acl_sid on; in' at line 1 [Failed SQL: (1064) delete from oauthclientrole; delete from oauthclient; delete from acl_sid;
set identity_insert acl_sid on; insert into acl_sid (id, type, version, active, principal, sid, createdDate, lastModifiedDate) (select sys_user_id, 1, 1, iif(is_enabled = 'Y', 1, 0), 1, user_name, created_date, modified_date from sys_user);
declare @max_sid bigint; select @max_sid = max(id) from acl_sid; insert into acl_sid (id, type, version, active, principal, sid, createdDate, lastModifiedDate) (select web_user_id + @max_sid, 3, 1, 1, 1, user_name, created_date, modified_date from web_user); set identity_insert acl_sid off;]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
```
cc @mobrezaMatija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/34Generating the initial schema2020-06-24T08:31:08+02:00Matija ObrezaGenerating the initial schemaPlease test the instructions to generate the database schema when the MSSQL database is completely empty.
Start with a blank MSSQL docker container:
```sh
docker volume create mssql-gg-data
docker run --name 'mssql-gg' -e 'ACCEPT_EULA=...Please test the instructions to generate the database schema when the MSSQL database is completely empty.
Start with a blank MSSQL docker container:
```sh
docker volume create mssql-gg-data
docker run --name 'mssql-gg' -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=YourStrong@Passw0rd' -e 'MSSQL_PID=Express' -e 'TZ=UTC' -v mssql-gg-data:/var/opt/mssql mcr.microsoft.com/mssql/server:2019-latest
```
Document how to:
1. Create a database `gg-ce-dev`
1. Execute liquibase to generate the schema in `gg-ce-dev` (see README and liquibase.properties)1.0Oleksii SavranOleksii Savranhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/35Processes in request handling2023-09-05T06:51:11+02:00Matija ObrezaProcesses in request handling@jalarcon @gcapilit GG allows for recording process steps as `*Actions`.
There is no specific *status* on the order itself, it is considered as closed when the `completedDate` is set. Everything else is recorded as order actions.
Cons...@jalarcon @gcapilit GG allows for recording process steps as `*Actions`.
There is no specific *status* on the order itself, it is considered as closed when the `completedDate` is set. Everything else is recorded as order actions.
Considering a generic request for material (think distribution), once the list of accessions and request details are filed in GG, the next steps are:
1. **Assign** source inventory to each requested item
1. If there is **no available** inventory, what can we do with that order item? Set SYSTEM inventory and `CANCEL` the item?
1. This leaves us with order items that have valid source inventory and can be packaged for distribution
1. Determine if SMTA acceptance is required
1. If SMTA required, initiate order item action `SMTAACCEPT` for all remaining items
1. If other MTA is required, initiate relevant item action.
1. Determine if IMPORT PERMIT is required
1. Initiate `IMPORT_PER` action on items
For each item in the request:
1. **Retrieve** source inventories from storage
1. **Pack** take material from source inventory and package for distribution. This updates the available `quantityOnHand` of the source inventory.
1. **Verify** that packets for distribution match (@jalarcon This is your `ORIA_VER_SHIP` action)
1. **Ship** the material
Each of these is a task that can be recorded as `OrderRequestItemAction` with its own `start` and `completed` date.
Are any steps missing?
## Relationship with order item `Status`
The status of each order item begins with `NEW` and ends in one of: `SHIPPED`, `CANCEL` or `SPLIT` states.
Intermediate states in GG are: `HOLD`, `PENDING`, `INSPECT` and `QUALITYTEST`. It is not immediately clear how these relate to the actions listed above.Grace CapilitGrace Capilithttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/36Genesys import with crops2020-06-11T09:08:59+02:00Matija ObrezaGenesys import with cropsMappings of crops to taxonomy should be imported from Genesys.
It should add records to `TaxonomyCropMap`.Mappings of crops to taxonomy should be imported from Genesys.
It should add records to `TaxonomyCropMap`.1.0Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/37Add disclaimer2020-06-12T09:20:45+02:00Matija ObrezaAdd disclaimerAdd a disclaimer to README, just in case it is not clear.Add a disclaimer to README, just in case it is not clear.1.0Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/38Update Geography2020-06-13T20:41:46+02:00Matija ObrezaUpdate GeographyThe `.cab` file contains geography and region data. Import that to local database.The `.cab` file contains geography and region data. Import that to local database.1.0Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/39Site on accession and inventory2020-06-30T17:46:28+02:00Matija ObrezaSite on accession and inventoryAdd a new property `Site site` to `Accession` and `Inventory` records. It is **not nullable**.
Migration scripts need to populate the `site` from:
- For accessions: from `accession.ownedBy.site`
- Inventories: from `inventory.inventory...Add a new property `Site site` to `Accession` and `Inventory` records. It is **not nullable**.
Migration scripts need to populate the `site` from:
- For accessions: from `accession.ownedBy.site`
- Inventories: from `inventory.inventoryMaintPolicy.owner.site`1.0Anastasiia KarasAnastasiia Karashttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/40Inventory details2020-06-15T15:26:58+02:00Matija ObrezaInventory detailsAdd `InventoryDetails` for grin-global/grin-global-ui#35Add `InventoryDetails` for grin-global/grin-global-ui#351.0Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/41KPI Infrastructure2020-06-30T15:48:00+02:00Matija ObrezaKPI InfrastructureCopy the KPI models, services and controllers from Genesys.
Update `liquibase` (needs to work for mysql and MSSQL, usually mysql-sourced changes generate good changelogs, but see existing changesets for examples).
Copy the KPI models, services and controllers from Genesys.
Update `liquibase` (needs to work for mysql and MSSQL, usually mysql-sourced changes generate good changelogs, but see existing changesets for examples).
1.0Maxym BorodenkoMaxym Borodenko