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
062             *             com.liferay.portlet.asset.model.ClassTypeReader}
063             */
064            @Deprecated
065            public Tuple getClassTypeFieldName(
066                            long classTypeId, String fieldName, Locale locale)
067                    throws Exception;
068    
069            /**
070             * @deprecated As of 7.0.0, see {@link
071             *             com.liferay.portlet.asset.model.ClassTypeReader}
072             */
073            @Deprecated
074            public List<Tuple> getClassTypeFieldNames(
075                            long classTypeId, Locale locale, int start, int end)
076                    throws Exception;
077    
078            /**
079             * @deprecated As of 7.0.0, see {@link
080             *             com.liferay.portlet.asset.model.ClassTypeReader}
081             */
082            @Deprecated
083            public int getClassTypeFieldNamesCount(long classTypeId, Locale locale)
084                    throws Exception;
085    
086            public ClassTypeReader getClassTypeReader();
087    
088            /**
089             * @deprecated As of 7.0.0, see {@link
090             *             com.liferay.portlet.asset.model.ClassTypeReader}
091             */
092            @Deprecated
093            public Map<Long, String> getClassTypes(long[] groupIds, Locale locale)
094                    throws Exception;
095    
096            public String getIconCssClass();
097    
098            public String getIconPath(PortletRequest portletRequest);
099    
100            public String getPortletId();
101    
102            public String getType();
103    
104            public String getTypeName(Locale locale);
105    
106            /**
107             * @deprecated As of 7.0.0, replaced by {@link #getTypeName(Locale)}
108             */
109            @Deprecated
110            public String getTypeName(Locale locale, boolean hasSubtypes);
111    
112            public String getTypeName(Locale locale, long subtypeId);
113    
114            /**
115             * @deprecated As of 7.0.0, replaced by {@link #getURLAdd(
116             *                         LiferayPortletRequest, LiferayPortletResponse, long)}
117             */
118            @Deprecated
119            public PortletURL getURLAdd(
120                            LiferayPortletRequest liferayPortletRequest,
121                            LiferayPortletResponse liferayPortletResponse)
122                    throws PortalException;
123    
124            public PortletURL getURLAdd(
125                            LiferayPortletRequest liferayPortletRequest,
126                            LiferayPortletResponse liferayPortletResponse, long classTypeId)
127                    throws PortalException;
128    
129            public PortletURL getURLView(
130                            LiferayPortletResponse liferayPortletResponse,
131                            WindowState windowState)
132                    throws PortalException;
133    
134            public boolean hasAddPermission(
135                            PermissionChecker permissionChecker, long groupId, long classTypeId)
136                    throws Exception;
137    
138            /**
139             * @deprecated As of 7.0.0, see {@link
140             *             com.liferay.portlet.asset.model.ClassTypeReader}
141             */
142            @Deprecated
143            public boolean hasClassTypeFieldNames(long classTypeId, Locale locale)
144                    throws Exception;
145    
146            public boolean hasPermission(
147                            PermissionChecker permissionChecker, long entryClassPK,
148                            String actionId)
149                    throws Exception;
150    
151            public boolean isActive(long companyId);
152    
153            public boolean isCategorizable();
154    
155            public boolean isLinkable();
156    
157            public boolean isListable(long classPK);
158    
159            public boolean isSelectable();
160    
161            public boolean isSupportsClassTypes();
162    
163            public void setClassName(String className);
164    
165            public void setPortletId(String portletId);
166    
167    }