webmcp

view framework/env/execute/action.lua @ 352:2b5bdf9028fb

Code cleanup and performance improvements regarding 404 check; Deprecated encode.action_file_path{...} and encode.view_file_path{...}
author jbe
date Thu Mar 26 16:40:04 2015 +0100 (2015-03-26)
parents eb3e236d261d
children f28b3c671378
line source
1 --[[--
2 action_status = -- status code returned by the 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

Impressum / About Us