001    /**
002     * Copyright (c) 2000-2012 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.Locale;
025    
026    import javax.portlet.PortletRequest;
027    import javax.portlet.PortletURL;
028    import javax.portlet.RenderRequest;
029    import javax.portlet.RenderResponse;
030    import javax.portlet.WindowState;
031    
032    /**
033     * @author Jorge Ferrer
034     * @author Juan Fernández
035     */
036    public interface AssetRenderer {
037    
038            public static final String TEMPLATE_ABSTRACT = "abstract";
039    
040            public static final String TEMPLATE_FULL_CONTENT = "full_content";
041    
042            public String getAssetRendererFactoryClassName();
043    
044            public String[] getAvailableLocales() throws Exception;
045    
046            public long getClassPK();
047    
048            public String getDiscussionPath();
049    
050            public long getGroupId();
051    
052            public String getIconPath(PortletRequest portletRequest);
053    
054            public String getSearchSummary(Locale locale);
055    
056            public String getSummary(Locale locale);
057    
058            public String getThumbnailPath(PortletRequest portletRequest)
059                    throws Exception;
060    
061            public String getTitle(Locale locale);
062    
063            public String getURLDownload(ThemeDisplay themeDisplay);
064    
065            public PortletURL getURLEdit(
066                            LiferayPortletRequest liferayPortletRequest,
067                            LiferayPortletResponse liferayPortletResponse)
068                    throws Exception;
069    
070            public PortletURL getURLEdit(
071                            LiferayPortletRequest liferayPortletRequest,
072                            LiferayPortletResponse liferayPortletResponse,
073                            WindowState windowState, PortletURL redirectURL)
074                    throws Exception;
075    
076            public PortletURL getURLExport(
077                            LiferayPortletRequest liferayPortletRequest,
078                            LiferayPortletResponse liferayPortletResponse)
079                    throws Exception;
080    
081            public String getUrlTitle();
082    
083            public PortletURL getURLView(
084                            LiferayPortletResponse liferayPortletResponse,
085                            WindowState windowState)
086                    throws Exception;
087    
088            public String getURLViewInContext(
089                            LiferayPortletRequest liferayPortletRequest,
090                            LiferayPortletResponse liferayPortletResponse,
091                            String noSuchEntryRedirect)
092                    throws Exception;
093    
094            public long getUserId();
095    
096            public String getUserName();
097    
098            public String getUuid();
099    
100            public String getViewInContextMessage();
101    
102            public boolean hasEditPermission(PermissionChecker permissionChecker)
103                    throws PortalException, SystemException;
104    
105            public boolean hasViewPermission(PermissionChecker permissionChecker)
106                    throws PortalException, SystemException;
107    
108            public boolean isConvertible();
109    
110            public boolean isDisplayable();
111    
112            public boolean isLocalizable();
113    
114            public boolean isPreviewInContext();
115    
116            public boolean isPrintable();
117    
118            public String render(
119                            RenderRequest renderRequest, RenderResponse renderResponse,
120                            String template)
121                    throws Exception;
122    
123    }