1 import "Simantics/Model"
2 import "Simantics/Ontologies"
5 importJava "org.simantics.document.ui.actions.ImportDocumentWithDetail" where
6 importDocumentWithDetailSCL :: Resource -> String -> <WriteGraph> Resource
8 importJava "org.simantics.document.ui.graphfile.FileDocumentUtil" where
9 importFolderWithName :: String -> Resource -> Resource -> Resource -> ProgressMonitor -> <WriteGraph> Resource
11 importJava "org.simantics.document.ui.actions.AddUrlDocumentWithDetail" where
12 addUrlDocumentWithDetailSCL :: Resource -> String -> String -> <WriteGraph> Resource
14 importJava "org.simantics.document.ui.actions.ExportDocumentFile" where
15 exportDocument :: Resource -> String -> <Proc> ()
17 documentsFolders :: Model -> <ReadGraph> [Resource]
18 documentsFolders model = recurse DOCUMENT.DocumentLibrary model
22 libraries = filter isLibrary cs
23 libraryGrp = filter (not . isLibrary) cs
24 libraries + concatMap (recurse t) libraryGrp
25 isLibrary r = isInstanceOf r DOCUMENT.DocumentLibrary
27 documents :: Model -> <ReadGraph> [Resource]
28 documents model = recurse DOCUMENT.Document model
32 documents = filter isDocument cs
33 documentFolder = filter (not . isDocument) cs
34 documents + concatMap (recurse t) documentFolder
35 isDocument r = isInstanceOf r DOCUMENT.Document
37 document :: Model -> String -> <ReadGraph> [Resource]
38 document model name = do
39 docs = documents model
40 filter (\x -> (relatedValue2 x L0.HasName :: String) == name) docs