Class ConsoleSlotDirectiveModel

java.lang.Object
org.apache.juneau.console.freemarker.ConsoleSlotDirectiveModel
All Implemented Interfaces:
freemarker.template.TemplateDirectiveModel, freemarker.template.TemplateModel

public final class ConsoleSlotDirectiveModel extends Object implements freemarker.template.TemplateDirectiveModel
The capture-only console slot directives: <@head>, <@scripts>, <@brand>, <@actions>, <@title>, <@footer>, and <@body>. One parameterized instance is registered per slot name (its PageCapture field), so the seven directives share this one class.

Each is authored inside <@console>. During the console's body pass this directive captures its rendered body into the matching PageCapture field and emits nothing at the author's position; <@console> then places each captured slot into the fixed document at its correct spot (chrome-level <@head>/<@scripts> in the head/end-of-body pass-throughs; <@brand>/<@actions>/ <@title> in the header; <@footer> as the single footer; <@body> spliced onto the <body> tag). A slot authored outside a <@console> (no PageCapture in scope) is rejected fail-closed.

phase= (head/scripts only):

<@head> and <@scripts> accept an optional phase= that steers the capture to a distinct cascade position: <@head phase="before-page-css"> lands app CSS before the page-local <@page css=> links (e.g. a.css), so a page css= rule still wins, and <@scripts phase="after-toolkit"> lands scripts between the toolkit JS and the page-local <@page init=> scripts (e.g. one.js). Any other slot rejects phase=; an unrecognized value is rejected fail-closed.

Since:
10.0.0
  • Field Summary

    Fields inherited from interface freemarker.template.TemplateModel

    NOTHING
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    execute(freemarker.core.Environment env, Map params, freemarker.template.TemplateModel[] loopVars, freemarker.template.TemplateDirectiveBody body)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      execute in interface freemarker.template.TemplateDirectiveModel
      Throws:
      freemarker.template.TemplateException
      IOException