org.apache.jetspeed.container.state.impl
Class JetspeedNavigationalStateCodec

java.lang.Object
  extended by org.apache.jetspeed.container.state.impl.JetspeedNavigationalStateCodec
All Implemented Interfaces:
NavigationalStateCodec

public class JetspeedNavigationalStateCodec
extends Object
implements NavigationalStateCodec

JetspeedNavigationalStateCodec

Version:
$Id: JetspeedNavigationalStateCodec.java 554926 2007-07-10 13:12:26Z ate $
Author:
Ate Douma

Field Summary
protected static char ACTION_WINDOW_ID_KEY
           
protected static char CLEAR_PARAMS_KEY
           
protected static String keytable
           
protected static org.apache.commons.logging.Log log
          Commons logging
protected static char MODE_KEY
           
protected static char PARAM_KEY
           
protected static char PARAMETER_ELEMENT_SEPARATOR
           
protected static char PARAMETER_SEPARATOR
           
protected  javax.portlet.PortletMode[] portletModes
           
protected static char RENDER_WINDOW_ID_KEY
           
protected static char RESOURCE_WINDOW_ID_KEY
           
protected static char STATE_KEY
           
private  org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor
           
protected  javax.portlet.WindowState[] windowStates
           
 
Constructor Summary
JetspeedNavigationalStateCodec(org.apache.jetspeed.PortalContext portalContext, org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor)
           
 
Method Summary
 PortletWindowRequestNavigationalStates decode(String parameters, String characterEncoding)
           
protected  int decodeArgument(int position, String arguments, StringBuffer buffer, char escape)
           
protected  PortletWindowRequestNavigationalState decodeParameter(org.apache.jetspeed.container.window.PortletWindowAccessor accessor, PortletWindowRequestNavigationalStates states, PortletWindowRequestNavigationalState currentState, String parameter)
           
protected  String decodeParameters(String value, String characterEncoding)
          Decodes a Base64 encoded string.
protected  javax.portlet.PortletMode decodePortletMode(char mode)
           
protected  javax.portlet.WindowState decodeWindowState(char state)
           
 String encode(PortletWindowRequestNavigationalStates states, boolean navParamsStateFull, boolean renderParamsStateFull)
           
 String encode(PortletWindowRequestNavigationalStates states, org.apache.pluto.om.window.PortletWindow window, Map parameters, javax.portlet.PortletMode portletMode, javax.portlet.WindowState windowState, boolean action, boolean navParamsStateFull, boolean renderParamsStateFull)
           
 String encode(PortletWindowRequestNavigationalStates states, org.apache.pluto.om.window.PortletWindow window, javax.portlet.PortletMode portletMode, javax.portlet.WindowState windowState, boolean navParamsStateFull, boolean renderParamsStateFull)
           
protected  String encode(PortletWindowRequestNavigationalStates states, String targetWindowId, PortletWindowRequestNavigationalState targetState, boolean action, boolean resource, boolean navParamsStateFull, boolean renderParamsStateFull)
           
protected  String encodeArgument(String argument, char escape)
           
protected  String encodeParameters(String value, String characterEncoding)
          Encodes a string with Base64.
protected  char encodePortletMode(javax.portlet.PortletMode portletMode)
           
protected  String encodePortletWindowNavigationalState(String windowId, PortletWindowRequestNavigationalState state, boolean action, boolean resource, boolean navParamsStateFull, boolean renderParamsStateFull)
           
protected  char encodeWindowState(javax.portlet.WindowState windowState)
           
private  void logDecode(PortletWindowRequestNavigationalStates states, StringBuffer buffer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
Commons logging


PARAMETER_SEPARATOR

protected static final char PARAMETER_SEPARATOR
See Also:
Constant Field Values

PARAMETER_ELEMENT_SEPARATOR

protected static final char PARAMETER_ELEMENT_SEPARATOR
See Also:
Constant Field Values

RENDER_WINDOW_ID_KEY

protected static final char RENDER_WINDOW_ID_KEY
See Also:
Constant Field Values

ACTION_WINDOW_ID_KEY

protected static final char ACTION_WINDOW_ID_KEY
See Also:
Constant Field Values

MODE_KEY

protected static final char MODE_KEY
See Also:
Constant Field Values

STATE_KEY

protected static final char STATE_KEY
See Also:
Constant Field Values

PARAM_KEY

protected static final char PARAM_KEY
See Also:
Constant Field Values

CLEAR_PARAMS_KEY

protected static final char CLEAR_PARAMS_KEY
See Also:
Constant Field Values

RESOURCE_WINDOW_ID_KEY

protected static final char RESOURCE_WINDOW_ID_KEY
See Also:
Constant Field Values

keytable

protected static final String keytable
See Also:
Constant Field Values

portletModes

protected final javax.portlet.PortletMode[] portletModes

windowStates

protected final javax.portlet.WindowState[] windowStates

windowAccessor

private final org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor
Constructor Detail

JetspeedNavigationalStateCodec

public JetspeedNavigationalStateCodec(org.apache.jetspeed.PortalContext portalContext,
                                      org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor)
Method Detail

decode

public PortletWindowRequestNavigationalStates decode(String parameters,
                                                     String characterEncoding)
                                              throws UnsupportedEncodingException
Specified by:
decode in interface NavigationalStateCodec
Throws:
UnsupportedEncodingException

logDecode

private void logDecode(PortletWindowRequestNavigationalStates states,
                       StringBuffer buffer)

encode

public String encode(PortletWindowRequestNavigationalStates states,
                     org.apache.pluto.om.window.PortletWindow window,
                     javax.portlet.PortletMode portletMode,
                     javax.portlet.WindowState windowState,
                     boolean navParamsStateFull,
                     boolean renderParamsStateFull)
              throws UnsupportedEncodingException
Specified by:
encode in interface NavigationalStateCodec
Throws:
UnsupportedEncodingException

encode

public String encode(PortletWindowRequestNavigationalStates states,
                     org.apache.pluto.om.window.PortletWindow window,
                     Map parameters,
                     javax.portlet.PortletMode portletMode,
                     javax.portlet.WindowState windowState,
                     boolean action,
                     boolean navParamsStateFull,
                     boolean renderParamsStateFull)
              throws UnsupportedEncodingException
Specified by:
encode in interface NavigationalStateCodec
Throws:
UnsupportedEncodingException

encode

public String encode(PortletWindowRequestNavigationalStates states,
                     boolean navParamsStateFull,
                     boolean renderParamsStateFull)
              throws UnsupportedEncodingException
Specified by:
encode in interface NavigationalStateCodec
Throws:
UnsupportedEncodingException

encode

protected String encode(PortletWindowRequestNavigationalStates states,
                        String targetWindowId,
                        PortletWindowRequestNavigationalState targetState,
                        boolean action,
                        boolean resource,
                        boolean navParamsStateFull,
                        boolean renderParamsStateFull)
                 throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

encodePortletWindowNavigationalState

protected String encodePortletWindowNavigationalState(String windowId,
                                                      PortletWindowRequestNavigationalState state,
                                                      boolean action,
                                                      boolean resource,
                                                      boolean navParamsStateFull,
                                                      boolean renderParamsStateFull)

decodeParameter

protected PortletWindowRequestNavigationalState decodeParameter(org.apache.jetspeed.container.window.PortletWindowAccessor accessor,
                                                                PortletWindowRequestNavigationalStates states,
                                                                PortletWindowRequestNavigationalState currentState,
                                                                String parameter)

decodePortletMode

protected javax.portlet.PortletMode decodePortletMode(char mode)

encodePortletMode

protected char encodePortletMode(javax.portlet.PortletMode portletMode)

decodeWindowState

protected javax.portlet.WindowState decodeWindowState(char state)

encodeWindowState

protected char encodeWindowState(javax.portlet.WindowState windowState)

decodeParameters

protected String decodeParameters(String value,
                                  String characterEncoding)
                           throws UnsupportedEncodingException
Decodes a Base64 encoded string. Because the encoded string is used in an URL the two '/' and '=' which has some significance in an URL are encoded on top of the Base64 encoding and are first translated back before decoding.

Parameters:
value -
characterEncoding - String containing the name of the chararacter encoding
Returns:
decoded string
Throws:
UnsupportedEncodingException

encodeParameters

protected String encodeParameters(String value,
                                  String characterEncoding)
                           throws UnsupportedEncodingException
Encodes a string with Base64. Because the encoded string is used in an URL the two '/' and '=' which has some significance in an URL are encoded on top of/after the Base64 encoding

Parameters:
value -
Returns:
encoded string
Throws:
UnsupportedEncodingException

encodeArgument

protected String encodeArgument(String argument,
                                char escape)

decodeArgument

protected int decodeArgument(int position,
                             String arguments,
                             StringBuffer buffer,
                             char escape)


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.