From 3772b8c75d61b4617bddc8cba49c3e37d0b0e749 Mon Sep 17 00:00:00 2001 From: Jussi Koskela Date: Fri, 8 Feb 2019 15:13:31 +0200 Subject: [PATCH] Fixed broken validation of document SCL Handler expressions The implementation was originally in Simupedia but was obviously lost while moving the validation implementation to Simantics Platform. gitlab #255 Change-Id: I81c92620631caa352daa5a7380733a4edb91e938 --- .../graph/Components.pgraph | 1 + .../org.simantics.document.server/scl/Document/All.scl | 1 + .../src/org/simantics/document/server/Functions.java | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/bundles/org.simantics.document.base.ontology/graph/Components.pgraph b/bundles/org.simantics.document.base.ontology/graph/Components.pgraph index 65a75d288..e89d74589 100644 --- a/bundles/org.simantics.document.base.ontology/graph/Components.pgraph +++ b/bundles/org.simantics.document.base.ontology/graph/Components.pgraph @@ -54,6 +54,7 @@ DOC.SCLValue compileSimupediaSCLHandlerValueExpression self""" "Variable -> String" @L0.assert L0.ConvertsToValueWith DOC.Functions.sclHandlerValue : L0.ExternalValue diff --git a/bundles/org.simantics.document.server/scl/Document/All.scl b/bundles/org.simantics.document.server/scl/Document/All.scl index 6eaf328a3..a90a24bcb 100644 --- a/bundles/org.simantics.document.server/scl/Document/All.scl +++ b/bundles/org.simantics.document.server/scl/Document/All.scl @@ -144,6 +144,7 @@ importJava "org.simantics.document.server.Functions" where stateVariable :: Variable -> Variable compileDocumentSCLValueExpression :: Variable -> String + compileDocumentSCLHandlerValueExpression :: Variable -> String primitiveProperties :: DocumentProperties diff --git a/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java b/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java index 186edd252..d5a727ffa 100644 --- a/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java +++ b/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java @@ -1381,6 +1381,15 @@ public class Functions { } } + public static String compileDocumentSCLHandlerValueExpression(ReadGraph graph, Variable context) { + try { + ServerSCLHandlerValueRequest.compile(graph, context); + return ""; + } catch (Exception e) { + return resolveIssueMessage(e); + } + } + private static String resolveIssueMessage(Exception e) { if (e instanceof ImportFailureException) return ""; -- 2.47.1