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    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 hasAddPermission(
092                            PermissionChecker permissionChecker, long groupId, long classTypeId)
093                    throws Exception;
094    
095            public boolean hasClassTypeFieldNames(long classTypeId, Locale locale)
096                    throws Exception;
097    
098            public boolean hasPermission(
099                            PermissionChecker permissionChecker, long entryClassPK,
100                            String actionId)
101                    throws Exception;
102    
103            public boolean isActive(long companyId);
104    
105            public boolean isCategorizable();
106    
107            public boolean isLinkable();
108    
109            public boolean isListable(long classPK)
110                    throws SystemException;
111    
112            public boolean isSelectable();
113    
114            public void setClassName(String className);
115    
116            public void setPortletId(String portletId);
117    
118    }