001    /**
002     * Copyright (c) 2000-2012 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.xml.Element;
018    
019    import java.util.List;
020    import java.util.Locale;
021    
022    /**
023     * @author Juan Fernández
024     */
025    public interface PortletDisplayTemplateHandler {
026    
027            /**
028             * Returns the class name of the portlet display template.
029             *
030             * @return the class name of the portlet display template
031             */
032            public String getClassName();
033    
034            /**
035             * Returns a list of elements containing the information of the portlet
036             * display templates to be installed by default.
037             *
038             * @return a list of elements containing the information of the portlet
039             *         display templates to be installed by default. These templates
040             *         will be installed when registering the portlet
041             * @throws Exception if an exception occurred assembling the default
042             *         template elements
043             */
044            public List<Element> getDefaultTemplateElements() throws Exception;
045    
046            /**
047             * Returns the name of the portlet display template.
048             *
049             * @param  locale the locale of the portlet display template name to get
050             * @return the name of the portlet display template
051             */
052            public String getName(Locale locale);
053    
054            /**
055             * Returns the name of the resource the portlet display template is
056             * associated with. Permissions on the resource are checked when adding a
057             * new portlet display template.
058             *
059             * @return the name of the resource
060             */
061            public String getResourceName();
062    
063            /**
064             * Returns the path to the help template of the portlet display.
065             *
066             * @param  language the language of the template
067             * @return the path to the help template of the portlet display. This
068             *         template will be shown as a help message when the user creates a
069             *         new portlet display template.
070             */
071            public String getTemplatesHelpPath(String language);
072    
073    }