|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.container.services.information.PortletStateManager
public class PortletStateManager
The PortletStateManager implementation. Analyzes the incoming request parameters for the given PortletWindow, changes the window states/portlet modes, stores them in the static hash maps, builds a portlet URL based on the changed modes/states and portlet render parameters for the current PortletWindow.
Field Summary | |
---|---|
static java.lang.String |
ACTION
|
private boolean |
isAction
|
private static org.apache.commons.logging.Log |
LOG
|
static java.lang.String |
MIN_CHAN_ID
|
private static java.lang.String |
MINIMIZED
|
private boolean |
nextAction
|
private javax.portlet.PortletMode |
nextMode
|
private javax.portlet.WindowState |
nextState
|
private java.util.Map |
params
|
private static java.lang.String |
ROOT
|
static java.lang.String |
UP_EDIT_TARGET
|
static java.lang.String |
UP_HELP_TARGET
|
static java.lang.String |
UP_PARAM_PREFIX
|
static java.lang.String |
UP_ROOT
|
static java.lang.String |
UP_TCATTR
|
static java.lang.String |
UP_VIEW_TARGET
|
static java.lang.String |
UP_WINDOW_STATE
|
private PortletWindowImpl |
windowOfAction
|
Constructor Summary | |
---|---|
PortletStateManager(org.apache.pluto.om.window.PortletWindow window)
Creates a new PortletStateManager instance which can be used for generating a URL for the specified PortletWindow. |
Method Summary | |
---|---|
private void |
analyzeRequestInformation()
Analyzes the request parameters and sets portlet modes/window states for the current PortletWindow |
void |
clearParameters()
Clears the render parameters for the current PortletWindow |
static void |
clearState(org.apache.pluto.om.window.PortletWindow window)
Clears the PorletMode and WindowState information for the specifid PortletWindow |
private java.lang.String |
decodeString(java.lang.String text)
Generates the UTF-8 URL decoded version of the string, wrapping the possible UnsupportedEncodingException in a RuntimeException. |
private java.lang.String |
encodeString(java.lang.String text)
Generates the UTF-8 URL encoded version of the string, wrapping the possible UnsupportedEncodingException in a RuntimeException. |
java.lang.String |
getActionURL()
Returns a full portlet URL including uP file |
private java.lang.String |
getEncodedParameterString()
Generates the string representation of the request parameters for the portlet based on it's current state. |
private static java.lang.String |
getKey(org.apache.pluto.om.window.PortletWindow window)
Generates a key from the PortletWindow id. |
static javax.portlet.PortletMode |
getMode(org.apache.pluto.om.window.PortletWindow window)
Returns the current portlet mode for the given PortletWindow |
static javax.portlet.PortletMode |
getPrevMode(org.apache.pluto.om.window.PortletWindow window)
Returns the previous portlet mode for the given PortletWindow |
static javax.portlet.WindowState |
getPrevState(org.apache.pluto.om.window.PortletWindow window)
Returns the previous portlet state for the given PortletWindow |
private static javax.servlet.http.HttpSession |
getSession(org.apache.pluto.om.window.PortletWindow window)
Gets a HttpSession for the specified PortletWindow. |
static javax.portlet.WindowState |
getState(org.apache.pluto.om.window.PortletWindow window)
Returns the current portlet state for the given PortletWindow |
private static PortletWindowStateInfo |
getStateInfo(org.apache.pluto.om.window.PortletWindow window)
Gets PortletWindowStateInfo for the PortletWindow, creates one if nessesary. |
private static javax.servlet.http.HttpServletRequest |
getUnwrapedRequest(javax.servlet.http.HttpServletRequest request)
Recursivly unwrapps a HttpServletRequest. |
boolean |
isAction()
Returns true if the current PortletRequest is ActionRequest, false - otherwise |
void |
setAction()
Setting the portlet action parameter for the next request |
static void |
setMode(org.apache.pluto.om.window.PortletWindow window,
javax.portlet.PortletMode mode)
Sets the portlet mode for the given PortletWindow |
void |
setNextMode(javax.portlet.PortletMode mode)
Sets the next portlet mode for the current PortletWindow |
void |
setNextState(javax.portlet.WindowState state)
Sets the next window state for the current PortletWindow |
void |
setParameters(java.util.Map parameters)
Adds the render parameters to the portlet URL |
static void |
setState(org.apache.pluto.om.window.PortletWindow window,
javax.portlet.WindowState state)
Sets the window state for the given PortletWindow |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log LOG
public static final java.lang.String UP_PARAM_PREFIX
public static final java.lang.String ACTION
public static final java.lang.String UP_ROOT
public static final java.lang.String UP_TCATTR
public static final java.lang.String UP_HELP_TARGET
public static final java.lang.String UP_EDIT_TARGET
public static final java.lang.String UP_VIEW_TARGET
public static final java.lang.String UP_WINDOW_STATE
public static final java.lang.String MIN_CHAN_ID
private static final java.lang.String MINIMIZED
private static final java.lang.String ROOT
private final PortletWindowImpl windowOfAction
private boolean isAction
private boolean nextAction
private javax.portlet.PortletMode nextMode
private javax.portlet.WindowState nextState
private final java.util.Map params
Constructor Detail |
---|
public PortletStateManager(org.apache.pluto.om.window.PortletWindow window)
window
- The PortletWindow to generate a URL for.Method Detail |
---|
public void setNextMode(javax.portlet.PortletMode mode)
mode
- a portlet modepublic void setNextState(javax.portlet.WindowState state)
state
- a window statepublic void setAction()
public void setParameters(java.util.Map parameters)
parameters
- a Map
containing the render parameterspublic boolean isAction()
public void clearParameters()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.String getActionURL()
private java.lang.String getEncodedParameterString()
private void analyzeRequestInformation()
private java.lang.String encodeString(java.lang.String text)
text
- The string to encode.
private java.lang.String decodeString(java.lang.String text)
text
- The string to decode.
public static void clearState(org.apache.pluto.om.window.PortletWindow window)
window
- The PortletWindow to clear the state information forpublic static javax.portlet.PortletMode getMode(org.apache.pluto.om.window.PortletWindow window)
window
- a portlet window
public static javax.portlet.PortletMode getPrevMode(org.apache.pluto.om.window.PortletWindow window)
window
- a portlet window
public static javax.portlet.WindowState getState(org.apache.pluto.om.window.PortletWindow window)
window
- a portlet window
public static javax.portlet.WindowState getPrevState(org.apache.pluto.om.window.PortletWindow window)
window
- a portlet window
public static void setMode(org.apache.pluto.om.window.PortletWindow window, javax.portlet.PortletMode mode)
window
- a portlet windowmode
- a portlet modepublic static void setState(org.apache.pluto.om.window.PortletWindow window, javax.portlet.WindowState state)
window
- a portlet windowstate
- a window stateprivate static javax.servlet.http.HttpSession getSession(org.apache.pluto.om.window.PortletWindow window)
window
- The PortletWindow to get the HttpSession for.
java.lang.IllegalStateException
- If the PortletWindow doesn't have an associated HttpServletRequest object.private static javax.servlet.http.HttpServletRequest getUnwrapedRequest(javax.servlet.http.HttpServletRequest request)
request
- The request to unwrap.
private static PortletWindowStateInfo getStateInfo(org.apache.pluto.om.window.PortletWindow window)
window
- The PortletWindow to get the PortletWindowStateInfo for.
private static java.lang.String getKey(org.apache.pluto.om.window.PortletWindow window)
window
- The PortletWindow to generate the key from.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |