001
014
015 package com.liferay.portal.kernel.velocity;
016
017 import java.io.Writer;
018
019
022 public class VelocityEngineUtil {
023
024 public static void flushTemplate(String resource) {
025 getVelocityEngine().flushTemplate(resource);
026 }
027
028 public static VelocityContext getEmptyContext() {
029 return getVelocityEngine().getEmptyContext();
030 }
031
032 public static VelocityContext getRestrictedToolsContext() {
033 return getVelocityEngine().getRestrictedToolsContext();
034 }
035
036 public static VelocityContext getStandardToolsContext() {
037 return getVelocityEngine().getStandardToolsContext();
038 }
039
040 public static VelocityEngine getVelocityEngine() {
041 return _velocityEngine;
042 }
043
044 public static VelocityContext getWrappedRestrictedToolsContext() {
045 return getVelocityEngine().getWrappedRestrictedToolsContext();
046 }
047
048 public static VelocityContext getWrappedStandardToolsContext() {
049 return getVelocityEngine().getWrappedStandardToolsContext();
050 }
051
052 public static void init() throws Exception {
053 getVelocityEngine().init();
054 }
055
056 public static boolean mergeTemplate(
057 String velocityTemplateId, String velocityTemplateContent,
058 VelocityContext velocityContext, Writer writer)
059 throws Exception {
060
061 return getVelocityEngine().mergeTemplate(
062 velocityTemplateId, velocityTemplateContent, velocityContext,
063 writer);
064 }
065
066 public static boolean mergeTemplate(
067 String velocityTemplateId, VelocityContext velocityContext,
068 Writer writer)
069 throws Exception {
070
071 return getVelocityEngine().mergeTemplate(
072 velocityTemplateId, velocityContext, writer);
073 }
074
075 public static boolean resourceExists(String resource) {
076 return getVelocityEngine().resourceExists(resource);
077 }
078
079 public void setVelocityEngine(VelocityEngine velocityEngine) {
080 _velocityEngine = velocityEngine;
081 }
082
083 private static VelocityEngine _velocityEngine;
084
085 }