001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.velocity;
016    
017    import java.io.Writer;
018    
019    /**
020     * @author Raymond Augé
021     */
022    public interface VelocityEngine {
023    
024            public void flushTemplate(String resource);
025    
026            public VelocityContext getEmptyContext();
027    
028            public VelocityContext getRestrictedToolsContext();
029    
030            public VelocityContext getStandardToolsContext();
031    
032            public VelocityContext getWrappedRestrictedToolsContext();
033    
034            public VelocityContext getWrappedStandardToolsContext();
035    
036            public void init() throws Exception;
037    
038            public boolean mergeTemplate(
039                            String velocityTemplateId, String velocityTemplateContent,
040                            VelocityContext velocityContext, Writer writer)
041                    throws Exception;
042    
043            public boolean mergeTemplate(
044                            String velocityTemplateId, VelocityContext velocityContext,
045                            Writer writer)
046                    throws Exception;
047    
048            public boolean resourceExists(String resource);
049    
050    }