org.exoplatform.calendar.service
Interface CalendarService

All Known Implementing Classes:
CalendarServiceImpl

public interface CalendarService

Created by The eXo Platform SARL Author : Hung Nguyen Quang hung.nguyen@exoplatform.com Jul 11, 2007


Field Summary
static String CALDAV
           
static String EXPORTEDCSV
           
static String ICALENDAR
           
 
Method Summary
 void addEventListenerPlugin(CalendarEventListener listener)
           
 void addListenerPlugin(CalendarUpdateEventListener listener)
           
 void assignGroupTask(String taskId, String calendarId, String assignee)
          Assigns a group task for an user
 void autoRemoveShareCalendar(String groupId, String username)
          Un-shares group calendars with an user when he is removed from a membership
 void autoShareCalendar(List<String> groupsOfUser, String receiver)
          Shares group calendars with an user when he is assigned a new membership
 Map<String,String> checkFreeBusy(EventQuery eventQuery)
          Gets busy time of participants in a period
 void confirmInvitation(String fromUserId, String toUserId, int calType, String calendarId, String eventId, int answer)
          Deprecated.  
 void confirmInvitation(String fromUserId, String confirmingEmail, String confirmingUser, int calType, String calendarId, String eventId, int answer)
          Confirms an invitation to participate in an event
 org.quartz.JobDetail findSynchronizeRemoteCalendarJob(org.exoplatform.services.scheduler.JobSchedulerService schedulerService, String username)
          Finds job of synchronizing remote calendar of an user
 int generateRss(String username, LinkedHashMap<String,Calendar> calendars, RssData rssData)
          Generates RSS Feed link for list of calendars following RSS standard and stores the feed in storage
 int generateRss(String username, List<String> calendarIds, RssData rssData)
          Generates RSS Feed data for list of calendars following RSS standard and stores the feed in storage
 List<CalendarEvent> getAllNoRepeatEvents(String username, EventQuery eventQuery, String[] publicCalendarIds)
          A faster version of getEvents used for UIWeekview
 String getCalDavResourceEtag(String username, String calendarId, String eventId)
          Gets the entity tag of an event in a subscribed calendar.
 String getCalDavResourceHref(String username, String calendarId, String eventId)
          Gets the reference key to remote event of an event in a subscribed calendar.
 Calendar getCalendarById(String calId)
          Gets a calendar by its id
 CalendarImportExport getCalendarImportExports(String type)
          Gets the object performing import/export by type of import/export.
 CalendarSetting getCalendarSetting(String username)
          Gets calendar settings of an user
 CalendarEvent getEvent(String username, String eventId)
          Gets event/task by its id and its owner
 CalendarEvent getEventById(String eventId)
          Gets event by its Id
 List<EventCategory> getEventCategories(String username)
          Gets all event categories of an user
 EventCategory getEventCategory(String username, String eventCategoryId)
          Gets event category by its id and its owner
 EventCategory getEventCategoryByName(String username, String eventCategoryName)
          Gets event category by its name and its owner
 List<CalendarEvent> getEvents(String username, EventQuery eventQuery, String[] publicCalendarIds)
          Gets all the events and tasks that match the conditions in the given EventQuery object
 List<CalendarEvent> getExceptionEvents(String username, CalendarEvent recurEvent)
          Gets all exception occurrences from a original recurrent event, the exception event always belong to same calendar with original recurrent event
 String[] getExportImportType()
          Gets array of supported types of import/export
 List<FeedData> getFeeds(String username)
          Gets RSS Feed data created by the given user.
 Calendar getGroupCalendar(String calendarId)
          Gets a group/public calendar by its Id
 List<GroupCalendarData> getGroupCalendars(String[] groupIds, boolean isShowAll, String username)
          Gets all the group calendar data of current user
 CalendarEvent getGroupEvent(String eventId)
          Gets a group event by its Id
 CalendarEvent getGroupEvent(String calendarId, String eventId)
          Gets event or task from a given group calendar by its id
 List<CalendarEvent> getGroupEventByCalendar(List<String> calendarIds)
          Gets all events and tasks from a list of public calendars
 List<CalendarEvent> getHighLightOriginalRecurrenceEvents(String username, Calendar from, Calendar to, String[] publicCalendarIds)
           
 Map<String,CalendarEvent> getOccurrenceEvents(CalendarEvent recurEvent, Calendar from, Calendar to, String timezone)
          Gets all occurrences of a repetitive event in a period of time.
 List<CalendarEvent> getOriginalRecurrenceEvents(String username, Calendar from, Calendar to, String[] publicCalendarIds)
          Gets all original repetitive events of an user in period of time
 List<CalendarEvent> getPublicEvents(EventQuery eventQuery)
          Gets all public events and tasks that match the conditions in the given EventQuery
 RemoteCalendar getRemoteCalendar(String owner, String calendarId)
          Gets an user's remote calendar, identified by its ID
 Calendar getRemoteCalendar(String owner, String remoteUrl, String remoteType)
          Gets an user's remote calendar, identified by its URL
 int getRemoteCalendarCount(String username)
          Gets number of remote calendars of an user
 RemoteCalendarService getRemoteCalendarService()
          Gets the RemoteCalendarService object
 ResourceBundle getResourceBundle()
          Gets the resource bundle to support localization
 javax.jcr.Node getRssHome(String username)
          Gets RSS home node where RSS data is stored in data storage.
 GroupCalendarData getSharedCalendars(String username, boolean isShowAll)
          Gets all calendars that are shared with the given user
 CalendarEvent getSharedEvent(String username, String calendarId, String eventId)
          Get shared event by user name, calendar id and event id
 List<CalendarEvent> getSharedEventByCalendars(String username, List<String> calendarIds)
          Gets events in shared calendars
 int getTypeOfCalendar(String userName, String calendarId)
          Gets type of a calendar by user name and calendar id
 Calendar getUserCalendar(String username, String calendarId)
          Gets the given user's private calendar, identified by its ID.
 List<Calendar> getUserCalendars(String username, boolean isShowAll)
          Gets private calendars of the given user.
 List<CalendarEvent> getUserEventByCalendar(String username, List<String> calendarIds)
          Gets all events and tasks from a list of private calendars
 List<CalendarEvent> getUserEvents(String username, EventQuery eventQuery)
          Gets events and tasks that match the conditions in the given EventQuery
 Calendar importRemoteCalendar(RemoteCalendar remoteCalendar)
          Imports an online .ics or through CalDav access to local calendar
 void importRemoteCalendarByJob(RemoteCalendar remoteCalendar)
          Imports given remote calendar in background
 void initNewUser(String userName, CalendarSetting defaultCalendarSetting)
          Initializes calendar data for a new created user
 boolean isGroupBeingShared(String group, org.exoplatform.services.scheduler.impl.JobSchedulerServiceImpl schedulerService)
          Checks if a group is belong to a list of groups that's being shared
 boolean isRemoteCalendar(String username, String calendarId)
          Checks if the calendar with given calendarId is a remote calendar
 boolean isValidRemoteUrl(String url, String type, String remoteUser, String remotePassword)
          Checks if the remote URL is valid, in 2 cases of iCalendar URL or CalDav URL, with authentication
 void loadSynchronizeRemoteCalendarJob(String username)
          Initializes job for synchronizing remote calendar
 void moveEvent(String fromCalendar, String toCalendar, String formType, String toType, List<CalendarEvent> calEvents, String username)
          Saves changes for list of events.
 Calendar refreshRemoteCalendar(String username, String remoteCalendarId)
          Reloads data for a remote calendar
 void removeEventCategory(String username, String eventCategoryId)
          Removes an event category, all events and tasks belong to this category will be removed.
 void removeFeedData(String username, String title)
          Removes the feed data of an user by the feed's title
 void removeOccurrenceInstance(String username, CalendarEvent occurrence)
          Removes only an occurrence instance from recurrence series, this function will get the original event node of the occurrence and then put the recurrence id of the need-to-delete occurrence to excludeId list of original node.
 Calendar removePublicCalendar(String calendarId)
          Removes the group calendar form data base, every events, tasks inside this calendar will be removed too
 CalendarEvent removePublicEvent(String calendarId, String eventId)
          Removes a public event or task, all attachments and reminders of this event will be removed
 void removeRecurrenceSeries(String username, CalendarEvent originalEvent)
          Removes all occurrence from an recurrence series.
 void removeSharedCalendar(String username, String calendarId)
          Removes shared calendars of an user
 void removeSharedCalendarByJob(String username, List<String> unsharedGroups, String calendarId)
          Un-shares a calendar with groups.
 void removeSharedCalendarFolder(String username)
          Removes the shared calendar folder of an user and all references (from shared calendars) to this folder.
 void removeSharedEvent(String username, String calendarId, String eventId)
          Removes event/task from shared calendar
 Calendar removeUserCalendar(String username, String calendarId)
          Removes private calendar by given id, all events and tasks belong to this calendar will be removed
 CalendarEvent removeUserEvent(String username, String calendarId, String eventId)
          Removes an event from the personal calendar
 void saveCalendarSetting(String username, CalendarSetting setting)
          Saves User Calendar setting
 void saveEventCategory(String username, EventCategory eventCategory, boolean isNew)
          Saves an event category to data base
 void saveEventToSharedCalendar(String username, String calendarId, CalendarEvent event, boolean isNew)
          Saves event to shared calendar.
 void savePublicCalendar(Calendar calendar, boolean isNew)
          Saves a calendar to public area (group calendar)
 void savePublicEvent(String calendarId, CalendarEvent event, boolean isNew)
          Saves event or task to a public calendar
 void saveSharedCalendar(String username, Calendar calendar)
          Saves a calendar to shared calendars section
 void saveUserCalendar(String username, Calendar calendar, boolean isNew)
          Saves an user's private calendar to storage
 void saveUserEvent(String username, String calendarId, CalendarEvent event, boolean isNew)
          Saves events/tasks to a personal calendar
 EventPageList searchEvent(String username, EventQuery eventQuery, String[] publicCalendarIds)
          Gets an EventPageList of events/tasks of a given list of public calendars that matches the condition
in the given EvenQuery object.
 Map<Integer,String> searchHighlightRecurrenceEvent(String username, EventQuery eventQuery, String[] publicCalendarIds, String timezone)
          Finds all days of month or year that have event/task to highlight from all personal, shared and public calendar of an user
This function is much same like searchHightLightEvent() function but it only counts for recurrent event
 Map<Integer,String> searchHightLightEvent(String username, EventQuery eventQuery, String[] publicCalendarIds)
          Gets the day in month on which there are events.
 void setGroupTaskStatus(String taskId, String calendarId, String status)
          Sets status for a group task.
 void shareCalendar(String username, String calendarId, List<String> sharedUsers)
          Shares the private calendar to other users
 void shareCalendarByRunJob(String username, String calendarId, List<String> sharedGroups)
          Shares Calendar with groups
 void stopSynchronizeRemoteCalendarJob(String username)
          Stops an user's job for synchronizing remote calendar
 void updateOccurrenceEvent(String fromCalendar, String toCalendar, String fromType, String toType, List<CalendarEvent> calEvents, String username)
          Updates an occurrence of a repetitive event
 void updateRecurrenceSeries(String fromCalendar, String toCalendar, String fromType, String toType, CalendarEvent occurrence, String username)
          Updates recurrence series from an occurrence, this function is only called if the occurrence event is not changed the from date property.
 Calendar updateRemoteCalendarInfo(RemoteCalendar remoteCalendar)
          Updates a remote calendar
 

Field Detail

ICALENDAR

static final String ICALENDAR
See Also:
Constant Field Values

EXPORTEDCSV

static final String EXPORTEDCSV
See Also:
Constant Field Values

CALDAV

static final String CALDAV
See Also:
Constant Field Values
Method Detail

getUserCalendar

Calendar getUserCalendar(String username,
                         String calendarId)
                         throws Exception
Gets the given user's private calendar, identified by its ID.

Parameters:
username - current user name(or user id)
calendarId - Id of the calendar
Returns:
The private Calendar of the given user identified by the given id
Throws:
Exception
See Also:
Calendar

getUserCalendars

List<Calendar> getUserCalendars(String username,
                                boolean isShowAll)
                                throws Exception
Gets private calendars of the given user.

The result depends on value of isShowAll parameter. If isShowAll
is true, this method returns all private calendars of this user, otherwise it returns
only calendars selected to be displayed in Calendar setting

Parameters:
username - current user name(or user id)
isShowAll - If true, returns all private calendars. If false, returns
only calendars that are selected in Calendar Setting
Returns:
List of Calendar objects
Throws:
Exception
See Also:
Calendar, CalendarSetting

saveUserCalendar

void saveUserCalendar(String username,
                      Calendar calendar,
                      boolean isNew)
                      throws Exception
Saves an user's private calendar to storage

Parameters:
username - current user name(or user id)
calendar - Calendar object that will be stored
isNew - Boolean value to know adding a new calendar or just updating this calendar
Throws:
Exception

removeUserCalendar

Calendar removeUserCalendar(String username,
                            String calendarId)
                            throws Exception
Removes private calendar by given id, all events and tasks belong to this calendar will be removed

Parameters:
username - current user name(or user id)
calendarId - given calendar id
Returns:
Throws:
Exception

saveSharedCalendar

void saveSharedCalendar(String username,
                        Calendar calendar)
                        throws Exception
Saves a calendar to shared calendars section

Parameters:
username - current user name(or user id)
calendar - Calendar object
Throws:
Exception

getGroupCalendar

Calendar getGroupCalendar(String calendarId)
                          throws Exception
Gets a group/public calendar by its Id

Parameters:
calendarId - given calendar id
Returns:
Calendar object
Throws:
Exception
See Also:
Calendar

getGroupCalendars

List<GroupCalendarData> getGroupCalendars(String[] groupIds,
                                          boolean isShowAll,
                                          String username)
                                          throws Exception
Gets all the group calendar data of current user

The GroupCalendarData contains information about list of calendars with the
group that those calendars belong to.

Parameters:
groupIds - The id of groups that current user belongs to
isShowAll - to specify getting all calendars or only calendars selected in Calendar user setting
username - current user name(or user id)
Returns:
List of GroupCalendarData and each GroupCalendarData contains list of calendar objects
Throws:
Exception
See Also:
GroupCalendarData

savePublicCalendar

void savePublicCalendar(Calendar calendar,
                        boolean isNew)
                        throws Exception
Saves a calendar to public area (group calendar)

Parameters:
calendar - Calendar to be saved
isNew - If true, a new calendar will be saved. If false, an existing calendar will be updated.
Throws:
Exception

removePublicCalendar

Calendar removePublicCalendar(String calendarId)
                              throws Exception
Removes the group calendar form data base, every events, tasks inside this calendar will be removed too

Parameters:
calendarId -
Returns:
Throws:
Exception

getEventCategories

List<EventCategory> getEventCategories(String username)
                                       throws Exception
Gets all event categories of an user

Parameters:
username - current user name(or user id)
Returns:
list of event categories
Throws:
Exception
See Also:
EventCategory

saveEventCategory

void saveEventCategory(String username,
                       EventCategory eventCategory,
                       boolean isNew)
                       throws Exception
Saves an event category to data base

Every users have their own categories of events. The name of category is unique.

Parameters:
username - current user name(or user id)
eventCategory -
isNew -
Throws:
Exception

removeEventCategory

void removeEventCategory(String username,
                         String eventCategoryId)
                         throws Exception
Removes an event category, all events and tasks belong to this category will be removed.

Parameters:
username - current user name(or user id)
eventCategoryId - The unique name of category
Throws:
Exception

getEventCategory

EventCategory getEventCategory(String username,
                               String eventCategoryId)
                               throws Exception
Gets event category by its id and its owner

Parameters:
username - user id of the event category's owner
eventCategoryId - Id of the event category
Returns:
an EventCategory object
Throws:
Exception
See Also:
EventCategory

getEventCategoryByName

EventCategory getEventCategoryByName(String username,
                                     String eventCategoryName)
                                     throws Exception
Gets event category by its name and its owner

Parameters:
username - Id of the owner
eventCategoryName - The name of the category
Returns:
EventCategory object
Throws:
Exception
See Also:
EventCategory

getUserEventByCalendar

List<CalendarEvent> getUserEventByCalendar(String username,
                                           List<String> calendarIds)
                                           throws Exception
Gets all events and tasks from a list of private calendars

Parameters:
username - The owner of the calendar
calendarIds - List of calendar id
Returns:
List of events and tasks
Throws:
Exception

getUserEvents

List<CalendarEvent> getUserEvents(String username,
                                  EventQuery eventQuery)
                                  throws Exception
Gets events and tasks that match the conditions in the given EventQuery

Each property of the EventQuery contains a condition of the query. For example:

After setting value for those properties, the conditions are built in a query statement by the
method EventQuery.getQueryStatement()

Parameters:
username - current user name(or user id)
eventQuery - EventQuery object containing the conditions
Returns:
List of CalendarEvent object (events and tasks)
Throws:
Exception
See Also:
CalendarEvent, EventQuery

getEvent

CalendarEvent getEvent(String username,
                       String eventId)
                       throws Exception
Gets event/task by its id and its owner

Parameters:
username - user id of the event owner
eventId - id of the event
Returns:
CalendarEvent in the personal calendar of owner
Throws:
Exception

saveUserEvent

void saveUserEvent(String username,
                   String calendarId,
                   CalendarEvent event,
                   boolean isNew)
                   throws Exception
Saves events/tasks to a personal calendar

Parameters:
username - current user name(or user id)
calendarId - Id of the calendar to which the event will be saved
event - CalendarEvent object to be saved
isNew - If true, a new event will be saved. If false, an existing event will be updated.
Throws:
Exception

removeUserEvent

CalendarEvent removeUserEvent(String username,
                              String calendarId,
                              String eventId)
                              throws Exception
Removes an event from the personal calendar

All attachments and reminders will be removed

Parameters:
username - current user name(or user id)
calendarId - Id of the calendar from which the event will be removed.
eventId - Id of the removed event.
Returns:
the removed CalendarEvent object. Null if no event was removed.
Throws:
Exception

getGroupEvent

CalendarEvent getGroupEvent(String eventId)
                            throws Exception
Gets a group event by its Id

Parameters:
eventId -
Returns:
CalendarEvent object or null if event was not found
Throws:
Exception

getGroupEvent

CalendarEvent getGroupEvent(String calendarId,
                            String eventId)
                            throws Exception
Gets event or task from a given group calendar by its id

Parameters:
calendarId - given group calendar id
eventId - given event id
Returns:
CalendarEvent object
Throws:
Exception
See Also:
CalendarEvent

getGroupEventByCalendar

List<CalendarEvent> getGroupEventByCalendar(List<String> calendarIds)
                                            throws Exception
Gets all events and tasks from a list of public calendars

Parameters:
calendarIds - List of Calendar IDs
Returns:
List of CalendarEvent objects
Throws:
Exception
See Also:
CalendarEvent

getPublicEvents

List<CalendarEvent> getPublicEvents(EventQuery eventQuery)
                                    throws Exception
Gets all public events and tasks that match the conditions in the given EventQuery

Parameters:
eventQuery - EventQuery object
Returns:
List of calendar event objects
Throws:
Exception
See Also:
CalendarEvent, EventQuery

savePublicEvent

void savePublicEvent(String calendarId,
                     CalendarEvent event,
                     boolean isNew)
                     throws Exception
Saves event or task to a public calendar

Parameters:
calendarId - Id of the public calendar to which the event will be saved
event - CalendarEvent object to be saved.
isNew - If true, a new event will be saved. If false, an existing event will be updated.
Throws:
Exception

removePublicEvent

CalendarEvent removePublicEvent(String calendarId,
                                String eventId)
                                throws Exception
Removes a public event or task, all attachments and reminders of this event will be removed

Parameters:
calendarId - given calendar id
eventId - given event or task id
Returns:
the removed CalendarEvent. Null if no event was removed.
Throws:
Exception

saveCalendarSetting

void saveCalendarSetting(String username,
                         CalendarSetting setting)
                         throws Exception
Saves User Calendar setting

Parameters:
username - current user name(or user id)
setting - CalendarSetting object
Throws:
Exception
See Also:
CalendarSetting

getCalendarSetting

CalendarSetting getCalendarSetting(String username)
                                   throws Exception
Gets calendar settings of an user

Parameters:
username - current user name(or user id)
Returns:
CalendarSetting object
Throws:
Exception
See Also:
CalendarSetting

getCalendarImportExports

CalendarImportExport getCalendarImportExports(String type)
Gets the object performing import/export by type of import/export.

There are 2 classes that implements the interface CalendarImportExport:

Parameters:
type - ICS or CSV
Returns:
a CalendarImportExport object that belongs to 1 of those 2 above classes.
See Also:
CalendarImportExport

getExportImportType

String[] getExportImportType()
                             throws Exception
Gets array of supported types of import/export

Now there are 2 types that are supported: ICS and CSV.

Returns:
array of supported types
Throws:
Exception
See Also:
CalendarImportExport, RemoteCalendarService

generateRss

int generateRss(String username,
                LinkedHashMap<String,Calendar> calendars,
                RssData rssData)
                throws Exception
Generates RSS Feed link for list of calendars following RSS standard and stores the feed in storage

This method is called when user selects calendars to generate RSS link in UIEditFeed form.

Parameters:
username - current user name(or user id)
calendars - the RSS feed will contain events and tasks from the calendars given in this param
rssData - object containing basic informations (url, title, description) of the feed
Returns:
1 if succeed, -1 if fail
Throws:
Exception
See Also:
RssData

generateRss

int generateRss(String username,
                List<String> calendarIds,
                RssData rssData)
                throws Exception
Generates RSS Feed data for list of calendars following RSS standard and stores the feed in storage

Parameters:
username - current user name(or user id)
calendarIds - the RSS feed will contain events and tasks from the calendars given in this param
rssData - object containing basic informations (url, title, description) of the feed
Returns:
1 if succeed, -1 if fail
Throws:
Exception
See Also:
RssData

getFeeds

List<FeedData> getFeeds(String username)
                        throws Exception
Gets RSS Feed data created by the given user.

Parameters:
username - current user name (or user id)
Returns:
List of FeedData
Throws:
Exception
See Also:
FeedData

getRssHome

javax.jcr.Node getRssHome(String username)
                          throws Exception
Gets RSS home node where RSS data is stored in data storage.

Parameters:
username - current user name(or user id)
Returns:
Rss home node
Throws:
Exception

searchEvent

EventPageList searchEvent(String username,
                          EventQuery eventQuery,
                          String[] publicCalendarIds)
                          throws Exception
Gets an EventPageList of events/tasks of a given list of public calendars that matches the condition
in the given EvenQuery object.

Parameters:
username - current user name(or user id)
eventQuery - EventQuery object
publicCalendarIds - Array of public calendar IDs in which to search events
Returns:
EventPageList object.
Throws:
Exception
See Also:
EventPageList

searchHightLightEvent

Map<Integer,String> searchHightLightEvent(String username,
                                          EventQuery eventQuery,
                                          String[] publicCalendarIds)
                                          throws Exception
Gets the day in month on which there are events.

This method is used when UIMiniCalendar is loaded or updated. We need to know on which day there are events
to add class 'highlight' for that day in the template.

The given EventQuery always has from date is the first day of the month, and end date is the last
day of the month. The returned result is a Map with key set is the days having events, the values are all "value".

Parameters:
username - current user name(or user id)
eventQuery - EventQuery object
publicCalendarIds - array of public calendar IDs of which to search events
Returns:
a Map with key set is the days having events. Ex: {<14,"value">, <15,"value">}
Throws:
Exception

shareCalendar

void shareCalendar(String username,
                   String calendarId,
                   List<String> sharedUsers)
                   throws Exception
Shares the private calendar to other users

Parameters:
username - current user name(or user id)
calendarId - Id of the shared calendar
sharedUsers - list of users with whom to share this calendar
Throws:
Exception

getSharedCalendars

GroupCalendarData getSharedCalendars(String username,
                                     boolean isShowAll)
                                     throws Exception
Gets all calendars that are shared with the given user

Parameters:
username - given user name(or user id)
isShowAll - If true, returns all shared calendars, if false, returns only shared calendars that are selected in Calendar Setting.
Returns:
GroupCalendarData object
Throws:
Exception
See Also:
GroupCalendarData

getEvents

List<CalendarEvent> getEvents(String username,
                              EventQuery eventQuery,
                              String[] publicCalendarIds)
                              throws Exception
Gets all the events and tasks that match the conditions in the given EventQuery object

The result includes events of private, public and share calendars.

If publicCalendarIds is not null, the result will include also all public events from those
public calendar.

Parameters:
username - current user name(or user id)
eventQuery - EventQuery object
publicCalendarIds - Optional array of public calendar IDs of which to get events
Returns:
Throws:
Exception
See Also:
CalendarEvent

getAllNoRepeatEvents

List<CalendarEvent> getAllNoRepeatEvents(String username,
                                         EventQuery eventQuery,
                                         String[] publicCalendarIds)
                                         throws Exception
A faster version of getEvents used for UIWeekview

Parameters:
username -
eventQuery -
publicCalendarIds -
Returns:
Throws:
Exception

removeSharedCalendar

void removeSharedCalendar(String username,
                          String calendarId)
                          throws Exception
Removes shared calendars of an user

Parameters:
username - current user name(or user id)
calendarId - given calendar id
Throws:
Exception

removeSharedCalendarFolder

void removeSharedCalendarFolder(String username)
                                throws Exception
Removes the shared calendar folder of an user and all references (from shared calendars) to this folder.

Parameters:
username - the username
Throws:
Exception

saveEventToSharedCalendar

void saveEventToSharedCalendar(String username,
                               String calendarId,
                               CalendarEvent event,
                               boolean isNew)
                               throws Exception
Saves event to shared calendar.

Parameters:
username - current user name(or user id)
calendarId - given calendar id
event - CalendarEvent object
isNew - If true, a new event will be saved. If false, an existing event will be updated.
Throws:
Exception

checkFreeBusy

Map<String,String> checkFreeBusy(EventQuery eventQuery)
                                 throws Exception
Gets busy time of participants in a period

The list of participants and the period are given in an EventQuery object.

The returned result is a Map with the key is user name of participants
and the value is pairs of {fromtime, totime} in milliseconds , separated by ','.

Parameters:
eventQuery - EventQuery object
Returns:
a Map with the key is user name and value is
Throws:
Exception
See Also:
EventQuery

removeSharedEvent

void removeSharedEvent(String username,
                       String calendarId,
                       String eventId)
                       throws Exception
Removes event/task from shared calendar

Parameters:
username - current user name(or user id)
calendarId - given calendar id
eventId - given event id
Throws:
Exception

moveEvent

void moveEvent(String fromCalendar,
               String toCalendar,
               String formType,
               String toType,
               List<CalendarEvent> calEvents,
               String username)
               throws Exception
Saves changes for list of events.

This method can be used in 2 cases:

Parameters:
fromCalendar - Id of the source calendar
toCalendar - Id of the destination calendar
formType - type of the source calendar (private/shared/public)
toType - type of the destination calendar (private/shared/public)
calEvents - List of CalendarEvent objects
username - current user name(or user id)
Throws:
Exception

confirmInvitation

void confirmInvitation(String fromUserId,
                       String toUserId,
                       int calType,
                       String calendarId,
                       String eventId,
                       int answer)
Deprecated. 

Confirms invitation to participate in an event

This method is called only when user uses exo mail product.

The answer can be: DENY, ACCEPT, NOTSURE

Parameters:
fromUserId - Id of the invitation owner
toUserId - Id of the invited user
calType - type of the invitation event's calendar
calendarId - Id of the invitation event's calendar
eventId - Id of the invitation event
answer - The answer of the invited user

confirmInvitation

void confirmInvitation(String fromUserId,
                       String confirmingEmail,
                       String confirmingUser,
                       int calType,
                       String calendarId,
                       String eventId,
                       int answer)
                       throws Exception
Confirms an invitation to participate in an event

Parameters:
fromUserId - Id of the invitation owner
confirmingEmail - Email of the invited participant
confirmingUser - User id of the invited participant
calType - Type of the invitation event's calendar
calendarId - Id of the invitation event's calendar
eventId - Id of the invitation event
answer - The answer of the invited user. It can be: DENY/ACCEPT/NOT_SURE
Throws:
Exception

addListenerPlugin

void addListenerPlugin(CalendarUpdateEventListener listener)
                       throws Exception
Throws:
Exception

addEventListenerPlugin

void addEventListenerPlugin(CalendarEventListener listener)
                            throws Exception
Throws:
Exception

getTypeOfCalendar

int getTypeOfCalendar(String userName,
                      String calendarId)
                      throws Exception
Gets type of a calendar by user name and calendar id

There a 3 types of calendar:

Parameters:
userName -
calendarId -
Returns:
0 if the calendar is private, 1 if the calendar is shared, 2 if the calendar is public
Throws:
Exception
See Also:
Calendar

getSharedEventByCalendars

List<CalendarEvent> getSharedEventByCalendars(String username,
                                              List<String> calendarIds)
                                              throws Exception
Gets events in shared calendars

Parameters:
username - current user name
calendarIds - list of shared calendars from which to get events
Returns:
list of CalendarEvent object
Throws:
Exception

getSharedEvent

CalendarEvent getSharedEvent(String username,
                             String calendarId,
                             String eventId)
                             throws Exception
Get shared event by user name, calendar id and event id

Parameters:
username - current user name
calendarId - id of shared calendar
eventId - id of shared event
Returns:
the CalendarEvent object
Throws:
Exception

removeFeedData

void removeFeedData(String username,
                    String title)
Removes the feed data of an user by the feed's title

Parameters:
username - user id of the feed owner
title - The title of the removed feed

getResourceBundle

ResourceBundle getResourceBundle()
                                 throws Exception
Gets the resource bundle to support localization

Returns:
a ResourceBundle object
Throws:
Exception

initNewUser

void initNewUser(String userName,
                 CalendarSetting defaultCalendarSetting)
                 throws Exception
Initializes calendar data for a new created user

Parameters:
userName - User id of the new created user
defaultCalendarSetting - default calendar setting
Throws:
Exception

assignGroupTask

void assignGroupTask(String taskId,
                     String calendarId,
                     String assignee)
                     throws Exception
Assigns a group task for an user

Parameters:
taskId - the assigned task
calendarId - Id of the task's calendar
assignee - User id of the assignee
Throws:
Exception

setGroupTaskStatus

void setGroupTaskStatus(String taskId,
                        String calendarId,
                        String status)
                        throws Exception
Sets status for a group task.

Parameters:
taskId - Id of the task
calendarId - Id of the task's calendar
status -
Throws:
Exception
See Also:
CalendarEvent

isRemoteCalendar

boolean isRemoteCalendar(String username,
                         String calendarId)
                         throws Exception
Checks if the calendar with given calendarId is a remote calendar

Parameters:
username - the owner of calendar
calendarId - the Id of calendar
Returns:
true if this calendar is remote, otherwise false
Throws:
Exception

isValidRemoteUrl

boolean isValidRemoteUrl(String url,
                         String type,
                         String remoteUser,
                         String remotePassword)
                         throws Exception
Checks if the remote URL is valid, in 2 cases of iCalendar URL or CalDav URL, with authentication

Parameters:
url - the remote URL
type - the type of remote calendar, iCalendar or CalDav
remoteUser - the remote user name used to authenticate
remotePassword - the remote password used to authenticate
Returns:
true if remote URL is available in case of iCalendar or supports CalDav access in case of CalDav
Throws:
Exception

importRemoteCalendar

Calendar importRemoteCalendar(RemoteCalendar remoteCalendar)
                              throws Exception
Imports an online .ics or through CalDav access to local calendar

Parameters:
remoteCalendar - object content all properties for remote calendar.
Throws:
Exception

refreshRemoteCalendar

Calendar refreshRemoteCalendar(String username,
                               String remoteCalendarId)
                               throws Exception
Reloads data for a remote calendar

Parameters:
username - owner of the calendar
remoteCalendarId - Id of the remote calendar to refresh
Returns:
the RemoteCalendar object
Throws:
Exception

updateRemoteCalendarInfo

Calendar updateRemoteCalendarInfo(RemoteCalendar remoteCalendar)
                                  throws Exception
Updates a remote calendar

Parameters:
remoteCalendar - a RemoteCalendar object.
Returns:
this calendar after updating
Throws:
Exception
See Also:
RemoteCalendar

getRemoteCalendar

RemoteCalendar getRemoteCalendar(String owner,
                                 String calendarId)
                                 throws Exception
Gets an user's remote calendar, identified by its ID

Parameters:
owner - user name of the calendar's owner
calendarId - the Id of calendar
Returns:
RemoteCalendar object
Throws:
Exception
See Also:
RemoteCalendar

getRemoteCalendarService

RemoteCalendarService getRemoteCalendarService()
                                               throws Exception
Gets the RemoteCalendarService object

Returns:
RemoteCalendarService object
Throws:
Exception

getRemoteCalendar

Calendar getRemoteCalendar(String owner,
                           String remoteUrl,
                           String remoteType)
                           throws Exception
Gets an user's remote calendar, identified by its URL

Parameters:
owner - user name of the calendar's owner
remoteUrl - URL of the remote calendar
remoteType - iCalendar or CalDav
Returns:
a Calendar object
Throws:
Exception

getRemoteCalendarCount

int getRemoteCalendarCount(String username)
                           throws Exception
Gets number of remote calendars of an user

Parameters:
username -
Returns:
number of remote calendars
Throws:
Exception

getCalDavResourceHref

String getCalDavResourceHref(String username,
                             String calendarId,
                             String eventId)
                             throws Exception
Gets the reference key to remote event of an event in a subscribed calendar.

Each event of a CalDav subscribed calendar has a reference key to its respective remote event. This key allows us to know if
an event is deleted or created from remote calendar.

The JCR property holding this value is exo:caldavHref of the node type exo:caldavCalendarEvent.

Parameters:
username - current user name (or user ID)
calendarId - the subscribed calendar's ID
eventId - Id of the local event
Returns:
reference key to the remote event
Throws:
Exception

getCalDavResourceEtag

String getCalDavResourceEtag(String username,
                             String calendarId,
                             String eventId)
                             throws Exception
Gets the entity tag of an event in a subscribed calendar.

Each event of a CalDav subscribed calendar has an entity tag. This value allows us to know if the details content of a remote event
were updated, so that we can update the respective local event properly.

The JCR property holding this value is exo:caldavEtag of the node type exo:caldavCalendarEvent.

Parameters:
username - current user name (or user ID)
calendarId - ID of the subscribed calendar
eventId - Id of the local event
Returns:
entity tag for the given event
Throws:
Exception

loadSynchronizeRemoteCalendarJob

void loadSynchronizeRemoteCalendarJob(String username)
                                      throws Exception
Initializes job for synchronizing remote calendar

Parameters:
username -
Throws:
Exception

findSynchronizeRemoteCalendarJob

org.quartz.JobDetail findSynchronizeRemoteCalendarJob(org.exoplatform.services.scheduler.JobSchedulerService schedulerService,
                                                      String username)
                                                      throws Exception
Finds job of synchronizing remote calendar of an user

Parameters:
schedulerService -
username -
Returns:
a JobDetail object
Throws:
Exception

stopSynchronizeRemoteCalendarJob

void stopSynchronizeRemoteCalendarJob(String username)
                                      throws Exception
Stops an user's job for synchronizing remote calendar

Parameters:
username -
Throws:
Exception

getOccurrenceEvents

Map<String,CalendarEvent> getOccurrenceEvents(CalendarEvent recurEvent,
                                              Calendar from,
                                              Calendar to,
                                              String timezone)
                                              throws Exception
Gets all occurrences of a repetitive event in a period of time.
The result will be depended on the recurrence rule, the start date of recurrent event and the period of time to view.

Parameters:
recurEvent - the original recurrent event
from - the from time
to - the to time
Returns:
the map of CalendarEvent object, each entry will contains an occurrence event object with recurrence-id as the key
Throws:
Exception

getOriginalRecurrenceEvents

List<CalendarEvent> getOriginalRecurrenceEvents(String username,
                                                Calendar from,
                                                Calendar to,
                                                String[] publicCalendarIds)
                                                throws Exception
Gets all original repetitive events of an user in period of time

Parameters:
username - the owner of recurrent event
from - from time
to - to time
Returns:
list of CalendarEvent objects
Throws:
Exception

updateOccurrenceEvent

void updateOccurrenceEvent(String fromCalendar,
                           String toCalendar,
                           String fromType,
                           String toType,
                           List<CalendarEvent> calEvents,
                           String username)
                           throws Exception
Updates an occurrence of a repetitive event

This method is called when:

  • User wants to update only one instance of the recurrent series. In this case, a new normal event will be created as an exception event of the series
  • User wants to update an exception event of a recurrent series. In this case, this event will be updated as a normal one

Parameters:
fromCalendar - ID of the source calendar
toCalendar - ID of the destination calendar
fromType - type of the source Calendar
toType - type of the destination calendar
calEvents - list of events to be updated
username - current user name (or user ID)
Throws:
Exception

getExceptionEvents

List<CalendarEvent> getExceptionEvents(String username,
                                       CalendarEvent recurEvent)
                                       throws Exception
Gets all exception occurrences from a original recurrent event, the exception event always belong to same calendar with original recurrent event

Parameters:
username - the owner of this recurrent event
recurEvent - the original recurrent event
Returns:
the list of CalendarEvent objects
Throws:
Exception

removeOccurrenceInstance

void removeOccurrenceInstance(String username,
                              CalendarEvent occurrence)
                              throws Exception
Removes only an occurrence instance from recurrence series, this function will get the original event node of the occurrence and then put the recurrence id of the need-to-delete occurrence to excludeId list of original node.

Parameters:
username - owner of this occurrence event
occurrence - the occurrence event object to remove
Throws:
Exception

removeRecurrenceSeries

void removeRecurrenceSeries(String username,
                            CalendarEvent originalEvent)
                            throws Exception
Removes all occurrence from an recurrence series. It will delete the original event of recurrence series.
All exception occurrences of this series still exist and will be treated as a normal event

Parameters:
username - owner of recurrent event, in case of private or shared calendar
originalEvent - the original recurrent event object
Throws:
Exception

updateRecurrenceSeries

void updateRecurrenceSeries(String fromCalendar,
                            String toCalendar,
                            String fromType,
                            String toType,
                            CalendarEvent occurrence,
                            String username)
                            throws Exception
Updates recurrence series from an occurrence, this function is only called if the occurrence event is not changed the from date property.
In other way, if the occurrence event move to another date, it will be updated as a 'exception' occurrence and not affects to series

Parameters:
fromCalendar - the calendarId of the calendar which the recurrent event belong to before updating
toCalendar - the new calendarId of the recurrent event
fromType - calendarType of recurrent event before updating
toType - calendarType of recurrent event after updating
occurrence - the occurrence contains the new data about recurrence series
username - owner of recurrent event, in case of private and shared calendar
Throws:
Exception

searchHighlightRecurrenceEvent

Map<Integer,String> searchHighlightRecurrenceEvent(String username,
                                                   EventQuery eventQuery,
                                                   String[] publicCalendarIds,
                                                   String timezone)
                                                   throws Exception
Finds all days of month or year that have event/task to highlight from all personal, shared and public calendar of an user
This function is much same like searchHightLightEvent() function but it only counts for recurrent event

Parameters:
username - the username of user
eventQuery - EventQuery object to limit time-range
publicCalendarIds - list of public calendar
timezone - timezone
Returns:
Throws:
Exception

getHighLightOriginalRecurrenceEvents

List<CalendarEvent> getHighLightOriginalRecurrenceEvents(String username,
                                                         Calendar from,
                                                         Calendar to,
                                                         String[] publicCalendarIds)
                                                         throws Exception
Throws:
Exception

shareCalendarByRunJob

void shareCalendarByRunJob(String username,
                           String calendarId,
                           List<String> sharedGroups)
                           throws Exception
Shares Calendar with groups

When a calendar is selected to share with a group, the sharing process will run as job in background to avoid blocking the user. It will send notification for users about starting and finishing the job.

Parameters:
username - Id of current user
calendarId - Id of shared calendar
sharedGroups - List of shared groups
Throws:
Exception

removeSharedCalendarByJob

void removeSharedCalendarByJob(String username,
                               List<String> unsharedGroups,
                               String calendarId)
                               throws Exception
Un-shares a calendar with groups.

To avoid letting users wait too long, un-sharing with groups runs as job in background. There are notifications about job starting and finishing

Parameters:
username - Id of current user
unsharedGroups - List of un-shared groups
calendarId - Id of shared calendar
Throws:
Exception
See Also:
CalendarService#shareCalendarByRunJob(String, String, List)}

isGroupBeingShared

boolean isGroupBeingShared(String group,
                           org.exoplatform.services.scheduler.impl.JobSchedulerServiceImpl schedulerService)
                           throws Exception
Checks if a group is belong to a list of groups that's being shared

Parameters:
group - Id of the group to be checked
schedulerService - The schedule service that manages jobs
Returns:
true if this group is belong to a list of groups that is being shared, false if not.
Throws:
Exception
See Also:
CalendarService#shareCalendarByRunJob(String, String, List)}

getEventById

CalendarEvent getEventById(String eventId)
                           throws Exception
Gets event by its Id

Parameters:
eventId - Id of the event
Returns:
a CalendarEvent
Throws:
Exception

getCalendarById

Calendar getCalendarById(String calId)
                         throws Exception
Gets a calendar by its id

Parameters:
calId - Id of the calendar
Returns:
a Calendar
Throws:
Exception

autoShareCalendar

void autoShareCalendar(List<String> groupsOfUser,
                       String receiver)
                       throws Exception
Shares group calendars with an user when he is assigned a new membership

This method is called in NewMembershipListener.postSave(org.exoplatform.services.organization.Membership, boolean).

Parameters:
groupsOfUser - List of group id
receiver - User id
Throws:
Exception

autoRemoveShareCalendar

void autoRemoveShareCalendar(String groupId,
                             String username)
                             throws Exception
Un-shares group calendars with an user when he is removed from a membership

This method is called in NewMembershipListener.preDelete(org.exoplatform.services.organization.Membership).

Parameters:
groupId -
username -
Throws:
Exception

importRemoteCalendarByJob

void importRemoteCalendarByJob(RemoteCalendar remoteCalendar)
                               throws Exception
Imports given remote calendar in background

Users don't need to wait too long when importing a big calendar

Parameters:
remoteCalendar -
Throws:
Exception


Copyright © 2003-2013 eXo Platform SAS. All Rights Reserved.