1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package info.magnolia.rendering.context;
35
36 import info.magnolia.rendering.engine.OutputProvider;
37 import info.magnolia.rendering.engine.RenderException;
38 import info.magnolia.rendering.listeners.AbstractRenderingListener;
39 import info.magnolia.rendering.listeners.AbstractRenderingListener.RenderingListenerReturnCode;
40 import info.magnolia.rendering.template.AreaDefinition;
41 import info.magnolia.rendering.template.RenderableDefinition;
42 import info.magnolia.rendering.util.AppendableWriter;
43
44 import java.io.IOException;
45 import java.io.OutputStream;
46 import java.util.Collection;
47 import java.util.List;
48 import java.util.Map;
49
50 import javax.jcr.Node;
51
52
53
54
55 public interface RenderingContext {
56
57 Node getMainContent();
58
59 Node getCurrentContent();
60
61 RenderableDefinition getRenderableDefinition();
62
63 AreaDefinition getParentAreaDefinition();
64
65 RenderableDefinition getAncestorDefinition(int level);
66
67 OutputProvider getOutputProvider();
68
69
70
71
72
73 void push(Node content, RenderableDefinition renderableDefinition);
74
75
76
77
78
79
80 void push(Node content, RenderableDefinition renderableDefinition, OutputProvider outputProvider);
81
82 void pop();
83
84 AppendableWriter getAppendable() throws IOException;
85
86 OutputStream getOutputStream() throws IOException;
87
88 void handleException(RenderException renderException);
89
90 void addListener(AbstractRenderingListener renderingListener);
91
92 void setListeners(List<AbstractRenderingListener> listeners);
93
94
95 Collection<RenderingListenerReturnCode> before(Node content, RenderableDefinition definition, Map<String, Object> contextObjects, OutputProvider out);
96
97
98 void after(Node content, RenderableDefinition definition, Map<String, Object> contextObjects, OutputProvider out);
99
100 }