Dataset location and timing
The DatasetLocation
now holds data on where the plant material was evaluated, but does not tell us when that happened.
Add String startDate
and endDate
fields to this class. @Column(length = 8)
Date format
We need to keep this as String
because the exact month or day of the dates may not be known. We will use the YYYYMMDD
format and the setter should test with MCPDUtils.isMcpdDate()
method if the value is valid.
Update MCPDUtils
Update MCPDUtils.isMcpdDate()
method to test that the values for DD and MM are:
- DD: -- or 00 or valid month value from 1 to 12
- MM: -- or 00 or valid day in the month of the year (if provided)
Dataset
Update Dataset
class and add String startDate
and endDate
fields to Dataset
. @Column(length = 8)
In @PrePersist/@PreUpdate
get the minimum and maximum start and end dates from all dataset locations.
if (dataset.locations != null) {
this.startDate = dataset.locations.stream().map(ds -> ds.startDate).sorted(/* ascending */).findFirst().orElse(null);
this.endDate = ... /* descending */
}
You may need to update methods for saving locations to also trigger an update on the dataset.
After merge
When this is done, file a ticket in the catalog-ui project to update the forms and display of DatasetLocations.