001 /** 002 * Copyright (c) 2000-2013 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.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 }