001
014
015 package com.liferay.portlet.asset.model;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portal.kernel.exception.SystemException;
019 import com.liferay.portal.kernel.portlet.LiferayPortletRequest;
020 import com.liferay.portal.kernel.portlet.LiferayPortletResponse;
021 import com.liferay.portal.kernel.util.WebKeys;
022 import com.liferay.portal.theme.ThemeDisplay;
023
024 import javax.portlet.PortletRequest;
025 import javax.portlet.PortletURL;
026
027
031 public abstract class BaseAssetRendererFactory implements AssetRendererFactory {
032
033 public AssetRenderer getAssetRenderer(long classPK)
034 throws PortalException, SystemException {
035
036 return getAssetRenderer(classPK, TYPE_LATEST_APPROVED);
037 }
038
039 @SuppressWarnings("unused")
040 public AssetRenderer getAssetRenderer(long groupId, String urlTitle)
041 throws PortalException, SystemException {
042
043 return null;
044 }
045
046 public long getClassNameId() {
047 return _classNameId;
048 }
049
050 public String getIconPath(PortletRequest portletRequest) {
051 ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute(
052 WebKeys.THEME_DISPLAY);
053
054 return getIconPath(themeDisplay);
055 }
056
057 public String getPortletId() {
058 return _portletId;
059 }
060
061 public PortletURL getURLAdd(
062 LiferayPortletRequest liferayPortletRequest,
063 LiferayPortletResponse liferayPortletResponse) {
064
065 return null;
066 }
067
068 public boolean isSelectable() {
069 return true;
070 }
071
072 public void setClassNameId(long classNameId) {
073 _classNameId = classNameId;
074 }
075
076 public void setPortletId(String portletId) {
077 _portletId = portletId;
078 }
079
080 protected String getIconPath(ThemeDisplay themeDisplay) {
081 return themeDisplay.getPathThemeImages() + "/common/page.png";
082 }
083
084 private long _classNameId;
085 private String _portletId;
086
087 }