The AbstractDispatcher class holds all the basic methods of the dispatcher.

Extends ObjectManager

Methods

_actionDispatch (context)

private

The _actionDispatch will check the view, if it is located in the query it will use that one, else the plural name of the config is used.

Also a check on the format is done, if not found the default format is used specified in the config.json file.

After all this the request is authenticated, and executed.

Parameters

Name Type Description
context CommandContext The context of the request.

Returned Value

Promise: A promise containing the closed request object.


_getComponentConfig (identifier, config)

private

The _getComponentConfig is an internal method to combine all the config object together. Usually you don't have to call this method manually.

Parameters

Name Type Description
identifier Identifier The identifier object of the object to load.
config Object The config object for the object to load.

Returned Value

Object: The complete and combined config object.


_initialize (config)

private

Inherited from ObjectManager but overwritten in lib/dispatcher/abstract.js:20

The _initialize method initializes the dispatcher, this method will set the default controller which is being requested.

Parameters

Name Type Description
config Object

Returned Value

Promise: A promise contianing the initialised object.


clone ()

The clone method will return a clone of the current object. The clone is going exactly 4 levels deep.

Returned Value

Object: The cloned object.


execute (method, context)

The execute method executes a method against the command chain.

Parameters

Name Type Description
method Object The method to execute
context Object A simple object to act as the basic context.

Returned Value

Promise: A promise containing the context with the result of the call.


getAuthenticator ()

This method will return the authenticator related to your dispatcher.

Returned Value

Promise: A promise containing your authenticator.


getCommandChain ()

The getCommandChain will return the command chain for the current object.

Returned Value

CommandChain: The command chain object.


getIdentifier ()

The getIdentifier method will return the identifier for the current object.

Returned Value

Identifier: The identifier object from Raddish-Loader


getObject (identifier, config)

The getObject method will try to load the specified identifier. An optional config can be given for the identifier to load.

Parameters

Name Type Description
identifier String|Identifier An identifier string/ object.
config Object An optional config object.

Returned Value

Promise: A promise containing the initialized object.


getView (view, format)

This method returns the controller that is related to the dispatcher and the view you have requested.

Parameters

Name Type Description
view String The requested view.
format String The requested format.

Returned Value

Promise: A promise containing the requested controller.