Class LoadThumbnailDirective

java.lang.Object
ch.tocco.nice2.dms.impl.freemarker.LoadThumbnailDirective
All Implemented Interfaces:
Nice2TemplateDirective, freemarker.template.TemplateDirectiveModel, freemarker.template.TemplateModel

public class LoadThumbnailDirective extends Object implements Nice2TemplateDirective
This directive loads a thumbnail resource from an entity. Parameters: * entity (optional): The thumbnail resource entity or the baseEntity (default) from which to gather the thumbnail. * field (optional): The name of the field if the given entity is not a Resource entity. * format (optional): The format which will be used to deliver the thumbnail (e.g. "jpg" or "png"). Defaults to "png" if the source binary is a PNG, otherwise "jpg". * width (optional): The width of the thumbnail. If not provided, it will be proportional to @param height. * height (optional): The height of the thumbnail. If not provided, it will be proportional to @param width. * base64 (optional): When true, the binary is inlined as base64 content (otherwise URL is returned). * unpublished (optional): true if unpublished resources should be used as well, false or no parameter otherwise.
  • Constructor Details

  • 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