001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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    import javax.portlet.WindowState;
031    
032    /**
033     * @author Jorge Ferrer
034     * @author Juan Fernández
035     * @author Raymond Augé
036     * @author Sergio González
037     */
038    public interface AssetRendererFactory {
039    
040            public static final int TYPE_LATEST = 0;
041    
042            public static final int TYPE_LATEST_APPROVED = 1;
043    
044            public AssetEntry getAssetEntry(long assetEntryId)
045                    throws PortalException, SystemException;
046    
047            public AssetEntry getAssetEntry(String classNameId, long classPK)
048                    throws PortalException, SystemException;
049    
050            public AssetRenderer getAssetRenderer(long classPK)
051                    throws PortalException, SystemException;
052    
053            public AssetRenderer getAssetRenderer(long classPK, int type)
054                    throws PortalException, SystemException;
055    
056            public AssetRenderer getAssetRenderer(long groupId, String urlTitle)
057                    throws PortalException, SystemException;
058    
059            public String getClassName();
060    
061            public long getClassNameId();
062    
063            public List<Tuple> getClassTypeFieldNames(
064                            long classTypeId, Locale locale, int start, int end)
065                    throws Exception;
066    
067            public int getClassTypeFieldNamesCount(long classTypeId, Locale locale)
068                    throws Exception;
069    
070            public Map<Long, String> getClassTypes(long[] groupIds, Locale locale)
071                    throws Exception;
072    
073            public String getIconPath(PortletRequest portletRequest);
074    
075            public String getPortletId();
076    
077            public String getType();
078    
079            public String getTypeName(Locale locale, boolean hasSubtypes);
080    
081            public PortletURL getURLAdd(
082                            LiferayPortletRequest liferayPortletRequest,
083                            LiferayPortletResponse liferayPortletResponse)
084                    throws PortalException, SystemException;
085    
086            public PortletURL getURLView(
087                            LiferayPortletResponse liferayPortletResponse,
088                            WindowState windowState)
089                    throws PortalException, SystemException;
090    
091            public boolean hasClassTypeFieldNames(long classTypeId, Locale locale)
092                    throws Exception;
093    
094            public boolean hasPermission(
095                            PermissionChecker permissionChecker, long entryClassPK,
096                            String actionId)
097                    throws Exception;
098    
099            public boolean isActive(long companyId);
100    
101            public boolean isCategorizable();
102    
103            public boolean isLinkable();
104    
105            public boolean isSelectable();
106    
107            public void setClassName(String className);
108    
109            public void setPortletId(String portletId);
110    
111    }