From e7f6e88cf78ca7ae6b5de9ceaf7a62d290314a43 Mon Sep 17 00:00:00 2001 From: Hylke van der Schaaf Date: Tue, 13 Aug 2024 17:58:18 +0200 Subject: [PATCH] Fixed validator reference in json --- .../iosb/ilt/frostserver/model/loader/DefValidator.java | 2 +- .../frostserver/persistence/PersistenceManagerFactory.java | 4 ++-- .../frostserver/persistence/pgjooq/bindings/JsonValue.java | 3 +-- .../Actuation/src/main/resources/actuationv2/model/Task.json | 2 +- .../main/resources/plugincoremodelv2/model/Observation.json | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/FROST-Server.Core.Model/src/main/java/de/fraunhofer/iosb/ilt/frostserver/model/loader/DefValidator.java b/FROST-Server.Core.Model/src/main/java/de/fraunhofer/iosb/ilt/frostserver/model/loader/DefValidator.java index 834b24cca..e30be5de2 100644 --- a/FROST-Server.Core.Model/src/main/java/de/fraunhofer/iosb/ilt/frostserver/model/loader/DefValidator.java +++ b/FROST-Server.Core.Model/src/main/java/de/fraunhofer/iosb/ilt/frostserver/model/loader/DefValidator.java @@ -97,7 +97,7 @@ public static class NamedValidator { @ConfigurableField(editor = EditorSubclass.class, label = "validator", description = "The implementation class of the validator.") - @EditorSubclass.EdOptsSubclass(iface = EntityValidator.class) + @EditorSubclass.EdOptsSubclass(iface = EntityValidator.class, merge = true, nameField = "@class", shortenClassNames = true) public EntityValidator validator; } diff --git a/FROST-Server.Core/src/main/java/de/fraunhofer/iosb/ilt/frostserver/persistence/PersistenceManagerFactory.java b/FROST-Server.Core/src/main/java/de/fraunhofer/iosb/ilt/frostserver/persistence/PersistenceManagerFactory.java index 7d856e731..76723e7ee 100644 --- a/FROST-Server.Core/src/main/java/de/fraunhofer/iosb/ilt/frostserver/persistence/PersistenceManagerFactory.java +++ b/FROST-Server.Core/src/main/java/de/fraunhofer/iosb/ilt/frostserver/persistence/PersistenceManagerFactory.java @@ -66,8 +66,8 @@ private PersistenceManagerFactory(CoreSettings settings) { throw new IllegalArgumentException("settings must be non-null"); } this.settings = settings; + String pmiClsName = settings.getPersistenceSettings().getPersistenceManagerImplementationClass(); try { - String pmiClsName = settings.getPersistenceSettings().getPersistenceManagerImplementationClass(); Class clazz = Class.forName(pmiClsName, false, getClass().getClassLoader()); if (PersistenceManager.class.isAssignableFrom(clazz)) { persistenceManagerClass = (Class) clazz; @@ -75,7 +75,7 @@ private PersistenceManagerFactory(CoreSettings settings) { throw new IllegalArgumentException("Class " + pmiClsName + " does not implement the interface PersistenceManager"); } } catch (ClassNotFoundException ex) { - throw new IllegalArgumentException(ERROR_MSG + "Class '" + settings.getPersistenceSettings().getPersistenceManagerImplementationClass() + "' could not be found", ex); + throw new IllegalArgumentException(ERROR_MSG + "Class '" + pmiClsName + "' could not be found", ex); } } diff --git a/FROST-Server.SQLjooq/src/main/java/de/fraunhofer/iosb/ilt/frostserver/persistence/pgjooq/bindings/JsonValue.java b/FROST-Server.SQLjooq/src/main/java/de/fraunhofer/iosb/ilt/frostserver/persistence/pgjooq/bindings/JsonValue.java index 5b077544f..61e29dc3a 100644 --- a/FROST-Server.SQLjooq/src/main/java/de/fraunhofer/iosb/ilt/frostserver/persistence/pgjooq/bindings/JsonValue.java +++ b/FROST-Server.SQLjooq/src/main/java/de/fraunhofer/iosb/ilt/frostserver/persistence/pgjooq/bindings/JsonValue.java @@ -23,8 +23,7 @@ import java.util.Map; /** - * - * @author scf + * Wrapper for JSON values in the database. */ public class JsonValue { diff --git a/Plugins/Actuation/src/main/resources/actuationv2/model/Task.json b/Plugins/Actuation/src/main/resources/actuationv2/model/Task.json index 81e8d94f2..734ab1d16 100644 --- a/Plugins/Actuation/src/main/resources/actuationv2/model/Task.json +++ b/Plugins/Actuation/src/main/resources/actuationv2/model/Task.json @@ -122,7 +122,7 @@ { "name": "AC-Task-CrationTime", "validator": { - "className": "de.fraunhofer.iosb.ilt.frostserver.plugin.actuation.CreateTimeValidator" + "@class": "de.fraunhofer.iosb.ilt.frostserver.plugin.actuation.CreateTimeValidator" } } ], diff --git a/Plugins/CoreModelV2/src/main/resources/plugincoremodelv2/model/Observation.json b/Plugins/CoreModelV2/src/main/resources/plugincoremodelv2/model/Observation.json index 0800c7cff..40356aa5c 100644 --- a/Plugins/CoreModelV2/src/main/resources/plugincoremodelv2/model/Observation.json +++ b/Plugins/CoreModelV2/src/main/resources/plugincoremodelv2/model/Observation.json @@ -144,7 +144,7 @@ { "name": "CM-ObsPhenTime", "validator": { - "className": "de.fraunhofer.iosb.ilt.frostserver.plugin.coremodel.PhenomenonTimeValidator" + "@class": "de.fraunhofer.iosb.ilt.frostserver.plugin.coremodel.PhenomenonTimeValidator" } } ],