webmcp
view framework/env/execute/action.lua @ 376:4bcedf32b089
Allow direct (proxy) access to fields of JSON object in a special column (set in the model) (write access not implemented yet)
| author | jbe | 
|---|---|
| date | Sat Nov 14 17:07:03 2015 +0100 (2015-11-14) | 
| 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
