Template Engine

Class Template

Extends:
EventDispatcher
Requires:
Class
Event
EventDispatcher
JsonRpcAbstract
JsonRpcError
JsonRpcResult
TemplateManager
Defined in:
Template.js

Template Base template class.

Constructor

Template(name, configuration)
Representing template.

Static Fields

Field
[constant]
[constant]
[constant]
[constant]
Template.ERROR
[constant]
Template.RENDERED
[constant]

Fields

Field
Indicates if template is a child of parent.
Indicates if template was rendered.

Methods

Method
addChild(child)
Adding child template
Inherited from EventDispatcher
addEventListener(type, callbackFunction, context)
Adding listener
Inherited from EventDispatcher
Dispatches event
Dispatchig render action and handles its errors and exceptions.
Returns content generated by specific render engine
Returns error handler
Returns template name
Returns template location path
Returns template manager who holds every template in the subtree
Inherited from EventDispatcher
Checks if given event type listener is registered
onData(e)
Handling model load.
Handling model error.
Inherited from EventDispatcher
Remove group of listeners or all listeners
Inherited from EventDispatcher
removeEventListener(type, callbackFunction)
Remove listener
render(data)
Abstract method.
Setting rendering result
setTemplateManager(templateManager)
Sets template manager object which holds every template in the subtree
Class Detail
Template(name, configuration)
Parameters (optional)
name {String}
configuration {Object}
Throws:
{Template.Exception.CONFIG_INVALID} if given name or configuration are invalid.
Static Field Details
Template.ACTION_ERROR_ABORT
[constant]
Template.ACTION_ERROR_DEFAULT
[constant]
Template.ACTION_ERROR_DISCARD
[constant]
Template.ACTION_ERROR_PROPAGATE
[constant]
Template.ERROR
[constant]
Template.RENDERED
[constant]
Field Details
hasParent
Indicates if template is a child of parent.
isRendered
Indicates if template was rendered.
Method Details
addChild(child)
Adding child template
Parameters (optional)
child {Template}
dispatchRender(data)
Dispatchig render action and handles its errors and exceptions.
Parameters (optional)
data {Object}
Throws:
{Template.Exception.NOT_IMPLEMENTED} if method render wasn't overriden
getContent() :{String}
Returns content generated by specific render engine
Returns:
{String}
getErrorAction() :{CONST}
Returns error handler
Returns:
{CONST}
getName() :{String}
Returns template name
Returns:
{String}
getPath() :{String}
Returns template location path
Returns:
{String} template path
getTemplateManager() :{TemplateManager}
Returns template manager who holds every template in the subtree
Returns:
{TemplateManager}
onData(e)
Handling model load. Called on DriverAbstract.LOADED
Parameters (optional)
e {Event}
onDataError(e)
Handling model error. Called on DriverAbstract.ERROR
Parameters (optional)
e {ErrorEvent}
render(data)
Abstract method. Needed to be overriden - otherwise Template.Exception.NOT_IMPLEMENTED will be throwed.
Parameters (optional)
data {Object}
setRenderedData(data)
Setting rendering result
Parameters (optional)
data {Object}
setTemplateManager(templateManager)
Sets template manager object which holds every template in the subtree
Parameters (optional)
templateManager {TemplateManager}
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Aug 17 2011 15:33:34 GMT+0200 (CEST)