1
0
Fork 0

a string as action is mapped to a prefix controller

This commit is contained in:
Frank Celler 2012-10-01 12:39:11 +02:00
parent a5f83c3e8d
commit 049009ba5a
2 changed files with 1 additions and 42 deletions

View File

@ -368,7 +368,6 @@
/// <li>@ref UserManualActionsContentAction</li>
/// <li>@ref UserManualActionsContentController</li>
/// <li>@ref UserManualActionsContentPrefix</li>
/// <li>@ref UserManualActionsContentMethod</li>
/// </ul>
/// </li>
/// <li>@ref UserManualActionsReqRes</li>
@ -838,18 +837,6 @@
/// If you use an prefix controller, you should make certain that no unwanted
/// actions are available under the prefix.
///
/// @subsection UserManualActionsContentMethod Method Restriction
///
/// You can restrict the match to specific methods.
///
/// If the definition is
///
/// @code
/// { controller: "org/arangodb/actions/echoController", methods: [ "post", "put" ] }
/// @endcode
///
/// then only @LIT{POST} and @LIT{PUT} requests will match.
///
/// @section UserManualActionsReqRes Requests and Responses
///////////////////////////////////////////////////////////
///

View File

@ -188,35 +188,7 @@ function lookupCallbackAction (action) {
var module;
if (typeof action === 'string') {
path = action.split("/");
name = path.pop();
func = null;
try {
module = require(path.join("/"));
if (module.hasOwnProperty(name)) {
func = module[name];
}
else {
console.error("cannot find action named '%s' in module '%s'", name, path.join("/"));
}
}
catch (err) {
console.error("cannot find action named '%s' in module '%s': %s",
name, path.join("/"), String(err));
return null;
}
if (func === null || typeof func !== 'function') {
return null;
}
return {
controller: func,
options: {},
methods: exports.ALL_METHODS
};
return lookupCallbackAction({ prefixController: action });
}
if (action.hasOwnProperty('do')) {