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

RenderContext - JBOSS Portal 2.2 API 英文版文档


org.jboss.portal.theme.render
Interface RenderContext

All Known Implementing Classes:
RenderContextImpl

public interface RenderContext

A render context allows all pieces that create markup a way to access relevant information for the current request and render process.

A render context is created for each portal request and render tag. It contains all the information needed to generate the markup of one region tag for the portal response.


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 renderSetName)
          Get the implementation of the window renderer in the render set that is provided via the passed name.
 

Method Detail

getMarkupFragment

public java.lang.StringBuffer getMarkupFragment()
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.

Returns:
the StringBuffer that contains the generated markup

getMarkupFragmentAsDom

public 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).

Returns:
the Document that represents the generated markup
See Also:
getMarkupFragment()

getContentType

public MediaType getContentType()
Get the media type for this render process

Returns:
the media type for this render process

getRegionOrientation

public RegionOrientation getRegionOrientation()
Get the region orientation for this render process

Returns:
the region orientation for this render process

getRegionRenderer

public RegionRenderer getRegionRenderer()
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.

Returns:
a region renderer to use for this context

getRegionRenderer

public RegionRenderer getRegionRenderer(java.lang.String renderSetName)
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).

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:
getRegionRenderer()

getWindowRenderer

public WindowRenderer getWindowRenderer()
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.

Returns:
a window renderer to use for this context

getWindowRenderer

public WindowRenderer getWindowRenderer(WindowResult renderSetName)
Get the implementation of the window renderer in the render set that is provided via the passed name.

Parameters:
renderSetName - 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()
Get the implemetation of the decoration renderer to use in this context

Returns:
a decoration renderer to use for this context

getDecorationRenderer

public DecorationRenderer getDecorationRenderer(WindowResult result)
Get the implemetation of the decoration renderer of the provided render set

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()
Get the implementation of the portlet renderer to use for this context

Returns:
a portlet renderer to use for thsi context

getPortletRenderer

public PortletRenderer getPortletRenderer(WindowResult result)
Get the implementation of the portlet renderer of the provided render set

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()
Get the id attribute for the tag to be rendered.

Returns:
the value of the id attribute of the rendered tag

getPageProperties

public java.util.Map getPageProperties()
Get the properties as they are defined in the portal descriptor for the currently requested page.

Returns:
the page properties for the currently requested page

getLayoutRegionNames

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

Returns:
a list of all region names of the current layout

getProperty

public java.lang.String getProperty(WindowResult result,
                                    java.lang.String key)
get a portal object property value for the provided key.

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