webmcp
view framework/env/execute/action.lua @ 406:36f0d1d5ed7d
Further fixes in mondelefant.connect{...} (including proper handling of garbage collection in case of memory allocation errors); Code cleanup (use luaL_setmetatable, which is available since Lua 5.2)
author | jbe |
---|---|
date | Wed Jan 06 18:59:58 2016 +0100 (2016-01-06) |
parents | f28b3c671378 |
children |
line source
1 --[[--
2 action_status = -- status code returned by action (a string), or, if "test_existence" == true, a boolean
3 execute.action{
4 module = module, -- module name of the action to be executed
5 action = action, -- name of the action to be executed
6 id = id, -- id to be returned by param.get_id(...) during execution
7 params = params, -- parameters to be returned by param.get(...) during execution
8 test_existence = test_existence -- do not execute action but only check if it exists
9 }
11 Executes an action without associated filters.
13 --]]--
15 function execute.action(args)
16 local module = args.module
17 local action = args.action
18 local test = args.test_existence
19 if not test then
20 trace.enter_action{ module = module, action = action }
21 end
22 local action_status = execute.file_path{
23 file_path = encode.file_path(
24 WEBMCP_BASE_PATH, 'app', WEBMCP_APP_NAME, module, '_action', action .. '.lua'
25 ),
26 id = args.id,
27 params = args.params,
28 test_existence = test
29 }
30 if not test then
31 trace.execution_return{ status = action_status }
32 end
33 return action_status
34 end