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.portlet.documentlibrary.template;
016    
017    import com.liferay.portal.kernel.language.LanguageUtil;
018    import com.liferay.portal.kernel.portletdisplaytemplate.BasePortletDisplayTemplateHandler;
019    import com.liferay.portal.kernel.repository.model.FileEntry;
020    import com.liferay.portal.kernel.util.PropsKeys;
021    import com.liferay.portal.kernel.util.StringPool;
022    import com.liferay.portal.util.PortalUtil;
023    import com.liferay.portal.util.PortletKeys;
024    import com.liferay.portal.util.PropsValues;
025    
026    import java.util.Locale;
027    
028    /**
029     * @author Eduardo Garcia
030     */
031    public class DocumentLibraryPortletDisplayTemplateHandler
032            extends BasePortletDisplayTemplateHandler {
033    
034            public String getClassName() {
035                    return FileEntry.class.getName();
036            }
037    
038            public String getName(Locale locale) {
039                    String portletTitle = PortalUtil.getPortletTitle(
040                            PortletKeys.DOCUMENT_LIBRARY, locale);
041    
042                    return portletTitle.concat(StringPool.SPACE).concat(
043                            LanguageUtil.get(locale, "template"));
044            }
045    
046            public String getResourceName() {
047                    return "com.liferay.portlet.documentlibrary";
048            }
049    
050            @Override
051            protected String getTemplatesConfigPath() {
052                    return PropsValues.DL_DISPLAY_TEMPLATES_CONFIG;
053            }
054    
055            @Override
056            protected String getTemplatesHelpKey() {
057                    return PropsKeys.DL_DISPLAY_TEMPLATES_HELP;
058            }
059    
060    }