com.filenet.wcm.toolkit.server.base

Class ControllerUtilities

  1. java.lang.Object
  2. extended bycom.filenet.wcm.toolkit.server.base.ControllerUtilities

  1. public final class ControllerUtilities
  2. extends java.lang.Object
In order to prevent WcmController from growing beyond its current ~5K lines, ControllerUtilities will contain utility methods required by it.

Nested Class Summary

Modifier and Type Class and Description
  1. protected static class
ControllerUtilities.ControllerState
Controller stateful data.
  1. protected static class
ControllerUtilities.PropertiesMap
Properties submaps for different high-level scopings.
  1. protected static class
ControllerUtilities.WindowIdInfo
WindowIdInfo objects are stored in the windowIdMap of the controller to help in expiring windowId's throughout the course of the user session.
  1. protected static class
ControllerUtilities.WindowIDManager
WindowIDManager takes care of aging out window ID's that have not been accessed for longer than a defined timeout limit.
  1. protected static class
ControllerUtilities.WindowState
Window stateful data

Field Summary

Modifier and Type Field and Description
  1. static
  2. long
CLEAN_INLINE_TIMEOUT
  1. static
  2. boolean
DEBUG_CLEANUP
  1. static
  2. java.lang.String
DEBUG_TRACE_KEY
  1. static
  2. boolean
ENABLE_CLEANUP_SETTINGS
  1. static
  2. java.lang.String
ERROR_TRACE_KEY
  1. static
  2. long
POPUP_TIMEOUT
  1. static
  2. java.lang.String
RESOURCE_TRACE_KEY
  1. static
  2. java.lang.String
SECURE_AUTNENTICATION_PARAMETERS
  1. static
  2. boolean
staticsInitialized
  1. static
  2. java.lang.String
UI_ROOT_KEY
  1. static
  2. java.lang.String
WINDOW_ID_COMPATIBILITY

Constructor Summary

Constructor and Description
ControllerUtilities()

Method Summary

Modifier and Type Method and Description
  1. protected static
  2. ControllerUtilities.ControllerState
getControllerState(WcmController controller)
Get the controller state...
  1. static
  2. java.lang.String
getInitParameter(WcmController controller,java.lang.String key)
  1. static
  2. boolean
getInitParameter(WcmController controller,java.lang.String key,boolean defaultValue)
  1. static
  2. long
getInitParameter(WcmController controller,java.lang.String key,long defaultValue)
  1. static
  2. java.lang.String
getInitParameter(WcmController controller,java.lang.String key,java.lang.String defaultValue)
  1. static
  2. boolean
getInitParameterBoolean(WcmController controller,java.lang.String key)
  1. static
  2. boolean
getInitParameterBoolean(WcmController controller,java.lang.String key,boolean defaultValue)
  1. protected static
  2. ControllerUtilities.PropertiesMap
getPropertiesMap(java.lang.String key,WcmDataStore parentMap)
Get a singleton properties map for the key.
  1. static
  2. boolean
getRemoveSessionId(WcmController controller)
  1. static
  2. int
getResourceTrace(WcmController controller)
  1. protected static
  2. java.lang.Object
getScopedProperty(WcmDataStore properties,java.lang.String key,java.lang.Object defaultValue,boolean setIfNotFound,boolean constructClass)
Get a property from the PropertiesMap.
  1. static
  2. java.lang.String
getUIRoot(WcmController controller)
  1. protected static
  2. ControllerUtilities.WindowIDManager
getWindowIDManager(WcmController controller)
  1. protected static
  2. ControllerUtilities.PropertiesMap
getWindowMap(java.lang.String windowId,WcmController controller,boolean create,boolean verify)
Convenience method for the window map.
  1. protected static
  2. ControllerUtilities.PropertiesMap
getWindowMap(java.lang.String windowId,WcmDataStore dataStore,boolean create)
Convenience method for the window map.
  1. protected static
  2. ControllerUtilities.WindowState
getWindowState(ControllerUtilities.PropertiesMap windowMap)
Get the window state object.
  1. protected static
  2. ControllerUtilities.WindowState
getWindowState(java.lang.String windowId,WcmDataStore dataStore,boolean create)
Get the window state via the windowMap.
  1. protected static
  2. boolean
releaseWindowMap(java.lang.String windowId,WcmDataStore dataStore)
  1. static
  2. boolean
sendCloseWindow(javax.servlet.http.HttpServletResponse response)
Writes some javascript to the browser telling it to close itself.
  1. static
  2. boolean
sendRedirect(javax.servlet.http.HttpServletResponse response,java.lang.String baseUrl,java.lang.String targetURL,int postThreshold)
Redirect to another page.
  1. static
  2. boolean
sendRedirectViaPOST(javax.servlet.http.HttpServletResponse response,WcmURLBuilder targetURL)
Redirect to the URL defined in targetURL by writing a form to the browser that contains hidden fields representing each key-value in the request string, followed by JavaScript that submits it.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

UI_ROOT_KEY

  1. public static java.lang.String UI_ROOT_KEY

RESOURCE_TRACE_KEY

  1. public static java.lang.String RESOURCE_TRACE_KEY

DEBUG_TRACE_KEY

  1. public static java.lang.String DEBUG_TRACE_KEY

ERROR_TRACE_KEY

  1. public static java.lang.String ERROR_TRACE_KEY

WINDOW_ID_COMPATIBILITY

  1. public static java.lang.String WINDOW_ID_COMPATIBILITY

SECURE_AUTNENTICATION_PARAMETERS

  1. public static final java.lang.String SECURE_AUTNENTICATION_PARAMETERS
See Also:

staticsInitialized

  1. public static boolean staticsInitialized

ENABLE_CLEANUP_SETTINGS

  1. public static boolean ENABLE_CLEANUP_SETTINGS

  1. public static long POPUP_TIMEOUT

CLEAN_INLINE_TIMEOUT

  1. public static long CLEAN_INLINE_TIMEOUT

DEBUG_CLEANUP

  1. public static boolean DEBUG_CLEANUP

Constructor Detail

ControllerUtilities

  1. public ControllerUtilities()

Method Detail

sendRedirect

  1. public static boolean sendRedirect( javax.servlet.http.HttpServletResponse response,
  2. java.lang.String baseUrl,
  3. java.lang.String targetURL,
  4. int postThreshold)
  5. throws java.io.IOException
Redirect to another page. This is typically accomplished via response.sendRedirect(). In the case of redirection to the getContent servlet, the redirect is done via a Refresh meta tag written out in the response. This is a workaround for a bug found in IE5. When postThreshold is specified as a non-zero positive int value, and the length of targetURL is greater than this value, the redirect is done via a form with hidden fields that is written to the browser and posted via JavaScript.
Parameters:
response -
baseUrl -
targetURL -
postThreshold - Specify the post threshold. If 0 or less is specified, this method will never redirect via POST.
Returns:
Whether or not the redirect was accomplished.
Throws:
java.io.IOException

sendRedirectViaPOST

  1. public static boolean sendRedirectViaPOST( javax.servlet.http.HttpServletResponse response,
  2. WcmURLBuilder targetURL)
  3. throws java.io.IOException
Redirect to the URL defined in targetURL by writing a form to the browser that contains hidden fields representing each key-value in the request string, followed by JavaScript that submits it.
Parameters:
response -
targetURL -
Returns:
Throws:
java.io.IOException

sendCloseWindow

  1. public static boolean sendCloseWindow( javax.servlet.http.HttpServletResponse response)
  2. throws java.io.IOException
Writes some javascript to the browser telling it to close itself.
Throws:
java.io.IOException

getInitParameter

  1. public static java.lang.String getInitParameter( WcmController controller,
  2. java.lang.String key)

getInitParameter

  1. public static java.lang.String getInitParameter( WcmController controller,
  2. java.lang.String key,
  3. java.lang.String defaultValue)

getInitParameter

  1. public static boolean getInitParameter( WcmController controller,
  2. java.lang.String key,
  3. boolean defaultValue)

getInitParameter

  1. public static long getInitParameter( WcmController controller,
  2. java.lang.String key,
  3. long defaultValue)

getInitParameterBoolean

  1. public static boolean getInitParameterBoolean( WcmController controller,
  2. java.lang.String key)

getInitParameterBoolean

  1. public static boolean getInitParameterBoolean( WcmController controller,
  2. java.lang.String key,
  3. boolean defaultValue)

getRemoveSessionId

  1. public static boolean getRemoveSessionId( WcmController controller)

getUIRoot

  1. public static java.lang.String getUIRoot( WcmController controller)

getResourceTrace

  1. public static int getResourceTrace( WcmController controller)

getWindowIDManager

  1. protected static ControllerUtilities.WindowIDManager getWindowIDManager( WcmController controller)
  2. throws WcmException
Throws:

getWindowState

  1. protected static ControllerUtilities.WindowState getWindowState( java.lang.String windowId,
  2. WcmDataStore dataStore,
  3. boolean create)
  4. throws WcmException
Get the window state via the windowMap.
Parameters:
windowId -
dataStore -
create -
Returns:
Throws:

getWindowState

  1. protected static ControllerUtilities.WindowState getWindowState( ControllerUtilities.PropertiesMap windowMap)
  2. throws WcmException
Get the window state object.
Parameters:
windowMap -
Returns:
Throws:

getControllerState

  1. protected static ControllerUtilities.ControllerState getControllerState( WcmController controller)
  2. throws WcmException
Get the controller state...
Parameters:
controller -
Returns:
Throws:

getPropertiesMap

  1. protected static ControllerUtilities.PropertiesMap getPropertiesMap( java.lang.String key,
  2. WcmDataStore parentMap)
  3. throws java.lang.Exception
Get a singleton properties map for the key. Create it if it does not exist.
Parameters:
key -
parentMap - This can either be the main dataStore instance or a PropertiesMap instance.
Returns:
Throws:
java.lang.Exception

getWindowMap

  1. protected static ControllerUtilities.PropertiesMap getWindowMap( java.lang.String windowId,
  2. WcmController controller,
  3. boolean create,
  4. boolean verify)
  5. throws FrameworkException
  6. WcmException
Convenience method for the window map. Optionally verifies that the windowId specified has not expired.
Parameters:
windowId -
controller -
create - - Set to true to create the windowId map if it does not already exist.
verify - - Set to true to verify that the windowId has not expired.
Returns:
Throws:

getWindowMap

  1. protected static ControllerUtilities.PropertiesMap getWindowMap( java.lang.String windowId,
  2. WcmDataStore dataStore,
  3. boolean create)
  4. throws WcmException
Convenience method for the window map.
Parameters:
windowId -
dataStore -
create -
Returns:
Throws:

releaseWindowMap

  1. protected static boolean releaseWindowMap( java.lang.String windowId,
  2. WcmDataStore dataStore)

getScopedProperty

  1. protected static java.lang.Object getScopedProperty( WcmDataStore properties,
  2. java.lang.String key,
  3. java.lang.Object defaultValue,
  4. boolean setIfNotFound,
  5. boolean constructClass)
  6. throws java.lang.Exception
Get a property from the PropertiesMap. Provides parameters to help in auto-creation.
Parameters:
properties -
key -
defaultValue -
setIfNotFound -
constructClass -
Returns:
Throws:
java.lang.Exception