001    /**
002     * Copyright (c) 2000-2010 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.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.security.permission.PermissionChecker;
022    
023    import javax.portlet.PortletRequest;
024    import javax.portlet.PortletURL;
025    
026    /**
027     * @author Jorge Ferrer
028     * @author Juan Fernández
029     * @author Raymond Augé
030     */
031    public interface AssetRendererFactory {
032    
033            public static int TYPE_LATEST = 0;
034    
035            public static int TYPE_LATEST_APPROVED = 1;
036    
037            public AssetRenderer getAssetRenderer(long classPK)
038                    throws PortalException, SystemException;
039    
040            public AssetRenderer getAssetRenderer(long classPK, int type)
041                    throws PortalException, SystemException;
042    
043            public AssetRenderer getAssetRenderer(long groupId, String urlTitle)
044                    throws PortalException, SystemException;
045    
046            public String getClassName();
047    
048            public long getClassNameId();
049    
050            public String getIconPath(PortletRequest portletRequest);
051    
052            public String getPortletId();
053    
054            public String getType();
055    
056            public PortletURL getURLAdd(
057                    LiferayPortletRequest liferayPortletRequest,
058                    LiferayPortletResponse liferayPortletResponse);
059    
060            public boolean hasPermission(
061                            PermissionChecker permissionChecker, long entryClassPK,
062                            String actionId)
063                    throws Exception;
064    
065            public boolean isSelectable();
066    
067            public void setClassNameId(long classNameId);
068    
069            public void setPortletId(String portletId);
070    
071    }