|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.filenet.wcm.apps.server.presentation.util.DateTimeControl
DateTimeControl is a utility class that provides a DHTML calendar control presentation for showing and updating datetime values on an HTML form. A UI module that uses this control presentation must make the includeHeaders call in its initialize() or onStartPage() call. For forward compatibility, this interface needs to be used exclusively to leverage the DHTML calendar control. The underlying calendar control used by this interface may change in the future. All of methods provided take locale and style as parameters in order to get the JDK OptimizedDateFormat format object appropriate for that locale and file. The normalized pattern that is accessible through this class via getNormalizedPattern is the format pattern used by the DHTML calendar control, and represents the formatted date that is sent to the server when a form is submitted. The normalized pattern for the specified locale and style may or may not directly match the pattern that would be returned from OptimizedDateFormat.getDateFormat/getDateTimeFormat, so the normalized format/pattern needs to be used when parsing datetime values specified using the DHTML calendar control.
Nested Class Summary | |
static class |
DateTimeControl.FormValues
|
static class |
DateTimeControl.SimplePattern
|
Field Summary | |
static com.filenet.wcm.toolkit.util.WcmString[] |
FORMAT_LABELS
|
static int[] |
FORMAT_STYLES
|
Method Summary | |
static java.lang.String[] |
getDateStyleStrings(java.util.Locale locale)
Return an array of the normalized format patterns representing DateTime.SHORT, MEDIUM, LONG and FULL. |
static java.lang.String |
getDisplayDate(java.util.Calendar utcDate,
java.util.Locale locale,
java.util.TimeZone timeZone,
int dateStyle,
int timeStyle,
boolean showTime)
Get the formatted date based on the specified locale and style parameters. |
static java.lang.String |
getDisplayDate(java.lang.String isoDate,
java.util.Locale locale,
java.util.TimeZone timeZone,
int dateStyle,
int timeStyle,
boolean showTime)
Get the formatted date based on the specified locale and style paramters. |
static java.lang.String |
getDisplayDate(java.lang.String isoDate,
java.lang.String localeString,
java.lang.String timeZoneString,
java.lang.String dateStyleString,
java.lang.String timeStyleString,
boolean showTime)
Get the formatted date based on the specified locale and style paramters. |
static DateTimeControl.FormValues |
getFormValues(javax.servlet.http.HttpServletRequest request,
java.lang.String elementName)
Gets all of the information for a request element representing the dateTime control. |
static DateTimeControl.FormValues |
getFormValues(java.util.Map parameterMap,
java.lang.String elementName)
Gets all of the information for a request element representing the dateTime control. |
static java.lang.String |
getHTML(DateTimeControlSettings dateTimeControlSettings,
java.lang.String elementName,
java.lang.String currentW3CValue,
java.lang.String inputClass)
|
static java.lang.String |
getHTML(java.util.Locale locale,
java.util.TimeZone timeZone,
int dateStyle,
int timeStyle,
java.lang.String elementName,
java.lang.String currentW3CValue,
java.lang.String inputClass,
boolean showTime)
Get the HTML representing a calendar control form element. |
static java.lang.String |
getHTML(java.util.Locale locale,
java.util.TimeZone timeZone,
java.lang.String pattern,
java.lang.String elementName,
java.lang.String currentW3CValue,
java.lang.String inputClass)
|
static java.lang.String |
getHTML(java.lang.String localeString,
java.lang.String timeZoneString,
java.lang.String dateStyleString,
java.lang.String timeStyleString,
java.lang.String elementName,
java.lang.String currentW3CValue,
java.lang.String inputClass,
boolean showTime)
Get the HTML representing a calendar control form element. |
static java.lang.String |
getISODate(java.util.Locale locale,
javax.servlet.http.HttpServletRequest request,
java.lang.String elementName,
boolean compressed)
The ISO formatted datetime value. |
static java.lang.String |
getISODate(java.util.Locale locale,
java.util.Map parameterMap,
java.lang.String elementName,
boolean compressed)
The ISO formatted datetime value. |
static java.lang.String |
getISODate(java.util.Locale locale,
java.lang.String rawValue,
java.lang.String pattern,
java.util.TimeZone timeZone,
boolean compressed)
The ISO formatted datetime value. |
static java.util.Calendar |
getLocalDate(java.util.Locale locale,
javax.servlet.http.HttpServletRequest request,
java.lang.String elementName)
Get the date object corresponding to the value entered into a datetime control in the browser. |
static java.lang.String[] |
getTimeStyleStrings(java.util.Locale locale)
Return an array of the normalized format patterns representing DateTime.SHORT, MEDIUM, LONG and FULL. |
static java.util.TimeZone |
getTimeZone(java.lang.String timeZoneID)
|
static void |
includeHeaders(com.filenet.wcm.toolkit.server.base.WcmController controller,
java.util.Locale locale)
Make sure that the required calendar javascript files are included in the header. |
static void |
includeHeaders(com.filenet.wcm.toolkit.server.base.WcmController controller,
java.util.Locale locale,
java.lang.String style)
Make sure that the required calendar javascript files are included in the header. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final com.filenet.wcm.toolkit.util.WcmString[] FORMAT_LABELS
public static final int[] FORMAT_STYLES
Method Detail |
public static void includeHeaders(com.filenet.wcm.toolkit.server.base.WcmController controller, java.util.Locale locale)
controller
- The current controller.locale
- The locale to use to determine the language for the calendar control to display (optional).public static void includeHeaders(com.filenet.wcm.toolkit.server.base.WcmController controller, java.util.Locale locale, java.lang.String style)
controller
- locale
- The locale language to use for display, if supported. If null, the JVM language is used. (optional)style
- The style contstant value representing the style to use. Default is STYLE_SYSTEM. (optional)public static DateTimeControl.FormValues getFormValues(javax.servlet.http.HttpServletRequest request, java.lang.String elementName)
request
- elementName
-
public static DateTimeControl.FormValues getFormValues(java.util.Map parameterMap, java.lang.String elementName)
parameterMap
- elementName
-
public static java.util.Calendar getLocalDate(java.util.Locale locale, javax.servlet.http.HttpServletRequest request, java.lang.String elementName) throws java.text.ParseException
locale
- The locale corresponding to the language being displayed.request
- elementName
-
java.text.ParseException
public static java.lang.String getISODate(java.util.Locale locale, javax.servlet.http.HttpServletRequest request, java.lang.String elementName, boolean compressed) throws java.text.ParseException
locale
- - The locale corresponding to the language being displayed.request
- elementName
- compressed
- - Whether to return the ISO date in compressed form or hyphenated form.
java.text.ParseException
public static java.lang.String getISODate(java.util.Locale locale, java.util.Map parameterMap, java.lang.String elementName, boolean compressed) throws java.text.ParseException
locale
- - The locale corresponding to the language being displayed.parameterMap
- elementName
- compressed
- - Whether to return the ISO date in compressed form or hyphenated form.
java.text.ParseException
public static java.lang.String getISODate(java.util.Locale locale, java.lang.String rawValue, java.lang.String pattern, java.util.TimeZone timeZone, boolean compressed) throws java.text.ParseException
locale
- - The locale corresponding to the language being displayed.rawValue
- The current display date value.pattern
- The style, for example, DateTime.SHORT.timeZone
- compressed
- - Whether to return the ISO date in compressed form or hyphenated form.
java.text.ParseException
public static java.lang.String[] getDateStyleStrings(java.util.Locale locale)
locale
-
public static java.lang.String[] getTimeStyleStrings(java.util.Locale locale)
locale
-
public static java.lang.String getHTML(java.lang.String localeString, java.lang.String timeZoneString, java.lang.String dateStyleString, java.lang.String timeStyleString, java.lang.String elementName, java.lang.String currentW3CValue, java.lang.String inputClass, boolean showTime)
localeString
- The locale being used in the format returned from WcmUi.encodeLocale(locale). Determines the exact date format that is used.dateStyleString
- The style, for example, DateTime.SHORT.timeStyleString
- The style, for example, DateTime.SHORT.elementName
- The element name that will be used for the input textbox containing the formatted date.currentW3CValue
- The current W3C String date value to display. If the value is not a valid W3C format it will not be formatted for display (optional).inputClass
- The CSS style class to use for the input textbox (optional).showTime
- Specify whether or not to show the time in the display pattern.
public static java.lang.String getHTML(java.util.Locale locale, java.util.TimeZone timeZone, java.lang.String pattern, java.lang.String elementName, java.lang.String currentW3CValue, java.lang.String inputClass)
public static java.lang.String getHTML(java.util.Locale locale, java.util.TimeZone timeZone, int dateStyle, int timeStyle, java.lang.String elementName, java.lang.String currentW3CValue, java.lang.String inputClass, boolean showTime)
locale
- The locale being used. Determines the exact date format that is used.dateStyle
- The date style, for example, DateTime.SHORT.timeStyle
- The date style, for example, DateTime.SHORT.elementName
- The element name that will be used for the input textbox containing the formatted date.currentW3CValue
- The current W3C String date value to display. If the value is not a valid W3C format it will not be formatted for display (optional).inputClass
- The CSS style class to use for the input textbox (optional).showTime
- Specify whether or not to show the time in the display pattern.
public static java.lang.String getHTML(DateTimeControlSettings dateTimeControlSettings, java.lang.String elementName, java.lang.String currentW3CValue, java.lang.String inputClass)
public static java.util.TimeZone getTimeZone(java.lang.String timeZoneID)
public static java.lang.String getDisplayDate(java.lang.String isoDate, java.lang.String localeString, java.lang.String timeZoneString, java.lang.String dateStyleString, java.lang.String timeStyleString, boolean showTime) throws com.filenet.wcm.toolkit.util.WcmException
isoDate
- The ISO date valuelocaleString
- The locale String value obtained using WcmUi.encodeLocale(locale)dateStyleString
- The dateStyle (int) value specified as a StringtimeStyleString
- The timeStyle (int) value specified as a StringshowTime
- Specify whether or not to show the time component
com.filenet.wcm.toolkit.util.WcmException
public static java.lang.String getDisplayDate(java.lang.String isoDate, java.util.Locale locale, java.util.TimeZone timeZone, int dateStyle, int timeStyle, boolean showTime) throws com.filenet.wcm.toolkit.util.WcmException
isoDate
- The ISO date valuelocale
- The locale objecttimeZone
- The TimeZone objectdateStyle
- The dateStyle (int) valuetimeStyle
- The timeStyle (int) valueshowTime
- Specify whether or not to show the time component
com.filenet.wcm.toolkit.util.WcmException
public static java.lang.String getDisplayDate(java.util.Calendar utcDate, java.util.Locale locale, java.util.TimeZone timeZone, int dateStyle, int timeStyle, boolean showTime)
utcDate
- The date to displaylocale
- The locale used to determine the date and time style patterns to be useddateStyle
- The date style value (e.g. DateFormat.SHORT, DateFormat.LONG, etc.)timeStyle
- The time style valueshowTime
- Specify whether or not to show the time component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |