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.portlet.journal.util;
016    
017    import com.liferay.portal.kernel.xml.Element;
018    import com.liferay.portlet.journal.TransformException;
019    
020    import java.util.List;
021    import java.util.Map;
022    
023    /**
024     * @author         Alexander Chow
025     * @author         Brian Wing Shun Chan
026     * @author         Raymond Augé
027     * @deprecated
028     */
029    public class JournalVmUtil {
030    
031            public static List<TemplateNode> extractDynamicContents(Element parent)
032                    throws TransformException {
033    
034                    return _instance._velocityTemplateParser.extractDynamicContents(
035                            null, parent);
036            }
037    
038            public static String transform(
039                            Map<String, String> tokens, String viewMode, String languageId,
040                            String xml, String script)
041                    throws TransformException {
042    
043                    return _instance._velocityTemplateParser.transform(
044                            null, tokens, viewMode, languageId, xml, script);
045            }
046    
047            private JournalVmUtil() {
048                    _velocityTemplateParser = new VelocityTemplateParser();
049            }
050    
051            private static JournalVmUtil _instance = new JournalVmUtil();
052    
053            private VelocityTemplateParser _velocityTemplateParser;
054    
055    }