Class LoadRedirectPathDirective
java.lang.Object
ch.tocco.nice2.optional.cms.impl.directives.LoadRedirectPathDirective
- All Implemented Interfaces:
Nice2TemplateDirective
,freemarker.template.TemplateDirectiveModel
,freemarker.template.TemplateModel
Load the path for the redirect (in privileged mode).
Arguments:
- entity: The base entity
- name: The name of the variable where the result is stored
- fields: Comma separated list of fields to look up the path in
- relations: Comma separated list of relations to a ContentTreeNode entity
Presedence:
1. The first field value that is set, will be returned
2. If no field value is set, the first relation that is set will be taken.
Usage examples:
In redirect widget: [@loadRedirectPath entity=singleBase name="location" fields="location" relations="relPage"/]
In login widget: [@loadRedirectPath entity=singleBase name="location" relations="relPage"/]
-
Field Summary
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
-
Constructor Summary
ConstructorDescriptionLoadRedirectPathDirective
(RequestService requestService, ContentTreeService contentTreeService, SecurityManager securityManager) -
Method Summary
-
Constructor Details
-
LoadRedirectPathDirective
public LoadRedirectPathDirective(RequestService requestService, ContentTreeService contentTreeService, SecurityManager securityManager)
-
-
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
-