]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.db/scl/Simantics/DB.scl
Lots of fixes for PrettyPrintTG
[simantics/platform.git] / bundles / org.simantics.scl.db / scl / Simantics / DB.scl
index e42af1878214e75fdf90378fdafa57631b33aa57..df556086ed6ab61d0aa1458f5d6da06e24955172 100644 (file)
@@ -1,5 +1,6 @@
 import "JavaBuiltin" as Java
 include "http://www.simantics.org/Layer0-1.1" as L0
+import "Map" as Map
 
 infixl 5 (#)
  
@@ -42,6 +43,8 @@ importJava "org.simantics.db.Statement" where
     @JavaName getObject
     objectOf :: Statement -> Resource
     
+    isAsserted :: Statement -> Resource -> <ReadGraph> Boolean
+    
 importJava "org.simantics.db.ReadGraph" where
     "Converts an absolute URI to a resource or returns `Nothing` if there is no such resource."
     @JavaName getPossibleResource
@@ -84,6 +87,9 @@ importJava "org.simantics.db.ReadGraph" where
     @JavaName getSingleStatement
     singleStatement :: Resource -> Resource -> <ReadGraph> Statement
 
+    @JavaName getPossibleStatement
+    possibleStatement :: Resource -> Resource -> <ReadGraph> Maybe Statement
+
     @JavaName getRelatedVariantValue
     relatedVariantValue :: Resource -> Resource -> <ReadGraph> Variant
 
@@ -256,6 +262,22 @@ importJava "org.simantics.db.common.utils.OrderedSetUtils" where
 importJava "org.simantics.db.common.utils.ListUtils" where
     @JavaName toList
     elementsOfList :: Resource -> <ReadGraph> [Resource]
+    
+    @JavaName create
+    createList :: [Resource] -> <WriteGraph> Resource
+    
+    @javaName insertBack
+    insertBack :: Resource -> [Resource] -> <WriteGraph> ()
+    
+    @javaName removeElement
+    removeElement :: Resource -> Resource -> <WriteGraph> Boolean
+    
+    @javaName swapWithPrevious
+    swapWithPrevious :: Resource -> Resource -> <WriteGraph> Boolean
+
+    @javaName swapWithNext
+    swapWithNext :: Resource -> Resource -> <WriteGraph> Boolean
+
 
 importJava "org.simantics.db.common.utils.CommonDBUtils" where
     isParent :: Resource -> Resource -> <ReadGraph> Boolean
@@ -302,6 +324,13 @@ importJava "org.simantics.scl.db.SCLFunctions" where
     unaryQuery :: (a -> <ReadGraph,e> b) -> a -> <ReadGraph> b
     unaryQueryCached :: (a -> <ReadGraph,e> b) -> a -> <ReadGraph> b
 
+    "Makes a new read request with given procedure for calculating the result. The request is cached only if the current request is listened."
+    subquery :: (<ReadGraph,Proc> a) -> <ReadGraph,Proc> a
+    "Makes a new read request with given procedure for calculating the result. The request is always cached."
+    subqueryC :: (<ReadGraph,Proc> a) -> <ReadGraph,Proc> a
+    "Tries to convert the given Dynamic value to a value with the inferred type"
+    possibleFromDynamic :: Typeable a => String -> Dynamic -> Maybe a
+
 importJava "org.simantics.db.layer0.util.Layer0Utils" where
     undo :: () -> <Proc> String
     undoOperations :: Integer -> <Proc> String
@@ -314,6 +343,7 @@ importJava "org.simantics.db.layer0.util.Layer0Utils" where
     listOntologies :: () -> <ReadGraph> [Resource]
     emptyTrashBin :: () -> <Proc> ()
     purgeDatabase :: () -> <Proc> ()
+    prettyPrintResource :: Resource -> Boolean -> <ReadGraph> String
 
     @private
     @JavaName copyTo