GGCE Server issueshttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues2020-10-12T17:03:06+02:00https://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/107Inv Group: Delete2020-10-12T17:03:06+02:00Matija ObrezaInv Group: Deletegrin-global/grin-global-ui!102 adds editing and delete support to the UI.
Calling the delete inventory group API fails with:
> could not execute batch; SQL [delete from accession_inv_group where accession_inv_group_id=?]; constraint [n...grin-global/grin-global-ui!102 adds editing and delete support to the UI.
Calling the delete inventory group API fails with:
> could not execute batch; SQL [delete from accession_inv_group where accession_inv_group_id=?]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute batchcould not execute batchThe DELETE statement conflicted with the REFERENCE constraint "fk_aigm_aig". The conflict occurred in database "..", table "dbo.accession_inv_group_map", column 'accession_inv_group_id'.1.0Anastasiia KarasAnastasiia Karashttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/108CE server not starting after pulling latest2020-10-20T07:46:52+02:00Lilibeth SisonCE server not starting after pulling latest@mobreza I pulled the latest this morning. Then server won't start
here is part of the log :
```
2020-10-20 03:12:39.624:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=2466ms
2020-10-20 03:12:39.942:INFO:oejshC.ROOT:main...@mobreza I pulled the latest this morning. Then server won't start
here is part of the log :
```
2020-10-20 03:12:39.624:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=2466ms
2020-10-20 03:12:39.942:INFO:oejshC.ROOT:main: 3 Spring WebApplicationInitializers detected on classpath
WhoMakesTheJSessionId listener instantiated.
2020-10-20 03:12:40.203:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
2020-10-20 03:12:40.203:INFO:oejs.session:main: No SessionScavenger set, using defaults
2020-10-20 03:12:40.204:INFO:oejs.session:main: node0 Scavenging every 660000ms
2020-10-20 03:12:40.213:INFO:oejshC.ROOT:main: Initializing Spring root WebApplicationContext
03:12:42,132 main WARN ApplicationConfig:70 - Extra configuration file myconfig.properties not found
03:12:43,181 main WARN GMTStringToDateConverter:18 - Current time in SOAP format: 2020-10-20T03:12:43.0000181Z
Application is connecting to jdbc:sqlserver://172.29.4.174:1433;DatabaseName=gringlobal_forDocker
03:12:44,071 main INFO DatabaseSchemaCreator:88 - Inspecting catalog=gringlobal_forDocker schema=dbo
03:12:45,101 main INFO JdbcExecutor:95 - select schema_name()
03:12:45,105 main INFO JdbcExecutor:95 - SELECT CASE ServerProperty('EngineEdition')
WHEN 1 THEN 'Personal'
WHEN 2 THEN 'Standard'
WHEN 3 THEN 'Enterprise'
WHEN 4 THEN 'Express'
WHEN 5 THEN 'Azure'
ELSE 'Unknown'
END
03:12:45,121 main INFO JdbcExecutor:95 - select schema_name()
03:12:45,122 main INFO JdbcExecutor:95 - SELECT COUNT(*) FROM DATABASECHANGELOGLOCK
03:12:45,139 main INFO JdbcExecutor:95 - select schema_name()
03:12:45,140 main INFO JdbcExecutor:95 - SELECT COUNT(*) FROM DATABASECHANGELOGLOCK
03:12:45,142 main INFO JdbcExecutor:95 - select schema_name()
03:12:45,143 main INFO JdbcExecutor:95 - SELECT LOCKED FROM DATABASECHANGELOGLOCK WHERE ID=1
03:12:45,145 main INFO StandardLockService:95 - Waiting for changelog lock....
03:12:55,147 main INFO JdbcExecutor:95 - select schema_name()
03:12:55,149 main INFO JdbcExecutor:95 - SELECT LOCKED FROM DATABASECHANGELOGLOCK WHERE ID=1
03:12:55,150 main INFO StandardLockService:95 - Waiting for changelog lock....
03:13:05,153 main INFO JdbcExecutor:95 - select schema_name()
03:13:05,155 main INFO JdbcExecutor:95 - SELECT LOCKED FROM DATABASECHANGELOGLOCK WHERE ID=1
03:13:05,157 main INFO StandardLockService:95 - Waiting for changelog lock....
03:13:15,159 main INFO JdbcExecutor:95 - select schema_name()
03:13:15,161 main INFO JdbcExecutor:95 - SELECT LOCKED FROM DATABASECHANGELOGLOCK WHERE ID=1
03:13:15,163 main INFO StandardLockService:95 - Waiting for changelog lock....
03:13:25,166 main INFO JdbcExecutor:95 - select schema_name()
03:13:25,168 main INFO JdbcExecutor:95 - SELECT LOCKED FROM DATABASECHANGELOGLOCK WHERE ID=1
03:13:25,170 main INFO StandardLockService:95 - Waiting for changelog lock....
```Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/109CORS update2020-10-28T08:00:29+01:00Matija ObrezaCORS updateUpgrade GG with CORS udpates in genesys-pgr/genesys-server!584Upgrade GG with CORS udpates in genesys-pgr/genesys-server!5841.0Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/110WebUser APIs2020-11-11T15:16:07+01:00Matija ObrezaWebUser APIsPlease add a new API controller to */api/v1/webuser* for CRUD operations on `WebUser`.
We need full-text search support and filtering on `WebUser`.Please add a new API controller to */api/v1/webuser* for CRUD operations on `WebUser`.
We need full-text search support and filtering on `WebUser`.1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/111ES select fields for full-text search2020-11-02T10:22:38+01:00Matija ObrezaES select fields for full-text searchWe need better control over what fields should be indexed for full-text search.We need better control over what fields should be indexed for full-text search.1.0Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/112Add backend for #1382020-11-18T14:43:26+01:00Maksym TishchenkoAdd backend for #138https://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/138
We need API endpoints:
1. */api/v1/webuser/register*: Register new web user, receives email and password.
1. */api/v1/webuser/me*: Returns `WebUser` (with `WebCoopera...https://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/138
We need API endpoints:
1. */api/v1/webuser/register*: Register new web user, receives email and password.
1. */api/v1/webuser/me*: Returns `WebUser` (with `WebCooperator`) for the currently logged in `WebUser`Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/113OAuth origin filter2020-11-18T14:00:55+01:00Matija ObrezaOAuth origin filterThe `OAuthClientOriginCheckFilter` now checks that the HTTP request *Origin* header matches the one allowed for the client.
It currently does a check if `allowedOrigins.isEmpty()`.
Please add the `else` part that will check that there ...The `OAuthClientOriginCheckFilter` now checks that the HTTP request *Origin* header matches the one allowed for the client.
It currently does a check if `allowedOrigins.isEmpty()`.
Please add the `else` part that will check that there is no Origin header. That means that this client may not be used from browsers.1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/114ACL check on startup2020-11-18T11:55:46+01:00Matija ObrezaACL check on startupI get a lot of `Error accessing anonymous permissions` log messages (from `CurrentPermissionWriter`) when using an imported database, where records were not created by the server and they don't have ACL owners and basic permissions.
Add...I get a lot of `Error accessing anonymous permissions` log messages (from `CurrentPermissionWriter`) when using an imported database, where records were not created by the server and they don't have ACL owners and basic permissions.
Add something to admin to fix ACL issues: assure SID owner, basic owner permissions. (see Genesys admin)1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/115Verification email for WebUser2020-11-18T14:43:28+01:00Matija ObrezaVerification email for WebUserAdd `EMailVerificationService` to send a verification email after registration of a `WebUser` via the API.
Because this happens mostly in the embedded GG-CE UI, we need forms in that project and verification endpoints here.Add `EMailVerificationService` to send a verification email after registration of a `WebUser` via the API.
Because this happens mostly in the embedded GG-CE UI, we need forms in that project and verification endpoints here.1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/116WebUser login2020-11-18T14:43:26+01:00Matija ObrezaWebUser logingrin-global/grin-global-ui#139 asks for support for login of `WebUser` using OAuth *Password* credentials (username+password provided by the user).
This requires checking user credentials against a **new** `webUserDetailsService` and `W...grin-global/grin-global-ui#139 asks for support for login of `WebUser` using OAuth *Password* credentials (username+password provided by the user).
This requires checking user credentials against a **new** `webUserDetailsService` and `WebUser` needs to implement `UserDetails`.
One idea is to add another `AuthorizationServer` to `OAuth2ServerConfig`:
```java
@Configuration
@EnableAuthorizationServer
protected class WebUserAuthorizationServerConfiguration extends AuthorizationServerConfigurerAdapter {
```
This `WebUserAuthorizationServerConfiguration` will need to be available on a different URL (the default */oauth/..* is already used). I hope this can be achieved by setting just the `prefix`:
```java
@Override
public void configure(final AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
final TokenEnhancerChain tokenEnhancerChain = new TokenEnhancerChain();
tokenEnhancerChain.setTokenEnhancers(Arrays.asList(accessTokenConverter()));
endpoints
.prefix("/webauth") // Prefix
.tokenStore(tokenStore())
.authorizationCodeServices(authorizationCodeServices())
.tokenEnhancer(tokenEnhancerChain)
.userDetailsService(webUserDetailsService) // webUserDetailsService
.authenticationManager(authenticationManager);
}
```1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/117Service endpoints?2021-02-15T11:04:07+01:00Matija ObrezaService endpoints?@jarias asked "Reviewing GG-CE, there are some services that are not listed and if they are, could you tell me how they are named":
| table | Expected endpoint |
|--------------------|---------------|
| Code_value | /list ...@jarias asked "Reviewing GG-CE, there are some services that are not listed and if they are, could you tell me how they are named":
| table | Expected endpoint |
|--------------------|---------------|
| Code_value | /list |
| Cooperator_group | /list |
| Cooperator_map | /list |
| Order_request_item | /list |
| Sys_group_user_map | /list |
| Sys_user | /list |
| Inventory_action | /add, /update |1.0Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/118Creating Inventories2020-11-18T13:21:23+01:00Matija ObrezaCreating InventoriesWhen creating new `Inventory` and other types of records via the API we only want to provide the `id` of referenced entities.
In the example below, we would create a new `Inventory` for accession with `id: 2001`:
```json
{
"accession...When creating new `Inventory` and other types of records via the API we only want to provide the `id` of referenced entities.
In the example below, we would create a new `Inventory` for accession with `id: 2001`:
```json
{
"accession": {
"id": 2001
},
"inventoryMaintPolicy": {
"id": 2
},
"site": {
"id": 47
},
"distributionCriticalQuantity": 1600,
"distributionDefaultFormCode": "SD",
"distributionDefaultQuantity": 250,
"distributionUnitCode": "sd",
"formTypeCode": "SD",
"isAutoDeducted": "Y",
"maintenanceName": "Maize",
"note": null,
"quantityOnHandUnitCode": "sd",
"regenerationCriticalQuantity": 1600,
"regenerationMethodCode": "Pap",
"inventoryNumberPart1": "MO",
"inventoryNumberPart2": "-1",
"isDistributable": "Y",
"quantityOnHand": "5000",
"hundredSeedWeight": "500",
"isAvailable": "Y",
"availabilityStatusCode": "AVAIL"
}
```
Right now, this fails in `lazyLoad` because `accession.taxonomySpecies == null`.
`@Transactional` boundaries don't allow for this.
The `create` service methods need to load these referenced entities.1.0Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/119Templating service2020-12-08T15:09:49+01:00Matija ObrezaTemplating serviceWe have several string templates in GG-CE that need to be filled with data. The most recent example is the filling an email template for user account verification.
Regardless of where the templates are stored, we need one templating sys...We have several string templates in GG-CE that need to be filled with data. The most recent example is the filling an email template for user account verification.
Regardless of where the templates are stored, we need one templating system that works both on the server (Java) and can be used on the client (Javascript).
```java
public interface TemplatingService {
String fillTemplate(String template, Map<String, Object> params);
}
```
```ts
function fillTemplate(template: string, params: Map) {
//
}
```
The template syntax will depend on the engine selected.1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/120Admin AppResource CRUD2020-12-08T15:09:48+01:00Matija ObrezaAdmin AppResource CRUDWe need to add support to manage `AppResource` in the UI for Administrators.
Please implement the CRUD controller and services.We need to add support to manage `AppResource` in the UI for Administrators.
Please implement the CRUD controller and services.1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/121Server not starting2020-11-20T08:28:59+01:00Lilibeth SisonServer not starting@mobreza I pulled latest release.
server not starting after that.
attached is the log file[gg-ce-server_log.txt](/uploads/f8bc096e6be40dcc348afbdbfc9a42c9/gg-ce-server_log.txt)@mobreza I pulled latest release.
server not starting after that.
attached is the log file[gg-ce-server_log.txt](/uploads/f8bc096e6be40dcc348afbdbfc9a42c9/gg-ce-server_log.txt)https://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/122BrAPI controllers2021-02-01T11:17:15+01:00Matija ObrezaBrAPI controllersBring BrAPI controllers and services from Genesys and adapt them to GG-CE.Bring BrAPI controllers and services from Genesys and adapt them to GG-CE.1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/123SysUser management2020-12-08T08:07:32+01:00Matija ObrezaSysUser managementUpgrade the SysUser management controller to:
- list available roles
- allow for assigning roles to `SysUser`Upgrade the SysUser management controller to:
- list available roles
- allow for assigning roles to `SysUser`1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/124CodeValue Translations2020-12-08T08:28:46+01:00Matija ObrezaCodeValue TranslationsUpdate CVL API for grin-global/grin-global-ui#151
1. Return CodeValueLang for all languages, use default translations if records are not in the DB
1. Add `upsert` method for codevalues at `POST/PUT /{cvId}/lang/{language}` to upsert tr...Update CVL API for grin-global/grin-global-ui#151
1. Return CodeValueLang for all languages, use default translations if records are not in the DB
1. Add `upsert` method for codevalues at `POST/PUT /{cvId}/lang/{language}` to upsert translation
1. Change delete to remove by language `DELETE /cvId}/lang/{language}`
![image](/uploads/acbea3367f60163677ca5dcfb7e283be/image.png)1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/126Inventory full-text search2021-01-11T06:34:03+01:00Matija ObrezaInventory full-text searchThe UI sends `{"_text":"zea","includeSystem":false}` to the API, but the response still includes system inventories:
![image](/uploads/6cfa6a14a6983603c51d56a98f85b242/image.png)The UI sends `{"_text":"zea","includeSystem":false}` to the API, but the response still includes system inventories:
![image](/uploads/6cfa6a14a6983603c51d56a98f85b242/image.png)1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/127Audit logs: modifiedDate2021-01-06T10:40:27+01:00Matija ObrezaAudit logs: modifiedDateAny reason that `modifiedDate` is recorded in auditlogs?
![image](/uploads/a7e7658e896b964f53ee0c37b8bb4630/image.png)
I believe we ignore fields flagged with Spring's `@CreatedDate` and `@ModifiedDate`?Any reason that `modifiedDate` is recorded in auditlogs?
![image](/uploads/a7e7658e896b964f53ee0c37b8bb4630/image.png)
I believe we ignore fields flagged with Spring's `@CreatedDate` and `@ModifiedDate`?1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/128SID autocomplete2020-12-17T16:29:43+01:00Maxym BorodenkoSID autocompleteThe SID autocomplete method in `PermissionController` uses `Map<String, Long>` to return "names" mapped to their `AclSid#id` field. This means that if two entries use the same "name" (`client.getTitle()`, `role.getAuthority()`, `sysGroup...The SID autocomplete method in `PermissionController` uses `Map<String, Long>` to return "names" mapped to their `AclSid#id` field. This means that if two entries use the same "name" (`client.getTitle()`, `role.getAuthority()`, `sysGroup.getGroupTag()`, ...) the only the last one will be included in the `Map`.
It would be better if the map returned was `Map<Long, String>`, mapping `AclSid#id` to a "name" since `id` is guaranteed to be unique.
A new UI ticket needs to be created to respect this change.Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/129Generic translation service2021-02-03T11:37:31+01:00Maxym BorodenkoGeneric translation serviceCurrently, the code for translations in `CodeValueServiceImpl` and `CropTraitServiceImpl` looks very similar. There are a lot of duplicated things. It would be nice to move all that stuff to a single place.
We already use such an approa...Currently, the code for translations in `CodeValueServiceImpl` and `CropTraitServiceImpl` looks very similar. There are a lot of duplicated things. It would be nice to move all that stuff to a single place.
We already use such an approach in the system, see `BaseAttachmentSupport`, `BaseActionSupport`. That approach works fine, so we can try something like that.Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/130Move @Id to the superclass2023-09-05T06:47:48+02:00Maxym BorodenkoMove @Id to the superclassAll entities in the system (about 150 classes) contain their own `id` property with a list of required annotations.
```java
@Id
@JsonProperty
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "crop_id")
private Long id...All entities in the system (about 150 classes) contain their own `id` property with a list of required annotations.
```java
@Id
@JsonProperty
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "crop_id")
private Long id;
```
The current code looks not very flexible. For example, if we need to change `GenerationType` then we have to update each class instead of a single superclass. We had to use that approach because each entity has a unique name of id column in the DB (`table_name_id`). To get rid of duplicate code we could use JPA's `@AttributeOverride` annotation.
> Used to override the mapping of a <code>Basic</code> (whether explicit or default) property or field or <code>Id</code> property or field.
> May be applied to an entity that extends a mapped superclass or to an embedded field or property to override a basic mapping or id mapping defined by the mapped superclass
We can move the `id` field to the `@MappedSuperclass` and override the mapping of id using `@AttributeOverride`
```java
@Entity
@Table(name = "crop")
@Cacheable
@AttributeOverride(name = "id", column = @Column(name = "crop_id"))
@JsonIdentityInfo(scope = Crop.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class Crop extends CooperatorOwnedModel implements Copyable<Crop> {
...
}
```Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/131Upgrade app-blocks, file-repository to 3.02021-01-13T17:21:39+01:00Matija ObrezaUpgrade app-blocks, file-repository to 3.0Releases 3.0-SNAPSHOT are built with Java 11. Please update app-blocks and file-repo and test.Releases 3.0-SNAPSHOT are built with Java 11. Please update app-blocks and file-repo and test.1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/132CRUD for Accession related records2021-02-01T11:17:08+01:00Maksym TishchenkoCRUD for Accession related recordsWe need API for: https://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/164
Implement API CRUD functionality for:
* AccessionIPR
* AccessionInvName
* AccessionSource
* AccessionPedigree
* AccessionCitations
* AccessionQuarantineWe need API for: https://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/164
Implement API CRUD functionality for:
* AccessionIPR
* AccessionInvName
* AccessionSource
* AccessionPedigree
* AccessionCitations
* AccessionQuarantineMaxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/133InventoryFilter with InventoryMaintenancePolicyFilter2021-01-27T18:25:17+01:00Matija ObrezaInventoryFilter with InventoryMaintenancePolicyFilterThe `InventoryFilter` now has a TODO for the `InventoryMaintenancePolicyFilter`. Please enable filtering by maintenance policy.The `InventoryFilter` now has a TODO for the `InventoryMaintenancePolicyFilter`. Please enable filtering by maintenance policy.1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/134Viability: Tetrazolium test results2021-02-04T11:26:44+01:00Matija ObrezaViability: Tetrazolium test resultsThis is to extend `InventoryViability` and `InventoryViabilityData` with columns for *Tetrazolium test results*:
Add to `InventoryViabilityData`: `Integer tzpositive_count` and `Integer tznegative_count`.
Add to `InventoryViability`: `...This is to extend `InventoryViability` and `InventoryViabilityData` with columns for *Tetrazolium test results*:
Add to `InventoryViabilityData`: `Integer tzpositive_count` and `Integer tznegative_count`.
Add to `InventoryViability`: `Integer percent_tzpositive` and `Integer percent_tznegative`.
![image](/uploads/92cf1fb8891bf8f36b3b442ed8415e8c/image.png)
## Notes
the sum of all `*_count` fields must add up.
The sum of all `percent_*` fields must add up to 100.CC1.0Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/135Inventory Viability Actions2021-05-06T06:25:48+02:00Matija ObrezaInventory Viability ActionsAdd a new entity `InventoryViabilityAction` and one new code group:
```java
public static final String INVENTORY_VIABILITY_ACTION = "INVENTORY_VIABILITY_ACTION";
// with
new CodeValueDef(INVENTORY_VIABILITY_ACTION, "PRETREATMENT", "Pre...Add a new entity `InventoryViabilityAction` and one new code group:
```java
public static final String INVENTORY_VIABILITY_ACTION = "INVENTORY_VIABILITY_ACTION";
// with
new CodeValueDef(INVENTORY_VIABILITY_ACTION, "PRETREATMENT", "Pretreatment", "A method of pretreatment is applied");
```
Add our standard actions controllers to `InventoryViabilityController`.
Update liquibase.
## ER design
Note: the two tables are replaced with `InventoryViabilityAction`:
![image](/uploads/1ac694def7ded8b193c2bd88df0b4c82/image.png)
## Draft code
```java
/**
* Records actions during viability testing.
*/
@Entity
@Table(name = "inventory_viability_action")
@JsonIdentityInfo(scope = InventoryViabilityAction.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class InventoryViabilityAction extends AbstractAction {
private static final long serialVersionUID = 4820082734646288915L;
@Id
@JsonProperty
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "inventory_action_id")
private Long id;
@Basic
@Column(name = "action_name_code", nullable = false, length = 20)
@CodeValueField(CommunityCodeValues.INVENTORY_VIABILITY_ACTION)
private String actionNameCode;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "inventory_viability_id", nullable = false)
@JsonIdentityReference
@JsonIdentityInfo(scope = InventoryViability.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
@JsonIgnoreProperties({ "ownedBy" })
private InventoryViability inventoryViability;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "method_id")
private Method method;
public InventoryViabilityAction() {
}
public InventoryViabilityAction(final Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setId(final Long id) {
this.id = id;
}
@Override
public Long getOwningEntityId() {
return inventoryViability == null ? null : inventoryViability.getInventory().getId();
}
public InventoryViability getInventoryViability() {
return inventoryViability;
}
public void setInventoryViability(final InventoryViability inventoryViability) {
this.inventoryViability = inventoryViability;
}
@Override
public String getActionNameCode() {
return this.actionNameCode;
}
@Override
public void setActionNameCode(String actionNameCode) {
this.actionNameCode = actionNameCode;
}
public Method getMethod() {
return method;
}
public void setMethod(final Method method) {
this.method = method;
}
}
```1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/136Inventory Viability Environment2021-08-19T06:06:01+02:00Matija ObrezaInventory Viability EnvironmentGenebank in Palmira wants to record environmental conditions with each `InventoryViabilityData`.
`InventoryViabilityEnvironment` will contain a unique set of value (the configuration of a machine) and should not be modifiable.
`Invento...Genebank in Palmira wants to record environmental conditions with each `InventoryViabilityData`.
`InventoryViabilityEnvironment` will contain a unique set of value (the configuration of a machine) and should not be modifiable.
`InventoryViabilityDataEnvironmentMap` links `InventoryViabilityEnvironment` to `InventoryViabilityData`.
Add the simple CRUD controller for `InventoryViabilityEnvironment`.
## Diagram
Please ignore names of fields in the diagram, use standard naming conventions:
![image](/uploads/b13888ed4f547ebc817240c6ee54b02f/image.png)1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/137Inventory with barcode2021-02-15T07:12:30+01:00Matija ObrezaInventory with barcodeAdd to `Inventory` a new field:
```java
@Column(length = 100, nullable = true)
private String barcode;
```
The `barcode` must be unique in the database if it has a value (many `NULL` values will exist).
Please add to `InventoryFilter`...Add to `Inventory` a new field:
```java
@Column(length = 100, nullable = true)
private String barcode;
```
The `barcode` must be unique in the database if it has a value (many `NULL` values will exist).
Please add to `InventoryFilter`:
```java
public Set<String> barcode;
```1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/138OpenAPI: select API definition2021-02-15T07:16:52+01:00Maxym BorodenkoOpenAPI: select API definitionCurrently, GG-CE has several API definitions that have defined in `OpenAPIConfig`:
```java
@Bean
public GroupedOpenApi apiV1() {
String[] paths = { "/api/v1/**" };
return GroupedOpenApi.builder().setGroup("V1").pathsToMatch(paths).bui...Currently, GG-CE has several API definitions that have defined in `OpenAPIConfig`:
```java
@Bean
public GroupedOpenApi apiV1() {
String[] paths = { "/api/v1/**" };
return GroupedOpenApi.builder().setGroup("V1").pathsToMatch(paths).build();
}
@Bean
public GroupedOpenApi brapiV1() {
String[] paths = { "/brapi/v1/**" };
return GroupedOpenApi.builder().setGroup("BrAPI").pathsToMatch(paths).build();
}
```
But it's unable to select a definition using a UI:
![image](/uploads/9412af5db26d62781a181c897cc82c02/image.png)
The same issue in Genesys was mentioned in https://gitlab.croptrust.org/genesys-pgr/genesys-server/-/merge_requests/531?commit_id=984ba167797b376235bcefbc8d6092b9bb786a49#note_50483
UI must allow selecting of API definition:
![image](/uploads/f1786ace6d778fd8cdc0e9c0961503d9/image.png)Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/139API lockdown2021-02-19T19:13:49+01:00Matija ObrezaAPI lockdownAll API calls to the server must require user authentication (`ROLE_USER`) or be accessed by a trusted OAuth client directly.All API calls to the server must require user authentication (`ROLE_USER`) or be accessed by a trusted OAuth client directly.1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/140OAuth token repository2023-04-17T06:31:49+02:00Matija ObrezaOAuth token repository@mborodenko I think it is safer to try the OAuth token repository on GG-CE server first.
Please apply the changes from genesys-pgr/genesys-server!597 to this project and we can test it properly.@mborodenko I think it is safer to try the OAuth token repository on GG-CE server first.
Please apply the changes from genesys-pgr/genesys-server!597 to this project and we can test it properly.Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/141ES with prefix2021-02-18T10:42:06+01:00Matija ObrezaES with prefixWith grin-global/grin-global-server!152 all indexes and their aliases are created with a `prefix_`:
![image](/uploads/fedaf071dd1f6ff0db0fe2fbc9faa51f/image.png)
Please update the service methods so that it will:
1. keep only indexes ...With grin-global/grin-global-server!152 all indexes and their aliases are created with a `prefix_`:
![image](/uploads/fedaf071dd1f6ff0db0fe2fbc9faa51f/image.png)
Please update the service methods so that it will:
1. keep only indexes and aliases that start with the `prefix_`
1. ~~remove the prefix from index and aliases names (for the Admin UI).~~
~~Similarly, it should append the prefix to the methods from the controller that move/delete indexes and aliases.~~
In index and alias operations, make sure the index starts with the configured prefix.1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/142Endpoints for InventoryGroup membership2021-03-08T17:36:21+01:00Matija ObrezaEndpoints for InventoryGroup membershipWe have the method `public AccessionInvGroup addMembers(AccessionInvGroup group, List<Inventory> inventories, String note)` in `AccessionInvGroupServiceImpl` that is used to add Inventories to the Group. It is used from `/acquire` endpoi...We have the method `public AccessionInvGroup addMembers(AccessionInvGroup group, List<Inventory> inventories, String note)` in `AccessionInvGroupServiceImpl` that is used to add Inventories to the Group. It is used from `/acquire` endpoint.
Please add two new endpoints for adding:
1. `/api/v1/i/group/{i}/add-inventory` with `@PostBody List<Long> inventoryId`
1. `/api/v1/i/group/{i}/add-accession` with `@PostBody List<Long> accessionId`
1. and one for removing memberships: `/api/v1/i/group/{i}/remove` with `@PostBody List<AccessionInvGroupMap> accessionInvGroupMap`1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/143robots.txt controller2021-02-18T15:13:38+01:00Matija Obrezarobots.txt controllerPlease bring in the */robots.txt* controller from Genesys with default setting to **not allow**.Please bring in the */robots.txt* controller from Genesys with default setting to **not allow**.1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/144Assign inventory or accession number2021-02-22T06:09:03+01:00Matija ObrezaAssign inventory or accession numberThe current code does not assign `accessionNumber` and `inventoryNumber` to all records. On restart, there are always some left:
> WARN InventoryServiceImpl:392 - Assigning inventoryNumbers for 1000 records
> WARN InventoryServiceImpl...The current code does not assign `accessionNumber` and `inventoryNumber` to all records. On restart, there are always some left:
> WARN InventoryServiceImpl:392 - Assigning inventoryNumbers for 1000 records
> WARN InventoryServiceImpl:392 - Assigning inventoryNumbers for 1000 records
> WARN InventoryServiceImpl:392 - Assigning inventoryNumbers for 1000 records
It may have to do with loading not sorted by `id`?1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/146compatibility.SearchServiceImpl2021-02-22T05:58:44+01:00Matija Obrezacompatibility.SearchServiceImplCheck search of `@accession_source.geography_id IN (595)` of Accessions in the CT Search Tool.Check search of `@accession_source.geography_id IN (595)` of Accessions in the CT Search Tool.1.0Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/147Admin logger level change doesn't work2021-03-12T06:51:49+01:00Matija ObrezaAdmin logger level change doesn't workChanging the log level of a logger in Admin does not affect how logging is actually done.
Do we have duplicate *jars* on the classpath?Changing the log level of a logger in Admin does not affect how logging is actually done.
Do we have duplicate *jars* on the classpath?2021.2Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/148CodeValueLang in JSON2021-02-25T17:34:36+01:00Matija ObrezaCodeValueLang in JSONAn entity may have one or more `String` fields annotated with `@CodeValueField`. This is serialized to JSON directly as a string value.
Please extend Jackson configuration to include an additional virtual property `[field]_cv` that incl...An entity may have one or more `String` fields annotated with `@CodeValueField`. This is serialized to JSON directly as a string value.
Please extend Jackson configuration to include an additional virtual property `[field]_cv` that includes the array of `CodeValueLang.title`s of the selected code value.1.0Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/149Spring Security OAuth migration2023-04-17T06:32:15+02:00Maxym BorodenkoSpring Security OAuth migrationSince Spring Security OAuth 2.x is a legacy project now we cannot rely on it. Almost all feature set was implemented in Spring Security 5.x release except Authorization Server. Spring Security doesn’t provide Authorization Server support...Since Spring Security OAuth 2.x is a legacy project now we cannot rely on it. Almost all feature set was implemented in Spring Security 5.x release except Authorization Server. Spring Security doesn’t provide Authorization Server support and we have to decide what Authorization Server should be used instead of the old one.
Is that an option for us to rely on [Spring Authorization Server](https://github.com/spring-projects-experimental/spring-authorization-server)?
`OAuth2ServerConfig` must be refactored to get rid of deprecated things from Spring Security OAuth.Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/150Accession Prefix not null2021-02-26T15:46:39+01:00Maksym TishchenkoAccession Prefix not nullOriginal discussion in https://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/179#note_51255
in `Accession` model, field `accession_number_part1` needs to be updated to allow empty strings but not `null` values.
```java
@Basi...Original discussion in https://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/179#note_51255
in `Accession` model, field `accession_number_part1` needs to be updated to allow empty strings but not `null` values.
```java
@Basic
@OneLine
~~@NotBlank~~ // change to @NotNull
@Column(name = "accession_number_part1", nullable = false, length = 50)
private String accessionNumberPart1;
```Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/151parentInventory returns null2021-03-02T14:10:19+01:00Maksym TishchenkoparentInventory returns nullCall to _/i/details/:id_ returns `parentInventory` in response always as `null`, but has to be a `parentInventory` entity.Call to _/i/details/:id_ returns `parentInventory` in response always as `null`, but has to be a `parentInventory` entity.Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/152GG-CE Security2021-03-11T07:57:51+01:00Matija ObrezaGG-CE SecurityPlease implement as described in grin-global/support#18.Please implement as described in grin-global/support#18.2021.2Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/153Make DOI unique2021-03-03T17:46:20+01:00Matija ObrezaMake DOI uniqueThe DOI in accession must be unique (if not null).
Please add a unique constraint on the `accession.doi` field in the DB.The DOI in accession must be unique (if not null).
Please add a unique constraint on the `accession.doi` field in the DB.1.0Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/154DATE_FORMAT code value lang2021-03-03T15:42:28+01:00Matija ObrezaDATE_FORMAT code value langThe UI uses momentjs date format syntax (see https://momentjs.com/docs/#/displaying/format/) and this needs to be in the `CodeValueLang.title`.
We need to replace the entries in `CodeValueLang` with proper values understood by the UI.
...The UI uses momentjs date format syntax (see https://momentjs.com/docs/#/displaying/format/) and this needs to be in the `CodeValueLang.title`.
We need to replace the entries in `CodeValueLang` with proper values understood by the UI.
`CommunityCodeValues` declared some `DATE_FORMAT` codes before it was clear how this actually operates in GG. These can now be removed.1.0Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/155KPI updates2021-03-05T17:41:44+01:00Maxym BorodenkoKPI updatesKPI module in GG-CE and Genesys has the same code, so apply changes from https://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/575.KPI module in GG-CE and Genesys has the same code, so apply changes from https://gitlab.croptrust.org/genesys-pgr/genesys-server/-/issues/575.Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/156Prevent reindexing2021-03-10T19:23:40+01:00Matija ObrezaPrevent reindexingPrevent reindexing and throw an error if there is another indexing operation running.
Use hazel cast lock?Prevent reindexing and throw an error if there is another indexing operation running.
Use hazel cast lock?2021.2Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/157Release versioning2021-03-05T23:24:01+01:00Matija ObrezaRelease versioningGG-CE versioning:
1. Versioning: `2021.1`
1. Major: `${year}`
1. Minor: `${sequential}`
1. Patch: `${x}`
1. Docker image versioning scheme: `image:MAJOR.MINOR.PATCH`
1. `image:latest` points to the latest release
1. *master*...GG-CE versioning:
1. Versioning: `2021.1`
1. Major: `${year}`
1. Minor: `${sequential}`
1. Patch: `${x}`
1. Docker image versioning scheme: `image:MAJOR.MINOR.PATCH`
1. `image:latest` points to the latest release
1. *master* branch gets packaged into `image:MAJOR.MINOR-edge`
1. Add a link to the release info to both server and web. Pointing to Gitlab.1.0Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/158Bug: Invalid list of CropTraitCodes returned2021-03-10T18:10:18+01:00Matija ObrezaBug: Invalid list of CropTraitCodes returnedThe API does not correctly filter for selected `CropTrait`.The API does not correctly filter for selected `CropTrait`.2021.2Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/159error 5032021-03-11T05:13:17+01:00Lilibeth Sisonerror 503@mobreza I pulled the latest version, error 503 at startup.
here is the log file [GGCE-server-logs_11Mar2021.txt](/uploads/7b68c8997fffbc433147190fceac712d/GGCE-server-logs_11Mar2021.txt)@mobreza I pulled the latest version, error 503 at startup.
here is the log file [GGCE-server-logs_11Mar2021.txt](/uploads/7b68c8997fffbc433147190fceac712d/GGCE-server-logs_11Mar2021.txt)https://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/160creating inventory.generation problem2021-03-11T05:33:25+01:00Lilibeth Sisoncreating inventory.generation problem@mobreza Every time I pull the latest version and start the server, I get the 503 error. When I read the logs, there's an error in creating generation column in the inventory table. I manually create this column in MS SQL server because ...@mobreza Every time I pull the latest version and start the server, I get the 503 error. When I read the logs, there's an error in creating generation column in the inventory table. I manually create this column in MS SQL server because that's where I store the generation number of inventory records.
here is an example
![image](/uploads/4ac033f3641612006847deb375f2b074/image.png)
So each time, I rename the generation column to generation1, then the pull and startup would be successful. Do you have any suggestions on how to solve this?https://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/161Accession.backupLocationXSite not serialized2021-03-11T15:29:17+01:00Matija ObrezaAccession.backupLocationXSite not serializedAdd a unit test to ensure that `getAccessionDetails` includes `backupLocation1Site` and `backupLocation2Site`.
Add a test to check that `Accession` backup sites can be updated with the `update` API call.Add a unit test to ensure that `getAccessionDetails` includes `backupLocation1Site` and `backupLocation2Site`.
Add a test to check that `Accession` backup sites can be updated with the `update` API call.2021.2Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/162Geography: Filter, autocompleter, ES2021-03-12T11:29:21+01:00Matija ObrezaGeography: Filter, autocompleter, ESPlease add `Geography` to the list of indexed entities and `GeographyFilter._text` can then use ES, same for autocompleter.
`GeographyFilter.countryCode` should be `Set<String>`.Please add `Geography` to the list of indexed entities and `GeographyFilter._text` can then use ES, same for autocompleter.
`GeographyFilter.countryCode` should be `Set<String>`.2021.2Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/164CompatibilityTriggers to Aspects2021-03-30T18:14:11+02:00Matija ObrezaCompatibilityTriggers to AspectsMove and split `CompatibilityTriggers` to `org.gringlobal.service.triggers.AccessionTriggers` and `org.gringlobal.service.triggers.InventoryTriggers`.
Replace calls to methods in this class with appropriate AspectJ annotations *after* ...Move and split `CompatibilityTriggers` to `org.gringlobal.service.triggers.AccessionTriggers` and `org.gringlobal.service.triggers.InventoryTriggers`.
Replace calls to methods in this class with appropriate AspectJ annotations *after* `AccessionRepository.save`, *before* `AccessionRepository.delete`, `InventoryRepository.save`, ...2021.3Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/165Inserting SysDataviews from xml2021-03-19T13:35:44+01:00Matija ObrezaInserting SysDataviews from xmlGG *Dataview* definitions are commonly shared as XML files.
Please add a service method that will read the XML (attached) and insert a new dataview to the database.
[ggce_aclsid.dataviewxml](/uploads/0318ac2a36fc1744cb51d57003dd6252/gg...GG *Dataview* definitions are commonly shared as XML files.
Please add a service method that will read the XML (attached) and insert a new dataview to the database.
[ggce_aclsid.dataviewxml](/uploads/0318ac2a36fc1744cb51d57003dd6252/ggce_aclsid.dataviewxml)2021.2Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/166Release 2021.22021-03-20T09:54:59+01:00Matija ObrezaRelease 2021.22021.2Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/167Revise updating of Geographies from USDA2021-03-29T09:57:59+02:00Matija ObrezaRevise updating of Geographies from USDAThe updating of Geography data is now inefficient and needs a revision: It processes incoming records in batches (of 100), but then loads all existing records for matching. This works well only when there are not many existing records in...The updating of Geography data is now inefficient and needs a revision: It processes incoming records in batches (of 100), but then loads all existing records for matching. This works well only when there are not many existing records in the database.
Please try it, and update the way it is implemented.2021.3Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/168Missing inventory in viability API endpoint2021-03-26T09:24:52+01:00James AriasMissing inventory in viability API endpointIn the response of `/api/v1/i/viability/list` endpoint, the `InventoryViability`'s `inventory` field is `null`. The `inventory` information should be included.
I attach a sample image
![image](/uploads/0fb333a0607afb91c779aacf623ae383/...In the response of `/api/v1/i/viability/list` endpoint, the `InventoryViability`'s `inventory` field is `null`. The `inventory` information should be included.
I attach a sample image
![image](/uploads/0fb333a0607afb91c779aacf623ae383/image.png)Vladyslava MokliakVladyslava Mokliakhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/169Error message when add accession data2021-03-30T06:18:35+02:00Andrew ChanError message when add accession dataWhen I add a new accession to ggce, both with ggce and Curator tool got this error message:
Validation failed for classes [org.gringlobal.model.Inventory] during persist time for groups [javax.validation.groups.Default, ] List of const...When I add a new accession to ggce, both with ggce and Curator tool got this error message:
Validation failed for classes [org.gringlobal.model.Inventory] during persist time for groups [javax.validation.groups.Default, ] List of constraint violations:[ ConstraintViolationImpl{interpolatedMessage='must not be null', propertyPath=inventoryMaintenancePolicy, rootBeanClass=class org.gringlobal.model.Inventory, messageTemplate='{javax.validation.constraints.NotNull.message}'} ]
The database is mssql and totally new created, and can add user, site normally.https://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/170How is the quantity or the method sent in inventoryActions in the json request?2021-03-31T15:10:39+02:00James AriasHow is the quantity or the method sent in inventoryActions in the json request?How is quantity or method sent in json request?
If the following service only provides me with these options as shown in the image?
Service: `/api/v1/i/action/start`
![image](/uploads/93d3e97bc98ef21e8eb2914bb2fbf929/image.png)How is quantity or method sent in json request?
If the following service only provides me with these options as shown in the image?
Service: `/api/v1/i/action/start`
![image](/uploads/93d3e97bc98ef21e8eb2914bb2fbf929/image.png)2021.3Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/171Release v2021.32021-03-31T16:35:24+02:00Matija ObrezaRelease v2021.32021.3Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/172Type of Inventory Maintenance Policy2021-05-07T10:42:07+02:00Matija ObrezaType of Inventory Maintenance PolicyAdd the `InventoryMaintPolicy.managementTypeCode` field:
```java
@NotNull
@Column(name = "management_type_code", nullable = false, length = 20)
@CodeValueField("MANAGEMENT_TYPE")
private String managementTypeCode;
```
Define in `Commun...Add the `InventoryMaintPolicy.managementTypeCode` field:
```java
@NotNull
@Column(name = "management_type_code", nullable = false, length = 20)
@CodeValueField("MANAGEMENT_TYPE")
private String managementTypeCode;
```
Define in `CommunityCodeValues`:
```java
public static final String MANAGEMENT_TYPE = "MANAGEMENT_TYPE";
public static final CodeValueDef MANAGEMENT_TYPE_TEMPORARY = new CodeValueDef(MANAGEMENT_TYPE, "TEMPORARY", "Temporary collection", null);
public static final CodeValueDef MANAGEMENT_TYPE_ACTIVE = new CodeValueDef(MANAGEMENT_TYPE, "ACTIVE", "Active collection", null);
public static final CodeValueDef MANAGEMENT_TYPE_DISTRIBUTION = new CodeValueDef(MANAGEMENT_TYPE, "DISTRIBUTION", "For distribution", null);
public static final CodeValueDef MANAGEMENT_TYPE_BASE = new CodeValueDef(MANAGEMENT_TYPE, "BASE", "Base collection", null);
public static final CodeValueDef MANAGEMENT_TYPE_BACKUP = new CodeValueDef(MANAGEMENT_TYPE, "BACKUP", "Safety backup", null);
public static final CodeValueDef MANAGEMENT_TYPE_ARCHIVED = new CodeValueDef(MANAGEMENT_TYPE, "ARCHIVED", "Archived collection", null);
```
Liquibase should use `TEMPORARY` code.2021.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/173Recording Accession number changes2021-04-07T09:52:25+02:00Matija ObrezaRecording Accession number changesWhen the accession is inserted, register an `AccessionInvName` with `categoryCode = 'SITE'`, `rank = 1080` and `plantName = accessionNumber`. If a `NameGroup` with `name == accession.accessionNumberPart1` exists, then link it with the na...When the accession is inserted, register an `AccessionInvName` with `categoryCode = 'SITE'`, `rank = 1080` and `plantName = accessionNumber`. If a `NameGroup` with `name == accession.accessionNumberPart1` exists, then link it with the name group.
If accession number changes create `accession_action` and `accession_inv_name` records to document the change:
1. Record an action with code `ACCNUMBERD` and note `"Changed " + before + " to " +after`.
2. If the previous accession number is not yet registered as an `AccessionInvName`, add it.2021.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/174Record Accession species changes2021-04-15T09:17:28+02:00Matija ObrezaRecord Accession species changesWhen an accession is inserted, register a `AccessionInvAnnotation` record with `annotationTypeCode = "RECEIVED"`.
If accession `taxonomySpecies` changes insert a new `AccessionInvAnnotation` record with `annotationTypeCode = "RE-IDENT"`...When an accession is inserted, register a `AccessionInvAnnotation` record with `annotationTypeCode = "RECEIVED"`.
If accession `taxonomySpecies` changes insert a new `AccessionInvAnnotation` record with `annotationTypeCode = "RE-IDENT"`.
Please add `List<AccessionInvAnnotation> annotations` to the details.2021.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/175Auto-update Inventory status2021-04-07T09:52:25+02:00Matija ObrezaAuto-update Inventory statusWhen inventory is saved (inserted or updated) the `availabilityStatusCode` should be automatically updated if `isAutoDeducted == "Y"`:
1. if `quantity_on_hand <= distribution_critical_quantity` **and** `availability_status_code == "AVAI...When inventory is saved (inserted or updated) the `availabilityStatusCode` should be automatically updated if `isAutoDeducted == "Y"`:
1. if `quantity_on_hand <= distribution_critical_quantity` **and** `availability_status_code == "AVAIL"`, then set `availability_status_code = "LOW"` and `is_available = "N"`.
1. if `quantity_on_hand > distribution_critical_quantity` set `availability_status_code = "AVAIL"` **and** `is_available = "Y"`.
Original code:
```java
if (helper.AllFieldsExist("is_auto_deducted", "quantity_on_hand", "distribution_critical_quantity") && helper.GetValue("is_auto_deducted", "N", true).ToString().ToUpper() == "Y") {
double onHand = Convert.ToDouble(helper.GetValue("quantity_on_hand", 0.0, true));
double critical = Convert.ToDouble(helper.GetValue("distribution_critical_quantity", 0.0, true));
if (onHand <= critical) {
if (helper.FieldExists("availability_status_code") && helper.GetValue("availability_status_code", "", true).ToString().ToUpper() == "AVAIL") {
helper.SetValue("availability_status_code", "LOW", null, false);
if (helper.FieldExists("is_available") && helper.GetValue("is_available", "Y", true).ToString().ToUpper() == "Y") {
helper.SetValue("is_available", "N", null, false);
}
}
} else if (onHand > critical) {
if (helper.FieldExists("availability_status_code") && helper.GetValue("availability_status_code", "", true).ToString().ToUpper() == "LOW") {
helper.SetValue("availability_status_code", "AVAIL", null, false);
if (helper.FieldExists("is_available") && helper.GetValue("is_available", "N", true).ToString().ToUpper() == "N") {
helper.SetValue("is_available", "Y", null, false);
}
}
}
}
```2021.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/176Test coverage 70%2022-02-09T08:00:39+01:00Matija ObrezaTest coverage 70%In this ticket add unit tests or remove unused code from this project to reach code coverage of **70%**.In this ticket add unit tests or remove unused code from this project to reach code coverage of **70%**.Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/177SysGroup as AclSid2022-06-22T09:07:38+02:00Matija ObrezaSysGroup as AclSid`SysGroup` should extend `AclSid`. It should have `principal = false` and discriminator `type = 5`.
Changes to `sysGroup.isEnabled` property should toggle the `aclSid.active` value.
On user login, only `active` group should be included...`SysGroup` should extend `AclSid`. It should have `principal = false` and discriminator `type = 5`.
Changes to `sysGroup.isEnabled` property should toggle the `aclSid.active` value.
On user login, only `active` group should be included in granted authorities.
Update liquibase.2022.6Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/178Filtering collections2021-08-11T15:38:59+02:00Matija ObrezaFiltering collections`AccessionFilter` allows for filtering `accession.sources`, but using the `.any()` predicate generates an odd database query.
Add a unit test with:
1. One accession
2. Two `AccessionSource` records:
- One with `isOrigin = 'Y'` and `...`AccessionFilter` allows for filtering `accession.sources`, but using the `.any()` predicate generates an odd database query.
Add a unit test with:
1. One accession
2. Two `AccessionSource` records:
- One with `isOrigin = 'Y'` and `sourceTypeCode = COLLECTED`
- One with `isOrigin = 'N'` and `sourceTypeCode = COLLECTED`
1. Assert that filter `{ origin: true, sourceTypeCode: "COLLECTED" }` returns one record
I hope we can avoid using `buildJpaQuery` like we do in Genesys.
The fix needs to be applied to all filters where `.any()` is used.2021.10Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/179GGCE-SEC: Link between entities and SecurityActions2023-09-05T06:52:59+02:00Matija ObrezaGGCE-SEC: Link between entities and SecurityActionsWhile we support the SOAP interface, we should include GGCE security checks on direct interactions with tables in `DataviewServiceImpl` in `persistEntity()` and `deleteEntity()`. Or alternatively, we check permissions in an aspect?
- If...While we support the SOAP interface, we should include GGCE security checks on direct interactions with tables in `DataviewServiceImpl` in `persistEntity()` and `deleteEntity()`. Or alternatively, we check permissions in an aspect?
- If the record `.isNew()` in `persistEntity()`, the **CREATE** permission needs to be checked, otherwise **WRITE**.
- In `deleteEntity()` we check for **DELETE** permission.
For this to work, we need to link entity classes to `SecurityAction`.
Since permissions are site-based, we somehow need to extract `site.id` before permission checks. This could be done with an interface.
If we use an interface, then we can add both: `Site getSite()` (or `Site aclSite()`) and `SecurityAction requiredSecurityAction()`.
Any thoughts?Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/180Sum inventory quantities2021-04-26T16:55:16+02:00Matija ObrezaSum inventory quantitiesAdd an API endpoint */i/aggregate-quantity* that for selected `InventoryFilter` returns the aggregate of inventory quantities:
- grouped by `accession`, `formTypeCode`, `availabilityStatusCode`, `quantityOnHandUnitCode`
- count of `dist...Add an API endpoint */i/aggregate-quantity* that for selected `InventoryFilter` returns the aggregate of inventory quantities:
- grouped by `accession`, `formTypeCode`, `availabilityStatusCode`, `quantityOnHandUnitCode`
- count of `distinct inventoryMaintPolicy,
- count of `distinct parentInventory`
- count of `inventory`
- sum of `quantityOnHand`
The endpoint returns `FilteredPage<InventoryQuantity>` where:
```java
static class InventoryQuantity {
public Accession accession;
public String formTypeCode;
public String availabilityStatusCode;
public String quantityOnHandUnitCode;
public int inventoryMaintenancePolicyCount;
public int parentInventoryCount;
public int inventoryCount;
public double quantityOnHand;
}
```
This is a JPA only query -- full text is not supported, if `_text` is provided throw `InvalidApiUsageException`.2021.5Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/181GGCE-SEC: Bug in declaring permissions2021-04-16T08:58:43+02:00Matija ObrezaGGCE-SEC: Bug in declaring permissionsA user was able to register two actions on one site:
![image](/uploads/c1a09d88d83b1f8e9bd5468863f05bff/image.png)
This results in:
```
org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique resu...A user was able to register two actions on one site:
![image](/uploads/c1a09d88d83b1f8e9bd5468863f05bff/image.png)
This results in:
```
org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 2; nested exception is javax.persistence.NonUniqueResultException: query did not return a unique result: 2
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:385)
...
at com.sun.proxy.$Proxy238.getByActionAndSite(Unknown Source)
at org.gringlobal.application.config.GGCESecurityConfig$SecuredActionSecurity.actionAllowed(GGCESecurityConfig.java:105)
```
Please add a constraint that will prevent inserting duplicate action records on the same site.2021.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/182ES Inventory inventoryMaintenancePolicy search2021-04-15T13:29:18+02:00Matija ObrezaES Inventory inventoryMaintenancePolicy searchgrin-global/support#47 describes that ES search with a filter on IMP does not return results.
This filter works:
```json
{"_text":"base","formTypeCode":"SD","includeSystem":false,"inventoryNumberPart1":{"eq":["1985WS"]}}
```
Including...grin-global/support#47 describes that ES search with a filter on IMP does not return results.
This filter works:
```json
{"_text":"base","formTypeCode":"SD","includeSystem":false,"inventoryNumberPart1":{"eq":["1985WS"]}}
```
Including `inventoryMaintenancePolicy` in the filter with `_text` does not return results:
```json
{"_text":"base","formTypeCode":["SD"],"includeSystem":false,"inventoryMaintenancePolicy":{"id":3},"inventoryNumberPart1":{"eq":["1985WS"]}}
```
The Index for `Inventories` was refreshed, with the same result.2021.4Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/183Transient messages to admins2021-04-26T16:58:24+02:00Matija ObrezaTransient messages to adminsOn application startup, services log important warning messages that may not be looked at by administrators of GG-CE Server (e.g. ES mapping for `Inventory` is no longer compatible).
I would like to see such messages added to a in-memor...On application startup, services log important warning messages that may not be looked at by administrators of GG-CE Server (e.g. ES mapping for `Inventory` is no longer compatible).
I would like to see such messages added to a in-memory list of alerts that will be retrieved and rendered in GG-CE Web when an administrator accesses the system.
Please implement a `TransientMessageService` with:
```java
interface TransientMessageService {
// format uses Log4j syntax
IMessage addAdminAlert(String format, Object... args);
// get current alert
Page<IMessage> listAdminAlerts(Pageable page);
// remove alert
IMessage removeAdminAlert(UUID alertUuid);
}
class IMessage {
UUID uuid; // uses UUID.randomUUID();
String message;
Date timestamp;
}
```
The service implementation starts with a blank `ArrayList` of messages and removes alerts from the list via `removeAdminAlert()` method.
## UI
GG-CE Web will query the for the alert messages and render them to in the */admin* page. They will have an `X` icon that will call `removeAdminAlert()`.
## Messages to users
We will later consider the same approach also to send alerts to users.2021.5Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/184Cooperator with faoInstituteNumber2021-05-14T07:27:39+02:00Matija ObrezaCooperator with faoInstituteNumberAdd a new field `faoInstituteNumber` to the `Cooperator`:
```java
@Basic
@Pattern(regexp = "[A-Z]{3}\\d{3,4}")
@Column(name = "fao_institute_number", length = 10)
private String faoInstituteNumber;
```
Please add the pattern validation...Add a new field `faoInstituteNumber` to the `Cooperator`:
```java
@Basic
@Pattern(regexp = "[A-Z]{3}\\d{3,4}")
@Column(name = "fao_institute_number", length = 10)
private String faoInstituteNumber;
```
Please add the pattern validation to `Site.faoInstituteNumber`.2021.5Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/185API for discarding material2021-04-22T10:22:31+02:00Maxym BorodenkoAPI for discarding materialhttps://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/221 requires a new API endpoint to update `quantityOnHand`.https://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/221 requires a new API endpoint to update `quantityOnHand`.Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/187Problem applying `createdDate` filter for Inventory2021-04-27T08:18:51+02:00James AriasProblem applying `createdDate` filter for InventoryI am trying to re-create the createdDate filter in the inventory entity in the JSON, in order to obtain the inventory records, but it is not applying the filter to me.
I am creating it this way
![image](/uploads/cc0b4eb8acb98bcb6cf1294...I am trying to re-create the createdDate filter in the inventory entity in the JSON, in order to obtain the inventory records, but it is not applying the filter to me.
I am creating it this way
![image](/uploads/cc0b4eb8acb98bcb6cf12940934209a2/image.png)
The filter result
![image](/uploads/becd25ba2e37d6120575cf77cf630e3c/image.png)
Could you tell me how is the correct way?2021.5Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/186Improved liquibase2021-04-27T04:19:21+02:00Matija ObrezaImproved liquibaseGenebanks sometimes register GG-CE fields in their GG databases (e.g. `generation` column in `Inventory`) and our scripts attempt to insert the same field.
Update liquibase to check if columns already exist before trying to insert them.Genebanks sometimes register GG-CE fields in their GG databases (e.g. `generation` column in `Inventory`) and our scripts attempt to insert the same field.
Update liquibase to check if columns already exist before trying to insert them.2021.5Vladyslava MokliakVladyslava Mokliakhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/188Inventory Maintenance Policy. Error to add a policy through Curator-Tool2021-04-28T10:53:41+02:00Ghost UserInventory Maintenance Policy. Error to add a policy through Curator-ToolI got this error when pressing "Save Data" button.
![image](/uploads/eed48bde5b1c0e1777235bc3d6c813c2/image.png)
Curator-Tool version: v1.9.9.8
GG-CE instance: demo.api.genebanks.org
Here the full error message text.
---
There were e...I got this error when pressing "Save Data" button.
![image](/uploads/eed48bde5b1c0e1777235bc3d6c813c2/image.png)
Curator-Tool version: v1.9.9.8
GG-CE instance: demo.api.genebanks.org
Here the full error message text.
---
There were errors saving data.
Full error message:
Validation failed for classes [org.gringlobal.model.InventoryMaintenancePolicy] during persist time for groups [javax.validation.groups.Default, ]
List of constraint violations:[
ConstraintViolationImpl{interpolatedMessage='must not be null', propertyPath=managementTypeCode, rootBeanClass=class org.gringlobal.model.InventoryMaintenancePolicy, messageTemplate='{javax.validation.constraints.NotNull.message}'}
]
---
@erojasMatija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/191Genesys integration2021-08-11T16:43:47+02:00Matija ObrezaGenesys integrationAdd support to fetch Request data from Genesys and store it as a `WebOrderRequest` + `WebOrderRequestItem` in GG-CE. OAuth Client authentication will be used to authenticate.
The API settings (`url`, `clientId`, `secret`, `instituteCode...Add support to fetch Request data from Genesys and store it as a `WebOrderRequest` + `WebOrderRequestItem` in GG-CE. OAuth Client authentication will be used to authenticate.
The API settings (`url`, `clientId`, `secret`, `instituteCode`) are stored as `AppSetting` entries in `categoryTag = GENESYS_CLIENT`.
TODO: Think about protecting access to values in `AppSetting`.2021.10Vladyslava MokliakVladyslava Mokliakhttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/192TransientMessage with key and count2021-05-11T18:05:47+02:00Matija ObrezaTransientMessage with key and countAs we put more messages in `TransientMessageService` we would like to prevent having the "same message" added multiple times to the in-memory list.
If, for example the email service fails to deliver a message, we don't want a unique war...As we put more messages in `TransientMessageService` we would like to prevent having the "same message" added multiple times to the in-memory list.
If, for example the email service fails to deliver a message, we don't want a unique warning "SMTP unreachable" to be added every time it happens because it could fill the message list and other important messages would be lost.
Two new fields are added to `TransientMessage`: `String key` and `int count`.
The `key` is identifies the message type and added to the line that adds the message, for example:
```java
transientMessageService.addAdminAlert("ES-MAPPING-" + clazz, "The ES mapping is no longer compatible for index={} of {}. The index must be regenerated.", writeIndex, clazz);
```
The message service first looks up an existing message by `key` and if found, increments the count. If not found, the message is added with `count = 1`.2021.6Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/193CRUD APIs for InventoryViabilityRule2021-05-19T07:46:52+02:00Maxym BorodenkoCRUD APIs for InventoryViabilityRulehttps://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/248 requires new CRUD APIs for `InventoryViabilityRule`.https://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/248 requires new CRUD APIs for `InventoryViabilityRule`.2021.7Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/194unable to login2021-05-19T04:48:37+02:00Lilibeth Sisonunable to login@mobreza I pulled the latest version. I am unable to login to the admin pages.
in the log,
![image](/uploads/781246a240f6bd506759acbe7909f1c4/image.png)
however looking at the cooperator table, it has faoInstituteNumber instead
![i...@mobreza I pulled the latest version. I am unable to login to the admin pages.
in the log,
![image](/uploads/781246a240f6bd506759acbe7909f1c4/image.png)
however looking at the cooperator table, it has faoInstituteNumber instead
![image](/uploads/f9296db2aef1bddbf523579d2353dd81/image.png)https://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/195Startup ensure community AppSettings2021-05-26T13:01:44+02:00Matija ObrezaStartup ensure community AppSettingsGG-CE Web uses a set of `AppSetting` for its function. Please add, similar to how we ensure `CommunityCodeValues`, startup code that ensures `AppSetting` are in the database.
## First example
UI fetches the app setting `ApplicationServ...GG-CE Web uses a set of `AppSetting` for its function. Please add, similar to how we ensure `CommunityCodeValues`, startup code that ensures `AppSetting` are in the database.
## First example
UI fetches the app setting `ApplicationService.getSetting('INVENTORYVIABILITY_REPLICATE', 'LABEL')`.
Please ensure that the setting has a value (exists and is not null), if not use default:
```
^XA
^CF0,30
^FO50,10^FDViability {{ inventoryViability.id }}#{{ replicate }}^FS
^FO50,40^FDINV {{ inventory.inventoryNumber }}^FS
^FO50,90^FDACC {{ accession.accessionNumber }}^FS
^FO50,120^FD{{ taxon }}^FS
^FX Third section with bar code.
^FO50,150^BQN,2,6^FD{{ inventoryViability.id }}#{{ replicate }}^FS
^XZ
```2021.7Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/196Extended auditing2021-06-01T07:29:19+02:00Matija ObrezaExtended auditingMost entities in GG-CE require audit records, in this ticket we add `@Audited` to `CooperatorOwnedModel`.
The new `@HideAuditValue` annotation on `password` fields allows us to record that changes were made, but the `prev` and `new` val...Most entities in GG-CE require audit records, in this ticket we add `@Audited` to `CooperatorOwnedModel`.
The new `@HideAuditValue` annotation on `password` fields allows us to record that changes were made, but the `prev` and `new` values are not persisted.
`AuditLogController extends FilteredCRUDController` at */api/v1/auditlog* allows `GROUP_ADMINS` to browse, filter and remove audit log entries by filter.2021.8Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/197Modular mvn project2021-07-02T17:39:07+02:00Matija ObrezaModular mvn projectThis is to convert the current project layout to modular Maven project with:
- parent
- server
- client (TBD)
- coverageThis is to convert the current project layout to modular Maven project with:
- parent
- server
- client (TBD)
- coverage2021.7Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/198Dataviews for GROUP_ADMINS2021-05-28T11:10:16+02:00Matija ObrezaDataviews for GROUP_ADMINSThe *Curator Tool* (CT) allows users to access Dataviews in the `Client` category. Instead, Administrators used the *Admin Tool* (AT) to manage data of `CodeValue`, `CodeValueLang`, `SysUser` and other entities.
In GG-CE we need to prov...The *Curator Tool* (CT) allows users to access Dataviews in the `Client` category. Instead, Administrators used the *Admin Tool* (AT) to manage data of `CodeValue`, `CodeValueLang`, `SysUser` and other entities.
In GG-CE we need to provide access to such dataviews for `GROUP_ADMINS` as the AT is not available to them.
In this ticket we add `Code values` and `Code value translation` dataviews to `Client` category with `GG-CE Admin` subcategory.2021.7Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/199InventoryViabilityData validation of sum2021-06-01T07:20:00+02:00Matija ObrezaInventoryViabilityData validation of sumPlease add validation to `InventoryViabilityData` that the sum of `*Count` equals the total count in `replicationCount`.Please add validation to `InventoryViabilityData` that the sum of `*Count` equals the total count in `replicationCount`.2021.8Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/200Password policy2021-06-07T13:25:21+02:00Matija ObrezaPassword policyPlease enable the `PasswordPolicy` in GG-CE `UserServiceImpl` (both in `org.gringlobal.compatibility.service.impl` and `org.gringlobal.service.impl`) and `WebUserServiceImpl`.Please enable the `PasswordPolicy` in GG-CE `UserServiceImpl` (both in `org.gringlobal.compatibility.service.impl` and `org.gringlobal.service.impl`) and `WebUserServiceImpl`.2021.8Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/201SysLang MCPD2021-06-10T08:34:40+02:00Matija ObrezaSysLang MCPDMCPD is a commonly used standard for passport data exchange. Sharing data with other platforms in MCPD requires mapping of `CodeValue` entires to values defined in the standard.
As genebanks define their own codes for germplasm form, ha...MCPD is a commonly used standard for passport data exchange. Sharing data with other platforms in MCPD requires mapping of `CodeValue` entires to values defined in the standard.
As genebanks define their own codes for germplasm form, habitat type, etc. it is best to allow them to also declare the MCPD equivalents of each value as "translations".
GG-CE automatically registers a language with code `MCPD` at application startup.
Administrators are able to add the MCPD "translations" for relevant `CodeValues`: `GERMPLASM_FORM` (for MCPD type of germplasm `STORAGE`), `ACCESSION_SOURCE_HABITAT_TYPE` (for MCPD collecting source), `ACCESSION_STATUS`, etc.
## `AccessionMCPD::convert`
Update the MCPD mapping (see TODO comments "Use CV translations").
Also update the code that retrieves passport data from Genesys.2021.8Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/202GG-CE Dataviews2021-06-14T15:02:41+02:00Matija ObrezaGG-CE DataviewsWe now drop and re-create customized Dataviews provided by GG-CE in `ApplicationStartup`. With each start of the server this generates changes in the auditlog.
Please upgrade this functionality so that the dataviews will be **updated**,...We now drop and re-create customized Dataviews provided by GG-CE in `ApplicationStartup`. With each start of the server this generates changes in the auditlog.
Please upgrade this functionality so that the dataviews will be **updated**, not replaced.2021.8Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/203Concurrent edits2021-08-11T16:32:26+02:00Matija ObrezaConcurrent edits`@Version` field helps prevent concurrent updates of the same record. Instead of adding a `int version` field to all entities, we can use
```
@Version // Used for locking
@Column(name = "modified_date")
@NotAudited
@Temporal(Tempora...`@Version` field helps prevent concurrent updates of the same record. Instead of adding a `int version` field to all entities, we can use
```
@Version // Used for locking
@Column(name = "modified_date")
@NotAudited
@Temporal(TemporalType.TIMESTAMP)
// @LastModifiedDate // Not required?
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private Date modifiedDate;
```2021.10Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/204Upgrade dependencies2021-07-26T09:51:58+02:00Matija ObrezaUpgrade dependenciesFollowing genesys-pgr/file-repository#38 and genesys-pgr/application-blocks#44 please upgrade GG-CE Server dependencies.Following genesys-pgr/file-repository#38 and genesys-pgr/application-blocks#44 please upgrade GG-CE Server dependencies.2021.10Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/205OAuthClient: resize origin and redirect columns2021-06-15T13:53:15+02:00Matija ObrezaOAuthClient: resize origin and redirect columnsPlease update the size of `origin` and `redirect` columns in `liquibase` to `varchar(2000)`.Please update the size of `origin` and `redirect` columns in `liquibase` to `varchar(2000)`.2021.9Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/206BUG: GGCE Dataviews2021-06-24T07:57:45+02:00Matija ObrezaBUG: GGCE DataviewsDuring startup of a migrated legacy GG database I encountered the following issue:
```
09:13:06.773 [main] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - The DELETE statement conflicted with the REFERENCE constraint "fk_srfl_s...During startup of a migrated legacy GG database I encountered the following issue:
```
09:13:06.773 [main] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - The DELETE statement conflicted with the REFERENCE constraint "fk_srfl_srf". The conflict occurred in database "ggce-X", table "dbo.sys_dataview_field_lang", column 'sys_dataview_field_id'.
09:13:06,850 main ERROR ApplicationStartup:488 - Could not register sys_user dataview: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
...
at org.gringlobal.service.impl.DataviewServicesImpl$SysDataviewServiceImpl.updateDataviewFromXML(DataviewServicesImpl.java:216)
...
at com.sun.proxy.$Proxy602.updateDataviewFromXML(Unknown Source)
at org.gringlobal.spring.ApplicationStartup.lambda$ensureGGCEDataviews$26(ApplicationStartup.java:480)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The DELETE statement conflicted with the REFERENCE constraint "fk_srfl_srf". The conflict occurred in database "ggce-X", table "dbo.sys_dataview_field_lang", column 'sys_dataview_field_id'.
```2021.9Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/207Saving InventoryViability results2021-06-25T15:43:22+02:00Matija ObrezaSaving InventoryViability resultsWhen I save results of the viability test the `PUT /api/v1/i/viability` fails with:
```
2021-06-22 08:07:01 qtp1032616650-13 ERROR ApiExceptionHandler:235 - Wow! Such! Exception!
java.lang.NullPointerException
at org.gringlobal.model.I...When I save results of the viability test the `PUT /api/v1/i/viability` fails with:
```
2021-06-22 08:07:01 qtp1032616650-13 ERROR ApiExceptionHandler:235 - Wow! Such! Exception!
java.lang.NullPointerException
at org.gringlobal.model.Inventory.lazyLoad(Inventory.java:751)
at org.gringlobal.model.InventoryViability.lazyLoad(InventoryViability.java:369)
at org.gringlobal.service.impl.CRUDServiceImpl._lazyLoad(CRUDServiceImpl.java:74)
at org.gringlobal.service.impl.InventoryViabilityServiceImpl.update(InventoryViabilityServiceImpl.java:268)
at org.gringlobal.service.impl.InventoryViabilityServiceImpl.update(InventoryViabilityServiceImpl.java:73)
at org.gringlobal.service.impl.CRUDServiceImpl.update(CRUDServiceImpl.java:146)
at org.gringlobal.service.impl.InventoryViabilityServiceImpl.update(InventoryViabilityServiceImpl.java:253)
at org.gringlobal.service.impl.InventoryViabilityServiceImpl.update(InventoryViabilityServiceImpl.java:73)
at jdk.internal.reflect.GeneratedMethodAccessor1093.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:61)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:367)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy643.update(Unknown Source)
at org.gringlobal.api.v1.CRUDController.update(CRUDController.java:104)
at org.gringlobal.api.v1.FilteredCRUDController.update(FilteredCRUDController.java:136)
at org.gringlobal.api.v1.FilteredCRUDController$$FastClassBySpringCGLIB$$2aaa677f.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
at org.gringlobal.api.v1.impl.InventoryViabilityController$$EnhancerBySpringCGLIB$$a76b66f6.update(<generated>)
```
Please check.2021.9Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/208EmptyModel with initializeEntity2021-06-24T20:33:54+02:00Matija ObrezaEmptyModel with initializeEntityIn https://gitlab.croptrust.org/grin-global/grin-global-server/-/merge_requests/252#note_55780 we discussed the `Hibernate.initialize()` in `lazyLoad()`. With this method, we don't even need checking on `null`.
> we add that `initializ...In https://gitlab.croptrust.org/grin-global/grin-global-server/-/merge_requests/252#note_55780 we discussed the `Hibernate.initialize()` in `lazyLoad()`. With this method, we don't even need checking on `null`.
> we add that `initializeEntity(Object proxy)` to our super model (`AuditedModel` or `EmptyModel`) and make it `protected`? Then just call `initializeEntity(this.counterCooperator);`
In this ticket do the following:
```java
class EmptyModel {
protected final void initializeEntity(Object proxy) {
Hibernate.initialize(proxy);
}
}
class InventoryViabilityData {
lazyLoad() {
initializeEntity(this.inventoryViability);
...
}
}
```
If that works, all `lazyLoads` can be updated with `initializeEntity()` instead of `.getId()`.2021.9Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/209Taxonomy updated2021-09-20T19:55:27+02:00Matija ObrezaTaxonomy updatedI'm getting a warning during updating of GRIN Taxonomy data:
```
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert duplicate key row in object 'dbo.taxonomy_species' with unique index 'ndx_uniq_ts'. The duplicate...I'm getting a warning during updating of GRIN Taxonomy data:
```
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert duplicate key row in object 'dbo.taxonomy_species' with unique index 'ndx_uniq_ts'. The duplicate key value is (Sciadophyllum ellipticum, Blume).
```
This seems to also result in the final exception:
```
Unable to find org.gringlobal.model.TaxonomySpecies with id 472546
```
Please test if updating of taxonomy and geographies still works.2021.12Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/210Scheduled KPI runs and cleanup2021-07-05T10:38:41+02:00Matija ObrezaScheduled KPI runs and cleanupPlease ensure that KPI executions are started nightly and that the runs cleanup (removing runs, but keeping one per month) is enabled.
Our demo.api instance is restarted daily, does that affect the `@Scheduled` annotations?Please ensure that KPI executions are started nightly and that the runs cleanup (removing runs, but keeping one per month) is enabled.
Our demo.api instance is restarted daily, does that affect the `@Scheduled` annotations?2021.10Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/211Cooperator: similarity search functionality2021-08-12T09:09:29+02:00Maxym BorodenkoCooperator: similarity search functionalityhttps://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/276 requires similarity search functionality.
Bring the abstract `DuplicateFinder` from Genesys and implement it to search for similar cooperators.https://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/276 requires similarity search functionality.
Bring the abstract `DuplicateFinder` from Genesys and implement it to search for similar cooperators.2021.10Maxym BorodenkoMaxym Borodenko