1
14
15 package com.liferay.portal.kernel.velocity;
16
17 import java.io.Writer;
18
19
24 public class VelocityEngineUtil {
25
26 public static void flushTemplate(String resource) {
27 getVelocityEngine().flushTemplate(resource);
28 }
29
30 public static VelocityContext getEmptyContext() {
31 return getVelocityEngine().getEmptyContext();
32 }
33
34 public static VelocityContext getRestrictedToolsContext() {
35 return getVelocityEngine().getRestrictedToolsContext();
36 }
37
38 public static VelocityContext getStandardToolsContext() {
39 return getVelocityEngine().getStandardToolsContext();
40 }
41
42 public static VelocityEngine getVelocityEngine() {
43 return _velocityEngine;
44 }
45
46 public static VelocityContext getWrappedRestrictedToolsContext() {
47 return getVelocityEngine().getWrappedRestrictedToolsContext();
48 }
49
50 public static VelocityContext getWrappedStandardToolsContext() {
51 return getVelocityEngine().getWrappedStandardToolsContext();
52 }
53
54 public static void init() throws Exception {
55 getVelocityEngine().init();
56 }
57
58 public static boolean mergeTemplate(
59 String velocityTemplateId, String velocityTemplateContent,
60 VelocityContext velocityContext, Writer writer)
61 throws Exception {
62
63 return getVelocityEngine().mergeTemplate(
64 velocityTemplateId, velocityTemplateContent, velocityContext,
65 writer);
66 }
67
68 public static boolean mergeTemplate(
69 String velocityTemplateId, VelocityContext velocityContext,
70 Writer writer)
71 throws Exception {
72
73 return getVelocityEngine().mergeTemplate(
74 velocityTemplateId, velocityContext, writer);
75 }
76
77 public static boolean resourceExists(String resource) {
78 return getVelocityEngine().resourceExists(resource);
79 }
80
81 public void setVelocityEngine(VelocityEngine velocityEngine) {
82 _velocityEngine = velocityEngine;
83 }
84
85 private static VelocityEngine _velocityEngine;
86
87 }