info.magnolia.module.templatingcomponents.freemarker
Class EditBarDirective

java.lang.Object
  extended by info.magnolia.module.templatingcomponents.freemarker.AbstractDirective
      extended by info.magnolia.module.templatingcomponents.freemarker.EditBarDirective
All Implemented Interfaces:
freemarker.template.TemplateDirectiveModel, freemarker.template.TemplateModel

public class EditBarDirective
extends AbstractDirective

A freemarker directive for the edit bar UI component.

Version:
$Revision: $ ($Author: $)
Author:
gjoseph

Field Summary
 
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
 
Constructor Summary
EditBarDirective()
           
 
Method Summary
protected  AuthoringUiComponent prepareUIComponent(ServerConfiguration serverCfg, AggregationState aggState, freemarker.core.Environment env, Map<String,freemarker.template.TemplateModel> params, freemarker.template.TemplateModel[] loopVars, freemarker.template.TemplateDirectiveBody body)
          Implementations of this method should return a AuthoringUiComponent, prepared with the known parameters.
 
Methods inherited from class info.magnolia.module.templatingcomponents.freemarker.AbstractDirective
_param, bool, checkBody, content, doBody, execute, mandatoryBool, mandatoryContent, mandatoryString, mandatoryStringList, string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditBarDirective

public EditBarDirective()
Method Detail

prepareUIComponent

protected AuthoringUiComponent prepareUIComponent(ServerConfiguration serverCfg,
                                                  AggregationState aggState,
                                                  freemarker.core.Environment env,
                                                  Map<String,freemarker.template.TemplateModel> params,
                                                  freemarker.template.TemplateModel[] loopVars,
                                                  freemarker.template.TemplateDirectiveBody body)
                                           throws freemarker.template.TemplateModelException,
                                                  IOException
Description copied from class: AbstractDirective
Implementations of this method should return a AuthoringUiComponent, prepared with the known parameters. If parameters have been grabbed using the methods provided by this class, they should be removed from the map, thus leaving an empty map once the method returns. AbstractDirective.execute(freemarker.core.Environment, java.util.Map, freemarker.template.TemplateModel[], freemarker.template.TemplateDirectiveBody) will throw a TemplateModelException if there are leftover parameters. note: The current FreeMarker implementation passes a "new" Map which we can safely manipulate. is thrown away after the execution of the directive. When no parameters are passed, the Map is readonly, but it is otherwise a regular HashMap which has been instantiated shortly before the execution of the directive. However, since this behavior is not mandated by their API, nor documented (at the time of writing, with FreeMarker 2.3.16), we should exert caution. Unit tests hopefully cover this, so we'll be safe when updating to newer FreeMarker versions.

Specified by:
prepareUIComponent in class AbstractDirective
Throws:
freemarker.template.TemplateModelException
IOException


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.