From d0da481b6ff0e80d884d681ae672da27b2d331b3 Mon Sep 17 00:00:00 2001 From: Tor-Einar Skog <tor-einar.skog@nibio.no> Date: Mon, 31 Jul 2023 14:47:09 +0200 Subject: [PATCH] Bugfix: Add timestamp to feature properties of observations connected to POIs --- src/main/java/no/nibio/vips/logic/entity/Observation.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/no/nibio/vips/logic/entity/Observation.java b/src/main/java/no/nibio/vips/logic/entity/Observation.java index b9a40e51..95b2d5b1 100755 --- a/src/main/java/no/nibio/vips/logic/entity/Observation.java +++ b/src/main/java/no/nibio/vips/logic/entity/Observation.java @@ -635,18 +635,20 @@ public class Observation implements Serializable, no.nibio.vips.observation.Obse */ public ObservationListItem getListItem(String locale, ObservationDataSchema observationDataSchema) { - // If geoInfo is from POI, need to add observationId + // If geoInfo is from POI, need to add observationId and other stuff for observation rendering if(this.location != null) { this.location.addProperty("observationId", this.getObservationId()); + this.location.addProperty("isPositive", this.isPositive); + this.location.addProperty("timestamp", this.getTimeOfObservation().getTime()); } return new ObservationListItem( this.getObservationId(), this.getTimeOfObservation(), this.getOrganismId(), - this.getOrganism().getLocalName(locale).trim() != "" ? this.getOrganism().getLocalName(locale) : this.getOrganism().getLatinName(), + ! this.getOrganism().getLocalName(locale).trim().isBlank() ? this.getOrganism().getLocalName(locale) : this.getOrganism().getLatinName(), this.getCropOrganismId(), - this.getCropOrganism().getLocalName(locale).trim() != "" ? this.getCropOrganism().getLocalName(locale) : this.getCropOrganism().getLatinName(), + ! this.getCropOrganism().getLocalName(locale).trim().isBlank() ? this.getCropOrganism().getLocalName(locale) : this.getCropOrganism().getLatinName(), // Specific geoInfo trumps location. This is to be interpreted // as that the observation has been geographically masked by // choice of the observer -- GitLab