GGCE Server issueshttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues2020-12-17T16:29:43+01:00https://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 Borodenko