001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }