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(
063                            long classTypeId, Locale locale, int start, int end)
064                    throws Exception;
065    
066            public int getClassTypeFieldNamesCount(long classTypeId, Locale locale)
067                    throws Exception;
068    
069            public Map<Long, String> getClassTypes(long[] groupIds, Locale locale)
070                    throws Exception;
071    
072            public String getIconPath(PortletRequest portletRequest);
073    
074            public String getPortletId();
075    
076            public String getType();
077    
078            public String getTypeName(Locale locale, boolean hasSubtypes);
079    
080            public PortletURL getURLAdd(
081                            LiferayPortletRequest liferayPortletRequest,
082                            LiferayPortletResponse liferayPortletResponse)
083                    throws PortalException, SystemException;
084    
085            public boolean hasClassTypeFieldNames(long classTypeId, Locale locale)
086                    throws Exception;
087    
088            public boolean hasPermission(
089                            PermissionChecker permissionChecker, long entryClassPK,
090                            String actionId)
091                    throws Exception;
092    
093            public boolean isActive(long companyId);
094    
095            public boolean isCategorizable();
096    
097            public boolean isLinkable();
098    
099            public boolean isSelectable();
100    
101            public void setClassName(String className);
102    
103            public void setPortletId(String portletId);
104    
105    }