Class CardDirectiveModel
- All Implemented Interfaces:
freemarker.template.TemplateDirectiveModel,freemarker.template.TemplateModel
<@card> FreeMarker directive: adds one entry to the page contract's cards[].
html (the default) and terminal-view are built in. datatables, terminal and every other
well-formed type name is dispatched through the host's CardTypeRegistry: a registered
CardTypeHandler validates it, and an unregistered type falls back to the generic passthrough. Every type other
than html requires id=.
type="html" (the default) takes exactly one content source: a body (emitted as
<template data-card="{id}">), template= (reuses another card's template), or src= (fetched
same-origin by the shell). type="datatables" takes src= or a JSON5 catalog body and becomes the C1
bridge card. type="terminal-view" takes a JSON5
{contractVersion: '1', terminalView: {...}} body and becomes the terminal-view bridge card (see TerminalViewDef).
type="terminal" takes a JSON5 {contractVersion: '1', terminal: {...}} body and becomes the terminal
card (see TerminalDef). A card without id= gets jc-card-N. <@card> is only valid inside
<@page>; markup around it becomes jc-seg-N segments, so the authored order is kept.
Example:
<@page tab="releases"> <@card id="intro" title="Releases"><p>All releases.</p></@card> <@card type="datatables" id="releases"> { dataUrl: '/rest/releases/data', columns: [ { key: 'name', label: 'Name' } ] } </@card> </@page>
- Since:
- 10.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe shared-variable name this directive registers under.Fields inherited from interface freemarker.template.TemplateModel
NOTHING -
Method Summary
-
Field Details
-
NAME
The shared-variable name this directive registers under.- See Also:
-
-
Method Details
-
execute
public void execute(freemarker.core.Environment env, Map params, freemarker.template.TemplateModel[] loopVars, freemarker.template.TemplateDirectiveBody body) throws freemarker.template.TemplateException, IOException - Specified by:
executein interfacefreemarker.template.TemplateDirectiveModel- Throws:
freemarker.template.TemplateExceptionIOException
-