1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.asset.model;
16  
17  import com.liferay.portal.kernel.exception.PortalException;
18  import com.liferay.portal.kernel.exception.SystemException;
19  import com.liferay.portal.kernel.portlet.LiferayPortletRequest;
20  import com.liferay.portal.kernel.portlet.LiferayPortletResponse;
21  import com.liferay.portal.kernel.util.WebKeys;
22  import com.liferay.portal.theme.ThemeDisplay;
23  
24  import javax.portlet.PortletRequest;
25  import javax.portlet.PortletURL;
26  
27  /**
28   * <a href="BaseAssetRendererFactory.java.html"><b><i>View Source</i></b></a>
29   *
30   * @author Jorge Ferrer
31   * @author Juan Fernández
32   */
33  public abstract class BaseAssetRendererFactory implements AssetRendererFactory {
34  
35      @SuppressWarnings("unused")
36      public AssetRenderer getAssetRenderer(long groupId, String urlTitle)
37          throws PortalException, SystemException {
38  
39          return null;
40      }
41  
42      public long getClassNameId() {
43          return _classNameId;
44      }
45  
46      public String getIconPath(PortletRequest portletRequest) {
47          ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute(
48              WebKeys.THEME_DISPLAY);
49  
50          return getIconPath(themeDisplay);
51      }
52  
53      public String getPortletId() {
54          return _portletId;
55      }
56  
57      public PortletURL getURLAdd(
58          LiferayPortletRequest liferayPortletRequest,
59          LiferayPortletResponse liferayPortletResponse) {
60  
61          return null;
62      }
63  
64      public boolean isSelectable() {
65          return true;
66      }
67  
68      public void setClassNameId(long classNameId) {
69          _classNameId = classNameId;
70      }
71  
72      public void setPortletId(String portletId) {
73          _portletId = portletId;
74      }
75  
76      protected String getIconPath(ThemeDisplay themeDisplay) {
77          return themeDisplay.getPathThemeImages() + "/common/page.png";
78      }
79  
80      private long _classNameId;
81      private String _portletId;
82  
83  }