001    /**
002     * Copyright (c) 2000-present 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.portletdisplaytemplate;
016    
017    import com.liferay.portal.kernel.template.TemplateVariableGroup;
018    import com.liferay.portlet.dynamicdatamapping.DDMTemplate;
019    
020    import java.util.List;
021    import java.util.Map;
022    
023    import javax.servlet.http.HttpServletRequest;
024    import javax.servlet.http.HttpServletResponse;
025    
026    /**
027     * @author Leonardo Barros
028     */
029    public interface PortletDisplayTemplateManager {
030    
031            public static final String DISPLAY_STYLE_PREFIX = "ddmTemplate_";
032    
033            public static final String ENTRIES = "entries";
034    
035            public DDMTemplate getDDMTemplate(
036                    long groupId, long classNameId, String displayStyle,
037                    boolean useDefault);
038    
039            public String getDisplayStyle(String ddmTemplateKey);
040    
041            public Map<String, TemplateVariableGroup> getTemplateVariableGroups(
042                    String language);
043    
044            public String renderDDMTemplate(
045                            HttpServletRequest request, HttpServletResponse response,
046                            long templateId, List<?> entries,
047                            Map<String, Object> contextObjects)
048                    throws Exception;
049    
050    }