API - AbstractController

Extends ObjectManager

This class holds all the basic function calls from the controller.

Methods

Only when a user is authenticated return true else return false.

Parameters
Name Type Description
context CommandContext The complete context from the controller

Returns Promise: Containing true by default

Return true by default on a browse request.

Parameters
Name Type Description
context CommandContext The complete context from the controller

Returns Promise: Containing true by default

Only when a user is authenticated return true else return false.

Parameters
Name Type Description
context CommandContext The complete context from the controller

Returns Promise: Containing true by default

Only when a user is authenticated return true else return false.

Parameters
Name Type Description
context CommandContext The complete context from the controller

Returns Promise: Containing true by default

Basic permissions for a GET request, This function is here for basic purposes.

Parameters
Name Type Description
context CommandContext The context object with authentication information.

Returns Promise:

Basic permissions for a PATCH request, This function is here for basic purposes.

Parameters
Name Type Description
context CommandContext The context object with authentication information.

Returns Promise:

Basic permissions for a POST request, This function is here for basic purposes.

Parameters
Name Type Description
context CommandContext The context object with authentication information.

Returns Promise:

Basic permissions for a PUT request, This function is here for basic purposes.

Parameters
Name Type Description
context CommandContext The context object with authentication information.

Returns Promise:

Return true by default on a browse request.

Parameters
Name Type Description
context CommandContext The complete context from the controller

Returns Promise: Containing true by default

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

Returns Object: An exact copy of the current object

Execute function will execute a command given the method. This command will use the context for the behaviors.

Parameters
Name Type Description
method String Name of the action to execute.
context Object Data got from the request.

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.

The forward method forwards the complete context to another action. THis will return the promise for that specific action.

Parameters
Name Type Description
method String The method to forward to.
context Object The context specified for that method.

Returns Promise: The promise for the specified method.

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 function will return the context of the current controller.

Returns CommandContext: Context object.

Use this function to acquire the identifier object

Returns ObjectIdentifier: Identifier object.

This function returns the model matching the controller name. Also this method will automatically set the states.

Returns Promise: The initialized model object with set states

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 returns the permission set of the current controller.

Returns Promise: The complete permissions set

This method returns the complete request.

Returns Object: The states in the request

This method will return the initialize view matching the format given in the request or on the default.

Returns Promise: The initialized view object

This function will initialize the controller, it will set the request and response got from the dispatcher.

Parameters
Name Type Description
config Object|null Config object for extra configuration.

Returns Promise: The initialized controller object.

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.