站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.2 API 英文版文档

RenderContextImpl - JBOSS Portal 2.2 API 英文版文档


org.jboss.portal.theme.impl.render
Class RenderContextImpl

java.lang.Object
  extended byorg.jboss.portal.theme.impl.render.RenderContextImpl
All Implemented Interfaces:
RenderContext

public class RenderContextImpl
extends java.lang.Object
implements RenderContext

Implementation of a render context.

See Also:
RenderContext

Constructor Summary
RenderContextImpl(PortalRenderSet renderSet, MediaType contentType, RegionOrientation orientation, java.lang.String regionID, java.util.Map pageProperties, java.util.List regionNames, javax.servlet.http.HttpServletRequest request)
          Create a render context instance.
 
Method Summary
 MediaType getContentType()
          Get the media type for this render process
 DecorationRenderer getDecorationRenderer()
          Get the implemetation of the decoration renderer to use in this context
 DecorationRenderer getDecorationRenderer(WindowResult result)
          Get the implemetation of the decoration renderer of the provided render set
 java.util.List getLayoutRegionNames()
          Get a list of all region names as they are defined in the layout descriptor of the current layout.
 java.lang.StringBuffer getMarkupFragment()
          Get the StringBuffer that holds the markup to write back as response.
 org.w3c.dom.Document getMarkupFragmentAsDom()
          Get the xml dom document that holds the markup to write bach as response (perhaps after its been xsl transformed) This is for apps that rather build the result in XML (instead of a StringBuffer).
 java.util.Map getPageProperties()
          Get the properties as they are defined in the portal descriptor for the currently requested page.
 PortletRenderer getPortletRenderer()
          Get the implementation of the portlet renderer to use for this context
 PortletRenderer getPortletRenderer(WindowResult result)
          Get the implementation of the portlet renderer of the provided render set
 java.lang.String getProperty(WindowResult result, java.lang.String key)
          get a portal object property value for the provided key.
 java.lang.String getRegionID()
          Get the id attribute for the tag to be rendered.
 RegionOrientation getRegionOrientation()
          Get the region orientation for this render process
 RegionRenderer getRegionRenderer()
          Get the implementation of the region renderer as it was determined by the page invocation stack.
 RegionRenderer getRegionRenderer(java.lang.String renderSetName)
          Get the implementation of the region renderer in the provided render set.
 WindowRenderer getWindowRenderer()
          Get the implementation of the window renderer as it was determined by the page invocation stack.
 WindowRenderer getWindowRenderer(WindowResult result)
          Get the implementation of the window renderer in the render set that is provided via the passed name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenderContextImpl

public RenderContextImpl(PortalRenderSet renderSet,
                         MediaType contentType,
                         RegionOrientation orientation,
                         java.lang.String regionID,
                         java.util.Map pageProperties,
                         java.util.List regionNames,
                         javax.servlet.http.HttpServletRequest request)
Create a render context instance.

Parameters:
renderSet - the render set to use for this render process
contentType - the media/content/mime type of the current request
orientation - the orientation of the region tag
regionID - the id attribute value to use for the rendered tag
pageProperties -
request - the servlet request that is currently being serviced
Method Detail

getMarkupFragment

public java.lang.StringBuffer getMarkupFragment()
Description copied from interface: RenderContext
Get the StringBuffer that holds the markup to write back as response.

This is ment to be a convenient way to accumulate the markup generated by the individual processes involved in the rendering of the response. Each renderer in the render set simply appends it's markup to this buffer.

Specified by:
getMarkupFragment in interface RenderContext
Returns:
the StringBuffer that contains the generated markup
See Also:
RenderContext.getMarkupFragment()

getMarkupFragmentAsDom

public org.w3c.dom.Document getMarkupFragmentAsDom()
Description copied from interface: RenderContext
Get the xml dom document that holds the markup to write bach as response (perhaps after its been xsl transformed) This is for apps that rather build the result in XML (instead of a StringBuffer).

Specified by:
getMarkupFragmentAsDom in interface RenderContext
Returns:
the Document that represents the generated markup
See Also:
RenderContext.getMarkupFragmentAsDom()

getContentType

public MediaType getContentType()
Description copied from interface: RenderContext
Get the media type for this render process

Specified by:
getContentType in interface RenderContext
Returns:
the media type for this render process
See Also:
RenderContext.getContentType()

getRegionOrientation

public RegionOrientation getRegionOrientation()
Description copied from interface: RenderContext
Get the region orientation for this render process

Specified by:
getRegionOrientation in interface RenderContext
Returns:
the region orientation for this render process
See Also:
RenderContext.getRegionOrientation()

getRegionRenderer

public RegionRenderer getRegionRenderer()
Description copied from interface: RenderContext
Get the implementation of the region renderer as it was determined by the page invocation stack.

The region renderer ias part of the renderSet, which can be defined for the portal, or a particular page. The page will overwrite the portal.

Specified by:
getRegionRenderer in interface RenderContext
Returns:
a region renderer to use for this context
See Also:
RenderContext.getRegionRenderer()

getRegionRenderer

public RegionRenderer getRegionRenderer(java.lang.String renderSetName)
Description copied from interface: RenderContext
Get the implementation of the region renderer in the provided render set.

Mote that the render set can be different from the determined render set for the portal or page. This allows a renderer to use a different render set for an individual window (to name one example).

Specified by:
getRegionRenderer in interface RenderContext
Parameters:
renderSetName - the name of the render set to use to get the region renderer. if the name is null, the behaviour is the same as in the getRegionRenderer() method
Returns:
the region renderer of the provided render set, the region renderer of the render set of this context if the provided name was null, or null if the name was provided, but the render set doesn't exist
See Also:
RenderContext.getRegionRenderer(String)

getWindowRenderer

public WindowRenderer getWindowRenderer()
Description copied from interface: RenderContext
Get the implementation of the window renderer as it was determined by the page invocation stack.

The window renderer is part of a renderSet, which can be defined for the portal, or a particular page. The page will overwrite the portal.

Specified by:
getWindowRenderer in interface RenderContext
Returns:
a window renderer to use for this context
See Also:
RenderContext.getWindowRenderer()

getWindowRenderer

public WindowRenderer getWindowRenderer(WindowResult result)
Description copied from interface: RenderContext
Get the implementation of the window renderer in the render set that is provided via the passed name.

Specified by:
getWindowRenderer in interface RenderContext
Parameters:
result - the name of the render set to use to get the window renderer. if the name is null, the behaviour is the same as in the getWindowRenderer() method
Returns:
the window renderer of the provided render set, the window renderer of the render set of this context if the provided name was null, or null if the name was provided, but the render set doesn't exist

getDecorationRenderer

public DecorationRenderer getDecorationRenderer()
Description copied from interface: RenderContext
Get the implemetation of the decoration renderer to use in this context

Specified by:
getDecorationRenderer in interface RenderContext
Returns:
a decoration renderer to use for this context
See Also:
RenderContext.getDecorationRenderer()

getDecorationRenderer

public DecorationRenderer getDecorationRenderer(WindowResult result)
Description copied from interface: RenderContext
Get the implemetation of the decoration renderer of the provided render set

Specified by:
getDecorationRenderer in interface RenderContext
Parameters:
result -
Returns:
the decoration renderer of the provided render set, the decoration renderer of the render set of this context if the provided name was null, or null if the name was provided, but the render set doesn't exist

getPortletRenderer

public PortletRenderer getPortletRenderer()
Description copied from interface: RenderContext
Get the implementation of the portlet renderer to use for this context

Specified by:
getPortletRenderer in interface RenderContext
Returns:
a portlet renderer to use for thsi context
See Also:
RenderContext.getPortletRenderer()

getPortletRenderer

public PortletRenderer getPortletRenderer(WindowResult result)
Description copied from interface: RenderContext
Get the implementation of the portlet renderer of the provided render set

Specified by:
getPortletRenderer in interface RenderContext
Parameters:
result - the window result carying the optiona window properties , potentially pointing to a different portlet renderer
Returns:
the portlet renderer of the provided render set, the portlet renderer of the render set of this context if the provided name was null, or null if the name was provided, but the render set doesn't exist

getRegionID

public java.lang.String getRegionID()
Description copied from interface: RenderContext
Get the id attribute for the tag to be rendered.

Specified by:
getRegionID in interface RenderContext
Returns:
the value of the id attribute of the rendered tag
See Also:
RenderContext.getRegionID()

getPageProperties

public java.util.Map getPageProperties()
Description copied from interface: RenderContext
Get the properties as they are defined in the portal descriptor for the currently requested page.

Specified by:
getPageProperties in interface RenderContext
Returns:
the page properties for the currently requested page
See Also:
RenderContext.getPageProperties()

getLayoutRegionNames

public java.util.List getLayoutRegionNames()
Description copied from interface: RenderContext
Get a list of all region names as they are defined in the layout descriptor of the current layout.

Specified by:
getLayoutRegionNames in interface RenderContext
Returns:
a list of all region names of the current layout

getProperty

public java.lang.String getProperty(WindowResult result,
                                    java.lang.String key)
Description copied from interface: RenderContext
get a portal object property value for the provided key.

Specified by:
getProperty in interface RenderContext
Parameters:
result - a window result containing optional window properties
key - the key (name) of the property to access
Returns:
the value of the property if it exists in either the window or page properties, or null if it doesn't exist
See Also:
RenderContext.getProperty(WindowResult, String)