new command()
- Copyright:
- (c) Copyright 2013 - 2016 AV Digital Media Ltd. All Rights Reserved. No unauthorized copying, distribution or modification to this code in whole or in part is permitted without the express permission of AV Digital Media Ltd (UK).
This is the main command for the mvc framework, that which all other commands extend
Methods
(static) authenticated()
Determine if the session is running on a valid login
(static) clean()
Clean the post values based on the model types
(static) command(name, data)
Retrieves a command from the notification object and executes the command passing any data supplied
Parameters:
Name | Type | Description |
---|---|---|
name |
aim.command | The command type to find and return |
data |
Object | The data to pass to the execution method |
(static) commandMapped(name)
Determine is a command has been mapped already
Parameters:
Name | Type | Description |
---|---|---|
name |
String | The name of the command |
(static) createSession(sessionData, sessionData, callback)
Create a new user session
Parameters:
Name | Type | Description |
---|---|---|
sessionData |
Object | The data properties to set in the session |
sessionData |
Object | The data properties |
callback |
function | The callback to execute |
(static) destroySession()
Destroy the active session
(static) execute()
Default execution of the command will render the default template and the current request command file, if a custom main template is required then call then render method directly
(static) getArguments()
Get the current context arguments that were passed
(static) incompatibleBrowser(data)
Page not allowed method to render the not allowed page
Parameters:
Name | Type | Description |
---|---|---|
data |
string | The data to supply to the template |
(static) map(Obj, evnt, ref)
Map an object to the notification object, this action is only permitted from commands and module objects
Parameters:
Name | Type | Description |
---|---|---|
Obj |
Object | The object to map |
evnt |
String | The event reference |
ref |
String | The reference name/id |
(static) model(name)
Retrieves the specified model reference from the notification object
Parameters:
Name | Type | Description |
---|---|---|
name |
Object | The object type to compare against and return |
(static) module(name)
Retrieves the specified module reference from the notification object
Parameters:
Name | Type | Description |
---|---|---|
name |
Object | The object type to compare against and return |
(static) query()
Call the prepare statement on a model
(static) render(data)
The method to redirect to the session timeout page
Parameters:
Name | Type | Description |
---|---|---|
data |
string | The data to supply to the template |
(static) render(template, content, data, viewObj)
Render the view component
Parameters:
Name | Type | Description |
---|---|---|
template |
string | The default template file name |
content |
string | The content file name |
data |
* | The optional data object |
viewObj |
class | Optional view component name |
(static) sendFile(path, res)
Write a response to the client, specifically for file requests
Parameters:
Name | Type | Description |
---|---|---|
path |
String | The name of the command |
res |
Object | The response object |
(static) service(name)
Retrieves the specified service reference from the notification object
Parameters:
Name | Type | Description |
---|---|---|
name |
Object | The object type to compare against and return |
(static) sessionProperty(name)
Returns the session property required
Parameters:
Name | Type | Description |
---|---|---|
name |
String | The name of the property to return |
(static) sessionTimedOut(data)
Page not allowed method to render the not allowed page
Parameters:
Name | Type | Description |
---|---|---|
data |
string | The data to supply to the template |
(static) startSession()
Start a Session on the server, this assumes that the session service was mapped by the user
(static) unmap(name)
Unmap an element from the context notification object, this action can only be performed from commands and modules
Parameters:
Name | Type | Description |
---|---|---|
name |
String | The name reference to unmap |
(static) validateSession()
Check if the user is authorized to view the page {String} role - The role identifier to compare against {Object} data - The data object passed from the startup command
(static) validateSession()
Validate the current session
(static) view(name)
Retrieves the specified view reference from the notification object
Parameters:
Name | Type | Description |
---|---|---|
name |
Object | The object type to compare against and return |