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.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    }