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