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