org.sakaiproject.service.legacy.calendar
Interface CalendarService

All Superinterfaces:
EntityProducer
All Known Implementing Classes:
BaseCalendarService

public interface CalendarService
extends EntityProducer

CalendarService is the interface for the CHEF Calendar service.

The service manages a set of calendars, each containing a set of events.

Version:
$Revision: 3290 $
Author:
University of Michigan, CHEF Software Development Team

Nested Class Summary
 
Nested classes inherited from class org.sakaiproject.service.legacy.entity.EntityProducer
EntityProducer.ChangeType
 
Field Summary
static int DAY_VIEW
           
static String EVENT_ADD_CALENDAR
          Name for the event of adding a calendar.
static String EVENT_IMPORT_CALENDAR
          Security lock for importing events into a calendar.
static String EVENT_MODIFY_CALENDAR
          Security lock for removing or changing any events in a calendar.
static String EVENT_READ_CALENDAR
          Security lock for adding to a calendar.
static String EVENT_REMOVE_CALENDAR
          Name for the event of removing a calendar.
static int LIST_VIEW
           
static int MOD_ALL
          Recurring event modification intention: all.
static int MOD_NA
          Recurring event modification intention: no intention.
static int MOD_PRIOR
          Recurring event modification intention: this and prior.
static int MOD_REST
          Recurring event modification intention: this and subsequent.
static int MOD_THIS
          Recurring event modification intention: just this one.
static int MONTH_VIEW
           
static String REF_TYPE_CALENDAR
          The Reference type for a calendar.
static String REF_TYPE_CALENDAR_PDF
          The Reference type for a calendar pdf.
static String REF_TYPE_EVENT
          The Reference type for an event.
static String REFERENCE_ROOT
          This string starts the references to resources in this service.
static String SERVICE_NAME
          This string can be used to find the service in the service manager.
static int UNKNOWN_VIEW
          Calendar Printing Views.
static int WEEK_VIEW
           
 
Method Summary
 CalendarEdit addCalendar(String ref)
          Add a new calendar.
 boolean allowAddCalendar(String ref)
          check permissions for addCalendar().
 boolean allowGetCalendar(String ref)
          check permissions for getCalendar().
 boolean allowImportCalendar(String ref)
          check permissions for importing calendar events
 boolean allowRemoveCalendar(String ref)
          check permissions for removeCalendar().
 boolean allowUpdateCalendar(String ref)
          check permissions for editCalendar()
 String calendarPdfReference(String context, String id, int scheduleType, List calendars, String timeRangeString, String userName, TimeRange dailyTimeRange)
          Access the internal reference which can be used to access the calendar-in-pdf format from within the system.
 String calendarReference(String context, String id)
          Access the internal reference which can be used to access the calendar from within the system.
 void cancelCalendar(CalendarEdit edit)
          Cancel the changes made to a CalendarEdit object, and release the lock.
 void commitCalendar(CalendarEdit edit)
          Commit the changes made to a CalendarEdit object, and release the lock.
 CalendarEdit editCalendar(String ref)
          Get a locked calendar object for editing.
 String eventReference(String context, String calendarId, String id)
          Access the internal reference which can be used to access the event from within the system.
 Calendar getCalendar(String ref)
          Return a specific calendar.
 List getCalendars()
          Return a List of all the defined calendars.
 CalendarEventVector getEvents(List references, TimeRange range)
          Takes several calendar References and merges their events from within a given time range.
 RecurrenceRule newRecurrence(String frequency)
          Construct a new recurrence rule who's frequency description matches the frequency parameter.
 RecurrenceRule newRecurrence(String frequency, int interval)
          Construct a new recurrence rule who's frequency description matches the frequency parameter.
 RecurrenceRule newRecurrence(String frequency, int interval, int count)
          Construct a new recurrence rule who's frequency description matches the frequency parameter.
 RecurrenceRule newRecurrence(String frequency, int interval, Time until)
          Construct a new recurrence rule who's frequency description matches the frequency parameter.
 void removeCalendar(CalendarEdit edit)
          Remove a calendar that is locked for edit.
 
Methods inherited from interface org.sakaiproject.service.legacy.entity.EntityProducer
archive, getEntity, getEntityAuthzGroups, getEntityDescription, getEntityResourceProperties, getEntityUrl, getHttpAccess, getLabel, importEntities, merge, parseEntityReference, syncWithSiteChange, willArchiveMerge, willImport
 

Field Detail

SERVICE_NAME

public static final String SERVICE_NAME
This string can be used to find the service in the service manager.


REFERENCE_ROOT

public static final String REFERENCE_ROOT
This string starts the references to resources in this service.

See Also:
Constant Field Values

EVENT_ADD_CALENDAR

public static final String EVENT_ADD_CALENDAR
Name for the event of adding a calendar.

See Also:
Constant Field Values

EVENT_REMOVE_CALENDAR

public static final String EVENT_REMOVE_CALENDAR
Name for the event of removing a calendar.

See Also:
Constant Field Values

EVENT_IMPORT_CALENDAR

public static final String EVENT_IMPORT_CALENDAR
Security lock for importing events into a calendar.

See Also:
Constant Field Values

EVENT_READ_CALENDAR

public static final String EVENT_READ_CALENDAR
Security lock for adding to a calendar.

See Also:
Constant Field Values

EVENT_MODIFY_CALENDAR

public static final String EVENT_MODIFY_CALENDAR
Security lock for removing or changing any events in a calendar.

See Also:
Constant Field Values

REF_TYPE_CALENDAR

public static final String REF_TYPE_CALENDAR
The Reference type for a calendar.

See Also:
Constant Field Values

REF_TYPE_CALENDAR_PDF

public static final String REF_TYPE_CALENDAR_PDF
The Reference type for a calendar pdf.

See Also:
Constant Field Values

REF_TYPE_EVENT

public static final String REF_TYPE_EVENT
The Reference type for an event.

See Also:
Constant Field Values

MOD_NA

public static final int MOD_NA
Recurring event modification intention: no intention.

See Also:
Constant Field Values

MOD_THIS

public static final int MOD_THIS
Recurring event modification intention: just this one.

See Also:
Constant Field Values

MOD_ALL

public static final int MOD_ALL
Recurring event modification intention: all.

See Also:
Constant Field Values

MOD_REST

public static final int MOD_REST
Recurring event modification intention: this and subsequent.

See Also:
Constant Field Values

MOD_PRIOR

public static final int MOD_PRIOR
Recurring event modification intention: this and prior.

See Also:
Constant Field Values

UNKNOWN_VIEW

public static final int UNKNOWN_VIEW
Calendar Printing Views.

See Also:
Constant Field Values

DAY_VIEW

public static final int DAY_VIEW
See Also:
Constant Field Values

WEEK_VIEW

public static final int WEEK_VIEW
See Also:
Constant Field Values

MONTH_VIEW

public static final int MONTH_VIEW
See Also:
Constant Field Values

LIST_VIEW

public static final int LIST_VIEW
See Also:
Constant Field Values
Method Detail

getCalendars

public List getCalendars()
Return a List of all the defined calendars.

Returns:
a List of Calendar objects (may be empty)

allowAddCalendar

public boolean allowAddCalendar(String ref)
check permissions for addCalendar().

Parameters:
ref - A reference for the calendar.
Returns:
true if the user is allowed to addCalendar(ref), false if not.

addCalendar

public CalendarEdit addCalendar(String ref)
                         throws IdUsedException,
                                IdInvalidException,
                                PermissionException
Add a new calendar. Must commitCalendar() to make official, or cancelCalendar() when done!

Parameters:
ref - The new calendar reference.
Returns:
The newly created calendar.
Throws:
IdUsedException - if the id is not unique.
IdInvalidException - if the id is not made up of valid characters.
PermissionException - if the user does not have permission to add a calendar.

allowGetCalendar

public boolean allowGetCalendar(String ref)
check permissions for getCalendar().

Parameters:
ref - The calendar reference.
Returns:
true if the user is allowed to getCalendar(ref), false if not.

getCalendar

public Calendar getCalendar(String ref)
                     throws IdUnusedException,
                            PermissionException
Return a specific calendar.

Parameters:
ref - The calendar reference.
Returns:
the Calendar that has the specified name.
Throws:
IdUnusedException - If this name is not defined for any calendar.
PermissionException - If the user does not have any permissions to the calendar.

allowImportCalendar

public boolean allowImportCalendar(String ref)
check permissions for importing calendar events

Parameters:
ref - The calendar reference.
Returns:
true if the user is allowed to import events, false if not.

allowUpdateCalendar

public boolean allowUpdateCalendar(String ref)
check permissions for editCalendar()

Parameters:
ref - The calendar reference.
Returns:
true if the user is allowed to update the calendar, false if not.

editCalendar

public CalendarEdit editCalendar(String ref)
                          throws IdUnusedException,
                                 PermissionException,
                                 InUseException
Get a locked calendar object for editing. Must commitCalendar() to make official, or cancelCalendar() or removeCalendar() when done!

Parameters:
ref - The calendar reference.
Returns:
A CalendarEdit object for editing.
Throws:
IdUnusedException - if not found, or if not an CalendarEdit object
PermissionException - if the current user does not have permission to mess with this user.
InUseException - if the Calendar object is locked by someone else.

commitCalendar

public void commitCalendar(CalendarEdit edit)
Commit the changes made to a CalendarEdit object, and release the lock. The CalendarEdit is disabled, and not to be used after this call.

Parameters:
edit - The CalendarEdit object to commit.

cancelCalendar

public void cancelCalendar(CalendarEdit edit)
Cancel the changes made to a CalendarEdit object, and release the lock. The CalendarEdit is disabled, and not to be used after this call.

Parameters:
edit - The CalendarEdit object to commit.

removeCalendar

public void removeCalendar(CalendarEdit edit)
                    throws PermissionException
Remove a calendar that is locked for edit.

Parameters:
edit - The calendar to remove.
Throws:
PermissionException - if the user does not have permission to remove a calendar.

allowRemoveCalendar

public boolean allowRemoveCalendar(String ref)
check permissions for removeCalendar().

Parameters:
ref - The calendar reference.
Returns:
true if the user is allowed to removeCalendar(calendarId), false if not.

calendarReference

public String calendarReference(String context,
                                String id)
Access the internal reference which can be used to access the calendar from within the system.

Parameters:
context - The context.
id - The calendar id.
Returns:
The the internal reference which can be used to access the calendar from within the system.

calendarPdfReference

public String calendarPdfReference(String context,
                                   String id,
                                   int scheduleType,
                                   List calendars,
                                   String timeRangeString,
                                   String userName,
                                   TimeRange dailyTimeRange)
Access the internal reference which can be used to access the calendar-in-pdf format from within the system.

Parameters:
context - The context.
id - The calendar id.
Returns:
The the internal reference which can be used to access the calendar-in-pdf format from within the system.

eventReference

public String eventReference(String context,
                             String calendarId,
                             String id)
Access the internal reference which can be used to access the event from within the system.

Parameters:
context - The context.
id - The event id.
Returns:
The the internal reference which can be used to access the event from within the system.

getEvents

public CalendarEventVector getEvents(List references,
                                     TimeRange range)
Takes several calendar References and merges their events from within a given time range.

Parameters:
references - The List of calendar References.
range - The time period to use to select events.
Returns:
CalendarEventVector object with the union of all events from the list of calendars in the given time range.

newRecurrence

public RecurrenceRule newRecurrence(String frequency)
Construct a new recurrence rule who's frequency description matches the frequency parameter.

Parameters:
frequency - The frequency description of the desired rule.
Returns:
A new recurrence rule.

newRecurrence

public RecurrenceRule newRecurrence(String frequency,
                                    int interval)
Construct a new recurrence rule who's frequency description matches the frequency parameter.

Parameters:
frequency - The frequency description of the desired rule.
interval - The recurrence interval.
Returns:
A new recurrence rule.

newRecurrence

public RecurrenceRule newRecurrence(String frequency,
                                    int interval,
                                    int count)
Construct a new recurrence rule who's frequency description matches the frequency parameter.

Parameters:
frequency - The frequency description of the desired rule.
interval - The recurrence interval.
count - The number of reecurrences limit.
Returns:
A new recurrence rule.

newRecurrence

public RecurrenceRule newRecurrence(String frequency,
                                    int interval,
                                    Time until)
Construct a new recurrence rule who's frequency description matches the frequency parameter.

Parameters:
frequency - The frequency description of the desired rule.
interval - The recurrence interval.
until - The time after which recurrences stop.
Returns:
A new recurrence rule.