org.jasig.schedassist.model
Interface IEventUtils

All Known Implementing Classes:
DefaultEventUtilsImpl

public interface IEventUtils

This interface provides methods to construct iCal4j VEvents and Attendees for the Scheduling Assistant stack. It also provides short-hand inspection methods for these same objects.

Version:
$Id: IEventUtils.java 28 2011-05-04 15:18:26Z nblair $
Author:
Nicholas Blair, nblair@doit.wisc.edu

Method Summary
 boolean attendeeMatchesPerson(net.fortuna.ical4j.model.Property attendee, ICalendarAccount calendarAccount)
           
 net.fortuna.ical4j.model.PeriodList calculateRecurrence(net.fortuna.ical4j.model.component.VEvent event, Date startBoundary, Date endBoundary)
          Calculate recurrence dates for the specified events between the 2 date boundaries.
 net.fortuna.ical4j.model.component.VEvent constructAvailableAppointment(AvailableBlock block, IScheduleOwner owner, IScheduleVisitor visitor, String eventDescription)
          Construct an iCalendar EVENT for the Scheduling Assistant system.
 net.fortuna.ical4j.model.property.Attendee constructSchedulingAssistantAttendee(ICalendarAccount calendarAccount, AppointmentRole role)
          Construct an Attendee appropriate for the specified ICalendarAccount for the specified role.
 List<net.fortuna.ical4j.model.Calendar> convertScheduleForReflection(AvailableSchedule availableSchedule)
          Convert the AvailableSchedule into an iCalendar Calendar for the purposes of reflection back into the calendar system.
 net.fortuna.ical4j.model.property.Uid extractUid(net.fortuna.ical4j.model.Calendar calendar)
          If the Calendar contains one and only one event (series), return the Uid.
 net.fortuna.ical4j.model.property.Uid generateNewUid()
          Generate a new Uid, intended for use with Scheduling Assistant VEvents.
 net.fortuna.ical4j.model.Property getAttendeeForUserFromEvent(net.fortuna.ical4j.model.component.VEvent event, ICalendarAccount calendarUser)
          Walk through the attendee list in the VEvent argument.
 net.fortuna.ical4j.model.PropertyList getAttendeeListFromEvent(net.fortuna.ical4j.model.component.VEvent event)
          If the event is a Scheduling Assistant event, retrieve only the attendees on the event set by the Available system.
 Integer getEventVisitorLimit(net.fortuna.ical4j.model.component.VEvent event)
          If the event argument is an event created by the Scheduling Assistant, return the value of it's VisitorLimit property.
 int getScheduleVisitorCount(net.fortuna.ical4j.model.component.VEvent event)
          Return the number of Attendees in the event that have the role AppointmentRole.VISITOR.
 boolean isAttendingAsOwner(net.fortuna.ical4j.model.component.VEvent event, ICalendarAccount proposedOwner)
           
 boolean isAttendingAsVisitor(net.fortuna.ical4j.model.component.VEvent event, ICalendarAccount proposedVisitor)
           
 boolean isAttendingMatch(net.fortuna.ical4j.model.component.VEvent event, IScheduleVisitor visitor, IScheduleOwner owner)
          Returns true if the visitor and owner are in the VEvent's attendee list, the visitor argument has VISITOR role in the event, and the owner argument has OWNER role in the event.
 boolean isEventRecurring(net.fortuna.ical4j.model.component.VEvent event)
           
 boolean willEventCauseConflict(ICalendarAccount calendarAccount, net.fortuna.ical4j.model.component.VEvent event)
          This method defines our criteria for which VEvents will cause a conflict (either a red/busy block in the visible schedule or cause ConflictExistsExceptions).
 net.fortuna.ical4j.model.Calendar wrapEventInCalendar(net.fortuna.ical4j.model.component.VEvent event)
          Wrap the VEvent argument in a Calendar.
 

Method Detail

constructAvailableAppointment

net.fortuna.ical4j.model.component.VEvent constructAvailableAppointment(AvailableBlock block,
                                                                        IScheduleOwner owner,
                                                                        IScheduleVisitor visitor,
                                                                        String eventDescription)
Construct an iCalendar EVENT for the Scheduling Assistant system. The SUMMARY of the EVENT will start with the owner's MEETING_PREFIX preference and end with the full name of the visitor. The LOCATION of the EVENT will be set to the owner's location preference. The CLASS property will be set to "NORMAL". The STATUS property will be set to "CONFIRMED". If the owner and visitor represent the same person, only one ATTENDEE will be added, and will be marked with AppointmentRole#BOTH. Otherwise, owner and visitor will be added as ATTENDEEs with the corresponding AppointmentRole. The eventDescription argument will be added to the DESCRIPTION of the event. If the owner is detected as an academic advisor, and the visitor is a student, the student's "wiscedustudentid" value will be appended to the DESCRIPTION.

Parameters:
block - the selected AvailableBlock
owner - the owner of the appointment
visitor - the visitor to the appointment
eventDescription - text to enter into the DESCRIPTION property for the appointment
Returns:
the new event
Throws:
IllegalArgumentException - if any of the arguments (except the guids) are null, or if the data is not parsed properly by iCal4j

constructSchedulingAssistantAttendee

net.fortuna.ical4j.model.property.Attendee constructSchedulingAssistantAttendee(ICalendarAccount calendarAccount,
                                                                                AppointmentRole role)
Construct an Attendee appropriate for the specified ICalendarAccount for the specified role.

Parameters:
calendarAccount -
role -
Returns:
an appropriate attendee property
See Also:
AppointmentRole

getAttendeeForUserFromEvent

net.fortuna.ical4j.model.Property getAttendeeForUserFromEvent(net.fortuna.ical4j.model.component.VEvent event,
                                                              ICalendarAccount calendarUser)
Walk through the attendee list in the VEvent argument. Return the matching Attendee for the ICalendarAccount argument, or null if the ICalendarAccount is not in the attendee list.

Parameters:
event -
calendarUser -
Returns:
a matching attendee Property for the calendar account in the event, or null if not found.
See Also:
attendeeMatchesPerson(Property, ICalendarAccount)

getAttendeeListFromEvent

net.fortuna.ical4j.model.PropertyList getAttendeeListFromEvent(net.fortuna.ical4j.model.component.VEvent event)
If the event is a Scheduling Assistant event, retrieve only the attendees on the event set by the Available system. Otherwise, return an empty PropertyList.

Parameters:
event -
Returns:
only the Available attendees from the provided event

attendeeMatchesPerson

boolean attendeeMatchesPerson(net.fortuna.ical4j.model.Property attendee,
                              ICalendarAccount calendarAccount)
Parameters:
attendee -
calendarAccount -
Returns:
true if the Property is an attendee that matches the ICalendarAccount

getScheduleVisitorCount

int getScheduleVisitorCount(net.fortuna.ical4j.model.component.VEvent event)
Return the number of Attendees in the event that have the role AppointmentRole.VISITOR.

Parameters:
event -
Returns:
a count of schedule visitors in the attendee list of the event argument

willEventCauseConflict

boolean willEventCauseConflict(ICalendarAccount calendarAccount,
                               net.fortuna.ical4j.model.component.VEvent event)
This method defines our criteria for which VEvents will cause a conflict (either a red/busy block in the visible schedule or cause ConflictExistsExceptions).

Parameters:
calendarAccount -
event - an VEvent, including non-scheduling assistant appointments
Returns:
true if the specified VEvent will cause a conflict for the ICalendarAccount

isAttendingMatch

boolean isAttendingMatch(net.fortuna.ical4j.model.component.VEvent event,
                         IScheduleVisitor visitor,
                         IScheduleOwner owner)
Returns true if the visitor and owner are in the VEvent's attendee list, the visitor argument has VISITOR role in the event, and the owner argument has OWNER role in the event.

Parameters:
event -
visitor -
owner -
Returns:
true if the visitor and owner are in the VEvent's attendee list, the visitor argument has VISITOR role in the event, and the owner argument has OWNER role in the event

isAttendingAsVisitor

boolean isAttendingAsVisitor(net.fortuna.ical4j.model.component.VEvent event,
                             ICalendarAccount proposedVisitor)
Parameters:
event -
proposedVisitor -
Returns:
true if proposedVisitor is in the VEvent's attendee list as an IScheduleVisitor

isAttendingAsOwner

boolean isAttendingAsOwner(net.fortuna.ical4j.model.component.VEvent event,
                           ICalendarAccount proposedOwner)
Parameters:
event -
proposedOwner -
Returns:
true if proposedOwner is in the VEvent's attendee list as an IScheduleOwner

convertScheduleForReflection

List<net.fortuna.ical4j.model.Calendar> convertScheduleForReflection(AvailableSchedule availableSchedule)
Convert the AvailableSchedule into an iCalendar Calendar for the purposes of reflection back into the calendar system.

Parameters:
availableSchedule -
Returns:
the owner's availability schedule as a list of Calendars appropriate for storing in the calendar system
See Also:
ICalendarDataDao.reflectAvailableSchedule(IScheduleOwner, AvailableSchedule)

generateNewUid

net.fortuna.ical4j.model.property.Uid generateNewUid()
Generate a new Uid, intended for use with Scheduling Assistant VEvents.

Returns:
a new Uid

wrapEventInCalendar

net.fortuna.ical4j.model.Calendar wrapEventInCalendar(net.fortuna.ical4j.model.component.VEvent event)
Wrap the VEvent argument in a Calendar.

Parameters:
event -
Returns:

getEventVisitorLimit

Integer getEventVisitorLimit(net.fortuna.ical4j.model.component.VEvent event)
If the event argument is an event created by the Scheduling Assistant, return the value of it's VisitorLimit property. If the event argument is not a Scheduling Assistant event, this method returns null.

Parameters:
event -
Returns:
the value of the VisitorLimit if the event is a scheduling assistant appointment; if not return null

isEventRecurring

boolean isEventRecurring(net.fortuna.ical4j.model.component.VEvent event)
Parameters:
event -
Returns:
true if the event recurs (either by RRULE or RDATE)

calculateRecurrence

net.fortuna.ical4j.model.PeriodList calculateRecurrence(net.fortuna.ical4j.model.component.VEvent event,
                                                        Date startBoundary,
                                                        Date endBoundary)
Calculate recurrence dates for the specified events between the 2 date boundaries.

Parameters:
event -
startBoundary -
endBoundary -
Returns:
a never null, but possibly empty, PeriodList

extractUid

net.fortuna.ical4j.model.property.Uid extractUid(net.fortuna.ical4j.model.Calendar calendar)
If the Calendar contains one and only one event (series), return the Uid.

Parameters:
calendar -
Returns:
the distinct Uid contains by the event in this calendar


Copyright © 2012 Jasig. All Rights Reserved.