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            /**
079             * @deprecated As of 7.0.0, replaced by {@link #getSummary(PortletRequest,
080             *                              PortletResponse)}
081             */
082            @Deprecated
083            public String getSummary(Locale locale);
084    
085            public String getSummary(
086                    PortletRequest portletRequest, PortletResponse portletResponse);
087    
088            public String getThumbnailPath(PortletRequest portletRequest)
089                    throws Exception;
090    
091            public String getTitle(Locale locale);
092    
093            public String getURLDownload(ThemeDisplay themeDisplay);
094    
095            public PortletURL getURLEdit(
096                            LiferayPortletRequest liferayPortletRequest,
097                            LiferayPortletResponse liferayPortletResponse)
098                    throws Exception;
099    
100            public PortletURL getURLEdit(
101                            LiferayPortletRequest liferayPortletRequest,
102                            LiferayPortletResponse liferayPortletResponse,
103                            WindowState windowState, PortletURL redirectURL)
104                    throws Exception;
105    
106            public PortletURL getURLExport(
107                            LiferayPortletRequest liferayPortletRequest,
108                            LiferayPortletResponse liferayPortletResponse)
109                    throws Exception;
110    
111            public String getURLImagePreview(PortletRequest portletRequest)
112                    throws Exception;
113    
114            public String getUrlTitle();
115    
116            public PortletURL getURLView(
117                            LiferayPortletResponse liferayPortletResponse,
118                            WindowState windowState)
119                    throws Exception;
120    
121            public String getURLViewInContext(
122                            LiferayPortletRequest liferayPortletRequest,
123                            LiferayPortletResponse liferayPortletResponse,
124                            String noSuchEntryRedirect)
125                    throws Exception;
126    
127            public long getUserId();
128    
129            public String getUserName();
130    
131            public String getUuid();
132    
133            public String getViewInContextMessage();
134    
135            public boolean hasEditPermission(PermissionChecker permissionChecker)
136                    throws PortalException, SystemException;
137    
138            public boolean hasViewPermission(PermissionChecker permissionChecker)
139                    throws PortalException, SystemException;
140    
141            public boolean isConvertible();
142    
143            public boolean isDisplayable();
144    
145            public boolean isLocalizable();
146    
147            public boolean isPreviewInContext();
148    
149            public boolean isPrintable();
150    
151            public String render(
152                            RenderRequest renderRequest, RenderResponse renderResponse,
153                            String template)
154                    throws Exception;
155    
156            public void setAddToPagePreferences(
157                            PortletPreferences preferences, String portletId,
158                            ThemeDisplay themeDisplay)
159                    throws Exception;
160    
161    }