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