001
014
015 package com.liferay.portlet;
016
017 import com.liferay.portal.kernel.portlet.LiferayRenderResponse;
018 import com.liferay.portal.theme.PortletDisplay;
019 import com.liferay.portal.theme.ThemeDisplay;
020 import com.liferay.portal.util.WebKeys;
021
022 import java.util.Collection;
023
024 import javax.portlet.PortletMode;
025 import javax.portlet.PortletRequest;
026
027 import javax.servlet.http.HttpServletResponse;
028
029
033 public class RenderResponseImpl
034 extends MimeResponseImpl implements LiferayRenderResponse {
035
036 public String getLifecycle() {
037 return PortletRequest.RENDER_PHASE;
038 }
039
040 public String getResourceName() {
041 return _resourceName;
042 }
043
044 public String getTitle() {
045 return _title;
046 }
047
048 public Boolean getUseDefaultTemplate() {
049 return _useDefaultTemplate;
050 }
051
052 public void setResourceName(String resourceName) {
053 _resourceName = resourceName;
054 }
055
056 public void setNextPossiblePortletModes(
057 Collection<PortletMode> portletModes) {
058 }
059
060 public void setTitle(String title) {
061 _title = title;
062
063
064
065 ThemeDisplay themeDisplay =
066 (ThemeDisplay)_portletRequestImpl.getAttribute(
067 WebKeys.THEME_DISPLAY);
068
069 PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
070
071 portletDisplay.setTitle(_title);
072 }
073
074 public void setUseDefaultTemplate(Boolean useDefaultTemplate) {
075 _useDefaultTemplate = useDefaultTemplate;
076 }
077
078 protected void init(
079 PortletRequestImpl portletRequestImpl, HttpServletResponse response,
080 String portletName, long companyId, long plid) {
081
082 super.init(portletRequestImpl, response, portletName, companyId, plid);
083
084 _portletRequestImpl = portletRequestImpl;
085 }
086
087 private PortletRequestImpl _portletRequestImpl;
088 private String _title;
089 private Boolean _useDefaultTemplate;
090 private String _resourceName;
091
092 }