1 | |
|
2 | |
|
3 | |
|
4 | |
package org.apache.tiles.freemarker.template; |
5 | |
|
6 | |
import java.io.IOException; |
7 | |
import java.util.Map; |
8 | |
|
9 | |
import org.apache.tiles.autotag.core.runtime.AutotagRuntime; |
10 | |
|
11 | |
import freemarker.core.Environment; |
12 | |
import freemarker.template.TemplateDirectiveBody; |
13 | |
import freemarker.template.TemplateDirectiveModel; |
14 | |
import freemarker.template.TemplateException; |
15 | |
import freemarker.template.TemplateModel; |
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
public class SetCurrentContainerFMModel implements TemplateDirectiveModel { |
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
private org.apache.tiles.template.SetCurrentContainerModel model; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | 1 | public SetCurrentContainerFMModel(org.apache.tiles.template.SetCurrentContainerModel model) { |
34 | 1 | this.model = model; |
35 | 1 | } |
36 | |
|
37 | |
|
38 | |
@SuppressWarnings("unchecked") |
39 | |
@Override |
40 | |
public void execute(Environment env, @SuppressWarnings("rawtypes") Map params, TemplateModel[] loopVars, |
41 | |
TemplateDirectiveBody body) throws TemplateException, IOException { |
42 | 0 | AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.freemarker.autotag.FreemarkerAutotagRuntime(); |
43 | 0 | if (runtime instanceof TemplateDirectiveModel) { |
44 | 0 | ((TemplateDirectiveModel) runtime).execute(env, params, loopVars, body); |
45 | |
} |
46 | 0 | org.apache.tiles.request.Request request = runtime.createRequest(); |
47 | 0 | model.execute( |
48 | |
runtime.getParameter("containerKey", java.lang.String.class, null), |
49 | |
request |
50 | |
); |
51 | 0 | } |
52 | |
} |