Set resources immutable 64/3164/2
authorAlpi Rimppi <alpi.rimppi@semantum.fi>
Wed, 28 Aug 2019 08:18:30 +0000 (11:18 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 17 Sep 2019 09:19:12 +0000 (12:19 +0300)
gitlab #369

Change-Id: Id1ddcc8253339ac7ab60f2772ab53d5c06547b19

bundles/org.simantics.db.common/src/org/simantics/db/common/utils/CommonDBUtils.java
bundles/org.simantics.scl.db/scl/Simantics/DBSupport.scl

index dcd3939a4f2e64d73ed288a1856b471c1ab8fd46..747e43cf1a24f1e9b2fe0c34500c285894e501cf 100644 (file)
@@ -318,6 +318,11 @@ public class CommonDBUtils {
        return xs.isClusterLoaded(clusterUID);
     }
     
+    public static void setImmutable(ReadGraph graph, Resource resource, boolean value) throws DatabaseException {
+        XSupport xs = graph.getService(XSupport.class);
+        xs.setImmutable(resource, value);
+    }
+
     public static Type getSCLType(ReadGraph graph, RuntimeEnvironment runtimeEnvironment, String typeText) throws DatabaseException {
         try {
             return Environments.getType(runtimeEnvironment.getEnvironment(), typeText);
index f6d1453f08f484c6fbde645cd56177e4cd5ace25..eddcba75bbe074dcf19b268a1488296d05f9f048 100644 (file)
@@ -9,6 +9,7 @@ importJava "org.simantics.db.common.utils.CommonDBUtils" where
     garbageResources :: <ReadGraph> [Resource]
     clusterUIDOfResource :: Resource -> <ReadGraph> ClusterUID
     isClusterLoaded :: ClusterUID -> <ReadGraph> Boolean
+    setImmutable :: Resource -> Boolean -> <ReadGraph> ()
 
 importJava "org.simantics.scl.db.SCLFunctions" where
     collectClusters :: <Proc> ()