X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.scl.db%2Fscl%2FSimantics%2FDB.scl;h=2ff2f51acb11f455459bc64a8663e06961547129;hb=6320ecb3f75e3a29ed620ca5425ca22ef88a5496;hp=d7c1dde060eb923949520f96a52da6785164c465;hpb=3d8c21802176627ba3ff724980bf7606bcbb5100;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.db/scl/Simantics/DB.scl b/bundles/org.simantics.scl.db/scl/Simantics/DB.scl index d7c1dde06..2ff2f51ac 100644 --- a/bundles/org.simantics.scl.db/scl/Simantics/DB.scl +++ b/bundles/org.simantics.scl.db/scl/Simantics/DB.scl @@ -108,6 +108,9 @@ importJava "org.simantics.db.ReadGraph" where @JavaName getRelatedValue2 relatedValue2 :: Resource -> Resource -> a + @JavaName getPossibleRelatedValue2 + possibleRelatedValue2 :: Resource -> Resource -> Maybe a + @JavaName getRelatedVariantValue2 relatedVariantValue2 :: Resource -> Resource -> Variant @@ -151,6 +154,8 @@ importJava "org.simantics.db.ReadGraph" where @JavaName getPredicates predicatesOf :: Resource -> [Resource] + + isImmutable :: Resource -> Boolean importJava "org.simantics.db.layer0.util.ExtendedUris" where "Converts an absolute URI to a resource" @@ -185,6 +190,9 @@ class Browsable a where valueOf :: Serializable v => a -> v + genericRelatedValue :: a -> Resource -> t + genericPossibleRelatedValue :: a -> Resource -> Maybe t + variantValueOf :: a -> Variant children :: a -> [a] @@ -204,6 +212,9 @@ instance Browsable Resource where valueOf r = valueOf_ r binding variantValueOf = variantValueOf_ + genericRelatedValue = relatedValue2 + genericPossibleRelatedValue = possibleRelatedValue2 + children r = r # L0.ConsistsOf parent r = singleObject r L0.PartOf possibleParent r = possibleObject r L0.PartOf @@ -331,8 +342,8 @@ importJava "org.simantics.scl.db.SCLFunctions" where "Begins a write transaction and immediately returns." asyncWrite :: (() -> a) -> () - virtualSyncWriteMem :: String -> (() -> a) -> a - virtualSyncWriteWS :: String -> (() -> a) -> a + virtualSyncWriteMem :: String -> (() -> a) -> a + virtualSyncWriteWS :: String -> (() -> a) -> a safeExec :: (() -> a) -> a activateOnce :: Resource -> ()