com.ibm.workplace.wcm.api
Interface DateComponent

All Superinterfaces:
ContentComponent, WCMApiObject

public interface DateComponent
extends ContentComponent

Represents a Date component.

A DateComponent is a ContentComponent and cannot be stored as a separate entity in the repository.

A DateComponent can contain Date. This interface provides methods to retrieve and set the Date contained within this component.

note: since v6.0.0, a DateComponent is referred to as a "Date and Time Element" in the Authoring UI.

See Also:
ContentComponent

Field Summary
static int TYPE_DATE
          Type constant indicating that the Date returned from this DateComponent will be formatted to only show the date.
static int TYPE_TIME
          Type constant indicating that the Date returned from this DateComponent will be formatted to only show the time.
static int TYPE_TIME_AND_DATE
          Type constant indicating that the Date returned from this DateComponent will be formatted to show the time and date.
 
Method Summary
 java.util.Date getDate()
          Returns the date and time contained in this component as a Date.
 int getDateType()
          Returns the formatting type set in this DateComponent.
 DocumentType<? extends DateComponent> getDocumentType()
          Returns the DocumentType of the ContentComponent.
 void setDate(java.util.Date date)
          Sets the date and time contained in this DateComponent as a Date.
 void setDateType(int dateType)
          Sets the formatting type for this DateComponent.
 
Methods inherited from interface com.ibm.workplace.wcm.api.ContentComponent
getContainer, getName, getTitleTextProviderKey, getTitleTextProviderName, setTitleTextProviderKey, setTitleTextProviderName
 

Field Detail

TYPE_TIME_AND_DATE

static final int TYPE_TIME_AND_DATE
Type constant indicating that the Date returned from this DateComponent will be formatted to show the time and date.

See Also:
Constant Field Values

TYPE_DATE

static final int TYPE_DATE
Type constant indicating that the Date returned from this DateComponent will be formatted to only show the date.

See Also:
Constant Field Values

TYPE_TIME

static final int TYPE_TIME
Type constant indicating that the Date returned from this DateComponent will be formatted to only show the time.

See Also:
Constant Field Values
Method Detail

getDocumentType

DocumentType<? extends DateComponent> getDocumentType()
Description copied from interface: ContentComponent
Returns the DocumentType of the ContentComponent.

Specified by:
getDocumentType in interface ContentComponent
Returns:
the type
See Also:
ContentComponent.getDocumentType()

getDate

java.util.Date getDate()
Returns the date and time contained in this component as a Date.

Returns null if the Date is not set.

Returns:
the date and time

setDate

void setDate(java.util.Date date)
             throws com.ibm.workplace.wcm.api.exceptions.OperationFailedException
Sets the date and time contained in this DateComponent as a Date.

Note. This method replaces any existing date and time in this component.

Parameters:
date - the date and time
Throws:
com.ibm.workplace.wcm.api.exceptions.OperationFailedException - if the string argument is null or the date and time could not be set

getDateType

int getDateType()
Returns the formatting type set in this DateComponent.

Returns the default value DateComponent.TYPE_TIME_AND_DATE if the new date has been set.

Returns:
the date formatting type

setDateType

void setDateType(int dateType)
                 throws com.ibm.workplace.wcm.api.exceptions.OperationFailedException
Sets the formatting type for this DateComponent.

Valid values are:

  • TYPE_TIME - Date format type to show the time
  • TYPE_DATE - Date format type to show the date
  • TYPE_TIME_AND_DATE - Date format type to show the date and time

Parameters:
dateType - the date formatting type to be set
Throws:
com.ibm.workplace.wcm.api.exceptions.OperationFailedException - if an invalid date formatting type was passed in