1 include "Simantics/Entity" hiding (nameOf)
2 include "Simantics/Ontologies"
5 type Configuration = Resource
10 Returns an existing model in the current project with the given `name`
12 model :: String -> <ReadGraph> Model
13 model name = match possibleResourceChild (currentProject ()) name with
15 Nothing -> fail $ "Didn't find a model " + name + "."
20 Returns the configuration of the given `model`
21 and returns the `configuration` resource
23 configurationOf :: Model -> <ReadGraph> Configuration
24 configurationOf m = singleObject m SIMU.HasConfiguration
27 Returns the list of all models in the current project.
29 allModels :: () -> <ReadGraph> [Model]
30 allModels _ = objectsWithType (currentProject ()) L0.ConsistsOf SIMU.Model
32 importJava "org.simantics.modeling.ModelingUtils" where
33 """Removes the index associated with the model."""
34 removeIndex :: Model -> <WriteGraph> ()
36 resetIssueSources :: Model -> <WriteGraph> ()
38 """Copies annotation types from one model to another."""
39 copyAnnotationTypes :: Model -> Model -> <WriteGraph> ()
41 deleteIndex :: Resource -> <WriteGraph> ()
42 releaseMemory :: () -> <WriteGraph> ()
44 searchByType :: Resource -> Resource -> <ReadGraph> [Resource]
45 searchByTypeShallow :: Resource -> Resource -> <ReadGraph> [Resource]
46 searchByTypeAndName :: Resource -> Resource -> String -> <ReadGraph> [Resource]
47 searchByTypeAndNameShallow :: Resource -> Resource -> String -> <ReadGraph> [Resource]
48 searchByQuery :: Resource -> String -> <ReadGraph> [Resource]
49 searchByQueryShallow :: Resource -> String -> <ReadGraph> [Resource]
50 searchByTypeAndFilter :: Resource -> Resource -> (Resource -> <ReadGraph> Boolean) -> <ReadGraph> [Resource]
52 listIndexEntries :: Resource -> String -> <ReadGraph> String
53 activateModel :: Resource -> <WriteGraph> Boolean
56 createGenericModel :: Resource -> String -> <WriteGraph> Resource
58 importJava "org.simantics.modeling.ModelingUtils" where
59 @JavaName getPossibleModel
60 getPossibleModel :: Resource -> <ReadGraph> Model
61 possibleIndexRoot :: Resource -> <ReadGraph> Maybe Resource
63 activateModelAction :: Resource -> <Proc> ()
64 activateModelAction model = do
65 syncWrite (\() -> activateModel model)