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 getTitle(Locale locale);
059    
060            public String getURLDownload(ThemeDisplay themeDisplay);
061    
062            public PortletURL getURLEdit(
063                            LiferayPortletRequest liferayPortletRequest,
064                            LiferayPortletResponse liferayPortletResponse)
065                    throws Exception;
066    
067            public PortletURL getURLEdit(
068                            LiferayPortletRequest liferayPortletRequest,
069                            LiferayPortletResponse liferayPortletResponse,
070                            WindowState windowState, PortletURL redirectURL)
071                    throws Exception;
072    
073            public PortletURL getURLExport(
074                            LiferayPortletRequest liferayPortletRequest,
075                            LiferayPortletResponse liferayPortletResponse)
076                    throws Exception;
077    
078            public String getUrlTitle();
079    
080            public PortletURL getURLView(
081                            LiferayPortletResponse liferayPortletResponse,
082                            WindowState windowState)
083                    throws Exception;
084    
085            public String getURLViewInContext(
086                            LiferayPortletRequest liferayPortletRequest,
087                            LiferayPortletResponse liferayPortletResponse,
088                            String noSuchEntryRedirect)
089                    throws Exception;
090    
091            public long getUserId();
092    
093            public String getUserName();
094    
095            public String getUuid();
096    
097            public String getViewInContextMessage();
098    
099            public boolean hasEditPermission(PermissionChecker permissionChecker)
100                    throws PortalException, SystemException;
101    
102            public boolean hasViewPermission(PermissionChecker permissionChecker)
103                    throws PortalException, SystemException;
104    
105            public boolean isConvertible();
106    
107            public boolean isDisplayable();
108    
109            public boolean isLocalizable();
110    
111            public boolean isPreviewInContext();
112    
113            public boolean isPrintable();
114    
115            public String render(
116                            RenderRequest renderRequest, RenderResponse renderResponse,
117                            String template)
118                    throws Exception;
119    
120    }