001    /**
002     * Copyright (c) 2000-present 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.portlet.LiferayPortletRequest;
019    import com.liferay.portal.kernel.portlet.LiferayPortletResponse;
020    import com.liferay.portal.kernel.util.Tuple;
021    import com.liferay.portal.security.permission.PermissionChecker;
022    
023    import java.util.List;
024    import java.util.Locale;
025    import java.util.Map;
026    
027    import javax.portlet.PortletRequest;
028    import javax.portlet.PortletURL;
029    import javax.portlet.WindowState;
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) throws PortalException;
044    
045            public AssetEntry getAssetEntry(String classNameId, long classPK)
046                    throws PortalException;
047    
048            public AssetRenderer getAssetRenderer(long classPK) throws PortalException;
049    
050            public AssetRenderer getAssetRenderer(long classPK, int type)
051                    throws PortalException;
052    
053            public AssetRenderer getAssetRenderer(long groupId, String urlTitle)
054                    throws PortalException;
055    
056            public String getClassName();
057    
058            public long getClassNameId();
059    
060            /**
061             * @deprecated As of 7.0.0, see {@link com.liferay.portlet.asset.model.ClassTypeReader}
062             */
063            @Deprecated
064            public Tuple getClassTypeFieldName(
065                            long classTypeId, String fieldName, Locale locale)
066                    throws Exception;
067    
068            /**
069             * @deprecated As of 7.0.0, see {@link com.liferay.portlet.asset.model.ClassTypeReader}
070             */
071            @Deprecated
072            public List<Tuple> getClassTypeFieldNames(
073                            long classTypeId, Locale locale, int start, int end)
074                    throws Exception;
075    
076            /**
077             * @deprecated As of 7.0.0, see {@link com.liferay.portlet.asset.model.ClassTypeReader}
078             */
079            @Deprecated
080            public int getClassTypeFieldNamesCount(long classTypeId, Locale locale)
081                    throws Exception;
082    
083            public ClassTypeReader getClassTypeReader();
084    
085            /**
086             * @deprecated As of 7.0.0, see {@link com.liferay.portlet.asset.model.ClassTypeReader}
087             */
088            @Deprecated
089            public Map<Long, String> getClassTypes(long[] groupIds, Locale locale)
090                    throws Exception;
091    
092            public String getIconCssClass();
093    
094            public String getIconPath(PortletRequest portletRequest);
095    
096            public String getPortletId();
097    
098            public String getType();
099    
100            public String getTypeName(Locale locale);
101    
102            /**
103             * @deprecated As of 7.0.0, replaced by {@link #getTypeName(Locale)}
104             */
105            @Deprecated
106            public String getTypeName(Locale locale, boolean hasSubtypes);
107    
108            public String getTypeName(Locale locale, long subtypeId);
109    
110            public PortletURL getURLAdd(
111                            LiferayPortletRequest liferayPortletRequest,
112                            LiferayPortletResponse liferayPortletResponse)
113                    throws PortalException;
114    
115            public PortletURL getURLView(
116                            LiferayPortletResponse liferayPortletResponse,
117                            WindowState windowState)
118                    throws PortalException;
119    
120            public boolean hasAddPermission(
121                            PermissionChecker permissionChecker, long groupId, long classTypeId)
122                    throws Exception;
123    
124            /**
125             * @deprecated As of 7.0.0, see {@link com.liferay.portlet.asset.model.ClassTypeReader}
126             */
127            @Deprecated
128            public boolean hasClassTypeFieldNames(long classTypeId, Locale locale)
129                    throws Exception;
130    
131            public boolean hasPermission(
132                            PermissionChecker permissionChecker, long entryClassPK,
133                            String actionId)
134                    throws Exception;
135    
136            public boolean isActive(long companyId);
137    
138            public boolean isCategorizable();
139    
140            public boolean isLinkable();
141    
142            public boolean isSelectable();
143    
144            public boolean isSupportsClassTypes();
145    
146            public void setClassName(String className);
147    
148            public void setPortletId(String portletId);
149    
150    }