/workspace/getTemplate

The module exports the getTemplate method which is required by the query, languageTemplates, getLayer, and getLocale modules.

Requires

Methods

(async, inner) getTemplate(template) → {Promise.<(Object|Error)>}

A JSON template object will be requested from the getTemplateObject method.

An error will be returned if the lookup failed.

A template will be requested from source if the template has not been cached.

Template modules will be constructed.

Parameters:
NameTypeDescription
templatestring
Returns:

JSON Template

Type: 
Promise.<(Object|Error)>

(async, inner) getTemplateObject(template) → {Promise.<(Object|Error)>}

The workspace will checked and cached by the Workspace API checkWorkspaceCache method.

A template object matching the template_key param in the workspace.templates{} object will be returned.

The template string will be checked to include only whitelisted character.

An error exception will be returned if the template object lookup from the workspace failed.

Parameters:
NameTypeDescription
templatestring
Returns:

JSON Template

Type: 
Promise.<(Object|Error)>