Nitido Inc.

com.nitido.nimx.nuggets.wcap
Class ToDo

java.lang.Object
  extended by com.nitido.nimx.nuggets.wcap.Component
      extended by com.nitido.nimx.nuggets.wcap.ToDo
All Implemented Interfaces:
java.io.Serializable

public class ToDo
extends Component

The data object for storing all information of an to-do. The description of the default constructor contains more detail about what kind of information this object has encapsulated.

See Also:
Serialized Form

Field Summary
protected  java.util.Date _completed
           
protected  java.util.Date _due
           
protected  Duration _duration
           
protected  boolean _isAllDay
           
protected  int _percent
           
protected  boolean _removeCompleted
           
protected  java.util.Date _start
           
 
Fields inherited from class com.nitido.nimx.nuggets.wcap.Component
_alarm, _created, _desc, _exdates, _exrules, _lastMod, _location, _priority, _rdates, _rid, _rrules, _sequence, _status, _timeZoneId, _title, _uid
 
Constructor Summary
ToDo(java.lang.String title, java.util.Date start)
          Convenience constructor.
ToDo(java.lang.String uid, java.lang.String rid, java.lang.String title, java.lang.String desc, java.lang.String location, CompStatus status, java.util.Vector rdates, java.util.Vector rrules, java.util.Vector exdates, java.util.Vector exrules, Alarm alarm, boolean isAllDay, java.util.Date start, java.util.Date due, Duration duration)
          Proprietary Default Constructor - This constructor does not specify the completed, percent, priority and sequence.
ToDo(java.lang.String uid, java.lang.String rid, java.lang.String title, java.lang.String desc, java.lang.String location, CompStatus status, java.util.Vector rdates, java.util.Vector rrules, java.util.Vector exdates, java.util.Vector exrules, Alarm alarm, int priority, int sequence, int percent, java.util.Date completed, boolean removeCompleted, boolean isAllDay, java.util.Date start, java.util.Date due, Duration duration)
          Constructor for application - This is the constructor one should use when creating/adding a new ToDo.
ToDo(java.lang.String uid, java.lang.String rid, java.lang.String title, java.lang.String desc, java.lang.String location, CompStatus status, java.util.Vector rdates, java.util.Vector rrules, java.util.Vector exdates, java.util.Vector exrules, Alarm alarm, int priority, int sequence, int percent, java.util.Date completed, boolean removeCompleted, boolean isAllDay, java.util.Date start, java.util.Date due, Duration duration, java.util.Date created, java.util.Date lastMod)
          Constructor for old version of application - This constructor does not requires the TimeZoneId parameter.
ToDo(java.lang.String uid, java.lang.String rid, java.lang.String title, java.lang.String desc, java.lang.String location, CompStatus status, java.util.Vector rdates, java.util.Vector rrules, java.util.Vector exdates, java.util.Vector exrules, Alarm alarm, int priority, int sequence, int percent, java.util.Date completed, boolean removeCompleted, boolean isAllDay, java.util.Date start, java.util.Date due, Duration duration, java.util.Date created, java.util.Date lastMod, java.lang.String timeZoneId)
          Default Constructor - This constructor takes in parameters for intializing all of the member fields.
 
Method Summary
 boolean equals(java.lang.Object inObj)
          Override the default java.lang.Object's equal command.
 java.util.Date getCompletionDate()
          Get the completion date.
 java.util.Date getDueTime()
          Get the due date/time of the ToDo.
 Duration getDuration()
          Get the duration of the ToDo.
 boolean getIsAllDay()
          Get the flag that indicates whether the ToDo is an all day todo.
 int getPercent()
          Get the percent (of completion).
 java.util.Date getStartTime()
          Get the starting date/time of the ToDo.
 boolean isCompleted()
          Get whether the todo is really completed.
 void markAsCompleted(java.util.Date completed)
          Mark the todo as completed at the specify date.
 void markAsIncomplete()
          Mark the todo as incompleted
 void setPercent(int percent)
          Set the percent (of completion).
 void setTime(boolean isAllDay, java.util.Date start, java.util.Date due, Duration duration)
          Set the date/time of the ToDo.
 java.lang.String toString()
          Returns a meaningful message with respect to the content of the object.
 java.lang.String toWcapQuery(WcapNugget nugget, java.text.DateFormat dfDay, java.text.DateFormat dfFull)
          Convert the component into a string that is used for constructing a WCAP query.
 
Methods inherited from class com.nitido.nimx.nuggets.wcap.Component
getAlarm, getCreatedDate, getDescription, getExclusionDates, getExclusionRules, getLastModDate, getLocation, getPriority, getRecurrenceDates, getRecurrenceRules, getRid, getSequence, getStatus, getTimeZoneId, getTitle, getUid, hasRecurRule, setAlarm, setCreatedDate, setDescription, setExclusionDates, setExclusionRules, setLastModDate, setLocation, setPriority, setRecurrenceDates, setRecurrenceRules, setRid, setSequence, setStatus, setTimeZoneId, setTitle, setUid
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_percent

protected int _percent

_removeCompleted

protected boolean _removeCompleted

_completed

protected java.util.Date _completed

_isAllDay

protected boolean _isAllDay

_start

protected java.util.Date _start

_due

protected java.util.Date _due

_duration

protected Duration _duration
Constructor Detail

ToDo

public ToDo(java.lang.String uid,
            java.lang.String rid,
            java.lang.String title,
            java.lang.String desc,
            java.lang.String location,
            CompStatus status,
            java.util.Vector rdates,
            java.util.Vector rrules,
            java.util.Vector exdates,
            java.util.Vector exrules,
            Alarm alarm,
            int priority,
            int sequence,
            int percent,
            java.util.Date completed,
            boolean removeCompleted,
            boolean isAllDay,
            java.util.Date start,
            java.util.Date due,
            Duration duration,
            java.util.Date created,
            java.util.Date lastMod,
            java.lang.String timeZoneId)
     throws InvalidParameterException
Default Constructor - This constructor takes in parameters for intializing all of the member fields.

It should never be used by the application. It is usually invoked by the WcapNugget or future extended/customized version of the WcapNugget.

In the following parameter list, each parameter starts with a [] tag that indicates the nature of the parameter. The available tags are:

Parameters:
uid - [SERVER] The unique id of the todo. This parameter is required only when you are modifying an existing todo. If you are adding a new todo, you should set this parameter to null and it will be ignored.

rid - [SERVER] The recurrence id of the todo. This parameter is required only when you are modifying an existing todo. If you are adding a new todo this parameter will be ignored. If you are modifying an todo without recurrence, you may set it to string "0".

title - [REQUIRED] - The title of the ToDo. It must exists when creating

desc - [OPTIONAL] - The description. If it is null, the ToDo will have no description.

location - [OPTIONAL] - The location of the ToDo. If it is null, the ToDo will have no location.

status - [SERVER] - The component status as indicated by the server.

rdates - [OPTIONAL] - A Vector of RecurDate objects that indicates the recurrence dates.

rrules - [OPTIONAL] - A Vector of RecurRule objects that represents the recurrence rules.

exdates - [OPTIONAL] - A Vector of RecurDate objects that indicates the dates to be excluded from recurrence.

exrules - [OPTIONAL] - A Vector of RecurRule objects that represents the rules for the time that are excluded from the recurrence.

alarm - [OPTIONAL] - An Alarm object that represent the reminder trigger.

priority - [OPTIONAL] - The priority of the ToDo, It is an integer with value 0=lowest priority and 9=highest priority. A negative value means the priority is not specified.

sequence - [OPTIONAL] - The sequence number of the ToDo. It is an integer with value starting from 0. A negative value means the sequence is not specified.

percent - [OPTIONAL] - The percent of the ToDo has been completed. It is an integer with value from 0 to 100.

completed - [OPTIONAL] - The Date object for completion time of the ToDo. This field is the field to indicate whether a ToDo has actually completed. Setting the "status" field to CompStatus.COMPLETED is NOT sufficient for the Calendar server to acknowledge the ToDo is completed.

removeCompleted - [OPTIONAL] - A boolean flag to indicate if the todo is going to remove any existing completion date.

isAllDay - [REQUIRED] - A true value indicates this ToDo lasts all day.

start - [REQUIRED] - The Date object for starting time of the ToDo. In the new SunONE Calendar 6.0, the Calendar Express interface always generates ToDos that have no start time. So, the check for null is no longer applicable. Moreover, to the WCAP interface, the start time is required only when creating the ToDo. It is an optional field when you are modifying the ToDo.

due - [OPTIONAL] - The Date object for ending time. This parameter is required if and only if isAllDay parameter is false. This parameter will be ignored if the todo will last all day.

duration - [OPTIONAL] - The duration of the event.
created - [OPTIONAL] - The Date object for the creation time
lastMod - [OPTIONAL] - The Date object for the last modification time.
timeZoneId - [OPTIONAL] - The time zone id string for the notification email.
Throws:
InvalidParameterException - At least one of the required parameter is missing, or an optional parameter has invalid value.

ToDo

public ToDo(java.lang.String uid,
            java.lang.String rid,
            java.lang.String title,
            java.lang.String desc,
            java.lang.String location,
            CompStatus status,
            java.util.Vector rdates,
            java.util.Vector rrules,
            java.util.Vector exdates,
            java.util.Vector exrules,
            Alarm alarm,
            int priority,
            int sequence,
            int percent,
            java.util.Date completed,
            boolean removeCompleted,
            boolean isAllDay,
            java.util.Date start,
            java.util.Date due,
            Duration duration,
            java.util.Date created,
            java.util.Date lastMod)
     throws InvalidParameterException
Constructor for old version of application - This constructor does not requires the TimeZoneId parameter.

It should never be used by the application. It is usually invoked by the WcapNugget or future extended/customized version of the WcapNugget.

In the following parameter list, each parameter starts with a [] tag that indicates the nature of the parameter. The available tags are:

Parameters:
uid - [SERVER] The unique id of the todo. This parameter is required only when you are modifying an existing todo. If you are adding a new todo, you should set this parameter to null and it will be ignored.

rid - [SERVER] The recurrence id of the todo. This parameter is required only when you are modifying an existing todo. If you are adding a new todo this parameter will be ignored. If you are modifying an todo without recurrence, you may set it to string "0".

title - [REQUIRED] - The title of the ToDo. It must exists when creating

desc - [OPTIONAL] - The description. If it is null, the ToDo will have no description.

location - [OPTIONAL] - The location of the ToDo. If it is null, the ToDo will have no location.

status - [SERVER] - The component status as indicated by the server.

rdates - [OPTIONAL] - A Vector of RecurDate objects that indicates the recurrence dates.

rrules - [OPTIONAL] - A Vector of RecurRule objects that represents the recurrence rules.

exdates - [OPTIONAL] - A Vector of RecurDate objects that indicates the dates to be excluded from recurrence.

exrules - [OPTIONAL] - A Vector of RecurRule objects that represents the rules for the time that are excluded from the recurrence.

alarm - [OPTIONAL] - An Alarm object that represent the reminder trigger.

priority - [OPTIONAL] - The priority of the ToDo, It is an integer with value 0=lowest priority and 9=highest priority. A negative value means the priority is not specified.

sequence - [OPTIONAL] - The sequence number of the ToDo. It is an integer with value starting from 0. A negative value means the sequence is not specified.

percent - [OPTIONAL] - The percent of the ToDo has been completed. It is an integer with value from 0 to 100.

completed - [OPTIONAL] - The Date object for completion time of the ToDo. This field is the field to indicate whether a ToDo has actually completed. Setting the "status" field to CompStatus.COMPLETED is NOT sufficient for the Calendar server to acknowledge the ToDo is completed.

removeCompleted - [OPTIONAL] - A boolean flag to indicate if the todo is going to remove any existing completion date.

isAllDay - [REQUIRED] - A true value indicates this ToDo lasts all day.

start - [REQUIRED] - The Date object for starting time of the ToDo. In the new SunONE Calendar 6.0, the Calendar Express interface always generates ToDos that have no start time. So, the check for null is no longer applicable. Moreover, to the WCAP interface, the start time is required only when creating the ToDo. It is an optional field when you are modifying the ToDo.

due - [OPTIONAL] - The Date object for ending time. This parameter is required if and only if isAllDay parameter is false. This parameter will be ignored if the todo will last all day.

duration - [OPTIONAL] - The duration of the event.
created - [OPTIONAL] - The Date object for the creation time
lastMod - [OPTIONAL] - The Date object for the last modification time.
Throws:
InvalidParameterException - At least one of the required parameter is missing, or an optional parameter has invalid value.

ToDo

public ToDo(java.lang.String uid,
            java.lang.String rid,
            java.lang.String title,
            java.lang.String desc,
            java.lang.String location,
            CompStatus status,
            java.util.Vector rdates,
            java.util.Vector rrules,
            java.util.Vector exdates,
            java.util.Vector exrules,
            Alarm alarm,
            int priority,
            int sequence,
            int percent,
            java.util.Date completed,
            boolean removeCompleted,
            boolean isAllDay,
            java.util.Date start,
            java.util.Date due,
            Duration duration)
     throws InvalidParameterException
Constructor for application - This is the constructor one should use when creating/adding a new ToDo.

In the following parameter list, each parameter starts with a [] tag that indicates the nature of the parameter. The available tags are:

Parameters:
uid - [SERVER] The unique id of the todo. This parameter is required only when you are modifying an existing todo. If you are adding a new todo, you should set this parameter to null and it will be ignored.

rid - [SERVER] The recurrence id of the todo. This parameter is required only when you are modifying an existing todo. If you are adding a new todo this parameter will be ignored. If you are modifying an todo without recurrence, you may set it to string "0".

title - [REQUIRED] - The title of the ToDo. It must exists when creating

desc - [OPTIONAL] - The description. If it is null, the ToDo will have no description.

location - [OPTIONAL] - The location of the ToDo. If it is null, the ToDo will have no location.

status - [SERVER] - The component status as indicated by the server.

rdates - [OPTIONAL] - A Vector of RecurDate objects that indicates the recurrence dates.

rrules - [OPTIONAL] - A Vector of RecurRule objects that represents the recurrence rules.

exdates - [OPTIONAL] - A Vector of RecurDate objects that indicates the dates to be excluded from recurrence.

exrules - [OPTIONAL] - A Vector of RecurRule objects that represents the rules for the time that are excluded from the recurrence.

alarm - [OPTIONAL] - An Alarm object that represent the reminder trigger.

priority - [OPTIONAL] - The priority of the ToDo, It is an integer with value 0=lowest priority and 9=highest priority. A negative value means the priority is not specified.

sequence - [OPTIONAL] - The sequence number of the ToDo. It is an integer with value starting from 0. A negative value means the sequence is not specified.

percent - [OPTIONAL] - The percent of the ToDo has been completed. It is an integer with value from 0 to 100.

completed - [OPTIONAL] - The Date object for completion time of the ToDo. This field is the field to indicate whether a ToDo has actually completed. Setting the "status" field to CompStatus.COMPLETED is NOT sufficient for the Calendar server to acknowledge the ToDo is completed.

removeCompleted - [OPTIONAL] - A boolean flag to indicate if the todo is going to remove any existing completion date.

isAllDay - [REQUIRED] - A true value indicates this ToDo lasts all day.

start - [REQUIRED] - The Date object for starting time of the ToDo. In the new SunONE Calendar 6.0, the Calendar Express interface always generates ToDos that have no start time. So, the check for null is no longer applicable. Moreover, to the WCAP interface, the start time is required only when creating the ToDo. It is an optional field when you are modifying the ToDo.

due - [OPTIONAL] - The Date object for ending time. This parameter is required if and only if isAllDay parameter is false. This parameter will be ignored if the todo will last all day.

duration - [OPTIONAL] - The duration of the event.
Throws:
InvalidParameterException - At least one of the required parameter is missing, or an optional parameter has invalid value.

ToDo

public ToDo(java.lang.String uid,
            java.lang.String rid,
            java.lang.String title,
            java.lang.String desc,
            java.lang.String location,
            CompStatus status,
            java.util.Vector rdates,
            java.util.Vector rrules,
            java.util.Vector exdates,
            java.util.Vector exrules,
            Alarm alarm,
            boolean isAllDay,
            java.util.Date start,
            java.util.Date due,
            Duration duration)
     throws InvalidParameterException
Proprietary Default Constructor - This constructor does not specify the completed, percent, priority and sequence.

In the following parameter list, each parameter starts with a [] tag that indicates the nature of the parameter. The available tags are:

Parameters:
uid - [SERVER] The unique id of the todo. This parameter is required only when you are modifying an existing todo. If you are adding a new todo, you should set this parameter to null and it will be ignored.

rid - [SERVER] The recurrence id of the todo. This parameter is required only when you are modifying an existing todo. If you are adding a new todo this parameter will be ignored. If you are modifying an todo without recurrence, you may set it to string "0".

title - [REQUIRED] - The title of the ToDo. It must exists when creating

desc - [OPTIONAL] - The description. If it is null, the ToDo will have no description.

location - [OPTIONAL] - The location of the ToDo. If it is null, the ToDo will have no location.

status - [SERVER] - The component status as indicated by the server.

rdates - [OPTIONAL] - A Vector of RecurDate objects that indicates the recurrence dates.

rrules - [OPTIONAL] - A Vector of RecurRule objects that represents the recurrence rules.

exdates - [OPTIONAL] - A Vector of RecurDate objects that indicates the dates to be excluded from recurrence.

exrules - [OPTIONAL] - A Vector of RecurRule objects that represents the rules for the time that are excluded from the recurrence.

alarm - [OPTIONAL] - An Alarm object that represent the reminder trigger.

isAllDay - [REQUIRED] - A true value indicates this ToDo lasts all day.

start - [REQUIRED] - The Date object for starting time of the ToDo. In the new SunONE Calendar 6.0, the Calendar Express interface always generates ToDos that have no start time. So, the check for null is no longer applicable. Moreover, to the WCAP interface, the start time is required only when creating the ToDo. It is an optional field when you are modifying the ToDo.

due - [OPTIONAL] - The Date object for ending time. This parameter is required if and only if isAllDay parameter is false. This parameter will be ignored if the todo will last all day.

Throws:
InvalidParameterException - At least one of the required parameter is missing, or an optional parameter has invalid value.

ToDo

public ToDo(java.lang.String title,
            java.util.Date start)
     throws InvalidParameterException
Convenience constructor. This constructor allow user to create a temporary ToDo with only the required attributes. It assume all the other attributes to be null and the ToDo is an all day todo.

Throws:
InvalidParameterException
Method Detail

getPercent

public int getPercent()
Get the percent (of completion).


setPercent

public void setPercent(int percent)
Set the percent (of completion).


isCompleted

public boolean isCompleted()
Get whether the todo is really completed.


markAsCompleted

public void markAsCompleted(java.util.Date completed)
Mark the todo as completed at the specify date.

If you don't want to make any changes to the completed status, you can pass a null object to this method.


markAsIncomplete

public void markAsIncomplete()
Mark the todo as incompleted


getCompletionDate

public java.util.Date getCompletionDate()
Get the completion date.

This is the Date object that you set in with markAsCompleted.


getIsAllDay

public boolean getIsAllDay()
Get the flag that indicates whether the ToDo is an all day todo.


getStartTime

public java.util.Date getStartTime()
Get the starting date/time of the ToDo.


getDueTime

public java.util.Date getDueTime()
Get the due date/time of the ToDo.


getDuration

public Duration getDuration()
Get the duration of the ToDo.


setTime

public void setTime(boolean isAllDay,
                    java.util.Date start,
                    java.util.Date due,
                    Duration duration)
             throws InvalidParameterException
Set the date/time of the ToDo.

Parameters:
isAllDay - boolean flag to indicate whether the ToDo is an all day todo. If is set to true, both parameters "end" and "duration" will be ignored.

start - [REQUIRED] - The Date object for starting time of the ToDo. In the new SunONE Calendar 6.0, the Calendar Express interface always generates ToDos that have no start time. So, the check for null is no longer applicable. Moreover, to the WCAP interface, the start time is required only when creating the ToDo. It is an optional field when you are modifying the ToDo.

due - Date object to indicate the due date/time. A null value indicates no due date/time is set. If not null, the parameter "duration" will be ignored.

duration - The Duration object that represents the length of the to do. A null value indicates no duration value is set.
Throws:
InvalidParameterException - If the due time specified is before the start time.

toWcapQuery

public java.lang.String toWcapQuery(WcapNugget nugget,
                                    java.text.DateFormat dfDay,
                                    java.text.DateFormat dfFull)
                             throws InvalidParameterException,
                                    WcapException
Convert the component into a string that is used for constructing a WCAP query. This method is designed for internal use by the WcapNugget only.

Overrides:
toWcapQuery in class Component
Throws:
InvalidParameterException
WcapException

equals

public boolean equals(java.lang.Object inObj)
Override the default java.lang.Object's equal command. This will compares the content of the fields. In case of a vector or array field, it will compare the content of the field.

Overrides:
equals in class Component

toString

public java.lang.String toString()
Returns a meaningful message with respect to the content of the object. This is mainly used for debugging purpose.

Overrides:
toString in class Component

Nitido NiM 2.5 Java API

These JavaDoc pages are generated for release/nim_2_5-2.5.44

Copyright © 1999-2009 Nitido Inc.    Proprietary and Confidential.    All Rights Reserved.