001 /** 002 * Copyright (c) 2000-2013 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.template; 016 017 import com.liferay.portal.kernel.xml.Element; 018 019 import java.util.List; 020 import java.util.Locale; 021 import java.util.Map; 022 023 /** 024 * @author Juan Fern??ndez 025 */ 026 public interface TemplateHandler { 027 028 /** 029 * Returns the class name of the template handler. 030 * 031 * @return the class name of the template handler 032 */ 033 public String getClassName(); 034 035 /** 036 * Returns a list of elements containing the information of the portlet 037 * display templates to be installed by default. 038 * 039 * @return a list of elements containing the information of the portlet 040 * display templates to be installed by default. These templates 041 * will be installed when registering the portlet 042 * @throws Exception if an exception occurred assembling the default 043 * template elements 044 */ 045 public List<Element> getDefaultTemplateElements() throws Exception; 046 047 /** 048 * Returns the name of the template handler. 049 * 050 * @param locale the locale of the template handler name to get 051 * @return the name of the template handler 052 */ 053 public String getName(Locale locale); 054 055 /** 056 * Returns the name of the resource the template is associated with. 057 * Permissions on the resource are checked when adding a new template. 058 * 059 * @return the name of the resource 060 */ 061 public String getResourceName(); 062 063 public String[] getRestrictedVariables(String language); 064 065 /** 066 * Returns the path to the help template. 067 * 068 * @param language the language of the template 069 * @return the path to the help template. This template will be shown as a 070 * help message when the user creates a new template. 071 */ 072 public String getTemplatesHelpPath(String language); 073 074 /** 075 * Returns the name of the property in portal.properties that defines the 076 * path to the help of template. 077 * 078 * @return the name of the property in portal.properties that defines the 079 * path to the help template. 080 */ 081 public String getTemplatesHelpPropertyKey(); 082 083 public Map<String, TemplateVariableGroup> getTemplateVariableGroups( 084 long classPK, String language, Locale locale) 085 throws Exception; 086 087 }