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.module.templating.renderers; |
35 |
|
|
36 |
|
import info.magnolia.cms.core.Content; |
37 |
|
import info.magnolia.context.MgnlContext; |
38 |
|
import info.magnolia.module.templating.AbstractRenderer; |
39 |
|
import info.magnolia.module.templating.RenderException; |
40 |
|
import info.magnolia.module.templating.TemplateRenderer; |
41 |
|
import info.magnolia.module.templating.Template; |
42 |
|
import org.slf4j.Logger; |
43 |
|
import org.slf4j.LoggerFactory; |
44 |
|
|
45 |
|
import javax.servlet.ServletException; |
46 |
|
import javax.servlet.http.HttpServletRequest; |
47 |
|
import javax.servlet.http.HttpServletResponse; |
48 |
|
import java.io.IOException; |
49 |
|
import java.io.PrintWriter; |
50 |
|
import java.io.Writer; |
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
@link |
55 |
|
@author |
56 |
|
@version |
57 |
|
|
58 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 3 |
Complexity Density: 0.38 |
|
59 |
|
public abstract class AbstractTemplateRenderer extends AbstractRenderer implements TemplateRenderer { |
60 |
|
private static final Logger log = LoggerFactory.getLogger(AbstractTemplateRenderer.class); |
61 |
|
|
62 |
|
|
63 |
|
@deprecated |
64 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
65 |
0
|
public void renderTemplate(Template template, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {... |
66 |
0
|
final Content content = MgnlContext.getAggregationState().getMainContent(); |
67 |
0
|
final PrintWriter out = response.getWriter(); |
68 |
0
|
try { |
69 |
0
|
renderTemplate(content, template, out); |
70 |
|
} catch (RenderException e) { |
71 |
0
|
throw new ServletException(e); |
72 |
|
} |
73 |
|
} |
74 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
75 |
0
|
public void renderTemplate(Content content, Template template, Writer out) throws RenderException, IOException {... |
76 |
0
|
try { |
77 |
0
|
render(content, template, out); |
78 |
|
} finally{ |
79 |
0
|
out.flush(); |
80 |
|
} |
81 |
|
} |
82 |
|
} |