Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Dynamic JSON schema generation with translation support

Koencfbda0cc95a9
diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml
index e50ad969d..6ed9f7e9e 100644
--- a/.github/workflows/ci_cd.yml
+++ b/.github/workflows/ci_cd.yml
@@ -670,6 +670,23 @@ jobs:
env:
VERSION: ${{ steps.get-version-details.outputs.version_with_qualifier }}
+ - name: Check for outdated translations
+ run: |
+ set -e
+
+ # Run the tests
+ ./gradlew -p ui/app/shared processTranslations --no-parallel
+
+ out=$(git status --porcelain | grep "ui/app/shared/locales" || true)
+ if [[ -z "$out" ]]; then
+ echo "✅ No pipeline changes detected."
+ else
+ echo "❌ Pipeline files have changed. Please run './gradlew -p ui/app/shared processTranslations --no-parallel'"
+ echo "$out"
+ exit 1
+ fi
+ timeout-minutes: 20
+
- name: Run backend tests
id: run-backend-tests
if: ${{ steps.test-backend-command.outputs.value != '' }}
diff --git a/manager/src/main/java/org/openremote/manager/asset/AssetModelResourceImpl.java b/manager/src/main/java/org/openremote/manager/asset/AssetModelResourceImpl.java
index d18a8f2e0..0094d486d 100644
--- a/manager/src/main/java/org/openremote/manager/asset/AssetModelResourceImpl.java
+++ b/manager/src/main/java/org/openremote/manager/asset/AssetModelResourceImpl.java
@@ -19,6 +19,7 @@
*/
package org.openremote.manager.asset;
+import jakarta.ws.rs.WebApplicationException;
import org.openremote.container.timer.TimerService;
import org.openremote.manager.security.ManagerIdentityService;
import org.openremote.manager.web.ManagerWebResource;
@@ -29,8 +30,12 @@ import org.openremote.model.asset.AssetTypeInfo;
import org.openremote.model.value.MetaItemDescriptor;
import org.openremote.model.value.ValueDescriptor;
+import com.fasterxml.jackson.databind.JsonNode;
+
import java.util.Map;
+import static jakarta.ws.rs.core.Response.Status.*;
+
public class AssetModelResourceImpl extends ManagerWebResource implements AssetModelResource {
protected AssetModelService assetModelService;
@@ -64,4 +69,13 @@ public class AssetModelResourceImpl extends ManagerWebResource implements AssetM
public Map<String, MetaItemDescriptor<?>> getMetaItemDescriptors(RequestParams requestParams, String parentId) {
return assetModelService.getMetaItemDescriptors(parentId);
}
+
+ @Override
+ public JsonNode getValueDescriptorSchema(RequestParams requestParams, String name, String hash) {
+ JsonNode schema = assetModelService.getValueDescriptorSchema(name);
+ if (schema == null) {
+ throw new WebApplicationException(NOT_FOUND);
+ }
+ return schema;
+ }
}
diff --git a/manager/src/main/java/org/openremote/manager/asset/AssetModelService.java b/manager/src/main/java/org/openremote/manager/asset/AssetModelService.java
index 2499e7399..a51550e20 100644
--- a/manager/src/main/java/org/openremote/manager/asset/AssetModelService.java
+++ b/manager/src/main/java/org/openremote/manager/asset/AssetModelService.java
@@ -27,6 +27,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
+import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.fasterxml.jackson.databind.util.TokenBuffer;
import org.apache.camel.builder.RouteBuilder;
@@ -51,9 +52,14 @@ import org.openremote.model.value.MetaItemDescriptor;
import org.openremote.model.value.ValueDescriptor;
import java.io.IOException;
+import java.lang.reflect.Array;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
import java.util.logging.Level;
@@ -373,6 +379,10 @@ public class AssetModelService extends RouteBuilder implements ContainerService,
return ValueUtil.getMetaItemDescriptors();
}
+ public JsonNode getValueDescriptorSchema(String name) {
+ return ValueUtil.getValueDescriptorSchema(name);
+ }
+
protected <T> T parse(String jsonString, Class<T> type) throws JsonProcessingException {
return JSON.readValue(jsonString, JSON.constructType(type));
}
diff --git a/manager/src/main/java/org/openremote/manager/system/StatusResourceImpl.java b/manager/src/main/java/org/openremote/manager/system/StatusResourceImpl.java
index 87e13d950..24f9b832f 100644
--- a/manager/src/main/java/org/openremote/manager/system/StatusResourceImpl.java
+++ b/manager/src/main/java/org/openremote/manager/system/StatusResourceImpl.java
@@ -24,6 +24,7 @@ import org.openremote.manager.security.ManagerIdentityService;
import org.openremote.model.Container;
import org.openremote.model.system.HealthStatusProvider;
import org.openremote.model.system.StatusResource;
+import org.openremote.model.util.ValueUtil;
import java.io.IOException;
import java.io.InputStream;
@@ -66,7 +67,8 @@ public class StatusResourceImpl implements StatusResource {
serverInfo = Map.of(
"version", version,
- "authServerUrl", authServerUrl
+ "authServerUrl", authServerUrl,
+ "valueDescriptorSchemaHashes", ValueUtil.getValueDescriptorSchemaHashes()
);
LOG.info("Starting OpenRemote version: v"+version);
diff --git a/model/build.gradle b/model/build.gradle
index 699069a35..c089651cd 100644
--- a/model/build.gradle
+++ b/model/build.gradle
@@ -13,6 +13,7 @@ dependencies {
api "jakarta.el:jakarta.el-api:$javaxELAPIVersion"
api "jakarta.annotation:jakarta.annotation-api:$javaxAnnotationsVersion"
api "jakarta.ws.rs:jakarta.ws.rs-api:$jaxrsSpecVersion"
+ api "org.jboss.resteasy:resteasy-cache-core:4.7.10.Final"
api "org.keycloak:keycloak-core:$keycloakVersion"
diff --git a/model/src/main/java/org/openremote/model/asset/AssetModelResource.java b/model/src/main/java/org/openremote/model/asset/AssetModelResource.java
index 5bfd037d4..23be3c965 100644
--- a/model/src/main/java/org/openremote/model/asset/AssetModelResource.java
+++ b/model/src/main/java/org/openremote/model/asset/AssetModelResource.java
@@ -19,12 +19,15 @@
*/
package org.openremote.model.asset;
+import com.fasterxml.jackson.databind.JsonNode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.openremote.model.http.RequestParams;
+import org.openremote.model.system.StatusResource;
import org.openremote.model.value.MetaItemDescriptor;
import org.openremote.model.value.ValueDescriptor;
+import org.jboss.resteasy.annotations.cache.Cache;
import jakarta.ws.rs.*;
import java.util.Map;
@@ -99,4 +102,16 @@ public interface AssetModelResource {
@Produces(APPLICATION_JSON)
@Operation(operationId = "getMetaItemDescriptors", summary = "Retrieve the available meta item descriptors")
Map<String, MetaItemDescriptor<?>> getMetaItemDescriptors(@BeanParam RequestParams requestParams, @QueryParam("parentId") String parentId);
+
+ /**
+ * Retrieve the JSON Schema for a {@link ValueDescriptor} available in this system. A value descriptor schema is only meant to be retrieved
+ * once per client. Either when a new {@code hash} or {@code name} are requested. The HTTP client should cache the response based on the
+ * {@code Cache-Control} header. The {@code hash} for actively cached descriptors can be found by requesting the {@link StatusResource#getInfo()} endpoint.
+ */
+ @GET
+ @Path("getValueDescriptorSchema")
+ @Produces(APPLICATION_JSON)
+ @Cache(maxAge = 31536000) // A 1-year cache, the supplied hash parameter serves as cache key on the client
+ @Operation(operationId = "getValueDescriptorSchema", summary = "Retrieve the valueDescriptor JSON Schema.")
+ JsonNode getValueDescriptorSchema(@BeanParam RequestParams requestParams, @QueryParam("name") String name, @QueryParam("hash") String hash);
}
diff --git a/model/src/main/java/org/openremote/model/asset/agent/AgentLink.java b/model/src/main/java/org/openremote/model/asset/agent/AgentLink.java
index 9ed30ad80..9a3047299 100644
--- a/model/src/main/java/org/openremote/model/asset/agent/AgentLink.java
+++ b/model/src/main/java/org/openremote/model/asset/agent/AgentLink.java
@@ -38,6 +38,7 @@ import java.util.Optional;
* item and standard JSR-380 annotations should be used to provide validation logic.
*/
@JsonTypeInfo(property = "type", use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, defaultImpl = DefaultAgentLink.class)
+@JsonSchemaDefault("{\"id\":\"\",\"type\":\"DefaultAgentLink\"}")
@TsIgnoreTypeParams
public abstract class AgentLink<T extends AgentLink<?>> implements Serializable {
@@ -56,7 +57,7 @@ public abstract class AgentLink<T extends AgentLink<?>> implements Serializable
@JsonSchemaDescription("Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion")
@JsonSchemaSupplier(supplier = SchemaNodeMapper.SCHEMA_SUPPLIER_NAME_PATTERN_PROPERTIES_ANY_KEY_ANY_TYPE)
protected Map<String, Object> writeValueConverter;
- @JsonSchemaDescription("String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic" +
+ @JsonSchemaDescription("String to be used for attribute writes and can contain dynamic placeholders to allow dynamic" +
" value and/or time injection with formatting (see documentation for details) into the string or alternatively" +
" write the string through to the protocol as is (static string)")
@JsonSchemaFormat("or-multiline")
diff --git a/model/src/main/java/org/openremote/model/util/I18nAnnotationProcessor.java b/model/src/main/java/org/openremote/model/util/I18nAnnotationProcessor.java
new file mode 100644
index 000000000..c35402a9f
--- /dev/null
+++ b/model/src/main/java/org/openremote/model/util/I18nAnnotationProcessor.java
@@ -0,0 +1,208 @@
+/*
+ * Copyright 2025, OpenRemote Inc.
+ *
+ * See the CONTRIBUTORS.txt file in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.openremote.model.util;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.fasterxml.jackson.databind.node.TextNode;
+import org.openremote.model.util.JSONSchemaUtil.*;
+
+import javax.annotation.processing.*;
+import javax.lang.model.SourceVersion;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.TypeElement;
+import java.io.File;
+import java.lang.annotation.Annotation;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.*;
+
+import static javax.tools.Diagnostic.Kind.*;
+
+public class I18nAnnotationProcessor extends AbstractProcessor {
+
+ private final ObjectMapper mapper = new ObjectMapper();
+ // LinkedHashMap ensures consistent ordering
+ private final Map<String, String> translations = new LinkedHashMap<>();
+
+ @Override
+ public Set<String> getSupportedOptions() {
+ return Set.of("shared");
+ }
+
+ @Override
+ public Set<String> getSupportedAnnotationTypes() {
+ return Set.of(
+ JsonSchemaTitle.class.getCanonicalName(),
+ JsonSchemaDescription.class.getCanonicalName()
+ );
+ }
+
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.RELEASE_21;
+ }
+
+ @Override
+ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
+ collectI18nKeys(JsonSchemaTitle.class, roundEnv);
+ collectI18nKeys(JsonSchemaDescription.class, roundEnv);
+
+ if (roundEnv.processingOver()) {
+ writeKeys();
+ }
+
+ return false;
+ }
+
+ private <A extends Annotation> void collectI18nKeys(Class<A> annotationClass, RoundEnvironment roundEnv) {
+ for (Element element : roundEnv.getElementsAnnotatedWith(annotationClass)) {
+ try {
+ A ann = element.getAnnotation(annotationClass);
+ boolean translate = (boolean) annotationClass.getMethod("i18n").invoke(ann);
+ if (!translate) continue;
+
+ Optional<String> i18nSuffix = Arrays.stream(annotationClass.getMethods())
+ .filter(m -> m.getName().equals("i18nSuffix"))
+ .map(m -> (String)m.getDefaultValue())
+ .findFirst();
+ String keyword = (String) annotationClass.getMethod("keyword").invoke(ann);
+ String key = resolveKey(element, i18nSuffix.orElse(keyword));
+ String value = (String) annotationClass.getMethod("value").invoke(ann);
+
+ translations.put(key, value);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to process i18n annotation " + annotationClass.getSimpleName(), e);
+ }
+ }
+ }
+
+ private String resolveKey(Element element, String suffix) {
+ if (element.getKind().isClass()) {
+ return ((TypeElement) element).getQualifiedName().toString() + "." + suffix;
+ } else {
+ String className = ((TypeElement) element.getEnclosingElement()).getQualifiedName().toString();
+ return className + "." + element.getSimpleName().toString() + "." + suffix;
+ }
+ }
+
+ private void writeKeys() {
+ Path locales = Paths.get(processingEnv.getOptions().get("shared")).resolve("locales");
+ File[] dirs = locales.toFile().listFiles();
+
+ assert dirs != null;
+ for (File d : dirs) appendKeys(d.toPath().resolve("or.json"), d.getName().equals("en"));
+ }
+
+ private void appendKeys(Path path, boolean writeValue) {
+ ObjectNode existing;
+
+ if (!Files.exists(path)) {
+ processingEnv.getMessager().printMessage(WARNING, "Missing translation file");
+ return;
+ }
+
+ try {
+ existing = mapper.readValue(path.toFile(), new TypeReference<>() {});
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ int conflicts = 0;
+
+ nextTranslation:
+ for (Map.Entry<String, String> entry : translations.entrySet()) {
+ String key = entry.getKey();
+ String[] keys = key.split("\\.");
+ int zeroIndexLength = keys.length-1;
+
+ ObjectNode node = existing;
+
+ for (int i = 0; i < zeroIndexLength; i++) {
+ ObjectNode newNode = mapper.createObjectNode();
+ JsonNode oldNode = node.putIfAbsent(keys[i], newNode);
+ if (oldNode instanceof ObjectNode obj) {
+ node = obj;
+ } else if (oldNode == null) {
+ node = newNode;
+ } else {
+ processingEnv.getMessager().printMessage(ERROR, "Translation key conflict for: "+key);
+ conflicts++;
+ continue nextTranslation;
+ }
+ }
+ if (writeValue) {
+ node.set(keys[zeroIndexLength], new TextNode(entry.getValue()));
+ } else {
+ node.putIfAbsent(keys[zeroIndexLength], new TextNode(""));
+ }
+ }
+
+ if (conflicts > 0) {
+ processingEnv.getMessager().printMessage(ERROR,
+ conflicts + " translation key conflict(s) detected. Please remove the above keys or the conflicting annotations."
+ );
+ throw new RuntimeException("Key conflict");
+ }
+
+ try {
+ String updatedJsonString = buildJsonWithoutSpaces(existing, 0) + "\n";
+ Files.write(path, updatedJsonString.getBytes());
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ // Hacky solution to get around weird Jackson formatting which adds spaces between field names and colons
+ private static String buildJsonWithoutSpaces(JsonNode jsonNode, int indentLevel) {
+ StringBuilder jsonBuilder = new StringBuilder();
+ String indent = " ".repeat(indentLevel); // Create indentation spaces
+
+ // Close and return the object if empty
+ if (!jsonNode.properties().iterator().hasNext()) {
+ return jsonBuilder.append("{}").toString();
+ } else {
+ jsonBuilder.append("{\n");
+ }
+
+ // Iterate through the fields without adding a space between the "fieldName" and colon
+ for (Map.Entry<String, JsonNode> entry : jsonNode.properties()) {
+ jsonBuilder.append(indent).append(" \"").append(entry.getKey()).append("\": ");
+ JsonNode value = entry.getValue();
+
+ if (value.isObject()) {
+ jsonBuilder.append(buildJsonWithoutSpaces(value, indentLevel + 1));
+ } else {
+ jsonBuilder.append(value);
+ }
+ jsonBuilder.append(",\n");
+ }
+
+ if (jsonBuilder.length() > 1) {
+ jsonBuilder.setLength(jsonBuilder.length() - 2); // Remove last comma and newline
+ }
+ jsonBuilder.append("\n").append(indent).append("}"); // Close the object
+
+ return jsonBuilder.toString();
+ }
+}
diff --git a/model/src/main/java/org/openremote/model/util/JSONSchemaUtil.java b/model/src/main/java/org/openremote/model/util/JSONSchemaUtil.java
index b03239cfe..65a8a2449 100644
--- a/model/src/main/java/org/openremote/model/util/JSONSchemaUtil.java
+++ b/model/src/main/java/org/openremote/model/util/JSONSchemaUtil.java
@@ -132,8 +132,10 @@ public class JSONSchemaUtil {
public @interface JsonSchemaTitle {
String keyword() default "title";
String value();
- /* Whether to put the title on the root of the schema even when the class is wrapped in an array. */
+ /** Whether to put the title on the root of the schema even when the class is wrapped in an array. */
boolean container() default true;
+ boolean i18n() default true;
+ String i18nSuffix() default "label";
}
@Retention(RetentionPolicy.RUNTIME)
@@ -141,7 +143,9 @@ public class JSONSchemaUtil {
public @interface JsonSchemaDescription {
String keyword() default "description";
String value();
+ /** Whether to put the title on the root of the schema even when the class is wrapped in an array. */
boolean container() default true;
+ boolean i18n() default true;
}
@Retention(RetentionPolicy.RUNTIME)
@@ -149,6 +153,7 @@ public class JSONSchemaUtil {
public @interface JsonSchemaFormat {
String keyword() default "format";
String value();
+ /** Whether to put the title on the root of the schema even when the class is wrapped in an array. */
boolean container() default true;
}
@@ -157,6 +162,7 @@ public class JSONSchemaUtil {
public @interface JsonSchemaDefault {
String keyword() default "default";
String value();
+ /** Whether to put the title on the root of the schema even when the class is wrapped in an array. */
boolean container() default true;
}
@@ -165,6 +171,7 @@ public class JSONSchemaUtil {
public @interface JsonSchemaExamples {
String keyword() default "examples";
String[] value();
+ /** Whether to put the title on the root of the schema even when the class is wrapped in an array. */
boolean container() default true;
}
@@ -269,12 +276,17 @@ public class JSONSchemaUtil {
}
// Avoids annotation also being applied to the `items` in an array. See https://victools.github.io/jsonschema-generator/#generator-individual-configurations
if (!fieldScope.isFakeContainerItemScope()) {
- applyFieldAnnotation(fieldScope, JsonSchemaFormat.class, attrs);
- applyFieldAnnotation(fieldScope, JsonSchemaTitle.class, attrs);
- applyFieldAnnotation(fieldScope, JsonSchemaDescription.class, attrs);
applyFieldAnnotation(fieldScope, JsonSchemaFormat.class, attrs);
applyFieldAnnotation(fieldScope, JsonSchemaDefault.class, attrs);
applyFieldAnnotation(fieldScope, JsonSchemaExamples.class, attrs);
+
+ String key = getCanonicalMemberKey(fieldScope);
+ if (!applyI18nAnnotation(fieldScope.getAnnotation(JsonSchemaTitle.class), key, attrs)) {
+ applyFieldAnnotation(fieldScope, JsonSchemaTitle.class, attrs);
+ }
+ if (!applyI18nAnnotation(fieldScope.getAnnotation(JsonSchemaDescription.class), key, attrs)) {
+ applyFieldAnnotation(fieldScope, JsonSchemaDescription.class, attrs);
+ }
}
String description = jacksonResolvers.resolveDescription(fieldScope);
if (description != null) {
@@ -350,11 +362,18 @@ public class JSONSchemaUtil {
// These will be overwritten by member scope when colliding
if (!erasedType.isArray()) {
- applyTypeAnnotation(erasedType, JsonSchemaTitle.class, targetNode);
- applyTypeAnnotation(erasedType, JsonSchemaDescription.class, targetNode);
applyTypeAnnotation(erasedType, JsonSchemaFormat.class, targetNode);
applyTypeAnnotation(erasedType, JsonSchemaDefault.class, targetNode);
applyTypeAnnotation(erasedType, JsonSchemaExamples.class, targetNode);
+
+ // TODO: Is it possible to avoid object merging here?
+ String key = erasedType.getCanonicalName();
+ if (!(attrs.has("type") && applyI18nAnnotation(erasedType.getAnnotation(JsonSchemaTitle.class), key, attrs))) {
+ applyTypeAnnotation(erasedType, JsonSchemaTitle.class, targetNode);
+ }
+ if (!(attrs.has("type") && applyI18nAnnotation(erasedType.getAnnotation(JsonSchemaDescription.class), key, attrs))) {
+ applyTypeAnnotation(erasedType, JsonSchemaDescription.class, targetNode);
+ }
}
});
@@ -431,6 +450,10 @@ public class JSONSchemaUtil {
});
}
+ private String getCanonicalMemberKey(FieldScope fieldScope) {
+ return fieldScope.getMember().getDeclaringType().getErasedType().getCanonicalName() + "." + fieldScope.getMember().getName();
+ }
+
private static void setFormat(ObjectNode node, String format) {
node.put("format", format);
}
@@ -624,6 +647,21 @@ public class JSONSchemaUtil {
}
}
+ // TODO: handle other annotations from Jackson (or replace existing annotations)
+ private static <A extends Annotation> boolean applyI18nAnnotation(A annotation, String key, ObjectNode schema) {
+ if (annotation == null) return false;
+ Class<?> annotationClass = annotation.getClass();
+ try {
+ if ((boolean)annotationClass.getMethod("i18n").invoke(annotation)) {
+ schema.set("i18n", new TextNode(key));
+ return true;
+ }
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to apply i18n annotation " + annotationClass.getSimpleName(), e);
+ }
+ return false;
+ }
+
private static List<ResolvedType> findSubtypes(ResolvedType resolvedType, SchemaGenerationContext context) {
Class<?> rawType = resolvedType.getErasedType();
diff --git a/model/src/main/java/org/openremote/model/util/ValueUtil.java b/model/src/main/java/org/openremote/model/util/ValueUtil.java
index efa73cefd..c6eb43911 100644
--- a/model/src/main/java/org/openremote/model/util/ValueUtil.java
+++ b/model/src/main/java/org/openremote/model/util/ValueUtil.java
@@ -27,6 +27,7 @@ import com.fasterxml.jackson.databind.deser.BeanDeserializerModifier;
import com.fasterxml.jackson.databind.jsontype.NamedType;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.node.NullNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.databind.node.TextNode;
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
@@ -65,6 +66,9 @@ import java.io.Serializable;
import java.lang.reflect.*;
import java.math.BigDecimal;
import java.math.BigInteger;
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
import java.time.Duration;
import java.time.Instant;
import java.time.ZoneId;
@@ -158,8 +162,20 @@ public class ValueUtil {
protected static Map<String, Class<? extends AgentLink<?>>> agentTypeMap = new HashMap<>();
protected static Map<String, MetaItemDescriptor<?>> metaItemDescriptors = new HashMap<>();
protected static Map<String, ValueDescriptor<?>> valueDescriptors = new HashMap<>();
+ protected static Map<String, ObjectNode> valueDescriptorSchemas = new HashMap<>();
+ protected static Map<String, String> valueDescriptorSchemaHashes = new HashMap<>();
protected static Validator validator;
protected static SchemaGenerator generator;
+ protected static MessageDigest md;
+
+ static {
+ try {
+ md = MessageDigest.getInstance("MD5");
+ } catch (NoSuchAlgorithmException e) {
+ LOG.severe("MD5 algorithm not supported");
+ throw new RuntimeException(e);
+ }
+ }
public static ObjectMapper configureObjectMapper(ObjectMapper objectMapper) {
objectMapper
@@ -640,6 +656,10 @@ public class ValueUtil {
return Optional.ofNullable(metaItemDescriptors.get(name));
}
+ public static Map<String, String> getValueDescriptorSchemaHashes() {
+ return valueDescriptorSchemaHashes;
+ }
+
public static Map<String, ValueDescriptor<?>> getValueDescriptors() {
return valueDescriptors;
}
@@ -919,12 +939,40 @@ public class ValueUtil {
JSON.registerSubtypes(agentLinkSubTypes);
doSchemaInit();
+
+ // Add JSON schemas for complex meta items and generate cache keys
+ Map<String, MetaItemDescriptor<?>> metaItems = getMetaItemDescriptors();
+ valueDescriptorSchemas.putAll(metaItems.values().stream()
+ .map(AbstractNameValueDescriptorHolder::getType)
+ .filter(v -> {
+ String jsonType = v.getJsonType();
+ return jsonType.equals("array") || jsonType.equals("object");
+ })
+ .collect(Collectors.toMap(
+ ValueDescriptor::getName,
+ vd -> (ObjectNode) getSchema(vd.getType())
+ )));
+ valueDescriptorSchemaHashes.putAll(valueDescriptorSchemas.entrySet().stream().collect(Collectors.toMap(
+ Map.Entry::getKey,
+ v -> hash(v.getValue().toString())
+ )));
}
protected static void doSchemaInit() {
generator = new SchemaGenerator(JSONSchemaUtil.getJsonSchemaConfig(JSON));
}
+ public static JsonNode getValueDescriptorSchema(String name) {
+ if (ValueUtil.getValueDescriptor(name).isEmpty()) {
+ return null;
+ }
+ ValueDescriptor<?> vd = ValueUtil.getValueDescriptor(name).get();
+ return valueDescriptorSchemas.computeIfAbsent(vd.getName(), key -> {
+ ObjectNode schema = (ObjectNode) ValueUtil.getSchema(vd.getType());
+ valueDescriptorSchemaHashes.put(vd.getName(), hash(schema.toString()));
+ return schema;
+ });
+ }
protected static Class<?>[] getAgentLinkClasses() {
return Arrays.stream(getAssetDescriptors(null))
@@ -936,6 +984,10 @@ public class ValueUtil {
.toArray(Class<?>[]::new);
}
+ public static String hash(String v) {
+ return bytesToHexString(md.digest(v.getBytes(StandardCharsets.UTF_8)));
+ }
+
/**
* Validates the supplied object using standard JSR-380 bean validation; therefore any type passed in here must
* follow the JSR-380 annotation requirements.
diff --git a/model/src/main/java/org/openremote/model/value/ForecastConfigurationWeightedExponentialAverage.java b/model/src/main/java/org/openremote/model/value/ForecastConfigurationWeightedExponentialAverage.java
index d03ad05ed..33796f213 100644
--- a/model/src/main/java/org/openremote/model/value/ForecastConfigurationWeightedExponentialAverage.java
+++ b/model/src/main/java/org/openremote/model/value/ForecastConfigurationWeightedExponentialAverage.java
@@ -28,6 +28,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
+import org.openremote.model.util.JSONSchemaUtil.*;
import org.openremote.model.util.TimeUtil;
import static org.openremote.model.value.ForecastConfigurationWeightedExponentialAverage.TYPE;
@@ -40,6 +41,7 @@ public class ForecastConfigurationWeightedExponentialAverage extends ForecastCon
@NotNull
@JsonSerialize(using = ToStringSerializer.class)
@JsonDeserialize(converter = TimeUtil.PeriodAndDurationConverter.class)
+ @JsonSchemaTypeRemap(type = String.class)
// TODO: consider @JsonSchemaFormat("duration") requires new or-mwc-input type
protected TimeUtil.ExtendedPeriodAndDuration pastPeriod;
@NotNull
@@ -48,6 +50,7 @@ public class ForecastConfigurationWeightedExponentialAverage extends ForecastCon
@NotNull
@JsonSerialize(using = ToStringSerializer.class)
@JsonDeserialize(converter = TimeUtil.PeriodAndDurationConverter.class)
+ @JsonSchemaTypeRemap(type = String.class)
// TODO: consider @JsonSchemaFormat("duration") requires new or-mwc-input type
protected TimeUtil.ExtendedPeriodAndDuration forecastPeriod;
@NotNull
diff --git a/model/src/main/resources/META-INF/services/javax.annotation.processing.Processor b/model/src/main/resources/META-INF/services/javax.annotation.processing.Processor
new file mode 100644
index 000000000..062fc9e33
--- /dev/null
+++ b/model/src/main/resources/META-INF/services/javax.annotation.processing.Processor
@@ -0,0 +1 @@
+org.openremote.model.util.I18nAnnotationProcessor
diff --git a/model/src/test/java/org/openremote/model/util/JSONSchemaUtilTest.java b/model/src/test/java/org/openremote/model/util/JSONSchemaUtilTest.java
index c7817039a..1f40aab71 100644
--- a/model/src/test/java/org/openremote/model/util/JSONSchemaUtilTest.java
+++ b/model/src/test/java/org/openremote/model/util/JSONSchemaUtilTest.java
@@ -52,7 +52,7 @@ public class JSONSchemaUtilTest {
assertEquals(expected.toString(), actual.toString(), true);
}
- @JsonSchemaTitle("Test Title")
+ @JsonSchemaTitle(value = "Test Title", i18n = false)
static class ItemType { }
static class MembersShouldNotHaveTitle {
@@ -242,8 +242,8 @@ public class JSONSchemaUtilTest {
}
static class AnnotationsForFields {
- @JsonSchemaTitle("test")
- @JsonSchemaDescription("test")
+ @JsonSchemaTitle(value = "test", i18n = false)
+ @JsonSchemaDescription(value = "test", i18n = false)
@JsonSchemaFormat("test")
@JsonSchemaDefault("false")
@JsonSchemaExamples({ "test" })
@@ -275,8 +275,8 @@ public class JSONSchemaUtilTest {
assertEquals(expected.toString(), actual.toString(), true);
}
- @JsonSchemaTitle("test")
- @JsonSchemaDescription("test")
+ @JsonSchemaTitle(value = "test", i18n = false)
+ @JsonSchemaDescription(value = "test", i18n = false)
@JsonSchemaFormat("test")
@JsonSchemaDefault("{}")
@JsonSchemaExamples({ "test" })
@@ -304,6 +304,48 @@ public class JSONSchemaUtilTest {
assertEquals(expected.toString(), actual.toString(), true);
}
+ @JsonSchemaTitle("test")
+ @JsonSchemaDescription("test")
+ static class I18nAnnotations {
+ }
+
+ @Test
+ public void shouldApplyI18nAnnotations() throws JsonProcessingException, JSONException {
+ JsonNode expected = ValueUtil.JSON.readTree("""
+ {
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "type": "object",
+ "title": "I 18n Annotations",
+ "i18n": "org.openremote.model.util.JSONSchemaUtilTest.I18nAnnotations",
+ "additionalProperties": true
+ }"""
+ );
+
+ JsonNode actual = ValueUtil.getSchema(I18nAnnotations.class);
+ assertEquals(expected.toString(), actual.toString(), true);
+ }
+
+ @JsonSchemaTitle(value = "test", i18n = false)
+ @JsonSchemaDescription("Translated description")
+ static class I18nAnnotationsPartiallyDisabled {
+ }
+
+ @Test
+ public void shouldApplyI18nAnnotationsPartiallyDisabled() throws JsonProcessingException, JSONException {
+ JsonNode expected = ValueUtil.JSON.readTree("""
+ {
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "type": "object",
+ "title": "test",
+ "i18n": "org.openremote.model.util.JSONSchemaUtilTest.I18nAnnotationsPartiallyDisabled",
+ "additionalProperties": true
+ }"""
+ );
+
+ JsonNode actual = ValueUtil.getSchema(I18nAnnotationsPartiallyDisabled.class);
+ assertEquals(expected.toString(), actual.toString(), true);
+ }
+
@JsonTypeInfo(property = "type", use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY)
@JsonSubTypes({
@JsonSubTypes.Type(TestAgentLinkAnnotationResolving.class),
diff --git a/test/src/test/groovy/org/openremote/test/model/AssetModelTest.groovy b/test/src/test/groovy/org/openremote/test/model/AssetModelTest.groovy
index a6a73694e..54238d37e 100644
--- a/test/src/test/groovy/org/openremote/test/model/AssetModelTest.groovy
+++ b/test/src/test/groovy/org/openremote/test/model/AssetModelTest.groovy
@@ -1,5 +1,6 @@
package org.openremote.test.model
+import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.node.ObjectNode
import jakarta.ws.rs.WebApplicationException
import org.jboss.resteasy.api.validation.ViolationReport
@@ -8,6 +9,7 @@ import org.openremote.agent.protocol.simulator.SimulatorAgent
import org.openremote.agent.protocol.velbus.VelbusTCPAgent
import org.openremote.container.persistence.PersistenceService
import org.openremote.container.timer.TimerService
+import org.openremote.model.attribute.AttributeLink
import org.openremote.model.util.UniqueIdentifierGenerator
import org.openremote.manager.asset.AssetModelService
import org.openremote.manager.asset.AssetStorageService
@@ -34,6 +36,7 @@ import org.openremote.setup.integration.protocol.http.HTTPServerTestAgent
import org.openremote.test.ManagerContainerTrait
import spock.lang.Shared
import spock.lang.Specification
+import spock.lang.Unroll
import java.lang.reflect.Array
import java.nio.file.Files
@@ -604,4 +607,39 @@ class AssetModelTest extends Specification implements ManagerContainerTrait {
!attributeEventObjectNode2.has("source")
!attributeEventObjectNode2.has("meta")
}
+
+ @Unroll
+ def "Get valueDescriptor schema for #name"(String name, Class<?> clazz) {
+ given: "required services are setup"
+ def assetModelService = container.getService(AssetModelService.class)
+
+ when: "we ask to generate a schema for #clazz"
+ def schema = assetModelService.getValueDescriptorSchema(name)
+ def expected = ValueUtil.getSchema(clazz)
+
+ then: "the schema to be the same"
+ Objects.equals(schema, expected)
+
+ where:
+ name | clazz
+ "text" | String
+ "text[]" | String[]
+ "text[][]" | String[][]
+ "agentLink" | AgentLink
+ "attributeLink" | AttributeLink
+ "valueConstraint[]" | ValueConstraint[]
+ "forecastConfiguration" | ForecastConfiguration
+ "valueFormat" | ValueFormat
+ }
+
+ def "Get unknown valueDescriptor schema"() {
+ given: "required services are setup"
+ def assetModelService = container.getService(AssetModelService.class)
+
+ when: "we ask to generate a schema for a nonexistent value descriptor"
+ def schema = assetModelService.getValueDescriptorSchema("String")
+
+ then: "to return null"
+ Objects.equals(schema, null)
+ }
}
diff --git a/ui/app/shared/build.gradle b/ui/app/shared/build.gradle
index 8b46ca340..a7eba7620 100644
--- a/ui/app/shared/build.gradle
+++ b/ui/app/shared/build.gradle
@@ -1,3 +1,6 @@
+import javax.annotation.processing.Processor
+import javax.tools.ToolProvider
+
apply plugin: 'java'
apply plugin: "maven-publish"
apply plugin: "signing"
@@ -84,6 +87,24 @@ tasks.register('installDist', Copy) {
into project(':manager').layout.buildDirectory.dir("install/manager/web/${project.name}")
}
+tasks.register('processTranslations', JavaCompile) {
+ dependsOn(":model:classes")
+ outputs.upToDateWhen { false } // Always invalidate
+
+ def modelSourceSet = project(":model").sourceSets.main
+
+ source = modelSourceSet.allJava
+ classpath = modelSourceSet.compileClasspath
+ destinationDirectory = layout.buildDirectory.dir("generated/i18n") // unused
+ options.compilerArgs += [
+ "-proc:only", // Only run the processor
+ "-processor", "org.openremote.model.util.I18nAnnotationProcessor",
+ "-Ashared=${project.getProjectDir()}".toString()
+ ]
+ // Pass classpath to compiler
+ options.annotationProcessorPath = modelSourceSet.output + modelSourceSet.compileClasspath
+}
+
jar.dependsOn(generateSources)
processResources.dependsOn(generateSources)
sourcesJar.dependsOn(generateSources)
diff --git a/ui/app/shared/locales/ar/or.json b/ui/app/shared/locales/ar/or.json
index d119e04c3..6b9beac12 100644
--- a/ui/app/shared/locales/ar/or.json
+++ b/ui/app/shared/locales/ar/or.json
@@ -131,13 +131,13 @@
"TEXT_SWITCH": "تبديل النص ",
"ROUND_NODE": " تقريب القيمة إلى",
"LOG_OUTPUT": "Write to Logs",
- "DERIVATIVE": "Attribute derivative",
+ "DERIVATIVE": "Attribute derivative",
"INTEGRAL": "Attribute integral",
"HISTORIC_VALUE": "Attribute history",
"MAX_PROCESSOR": "Maximum",
- "MIN_PROCESSOR": "Minimum",
- "AVERAGE_PROCESSOR": "Average",
- "MEDIAN_PROCESSOR": "Median",
+ "MIN_PROCESSOR": "Minimum",
+ "AVERAGE_PROCESSOR": "Average",
+ "MEDIAN_PROCESSOR": "Median",
"SUM_OPERATOR": "Sum",
"max": "Max",
"min": "Min",
@@ -212,21 +212,21 @@
"buttonTextConfirm": "نص لزر التفعيل",
"buttonTextDecline": "نص لزر عدم التفعيل",
"custom": "إدخال يدوي",
- "realm": "نطاق",
- "realm_plural": "النطاقات",
- "displayName":" إسم الظهور ",
- "realm management":"إدخال النطاق",
- "deleteRealmConfirm":"هل أنت متأكد بأنك تريد حذف هذا النطاق؟",
+ "realm": "عالم دنيا",
+ "realm_plural": "عالم دنيا",
+ "displayName": " إسم الظهور ",
+ "realm management": "إدخال النطاق",
+ "deleteRealmConfirm": "هل أنت متأكد بأنك تريد حذف هذا النطاق؟",
"user_plural": "المستخدمين",
"user_role": "دور المستخدم",
"role_plural": "الأدوار",
"description": "شرح",
- "passwordMismatch":"كلمة المرور غير متطابقة",
- "username":"أسم المستخدم",
- "firstName":"الإسم الأول",
- "surname":"الكنية",
- "deleteUserConfirm":" هل أنت متأكد من حذف إسم المستخدم؟",
- "deleteRoleConfirm":"هل أنت متأكد من حذف هذا الدور",
+ "passwordMismatch": "كلمة المرور غير متطابقة",
+ "username": "أسم المستخدم",
+ "firstName": "الإسم الأول",
+ "surname": "الكنية",
+ "deleteUserConfirm": " هل أنت متأكد من حذف إسم المستخدم؟",
+ "deleteRoleConfirm": "هل أنت متأكد من حذف هذا الدور",
"realmRules": "إضافة شرط داخل هذا النطاق",
"globalRules": "الإجرائات العامة",
"recipients": "المستلمين",
@@ -243,8 +243,6 @@
"secured": "محمي",
"clientSecret": "كلمة سر المستخدم",
"clientId": "الرقم التعريقي للمستخدم",
- "realm": "عالم دنيا",
- "realm_plural": "عالم دنيا",
"port": "المنفذ",
"host": "أسم المضيف",
"errorOccurred": "حدث خطأ ",
@@ -265,7 +263,7 @@
"resetPassword": "إعادة تعيين كلمة السر",
"resetPasswordConfirmation": "تم إرسال بريد إلكتروني لإعادة تعيين كلمة السر الخاصة بك.",
"repeatPassword": "إعادة كتابة كلمة السر",
- "permissions":"الصلاحيات",
+ "permissions": "الصلاحيات",
"noChildAssets": "لايوجد مكون فرعي",
"account": "حساب",
"editAttribute": "تعديل الخصائص",
@@ -339,42 +337,31 @@
"hertz": "Hz",
"rpm": "rpm",
"carbon": "CO2",
- "meta": {
- },
- "attribute": {
- }
+ "meta": {},
+ "attribute": {}
},
"format": {
- "meta": {
- },
- "attribute": {
- }
+ "meta": {},
+ "attribute": {}
},
"constraints": {
- "meta": {
- },
- "attribute": {
- }
+ "meta": {},
+ "attribute": {}
},
"label": {
"asset": {
"ElectricityProducerSolarAsset": "PV solar asset",
"ElectricityProducerWindAsset": "Wind turbine asset"
},
- "meta": {
- },
- "attribute": {
- },
- "value": {
- }
+ "meta": {},
+ "attribute": {},
+ "value": {}
},
"metaOverrides": {
- "label": {
- }
+ "label": {}
},
"attributeOverrides": {
- "label": {
- }
+ "label": {}
},
"addMetaItems": "إضافة عنصر الإعدادات",
"loseChanges": "تجاهل التغييرات؟",
@@ -389,14 +376,14 @@
"description": "Protocol for connecting to a KNX"
}
},
- "validityType":"نوع الجدولة الزمنية",
- "validityAlways":"فعال بشكل دائم",
- "validityPeriod":"تخطيط للحادث",
- "validityRecurrence":"تخطيط لحدث متكرر",
+ "validityType": "نوع الجدولة الزمنية",
+ "validityAlways": "فعال بشكل دائم",
+ "validityPeriod": "تخطيط للحادث",
+ "validityRecurrence": "تخطيط لحدث متكرر",
"activeFromTo": "فعال من {{start}} إلى {{end}}",
- "fromTo":"من {{start}} إلى {{end}}",
- "fromToDays":"من {{start}} إلى {{days}} يوم لاحق {{end}}",
- "forDays":"من أجل {{days}} days",
+ "fromTo": "من {{start}} إلى {{end}}",
+ "fromToDays": "من {{start}} إلى {{days}} يوم لاحق {{end}}",
+ "forDays": "من أجل {{days}} days",
"scheduleRuleActivity": "جدولة نشاط الإجراء",
"allDay": "كل اليوم",
"apply": "تطبيق",
@@ -409,8 +396,7 @@
"dismiss": "رفض",
"createAssetFailed": " فشل في إنشاء المكون ",
"moveAssetFailed": "Failed to move asset",
- "logCategory": {
- },
+ "logCategory": {},
"readPermissions": "صلاحيات القراءة",
"writePermissions": "صلاحيات الكتابة",
"valueType": "نوع القيمة",
@@ -422,5 +408,135 @@
"attributeLabel": "Attribute",
"attributeValueLabel": "Attribute value",
"assetTypeDoesNotExist": "Filter : Asset type does not exist"
+ },
+ "org": {
+ "openremote": {
+ "model": {
+ "query": {
+ "filter": {
+ "ValueEmptyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RadialGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ValueAnyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "CalendarEventPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RectangularGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ArrayPredicate": {
+ "description": ""
+ },
+ "StringPredicate": {
+ "description": ""
+ },
+ "NumberPredicate": {
+ "description": ""
+ },
+ "DateTimePredicate": {
+ "description": ""
+ },
+ "BooleanPredicate": {
+ "description": ""
+ }
+ }
+ },
+ "simulator": {
+ "SimulatorReplayDatapoint": {
+ "label": ""
+ }
+ },
+ "value": {
+ "MathExpressionValueFilter": {
+ "label": ""
+ },
+ "SubStringValueFilter": {
+ "label": ""
+ },
+ "JsonPathFilter": {
+ "label": ""
+ },
+ "RegexValueFilter": {
+ "label": ""
+ },
+ "ValueConstraint": {
+ "description": "",
+ "Size": {
+ "description": ""
+ },
+ "Min": {
+ "description": ""
+ },
+ "Max": {
+ "description": ""
+ },
+ "Pattern": {
+ "description": ""
+ },
+ "AllowedValues": {
+ "description": ""
+ },
+ "Past": {
+ "description": ""
+ },
+ "PastOrPresent": {
+ "description": ""
+ },
+ "Future": {
+ "description": ""
+ },
+ "FutureOrPresent": {
+ "description": ""
+ },
+ "NotEmpty": {
+ "description": ""
+ },
+ "NotBlank": {
+ "description": ""
+ },
+ "NotNull": {
+ "description": ""
+ }
+ }
+ },
+ "asset": {
+ "agent": {
+ "AgentLink": {
+ "valueFilters": {
+ "description": ""
+ },
+ "valueConverter": {
+ "description": ""
+ },
+ "writeValueConverter": {
+ "description": ""
+ },
+ "writeValue": {
+ "description": ""
+ },
+ "messageMatchPredicate": {
+ "description": ""
+ },
+ "messageMatchFilters": {
+ "description": ""
+ },
+ "updateOnWrite": {
+ "description": ""
+ }
+ }
+ }
+ }
+ }
+ }
}
}
diff --git a/ui/app/shared/locales/cn/or.json b/ui/app/shared/locales/cn/or.json
index 052b6c489..9c8d0cf45 100644
--- a/ui/app/shared/locales/cn/or.json
+++ b/ui/app/shared/locales/cn/or.json
@@ -135,13 +135,13 @@
"TEXT_SWITCH": "文本逻辑",
"ROUND_NODE": "四舍五入",
"LOG_OUTPUT": "Write to Logs",
- "DERIVATIVE": "Attribute derivative",
+ "DERIVATIVE": "Attribute derivative",
"INTEGRAL": "Attribute integral",
"HISTORIC_VALUE": "Attribute history",
"MAX_PROCESSOR": "Maximum",
- "MIN_PROCESSOR": "Minimum",
- "AVERAGE_PROCESSOR": "Average",
- "MEDIAN_PROCESSOR": "Median",
+ "MIN_PROCESSOR": "Minimum",
+ "AVERAGE_PROCESSOR": "Average",
+ "MEDIAN_PROCESSOR": "Median",
"SUM_OPERATOR": "Sum",
"max": "Max",
"min": "Min",
@@ -225,10 +225,10 @@
"buttonTextConfirm": "确认按键文本",
"buttonTextDecline": "拒绝按键文本",
"custom": "自定义参数",
- "realm": "租户",
- "realm_plural": "租户",
- "displayName":"昵称",
- "deleteRealmConfirm":"您确定你要删除该产所吗?",
+ "realm": "场所",
+ "realm_plural": "场所",
+ "displayName": "昵称",
+ "deleteRealmConfirm": "您确定你要删除该产所吗?",
"user_plural": "用户",
"regularUser_plural": "普通用户",
"serviceUser_plural": "服务用户",
@@ -236,12 +236,12 @@
"role": "角色",
"role_plural": "角色",
"description": "描述",
- "passwordMismatch":"密码错误",
- "username":"用户名",
- "firstName":"名",
- "surname":"姓",
- "deleteUserConfirm":"您确认要删除该用户吗?",
- "deleteRoleConfirm":"您确认要删除该策略吗?",
+ "passwordMismatch": "密码错误",
+ "username": "用户名",
+ "firstName": "名",
+ "surname": "姓",
+ "deleteUserConfirm": "您确认要删除该用户吗?",
+ "deleteRoleConfirm": "您确认要删除该策略吗?",
"realmRules": "场所",
"globalRules": "全局",
"recipients": "收件人",
@@ -258,8 +258,6 @@
"secured": "安全",
"clientSecret": "客户端密钥",
"clientId": "客户端标识",
- "realm": "场所",
- "realm_plural": "场所",
"port": "端口",
"host": "主机名",
"errorOccurred": "出现错误",
@@ -286,8 +284,8 @@
"resetPasswordConfirmation": "已发送电子邮件重置您的密码。",
"repeatPassword": "重复密码",
"details": "Details",
- "permissions":"权限",
- "fullAccessLabel":"管理员: 完整权限,管理用户与角色",
+ "permissions": "权限",
+ "fullAccessLabel": "管理员: 完整权限,管理用户与角色",
"noChildAssets": "没有下属子资源",
"account": "账号",
"editAttribute": "改变参数",
@@ -361,42 +359,31 @@
"hertz": "Hz",
"rpm": "rpm",
"carbon": "CO2",
- "meta": {
- },
- "attribute": {
- }
+ "meta": {},
+ "attribute": {}
},
"format": {
- "meta": {
- },
- "attribute": {
- }
+ "meta": {},
+ "attribute": {}
},
"constraints": {
- "meta": {
- },
- "attribute": {
- }
+ "meta": {},
+ "attribute": {}
},
"label": {
"asset": {
"ElectricityProducerSolarAsset": "PV solar asset",
"ElectricityProducerWindAsset": "Wind turbine asset"
},
- "meta": {
- },
- "attribute": {
- },
- "value": {
- }
+ "meta": {},
+ "attribute": {},
+ "value": {}
},
"metaOverrides": {
- "label": {
- }
+ "label": {}
},
"attributeOverrides": {
- "label": {
- }
+ "label": {}
},
"addMetaItems": "添加配置项目",
"loseChanges": "放弃变更?",
@@ -411,14 +398,14 @@
"description": "连接KNX的协议"
}
},
- "validityType":"日程类型",
- "validityAlways":"总是激活",
- "validityPeriod":"计划一个事件",
- "validityRecurrence":"计划一个重复事件",
+ "validityType": "日程类型",
+ "validityAlways": "总是激活",
+ "validityPeriod": "计划一个事件",
+ "validityRecurrence": "计划一个重复事件",
"activeFromTo": "在 {{start}} 到 {{end}} 之间激活",
- "fromTo":"从 {{start}} 到 {{end}}",
- "fromToDays":"从 {{start}} 到 {{end}} 后 {{days}} 天",
- "forDays":"持续 {{days}} 天",
+ "fromTo": "从 {{start}} 到 {{end}}",
+ "fromToDays": "从 {{start}} 到 {{end}} 后 {{days}} 天",
+ "forDays": "持续 {{days}} 天",
"scheduleRuleActivity": "安排定时策略",
"allDay": "全天",
"apply": "应用",
@@ -431,8 +418,7 @@
"dismiss": "忽略",
"createAssetFailed": "创建资源失败",
"moveAssetFailed": "Failed to move asset",
- "logCategory": {
- },
+ "logCategory": {},
"readPermissions": "读权限",
"writePermissions": "写权限",
"valueType": "值类型",
@@ -471,5 +457,135 @@
"attributeLabel": "Attribute",
"attributeValueLabel": "Attribute value",
"assetTypeDoesNotExist": "Filter : Asset type does not exist"
+ },
+ "org": {
+ "openremote": {
+ "model": {
+ "query": {
+ "filter": {
+ "ValueEmptyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RadialGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ValueAnyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "CalendarEventPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RectangularGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ArrayPredicate": {
+ "description": ""
+ },
+ "StringPredicate": {
+ "description": ""
+ },
+ "NumberPredicate": {
+ "description": ""
+ },
+ "DateTimePredicate": {
+ "description": ""
+ },
+ "BooleanPredicate": {
+ "description": ""
+ }
+ }
+ },
+ "simulator": {
+ "SimulatorReplayDatapoint": {
+ "label": ""
+ }
+ },
+ "value": {
+ "MathExpressionValueFilter": {
+ "label": ""
+ },
+ "SubStringValueFilter": {
+ "label": ""
+ },
+ "JsonPathFilter": {
+ "label": ""
+ },
+ "RegexValueFilter": {
+ "label": ""
+ },
+ "ValueConstraint": {
+ "description": "",
+ "Size": {
+ "description": ""
+ },
+ "Min": {
+ "description": ""
+ },
+ "Max": {
+ "description": ""
+ },
+ "Pattern": {
+ "description": ""
+ },
+ "AllowedValues": {
+ "description": ""
+ },
+ "Past": {
+ "description": ""
+ },
+ "PastOrPresent": {
+ "description": ""
+ },
+ "Future": {
+ "description": ""
+ },
+ "FutureOrPresent": {
+ "description": ""
+ },
+ "NotEmpty": {
+ "description": ""
+ },
+ "NotBlank": {
+ "description": ""
+ },
+ "NotNull": {
+ "description": ""
+ }
+ }
+ },
+ "asset": {
+ "agent": {
+ "AgentLink": {
+ "valueFilters": {
+ "description": ""
+ },
+ "valueConverter": {
+ "description": ""
+ },
+ "writeValueConverter": {
+ "description": ""
+ },
+ "writeValue": {
+ "description": ""
+ },
+ "messageMatchPredicate": {
+ "description": ""
+ },
+ "messageMatchFilters": {
+ "description": ""
+ },
+ "updateOnWrite": {
+ "description": ""
+ }
+ }
+ }
+ }
+ }
+ }
}
}
diff --git a/ui/app/shared/locales/de/or.json b/ui/app/shared/locales/de/or.json
index e6c76aee5..d5f13b130 100644
--- a/ui/app/shared/locales/de/or.json
+++ b/ui/app/shared/locales/de/or.json
@@ -149,13 +149,13 @@
"TEXT_SWITCH": "Textueller Schalter",
"ROUND_NODE": "Runden",
"LOG_OUTPUT": "Write to Logs",
- "DERIVATIVE": "Attribute derivative",
+ "DERIVATIVE": "Attribute derivative",
"INTEGRAL": "Attribute integral",
"HISTORIC_VALUE": "Attribute history",
"MAX_PROCESSOR": "Maximum",
- "MIN_PROCESSOR": "Minimum",
- "AVERAGE_PROCESSOR": "Average",
- "MEDIAN_PROCESSOR": "Median",
+ "MIN_PROCESSOR": "Minimum",
+ "AVERAGE_PROCESSOR": "Average",
+ "MEDIAN_PROCESSOR": "Median",
"SUM_OPERATOR": "Sum",
"max": "Max",
"min": "Min",
@@ -303,14 +303,14 @@
"resetPasswordConfirmation": "Eine E-Mail zum Zurücksetzen Ihres Passworts wurde gesendet.",
"repeatPassword": "Passwort wiederholen",
"details": "Details",
- "permissions":"Berechtigungen",
- "linkedAssets":"Verbunden assets",
- "realm_role_plural":"Realm rollen",
- "manager_role_plural":"Manager rollen",
+ "permissions": "Berechtigungen",
+ "linkedAssets": "Verbunden assets",
+ "realm_role_plural": "Realm rollen",
+ "manager_role_plural": "Manager rollen",
"restrictAccess": "Zugriff einschränken",
"selectRestrictedAssets": "{{number}} Assets",
"restrictedAccessToAssets": "Eingeschränkter Zugriff auf",
- "fullAccessLabel":"Administrator: Vollzugriff; Benutzer und Rollen verwalten",
+ "fullAccessLabel": "Administrator: Vollzugriff; Benutzer und Rollen verwalten",
"noChildAssets": "Keine zugrunde liegenden Assets",
"account": "Account",
"editAttribute": "Attribut ändern",
@@ -479,7 +479,7 @@
"autoProvisioning": "Auto provisioning",
"provisioningConfigs": "Provisioning configurations",
"loadFailedProvisioningConfigs": "Failed to load provisioning configurations",
- "deleteProvisioningConfigConfirm":"Are you sure you want to delete this provisioning config?\nClients that use this config will no longer be able to connect.",
+ "deleteProvisioningConfigConfirm": "Are you sure you want to delete this provisioning config?\nClients that use this config will no longer be able to connect.",
"assetTemplate": "Asset template",
"createAsRestrictedUser": "Create restricted user",
"ignoreExpiryDate": "Ignore expiry date",
@@ -503,5 +503,135 @@
"attributeLabel": "Attribute",
"attributeValueLabel": "Attribute value",
"assetTypeDoesNotExist": "Filter : Asset type does not exist"
+ },
+ "org": {
+ "openremote": {
+ "model": {
+ "query": {
+ "filter": {
+ "ValueEmptyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RadialGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ValueAnyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "CalendarEventPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RectangularGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ArrayPredicate": {
+ "description": ""
+ },
+ "StringPredicate": {
+ "description": ""
+ },
+ "NumberPredicate": {
+ "description": ""
+ },
+ "DateTimePredicate": {
+ "description": ""
+ },
+ "BooleanPredicate": {
+ "description": ""
+ }
+ }
+ },
+ "simulator": {
+ "SimulatorReplayDatapoint": {
+ "label": ""
+ }
+ },
+ "value": {
+ "MathExpressionValueFilter": {
+ "label": ""
+ },
+ "SubStringValueFilter": {
+ "label": ""
+ },
+ "JsonPathFilter": {
+ "label": ""
+ },
+ "RegexValueFilter": {
+ "label": ""
+ },
+ "ValueConstraint": {
+ "description": "",
+ "Size": {
+ "description": ""
+ },
+ "Min": {
+ "description": ""
+ },
+ "Max": {
+ "description": ""
+ },
+ "Pattern": {
+ "description": ""
+ },
+ "AllowedValues": {
+ "description": ""
+ },
+ "Past": {
+ "description": ""
+ },
+ "PastOrPresent": {
+ "description": ""
+ },
+ "Future": {
+ "description": ""
+ },
+ "FutureOrPresent": {
+ "description": ""
+ },
+ "NotEmpty": {
+ "description": ""
+ },
+ "NotBlank": {
+ "description": ""
+ },
+ "NotNull": {
+ "description": ""
+ }
+ }
+ },
+ "asset": {
+ "agent": {
+ "AgentLink": {
+ "valueFilters": {
+ "description": ""
+ },
+ "valueConverter": {
+ "description": ""
+ },
+ "writeValueConverter": {
+ "description": ""
+ },
+ "writeValue": {
+ "description": ""
+ },
+ "messageMatchPredicate": {
+ "description": ""
+ },
+ "messageMatchFilters": {
+ "description": ""
+ },
+ "updateOnWrite": {
+ "description": ""
+ }
+ }
+ }
+ }
+ }
+ }
}
}
diff --git a/ui/app/shared/locales/en/or.json b/ui/app/shared/locales/en/or.json
index e1622a9d1..9163f2dc6 100644
--- a/ui/app/shared/locales/en/or.json
+++ b/ui/app/shared/locales/en/or.json
@@ -248,13 +248,13 @@
"TEXT_SWITCH": "Text switch",
"ROUND_NODE": "Round",
"LOG_OUTPUT": "Write to Logs",
- "DERIVATIVE": "Attribute derivative",
+ "DERIVATIVE": "Attribute derivative",
"INTEGRAL": "Attribute integral",
"HISTORIC_VALUE": "Attribute history",
"MAX_PROCESSOR": "Maximum",
- "MIN_PROCESSOR": "Minimum",
- "AVERAGE_PROCESSOR": "Average",
- "MEDIAN_PROCESSOR": "Median",
+ "MIN_PROCESSOR": "Minimum",
+ "AVERAGE_PROCESSOR": "Average",
+ "MEDIAN_PROCESSOR": "Median",
"SUM_OPERATOR": "Sum",
"max": "Max",
"min": "Min",
@@ -347,14 +347,14 @@
"realm": "Realm",
"realm_plural": "Realms",
"changeRealm": "Change realm",
- "displayName":"Friendly name",
+ "displayName": "Friendly name",
"loginTheme": "Login theme",
"emailTheme": "Email theme",
"resetPasswordAllowed": "Password reset allowed",
"resetPassword": "Reset Password",
"resetPasswordConfirmation": "An email has been sent to reset your password.",
- "rememberMe": "Remember me",
- "deleteRealmConfirm":"Are you sure you want to delete this Realm?",
+ "rememberMe": "Remember me",
+ "deleteRealmConfirm": "Are you sure you want to delete this Realm?",
"serviceUser": "Service user",
"user_plural": "Users",
"regularUser_plural": "Regular users",
@@ -370,16 +370,16 @@
"role": "Role",
"role_plural": "Roles",
"description": "Description",
- "passwordMismatch":"Passwords do not match",
+ "passwordMismatch": "Passwords do not match",
"twoFactorAuth": "Two Factor Authentication",
"twoFactorConfigure": "Configure",
- "username":"Username",
- "firstName":"First name",
- "surname":"Surname",
+ "username": "Username",
+ "firstName": "First name",
+ "surname": "Surname",
"deleteUser": "Delete user",
"deleteRole": "Delete role",
- "deleteUserConfirm":"Are you sure you want to delete the user '{{userName}}'?",
- "deleteRoleConfirm":"Are you sure you want to delete the role '{{roleName}}'?",
+ "deleteUserConfirm": "Are you sure you want to delete the user '{{userName}}'?",
+ "deleteRoleConfirm": "Are you sure you want to delete the role '{{roleName}}'?",
"realmRules": "Realm",
"globalRules": "Global",
"recipients": "Recipients",
@@ -476,14 +476,14 @@
"password-policy-not-username": "The password cannot be the username",
"password-policy-not-email": "The password cannot be the email address",
"details": "Details",
- "permissions":"Permissions",
- "linkedAssets":"Linked assets",
- "realm_role_plural":"Realm roles",
- "manager_role_plural":"Manager roles",
+ "permissions": "Permissions",
+ "linkedAssets": "Linked assets",
+ "realm_role_plural": "Realm roles",
+ "manager_role_plural": "Manager roles",
"restrictAccess": "Restrict access",
"selectRestrictedAssets": "{{number}} assets",
"restrictedAccessToAssets": "Restricted access to",
- "fullAccessLabel":"Admin: full access; manage users and roles",
+ "fullAccessLabel": "Admin: full access; manage users and roles",
"noChildAssets": "No child assets",
"account": "Account",
"editAttribute": "Change attribute",
@@ -609,14 +609,14 @@
"description": "Protocol for connecting to a KNX"
}
},
- "validityType":"Schedule type",
- "validityAlways":"Always active",
- "validityPeriod":"Plan an occurrence",
- "validityRecurrence":"Plan a repeating occurrence",
+ "validityType": "Schedule type",
+ "validityAlways": "Always active",
+ "validityPeriod": "Plan an occurrence",
+ "validityRecurrence": "Plan a repeating occurrence",
"activeFromTo": "Active from {{start}} to {{end}}",
- "fromTo":"From {{start}} to {{end}}",
- "fromToDays":"from {{start}} to {{days}} days later {{end}}",
- "forDays":"for {{days}} days",
+ "fromTo": "From {{start}} to {{end}}",
+ "fromToDays": "from {{start}} to {{days}} days later {{end}}",
+ "forDays": "for {{days}} days",
"scheduleRuleActivity": "Schedule Rule Activity",
"allDay": "All day",
"apply": "apply",
@@ -665,7 +665,7 @@
"autoProvisioning": "Auto provisioning",
"provisioningConfigs": "Provisioning configurations",
"loadFailedProvisioningConfigs": "Failed to load provisioning configurations",
- "deleteProvisioningConfigConfirm":"Are you sure you want to delete this provisioning config?\nClients that use this config will no longer be able to connect.",
+ "deleteProvisioningConfigConfirm": "Are you sure you want to delete this provisioning config?\nClients that use this config will no longer be able to connect.",
"assetTemplate": "Asset template",
"createAsRestrictedUser": "Create restricted user",
"ignoreExpiryDate": "Ignore expiry date",
@@ -729,9 +729,9 @@
"layout": "Layout",
"display": "Display",
"screen": "Screen",
- "uploadFile" : "Upload file",
- "fileSelected" : "File selected",
- "fileSaved" : "File saved",
+ "uploadFile": "Upload file",
+ "fileSelected": "File selected",
+ "fileSaved": "File saved",
"thresholds": "Thresholds",
"threshold": "Threshold",
"addInsights": "Add dashboard",
@@ -826,13 +826,13 @@
"default": "Default",
"appearance": "Appearance",
"configuration": {
- "" : "Appearance",
+ "": "Appearance",
"main": "Main",
"realmStyling": "Realm styling",
"managerConfigNotFound": "Manager configuration file could not be found.",
"mapSettingsNotFound": "Map configuration file could not be found.",
"tryAgain": "Try again",
- "addRealmCustomization" : "Add Realm Style",
+ "addRealmCustomization": "Add Realm Style",
"realmTitle": "Manager app title",
"realmMapSettingsTitle": "Realm Map Settings",
"defaultLanguage": "Default language",
@@ -849,16 +849,16 @@
"--or-app-color2": "Background: colour behind surface panels",
"--or-app-color3": "Text: page and panel titles",
"--or-app-color8": "Text on primary: text on items with the primary colour",
- "navigation" : "Navigation",
+ "navigation": "Navigation",
"navigationDescription": "Primary navigation is shown in the page header, secondary items can be found in the menu on the right.",
- "primaryNavigation" : "Primary menu",
- "secondaryNavigation" : "Secondary menu",
+ "primaryNavigation": "Primary menu",
+ "secondaryNavigation": "Secondary menu",
"notificationLanguages": "Notification languages",
"notificationLanguagesDesc": "Languages set here can be used in notifications to be sent to users with locale attribute set.",
"notificationLanguagesLabel": "Search other languages...",
- "reloadPage" : "To see the changes that have been made, reload the page",
+ "reloadPage": "To see the changes that have been made, reload the page",
"deleteRealmCustomization": "Delete Style",
- "deleteRealmCustomizationConfirm":"Are you sure you want to delete this Realm style?",
+ "deleteRealmCustomizationConfirm": "Are you sure you want to delete this Realm style?",
"mapBounds": "Boundaries",
"mapBoundsDescription": "Override the default bounds of the map",
"mapZoom": "Zoom",
@@ -869,8 +869,8 @@
"geoJson": "GeoJSON",
"geoJsonDescription": "Customize the GeoJSON; add points, lines and polygons to be drawn on the map.",
"deleteMapCustomization": "Delete map settings",
- "deleteMapCustomizationConfirm":"Are you sure you want to delete this Map customization?",
- "addMapCustomization" : "Add map settings",
+ "deleteMapCustomizationConfirm": "Are you sure you want to delete this Map customization?",
+ "addMapCustomization": "Add map settings",
"global": {
"reset": "Reset",
"import": "Import",
@@ -921,7 +921,7 @@
"alarm_plural": "Alarms",
"add": "Add Alarm",
"inactive_plural": "Inactive alarms",
- "active_plural" : "Active alarms",
+ "active_plural": "Active alarms",
"title": "Title",
"content": "Description",
"severity": "Severity",
@@ -974,5 +974,135 @@
"globalServicesLoadError": "Something went wrong while retrieving global services",
"noServices": "No services found, check the documentation on how to add services",
"iframeLoadError": "The selected service could not be loaded"
+ },
+ "org": {
+ "openremote": {
+ "model": {
+ "query": {
+ "filter": {
+ "ValueEmptyPredicate": {
+ "label": "Empty value",
+ "description": "Predicate that matches any empty/null value; unless negated."
+ },
+ "RadialGeofencePredicate": {
+ "label": "Radial geofence",
+ "description": "Predicate for GEO JSON point values; will return true if the point is within the specified radius of the specified latitude and longitude unless negated."
+ },
+ "ValueAnyPredicate": {
+ "label": "Any value",
+ "description": "Predicate that matches any value including null."
+ },
+ "CalendarEventPredicate": {
+ "label": "Calendar",
+ "description": "Predicate for calendar event values; will match based on whether the calendar event is active for the specified time."
+ },
+ "RectangularGeofencePredicate": {
+ "label": "Rectangular geofence",
+ "description": "Predicate for GEO JSON point values; will return true if the point is within the specified rectangle specified as latitude and longitude values of two corners unless negated."
+ },
+ "ArrayPredicate": {
+ "description": "Predicate for array values; will match based on configured options."
+ },
+ "StringPredicate": {
+ "description": "Predicate for string values; will match based on configured options."
+ },
+ "NumberPredicate": {
+ "description": "Predicate for number values; will match based on configured options."
+ },
+ "DateTimePredicate": {
+ "description": "Predicate for date time values; provided values should be valid ISO 8601 datetime strings (e.g. yyyy-MM-dd'T'HH:mm:ssZ or yyyy-MM-dd'T'HH:mm:ss±HH:mm), offset and time are optional, if no offset information is supplied then UTC is assumed."
+ },
+ "BooleanPredicate": {
+ "description": "Predicate for boolean values; will evaluate the value as a boolean and match against this predicates value, any value that is not a boolean will not match"
+ }
+ }
+ },
+ "simulator": {
+ "SimulatorReplayDatapoint": {
+ "label": "Data point"
+ }
+ },
+ "value": {
+ "MathExpressionValueFilter": {
+ "label": "Mathematical Expression"
+ },
+ "SubStringValueFilter": {
+ "label": "Substring"
+ },
+ "JsonPathFilter": {
+ "label": "JSON Path"
+ },
+ "RegexValueFilter": {
+ "label": "Regex"
+ },
+ "ValueConstraint": {
+ "description": "The constraints must be a JSON compatible list of objects.",
+ "Size": {
+ "description": "The attribute value must be between the specified boundaries based on the `min` and `max` properties. Supported types are JSON compatible strings, arrays and objects. Null values are considered valid."
+ },
+ "Min": {
+ "description": "The attribute value must be a number higher or equal to the specified value on the `min` property. Null values are considered valid."
+ },
+ "Max": {
+ "description": "The attribute value must be a number lower or equal to the specified value on the `max` property. Null values are considered valid."
+ },
+ "Pattern": {
+ "description": "The attribute value must match the regular expression pattern described in the `regexp` property. The regular expression follows the Java regular expression conventions. Flags can be specified using the `flags` property with values: CASE_INSENSITIVE, MULTILINE, DOTALL, UNIX_LINES, UNICODE_CASE, CANON_EQ and COMMENTS. Null values are considered valid."
+ },
+ "AllowedValues": {
+ "description": "The attribute value must match any of the specified values in the `allowedValues` property. The associated input in the UI will change to a select input with the options specified in the `allowedValues` property. The `allowedValueNames` property accepts a list of names that replace the labels in the select input, if the `allowedValueNames` list matches the length of the `allowedValues` list otherwise it falls back to the `allowedValues` as labels. Null values are considered valid. If `allowedValues` is not specified or empty the constraint only accepts null values."
+ },
+ "Past": {
+ "description": "The attribute value must be a java time object, java date object, a string in ISO8601 format or a number representing epoch milliseconds; the value must represent a time in the past. Null values are considered valid."
+ },
+ "PastOrPresent": {
+ "description": "The attribute value must be a java time object, java date object, a string in ISO8601 format or a number representing epoch milliseconds; the value must represent a time in the past or present. Null values are considered valid."
+ },
+ "Future": {
+ "description": "The attribute value must be a java time object, java date object, a string in ISO8601 format or a number representing epoch milliseconds; the value must represent a time in the future. Null values are considered valid."
+ },
+ "FutureOrPresent": {
+ "description": "The attribute value must be a java time object, java date object, a string in ISO8601 format or a number representing epoch milliseconds; the value must represent a time in the future or present. Null values are considered valid."
+ },
+ "NotEmpty": {
+ "description": "The attribute value must not be null nor empty. Supported types are JSON compatible strings, arrays and objects which contain at least 1 character, item or property."
+ },
+ "NotBlank": {
+ "description": "The attribute value must not be null and must contain at least 1 non-whitespace character. Accepts strings."
+ },
+ "NotNull": {
+ "description": "The attribute value must not be null. Accepts any type."
+ }
+ }
+ },
+ "asset": {
+ "agent": {
+ "AgentLink": {
+ "valueFilters": {
+ "description": "Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"
+ },
+ "valueConverter": {
+ "description": "Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns 'ACTIVE'/'DISABLED' strings but you want to connect this to a Boolean attribute"
+ },
+ "writeValueConverter": {
+ "description": "Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"
+ },
+ "writeValue": {
+ "description": "String to be used for attribute writes and can contain dynamic placeholders to allow dynamic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"
+ },
+ "messageMatchPredicate": {
+ "description": "The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."
+ },
+ "messageMatchFilters": {
+ "description": "ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"
+ },
+ "updateOnWrite": {
+ "description": "Don't expect a response from the protocol just update the attribute immediately on write"
+ }
+ }
+ }
+ }
+ }
+ }
}
}
diff --git a/ui/app/shared/locales/es/or.json b/ui/app/shared/locales/es/or.json
index ade75d15d..3238c2ff4 100644
--- a/ui/app/shared/locales/es/or.json
+++ b/ui/app/shared/locales/es/or.json
@@ -136,13 +136,13 @@
"TEXT_SWITCH": "Interruptor de texto",
"ROUND_NODE": "Redondo",
"LOG_OUTPUT": "Write to Logs",
- "DERIVATIVE": "Attribute derivative",
+ "DERIVATIVE": "Attribute derivative",
"INTEGRAL": "Attribute integral",
"HISTORIC_VALUE": "Attribute history",
"MAX_PROCESSOR": "Maximum",
- "MIN_PROCESSOR": "Minimum",
- "AVERAGE_PROCESSOR": "Average",
- "MEDIAN_PROCESSOR": "Median",
+ "MIN_PROCESSOR": "Minimum",
+ "AVERAGE_PROCESSOR": "Average",
+ "MEDIAN_PROCESSOR": "Median",
"SUM_OPERATOR": "Sum",
"max": "Max",
"min": "Min",
@@ -230,8 +230,8 @@
"custom": "Entrada manual",
"realm": "Realm",
"realm_plural": "Realms",
- "displayName":"Nome amigable",
- "deleteRealmConfirm":"¿Estás seguro de que deseas eliminar este realms?",
+ "displayName": "Nome amigable",
+ "deleteRealmConfirm": "¿Estás seguro de que deseas eliminar este realms?",
"user_plural": "Usuarios",
"regularUser_plural": "Usuarios",
"serviceUser_plural": "Usuários do serviço",
@@ -241,10 +241,10 @@
"description": "Descripción",
"passwordMismatch": "Las contraseñas no coinciden",
"username": "Nombre de usuario",
- "firstName":"Primer nombre",
- "surname":"Apellido",
- "deleteUserConfirm":"¿Está seguro de que desea eliminar este usuario?",
- "deleteRoleConfirm":"¿Está seguro de que desea eliminar este función?",
+ "firstName": "Primer nombre",
+ "surname": "Apellido",
+ "deleteUserConfirm": "¿Está seguro de que desea eliminar este usuario?",
+ "deleteRoleConfirm": "¿Está seguro de que desea eliminar este función?",
"realmRules": "Realm",
"globalRules": "Global",
"recipients": "Destinatarios",
@@ -362,42 +362,31 @@
"hertz": "Hz",
"rpm": "rpm",
"carbon": "CO2",
- "meta": {
- },
- "attribute": {
- }
+ "meta": {},
+ "attribute": {}
},
"format": {
- "meta": {
- },
- "attribute": {
- }
+ "meta": {},
+ "attribute": {}
},
"constraints": {
- "meta": {
- },
- "attribute": {
- }
+ "meta": {},
+ "attribute": {}
},
"label": {
"asset": {
"ElectricityProducerSolarAsset": "Activo solar fotovoltaico",
"ElectricityProducerWindAsset": "Activo de turbina eólica"
},
- "meta": {
- },
- "attribute": {
- },
- "value": {
- }
+ "meta": {},
+ "attribute": {},
+ "value": {}
},
"metaOverrides": {
- "label": {
- }
+ "label": {}
},
"attributeOverrides": {
- "label": {
- }
+ "label": {}
},
"addMetaItems": "Agregar elementos de configuración",
"loseChanges": "¿Descartar los cambios?",
@@ -419,7 +408,7 @@
"activeFromTo": "Activo desde {{start}} a {{end}}",
"fromTo": "Desde {{start}} a {{end}}",
"fromToDays": "De {{start}} a {{days}} días después {{end}}",
- "forDays":"por {{days}} dias",
+ "forDays": "por {{days}} dias",
"scheduleRuleActivity": "Programar Actividad de la regla",
"allDay": "Todo el dia",
"apply": "aplicar",
@@ -432,8 +421,7 @@
"dismiss": "despedir",
"createAssetFailed": "No se pudo crear el activo",
"moveAssetFailed": "Failed to move asset",
- "logCategory": {
- },
+ "logCategory": {},
"readPermissions": "Leer permisos",
"writePermissions": "Permisos de escritura",
"valueType": "Tipo de valor",
@@ -472,5 +460,135 @@
"attributeLabel": "Attribute",
"attributeValueLabel": "Attribute value",
"assetTypeDoesNotExist": "Filter : Asset type does not exist"
+ },
+ "org": {
+ "openremote": {
+ "model": {
+ "query": {
+ "filter": {
+ "ValueEmptyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RadialGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ValueAnyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "CalendarEventPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RectangularGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ArrayPredicate": {
+ "description": ""
+ },
+ "StringPredicate": {
+ "description": ""
+ },
+ "NumberPredicate": {
+ "description": ""
+ },
+ "DateTimePredicate": {
+ "description": ""
+ },
+ "BooleanPredicate": {
+ "description": ""
+ }
+ }
+ },
+ "simulator": {
+ "SimulatorReplayDatapoint": {
+ "label": ""
+ }
+ },
+ "value": {
+ "MathExpressionValueFilter": {
+ "label": ""
+ },
+ "SubStringValueFilter": {
+ "label": ""
+ },
+ "JsonPathFilter": {
+ "label": ""
+ },
+ "RegexValueFilter": {
+ "label": ""
+ },
+ "ValueConstraint": {
+ "description": "",
+ "Size": {
+ "description": ""
+ },
+ "Min": {
+ "description": ""
+ },
+ "Max": {
+ "description": ""
+ },
+ "Pattern": {
+ "description": ""
+ },
+ "AllowedValues": {
+ "description": ""
+ },
+ "Past": {
+ "description": ""
+ },
+ "PastOrPresent": {
+ "description": ""
+ },
+ "Future": {
+ "description": ""
+ },
+ "FutureOrPresent": {
+ "description": ""
+ },
+ "NotEmpty": {
+ "description": ""
+ },
+ "NotBlank": {
+ "description": ""
+ },
+ "NotNull": {
+ "description": ""
+ }
+ }
+ },
+ "asset": {
+ "agent": {
+ "AgentLink": {
+ "valueFilters": {
+ "description": ""
+ },
+ "valueConverter": {
+ "description": ""
+ },
+ "writeValueConverter": {
+ "description": ""
+ },
+ "writeValue": {
+ "description": ""
+ },
+ "messageMatchPredicate": {
+ "description": ""
+ },
+ "messageMatchFilters": {
+ "description": ""
+ },
+ "updateOnWrite": {
+ "description": ""
+ }
+ }
+ }
+ }
+ }
+ }
}
}
diff --git a/ui/app/shared/locales/fr/or.json b/ui/app/shared/locales/fr/or.json
index 3e720d094..9b9bd18d8 100644
--- a/ui/app/shared/locales/fr/or.json
+++ b/ui/app/shared/locales/fr/or.json
@@ -136,13 +136,13 @@
"TEXT_SWITCH": "Commutateur de texte",
"ROUND_NODE": "Arrondir",
"LOG_OUTPUT": "Write to Logs",
- "DERIVATIVE": "Attribute derivative",
+ "DERIVATIVE": "Attribute derivative",
"INTEGRAL": "Attribute integral",
"HISTORIC_VALUE": "Attribute history",
"MAX_PROCESSOR": "Maximum",
- "MIN_PROCESSOR": "Minimum",
- "AVERAGE_PROCESSOR": "Average",
- "MEDIAN_PROCESSOR": "Median",
+ "MIN_PROCESSOR": "Minimum",
+ "AVERAGE_PROCESSOR": "Average",
+ "MEDIAN_PROCESSOR": "Median",
"SUM_OPERATOR": "Sum",
"max": "Max",
"min": "Min",
@@ -230,8 +230,8 @@
"custom": "Saisie manuelle",
"realm": "Locataire",
"realm_plural": "Locataires",
- "displayName":"Nom familier",
- "deleteRealmConfirm":"Êtes-vous sûr de vouloir supprimer ce realm?",
+ "displayName": "Nom familier",
+ "deleteRealmConfirm": "Êtes-vous sûr de vouloir supprimer ce realm?",
"user_plural": "Utilisateurs",
"regularUser_plural": "Utilisateurs",
"serviceUser_plural": "Utilisateurs de services",
@@ -239,12 +239,12 @@
"role": "Rôle",
"role_plural": "Les rôles",
"description": "La description",
- "passwordMismatch":"Les mots de passe ne correspondent pas",
- "username":"Nom d'utilisateur",
- "firstName":"Prénom",
- "surname":"Nom de famille",
- "deleteUserConfirm":"Êtes-vous sûr de vouloir supprimer cet utilisateur?",
- "deleteRoleConfirm":"Voulez-vous vraiment supprimer ce rôle?",
+ "passwordMismatch": "Les mots de passe ne correspondent pas",
+ "username": "Nom d'utilisateur",
+ "firstName": "Prénom",
+ "surname": "Nom de famille",
+ "deleteUserConfirm": "Êtes-vous sûr de vouloir supprimer cet utilisateur?",
+ "deleteRoleConfirm": "Voulez-vous vraiment supprimer ce rôle?",
"realmRules": "Realm",
"globalRules": "Global",
"recipients": "Destinataires",
@@ -287,8 +287,8 @@
"resetPasswordConfirmation": "Un e-mail a été envoyé pour réinitialiser votre mot de passe.",
"repeatPassword": "Répéter le mot de passe",
"details": "Des détails",
- "permissions":"Autorisations",
- "fullAccessLabel":"Admin: accès complet ; gérer les utilisateurs et les rôles",
+ "permissions": "Autorisations",
+ "fullAccessLabel": "Admin: accès complet ; gérer les utilisateurs et les rôles",
"noChildAssets": "Aucune ressource enfant",
"account": "Compte",
"editAttribute": "Modifier l'attribut",
@@ -362,42 +362,31 @@
"hertz": "Hz",
"rpm": "tr/min",
"carbon": "CO2",
- "meta": {
- },
- "attribute": {
- }
+ "meta": {},
+ "attribute": {}
},
"format": {
- "meta": {
- },
- "attribute": {
- }
+ "meta": {},
+ "attribute": {}
},
"constraints": {
- "meta": {
- },
- "attribute": {
- }
+ "meta": {},
+ "attribute": {}
},
"label": {
"asset": {
"ElectricityProducerSolarAsset": "Ressource solaire PV",
"ElectricityProducerWindAsset": "Ressource éolienne"
},
- "meta": {
- },
- "attribute": {
- },
- "value": {
- }
+ "meta": {},
+ "attribute": {},
+ "value": {}
},
"metaOverrides": {
- "label": {
- }
+ "label": {}
},
"attributeOverrides": {
- "label": {
- }
+ "label": {}
},
"addMetaItems": "Ajouter des éléments de configuration",
"loseChanges": "Annuler les modifications?",
@@ -419,7 +408,7 @@
"activeFromTo": "Actif du {{start}} au {{end}}",
"fromTo": "Du {{start}} au {{end}}",
"fromToDays": "de {{start}} à {{days}} jours plus tard {{end}}",
- "forDays":"pour {{days}} jours",
+ "forDays": "pour {{days}} jours",
"scheduleRuleActivity": "Planifier l'activité de la règle",
"allDay": "Toute la journée",
"apply": "appliquer",
@@ -432,8 +421,7 @@
"dismiss": "rejeter",
"createAssetFailed": "Impossible de créer la ressource",
"moveAssetFailed": "Impossible de déplacer la ressource",
- "logCategory": {
- },
+ "logCategory": {},
"readPermissions": "Autorisations de lire",
"writePermissions": "Autorisations d'écrire",
"valueType": "Type de valeur",
@@ -472,5 +460,135 @@
"attributeLabel": "Attribute",
"attributeValueLabel": "Attribute value",
"assetTypeDoesNotExist": "Filter : Asset type does not exist"
+ },
+ "org": {
+ "openremote": {
+ "model": {
+ "query": {
+ "filter": {
+ "ValueEmptyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RadialGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ValueAnyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "CalendarEventPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RectangularGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ArrayPredicate": {
+ "description": ""
+ },
+ "StringPredicate": {
+ "description": ""
+ },
+ "NumberPredicate": {
+ "description": ""
+ },
+ "DateTimePredicate": {
+ "description": ""
+ },
+ "BooleanPredicate": {
+ "description": ""
+ }
+ }
+ },
+ "simulator": {
+ "SimulatorReplayDatapoint": {
+ "label": ""
+ }
+ },
+ "value": {
+ "MathExpressionValueFilter": {
+ "label": ""
+ },
+ "SubStringValueFilter": {
+ "label": ""
+ },
+ "JsonPathFilter": {
+ "label": ""
+ },
+ "RegexValueFilter": {
+ "label": ""
+ },
+ "ValueConstraint": {
+ "description": "",
+ "Size": {
+ "description": ""
+ },
+ "Min": {
+ "description": ""
+ },
+ "Max": {
+ "description": ""
+ },
+ "Pattern": {
+ "description": ""
+ },
+ "AllowedValues": {
+ "description": ""
+ },
+ "Past": {
+ "description": ""
+ },
+ "PastOrPresent": {
+ "description": ""
+ },
+ "Future": {
+ "description": ""
+ },
+ "FutureOrPresent": {
+ "description": ""
+ },
+ "NotEmpty": {
+ "description": ""
+ },
+ "NotBlank": {
+ "description": ""
+ },
+ "NotNull": {
+ "description": ""
+ }
+ }
+ },
+ "asset": {
+ "agent": {
+ "AgentLink": {
+ "valueFilters": {
+ "description": ""
+ },
+ "valueConverter": {
+ "description": ""
+ },
+ "writeValueConverter": {
+ "description": ""
+ },
+ "writeValue": {
+ "description": ""
+ },
+ "messageMatchPredicate": {
+ "description": ""
+ },
+ "messageMatchFilters": {
+ "description": ""
+ },
+ "updateOnWrite": {
+ "description": ""
+ }
+ }
+ }
+ }
+ }
+ }
}
}
diff --git a/ui/app/shared/locales/it/or.json b/ui/app/shared/locales/it/or.json
index e3a463e18..0e558d7f7 100644
--- a/ui/app/shared/locales/it/or.json
+++ b/ui/app/shared/locales/it/or.json
@@ -135,13 +135,13 @@
"TEXT_SWITCH": "Text switch",
"ROUND_NODE": "Rotondo",
"LOG_OUTPUT": "Write to Logs",
- "DERIVATIVE": "Attribute derivative",
+ "DERIVATIVE": "Attribute derivative",
"INTEGRAL": "Attribute integral",
"HISTORIC_VALUE": "Attribute history",
"MAX_PROCESSOR": "Maximum",
- "MIN_PROCESSOR": "Minimum",
- "AVERAGE_PROCESSOR": "Average",
- "MEDIAN_PROCESSOR": "Median",
+ "MIN_PROCESSOR": "Minimum",
+ "AVERAGE_PROCESSOR": "Average",
+ "MEDIAN_PROCESSOR": "Median",
"SUM_OPERATOR": "Sum",
"max": "Max",
"min": "Min",
@@ -225,8 +225,8 @@
"buttonTextConfirm": "Testo per il pulsante di azione",
"buttonTextDecline": "Testo per il pulsante di rifiuto",
"custom": "Attributo personalizzato",
- "displayName":"Nome amico",
- "deleteRealmConfirm":"Sei sicuro di voler cancellare questo Regno??",
+ "displayName": "Nome amico",
+ "deleteRealmConfirm": "Sei sicuro di voler cancellare questo Regno??",
"user_plural": "Utenti",
"regularUser_plural": "Utenti",
"serviceUser_plural": "Utenti del servizio",
@@ -234,12 +234,12 @@
"role": "Ruolo",
"role_plural": "Ruoli",
"description": "Descrizione",
- "passwordMismatch":"Le password non corrispondono",
- "username":"Nome utente",
- "firstName":"Nome",
- "surname":"Cognome",
- "deleteUserConfirm":"Sei sicuro di voler cancellare questo utente?",
- "deleteRoleConfirm":"Sei sicuro di voler cancellare questo ruolo?",
+ "passwordMismatch": "Le password non corrispondono",
+ "username": "Nome utente",
+ "firstName": "Nome",
+ "surname": "Cognome",
+ "deleteUserConfirm": "Sei sicuro di voler cancellare questo utente?",
+ "deleteRoleConfirm": "Sei sicuro di voler cancellare questo ruolo?",
"realmRules": "Regno",
"globalRules": "Globale",
"recipients": "Destinatari",
@@ -284,7 +284,7 @@
"resetPasswordConfirmation": "È stata inviata un'email per reimpostare la password.",
"repeatPassword": "Ripeti password",
"details": "Particolari",
- "permissions":"Permessi",
+ "permissions": "Permessi",
"fullAccessLabel": "Amministratore: accesso completo; gestire utenti e ruoli",
"noChildAssets": "Nessun asset del figlio",
"account": "Account",
@@ -359,42 +359,31 @@
"hertz": "Hz",
"rpm": "rpm",
"carbon": "CO2",
- "meta": {
- },
- "attribute": {
- }
+ "meta": {},
+ "attribute": {}
},
"format": {
- "meta": {
- },
- "attribute": {
- }
+ "meta": {},
+ "attribute": {}
},
"constraints": {
- "meta": {
- },
- "attribute": {
- }
+ "meta": {},
+ "attribute": {}
},
"label": {
"asset": {
"ElectricityProducerSolarAsset": "Asset solare fotovoltaica",
"ElectricityProducerWindAsset": "Asset turbina eolica"
},
- "meta": {
- },
- "attribute": {
- },
- "value": {
- }
+ "meta": {},
+ "attribute": {},
+ "value": {}
},
"metaOverrides": {
- "label": {
- }
+ "label": {}
},
"attributeOverrides": {
- "label": {
- }
+ "label": {}
},
"addMetaItems": "Aggiungere elementi di configurazione",
"loseChanges": "Scartare le modifiche?",
@@ -409,14 +398,14 @@
"description": "Protocollo per la connessione a un KNX"
}
},
- "validityType":"Tipo di programma",
- "validityAlways":"Sempre attivo",
- "validityPeriod":"Pianifica un'occorrenza",
- "validityRecurrence":"Pianifica un'occorrenza che si ripete",
+ "validityType": "Tipo di programma",
+ "validityAlways": "Sempre attivo",
+ "validityPeriod": "Pianifica un'occorrenza",
+ "validityRecurrence": "Pianifica un'occorrenza che si ripete",
"activeFromTo": "Attivo da {{start}} a {{end}}",
- "fromTo":"Da {{start}} a {{end}}",
- "fromToDays":"da {{start}} a {{days}} giorni dopo{{end}}",
- "forDays":"per {{days}} giorni",
+ "fromTo": "Da {{start}} a {{end}}",
+ "fromToDays": "da {{start}} a {{days}} giorni dopo{{end}}",
+ "forDays": "per {{days}} giorni",
"scheduleRuleActivity": "Programmare l'attività delle regole",
"allDay": "Tutto il giorno",
"apply": "applica",
@@ -429,8 +418,7 @@
"dismiss": "dismiss",
"createAssetFailed": "Fallita la creazione del asset",
"moveAssetFailed": "Failed to move asset",
- "logCategory": {
- },
+ "logCategory": {},
"readPermissions": "Leggi permessi",
"writePermissions": "Scrivi permessi",
"valueType": "Tipo di valore",
@@ -469,5 +457,135 @@
"attributeLabel": "Attribute",
"attributeValueLabel": "Attribute value",
"assetTypeDoesNotExist": "Filter : Asset type does not exist"
+ },
+ "org": {
+ "openremote": {
+ "model": {
+ "query": {
+ "filter": {
+ "ValueEmptyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RadialGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ValueAnyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "CalendarEventPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RectangularGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ArrayPredicate": {
+ "description": ""
+ },
+ "StringPredicate": {
+ "description": ""
+ },
+ "NumberPredicate": {
+ "description": ""
+ },
+ "DateTimePredicate": {
+ "description": ""
+ },
+ "BooleanPredicate": {
+ "description": ""
+ }
+ }
+ },
+ "simulator": {
+ "SimulatorReplayDatapoint": {
+ "label": ""
+ }
+ },
+ "value": {
+ "MathExpressionValueFilter": {
+ "label": ""
+ },
+ "SubStringValueFilter": {
+ "label": ""
+ },
+ "JsonPathFilter": {
+ "label": ""
+ },
+ "RegexValueFilter": {
+ "label": ""
+ },
+ "ValueConstraint": {
+ "description": "",
+ "Size": {
+ "description": ""
+ },
+ "Min": {
+ "description": ""
+ },
+ "Max": {
+ "description": ""
+ },
+ "Pattern": {
+ "description": ""
+ },
+ "AllowedValues": {
+ "description": ""
+ },
+ "Past": {
+ "description": ""
+ },
+ "PastOrPresent": {
+ "description": ""
+ },
+ "Future": {
+ "description": ""
+ },
+ "FutureOrPresent": {
+ "description": ""
+ },
+ "NotEmpty": {
+ "description": ""
+ },
+ "NotBlank": {
+ "description": ""
+ },
+ "NotNull": {
+ "description": ""
+ }
+ }
+ },
+ "asset": {
+ "agent": {
+ "AgentLink": {
+ "valueFilters": {
+ "description": ""
+ },
+ "valueConverter": {
+ "description": ""
+ },
+ "writeValueConverter": {
+ "description": ""
+ },
+ "writeValue": {
+ "description": ""
+ },
+ "messageMatchPredicate": {
+ "description": ""
+ },
+ "messageMatchFilters": {
+ "description": ""
+ },
+ "updateOnWrite": {
+ "description": ""
+ }
+ }
+ }
+ }
+ }
+ }
}
}
diff --git a/ui/app/shared/locales/nl/or.json b/ui/app/shared/locales/nl/or.json
index 8d164ab9c..36d4ea19c 100644
--- a/ui/app/shared/locales/nl/or.json
+++ b/ui/app/shared/locales/nl/or.json
@@ -227,7 +227,7 @@
"fitView": "Pas beeld aan op project",
"areYouSure": "Weet je het zeker?",
"flowEditor": "Flow editor",
- "flow":{
+ "flow": {
"EQUALS_COMPARATOR": "Gelijk aan",
"GREATER_THAN": "Groter dan",
"LESS_THAN": "Kleiner dan",
@@ -248,13 +248,13 @@
"TEXT_SWITCH": "Tekst schakeling",
"ROUND_NODE": "Afronden",
"LOG_OUTPUT": "Naar logs schrijven",
- "DERIVATIVE": "Attribuut afgeleide",
+ "DERIVATIVE": "Attribuut afgeleide",
"INTEGRAL": "Attribuut integraal",
"HISTORIC_VALUE": "Attribuut geschiedenis",
"MAX_PROCESSOR": "Maximum",
- "MIN_PROCESSOR": "Minimum",
- "AVERAGE_PROCESSOR": "Gemiddelde",
- "MEDIAN_PROCESSOR": "Mediaan",
+ "MIN_PROCESSOR": "Minimum",
+ "AVERAGE_PROCESSOR": "Gemiddelde",
+ "MEDIAN_PROCESSOR": "Mediaan",
"SUM_OPERATOR": "Som",
"max": "Max",
"min": "Min",
@@ -347,14 +347,14 @@
"realm": "Realm",
"realm_plural": "Realms",
"changeRealm": "Verander realm",
- "displayName":"Vriendelijke naam",
+ "displayName": "Vriendelijke naam",
"loginTheme": "Login thema",
"emailTheme": "Email thema",
"resetPasswordAllowed": "Wachtwoord kan hersteld worden",
"resetPassword": "Wachtwoord herstellen",
"resetPasswordConfirmation": "Er is een e-mail verzonden om je wachtwoord te herstellen.",
"rememberMe": "Ingelogd blijven",
- "deleteRealmConfirm":"Weet je zeker dat je deze realm wil verwijderen?",
+ "deleteRealmConfirm": "Weet je zeker dat je deze realm wil verwijderen?",
"serviceUser": "Service gebruiker",
"user_plural": "Gebruikers",
"regularUser_plural": "Gebruikers",
@@ -370,16 +370,16 @@
"role": "Rol",
"role_plural": "Rollen",
"description": "Omschrijving",
- "username":"Gebruikersnaam",
+ "username": "Gebruikersnaam",
"deleteUser": "Gebruiker verwijderen",
"deleteRole": "Rol verwijderen",
- "deleteUserConfirm":"De gebruiker '{{userName}}' verwijderen?",
- "deleteRoleConfirm":"De rol '{{roleName}}' verwijderen?",
- "passwordMismatch":"Wachtwoorden komen niet overeen",
+ "deleteUserConfirm": "De gebruiker '{{userName}}' verwijderen?",
+ "deleteRoleConfirm": "De rol '{{roleName}}' verwijderen?",
+ "passwordMismatch": "Wachtwoorden komen niet overeen",
"twoFactorAuth": "Tweestapsverificatie",
"twoFactorConfigure": "Configureer",
- "firstName":"Voornaam",
- "surname":"Achternaam",
+ "firstName": "Voornaam",
+ "surname": "Achternaam",
"realmRules": "Realm",
"globalRules": "Globaal",
"recipients": "Ontvangers",
@@ -424,7 +424,7 @@
"selectAsset": "Selecteer gateway asset",
"closeSuccessful": "Tunnel gesloten",
"closesAt": "Sluit op",
- "offline": "Offline"
+ "offline": "Offline"
},
"tunnels": "tunnels",
"tunnel": "tunnel",
@@ -475,14 +475,14 @@
"password-policy-not-username": "Het wachtwoord mag niet de gebruikersnaam zijn",
"password-policy-not-email": "Het wachtwoord mag niet het emailadres zijn",
"details": "Details",
- "permissions":"Rechten",
- "linkedAssets":"Gekoppelde assets",
- "realm_role_plural":"Realm rollen",
- "manager_role_plural":"Manager rollen",
+ "permissions": "Rechten",
+ "linkedAssets": "Gekoppelde assets",
+ "realm_role_plural": "Realm rollen",
+ "manager_role_plural": "Manager rollen",
"restrictAccess": "Beperkte toegang",
"selectRestrictedAssets": "{{number}} assets",
"restrictedAccessToAssets": "Beperkte toegang tot",
- "fullAccessLabel":"Admin: volledige toegang; gebruikers en rollen beheren",
+ "fullAccessLabel": "Admin: volledige toegang; gebruikers en rollen beheren",
"noChildAssets": "Geen onderliggende assets",
"account": "Account",
"editAttribute": "Attribuut kiezen",
@@ -615,7 +615,7 @@
"activeFromTo": "Actief van {{start}} tot {{end}}",
"fromTo": "Van {{start}} tot {{end}}",
"fromToDays": "van {{start}} tot {{days}} dagen later {{end}}",
- "forDays":"voor {{days}} dagen",
+ "forDays": "voor {{days}} dagen",
"scheduleRuleActivity": "Regelplanner",
"allDay": "Hele dag",
"apply": "toepassen",
@@ -664,7 +664,7 @@
"autoProvisioning": "Auto provisioning",
"provisioningConfigs": "Provisioning configuraties",
"loadFailedProvisioningConfigs": "Provisioning configuraties ophalen mislukt",
- "deleteProvisioningConfigConfirm":"Weet je zeker dat je deze provisioning configuratie wil verwijderen?\nClients die deze configuratie gebruiken kunnen niet langer verbinden.",
+ "deleteProvisioningConfigConfirm": "Weet je zeker dat je deze provisioning configuratie wil verwijderen?\nClients die deze configuratie gebruiken kunnen niet langer verbinden.",
"assetTemplate": "Asset template",
"createAsRestrictedUser": "Gebruiker met beperkte toegang maken",
"ignoreExpiryDate": "Vervaldatum negeren",
@@ -694,8 +694,8 @@
"no": "Nee",
"linked": "Gelinkt",
"filter": {
- "close": "Filter sluiten",
- "open": "Filter openen",
+ "close": "Filter sluiten",
+ "open": "Filter openen",
"filter": "Filter",
"clear": "LEEGMAKEN",
"action": "FILTER",
@@ -708,7 +708,7 @@
},
"realmDeleteConfirm": "Let op! Hiermee verwijder je alles in deze realm, typ de realm naam '{{realmName}}' om te bevestigen.",
"realmDeleteFailed": "Realm verwijderen mislukt",
- "addRule": "Regel toevoegen",
+ "addRule": "Regel toevoegen",
"rulesetStatus": {
"DEPLOYED": "Succesvol aangemaakt",
"NOSTATUS": "Uitgeschakeld",
@@ -728,12 +728,12 @@
"layout": "Indeling",
"display": "Weergave",
"screen": "Scherm",
- "uploadFile" : "Uploaden bestand",
- "fileSelected" : "Bestand geselecteerd",
- "fileSaved" : "Bestand opgeslagen",
+ "uploadFile": "Uploaden bestand",
+ "fileSelected": "Bestand geselecteerd",
+ "fileSaved": "Bestand opgeslagen",
"thresholds": "Drempelwaardes",
"threshold": "Drempelwaarde",
- "addInsights": "Dashboard toevoegen",
+ "addInsights": "Dashboard toevoegen",
"noDashboardSelected": "Selecteer een dashboard aan de linkerkant",
"noDashboardSelected-mobile": "Selecteer een dashboard in het menu linksboven",
"noDashboardFound": "Geen dashboard gevonden.",
@@ -783,7 +783,7 @@
"setToMobilePreset": "Stel mobiel preset in",
"zoomPercent": "Zoom %",
"presetSize": "Voorbeeld grootte",
- "previewScreenSizes": "Preview schermformaten",
+ "previewScreenSizes": "Preview schermformaten",
"renderingGrid": "Grid aan het renderen...",
"deviceNotSupported": "Dit dashboard wordt niet ondersteund op dit apparaat.",
"deletePermanentWarning": "Dit zal {{dashboard}} permanent verwijderen.",
@@ -825,13 +825,13 @@
"default": "Standaard",
"appearance": "Weergave",
"configuration": {
- "" : "Weergave",
+ "": "Weergave",
"main": "Algemeen",
"realmStyling": "Realm stijl",
"managerConfigNotFound": "Kon bestand met manager configuratie niet vinden.",
"mapSettingsNotFound": "Kon bestand met kaart configuratie niet vinden.",
"tryAgain": "Probeer opnieuw",
- "addRealmCustomization" : "Voeg realm stijl toe",
+ "addRealmCustomization": "Voeg realm stijl toe",
"realmTitle": "Manager app titel",
"realmMapSettingsTitle": "Realm Kaart Stijl",
"defaultLanguage": "Standaard taal",
@@ -848,16 +848,16 @@
"--or-app-color2": "Achtergrond: kleur achter panelen met oppervlakkleur",
"--or-app-color3": "Tekst: pagina en panel titels",
"--or-app-color8": "Tekst op primair: tekst op onderdelen met de primaire kleur",
- "navigation" : "Navigatie",
+ "navigation": "Navigatie",
"navigationDescription": "De primaire navigatie staat in de header, secundaire items kun je in het menu rechtsboven vinden.",
"notificationLanguages": "Notificatie talen",
"notificationLanguagesDesc": "Talen die hier ingesteld zijn kunnen gebruikt worden in notificaties voor gebruikers die hun taal hebben ingesteld.",
"notificationLanguagesLabel": "Zoek naar andere talen...",
- "primaryNavigation" : "Primair menu",
- "secondaryNavigation" : "Secundair menu",
- "reloadPage" : "Om de wijzigingen te zien die gemaakt zijn, herlaad de pagina",
+ "primaryNavigation": "Primair menu",
+ "secondaryNavigation": "Secundair menu",
+ "reloadPage": "Om de wijzigingen te zien die gemaakt zijn, herlaad de pagina",
"deleteRealmCustomization": "Verwijder stijl",
- "deleteRealmCustomizationConfirm":"Weet je zeker dat je deze realm stijl wilt verwijderen?",
+ "deleteRealmCustomizationConfirm": "Weet je zeker dat je deze realm stijl wilt verwijderen?",
"mapBounds": "Randen",
"mapBoundsDescription": "Overschrijf de standaard kaders van de kaart",
"mapZoom": "Zoom",
@@ -868,8 +868,8 @@
"geoJson": "GeoJSON",
"geoJsonDescription": "Bewerk de GeoJSON; voeg punten, lijnen, en andere vormen toe aan de kaart.",
"deleteMapCustomization": "Kaartinstelling verwijderen",
- "deleteMapCustomizationConfirm":"Weet je zeker dat je deze kaart wilt verwijderen",
- "addMapCustomization" : "Voeg een Kaartinstelling toe",
+ "deleteMapCustomizationConfirm": "Weet je zeker dat je deze kaart wilt verwijderen",
+ "addMapCustomization": "Voeg een Kaartinstelling toe",
"global": {
"reset": "Resetten",
"import": "Importeren",
@@ -973,5 +973,135 @@
"globalServicesLoadError": "Er is iets misgegaan bij het ophalen van de globale services",
"noServices": "Geen services gevonden, controleer de documentatie op hoe je services kunt toevoegen",
"iframeLoadError": "De geselecteerde service kon niet worden geladen"
+ },
+ "org": {
+ "openremote": {
+ "model": {
+ "query": {
+ "filter": {
+ "ValueEmptyPredicate": {
+ "label": "Lege waarde",
+ "description": "Predicaat dat overeenkomt met elke lege/nulwaarde; tenzij genegeerd."
+ },
+ "RadialGeofencePredicate": {
+ "label": "Radiale geofence",
+ "description": "Predicaat voor GEO JSON-puntwaarden; geeft true terug als het punt zich binnen de opgegeven straal rond de opgegeven breedte- en lengtegraad bevindt, tenzij negatief gemaakt."
+ },
+ "ValueAnyPredicate": {
+ "label": "Elke waarde",
+ "description": "Predicaat dat overeenkomt met elke waarde, inclusief null."
+ },
+ "CalendarEventPredicate": {
+ "label": "Kalender",
+ "description": "Predicaat voor kalender-evenementwaarden; komt overeen op basis van of het kalender-evenement actief is op het opgegeven tijdstip."
+ },
+ "RectangularGeofencePredicate": {
+ "label": "Rechthoekige geofence",
+ "description": "Predicaat voor GEO JSON-puntwaarden; geeft true terug als het punt zich binnen de opgegeven rechthoek bevindt, gespecificeerd als breedte- en lengtegraad van twee hoeken, tenzij negatief gemaakt."
+ },
+ "ArrayPredicate": {
+ "description": "Predicaat voor array waarden; komt overeen op basis van geconfigureerde opties."
+ },
+ "StringPredicate": {
+ "description": "Predicaat voor string waarden; komt overeen op basis van geconfigureerde opties."
+ },
+ "NumberPredicate": {
+ "description": "Predicaat voor numerieke waarden; komt overeen op basis van geconfigureerde opties."
+ },
+ "DateTimePredicate": {
+ "description": "Predicaat voor datum/tijdwaarden; opgegeven waarden moeten geldige ISO 8601-datumtijdstrings zijn (bijv. yyyy-MM-dd'T'HH:mm:ssZ of yyyy-MM-dd'T'HH:mm:ss±HH:mm). Offset en tijd zijn optioneel. Als geen offset-informatie wordt opgegeven, wordt UTC aangenomen."
+ },
+ "BooleanPredicate": {
+ "description": "Predicaat voor boolean waarden; evalueert de waarde als een boolean en vergelijkt deze met de waarde van dit predicaat. Elke waarde die geen boolean is, komt niet overeen."
+ }
+ }
+ },
+ "simulator": {
+ "SimulatorReplayDatapoint": {
+ "label": "Datapunt"
+ }
+ },
+ "value": {
+ "MathExpressionValueFilter": {
+ "label": "Wiskundige expressie"
+ },
+ "SubStringValueFilter": {
+ "label": "Substring"
+ },
+ "JsonPathFilter": {
+ "label": "JSON-pad"
+ },
+ "RegexValueFilter": {
+ "label": "Regex"
+ },
+ "ValueConstraint": {
+ "description": "De beperkingen moeten een JSON-compatibele lijst van objecten zijn.",
+ "Size": {
+ "description": "De attribuutwaarde moet binnen de opgegeven grenzen liggen op basis van de `min` en `max` waardes. Ondersteunde types zijn JSON-compatibele strings, arrays en objecten. Null-waarden worden als geldig beschouwd."
+ },
+ "Min": {
+ "description": "De attribuutwaarde moet een getal zijn dat groter of gelijk is aan de opgegeven `min` waarde. Null-waarden worden als geldig beschouwd."
+ },
+ "Max": {
+ "description": "De attribuutwaarde moet een getal zijn dat kleiner of gelijk is aan de opgegeven `max` waarde. Null-waarden worden als geldig beschouwd."
+ },
+ "Pattern": {
+ "description": "De attribuutwaarde moet overeenkomen met het reguliere expressiepatroon dat is beschreven in de eigenschap `regexp`. De reguliere expressie volgt de Java-reguliere expressieconventies. Vlaggen kunnen worden opgegeven met behulp van de eigenschap `flags` met waarden: CASE_INSENSITIVE, MULTILINE, DOTALL, UNIX_LINES, UNICODE_CASE, CANON_EQ en COMMENTS. Null-waarden worden als geldig beschouwd."
+ },
+ "AllowedValues": {
+ "description": "De attribuutwaarde moet overeenkomen met een van de opgegeven waarden in de eigenschap `allowedValues`. De bijbehorende invoer in de UI verandert in een selectievak met de opties die in `allowedValues` zijn opgegeven. De eigenschap `allowedValueNames` accepteert een lijst met namen die de labels in de selectielijst vervangen, als de lengte van `allowedValueNames` overeenkomt met die van `allowedValues`; anders worden de waarden zelf als labels gebruikt. Null-waarden worden als geldig beschouwd. Als `allowedValues` niet is opgegeven of leeg is, accepteert de beperking alleen null-waarden."
+ },
+ "Past": {
+ "description": "De attribuutwaarde moet een java-timeobject, java-datumobject, een string in ISO8601-formaat of een getal zijn in epoch-milliseconds; de waarde moet een tijd in het verleden zijn. Null-waarden worden als geldig beschouwd."
+ },
+ "PastOrPresent": {
+ "description": "De attribuutwaarde moet een java-timeobject, java-datumobject, een string in ISO8601-formaat of een getal zijn in epoch-milliseconds; de waarde moet een tijd in het verleden of heden zijn. Null-waarden worden als geldig beschouwd."
+ },
+ "Future": {
+ "description": "De attribuutwaarde moet een java-timeobject, java-datumobject, een string in ISO8601-formaat of een getal zijn in epoch-milliseconds; de waarde moet een tijd in de toekomst zijn. Null-waarden worden als geldig beschouwd."
+ },
+ "FutureOrPresent": {
+ "description": "De attribuutwaarde moet een java-timeobject, java-datumobject, een string in ISO8601-formaat of een getal zijn in epoch-milliseconds; de waarde moet een tijd in de toekomst of het heden zijn. Null-waarden worden als geldig beschouwd."
+ },
+ "NotEmpty": {
+ "description": "De attribuutwaarde mag niet null of leeg zijn. Ondersteunde types zijn JSON-compatibele strings, arrays en objecten die ten minste 1 teken, item of eigenschap bevatten."
+ },
+ "NotBlank": {
+ "description": "De attribuutwaarde mag niet null zijn en moet ten minste 1 niet-witruimte-teken bevatten. Accepteert strings."
+ },
+ "NotNull": {
+ "description": "De attribuutwaarde mag niet null zijn. Accepteert elk type."
+ }
+ }
+ },
+ "asset": {
+ "agent": {
+ "AgentLink": {
+ "valueFilters": {
+ "description": "Definieert ValueFilters die worden toegepast op een inkomende waarde voordat deze wordt weggeschreven naar een protocol gekoppeld attribuut; dit is vooral nuttig voor generieke protocollen. Het bericht moet de filters in arrayvolgorde doorlopen."
+ },
+ "valueConverter": {
+ "description": "Definieert een waardeconversiemap voor eenvoudige typeconversie; de inkomende waarde wordt geconverteerd naar JSON en als deze string overeenkomt met een eigenschapsnaam in de converter, wordt de waarde van die eigenschapsnaam naar het attribuut gestuurd. Een voorbeeld: een API die 'ACTIVE'/'DISABLED' strings retourneert, maar u wilt dit koppelen aan een boolean attribuutwaarde."
+ },
+ "writeValueConverter": {
+ "description": "Vergelijkbaar met valueConverter, maar wordt toegepast op uitgaande waarden voor de omgekeerde conversie."
+ },
+ "writeValue": {
+ "description": "String die wordt gebruikt voor attribuutschrijfacties en dynamische placeholders kan bevatten om dynamische waarden en/of tijd in de string in te voegen (zie documentatie voor details), of anders de string ongewijzigd naar het protocol doorsturen (statische string)."
+ },
+ "messageMatchPredicate": {
+ "description": "Het predicaat dat wordt toegepast op inkomende berichten om te bepalen of het bericht bedoeld is voor het gekoppelde attribuut; de waarde die in het predicaat wordt gebruikt, kan worden gefilterd met behulp van de message match-filters. Dit moet worden gedefinieerd om attributen door de gekoppelde agent te laten bijwerken."
+ },
+ "messageMatchFilters": {
+ "description": "ValueFilters die worden toegepast op inkomende berichten voordat deze worden vergeleken met het messageMatchPredicate."
+ },
+ "updateOnWrite": {
+ "description": "Verwacht geen reactie van het protocol; het werkt de attribuut onmiddellijk bij tijdens schrijven."
+ }
+ }
+ }
+ }
+ }
+ }
}
}
diff --git a/ui/app/shared/locales/pt/or.json b/ui/app/shared/locales/pt/or.json
index 6f6876cfd..0db1d3607 100644
--- a/ui/app/shared/locales/pt/or.json
+++ b/ui/app/shared/locales/pt/or.json
@@ -114,7 +114,7 @@
"clearTable": "Limpar",
"addAssetAttribute": "Adicionar atributo de ativo",
"add": "Adicionar",
- "flow":{
+ "flow": {
"EQUALS_COMPARATOR": "Igual a",
"GREATER_THAN": "Maior que",
"LESS_THAN": "Menor que",
@@ -135,13 +135,13 @@
"TEXT_SWITCH": "Mudança de texto",
"ROUND_NODE": "Rodada",
"LOG_OUTPUT": "Write to Logs",
- "DERIVATIVE": "Attribute derivative",
+ "DERIVATIVE": "Attribute derivative",
"INTEGRAL": "Attribute integral",
"HISTORIC_VALUE": "Attribute history",
"MAX_PROCESSOR": "Maximum",
- "MIN_PROCESSOR": "Minimum",
- "AVERAGE_PROCESSOR": "Average",
- "MEDIAN_PROCESSOR": "Median",
+ "MIN_PROCESSOR": "Minimum",
+ "AVERAGE_PROCESSOR": "Average",
+ "MEDIAN_PROCESSOR": "Median",
"SUM_OPERATOR": "Sum",
"max": "Max",
"min": "Min",
@@ -228,8 +228,8 @@
"custom": "Atributo personalizado",
"realm": "Reino",
"realm_plural": "Reinos",
- "displayName":"Nome amigável",
- "deleteRealmConfirm":"Tem certeza que deseja excluir este Reino?",
+ "displayName": "Nome amigável",
+ "deleteRealmConfirm": "Tem certeza que deseja excluir este Reino?",
"user_plural": "Usuários",
"regularUser_plural": "Usuários regulares",
"serviceUser_plural": "Usuários do serviço",
@@ -237,12 +237,12 @@
"role": "Função",
"role_plural": "Funções",
"description": "Descrição",
- "passwordMismatch":"As senhas não correspondem",
- "username":"Nome de usuário",
- "firstName":"Primeiro nome",
- "surname":"Sobrenome",
- "deleteUserConfirm":"Tem certeza de que deseja excluir este usuário?",
- "deleteRoleConfirm":"Tem certeza de que deseja excluir esta função?",
+ "passwordMismatch": "As senhas não correspondem",
+ "username": "Nome de usuário",
+ "firstName": "Primeiro nome",
+ "surname": "Sobrenome",
+ "deleteUserConfirm": "Tem certeza de que deseja excluir este usuário?",
+ "deleteRoleConfirm": "Tem certeza de que deseja excluir esta função?",
"realmRules": "Reino",
"globalRules": "Global",
"recipients": "Destinatários",
@@ -285,8 +285,8 @@
"resetPasswordConfirmation": "Um e-mail foi enviado para redefinir sua senha.",
"repeatPassword": "Repetir senha",
"details": "Detalhes",
- "permissions":"Permissões",
- "fullAccessLabel":"Admin: acesso total; gerenciar usuários e funções",
+ "permissions": "Permissões",
+ "fullAccessLabel": "Admin: acesso total; gerenciar usuários e funções",
"noChildAssets": "Nenhuma criança activos",
"account": "Conta",
"editAttribute": "Alterar atributo",
@@ -399,14 +399,14 @@
"description": "Protocolo para conectar a um KNX"
}
},
- "validityType":"Tipo de programação",
- "validityAlways":"Sempre ativo",
- "validityPeriod":"Planeje uma ocorrência",
- "validityRecurrence":"Planeje uma ocorrência repetida",
+ "validityType": "Tipo de programação",
+ "validityAlways": "Sempre ativo",
+ "validityPeriod": "Planeje uma ocorrência",
+ "validityRecurrence": "Planeje uma ocorrência repetida",
"activeFromTo": "Ativo de {{start}} a {{end}}",
- "fromTo":"De {{start}} a {{end}}",
- "fromToDays":"De {{start}} a {{days}} dias depois{{end}}",
- "forDays":"por {{days}} dias",
+ "fromTo": "De {{start}} a {{end}}",
+ "fromToDays": "De {{start}} a {{days}} dias depois{{end}}",
+ "forDays": "por {{days}} dias",
"scheduleRuleActivity": "Agendar Atividade de Regra",
"allDay": "Todo o dia",
"apply": "aplicar",
@@ -458,5 +458,135 @@
"attributeLabel": "Attribute",
"attributeValueLabel": "Attribute value",
"assetTypeDoesNotExist": "Filter : Asset type does not exist"
+ },
+ "org": {
+ "openremote": {
+ "model": {
+ "query": {
+ "filter": {
+ "ValueEmptyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RadialGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ValueAnyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "CalendarEventPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RectangularGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ArrayPredicate": {
+ "description": ""
+ },
+ "StringPredicate": {
+ "description": ""
+ },
+ "NumberPredicate": {
+ "description": ""
+ },
+ "DateTimePredicate": {
+ "description": ""
+ },
+ "BooleanPredicate": {
+ "description": ""
+ }
+ }
+ },
+ "simulator": {
+ "SimulatorReplayDatapoint": {
+ "label": ""
+ }
+ },
+ "value": {
+ "MathExpressionValueFilter": {
+ "label": ""
+ },
+ "SubStringValueFilter": {
+ "label": ""
+ },
+ "JsonPathFilter": {
+ "label": ""
+ },
+ "RegexValueFilter": {
+ "label": ""
+ },
+ "ValueConstraint": {
+ "description": "",
+ "Size": {
+ "description": ""
+ },
+ "Min": {
+ "description": ""
+ },
+ "Max": {
+ "description": ""
+ },
+ "Pattern": {
+ "description": ""
+ },
+ "AllowedValues": {
+ "description": ""
+ },
+ "Past": {
+ "description": ""
+ },
+ "PastOrPresent": {
+ "description": ""
+ },
+ "Future": {
+ "description": ""
+ },
+ "FutureOrPresent": {
+ "description": ""
+ },
+ "NotEmpty": {
+ "description": ""
+ },
+ "NotBlank": {
+ "description": ""
+ },
+ "NotNull": {
+ "description": ""
+ }
+ }
+ },
+ "asset": {
+ "agent": {
+ "AgentLink": {
+ "valueFilters": {
+ "description": ""
+ },
+ "valueConverter": {
+ "description": ""
+ },
+ "writeValueConverter": {
+ "description": ""
+ },
+ "writeValue": {
+ "description": ""
+ },
+ "messageMatchPredicate": {
+ "description": ""
+ },
+ "messageMatchFilters": {
+ "description": ""
+ },
+ "updateOnWrite": {
+ "description": ""
+ }
+ }
+ }
+ }
+ }
+ }
}
}
diff --git a/ui/app/shared/locales/ro/or.json b/ui/app/shared/locales/ro/or.json
index 4e693d00b..08327a38e 100644
--- a/ui/app/shared/locales/ro/or.json
+++ b/ui/app/shared/locales/ro/or.json
@@ -166,13 +166,13 @@
"TEXT_SWITCH": "Comutator text",
"ROUND_NODE": "Rotunjește",
"LOG_OUTPUT": "Write to Logs",
- "DERIVATIVE": "Attribute derivative",
+ "DERIVATIVE": "Attribute derivative",
"INTEGRAL": "Attribute integral",
"HISTORIC_VALUE": "Attribute history",
"MAX_PROCESSOR": "Maximum",
- "MIN_PROCESSOR": "Minimum",
- "AVERAGE_PROCESSOR": "Average",
- "MEDIAN_PROCESSOR": "Median",
+ "MIN_PROCESSOR": "Minimum",
+ "AVERAGE_PROCESSOR": "Average",
+ "MEDIAN_PROCESSOR": "Median",
"SUM_OPERATOR": "Sum",
"max": "Max",
"min": "Min",
@@ -276,11 +276,11 @@
"realm": "Domeniu",
"realm_plural": "Domenii",
"changeRealm": "Schimbă domeniu",
- "displayName":"Nume prietenos",
+ "displayName": "Nume prietenos",
"loginTheme": "Temă acces",
"emailTheme": "Temă email",
"resetPasswordAllowed": "Resetarea parolei este permisă",
- "deleteRealmConfirm":"Ești sigur că dorești să ștergi acest Domeniu?",
+ "deleteRealmConfirm": "Ești sigur că dorești să ștergi acest Domeniu?",
"serviceUser": "Utilizator service",
"user_plural": "Utilizatori",
"regularUser_plural": "Utilizatori obișnuiți",
@@ -296,14 +296,14 @@
"role": "Rol",
"role_plural": "Roluri",
"description": "Descriere",
- "passwordMismatch":"Parolele nu se potrivesc",
- "username":"Utilizator",
- "firstName":"Prenume",
- "surname":"Nume de familie",
+ "passwordMismatch": "Parolele nu se potrivesc",
+ "username": "Utilizator",
+ "firstName": "Prenume",
+ "surname": "Nume de familie",
"deleteUser": "Șterge Utilizator",
"deleteRole": "Șterge Rol",
- "deleteUserConfirm":"Esti sigur că vrei să ștergi acest utilizator?",
- "deleteRoleConfirm":"Esti sigur că vrei să ștergi acest rol?",
+ "deleteUserConfirm": "Esti sigur că vrei să ștergi acest utilizator?",
+ "deleteRoleConfirm": "Esti sigur că vrei să ștergi acest rol?",
"realmRules": "Domeniu",
"globalRules": "Global",
"recipients": "Destinatari",
@@ -347,14 +347,14 @@
"resetPasswordConfirmation": "Un e-mail a fost trimis pentru a vă reseta parola.",
"repeatPassword": "Repeta parola",
"details": "Detalii",
- "permissions":"Permisiuni",
- "linkedAssets":"Utilizatori interconectați",
- "realm_role_plural":"Roluri domeniu",
- "manager_role_plural":"Roluri manager",
+ "permissions": "Permisiuni",
+ "linkedAssets": "Utilizatori interconectați",
+ "realm_role_plural": "Roluri domeniu",
+ "manager_role_plural": "Roluri manager",
"restrictAccess": "Restricționeaza accesul",
"selectRestrictedAssets": "{{number}} obiecte",
"restrictedAccessToAssets": "Acces restricționat la",
- "fullAccessLabel":"Admin: full access; manage users and roles",
+ "fullAccessLabel": "Admin: full access; manage users and roles",
"noChildAssets": "Nu are obiecte copil",
"account": "Cont",
"editAttribute": "Schimbă atribut",
@@ -473,14 +473,14 @@
"description": "Protocol pentru conectarea la un KNX"
}
},
- "validityType":"Tip de program",
- "validityAlways":"Activ permanent",
- "validityPeriod":"Planifică un eveniment",
- "validityRecurrence":"Planifică un eveniment repetitiv",
+ "validityType": "Tip de program",
+ "validityAlways": "Activ permanent",
+ "validityPeriod": "Planifică un eveniment",
+ "validityRecurrence": "Planifică un eveniment repetitiv",
"activeFromTo": "Activ de la {{start}} până la {{end}}",
- "fromTo":"De la {{start}} până la {{end}}",
- "fromToDays":"de la {{start}} până peste {{days}} zile mai târziu {{end}}",
- "forDays":"pentru {{days}} zile",
+ "fromTo": "De la {{start}} până la {{end}}",
+ "fromToDays": "de la {{start}} până peste {{days}} zile mai târziu {{end}}",
+ "forDays": "pentru {{days}} zile",
"scheduleRuleActivity": "Planifică Activitatea Regulii",
"allDay": "Toată ziua",
"apply": "aplică",
@@ -527,7 +527,7 @@
"autoProvisioning": "Înrolare automată",
"provisioningConfigs": "Configurari înrolare",
"loadFailedProvisioningConfigs": "Încărcarea configurarii de înrolare a eșuat",
- "deleteProvisioningConfigConfirm":"Ești sigur că vrei să ștergi această configurare de înrolare?\nClienții care folosesc această configurare nu se vor mai putea conecta.",
+ "deleteProvisioningConfigConfirm": "Ești sigur că vrei să ștergi această configurare de înrolare?\nClienții care folosesc această configurare nu se vor mai putea conecta.",
"assetTemplate": "Șablon obiect",
"createAsRestrictedUser": "Crează utilizator restricționat",
"ignoreExpiryDate": "Ignoră data de expirare",
@@ -583,11 +583,11 @@
"layout": "Aspect",
"display": "Afișare",
"screen": "Ecran",
- "uploadFile" : "Încarcă fișier",
+ "uploadFile": "Încarcă fișier",
"thresholds": "Praguri",
"threshold": "Prag",
"noDashboardSelected": "Selectează un panou din stânga",
- "noDashboardSelected-mobile" : "Selecteaza un panou din meniul stanga-sus",
+ "noDashboardSelected-mobile": "Selecteaza un panou din meniul stanga-sus",
"noDashboardFound": "Niciun panou nu a fost găsit.",
"dashboardNotFound": "Panoul nu a fost găsit.",
"noDashboardWriteAccess": "Nu ai drepturi pentru a edita acest panou.",
@@ -630,7 +630,7 @@
"deleteWidgetWarning": "This will remove the widget from your board, and be permanently deleted after saving.",
"widgetTooSmall": "Widget-ul este prea mic.",
"allowTimerangeSelect": "Permite selectarea intervalului de timp",
- "showLegend": "Arată legenda",
+ "showLegend": "Arată legenda",
"showGeoJson": "Arată stratul GeoJSON",
"showValueAs": "Arată valoarea ca",
"deleteWidget": "Șterge widget",
@@ -646,10 +646,10 @@
"default": "Implicit",
"appearance": "Aspect",
"configuration": {
- "" : "Appearance",
+ "": "Appearance",
"main": "Principal",
"realmStyling": "STILIZAREA DOMENIULUI",
- "addRealmCustomization" : "Adaugă Stil Domeniu",
+ "addRealmCustomization": "Adaugă Stil Domeniu",
"realmTitle": "Titlu aplicație manager",
"defaultLanguage": "Limba implicită",
"images": "Imagini",
@@ -665,13 +665,13 @@
"--or-app-color2": "Fundal: Culoarea suprafetei din spatele panourilor",
"--or-app-color3": "Text: titlurile paginilor si panourilor",
"--or-app-color8": "Text primar: text pe elemente cu culoarea primara",
- "navigation" : "Navigație",
+ "navigation": "Navigație",
"navigationDescription": "Primary navigation is shown in the page header, secondary items can be found in the menu on the right.",
- "primaryNavigation" : "Meniu primar",
- "secondaryNavigation" : "Meniu secundar",
- "reloadPage" : "Pentru a vedea modificările făcute, reîncarca pagina",
+ "primaryNavigation": "Meniu primar",
+ "secondaryNavigation": "Meniu secundar",
+ "reloadPage": "Pentru a vedea modificările făcute, reîncarca pagina",
"deleteRealmCustomization": "Șterge Stilul",
- "deleteRealmCustomizationConfirm":"Esti sigur că vrei sa ștergi stilul acestui domeniu?",
+ "deleteRealmCustomizationConfirm": "Esti sigur că vrei sa ștergi stilul acestui domeniu?",
"mapBounds": "Limite",
"mapBoundsDescription": "Definește o cutie de vizualizare pe care o vede utilizatorul",
"mapZoom": "Magnificare",
@@ -682,8 +682,8 @@
"geoJson": "GeoJSON",
"geoJsonDescription": "Personalizare GeoJSON; adaugă puncte, linii și poligoane pe hartă.",
"deleteMapCustomization": "Șterge setările harții",
- "deleteMapCustomizationConfirm":"Ești sigur că dorești să ștergi această personalizare a hărții?",
- "addMapCustomization" : "Adaugă setari harta"
+ "deleteMapCustomizationConfirm": "Ești sigur că dorești să ștergi această personalizare a hărții?",
+ "addMapCustomization": "Adaugă setari harta"
},
"mqttSessions": "Sesiuni MQTT",
"address": "Adresa",
@@ -696,5 +696,135 @@
"saveRealmFailed": "Salvarea domeniului a eșuat",
"saveRealmSucceeded": "Domeniul a fost salvat cu succes!",
"userDisconnected": "Deconectare cu succes!",
- "userDisconnectFailed": "Deconectare eșuată"
+ "userDisconnectFailed": "Deconectare eșuată",
+ "org": {
+ "openremote": {
+ "model": {
+ "query": {
+ "filter": {
+ "ValueEmptyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RadialGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ValueAnyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "CalendarEventPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RectangularGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ArrayPredicate": {
+ "description": ""
+ },
+ "StringPredicate": {
+ "description": ""
+ },
+ "NumberPredicate": {
+ "description": ""
+ },
+ "DateTimePredicate": {
+ "description": ""
+ },
+ "BooleanPredicate": {
+ "description": ""
+ }
+ }
+ },
+ "simulator": {
+ "SimulatorReplayDatapoint": {
+ "label": ""
+ }
+ },
+ "value": {
+ "MathExpressionValueFilter": {
+ "label": ""
+ },
+ "SubStringValueFilter": {
+ "label": ""
+ },
+ "JsonPathFilter": {
+ "label": ""
+ },
+ "RegexValueFilter": {
+ "label": ""
+ },
+ "ValueConstraint": {
+ "description": "",
+ "Size": {
+ "description": ""
+ },
+ "Min": {
+ "description": ""
+ },
+ "Max": {
+ "description": ""
+ },
+ "Pattern": {
+ "description": ""
+ },
+ "AllowedValues": {
+ "description": ""
+ },
+ "Past": {
+ "description": ""
+ },
+ "PastOrPresent": {
+ "description": ""
+ },
+ "Future": {
+ "description": ""
+ },
+ "FutureOrPresent": {
+ "description": ""
+ },
+ "NotEmpty": {
+ "description": ""
+ },
+ "NotBlank": {
+ "description": ""
+ },
+ "NotNull": {
+ "description": ""
+ }
+ }
+ },
+ "asset": {
+ "agent": {
+ "AgentLink": {
+ "valueFilters": {
+ "description": ""
+ },
+ "valueConverter": {
+ "description": ""
+ },
+ "writeValueConverter": {
+ "description": ""
+ },
+ "writeValue": {
+ "description": ""
+ },
+ "messageMatchPredicate": {
+ "description": ""
+ },
+ "messageMatchFilters": {
+ "description": ""
+ },
+ "updateOnWrite": {
+ "description": ""
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
diff --git a/ui/app/shared/locales/uk/or.json b/ui/app/shared/locales/uk/or.json
index 8f4cc317c..ac800ffa6 100644
--- a/ui/app/shared/locales/uk/or.json
+++ b/ui/app/shared/locales/uk/or.json
@@ -171,13 +171,13 @@
"TEXT_SWITCH": "Текстовий перемикач",
"ROUND_NODE": "Коло",
"LOG_OUTPUT": "Write to Logs",
- "DERIVATIVE": "Attribute derivative",
+ "DERIVATIVE": "Attribute derivative",
"INTEGRAL": "Attribute integral",
"HISTORIC_VALUE": "Attribute history",
"MAX_PROCESSOR": "Maximum",
- "MIN_PROCESSOR": "Minimum",
- "AVERAGE_PROCESSOR": "Average",
- "MEDIAN_PROCESSOR": "Median",
+ "MIN_PROCESSOR": "Minimum",
+ "AVERAGE_PROCESSOR": "Average",
+ "MEDIAN_PROCESSOR": "Median",
"SUM_OPERATOR": "Sum",
"max": "Max",
"min": "Min",
@@ -540,7 +540,7 @@
"autoProvisioning": "Автоматичне налаштування",
"provisioningConfigs": "Конфігурації автоматичного налаштування",
"loadFailedProvisioningConfigs": "Не вдалося завантажити конфігурації автоматичного налаштування",
- "deleteProvisioningConfigConfirm":"Ви впевнені, що хочете видалити цю конфігурацію автоматичного налаштування?\nКлієнти, які використовують цю конфігурацію, більше не зможуть підключатися.",
+ "deleteProvisioningConfigConfirm": "Ви впевнені, що хочете видалити цю конфігурацію автоматичного налаштування?\nКлієнти, які використовують цю конфігурацію, більше не зможуть підключатися.",
"assetTemplate": "Шаблон активу",
"createAsRestrictedUser": "Створити обмеженого користувача",
"ignoreExpiryDate": "Ігнорувати дату закінчення",
@@ -679,7 +679,7 @@
"default": "За замовчуванням",
"appearance": "Вигляд",
"configuration": {
- "" : "Вигляд",
+ "": "Вигляд",
"main": "Головне",
"realmStyling": "Стилізація області",
"managerConfigNotFound": "Файл конфігурації менеджера не знайдено.",
@@ -738,5 +738,135 @@
"withInterval": "З інтервалом",
"AVG": "Середнє (середнє значення)",
"MIN": "Мінімум",
- "MAX": "Максимум"
+ "MAX": "Максимум",
+ "org": {
+ "openremote": {
+ "model": {
+ "query": {
+ "filter": {
+ "ValueEmptyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RadialGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ValueAnyPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "CalendarEventPredicate": {
+ "label": "",
+ "description": ""
+ },
+ "RectangularGeofencePredicate": {
+ "label": "",
+ "description": ""
+ },
+ "ArrayPredicate": {
+ "description": ""
+ },
+ "StringPredicate": {
+ "description": ""
+ },
+ "NumberPredicate": {
+ "description": ""
+ },
+ "DateTimePredicate": {
+ "description": ""
+ },
+ "BooleanPredicate": {
+ "description": ""
+ }
+ }
+ },
+ "simulator": {
+ "SimulatorReplayDatapoint": {
+ "label": ""
+ }
+ },
+ "value": {
+ "MathExpressionValueFilter": {
+ "label": ""
+ },
+ "SubStringValueFilter": {
+ "label": ""
+ },
+ "JsonPathFilter": {
+ "label": ""
+ },
+ "RegexValueFilter": {
+ "label": ""
+ },
+ "ValueConstraint": {
+ "description": "",
+ "Size": {
+ "description": ""
+ },
+ "Min": {
+ "description": ""
+ },
+ "Max": {
+ "description": ""
+ },
+ "Pattern": {
+ "description": ""
+ },
+ "AllowedValues": {
+ "description": ""
+ },
+ "Past": {
+ "description": ""
+ },
+ "PastOrPresent": {
+ "description": ""
+ },
+ "Future": {
+ "description": ""
+ },
+ "FutureOrPresent": {
+ "description": ""
+ },
+ "NotEmpty": {
+ "description": ""
+ },
+ "NotBlank": {
+ "description": ""
+ },
+ "NotNull": {
+ "description": ""
+ }
+ }
+ },
+ "asset": {
+ "agent": {
+ "AgentLink": {
+ "valueFilters": {
+ "description": ""
+ },
+ "valueConverter": {
+ "description": ""
+ },
+ "writeValueConverter": {
+ "description": ""
+ },
+ "writeValue": {
+ "description": ""
+ },
+ "messageMatchPredicate": {
+ "description": ""
+ },
+ "messageMatchFilters": {
+ "description": ""
+ },
+ "updateOnWrite": {
+ "description": ""
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
diff --git a/ui/component/or-attribute-input/src/agent-link-json-forms-renderer.ts b/ui/component/or-attribute-input/src/agent-link-json-forms-renderer.ts
index 32c050108..b18c36d15 100644
--- a/ui/component/or-attribute-input/src/agent-link-json-forms-renderer.ts
+++ b/ui/component/or-attribute-input/src/agent-link-json-forms-renderer.ts
@@ -9,14 +9,13 @@ import {
formatIs
} from "@jsonforms/core";
import manager, { OREvent } from "@openremote/core";
-import { Agent } from "@openremote/model";
+import { Agent, AgentDescriptor, AssetModelUtil } from "@openremote/model";
import { JsonFormsStateContext, getTemplateWrapper, JsonFormsRendererRegistryEntry } from "@openremote/or-json-forms";
import { InputType, OrInputChangedEvent } from "@openremote/or-mwc-components/or-mwc-input";
import { html } from "lit";
import "@openremote/or-mwc-components/or-mwc-input";
import { i18next } from "@openremote/or-translate";
import { until } from "lit/directives/until.js";
-import { showOkCancelDialog } from "@openremote/or-mwc-components/or-mwc-dialog";
/**
* This function creates a short lived cache for loading the list of agents; this is useful when multiple instances
@@ -27,7 +26,7 @@ let loadingPromise: Promise<Agent[]> | undefined;
let subscribed = false;
const timeout = 2000;
-export function loadAgents(): PromiseLike<Agent[]> {
+function loadAgents(): PromiseLike<Agent[]> {
if (agents) {
return Promise.resolve(agents);
@@ -89,8 +88,19 @@ const agentIdRenderer = (state: JsonFormsStateContext, props: ControlProps) => {
};
const onAgentChanged = (agent: Agent | undefined) => {
- props.handleChange(props.path, agent ? agent.id : undefined);
- return;
+ if (!agents) {
+ return;
+ }
+
+ if (agent) {
+ const newAgentDescriptor = AssetModelUtil.getAssetDescriptor(agent.type) as AgentDescriptor;
+ if (newAgentDescriptor) {
+ props.handleChange("", {
+ id: agent.id,
+ type: newAgentDescriptor.agentLinkType
+ });
+ }
+ }
};
const loadedTemplatePromise = loadAgents().then(agents => {
diff --git a/ui/component/or-attribute-input/src/index.ts b/ui/component/or-attribute-input/src/index.ts
index d3bfcd1e0..bc8eb3f61 100644
--- a/ui/component/or-attribute-input/src/index.ts
+++ b/ui/component/or-attribute-input/src/index.ts
@@ -1,13 +1,10 @@
import {css, html, LitElement, PropertyValues, TemplateResult} from "lit";
-import {customElement, property, query} from "lit/decorators.js";
+import {customElement, property} from "lit/decorators.js";
import {ifDefined} from "lit/directives/if-defined.js";
import {until} from "lit/directives/until.js";
import {createRef, Ref, ref} from 'lit/directives/ref.js';
import {i18next, translate} from "@openremote/or-translate";
import {
- Agent,
- AgentDescriptor,
- AgentLink,
Attribute,
AttributeDescriptor,
AttributeEvent,
@@ -30,7 +27,6 @@ import {
InputType,
OrInputChangedEvent,
OrInputChangedEventDetail,
- OrMwcInput,
ValueInputProvider,
ValueInputProviderGenerator,
ValueInputProviderOptions,
@@ -40,7 +36,7 @@ import "@openremote/or-map";
import {geoJsonPointInputTemplateProvider} from "@openremote/or-map";
import "@openremote/or-json-forms";
import {ErrorObject, OrJSONForms, StandardRenderers} from "@openremote/or-json-forms";
-import {agentIdRendererRegistryEntry, loadAgents} from "./agent-link-json-forms-renderer";
+import {agentIdRendererRegistryEntry} from "./agent-link-json-forms-renderer";
export class OrAttributeInputChangedEvent extends CustomEvent<OrAttributeInputChangedEventDetail> {
@@ -118,120 +114,75 @@ export function getHelperText(sending: boolean, error: boolean, timestamp: numbe
}
const jsonFormsAttributeRenderers = [...StandardRenderers, agentIdRendererRegistryEntry];
-type ErrorMessage = "agentNotFound" | "agentTypeMismatch";
-export const jsonFormsInputTemplateProvider: (fallback: ValueInputProvider) => ValueInputProviderGenerator = (fallback) => (assetDescriptor, valueHolder, valueHolderDescriptor, valueDescriptor, valueChangeNotifier, options) => {
-
- const disabled = !!(options && options.disabled);
- const readonly = !!(options && options.readonly);
- const label = options.label;
+let valueDescriptorSchemaHashes: Record<string, string>
+const schemas = new Map<string, any>()
- // Agent link needs some special handling as we need an agent picker no matter what
- if (valueDescriptor.name === WellknownValueTypes.AGENTLINK) {
+export const jsonFormsInputTemplateProvider: (fallback: ValueInputProvider) => ValueInputProviderGenerator = (fallback) => (assetDescriptor, valueHolder, valueHolderDescriptor, valueDescriptor, valueChangeNotifier, options) => {
+ if (valueDescriptor.jsonType === "object" || valueDescriptor.arrayDimensions && valueDescriptor.arrayDimensions > 0) {
+ const disabled = !!(options && options.disabled);
+ const readonly = !!(options && options.readonly);
+ const label = options.label;
// Apply a custom UI schema to remove the outer VerticalLayout
const uiSchema: any = {type: "Control", scope: "#"};
let schema: any;
const jsonForms: Ref<OrJSONForms> = createRef();
const loadingWrapper: Ref<OrLoadingWrapper> = createRef();
- let loadedAgents: Agent[] = [];
- let initialised = false;
- let agentLink: AgentLink | undefined;
-
- const onAgentLinkChanged = (dataAndErrors: {errors: ErrorObject[] | undefined, data: any}) => {
- if (!initialised) {
- return;
- }
- const newAgentLink: AgentLink | undefined = dataAndErrors.data;
-
- if (newAgentLink) {
- const agent = loadedAgents.find((agnt) => agnt.id === newAgentLink!.id);
- if (agent) {
- const newAgentDescriptor = AssetModelUtil.getAssetDescriptor(agent.type) as AgentDescriptor;
- if (newAgentDescriptor) {
- newAgentLink.type = newAgentDescriptor.agentLinkType!;
- }
- }
- }
-
- if (!Util.objectsEqual(newAgentLink, agentLink)) {
- agentLink = newAgentLink;
- valueChangeNotifier({
- value: newAgentLink
- });
- }
+ let initialised = false;
+ let prevValue: any;
+
+ const onChanged = (dataAndErrors: {errors: ErrorObject[] | undefined, data: any}) => {
+ if (!initialised) {
+ return
+ };
+
+ if (!Util.objectsEqual(dataAndErrors.data, prevValue)) {
+ prevValue = dataAndErrors.data;
+ valueChangeNotifier({
+ value: dataAndErrors.data
+ });
+ }
};
-
- const doLoad = async (link: AgentLink) => {
-
+ const doLoad = async (data: any) => {
if (!initialised) {
- agentLink = link;
+ prevValue = data;
}
initialised = true;
- if (!schema) {
- // TODO: Load agent link schema from AssetModelUtil - For now run AssetModelTest in debug and copy paste the result of def schema = ValueUtil.getSchema(AgentLink.class)
- schema = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","definitions":{"ArrayPredicate":{"type":"object","properties":{"index":{"type":"integer"},"lengthEquals":{"type":"integer"},"lengthGreaterThan":{"type":"integer"},"lengthLessThan":{"type":"integer"},"negated":{"type":"boolean"},"value":{"title":"Any Type","type":["null","number","integer","boolean","string","array","object"],"additionalProperties":true},"type":{"const":"array","default":"array"}},"required":["negated","type"],"title":"Array Predicate","additionalProperties":true,"description":"Predicate for array values; will match based on configured options."},"BluetoothMeshAgentLink":{"type":"object","properties":{"address":{"type":"string","pattern":"^([0-9A-Fa-f]{4})$"},"appKeyIndex":{"type":"integer","minimum":0,"maximum":2147483647},"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"modelName":{"type":"string","minLength":1},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"BluetoothMeshAgentLink","default":"BluetoothMeshAgentLink"}},"required":["appKeyIndex","modelName","type"],"title":"Bluetooth Mesh Agent Link","additionalProperties":true},"BooleanPredicate":{"type":"object","properties":{"value":{"type":"boolean"},"type":{"const":"boolean","default":"boolean"}},"required":["value","type"],"title":"Boolean Predicate","additionalProperties":true,"description":"Predicate for boolean values; will evaluate the value as a boolean and match against this predicates value, any value that is not a boolean will not match"},"CalendarEventPredicate":{"type":"object","properties":{"timestamp":{"type":"integer","format":"utc-millisec"},"type":{"const":"calendar-event","default":"calendar-event"}},"title":"Calendar","additionalProperties":true,"description":"Predicate for calendar event values; will match based on whether the calendar event is active for the specified time.","required":["type"]},"DateTimePredicate":{"type":"object","properties":{"negate":{"type":"boolean"},"operator":{"type":"string","enum":["EQUALS","GREATER_THAN","GREATER_EQUALS","LESS_THAN","LESS_EQUALS","BETWEEN"]},"rangeValue":{"type":"string"},"value":{"type":"string"},"type":{"const":"datetime","default":"datetime"}},"required":["negate","type"],"title":"Date Time Predicate","additionalProperties":true,"description":"Predicate for date time values; provided values should be valid ISO 8601 datetime strings (e.g. yyyy-MM-dd\'T\'HH:mm:ssZ or yyyy-MM-dd\'T\'HH:mm:ss±HH:mm), offset and time are optional, if no offset information is supplied then UTC is assumed."},"DefaultAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"DefaultAgentLink","default":"DefaultAgentLink"}},"title":"Default Agent Link","additionalProperties":true},"HTTPAgentLink":{"type":"object","properties":{"contentType":{"type":"string","description":"The content type header value to use when making requests for this linked attribute (shortcut alternative to using headers parameter)"},"headers":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"A JSON object of headers to be added to HTTP request; the key represents the name of the header and for each string value supplied a new header will be added with the key name and specified string value"},"id":{"type":"string","format":"or-agent-id"},"messageConvertBinary":{"type":"boolean","description":"Indicates that the HTTP response is binary and should be converted to binary string representation"},"messageConvertHex":{"type":"boolean","description":"Indicates that the HTTP response is binary and should be converted to hexadecimal string representation"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"method":{"type":"string","enum":["GET","POST","PUT","DELETE","OPTIONS","PATCH"],"description":"The HTTP method to use when making requests for this linked attribute"},"pagingMode":{"type":"boolean","description":"Indicates that the HTTP server supports pagination using the standard Link header mechanism"},"path":{"type":"string","description":"The URL path to append to the agents Base URL when making requests for this linked attribute"},"pollingAttribute":{"type":"string","description":"Allows the polled response to be written to another attribute with the specified name on the same asset as the linked attribute"},"pollingMillis":{"type":"integer","description":"Indicates that this HTTP request is used to update the linked attribute; this value indicates how frequently the HTTP request is made in order to update the linked attribute value"},"queryParameters":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"A JSON object of query parameters to be added to HTTP request URL; the key represents the name of the query parameter and for each string value supplied a new query parameter will be added with the key name and specified string value (e.g. \'https://..../?test=1&test=2\')"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"HTTPAgentLink","default":"HTTPAgentLink"}},"required":["messageConvertBinary","messageConvertHex","type"],"title":"HTTP Agent Link","additionalProperties":true},"JsonPathFilter":{"type":"object","properties":{"path":{"type":"string"},"returnFirst":{"type":"boolean"},"returnLast":{"type":"boolean"},"type":{"const":"jsonPath","default":"jsonPath"}},"required":["path","returnFirst","returnLast","type"],"title":"JSON Path","additionalProperties":true},"KNXAgentLink":{"type":"object","properties":{"actionGroupAddress":{"type":"string","pattern":"^\\\\d{1,3}/\\\\d{1,3}/\\\\d{1,3}$"},"dpt":{"type":"string","pattern":"^\\\\d{1,3}\\\\.\\\\d{1,3}$"},"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"statusGroupAddress":{"type":"string","pattern":"^\\\\d{1,3}/\\\\d{1,3}/\\\\d{1,3}$"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"KNXAgentLink","default":"KNXAgentLink"}},"required":["dpt","type"],"title":"KNX Agent Link","additionalProperties":true},"MQTTAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"publishTopic":{"type":"string","description":"An MQTT topic to publish attribute events to, any received payload will be pushed into the attribute; use write value converter and/or write value to do any processing, complex processing may require a rule or a custom MQTT agent"},"qos":{"type":"integer","description":"QoS level to use for publish/subscribe (default is 0 if unset)","minimum":0,"maximum":2},"subscriptionTopic":{"type":"string","description":"An MQTT topic to subscribe to, any received payload will be pushed into the attribute; use value filter(s) to extract values from string payloads and/or value converters to do simple value mapping, complex processing may require a rule or a custom MQTT agent"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"MQTTAgentLink","default":"MQTTAgentLink"}},"title":"MQTT Agent Link","additionalProperties":true,"required":["type"]},"MailAgentLink":{"type":"object","properties":{"fromMatchPredicate":{"type":"object","properties":{"caseSensitive":{"type":"boolean"},"match":{"type":"string","enum":["EXACT","BEGIN","END","CONTAINS"]},"negate":{"type":"boolean"},"value":{"type":"string"},"type":{"const":"string","default":"string"}},"required":["caseSensitive","negate","type"],"title":"String Predicate","additionalProperties":true,"description":"The predicate to apply to incoming mail message from address(es) to determine if the message is intended for the linked attribute. This must be defined to enable attributes to be updated by the linked agent."},"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"subjectMatchPredicate":{"type":"object","properties":{"caseSensitive":{"type":"boolean"},"match":{"type":"string","enum":["EXACT","BEGIN","END","CONTAINS"]},"negate":{"type":"boolean"},"value":{"type":"string"},"type":{"const":"string","default":"string"}},"required":["caseSensitive","negate","type"],"title":"String Predicate","additionalProperties":true,"description":"The predicate to apply to incoming mail message subjects to determine if the message is intended for the linked attribute. This must be defined to enable attributes to be updated by the linked agent."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"useSubject":{"type":"boolean","description":"Use the subject as value instead of the body"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"MailAgentLink","default":"MailAgentLink"}},"title":"Mail Agent Link","additionalProperties":true,"required":["type"]},"MathExpressionValueFilter":{"type":"object","properties":{"expression":{"type":"string"},"type":{"const":"mathExpression","default":"mathExpression"}},"title":"Mathematical Expression","additionalProperties":true,"required":["type"]},"MockAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"requiredValue":{"type":"string"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"MockAgentLink","default":"MockAgentLink"}},"title":"Mock Agent Link","additionalProperties":true,"required":["type"]},"ModbusAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"pollingMillis":{"type":"integer","description":"Poll interval in milliseconds"},"readAddress":{"type":"integer","description":"Zero based address from which the value is read from"},"readMemoryArea":{"type":"string","enum":["COIL","DISCRETE","HOLDING","INPUT"],"description":"Memory area to read from during read request"},"readRegistersAmount":{"type":"integer","description":"Set amount of registers to read. If left empty or less than 1, will use the default size for the corresponding data-type."},"readValueType":{"type":"string","enum":["BOOL","SINT","USINT","BYTE","INT","UINT","WORD","DINT","UDINT","DWORD","LINT","ULINT","LWORD","REAL","LREAL","CHAR","WCHAR"],"description":"Type to convert the returned data to. As specified by the PLC4X Modbus data types."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"writeAddress":{"type":"integer","description":"Zero-based address to which the value sent is written to"},"writeMemoryArea":{"type":"string","enum":["COIL","HOLDING"],"description":"Memory area to write to. \\"HOLDING\\" or \\"COIL\\" allowed."},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"ModbusAgentLink","default":"ModbusAgentLink"}},"required":["pollingMillis","readAddress","readMemoryArea","readValueType","type"],"title":"Modbus Agent Link","additionalProperties":true},"NumberPredicate":{"type":"object","properties":{"negate":{"type":"boolean"},"operator":{"type":"string","enum":["EQUALS","GREATER_THAN","GREATER_EQUALS","LESS_THAN","LESS_EQUALS","BETWEEN"]},"rangeValue":{"type":"number"},"value":{"type":"number"},"type":{"const":"number","default":"number"}},"required":["negate","type"],"title":"Number Predicate","additionalProperties":true,"description":"Predicate for number values; will match based on configured options."},"OpenWeatherMapAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"weatherProperty":{"type":"string","enum":["TEMPERATURE","ATMOSPHERIC_PRESSURE","HUMIDITY","CLOUD_COVERAGE","WIND_SPEED","WIND_DIRECTION","WIND_GUST_SPEED","PROBABILITY_OF_PRECIPITATION","RAIN_AMOUNT","ULTRAVIOLET_INDEX"],"description":"Select which weather property (e.g. temperature, humidity) to use as the data source"},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"OpenWeatherMapAgentLink","default":"OpenWeatherMapAgentLink"}},"required":["weatherProperty","type"],"title":"Open Weather Map Agent Link","additionalProperties":true},"RadialGeofencePredicate":{"type":"object","properties":{"lat":{"type":"number"},"lng":{"type":"number"},"negated":{"type":"boolean"},"radius":{"type":"integer"},"type":{"const":"radial","default":"radial"}},"required":["lat","lng","negated","radius","type"],"title":"Radial geofence","additionalProperties":true,"description":"Predicate for GEO JSON point values; will return true if the point is within the specified radius of the specified latitude and longitude unless negated."},"RectangularGeofencePredicate":{"type":"object","properties":{"latMax":{"type":"number"},"latMin":{"type":"number"},"lngMax":{"type":"number"},"lngMin":{"type":"number"},"negated":{"type":"boolean"},"type":{"const":"rect","default":"rect"}},"required":["latMax","latMin","lngMax","lngMin","negated","type"],"title":"Rectangular geofence","additionalProperties":true,"description":"Predicate for GEO JSON point values; will return true if the point is within the specified rectangle specified as latitude and longitude values of two corners unless negated."},"RegexValueFilter":{"type":"object","properties":{"matchGroup":{"type":"integer"},"matchIndex":{"type":"integer"},"pattern":{"type":"string"},"type":{"const":"regex","default":"regex"}},"title":"Regex","additionalProperties":true,"required":["type"]},"SNMPAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"SNMPAgentLink","default":"SNMPAgentLink"}},"title":"SNMP Agent Link","additionalProperties":true,"required":["type"]},"SimulatorAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"replayData":{"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"integer"},"value":{"title":"Any Type","type":["null","number","integer","boolean","string","array","object"],"additionalProperties":true}},"required":["timestamp"],"title":"Data point","additionalProperties":true},"description":"Used to store a dataset of values that should be replayed (i.e. written to the linked attribute) in a continuous loop based on a schedule (by default replays every 24h). Predicted datapoints can be added by configuring \'Store predicted datapoints\' which will insert the datapoints immediately as determined by the schedule."},"schedule":{"type":"object","properties":{"end":{"type":"string","format":"date-time","description":"Not implemented, within the recurrence rule you can specify an end date."},"recurrence":{"type":"string","description":"The recurrence schedule follows the RFC 5545 RRULE format."},"start":{"type":"string","format":"date-time","description":"Set a start date, if not provided, starts immediately. When the replay datapoint timestamp is 0 it will insert it at 00:00."}},"title":"Schedule","additionalProperties":true,"description":"When defined overwrites the possible dataset length and when it is replayed. This could be once when only a start- (and end) date are defined, or a recurring event following the RFC 5545 RRULE format. If not provided defaults to 24 hours. If the replay data contains datapoints scheduled after the default 24 hours or the recurrence rule the datapoints will be ignored."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"SimulatorAgentLink","default":"SimulatorAgentLink"}},"title":"Simulator Agent Link","additionalProperties":true,"required":["type"]},"StorageSimulatorAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"StorageSimulatorAgentLink","default":"StorageSimulatorAgentLink"}},"title":"Storage Simulator Agent Link","additionalProperties":true,"required":["type"]},"StringPredicate":{"type":"object","properties":{"caseSensitive":{"type":"boolean"},"match":{"type":"string","enum":["EXACT","BEGIN","END","CONTAINS"]},"negate":{"type":"boolean"},"value":{"type":"string"},"type":{"const":"string","default":"string"}},"required":["caseSensitive","negate","type"],"title":"String Predicate","additionalProperties":true,"description":"Predicate for string values; will match based on configured options."},"SubStringValueFilter":{"type":"object","properties":{"beginIndex":{"type":"integer"},"endIndex":{"type":"integer"},"type":{"const":"substring","default":"substring"}},"required":["beginIndex","type"],"title":"Substring","additionalProperties":true},"ValueAnyPredicate":{"type":"object","title":"Any value","additionalProperties":true,"description":"Predicate that matches any value including null.","properties":{"type":{"const":"value-any","default":"value-any"}},"required":["type"]},"ValueEmptyPredicate":{"type":"object","properties":{"negate":{"type":"boolean"},"type":{"const":"value-empty","default":"value-empty"}},"required":["negate","type"],"title":"Empty value","additionalProperties":true,"description":"Predicate that matches any empty/null value; unless negated."},"VelbusAgentLink":{"type":"object","properties":{"deviceAddress":{"type":"integer","minimum":1,"maximum":255},"deviceValueLink":{"type":"string","minLength":1},"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"VelbusAgentLink","default":"VelbusAgentLink"}},"required":["deviceAddress","deviceValueLink","type"],"title":"Velbus Agent Link","additionalProperties":true},"WebsocketAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"websocketSubscriptions":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/WebsocketSubscriptionImpl"},{"$ref":"#/definitions/WebsocketHTTPSubscription"}]},"description":"Array of WebsocketSubscriptions that should be executed when the linked attribute is linked; the subscriptions are executed in the order specified in the array."},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"WebsocketAgentLink","default":"WebsocketAgentLink"}},"title":"Websocket Agent Link","additionalProperties":true,"required":["type"]},"WebsocketHTTPSubscription":{"type":"object","properties":{"body":{"title":"Any Type","type":["null","number","integer","boolean","string","array","object"],"additionalProperties":true},"contentType":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"method":{"type":"string","enum":["GET","PUT","POST"]},"uri":{"type":"string"},"type":{"const":"http","default":"http"}},"title":"Websocket HTTP Subscription","additionalProperties":true,"required":["type"]},"WebsocketSubscriptionImpl":{"type":"object","properties":{"body":{"title":"Any Type","type":["null","number","integer","boolean","string","array","object"],"additionalProperties":true},"type":{"const":"websocket","default":"websocket"}},"title":"Websocket Subscription Impl","additionalProperties":true},"ZWaveAgentLink":{"type":"object","properties":{"deviceEndpoint":{"type":"integer"},"deviceNodeId":{"type":"integer"},"deviceValue":{"type":"string"},"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"ZWaveAgentLink","default":"ZWaveAgentLink"}},"title":"Z Wave Agent Link","additionalProperties":true,"required":["type"]}},"title":"Agent Link","oneOf":[{"$ref":"#/definitions/StorageSimulatorAgentLink"},{"$ref":"#/definitions/MailAgentLink"},{"$ref":"#/definitions/SNMPAgentLink"},{"$ref":"#/definitions/KNXAgentLink"},{"$ref":"#/definitions/SimulatorAgentLink"},{"$ref":"#/definitions/BluetoothMeshAgentLink"},{"$ref":"#/definitions/MockAgentLink"},{"$ref":"#/definitions/VelbusAgentLink"},{"$ref":"#/definitions/OpenWeatherMapAgentLink"},{"$ref":"#/definitions/ModbusAgentLink"},{"$ref":"#/definitions/ZWaveAgentLink"},{"$ref":"#/definitions/HTTPAgentLink"},{"$ref":"#/definitions/DefaultAgentLink"},{"$ref":"#/definitions/WebsocketAgentLink"},{"$ref":"#/definitions/MQTTAgentLink"}],"type":"object","properties":{"type":{"const":"AgentLink"}},"required":["type"]}');
+ if (!valueDescriptorSchemaHashes) {
+ const response = await manager.rest.api.StatusResource.getInfo();
+ valueDescriptorSchemaHashes = response.data.valueDescriptorSchemaHashes;
}
- loadedAgents = await loadAgents();
-
- if (!loadedAgents) {
- console.warn("Failed to load agents for agent link");
- return;
- }
-
- if (link) {
- if (link.id) {
- const matchedAgent = loadedAgents.find(agent => agent.id === link.id);
- if (!matchedAgent) {
- console.warn("Agent link: linked agent could not be found");
- link.id = "";
- }
- } else {
- link.id = "";
- }
+ const descriptor = valueDescriptor.name + "[]".repeat(valueDescriptor.arrayDimensions ?? 0);
+ const hash = valueDescriptorSchemaHashes[descriptor];
+
+ if (!schema && !schemas.has(descriptor)) {
+ const response = await manager.rest.api.AssetModelResource.getValueDescriptorSchema({
+ name: descriptor,
+ hash,
+ }, { headers: !hash ? { "Cache-Control": "no-cache" } : {} });
+ schema = response.data;
+ schemas.set(descriptor, schema);
+ // label ||= schema.title
+ } else {
+ schema = schemas.get(descriptor);
}
- // let error: ErrorMessage | undefined;
- //
- // if (!matchedAgent) {
- // console.warn("Linked agent cannot be found: " + agentLink);
- // error = "agentNotFound";
- // } else {
- // // Check agent link type
- // const agentDescriptor = AssetModelUtil.getAssetDescriptor(matchedAgent.type) as AgentDescriptor;
- // if (!agentDescriptor) {
- // console.warn("Failed to load agent descriptor for agent link: " + agentLink);
- // error = "agentNotFound";
- // } else if (agentDescriptor.agentLinkType !== agentLink.type) {
- // console.warn("Agent link type does not match agent descriptor agent link type: " + agentLink);
- // error = "agentTypeMismatch";
- // }
- // }
-
if (jsonForms.value && loadingWrapper.value) {
const forms = jsonForms.value;
forms.schema = schema;
- forms.data = link;
+ forms.data = data;
loadingWrapper.value.loading = false;
}
};
const templateFunction: ValueInputTemplateFunction = (value, focused, loading, sending, error, helperText) => {
-
- // Need to have a value so that the agent ID picker is shown
- if (!value) {
- value = {
- id: "",
- type: "DefaultAgentLink"
- };
- }
-
// Schedule loading
- window.setTimeout(() => doLoad(value as AgentLink), 0);
+ window.setTimeout(() => doLoad(value), 0);
return html`
<style>
@@ -246,7 +197,7 @@ export const jsonFormsInputTemplateProvider: (fallback: ValueInputProvider) => V
<or-loading-wrapper ${ref(loadingWrapper)} .loading="${true}">
<or-json-forms .renderers="${jsonFormsAttributeRenderers}" ${ref(jsonForms)}
.disabled="${disabled}" .readonly="${readonly}" .label="${label}"
- .schema="${schema}" label="Agent link" .uischema="${uiSchema}" .onChange="${onAgentLinkChanged}"></or-json-forms>
+ .schema="${schema}" .uischema="${uiSchema}" .onChange="${onChanged}"></or-json-forms>
</or-loading-wrapper>
`;
};
diff --git a/ui/component/or-json-forms/src/index.ts b/ui/component/or-json-forms/src/index.ts
index cd658f6f3..789e17de8 100644
--- a/ui/component/or-json-forms/src/index.ts
+++ b/ui/component/or-json-forms/src/index.ts
@@ -7,6 +7,7 @@ import {
CoreActions,
coreReducer,
createAjv,
+ createDefaultValue,
Dispatch,
generateDefaultUISchema,
generateJsonSchema,
@@ -27,6 +28,7 @@ import {getLabel, getTemplateFromProps} from "./util";
import {baseStyle} from "./styles";
import {Util} from "@openremote/core";
import {AdditionalProps} from "./base-element";
+import {i18next, translate} from "@openremote/or-translate";
declare global {
interface SymbolConstructor {
@@ -58,7 +60,7 @@ const styles = css`
`;
@customElement("or-json-forms")
-export class OrJSONForms extends LitElement implements OwnPropsOfJsonFormsRenderer, AdditionalProps {
+export class OrJSONForms extends translate(i18next)(LitElement) implements OwnPropsOfJsonFormsRenderer, AdditionalProps {
@property({type: Object})
public uischema?: UISchemaElement;
@@ -118,6 +120,10 @@ export class OrJSONForms extends LitElement implements OwnPropsOfJsonFormsRender
this.schema = this.data !== undefined ? generateJsonSchema(this.data) : {};
}
+ if (!this.data) {
+ this.data = createDefaultValue(this.schema, this.schema);
+ }
+
if (!this.uischema) {
this.uischema = generateDefaultUISchema(this.schema!);
}
@@ -139,7 +145,15 @@ export class OrJSONForms extends LitElement implements OwnPropsOfJsonFormsRender
);
}
- if (!this.contextValue || _changedProperties.has("core") || _changedProperties.has("renderers") || _changedProperties.has("cells") || _changedProperties.has("config") || _changedProperties.has("readonly")) {
+
+ if (!this.contextValue
+ || _changedProperties.has("core")
+ || _changedProperties.has("renderers")
+ || _changedProperties.has("cells")
+ || _changedProperties.has("config")
+ || _changedProperties.has("readonly")
+ || _changedProperties.has("_language")
+ ) {
this.contextValue = {
core: this.core,
renderers: this.renderers,
@@ -147,7 +161,15 @@ export class OrJSONForms extends LitElement implements OwnPropsOfJsonFormsRender
config: this.config,
uischemas: this.uischemas,
readonly: this.readonly,
- dispatch: (action: CoreActions) => this.updateCore(action)
+ dispatch: (action: CoreActions) => this.updateCore(action),
+ i18n: {
+ locale: this._language,
+ translate: (id, defaultMessage, { errors: [error] }) => {
+ const defaultValue = defaultMessage || error?.message || "";
+ return i18next.t(id, { defaultValue })
+ || i18next.t(id, { defaultValue, lng: "en" });
+ }
+ }
}
}
diff --git a/ui/component/or-translate/src/translate-mixin.ts b/ui/component/or-translate/src/translate-mixin.ts
index dc9d06c88..85add43ce 100644
--- a/ui/component/or-translate/src/translate-mixin.ts
+++ b/ui/component/or-translate/src/translate-mixin.ts
@@ -14,6 +14,7 @@ export const translate = (i18next: i18n) => <T extends Constructor<CustomElement
class extends base {
_i18nextJustInitialized = false;
+ _language: string = i18next.language;
connectedCallback() {
if (!i18next.language) {
@@ -58,8 +59,9 @@ export const translate = (i18next: i18n) => <T extends Constructor<CustomElement
public langChangedCallback = () => {
// @ts-ignore
if (this.requestUpdate) {
+ this._language = i18next.language;
// @ts-ignore
- this.requestUpdate();
+ this.requestUpdate("_language");
}
}
};