API - AbstractDispatcher

Extends ObjectManager

This is the abstract dispatcher This class contains the default methods.

Methods

This function will be available for every object, this will clone the current object.

Returns Object: An exact copy of the current object

This method will dispatch the request to the correct controller.

Parameters
Name Type Description
req Object NodeJS Request Object
res Object NodeJS Response Object

Returns Promise: The promise with the parsed content.

This is a private function to allow for config extending This method takes two parameters the first is the original config and the second will be appeneded to this one.

Parameters
Name Type Description
target Object The config object.
source Object The object to extend the config object.

Get the authenticator belonging to the current dispatcher.

Returns Promise: The promised authenticator

Return the command chain to run behaviors.

Returns CommandChain: CommandChain object.

Use this function to acquire a variable from config.js

Parameters
Name Type Description
key String Key to specify the config to return

Returns Object: The requested config value.

This method will return the Controller object for the request.

Parameters
Name Type Description
req Object NodeJS Request Object
res Object NodeJS Response Object

Returns Promise: Return the Controller object.

Use this function to acquire the identifier object

Returns ObjectIdentifier: Identifier object.

This is a alias of ObjectManager.getObject to use in the "this" context.

Parameters
Name Type Description
identifier String Identifier of the object to load
config Object|null Config to push to the object

Returns Promise: call ".then" to use the object when ready.

This method will check if gzip is enabled and supported, if both are true it will gzip the data and send it to the response.

Parameters
Name Type Description
req Object The NodeJS request object
res Object The NodeJS response object
data Object The data object which needs GZipping.

Returns Promise: The encoded response.

This method will handle the exceptions thrown in the framework, if it is an instance of RaddishError it will return it to the browser.

Parameters
Name Type Description
response Object NodeJS request object.
error Object The error object.

Every object called through getObject will go through this function. This will set the identifier and adds the behaviors (if any).

Parameters
Name Type Description
config Object Object with config values

Returns Promise: call ".then" to use the object when ready.

This is the handler which will try to mixin functions from another object.

Parameters
Name Type Description
object Object The object to mix into the current object.

This method will parse the request and returns the fields and files send in the request.

Parameters
Name Type Description
req Object NodeJS Request Object

Returns Promise: Return the POST data and Files