org.jboss.portal.server.theme.strategy
Interface StrategyResponse

All Known Implementing Classes:
StrategyResponseImpl

public interface StrategyResponse

Response of a layout strategy to communicate with the strategy interceptor.

The layout strategy can create a strategy response, and send it back to the strategy interceptor. The interceptor can then modify the request's state according to the desired changes expressed in the strategy response.


Method Summary
 void addModified(PortletContext portlet)
          Add a portlet to the list of portlets that have been modified by the strategy.
 void addNoRender(PortletContext portlet)
          Add a portlet to the list of portlets that are excluded from the render process.
 void addWindowStateChange(PortletContext portlet, WindowState state)
          Add a portlet to the list of portlets that received a new window state by the strategy.
 java.util.List getExcludedList()
          Get the list of portlets (portlet context) that should not be rendered by the portlet container.
 java.lang.String getLayoutURI()
          Get the URI of the layout to use.
 java.util.List getModifiedPortletContextList()
          Get the list of portlet contexts that have been modified.
 java.lang.String getState()
          Get the state for this strategy response
 java.util.Map getWindowStateChangeMap()
          Get a map of portlets that should change their window state, with the new state in the value
 void reset()
          Reset all the state of this response.
 void setState(java.lang.String state)
          Set the state for this strategy response.
 void setURI(java.lang.String layoutURI)
          Set the layout URI to use
 

Method Detail

getLayoutURI

java.lang.String getLayoutURI()
Get the URI of the layout to use. Note: this URI can only be one of the layout URIs defined in the layout of this request If the strategy does not return a URI, the strategy interceptor will test if the response contains a state, and if so, will try to get the URI for that state from the layout

Returns:
the URI of the layout to delegate to
See Also:
PortalLayout.getURI(), PortalLayout.getURI(String), getState(), setURI(java.lang.String)

getWindowStateChangeMap

java.util.Map getWindowStateChangeMap()
Get a map of portlets that should change their window state, with the new state in the value

Returns:
a map of portlets with changed window states (key: portlet context: value: window state)
See Also:
PortletContext, WindowState, addWindowStateChange(org.jboss.portal.server.theme.strategy.PortletContext, org.jboss.portal.server.plugins.windowstate.WindowState)

getExcludedList

java.util.List getExcludedList()
Get the list of portlets (portlet context) that should not be rendered by the portlet container.

Returns:
the list of portlets that should not be rendered
See Also:
PortletContext, addNoRender(org.jboss.portal.server.theme.strategy.PortletContext)

getModifiedPortletContextList

java.util.List getModifiedPortletContextList()
Get the list of portlet contexts that have been modified.

The portlet context allows to change the region and order of the portlet in that region. If the strategy alters any of those values, it must propagate the change via this list.

Returns:
a java.util.List of org.jboss.portal.core.theme.strategy.PortletContext
See Also:
PortletContext, addModified(org.jboss.portal.server.theme.strategy.PortletContext)

addNoRender

void addNoRender(PortletContext portlet)
Add a portlet to the list of portlets that are excluded from the render process.

Parameters:
portlet - the portlet to exclude

addModified

void addModified(PortletContext portlet)
Add a portlet to the list of portlets that have been modified by the strategy. Possible changes are in region assignment, and ordering inside a region

Parameters:
portlet - the portlet that has been modified
See Also:
PortletContext, getModifiedPortletContextList()

addWindowStateChange

void addWindowStateChange(PortletContext portlet,
                          WindowState state)
Add a portlet to the list of portlets that received a new window state by the strategy.

Parameters:
portlet - the portlet that got the new window state
state - the new window state
See Also:
PortletContext, WindowState, getWindowStateChangeMap()

reset

void reset()
Reset all the state of this response.

After the reset, the response's is equal to the state after it was created


setURI

void setURI(java.lang.String layoutURI)
Set the layout URI to use

Parameters:
layoutURI - the layout URI to use
See Also:
getLayoutURI()

setState

void setState(java.lang.String state)
Set the state for this strategy response.

The state is used to find a layout URI that is more atuned to this particular state

Parameters:
state - the state to use when looking for a layout URI
See Also:
PortalLayout.getURI(String)

getState

java.lang.String getState()
Get the state for this strategy response

Returns:
the state for this strategy response
See Also:
setState(java.lang.String)