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