|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mmbase.bridge.util.xml.DateFormat
Dates are stored as integer in mmbase. If you want to show these dates in a nice format in the XSL transformation. it is necessary to use this Xalan extension. The XSLT looks like this then:
<xsl:stylesheet version = "1.0"
xmlns:xsl ="http://www.w3.org/1999/XSL/Transform"
xmlns:date ="org.mmbase.bridge.util.xml.DateFormat"
>
| Constructor Summary | |
DateFormat()
|
|
| Method Summary | |
static java.lang.String |
format(Cloud cloud,
org.w3c.dom.Node node,
java.lang.String fieldName,
java.lang.String pattern,
java.lang.String timeZone)
Deprecated. not sure where this is used? |
static java.lang.String |
format(Cloud cloud,
java.lang.String number,
java.lang.String fieldName,
java.lang.String pattern,
java.lang.String timeZone)
Formats a node's field value with the date pattern |
protected static java.lang.String |
format(java.lang.String fieldValue,
java.lang.String pattern,
int factor,
java.lang.String timeZone,
java.util.Locale locale)
|
static java.lang.String |
format(java.lang.String fieldValue,
java.lang.String pattern,
int factor,
java.lang.String timeZone,
java.lang.String language,
java.lang.String country)
Formats the fieldvalue to a date pattern |
static java.lang.String |
format(java.lang.String fieldValue,
java.lang.String pattern,
java.lang.String timeZone,
java.lang.String language,
java.lang.String country)
Formats the fieldvalue to a date pattern |
static java.lang.String |
format(java.lang.String number,
java.lang.String fieldName,
java.lang.String pattern,
java.lang.String timeZone,
java.lang.String language,
java.lang.String country)
Formats a node's field value with the date pattern |
static java.lang.String |
format(java.lang.String cloudName,
java.lang.String number,
java.lang.String fieldName,
java.lang.String pattern,
java.lang.String timeZone,
java.lang.String language,
java.lang.String country)
Formats a node's field value with the date pattern |
static int |
getDatePart(java.lang.String fieldValue,
int factor,
int datePart)
Returns the a part of the date |
static int |
getDatePart(java.lang.String fieldValue,
int factor,
int datePart,
java.lang.String timeZone)
Returns the a part of the date |
static int |
getDay(java.lang.String fieldValue)
Returns the day of the month part of the date |
static int |
getDay(java.lang.String fieldValue,
java.lang.String timeZone)
Returns the day of the month part of the date |
static int |
getHours(java.lang.String fieldValue)
Returns the hours part of the date |
static int |
getHours(java.lang.String fieldValue,
java.lang.String timeZone)
Returns the hours part of the date |
static int |
getMinutes(java.lang.String fieldValue)
Returns the minutes part of the date |
static int |
getMinutes(java.lang.String fieldValue,
java.lang.String timeZone)
Returns the minutes part of the date |
static int |
getMonth(java.lang.String fieldValue)
Returns the month part of the date |
static int |
getMonth(java.lang.String fieldValue,
java.lang.String timeZone)
Returns the month part of the date |
static int |
getSeconds(java.lang.String fieldValue)
Returns the seconds part of the date |
static int |
getSeconds(java.lang.String fieldValue,
java.lang.String timeZone)
Returns the seconds part of the date |
static int |
getYear(java.lang.String fieldValue)
Returns the year part of the date |
static int |
getYear(java.lang.String fieldValue,
java.lang.String timeZone)
Returns the year part of the date |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DateFormat()
| Method Detail |
public static java.lang.String format(java.lang.String number,
java.lang.String fieldName,
java.lang.String pattern,
java.lang.String timeZone,
java.lang.String language,
java.lang.String country)
number - the number or alias of the node containing the fieldfieldName - the name of the field to formatpattern - the date pattern (i.e. 'dd-MM-yyyy')timeZone - timezone
public static java.lang.String format(java.lang.String cloudName,
java.lang.String number,
java.lang.String fieldName,
java.lang.String pattern,
java.lang.String timeZone,
java.lang.String language,
java.lang.String country)
cloudName - the name of the cloud in which to find the nodenumber - the number or alias of the node containing the fieldfieldName - the name of the field to formatpattern - the date pattern (i.e. 'dd-MM-yyyy')timeZone - timezone
public static java.lang.String format(Cloud cloud,
java.lang.String number,
java.lang.String fieldName,
java.lang.String pattern,
java.lang.String timeZone)
number - the number or alias of the node containing the fieldfieldName - the name of the field to formatpattern - the date pattern (i.e. 'dd-MM-yyyy')timeZone - timezone
public static java.lang.String format(java.lang.String fieldValue,
java.lang.String pattern,
java.lang.String timeZone,
java.lang.String language,
java.lang.String country)
pattern - the date pattern (i.e. 'dd-MM-yyyy')timeZone - timezone
public static java.lang.String format(java.lang.String fieldValue,
java.lang.String pattern,
int factor,
java.lang.String timeZone,
java.lang.String language,
java.lang.String country)
pattern - the date pattern (i.e. 'dd-MM-yyyy')factor - Factor to multiply fieldvalue to make milliseconds. Should be 1000 normally (so field in seconds)timeZone - Timezone. Null or blank means server timezone. If not recognized it will fall back to GMT.language - The language for which the date must be formatted.
protected static java.lang.String format(java.lang.String fieldValue,
java.lang.String pattern,
int factor,
java.lang.String timeZone,
java.util.Locale locale)
public static java.lang.String format(Cloud cloud,
org.w3c.dom.Node node,
java.lang.String fieldName,
java.lang.String pattern,
java.lang.String timeZone)
throws javax.xml.transform.TransformerException
node - A DOM node (xml) containing the node's fields as subtagspattern - the date pattern (i.e. 'dd-MM-yyyy')
javax.xml.transform.TransformerException - if something went wrong while searching the DOM Nodepublic static int getYear(java.lang.String fieldValue)
public static int getMonth(java.lang.String fieldValue)
public static int getDay(java.lang.String fieldValue)
public static int getHours(java.lang.String fieldValue)
public static int getMinutes(java.lang.String fieldValue)
public static int getSeconds(java.lang.String fieldValue)
public static int getYear(java.lang.String fieldValue,
java.lang.String timeZone)
timeZone - timezone
public static int getMonth(java.lang.String fieldValue,
java.lang.String timeZone)
timeZone - timezone
public static int getDay(java.lang.String fieldValue,
java.lang.String timeZone)
timeZone - timezone
public static int getHours(java.lang.String fieldValue,
java.lang.String timeZone)
timeZone - timezone
public static int getMinutes(java.lang.String fieldValue,
java.lang.String timeZone)
timeZone - timezone
public static int getSeconds(java.lang.String fieldValue,
java.lang.String timeZone)
timeZone - timezone
public static int getDatePart(java.lang.String fieldValue,
int factor,
int datePart)
factor - Factor to multiply fieldvalue to make milliseconds. Should be 1000 normally (so field in seconds)datePart - which part of the date should be returned. These are Calendar constants
public static int getDatePart(java.lang.String fieldValue,
int factor,
int datePart,
java.lang.String timeZone)
factor - Factor to multiply fieldvalue to make milliseconds. Should be 1000 normally (so field in seconds)datePart - which part of the date should be returned. These are Calendar constantstimeZone - Timezone. Null or blank means server timezone. If not recognized it will fall back to GMT.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||