1 9 10 package org.jboss.portal.core.theme.render.impl; 11 12 import org.jboss.portal.common.MediaType; 13 import org.jboss.portal.server.PortalRequest; 14 import org.jboss.portal.server.PortalResponse; 15 import org.jboss.portal.server.theme.PortalRenderSet; 16 import org.jboss.portal.server.theme.RegionOrientation; 17 import org.jboss.portal.server.theme.render.DecorationRenderer; 18 import org.jboss.portal.server.theme.render.PortletRenderer; 19 import org.jboss.portal.server.theme.render.RegionRenderer; 20 import org.jboss.portal.server.theme.render.RenderContext; 21 import org.jboss.portal.server.theme.render.RenderException; 22 import org.jboss.portal.server.theme.render.WindowRenderer; 23 import org.w3c.dom.Document ; 24 25 import javax.servlet.http.HttpServletRequest ; 26 27 34 public class RenderContextImpl 35 implements RenderContext 36 { 37 private final MediaType contentType; 38 private final StringBuffer fragment; 39 private final RegionOrientation orientation; 40 private final PortalRenderSet renderSet; 41 private HttpServletRequest request; 42 private PortalRequest portalRequest; 43 private PortalResponse portalResponse; 44 45 53 public RenderContextImpl(PortalRenderSet renderSet, 54 MediaType contentType, 55 RegionOrientation orientation, 56 HttpServletRequest request) 57 { 58 this.renderSet = renderSet; 59 this.contentType = contentType; 60 fragment = new StringBuffer (); 61 this.orientation = orientation; 62 this.request = request; 63 portalRequest = (PortalRequest)request.getAttribute("REQ"); 64 portalResponse = (PortalResponse)request.getAttribute("RESP"); 65 } 66 67 70 public StringBuffer getMarkupFragment() 71 { 72 return fragment; 73 } 74 75 78 public Document getMarkupFragmentAsDom() 79 { 80 throw new UnsupportedOperationException ("Dom not implemented yet."); 81 } 82 83 86 public MediaType getContentType() 87 { 88 return contentType; 89 } 90 91 94 public RegionOrientation getRegionOrientation() 95 { 96 return orientation; 97 } 98 99 102 public HttpServletRequest getHttpServletRequest() 103 { 104 return request; 105 } 106 107 110 public RegionRenderer getRegionRenderer() throws RenderException 111 { 112 return renderSet.getRegionRenderer(); 113 } 114 115 118 public WindowRenderer getWindowRenderer() throws RenderException 119 { 120 return renderSet.getWindowRenderer(); 121 } 122 123 126 public DecorationRenderer getDecorationRenderer() throws RenderException 127 { 128 return renderSet.getDecorationRenderer(); 129 } 130 131 134 public PortletRenderer getPortletRenderer() throws RenderException 135 { 136 return renderSet.getPortletRenderer(); 137 } 138 139 142 public PortalRequest getPortalRequest() 143 { 144 return portalRequest; 145 } 146 147 150 public PortalResponse getPortalResponse() 151 { 152 return portalResponse; 153 } 154 } 155 | Popular Tags |