Class AddressDirective
java.lang.Object
ch.tocco.nice2.optional.address.impl.AddressDirective
- All Implemented Interfaces:
Nice2TemplateDirective
,TemplateIdentifiers
,freemarker.template.TemplateDirectiveModel
,freemarker.template.TemplateModel
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.templating.api.freemarker.directives.TemplateIdentifiers
TemplateIdentifiers.Scope
-
Field Summary
Fields inherited from interface ch.tocco.nice2.templating.api.freemarker.directives.TemplateIdentifiers
BASEDATA_VAR, DELIMITER_PARAM, ENTITY_PARAM, INLINE_TEMPLATE, KEY, LIMIT_PARAM, LINE_END_PARAM, LINE_START_PARAM, NAME_PARAM, PATH_PARAM, PATHS_PARAM, PATTERN_PARAM, RECIPIENT_VAR, SCOPE_PARAM, SENDER_VAR, SINGLE_BASE_VAR, TARGET_VAR, VALUE_PARAM
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
-
Constructor Summary
ConstructorDescriptionAddressDirective
(AddressService addressService, ConverterEngineFactory converterEngineFactory, Context context) -
Method Summary
-
Constructor Details
-
AddressDirective
public AddressDirective(AddressService addressService, ConverterEngineFactory converterEngineFactory, Context context)
-
-
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 interfacefreemarker.template.TemplateDirectiveModel
- Throws:
freemarker.template.TemplateException
IOException
-