com.filenet.wcm.toolkit.server.util
Class WcmUi

java.lang.Object
  extended bycom.filenet.wcm.toolkit.server.util.WcmUi

public class WcmUi
extends java.lang.Object

WcmUi contains various static methods to help with UI-related tasks.


Field Summary
static java.lang.String FILENET_WEB_POST
          A static constant represents a FileNET Web Post
static java.lang.String LAST_EXCEPTION
          The global datastore key that stores the last saved exception shown on the error page.
static java.lang.String LAST_URL
          The global datastore key that stores an optional URL to define for the RETURN button on the error page - if LAST_EXCEPTION is defined.
static java.lang.String MSIE
          A static constant represents a Microsoft Internet Explorer.
static java.lang.String NETSCAPE
          A static constant represents a Nescape browser.
static java.lang.String UNSUPPORTED_BROWSER
          A static constant represents an unsupported client browser.
static WcmString wsDateFormat
          Deprecated.  
static WcmString wsModuleNotFound
           
 
Constructor Summary
protected WcmUi()
           
 
Method Summary
static java.util.Locale decodeLocale(java.lang.String encoded)
           
static java.lang.String encodeLocale(java.util.Locale locale)
          Encode a locale object into a String (serialize), so that it can be passed into an XSL transform as a parameter.
static java.lang.String encodeWindowId(javax.servlet.http.HttpServletRequest request, java.lang.String url)
          Encode/propagate the windowId found on the current request into the specified URL.
static java.lang.String encodeWindowId(java.lang.String windowId, java.lang.String url)
          Encode/propagate the specified windowId into the specified URL.
static java.lang.String formatContentSize(double size)
          Given the raw byte value, return an expression in the form "100KB" Any size greater than 0 bytes, but less than or equal to 1024 bytes will return as "1KB"
static java.lang.String formatContentSize(java.lang.String contentSizeAsString)
          Returns the String with the formatted content size.
static java.lang.String formatDouble(double d, java.util.Locale locale)
          Returns the String with formated double value
static java.lang.String formatDouble(double d, java.lang.String encodedLocale)
          Returns the String with formated double value
static java.lang.String formatDouble(java.lang.String d, java.util.Locale locale)
          Returns the String with formated double value.
static java.lang.String formatDouble(java.lang.String d, java.lang.String encodedLocale)
          Returns the String with formated double value
static java.lang.String getBasePath(javax.servlet.http.HttpServletRequest request)
          From the request object, determine the base path (i.e.
static java.lang.String getBrowserType(javax.servlet.http.HttpServletRequest request)
          Deprecated. - use com.filenet.wcm.toolkit.server.util.UserAgent class.
static java.lang.String getBrowserVersion(javax.servlet.http.HttpServletRequest request)
          From the request object, determine the client browser version.
static java.lang.String getCalendarControlHTML(java.lang.String elementName, java.lang.String formattedValue, java.lang.String inputClass, boolean readOnly)
          Deprecated.  
static WcmHeaderModuleInterface getHeaderModule(javax.servlet.http.HttpServletRequest request)
           
static java.lang.String getParentKey(java.lang.String childKey)
          Compute the qualified module name of the parent of a specified module.
static void render(javax.servlet.http.HttpServletRequest request, java.lang.String name, java.io.Writer w)
          Render is called from UI jsp pages to render the specified UI module's content onto the page.
static void render(WcmUiModuleInterface m, java.io.Writer w)
           
static void renderHeaders(javax.servlet.http.HttpServletRequest request, java.io.Writer w)
          Renders a standard set of headers on each page.
static void setNoCache(javax.servlet.http.HttpServletResponse response)
          Set the response headers to disable browser caching of the page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAST_EXCEPTION

public static final java.lang.String LAST_EXCEPTION
The global datastore key that stores the last saved exception shown on the error page.

See Also:
Constant Field Values

LAST_URL

public static final java.lang.String LAST_URL
The global datastore key that stores an optional URL to define for the RETURN button on the error page - if LAST_EXCEPTION is defined.

See Also:
Constant Field Values

MSIE

public static final java.lang.String MSIE
A static constant represents a Microsoft Internet Explorer.

See Also:
Constant Field Values

NETSCAPE

public static final java.lang.String NETSCAPE
A static constant represents a Nescape browser.

See Also:
Constant Field Values

FILENET_WEB_POST

public static final java.lang.String FILENET_WEB_POST
A static constant represents a FileNET Web Post

See Also:
Constant Field Values

UNSUPPORTED_BROWSER

public static final java.lang.String UNSUPPORTED_BROWSER
A static constant represents an unsupported client browser.

See Also:
Constant Field Values

wsModuleNotFound

public static final WcmString wsModuleNotFound

wsDateFormat

public static final WcmString wsDateFormat
Deprecated.  

Constructor Detail

WcmUi

protected WcmUi()
Method Detail

render

public static void render(javax.servlet.http.HttpServletRequest request,
                          java.lang.String name,
                          java.io.Writer w)
                   throws java.lang.Exception
Render is called from UI jsp pages to render the specified UI module's content onto the page.

Parameters:
request - The HttpServletRequest for the current UI jsp page.
name - The name specified in the "jsp:useBean id" for the UI module on the event jsp page.
w - A Writer instance where the HTML will be written.
Throws:
java.lang.Exception

render

public static void render(WcmUiModuleInterface m,
                          java.io.Writer w)
                   throws java.lang.Exception
Throws:
java.lang.Exception

renderHeaders

public static void renderHeaders(javax.servlet.http.HttpServletRequest request,
                                 java.io.Writer w)
                          throws java.lang.Exception
Renders a standard set of headers on each page. Every UI jsp page in the Toolkit framework should call renderHeaders.

Parameters:
request - The HttpServletRequest for the current UI jsp page.
w - A Writer instance where the HTML will be written.
Throws:
java.lang.Exception

getHeaderModule

public static WcmHeaderModuleInterface getHeaderModule(javax.servlet.http.HttpServletRequest request)

encodeLocale

public static java.lang.String encodeLocale(java.util.Locale locale)
Encode a locale object into a String (serialize), so that it can be passed into an XSL transform as a parameter. This is used when calling applicable forms of getFormattedDate from inside the XSL.

Parameters:
locale - The locale to use.
Returns:
The String value.

decodeLocale

public static java.util.Locale decodeLocale(java.lang.String encoded)

formatContentSize

public static java.lang.String formatContentSize(double size)
Given the raw byte value, return an expression in the form "100KB" Any size greater than 0 bytes, but less than or equal to 1024 bytes will return as "1KB"

Parameters:
size - in bytes.
Returns:

formatContentSize

public static java.lang.String formatContentSize(java.lang.String contentSizeAsString)
Returns the String with the formatted content size. Converts double to KBs

Parameters:
contentSizeAsString - content size as a double
Returns:
formatted value

formatDouble

public static java.lang.String formatDouble(double d,
                                            java.lang.String encodedLocale)
Returns the String with formated double value

Parameters:
d - double value
encodedLocale - encoded locale
Returns:
String with the local-specific formatted value

formatDouble

public static java.lang.String formatDouble(java.lang.String d,
                                            java.lang.String encodedLocale)
Returns the String with formated double value

Parameters:
d - string value (for double)
encodedLocale - encoded locale
Returns:
String with the local-specific formatted value

formatDouble

public static java.lang.String formatDouble(double d,
                                            java.util.Locale locale)
Returns the String with formated double value

Parameters:
d - double value
locale - locale object
Returns:
String with the local-specific formatted value

formatDouble

public static java.lang.String formatDouble(java.lang.String d,
                                            java.util.Locale locale)
Returns the String with formated double value. If the string is not a value double value, the original string is returned.

Parameters:
d - string value
locale - locale object
Returns:
String with the local-specific formatted value

encodeWindowId

public static java.lang.String encodeWindowId(java.lang.String windowId,
                                              java.lang.String url)
Encode/propagate the specified windowId into the specified URL.

Parameters:
windowId - The String windowId value, or null.
url - The url to encode.
Returns:
The url with the window Id encoded into it.

encodeWindowId

public static java.lang.String encodeWindowId(javax.servlet.http.HttpServletRequest request,
                                              java.lang.String url)
Encode/propagate the windowId found on the current request into the specified URL.

Parameters:
request - A reference to the current HttpServletRequest.
url - The url to encode.
Returns:
The url with the window Id encoded into it.

getBasePath

public static java.lang.String getBasePath(javax.servlet.http.HttpServletRequest request)
From the request object, determine the base path (i.e. "http://host:port/approot").

Parameters:
request - A reference to the current HttpServletRequest.
Returns:
The String value.

getParentKey

public static java.lang.String getParentKey(java.lang.String childKey)
Compute the qualified module name of the parent of a specified module. Given p1!p2!p3!c0, return p1!p2!p3.

Parameters:
childKey - The qualified module name of the module for which to find the parent's qualified module name.
Returns:
The parent module qualified name.

getBrowserType

public static java.lang.String getBrowserType(javax.servlet.http.HttpServletRequest request)
Deprecated. - use com.filenet.wcm.toolkit.server.util.UserAgent class.


getBrowserVersion

public static java.lang.String getBrowserVersion(javax.servlet.http.HttpServletRequest request)
From the request object, determine the client browser version.

Parameters:
request - A reference to the current HttpServletRequest.
Returns:
The String value.

setNoCache

public static void setNoCache(javax.servlet.http.HttpServletResponse response)
Set the response headers to disable browser caching of the page.

Parameters:
response - A reference to the current HttpServletResponse.

getCalendarControlHTML

public static java.lang.String getCalendarControlHTML(java.lang.String elementName,
                                                      java.lang.String formattedValue,
                                                      java.lang.String inputClass,
                                                      boolean readOnly)
Deprecated.  

Get the HTML representing a calendar control form element. The returned string value can be written out to a page to show the form field for date input.

A UI module that uses this method must, in its initialize, or onStartPage callback must make a call to include the required JavaScript via the header module. Cut-and-paste example:

getController().getHeaderModule().addJsFile("js/WcmCalendar.jsp").

Parameters:
elementName - The name to give to the form element.
formattedValue - The formatted value to display. If there is no value, null can be specified.
inputClass - The input class to use for the input element. If there is no value, null can be specified.
readOnly - Specify true to display as read-only.
Returns:
The HTML to write out to the page.


© Copyright IBM Corp. 2002, 2007. All Rights Reserved.