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.trash;
016    
017    import com.liferay.portal.kernel.util.WebKeys;
018    import com.liferay.portal.theme.ThemeDisplay;
019    import com.liferay.portlet.trash.util.TrashUtil;
020    
021    import javax.portlet.PortletRequest;
022    import javax.portlet.RenderRequest;
023    import javax.portlet.RenderResponse;
024    
025    /**
026     * @author Alexander Chow
027     */
028    public abstract class BaseTrashRenderer implements TrashRenderer {
029    
030            @Override
031            public String getIconPath(PortletRequest portletRequest) {
032                    ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute(
033                            WebKeys.THEME_DISPLAY);
034    
035                    return getIconPath(themeDisplay);
036            }
037    
038            public String getIconPath(ThemeDisplay themeDisplay) {
039                    return themeDisplay.getPathThemeImages() + "/common/page.png";
040            }
041    
042            @Override
043            public String getNewName(String oldName, String token) {
044                    return TrashUtil.getNewName(oldName, token);
045            }
046    
047            @Override
048            public String render(
049                            RenderRequest renderRequest, RenderResponse renderResponse,
050                            String template)
051                    throws Exception {
052    
053                    return null;
054            }
055    
056            @Override
057            public String renderActions(
058                            RenderRequest renderRequest, RenderResponse renderResponse)
059                    throws Exception {
060    
061                    return null;
062            }
063    
064    }