Class AddressDirective

java.lang.Object
ch.tocco.nice2.optional.address.impl.AddressDirective
All Implemented Interfaces:
Nice2TemplateDirective, TemplateIdentifiers, freemarker.template.TemplateDirectiveModel, freemarker.template.TemplateModel

public class AddressDirective extends Object implements Nice2TemplateDirective, TemplateIdentifiers
AddressDirective Used to display addresses in freemarker. Parameters: - entity The base entity of this directive. Paths are relative to this entity. - entityPk The key of the base entity of this directive. Paths are relative to this entity. Requires the entityModel argument. - entityModel The model of the base entity of this directive. Only needed when working with entityPk. - path The path to the address or address related entity. - pathToUser (optional) The path to a user entity. Only use this if the user needs to be explicitly overwritten. - type (optional) The @see ch.tocco.nice2.optional.address.AddressService.AddressType to be used. Default is set to AddressService.AddressType.CORRESPONDENCE. - look (optional) The @see ch.tocco.nice2.optional.address.AddressService.AddressLook to be used. Default is set to AddressService.AddressLook.PERSONAL. - html (optional) if html is set to "true", the output will be transformed into html. If not, plain text will be retuned. Keep in mind when setting as well a user as an address: - path needs to be a path to the related Address entity - pathToUser needs to be a path to the related User entity If the user is not manually overwritten, you have to use "path" to set the path to a address related entity.
  • 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