com.aspose.email

com.aspose.email

Class Appointment

public class Appointment
extends Object

Represents a calendar to an e-mail.

This example demonstrates how to add a calendar to an E-Mail message.

[Java]

     MailMessage msg = new MailMessage();

     //attendees for the event
     MailAddressCollection attendees = new MailAddressCollection();
     attendees.add(new MailAddress("person1@domain.com"));
     attendees.add(new MailAddress("person2@domain.com"));
     attendees.add(new MailAddress("person3@domain.com"));

     //create appointment
     Appointment app = new Appointment("Room 112",
          new Date(2006,7,17,13,0,0), new Date(2006,7,17,14,0,0),
          new MailAddress("somebody@domain.com"),
          attendees );
     app.setSummary("Release Meetting");
     app.setDescription("Discuss for the next release");

     //add calendar to the message
     msg.addAlternateView(app.requestApointment());
 

Constructor Summary
Appointment(String location, Date startDate, Date endDate, MailAddress organizer, MailAddressCollection attendees)
Appointment(String location, String summary, String description, Date startDate, Date endDate, MailAddress organizer, MailAddressCollection attendees)
Appointment(String location, String summary, String description, Date startDate, Date endDate, MailAddress organizer, MailAddressCollection attendees, CalendarRecurrencePattern recurrencePattern)
Appointment(String location, String summary, String description, Date startDate, Date endDate, MailAddress organizer, MailAddressCollection attendees, String uid)
Appointment(String location, String summary, String description, Date startDate, Date endDate, MailAddress organizer, MailAddressCollection attendees, String uid, CalendarRecurrencePattern recurrencePattern)
 
Method Summary
cancelAppointment()
Cancels the appointment.
cancelAppointment(intsequenceId)
Cancels the appointment.
getAppointmentText()
Gets the calendar text.
getAppointmentText(AppointmentFormattingOptions formattingOptions)
Gets the calendar text.
getAttendees()
Gets or sets the attendees.
getDescription()
Gets or sets the description.
getEndTimeZone()
End time zone
int
getFlags()
Gets or sets appointment flags.
getLocation()
Gets or sets the location.
int
getMethod()
Gets or sets the iCalendar object method type associated with the calendar object.
getOptionalAttendees()
Gets the optional attendees.
getOrganizer()
Gets or sets the organizer.
getRecurrencePattern()
Gets or sets the recurrence pattern.
getSequenceId()
Gets the sequence id.
getStartTimeZone()
Start time zone
getSummary()
Gets or sets the summary.
getUniqueId()
Gets or sets the unique id.
load(InputStream stream)
load(InputStream stream, booleanapplyLocalTZ)
load(String filePath)
Loads Appointment from the file.
requestApointment()
Requests the apointment.
requestApointment(intsequenceId)
Requests the apointment.
void
resetTimeZone()
Set local time zone
void
save(OutputStream stream)
void
save(OutputStream stream, AppointmentSaveOptions saveOptions)
void
save(OutputStream stream, intsaveFormat)
void
save(String filePath)
Saves appointment to the file with iCalendar format using te default save options
void
save(String filePath, AppointmentSaveOptions saveOptions)
Saves appointment to the file with specified save options
void
save(String filePath, intsaveFormat)
Saves appointment to the file with specified format using te default save options
void
void
void
setEndDate(Date value)
void
void
setFlags(intvalue)
void
void
setMethod(intvalue)
void
void
void
void
void
void
setTimeZone(String tzName)
Set time zone
void
updateAppointment()
Updates the appointment.
updateAppointment(intsequenceId)
Updates the appointment.
 
Methods inherited from class java.lang.Object
 

    • Method Detail

      • getLocation

        public String getLocation()

        Gets or sets the location.

      • setLocation

        public void setLocation(String value)
      • getSummary

        public String getSummary()

        Gets or sets the summary.

      • setSummary

        public void setSummary(String value)
      • getDescription

        public String getDescription()

        Gets or sets the description.

      • setDescription

        public void setDescription(String value)
      • getStartDate

        public Date getStartDate()
      • setStartDate

        public void setStartDate(Date value)
      • getEndDate

        public Date getEndDate()
      • setEndDate

        public void setEndDate(Date value)
      • getOptionalAttendees

        public MailAddressCollection getOptionalAttendees()

        Gets the optional attendees.

        Value: The address collection of optional attendees.

      • getOrganizer

        public MailAddress getOrganizer()

        Gets or sets the organizer.

      • setOrganizer

        public void setOrganizer(MailAddress value)
      • getRecurrencePattern

        public CalendarRecurrencePattern getRecurrencePattern()

        Gets or sets the recurrence pattern.

        Value: The recurrence pattern.

      • getUniqueId

        public String getUniqueId()

        Gets or sets the unique id.

        Value: The unique id.

      • setUniqueId

        public void setUniqueId(String value)
      • getSequenceId

        public String getSequenceId()

        Gets the sequence id.

        Value: The sequence id.

      • getFlags

        public int getFlags()

        Gets or sets appointment flags.

      • setFlags

        public void setFlags(int value)
      • getMethod

        public int getMethod()

        Gets or sets the iCalendar object method type associated with the calendar object.

      • setMethod

        public void setMethod(int value)
      • getStartTimeZone

        public String getStartTimeZone()

        Start time zone

      • setStartTimeZone

        public void setStartTimeZone(String value)
      • getEndTimeZone

        public String getEndTimeZone()

        End time zone

      • setEndTimeZone

        public void setEndTimeZone(String value)
      • resetTimeZone

        public void resetTimeZone()

        Set local time zone

      • setTimeZone

        public void setTimeZone(String tzName)

        Set time zone

        Parameters:
        tzName - The time zone name, for sample "America/New_York"
      • requestApointment

        public AlternateView requestApointment()

        Requests the apointment.

        Returns:
      • requestApointment

        public AlternateView requestApointment(int sequenceId)

        Requests the apointment.

        Parameters:
        sequenceId - The sequence id.
        Returns:
      • cancelAppointment

        public AlternateView cancelAppointment()

        Cancels the appointment.

        Returns:
      • cancelAppointment

        public AlternateView cancelAppointment(int sequenceId)

        Cancels the appointment.

        Parameters:
        sequenceId - The sequence id.
        Returns:
      • updateAppointment

        public AlternateView updateAppointment()

        Updates the appointment.

        Returns:
      • updateAppointment

        public AlternateView updateAppointment(int sequenceId)

        Updates the appointment.

        Parameters:
        sequenceId - The sequence id.
        Returns:
      • getAppointmentHtml

        public String getAppointmentHtml()
      • getAppointmentText

        public String getAppointmentText()

        Gets the calendar text.

        Returns:
      • getAppointmentText

        public String getAppointmentText(AppointmentFormattingOptions formattingOptions)

        Gets the calendar text.

        Parameters:
        formattingOptions - AppointmentFormattingOptions that represents appointment formatting options.
        Returns:
        The text representation of appointment.
        Throws:
        com.aspose.email.ms.System.IllegalArgumentException - throws when formattingOptions is null.
      • save

        public void save(String filePath)

        Saves appointment to the file with iCalendar format using te default save options

        Parameters:
        filePath - A file path
        Throws:
        com.aspose.email.ms.System.IllegalArgumentException - filePath is null or empty
      • save

        public void save(String filePath,
                         int saveFormat)

        Saves appointment to the file with specified format using te default save options

        Parameters:
        filePath - A file path
        saveFormat - A save format
        Throws:
        com.aspose.email.ms.System.IllegalArgumentException - filePath is null or empty
        UnsupportedOperationException - The specified save options are not supported
      • save

        public void save(String filePath,
                         AppointmentSaveOptions saveOptions)

        Saves appointment to the file with specified save options

        Parameters:
        filePath - A file path
        saveOptions - A save options
        Throws:
        com.aspose.email.ms.System.IllegalArgumentException - filePath is null or empty
        com.aspose.email.ms.System.IllegalArgumentException - saveOptions is null
        UnsupportedOperationException - The specified save options are not supported
      • save

        public void save(OutputStream stream,
                         int saveFormat)
      • load

        public static Appointment load(String filePath)

        Loads Appointment from the file. Supported file formats: iCalendar

        Parameters:
        filePath - A file path
        Returns:
        A read Appointment
        Throws:
        com.aspose.email.ms.System.IllegalArgumentException - filePath is null or empty