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

StrategyContextImpl - JBOSS Portal 2.2 API 英文版文档


org.jboss.portal.theme.impl.strategy
Class StrategyContextImpl

java.lang.Object
  extended byorg.jboss.portal.theme.impl.strategy.StrategyContextImpl
All Implemented Interfaces:
StrategyContext

public final class StrategyContextImpl
extends java.lang.Object
implements StrategyContext

An implementation of the strategy context.

The strategy context is used by the layout strategy interceptor to pass the available state information from the portal to the strategy. The context contains information about the current page, the windowIDs on it, the state of those windowIDs, etc.

See Also:
StrategyContext

Constructor Summary
StrategyContextImpl(PageRequestContext requestContext, PortalLayout layout, PortalTheme theme)
           
 
Method Summary
 StrategyResponse createResponse()
          Create a new strategy response.
 java.lang.String getCharSet()
          Get the encoding in which the response to the current request will be emmited.
 javax.servlet.http.HttpServletRequest getHttpServletRequest()
          Get a reference to the javax.servlet.http.HttpServletRequest
 PortalLayout getLayout()
          Get the layout that is currently active for the request.
 MediaType getMediaType()
          Get the determined content type for the current request.
 java.util.List getPortletContexts()
          Get a list of all the portlets assigned to the requested page.
 java.lang.String[] getRegions()
          Get the names of all the regions of the current page.
 PortletContext getTargetPortlet()
          Get the targeted portlet for the current request, if any.
 PortalTheme getTheme()
          Get the theme that is currently active for the request.
 boolean isPortalSupportedPortletMode(Mode mode)
          Check if the presented PortletMode is allowed for the current portal.
 boolean isPortalSupportedWindowState(WindowState state)
          Check if the presented WindowState is allowed for the current portal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrategyContextImpl

public StrategyContextImpl(PageRequestContext requestContext,
                           PortalLayout layout,
                           PortalTheme theme)
Method Detail

getPortletContexts

public java.util.List getPortletContexts()
Description copied from interface: StrategyContext
Get a list of all the portlets assigned to the requested page.

Specified by:
getPortletContexts in interface StrategyContext
Returns:
a java.util.Map of org.jboss.portal.theme.strategy.PortletContext
See Also:
StrategyContext.getPortletContexts(), PortletContext

getTargetPortlet

public PortletContext getTargetPortlet()
Description copied from interface: StrategyContext
Get the targeted portlet for the current request, if any.

If the current request is dedicated to a particular portlet (action or render request for this portlet), make this information available.

Specified by:
getTargetPortlet in interface StrategyContext
Returns:
the portlet that is currently targeted, or null if this is not a request dedicated to a particular portlet
See Also:
StrategyContext.getTargetPortlet()

getLayout

public PortalLayout getLayout()
Description copied from interface: StrategyContext
Get the layout that is currently active for the request.

The layout is the jsp or servlet that will handle the generation of the page's markup.

Specified by:
getLayout in interface StrategyContext
Returns:
the current layout for the request
See Also:
StrategyContext.getLayout()

getTheme

public PortalTheme getTheme()
Description copied from interface: StrategyContext
Get the theme that is currently active for the request.

The theme is a set of css and image files that make up the look and feel of the rendered markup

Specified by:
getTheme in interface StrategyContext
Returns:
the current theme for the request

getRegions

public java.lang.String[] getRegions()
Description copied from interface: StrategyContext
Get the names of all the regions of the current page.

Specified by:
getRegions in interface StrategyContext
Returns:
all the regions available on the current page
See Also:
StrategyContext.getRegions()

createResponse

public StrategyResponse createResponse()
Description copied from interface: StrategyContext
Create a new strategy response.

Specified by:
createResponse in interface StrategyContext
Returns:
a new strategy response
See Also:
StrategyContext.createResponse()

getHttpServletRequest

public javax.servlet.http.HttpServletRequest getHttpServletRequest()
Description copied from interface: StrategyContext
Get a reference to the javax.servlet.http.HttpServletRequest

Specified by:
getHttpServletRequest in interface StrategyContext
Returns:
the HttpServletRequest instance of this portal request
See Also:
StrategyContext.getHttpServletRequest()

getMediaType

public MediaType getMediaType()
Description copied from interface: StrategyContext
Get the determined content type for the current request.

Specified by:
getMediaType in interface StrategyContext
Returns:
the content type that will be emmited to the client at the end of the current request
See Also:
StrategyContext.getMediaType()

getCharSet

public java.lang.String getCharSet()
Description copied from interface: StrategyContext
Get the encoding in which the response to the current request will be emmited.

Specified by:
getCharSet in interface StrategyContext
Returns:
the encoding of the response content
See Also:
StrategyContext.getCharSet()

isPortalSupportedWindowState

public boolean isPortalSupportedWindowState(WindowState state)
Description copied from interface: StrategyContext
Check if the presented WindowState is allowed for the current portal.

Specified by:
isPortalSupportedWindowState in interface StrategyContext
Parameters:
state - the state to check for validity
Returns:
true if the requested portal supports the presented state
See Also:
StrategyContext.isPortalSupportedWindowState(WindowState)

isPortalSupportedPortletMode

public boolean isPortalSupportedPortletMode(Mode mode)
Description copied from interface: StrategyContext
Check if the presented PortletMode is allowed for the current portal.

Specified by:
isPortalSupportedPortletMode in interface StrategyContext
Parameters:
mode - the mode to check for validity
Returns:
true if the requested portal supports the presented mode
See Also:
StrategyContext.isPortalSupportedPortletMode(Mode)