com.filenet.wcm.toolkit.server.util

Class ClientTimeZoneUtil

  1. java.lang.Object
  2. extended bycom.filenet.wcm.toolkit.server.util.ClientTimeZoneUtil

  1. public class ClientTimeZoneUtil
  2. extends java.lang.Object

Field Summary

Modifier and Type Field and Description
  1. static
  2. java.lang.String
BROWSER_OFFSET1_KEY
  1. static
  2. java.lang.String
BROWSER_OFFSET2_KEY
  1. static
  2. java.lang.String
BROWSER_TIME1_KEY
  1. static
  2. java.lang.String
BROWSER_TIME2_KEY
  1. static
  2. java.lang.String
CLIENT_TIME_ZONE_ID
  1. protected static
  2. java.lang.String
TZ_QUERY_FORM_NAME

Constructor Summary

Constructor and Description
ClientTimeZoneUtil()

Method Summary

Modifier and Type Method and Description
  1. static
  2. void
configureBrowserTimeZone(javax.servlet.http.HttpServletRequest req,java.util.Map parameters,java.util.Locale clientLocale,WcmDataStore dataStore)
Configures the browser TimeZone object based on information passed back from the client browser (either applet or a JavaScript form, and stores it in the datastore.
  1. static
  2. void
configureClientTimeZone(javax.servlet.http.HttpServletRequest req,java.util.Map parameters,java.util.Locale clientLocale,WcmDataStore dataStore)
Configures the client TimeZone object based on information passed back from the client browser, and stores it in the datastore.
  1. static
  2. void
configureClientTimeZone(javax.servlet.http.HttpServletRequest req,java.util.Map parameters,java.util.Locale clientLocale,WcmDataStore dataStore,boolean forceRefresh)
Configures the client TimeZone object based on information passed back from the client browser, and stores it in the datastore.
  1. static
  2. java.util.TimeZone
getBrowserTimeZone(WcmDataStore ds)
Gets the browser TimeZone from the datastore.
  1. static
  2. java.util.TimeZone
getClientTimeZone(WcmDataStore ds,java.util.TimeZone defaultTimeZone)
Gets the client TimeZone from the datastore.
  1. static
  2. java.lang.String
getID(java.util.TimeZone tz)
  1. static
  2. java.util.TimeZone
getTimeZone(java.lang.String timeZoneID)
  1. static
  2. java.lang.String
getTimeZoneHiddenFields(java.lang.String formName,java.lang.String extraScript)
Return a set of hidden fields that can be included in an HTML form, to support retrieval of the browser machine's timezone information when needed.
  1. static
  2. java.lang.String
getTimeZoneParameter(javax.servlet.http.HttpServletRequest request,java.util.Map parameters,java.lang.String key)
  1. static
  2. boolean
isClientTimeZoneDefined(WcmDataStore ds)
Indicates whether or not the client TimeZone object exists in the datastore.
  1. static
  2. boolean
isTimeZoneExplicit(WcmDataStore ds)
Returns true if the client timezone explicit flag is set.
  1. static
  2. boolean
queryBrowserTimeZone(WcmDataStore dataStore,javax.servlet.http.HttpServletRequest request,javax.servlet.http.HttpServletResponse response,java.lang.String windowId,java.lang.String eventTarget,java.lang.String eventName)
Retrieve the browser timezone by writing a hidden form to the browser and submitting it.
  1. static
  2. void
setBrowserTimeZone(WcmDataStore ds,java.util.TimeZone clientTimeZone)
Set the browser TimeZone object in the datastore.
  1. static
  2. void
setClientTimeZone(WcmDataStore ds,java.util.TimeZone clientTimeZone)
Set the client TimeZone object in the datastore.
  1. static
  2. void
setClientTimeZone(WcmDataStore ds,java.util.TimeZone clientTimeZone,boolean isExplicit)
Set the client TimeZone object in the datastore.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

BROWSER_TIME1_KEY

  1. public static java.lang.String BROWSER_TIME1_KEY

BROWSER_TIME2_KEY

  1. public static java.lang.String BROWSER_TIME2_KEY

BROWSER_OFFSET1_KEY

  1. public static java.lang.String BROWSER_OFFSET1_KEY

BROWSER_OFFSET2_KEY

  1. public static java.lang.String BROWSER_OFFSET2_KEY

CLIENT_TIME_ZONE_ID

  1. public static java.lang.String CLIENT_TIME_ZONE_ID

TZ_QUERY_FORM_NAME

  1. protected static final java.lang.String TZ_QUERY_FORM_NAME
See Also:

Constructor Detail

ClientTimeZoneUtil

  1. public ClientTimeZoneUtil()

Method Detail

queryBrowserTimeZone

  1. public static boolean queryBrowserTimeZone( WcmDataStore dataStore,
  2. javax.servlet.http.HttpServletRequest request,
  3. javax.servlet.http.HttpServletResponse response,
  4. java.lang.String windowId,
  5. java.lang.String eventTarget,
  6. java.lang.String eventName)
  7. throws java.lang.Exception
Retrieve the browser timezone by writing a hidden form to the browser and submitting it. The page as identified in the request object is reloaded with the browser timezone parameters included. The caller can optionally define a targeted or global event to fire with the data if desired. Return true if the form was written to query for browser timezone. The query is done only if the client timezone has not already been captured, and if the current request does not contain the browser timezone parameters.
Parameters:
dataStore - - The dataStore object for this session.
request - - The request object. The URL of this request object is used as the form action URL.
response - - The response object.
windowId - - The windowId to encode on the form action (optional).
eventTarget - - The target UI module name for a targeted event (optional).
eventName - - The event name for a targeted or global event (optional).
Returns:
True if the form was written, false if not.
Throws:
java.lang.Exception

getTimeZoneHiddenFields

  1. public static java.lang.String getTimeZoneHiddenFields( java.lang.String formName,
  2. java.lang.String extraScript)
Return a set of hidden fields that can be included in an HTML form, to support retrieval of the browser machine's timezone information when needed. These hidden fields are populated by the JavaScript returned from getTimeZoneQueryJavaScript So that when the form is submitted, the information is sent back to the server.
Returns:
A String of HTML.

isClientTimeZoneDefined

  1. public static boolean isClientTimeZoneDefined( WcmDataStore ds)
Indicates whether or not the client TimeZone object exists in the datastore.
Parameters:
ds - The datastore
Returns:
True if the TimeZone object exists.

getTimeZone

  1. public static java.util.TimeZone getTimeZone( java.lang.String timeZoneID)

getClientTimeZone

  1. public static java.util.TimeZone getClientTimeZone( WcmDataStore ds,
  2. java.util.TimeZone defaultTimeZone)
  3. throws java.lang.Exception
Gets the client TimeZone from the datastore. If the client timezone has not been configured and no default timezone is specified, this method will throw an exception.
Parameters:
ds - The datastore
defaultTimeZone - The default timezone to use if the client timezone is not defined.
Returns:
The TimeZone object if defined, otherwise null.
Throws:
java.lang.Exception

getBrowserTimeZone

  1. public static java.util.TimeZone getBrowserTimeZone( WcmDataStore ds)
  2. throws java.lang.Exception
Gets the browser TimeZone from the datastore. If the client timezone has not been configured , this method will throw an exception.
Parameters:
ds - The datastore
Returns:
The TimeZone object.
Throws:
java.lang.Exception

isTimeZoneExplicit

  1. public static boolean isTimeZoneExplicit( WcmDataStore ds)
Returns true if the client timezone explicit flag is set.
Parameters:
ds -
Returns:

getTimeZoneParameter

  1. public static java.lang.String getTimeZoneParameter( javax.servlet.http.HttpServletRequest request,
  2. java.util.Map parameters,
  3. java.lang.String key)

configureClientTimeZone

  1. public static void configureClientTimeZone( javax.servlet.http.HttpServletRequest req,
  2. java.util.Map parameters,
  3. java.util.Locale clientLocale,
  4. WcmDataStore dataStore)
  5. throws WcmException
Configures the client TimeZone object based on information passed back from the client browser, and stores it in the datastore.
Parameters:
req - The request containing the browser timezone info key/values (optional). If set to null, parameters must be specified.
parameters - The map containing the browser timezone info key/values (optional). If set to null, req must be specified.
dataStore -
Throws:

configureClientTimeZone

  1. public static void configureClientTimeZone( javax.servlet.http.HttpServletRequest req,
  2. java.util.Map parameters,
  3. java.util.Locale clientLocale,
  4. WcmDataStore dataStore,
  5. boolean forceRefresh)
  6. throws WcmException
Configures the client TimeZone object based on information passed back from the client browser, and stores it in the datastore.
Parameters:
req - The request containing the browser timezone info key/values (optional). If set to null, parameters must be specified.
parameters - The map containing the browser timezone info key/values (optional). If set to null, req must be specified.
dataStore -
forceRefresh - Store new timezone information even if it is already set in the session.
Throws:

configureBrowserTimeZone

  1. public static void configureBrowserTimeZone( javax.servlet.http.HttpServletRequest req,
  2. java.util.Map parameters,
  3. java.util.Locale clientLocale,
  4. WcmDataStore dataStore)
  5. throws WcmException
Configures the browser TimeZone object based on information passed back from the client browser (either applet or a JavaScript form, and stores it in the datastore.
Parameters:
req - The request containing the browser timezone info key/values (optional). If set to null, parameters must be specified.
parameters - The map containing the browser timezone info key/values (optional). If set to null, req must be specified.
dataStore -
Throws:

setClientTimeZone

  1. public static void setClientTimeZone( WcmDataStore ds,
  2. java.util.TimeZone clientTimeZone)
  3. throws WcmException
Set the client TimeZone object in the datastore.
Parameters:
clientTimeZone -
Throws:

setBrowserTimeZone

  1. public static void setBrowserTimeZone( WcmDataStore ds,
  2. java.util.TimeZone clientTimeZone)
  3. throws WcmException
Set the browser TimeZone object in the datastore. This setting is always independent from user selection.
Parameters:
clientTimeZone -
Throws:

setClientTimeZone

  1. public static void setClientTimeZone( WcmDataStore ds,
  2. java.util.TimeZone clientTimeZone,
  3. boolean isExplicit)
  4. throws WcmException
Set the client TimeZone object in the datastore.
Parameters:
clientTimeZone -
isExplicit - - Sets the explicit flag for the specified timezone.
Throws:

getID

  1. public static java.lang.String getID( java.util.TimeZone tz)