org.apache.jetspeed.container.state
Interface NavigationalState

All Known Subinterfaces:
MutableNavigationalState

public interface NavigationalState

NavigationalState gives readonly access to the state of the Portal URL and all navigational state context as well as encoding a new State for usage in a Portal URL.
Note: Support for changing the PortletMode and/or WindowState of a PortletWindow, other than for encoding a new State is moved down to the MutableNavigationState interface to cleanly define the immutable contract of this interface.

Version:
$Id: NavigationalState.java 772001 2009-05-05 22:52:41Z ate $
Author:
David Sean Taylor

Field Summary
static java.lang.String NAVSTATE_SESSION_KEY
          Session key for storing the PortletWindowSessionNavigationalStates
static java.lang.String PRP_SESSION_KEY
          Session key for storing the PublicRenderParametersMap
 
Method Summary
 java.lang.String encode()
          Encodes the current navigational State into a string to be embedded within a PortalURL.
 java.lang.String encode(PortletWindow window, java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.String actionScopeId, boolean actionScopeRendered, java.lang.String cacheLevel, java.lang.String resourceId, java.util.Map<java.lang.String,java.lang.String[]> privateRenderParameters, java.util.Map<java.lang.String,java.lang.String[]> publicRenderParameters, javax.portlet.PortletMode mode, javax.portlet.WindowState state, boolean action)
          Deprecated.  
 java.lang.String encode(PortletWindow window, java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.String actionScopeId, boolean actionScopeRendered, java.lang.String cacheLevel, java.lang.String resourceId, java.util.Map<java.lang.String,java.lang.String[]> privateRenderParameters, java.util.Map<java.lang.String,java.lang.String[]> publicRenderParameters, javax.portlet.PortletMode mode, javax.portlet.WindowState state, PortalURL.URLType urlType)
          Encodes the Navigational State with overrides for a specific PortletWindow into a string to be embedded within a PortalURL.
 java.lang.String encode(PortletWindow window, javax.portlet.PortletMode mode, javax.portlet.WindowState state)
          Encodes the Navigational State with overrides for a specific PortletWindow while retaining its (request) parameters into a string to be embedded within a renderURL.
 java.lang.String getActionScopeId(PortletWindow window)
           
 java.lang.String getCacheLevel(PortletWindow window)
           
 javax.portlet.PortletMode getMappedMode(PortletWindow window)
          Gets the internal (portal) portlet mode for the given portlet window.
 javax.portlet.PortletMode getMappedMode(java.lang.String windowId)
          Gets the internal (portal) portlet mode for the given portlet window id.
 javax.portlet.WindowState getMappedState(PortletWindow window)
          Gets the internal (portal) window state for given portlet window.
 javax.portlet.WindowState getMappedState(java.lang.String windowId)
          Gets the internal (portal) window state for given portlet window id.
 PortletWindow getMaximizedWindow()
          For the current request return the (first) maximized window or return null if no windows are maximized.
 javax.portlet.PortletMode getMode(PortletWindow window)
          Gets the portlet mode for the given portlet window.
 javax.portlet.PortletMode getMode(java.lang.String windowId)
          Deprecated.  
 java.util.Map<java.lang.String,java.lang.String[]> getParameterMap(PortletWindow window)
           
 PortletWindow getPortletWindowOfAction()
           
 PortletWindow getPortletWindowOfResource()
           
 java.util.Map<java.lang.String,java.lang.String[]> getPrivateRenderParameterMap(PortletWindow window)
           
 java.util.Map<java.lang.String,java.lang.String[]> getPublicRenderParameterMap(PortletWindow window)
           
 java.util.Map<java.lang.String,java.lang.String[]> getRequestParameterMap()
          Provides a "safe" copy of the client/portal request parameterMap, with the values already (re)encode in the preferred or requested character encoding
 java.lang.String getResourceID(PortletWindow window)
           
 javax.portlet.WindowState getState(PortletWindow window)
          Gets the window state for given portlet window.
 javax.portlet.WindowState getState(java.lang.String windowId)
          Deprecated.  
 PortalURL.URLType getURLType()
           
 java.util.Iterator<java.lang.String> getWindowIdIterator()
          Returns an iterator of Portlet Window ids of all the Portlet Windows within the NavigationalState.
 void init(java.lang.String encodedState, java.lang.String characterEncoding)
           
 boolean isActionScopedRequestAttributes(PortletWindow window)
           
 boolean isActionScopeRendered(PortletWindow window)
           
 boolean isNavigationalParameterStateFull()
           
 boolean isRenderParameterStateFull()
           
 void registerPortletContentCachedForPublicRenderParameters(RequestContext context, PortletContent content)
           
 boolean sync(RequestContext context)
          Synchronize the Navigational State with saved state (if used).
 

Field Detail

NAVSTATE_SESSION_KEY

static final java.lang.String NAVSTATE_SESSION_KEY
Session key for storing the PortletWindowSessionNavigationalStates

See Also:
Constant Field Values

PRP_SESSION_KEY

static final java.lang.String PRP_SESSION_KEY
Session key for storing the PublicRenderParametersMap

See Also:
Constant Field Values
Method Detail

init

void init(java.lang.String encodedState,
          java.lang.String characterEncoding)
          throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

sync

boolean sync(RequestContext context)
Synchronize the Navigational State with saved state (if used).

Parameters:
context - The RequestContext for this Navigational State
Returns:
false if the target PortletWindow (action or resource) could not be resolved

getState

javax.portlet.WindowState getState(PortletWindow window)
Gets the window state for given portlet window.

Parameters:
window -
Returns:

getMappedState

javax.portlet.WindowState getMappedState(PortletWindow window)
Gets the internal (portal) window state for given portlet window.

Parameters:
window -
Returns:

getState

javax.portlet.WindowState getState(java.lang.String windowId)
Deprecated. 

Gets the window state for given portlet window id.

Parameters:
windowId -
Returns:

getMappedState

javax.portlet.WindowState getMappedState(java.lang.String windowId)
Gets the internal (portal) window state for given portlet window id.

Parameters:
windowId -
Returns:

getMode

javax.portlet.PortletMode getMode(PortletWindow window)
Gets the portlet mode for the given portlet window.

Parameters:
window -
Returns:

getMappedMode

javax.portlet.PortletMode getMappedMode(PortletWindow window)
Gets the internal (portal) portlet mode for the given portlet window.

Parameters:
window -
Returns:

getMode

javax.portlet.PortletMode getMode(java.lang.String windowId)
Deprecated. 

Gets the portlet mode for the given portlet window id.

Parameters:
windowId -
Returns:

getMappedMode

javax.portlet.PortletMode getMappedMode(java.lang.String windowId)
Gets the internal (portal) portlet mode for the given portlet window id.

Parameters:
windowId -
Returns:

getMaximizedWindow

PortletWindow getMaximizedWindow()
For the current request return the (first) maximized window or return null if no windows are maximized.

Returns:
The maximized window or null

getRequestParameterMap

java.util.Map<java.lang.String,java.lang.String[]> getRequestParameterMap()
Provides a "safe" copy of the client/portal request parameterMap, with the values already (re)encode in the preferred or requested character encoding

This parameterMap is created early (and only once) to protect against dynamic modification by certain webcontainers like Websphere which might change the contents of the original request parametersMap during request dispatching with additional query string parameters.

Furthermore, when using parallel rendering this is even more critical to do upfront and only once while still in the initial portal request Thread.

Returns:

getParameterMap

java.util.Map<java.lang.String,java.lang.String[]> getParameterMap(PortletWindow window)

isActionScopedRequestAttributes

boolean isActionScopedRequestAttributes(PortletWindow window)

getActionScopeId

java.lang.String getActionScopeId(PortletWindow window)

isActionScopeRendered

boolean isActionScopeRendered(PortletWindow window)

getCacheLevel

java.lang.String getCacheLevel(PortletWindow window)

getResourceID

java.lang.String getResourceID(PortletWindow window)

getPrivateRenderParameterMap

java.util.Map<java.lang.String,java.lang.String[]> getPrivateRenderParameterMap(PortletWindow window)

getPublicRenderParameterMap

java.util.Map<java.lang.String,java.lang.String[]> getPublicRenderParameterMap(PortletWindow window)

getURLType

PortalURL.URLType getURLType()

getPortletWindowOfAction

PortletWindow getPortletWindowOfAction()

getPortletWindowOfResource

PortletWindow getPortletWindowOfResource()

getWindowIdIterator

java.util.Iterator<java.lang.String> getWindowIdIterator()
Returns an iterator of Portlet Window ids of all the Portlet Windows within the NavigationalState.
Note: for an ActionRequest, this will include the window id of the PortletWindowOfAction.

Returns:
iterator of portletWindow ids (String)

encode

java.lang.String encode(PortletWindow window,
                        java.util.Map<java.lang.String,java.lang.String[]> parameters,
                        java.lang.String actionScopeId,
                        boolean actionScopeRendered,
                        java.lang.String cacheLevel,
                        java.lang.String resourceId,
                        java.util.Map<java.lang.String,java.lang.String[]> privateRenderParameters,
                        java.util.Map<java.lang.String,java.lang.String[]> publicRenderParameters,
                        javax.portlet.PortletMode mode,
                        javax.portlet.WindowState state,
                        boolean action)
                        throws java.io.UnsupportedEncodingException
Deprecated. 

Encodes the Navigational State with overrides for a specific PortletWindow into a string to be embedded within a PortalURL.

Parameters:
window - the PortalWindow
parameters - the new request or action parameters for the PortalWindow
actionScopeId - the new action scope for the PortalWindow
actionScopeRendered - the new action scope rendered flag for the PortalWindow
cacheLevel - the new cache level for the PortalWindow resource
resourceId - the new resource id for the PortalWindow resource
privateRenderParameters - the new private render parameters for the PortalWindow resource
publicRenderParameters - the new request, action, or resource public render parameters for the PortalWindow
mode - the new PortletMode for the PortalWindow
state - the new WindowState for the PortalWindow
action - indicates if to be used in an actionURL or renderURL
Returns:
encoded new Navigational State
Throws:
java.io.UnsupportedEncodingException

encode

java.lang.String encode(PortletWindow window,
                        java.util.Map<java.lang.String,java.lang.String[]> parameters,
                        java.lang.String actionScopeId,
                        boolean actionScopeRendered,
                        java.lang.String cacheLevel,
                        java.lang.String resourceId,
                        java.util.Map<java.lang.String,java.lang.String[]> privateRenderParameters,
                        java.util.Map<java.lang.String,java.lang.String[]> publicRenderParameters,
                        javax.portlet.PortletMode mode,
                        javax.portlet.WindowState state,
                        PortalURL.URLType urlType)
                        throws java.io.UnsupportedEncodingException
Encodes the Navigational State with overrides for a specific PortletWindow into a string to be embedded within a PortalURL.

Parameters:
window - the PortalWindow
parameters - the new request or action parameters for the PortalWindow
actionScopeId - the new action scope for the PortalWindow
actionScopeRendered - the new action scope rendered flag for the PortalWindow
cacheLevel - the new cache level for the PortalWindow resource
resourceId - the new resource id for the PortalWindow resource
privateRenderParameters - the new private render parameters for the PortalWindow resource
publicRenderParameters - the new request, action, or resource public render parameters for the PortalWindow
mode - the new PortletMode for the PortalWindow
state - the new WindowState for the PortalWindow
urlType - indicates if to be used in an actionURL, ResourceURL or renderURL
Returns:
encoded new Navigational State
Throws:
java.io.UnsupportedEncodingException

encode

java.lang.String encode(PortletWindow window,
                        javax.portlet.PortletMode mode,
                        javax.portlet.WindowState state)
                        throws java.io.UnsupportedEncodingException
Encodes the Navigational State with overrides for a specific PortletWindow while retaining its (request) parameters into a string to be embedded within a renderURL.

Parameters:
window - the PortalWindow
mode - the new PortletMode for the PortalWindow
state - the new WindowState for the PortalWindow
Returns:
encoded new Navigational State
Throws:
java.io.UnsupportedEncodingException

encode

java.lang.String encode()
                        throws java.io.UnsupportedEncodingException
Encodes the current navigational State into a string to be embedded within a PortalURL.

Returns:
encoded new Navigational State
Throws:
java.io.UnsupportedEncodingException

isNavigationalParameterStateFull

boolean isNavigationalParameterStateFull()
Returns:
true if WindowStates and PortletModes will be saved in the Session

isRenderParameterStateFull

boolean isRenderParameterStateFull()
Returns:
true if render parameters will be saved in the Session

registerPortletContentCachedForPublicRenderParameters

void registerPortletContentCachedForPublicRenderParameters(RequestContext context,
                                                           PortletContent content)


Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.