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