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.security.permission.PermissionChecker;
022    import com.liferay.portal.theme.ThemeDisplay;
023    
024    import java.util.Date;
025    import java.util.Locale;
026    
027    import javax.portlet.PortletPreferences;
028    import javax.portlet.PortletRequest;
029    import javax.portlet.PortletResponse;
030    import javax.portlet.PortletURL;
031    import javax.portlet.RenderRequest;
032    import javax.portlet.RenderResponse;
033    import javax.portlet.WindowState;
034    
035    /**
036     * @author Jorge Ferrer
037     * @author Juan Fern??ndez
038     */
039    public interface AssetRenderer {
040    
041            public static final String TEMPLATE_ABSTRACT = "abstract";
042    
043            public static final String TEMPLATE_FULL_CONTENT = "full_content";
044    
045            public String getAddToPagePortletId() throws Exception;
046    
047            public int getAssetRendererType();
048    
049            public String[] getAvailableLanguageIds() throws Exception;
050    
051            /**
052             * @deprecated As of 6.2.0, replaced by {@link #getAvailableLanguageIds}
053             */
054            public String[] getAvailableLocales() throws Exception;
055    
056            public String getClassName();
057    
058            public long getClassPK();
059    
060            public String getDiscussionPath();
061    
062            public Date getDisplayDate();
063    
064            public long getGroupId();
065    
066            public String getIconPath(PortletRequest portletRequest);
067    
068            public String getNewName(String oldName, String token);
069    
070            public String getPreviewPath(
071                            PortletRequest portletRequest, PortletResponse PortletResponse)
072                    throws Exception;
073    
074            public String getSearchSummary(Locale locale);
075    
076            public int getStatus();
077    
078            public String getSummary(Locale locale);
079    
080            public String getThumbnailPath(PortletRequest portletRequest)
081                    throws Exception;
082    
083            public String getTitle(Locale locale);
084    
085            public String getURLDownload(ThemeDisplay themeDisplay);
086    
087            public PortletURL getURLEdit(
088                            LiferayPortletRequest liferayPortletRequest,
089                            LiferayPortletResponse liferayPortletResponse)
090                    throws Exception;
091    
092            public PortletURL getURLEdit(
093                            LiferayPortletRequest liferayPortletRequest,
094                            LiferayPortletResponse liferayPortletResponse,
095                            WindowState windowState, PortletURL redirectURL)
096                    throws Exception;
097    
098            public PortletURL getURLExport(
099                            LiferayPortletRequest liferayPortletRequest,
100                            LiferayPortletResponse liferayPortletResponse)
101                    throws Exception;
102    
103            public String getURLImagePreview(PortletRequest portletRequest)
104                    throws Exception;
105    
106            public String getUrlTitle();
107    
108            public PortletURL getURLView(
109                            LiferayPortletResponse liferayPortletResponse,
110                            WindowState windowState)
111                    throws Exception;
112    
113            public String getURLViewInContext(
114                            LiferayPortletRequest liferayPortletRequest,
115                            LiferayPortletResponse liferayPortletResponse,
116                            String noSuchEntryRedirect)
117                    throws Exception;
118    
119            public long getUserId();
120    
121            public String getUserName();
122    
123            public String getUuid();
124    
125            public String getViewInContextMessage();
126    
127            public boolean hasEditPermission(PermissionChecker permissionChecker)
128                    throws PortalException, SystemException;
129    
130            public boolean hasViewPermission(PermissionChecker permissionChecker)
131                    throws PortalException, SystemException;
132    
133            public boolean isConvertible();
134    
135            public boolean isDisplayable();
136    
137            public boolean isLocalizable();
138    
139            public boolean isPreviewInContext();
140    
141            public boolean isPrintable();
142    
143            public String render(
144                            RenderRequest renderRequest, RenderResponse renderResponse,
145                            String template)
146                    throws Exception;
147    
148            public void setAddToPagePreferences(
149                            PortletPreferences preferences, String portletId,
150                            ThemeDisplay themeDisplay)
151                    throws Exception;
152    
153    }