Describes one page or content template that an app makes available for creating new resources, found via TemplatingApplication.appendTemplates and TemplatingApplication.findTemplateDef. Carries the template's path and display description, a factory for the prototype resource it creates, and flags for whether it can be used to create content pages or is a theme-only template.

Implements: Serializable


Properties

PropertyReturnsDescription
contentTemplatebooleanWhether this template can be used by users to create new content pages, as opposed to being theme-only.
descriptionStringThe display description shown for this template when a user picks a template to create a new page from.
editorStringThe editor used to edit content created from this template. Null selects the default KEditor; other values, such as "texteditor" or "edmEditor", select an alternative editor.
fileNameStringThe template's file name, within its parent folder.
pageTypeStringThe page type this template is associated with, used to match components that should be available for pages created from it.
parentPathStringThe path of the folder this template lives in.
pathStringThe template's full path, combining its parent folder path and file name.
prototypeCommonResourceCreates a new, empty instance of the resource type this template produces, using this template's prototype supplier. Returns null if no prototype supplier was given.
themeTemplatebooleanWhether this is a theme-only template, ie a template for templates rather than for content pages.

Methods

getParentPath() · getFileName() · getDescription() · getPath() · getPrototype() · isContentTemplate() · isThemeTemplate() · getEditor() · getPageType() · withEditor(String editor)

getParentPath()

Returns: String

The path of the folder this template lives in.

getFileName()

Returns: String

The template's file name, within its parent folder.

getDescription()

Returns: String

The display description shown for this template when a user picks a template to create a new page from.

getPath()

Returns: String

The template's full path, combining its parent folder path and file name.

getPrototype()

Returns: CommonResource

Creates a new, empty instance of the resource type this template produces, using this template's prototype supplier. Returns null if no prototype supplier was given.

isContentTemplate()

Returns: boolean

Whether this template can be used by users to create new content pages, as opposed to being theme-only.

isThemeTemplate()

Returns: boolean

Whether this is a theme-only template, ie a template for templates rather than for content pages.

getEditor()

Returns: String

The editor used to edit content created from this template. Null selects the default KEditor; other values, such as "texteditor" or "edmEditor", select an alternative editor.

getPageType()

Returns: String

The page type this template is associated with, used to match components that should be available for pages created from it.

withEditor(String editor)

Returns: TemplateDef

Returns a copy of this template definition with the given editor set. Used to fluently override the editor on a template built from one of the other constructors.

ParameterDescription
editorthe editor name to set on the new template definition
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.