cloneCommandContext :: CommandContext -> <Proc> CommandContextMutable
cloneCommandContext context = merge (commandContext ()) context
+instance Show CommandContext where
+ show ctx = printContext ctx
+
importJava "org.simantics.document.server.io.CommandResult" where
data CommandResult
displayValue0 :: Variable -> <ReadGraph> String
displayValue0 var = propertyValue var "HasDisplayValue"
-consoleLog :: Variable -> String -> <ReadGraph> ()
-consoleLog state message = do
- console = state#console
- runProc $ addMessage console message
+consoleLog :: CommandContext -> String -> ()
+consoleLog context message = match possibleValue context "console" with
+ Nothing -> ()
+ Just console -> runProc $ addMessage console message
contextDocument :: CommandContext -> <Proc> IDocument
contextDocument ctx = justValue ctx "__document__"
-
-importJava "org.simantics.document.server.io.IRequest" where
- @private
- data IRequest
-
- @private
- getParameter :: IRequest -> String -> <Proc> Maybe String
-
-possibleQueryParameterFromContext :: CommandContext -> String -> <Proc> Maybe String
-possibleQueryParameterFromContext context parameter = do
- request = fromJust $ possibleValue context "__request__"
- getParameter request parameter