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.security.permission.PermissionChecker;
023 import com.liferay.portal.theme.ThemeDisplay;
024
025 import javax.portlet.PortletRequest;
026 import javax.portlet.PortletURL;
027
028
033 public abstract class BaseAssetRendererFactory implements AssetRendererFactory {
034
035 public AssetRenderer getAssetRenderer(long classPK)
036 throws PortalException, SystemException {
037
038 return getAssetRenderer(classPK, TYPE_LATEST_APPROVED);
039 }
040
041
045 public AssetRenderer getAssetRenderer(long groupId, String urlTitle)
046 throws PortalException, SystemException {
047
048 return null;
049 }
050
051 public long getClassNameId() {
052 return _classNameId;
053 }
054
055 public String getIconPath(PortletRequest portletRequest) {
056 ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute(
057 WebKeys.THEME_DISPLAY);
058
059 return getIconPath(themeDisplay);
060 }
061
062 public String getPortletId() {
063 return _portletId;
064 }
065
066 public PortletURL getURLAdd(
067 LiferayPortletRequest liferayPortletRequest,
068 LiferayPortletResponse liferayPortletResponse) {
069
070 return null;
071 }
072
073 public boolean hasPermission(
074 PermissionChecker permissionChecker, long classPK, String actionId)
075 throws Exception {
076
077 return true;
078 }
079
080 public boolean isSelectable() {
081 return true;
082 }
083
084 public void setClassNameId(long classNameId) {
085 _classNameId = classNameId;
086 }
087
088 public void setPortletId(String portletId) {
089 _portletId = portletId;
090 }
091
092 protected String getIconPath(ThemeDisplay themeDisplay) {
093 return themeDisplay.getPathThemeImages() + "/common/page.png";
094 }
095
096 private long _classNameId;
097 private String _portletId;
098
099 }