001    /**
002     * Copyright (c) 2000-2011 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 java.util.Map;
024    
025    import javax.portlet.PortletRequest;
026    import javax.portlet.PortletURL;
027    
028    /**
029     * @author Jorge Ferrer
030     * @author Juan Fernández
031     * @author Raymond Augé
032     * @author Sergio González
033     */
034    public interface AssetRendererFactory {
035    
036            public static int TYPE_LATEST = 0;
037    
038            public static int TYPE_LATEST_APPROVED = 1;
039    
040            public AssetEntry getAssetEntry(long assetEntryId)
041                    throws PortalException, SystemException;
042    
043            public AssetEntry getAssetEntry(String classNameId, long classPK)
044                    throws PortalException, SystemException;
045    
046            public AssetRenderer getAssetRenderer(long classPK)
047                    throws PortalException, SystemException;
048    
049            public AssetRenderer getAssetRenderer(long classPK, int type)
050                    throws PortalException, SystemException;
051    
052            public AssetRenderer getAssetRenderer(long groupId, String urlTitle)
053                    throws PortalException, SystemException;
054    
055            public String getClassName();
056    
057            public long getClassNameId();
058    
059            public Map<Long, String> getClassTypes(long[] groupIds) throws Exception;
060    
061            public String getIconPath(PortletRequest portletRequest);
062    
063            public String getPortletId();
064    
065            public String getType();
066    
067            public PortletURL getURLAdd(
068                            LiferayPortletRequest liferayPortletRequest,
069                            LiferayPortletResponse liferayPortletResponse)
070                    throws PortalException, SystemException;
071    
072            public boolean hasPermission(
073                            PermissionChecker permissionChecker, long entryClassPK,
074                            String actionId)
075                    throws Exception;
076    
077            public boolean isLinkable();
078    
079            public boolean isSelectable();
080    
081            public void setClassNameId(long classNameId);
082    
083            public void setPortletId(String portletId);
084    
085    }