Compoze Software, Inc.

com.compoze.calendar
Class Appointment


java.lang.Object

  |

  +--com.compoze.calendar.Appointment

All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class Appointment
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

This class represents an appointment.

To add and search for appointments, see the Appointments collection class. Once the appointment is obtained, its accessor methods may be called to set and get properties. The update() method must be called to store any changes to the server.

An Appointment conforms to the vCalendar specification (RFC #2445). To generate a vCalendar compliant representation of an appointment, user toVcalendarString().

The following table contains the mappings from Appointment properties to their corresponding Java methods:

Appointment Property Java Methods
AppointmentProperty.ALL_DAY_EVENT isAllDayEvent()
AppointmentProperty.BILLING_INFORMATION getBillingInformation()
AppointmentProperty.BUSY_STATUS getBusyStatus()
AppointmentProperty.CATEGORY getCategories()
AppointmentProperty.COMMENTS getComments()
AppointmentProperty.DESCRIPTION getDescription()
AppointmentProperty.END_DATE getEndDate()
AppointmentProperty.LOCATION getLocation()
AppointmentProperty.MILEAGE getMileage()
AppointmentProperty.ORGANIZER getOrganizer()
AppointmentProperty.PRIORITY getPriority()
AppointmentProperty.START_DATE getStartDate()
AppointmentProperty.SUMMARY getSummary()
AppointmentProperty.CUSTOM_NUM1 getCustomNum1()
AppointmentProperty.CUSTOM_NUM2 getCustomNum2()
AppointmentProperty.CUSTOM_NUM3 getCustomNum3()
AppointmentProperty.CUSTOM_NUM4 getCustomNum4()
AppointmentProperty.CUSTOM_STR1 getCustomStr1()
AppointmentProperty.CUSTOM_STR2 getCustomStr2()
AppointmentProperty.CUSTOM_STR3 getCustomStr3()
AppointmentProperty.CUSTOM_STR4 getCustomStr4()

See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_VCALENDAR_VERSION
          The default vCalendar version.
 
Constructor Summary
Appointment()
          Constructor.
 
Method Summary
 void addCategory(Category category)
          Adds the specified category to the list of categories.
 void clearDateRecurrence()
          Clears the date recurrence for the appointment.
 MeetingRequest createMeetingRequest()
          Creates a meeting request for this appointment.
 void delete()
          Deletes the appointment.
 void delete(int iInstance)
          Deletes the appointment.
 AccessManager getAccessManager()
          Gets the access manager for this appointment.
 java.lang.String getBillingInformation()
          Gets the billing information of the appointment.
 BusyStatus getBusyStatus()
          Gets the busy status of the appointment.
 Categories getCategories()
          Gets the list of categories.
 java.lang.String getComments()
          Gets the comments for the appointment.
 long getCustomNum1()
          Gets the custom number1 field of the appointment.
 long getCustomNum2()
          Gets the custom number2 field of the appointment.
 long getCustomNum3()
          Gets the custom number3 field of the appointment.
 long getCustomNum4()
          Gets the custom number4 field of the appointment.
 java.lang.String getCustomStr1()
          Gets the custom string1 field of the appointment.
 java.lang.String getCustomStr2()
          Gets the custom string2 field of the appointment.
 java.lang.String getCustomStr3()
          Gets the custom string3 field of the appointment.
 java.lang.String getCustomStr4()
          Gets the custom string4 field of the appointment.
 java.util.Date getDateCreated()
          Gets the date the appointment was created.
 java.util.Date getDateLastModified()
          Gets the date the appointment was last modified.
 DateRange getDateRange()
          Gets the date range of the appointment.
 DateRecurrence getDateRecurrence()
          Gets the date recurrence for the appointment.
 java.lang.String getDescription()
          Gets the description of the appointment.
 java.util.Date getEndDate()
          Gets the end date of the appointment.
 long getID()
          Gets the unique identifier (id) of the appointment.
 java.lang.String getLocation()
          Gets the location of the appointment.
 java.lang.String getMileage()
          Gets the mileage of the appointment.
 java.lang.String getOrganizer()
          Gets the name of the organizer.
 Priority getPriority()
          Gets the priority of the appointment.
 java.util.Date getStartDate()
          Gets the start date of the appointment.
 java.lang.String getSummary()
          Gets the summary of the appointment.
 java.lang.String getSummary(int iLength)
          Gets the summary of the appointment.
 boolean isAllDayEvent()
          Checks whether or not this event is an all day event.
 boolean isRecurring()
          Checks if this appointment is a recurring appointment (its date recurrence is not null).
 void removeCategories()
          Removes all categories from the list of categories.
 void removeCategory(Category category)
          Removes the specified category from the list of categories.
 void setAllDayEvent(boolean bAllDayEvent)
          Sets whether or not this event is an all day event.
 void setBillingInformation(java.lang.String sBillingInformation)
          Sets the billing information of the appointment.
 void setBusyStatus(BusyStatus busyStatus)
          Sets the busy status of the appointment.
 void setComments(java.lang.String sComments)
          Sets the comments for the appointment.
 void setCustomNum1(long lCustomNum1)
          Sets the custom number1 field of the appointment.
 void setCustomNum2(long lCustomNum2)
          Sets the custom number2 field of the appointment.
 void setCustomNum3(long lCustomNum3)
          Sets the custom number3 field of the appointment.
 void setCustomNum4(long lCustomNum4)
          Sets the custom number4 field of the appointment.
 void setCustomStr1(java.lang.String sCustomStr1)
          Sets the custom string1 field of the appointment.
 void setCustomStr2(java.lang.String sCustomStr2)
          Sets the custom string2 field of the appointment.
 void setCustomStr3(java.lang.String sCustomStr3)
          Sets the custom string3 field of the appointment.
 void setCustomStr4(java.lang.String sCustomStr4)
          Sets the custom string4 field of the appointment.
 void setDateRecurrence(DateRecurrence recurrence)
          Sets the date recurrence that defines a recurring appointment.
 void setDates(java.util.Date startDate, java.util.Date endDate)
          Sets the start and end dates of the appointment.
 void setDescription(java.lang.String sDescription)
          Sets the description of the appointment.
 void setLocation(java.lang.String sLocation)
          Sets the location of the appointment.
 void setMileage(java.lang.String sMileage)
          Sets the mileage of the appointment.
 void setPriority(Priority priority)
          Sets the priority of the appointment.
 void setSummary(java.lang.String sSummary)
          Sets the summary of the appointment.
 java.lang.String toString()
          Returns a string representation of the object.
 java.lang.String toVcalendarString()
          Creates a string that contains the vCalendar compliant (RFC #2445) representation of the appointment.
 java.lang.String toVcalendarString(java.lang.String sVersion, boolean bOffice98Compatible)
          Creates a string that contains the vCalendar compliant (RFC #2445) representation of the appointment.
 boolean update()
          Updates the appointment (saves the appointment entry).
 boolean update(boolean bForce)
          Updates the appointment (saves the appointment entry).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_VCALENDAR_VERSION


public static final java.lang.String DEFAULT_VCALENDAR_VERSION
The default vCalendar version.
See Also:
toVcalendarString()
Constructor Detail

Appointment


public Appointment()
Constructor. NOTE: This default constructor technically leaves the appointment in an invalid state. Use Appointments.add() to create an appointment.
Method Detail

getID


public long getID()
Gets the unique identifier (id) of the appointment. This is non-zero number that uniquely identifies the appointment.
Returns:
the id of the appointment

createMeetingRequest


public MeetingRequest createMeetingRequest()
Creates a meeting request for this appointment.
Returns:
the newly created meeting request

setDateRecurrence


public void setDateRecurrence(DateRecurrence recurrence)
Sets the date recurrence that defines a recurring appointment. The date recurrence is based on the date and time of the first instance.

To clear the date recurrence, use clearDateRecurrence().

Parameters:
recurrence - the date recurrence (may not be null)

getDateRecurrence


public DateRecurrence getDateRecurrence()
Gets the date recurrence for the appointment. If you want to check to see if an appointment is recurring, use the isRecurring() method.
Returns:
the date recurrence for the appointment or null if it is not set

clearDateRecurrence


public void clearDateRecurrence()
Clears the date recurrence for the appointment.

isRecurring


public boolean isRecurring()
Checks if this appointment is a recurring appointment (its date recurrence is not null).
Returns:
true if this appointment is a recurring appointment; false otherwise

isAllDayEvent


public boolean isAllDayEvent()
Checks whether or not this event is an all day event.
Returns:
true if the event is an all day event; false if it is not an all day event

setAllDayEvent


public void setAllDayEvent(boolean bAllDayEvent)
Sets whether or not this event is an all day event. If this is set to true then the event's start and end times are automatically set to span the entire day (12AM-12AM).
Parameters:
bAllDayEvent - if true, the event is an all day event

getCategories


public Categories getCategories()
Gets the list of categories. Any modification to this collection of category objects will not be reflected in the appointment. To modify the list of categories, use addCategory(Category) and removeCategory(Category).
Returns:
the categories collection or null if no categories are set
See Also:
Category, addCategory(Category), removeCategory(Category)

addCategory


public void addCategory(Category category)
Adds the specified category to the list of categories.
Parameters:
category - the category to add (may not be null)
See Also:
getCategories(), removeCategory(Category)

removeCategories


public void removeCategories()
Removes all categories from the list of categories.
See Also:
getCategories(), addCategory(Category), removeCategory(Category)

removeCategory


public void removeCategory(Category category)
Removes the specified category from the list of categories.
Parameters:
category - the category to remove (may not be null)
See Also:
getCategories(), addCategory(Category)

getBillingInformation


public java.lang.String getBillingInformation()
Gets the billing information of the appointment.
Returns:
the billing information of the appointment or null if no billing information is set

setBillingInformation


public void setBillingInformation(java.lang.String sBillingInformation)
Sets the billing information of the appointment.
Parameters:
sBillingInformation - the billing information of the appointment or null if no billing information is set

getComments


public java.lang.String getComments()
Gets the comments for the appointment.
Returns:
the comments for the appointment or null if no comments are set

setComments


public void setComments(java.lang.String sComments)
Sets the comments for the appointment.
Parameters:
sComments - the comments for the appointment or null if no comments are set

getLocation


public java.lang.String getLocation()
Gets the location of the appointment.
Returns:
the location of the appointment or null if no location is set

setLocation


public void setLocation(java.lang.String sLocation)
Sets the location of the appointment.
Parameters:
sLocation - the location of the appointment or null if no location is set

getSummary


public java.lang.String getSummary()
Gets the summary of the appointment.

If the summary is an empty string, the setting appointment.summary from calendar_resources.properties is returned. This will prevent an empty string from being returned. If you wish to return the empty string, set appointment.summary to blank.

Returns:
the summary of the appointment or null if no summary is set

getSummary


public java.lang.String getSummary(int iLength)
Gets the summary of the appointment. The summary is truncated after the specified number of characters and "..." is appended to it.
Parameters:
iLength - the maximum length of the result (string plus "...")
Returns:
the truncated summary of the appointment

setSummary


public void setSummary(java.lang.String sSummary)
Sets the summary of the appointment.
Parameters:
sSummary - the summary of the appointment or null if no summary is set

getDescription


public java.lang.String getDescription()
Gets the description of the appointment.
Returns:
the description of the appointment or null if no description is set

setDescription


public void setDescription(java.lang.String sDescription)
Sets the description of the appointment.
Parameters:
sDescription - the description of the appointment or null if no description is set

getMileage


public java.lang.String getMileage()
Gets the mileage of the appointment.
Returns:
the mileage of the appointment or null if no mileage is set

setMileage


public void setMileage(java.lang.String sMileage)
Sets the mileage of the appointment.
Parameters:
sMileage - the mileage of the appointment or null if no mileage is set

getCustomNum1


public long getCustomNum1()
Gets the custom number1 field of the appointment.
Returns:
the custom number1 field of the appointment or null if the custom number1 field is not set

setCustomNum1


public void setCustomNum1(long lCustomNum1)
Sets the custom number1 field of the appointment.
Parameters:
lCustomNum1 - the custom number1 field of the appointment

getCustomNum2


public long getCustomNum2()
Gets the custom number2 field of the appointment.
Returns:
the custom number2 field of the appointment or null if the custom number2 field is not set

setCustomNum2


public void setCustomNum2(long lCustomNum2)
Sets the custom number2 field of the appointment.
Parameters:
lCustomNum2 - the custom number2 field of the appointment

getCustomNum3


public long getCustomNum3()
Gets the custom number3 field of the appointment.
Returns:
the custom number3 field of the appointment or null if the custom number3 field is not set

setCustomNum3


public void setCustomNum3(long lCustomNum3)
Sets the custom number3 field of the appointment.
Parameters:
lCustomNum3 - the custom number3 field of the appointment

getCustomNum4


public long getCustomNum4()
Gets the custom number4 field of the appointment.
Returns:
the custom number4 field of the appointment or null if the custom number4 field is not set

setCustomNum4


public void setCustomNum4(long lCustomNum4)
Sets the custom number4 field of the appointment.
Parameters:
lCustomNum4 - the custom number4 field of the appointment

getCustomStr1


public java.lang.String getCustomStr1()
Gets the custom string1 field of the appointment.
Returns:
the custom string1 field of the appointment or null if the custom string1 field is not set

setCustomStr1


public void setCustomStr1(java.lang.String sCustomStr1)
Sets the custom string1 field of the appointment.
Parameters:
sCustomStr1 - the custom string1 field of the appointment

getCustomStr2


public java.lang.String getCustomStr2()
Gets the custom string2 field of the appointment.
Returns:
the custom string2 field of the appointment or null if the custom string2 field is not set

setCustomStr2


public void setCustomStr2(java.lang.String sCustomStr2)
Sets the custom string2 field of the appointment.
Parameters:
sCustomStr2 - the custom string2 field of the appointment

getCustomStr3


public java.lang.String getCustomStr3()
Gets the custom string3 field of the appointment.
Returns:
the custom string3 field of the appointment or null if the custom string3 field is not set

setCustomStr3


public void setCustomStr3(java.lang.String sCustomStr3)
Sets the custom string3 field of the appointment.
Parameters:
sCustomStr3 - the custom string3 field of the appointment

getCustomStr4


public java.lang.String getCustomStr4()
Gets the custom string4 field of the appointment.
Returns:
the custom string4 field of the appointment or null if the custom string4 field is not set

setCustomStr4


public void setCustomStr4(java.lang.String sCustomStr4)
Sets the custom string4 field of the appointment.
Parameters:
sCustomStr4 - the custom string4 field of the appointment

setPriority


public void setPriority(Priority priority)
Sets the priority of the appointment.
Parameters:
priority - the priority of the appointment (may not be null)

getPriority


public Priority getPriority()
Gets the priority of the appointment.
Returns:
the priority or null if not set

setBusyStatus


public void setBusyStatus(BusyStatus busyStatus)
Sets the busy status of the appointment.
Parameters:
busyStatus - the busy status of the appointment (may not be null)

getBusyStatus


public BusyStatus getBusyStatus()
Gets the busy status of the appointment.
Returns:
the busy status or null if not set

getStartDate


public java.util.Date getStartDate()
Gets the start date of the appointment.
Returns:
the start date of the appointment

getEndDate


public java.util.Date getEndDate()
Gets the end date of the appointment.
Returns:
the end date of the appointment

getDateRange


public DateRange getDateRange()
Gets the date range of the appointment. This setter and getter methods on this date range are not valid for modifying the start and end dates.
Returns:
the date range of the appointment

setDates


public void setDates(java.util.Date startDate,
                     java.util.Date endDate)
Sets the start and end dates of the appointment. The start always ends up before the end.
Parameters:
startDate - the start date of the appointment
endDate - the end date of the appointment

getOrganizer


public java.lang.String getOrganizer()
Gets the name of the organizer. The organizer is the name of the user who originally created this appointment.
Returns:
the organizer name

getDateCreated


public java.util.Date getDateCreated()
Gets the date the appointment was created.
Returns:
the date created

getDateLastModified


public java.util.Date getDateLastModified()
Gets the date the appointment was last modified.
Returns:
the date last modified

update


public boolean update()
               throws java.security.AccessControlException
Updates the appointment (saves the appointment entry). This method must be called to commit changes to the appointment.
Returns:
true if the update is successful; false otherwise
Throws:
java.security.AccessControlException - occurs if the user does not have permission to edit the appointment

update


public boolean update(boolean bForce)
               throws java.security.AccessControlException
Updates the appointment (saves the appointment entry). This method must be called to commit changes to the appointment.
Parameters:
bForce - true to force the update; false otherwise (currently ignored)
Returns:
true if the update is successful; false otherwise
Throws:
java.security.AccessControlException - occurs if the user does not have permission to edit the appointment

delete


public void delete()
            throws java.security.AccessControlException
Deletes the appointment. If this appointment is recurring, only this instance is deleted.
Throws:
java.security.AccessControlException - occurs if the user does not have permission to delete the appointment
See Also:
delete(int), DateRecurrence.RULE_THIS_INSTANCE

delete


public void delete(int iInstance)
            throws java.security.AccessControlException
Deletes the appointment.
Parameters:
iInstance - the delete rule (see DateRecurrence.RULE_ constants)
Throws:
java.security.AccessControlException - occurs if the user does not have permission to delete the appointment

getAccessManager


public AccessManager getAccessManager()
                               throws AccessManagerException
Gets the access manager for this appointment. The access manager is used to modify the permissions.
Returns:
the access manager for this appointment
Throws:
AccessManagerException - an error occurs retrieving the access manager
See Also:
CalendarPermission

toVcalendarString


public java.lang.String toVcalendarString()
Creates a string that contains the vCalendar compliant (RFC #2445) representation of the appointment. The default vCalendar version is used, and Outlook 98 compatibility is enabled.
Returns:
the vCalendar string
See Also:
DEFAULT_VCALENDAR_VERSION

toVcalendarString


public java.lang.String toVcalendarString(java.lang.String sVersion,
                                          boolean bOffice98Compatible)
Creates a string that contains the vCalendar compliant (RFC #2445) representation of the appointment.
Parameters:
sVersion - the vCalendar version to present
bOffice98Compatible - true if the vCalendar should support Office 98
Returns:
the vCalendar string

toString


public java.lang.String toString()
Returns a string representation of the object.
Overrides:
toString in class java.lang.Object
Returns:
the string representation of the object

Compoze Software, Inc.

Copyright ©1999-2001 Compoze Software, Inc. All rights reserved.