Package org.exoplatform.agenda.service
Interface AgendaEventService
public interface AgendaEventService
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanAccessEvent(Event event, long identityId) Check whether user can access event or not.booleancanCreateEvent(Calendar calendar, long userIdentityId) Check whether user can create an event in selected Calendar or not.booleancanUpdateEvent(Event event, long userIdentityId) Check whether user can update or delete an event or not.longcountEventDatePolls(List<Long> ownerIds, long attendeeId) Count pending date polls where the current user is invitedlongcountPendingEvents(List<Long> ownerIds, long userIdentityId) Count pending events that the selected user didn't answered yetcreateEvent(Event event, List<EventAttendee> attendees, List<EventConference> conferences, List<EventReminder> reminders, List<EventDateOption> dateOptions, RemoteEvent remoteEvent, boolean sendInvitation, long userIdentityId) Creates an event in designated calendar or in user personal calendar if nullcreateEventExceptionalOccurrence(long eventId, List<EventAttendee> attendees, List<EventConference> conferences, List<EventReminder> reminders, ZonedDateTime occurrenceId) Create a new exceptional occurrence for a parent recurrent eventdeleteEventById(long eventId, long userIdentityId) Deletes an existing eventgetEventById(long eventId) Retrieves an event identified by its technical identifier.getEventById(long eventId, ZoneId timeZone, long identityId) Retrieves an event identified by its technical identifier.getEventDatePolls(EventFilter eventFilter, ZoneId userTimeZone, long attendeeId) Retrieves the list of pending date polls where the current user is invitedgetEventOccurrence(long parentEventId, ZonedDateTime occurrenceId, ZoneId userTimeZone, long identityId) Retrieves Event Occurrence identified by parent recurrence Event identifier and occurrence dategetEventOccurrencesInPeriod(Event recurrentEvent, ZonedDateTime start, ZonedDateTime end, ZoneId timezone, int limit) Retrieves occurrences, without exceptional, of a recurrent event in a given period of time.getEvents(EventFilter eventFilter, ZoneId userTimeZone, long userIdentityId) Retrieves the list of events available for a designated user filtered by criteria defined in a filter.getExceptionalOccurrenceEvent(long eventId, ZonedDateTime occurrenceId) Retrieves an event identified by its technical identifier.getExceptionalOccurrenceEvents(long eventId, ZoneId timeZone, long userIdentityId) Retrieves the list of exceptional occurrences of an event identified by its technical identifier.getParentRecurrentEvents(ZonedDateTime start, ZonedDateTime end, ZoneId timeZone) Retrieve parent recurrent events switch event filter.getPendingEvents(List<Long> ownerIds, long userIdentityId, ZoneId userTimeZone, int offset, int limit) Retrieve pending events that the selected user didn't answered yetsaveEventExceptionalOccurrence(long eventId, ZonedDateTime occurrenceId) Creates an exceptional occurrence for a recurrent event and occurrence IDSearch the list of events available with query for the currentUservoidselectEventDateOption(long eventId, long dateOptionId, long userIdentityId) Choose a selectedEventDateOptionfor a givenEventupdateEvent(Event event, List<EventAttendee> attendees, List<EventConference> conferences, List<EventReminder> reminders, List<EventDateOption> dateOptions, RemoteEvent remoteEvent, boolean sendInvitation, long userIdentityId) Updates an existing event in-place when the user is owner of parentCalendar, else this will duplicate the event and add it into his personal calendarvoidupdateEventFields(long eventId, Map<String, List<String>> fields, boolean updateAllOccurrences, boolean sendInvitation, long userIdentityId) Updates a single field for a givenEventidentified by its technical identifier.
-
Method Details
-
getEvents
List<Event> getEvents(EventFilter eventFilter, ZoneId userTimeZone, long userIdentityId) throws IllegalAccessException Retrieves the list of events available for a designated user filtered by criteria defined in a filter.- Parameters:
eventFilter- a filter used to define criteria to get list of objectsuserTimeZone- User time zoneuserIdentityId- userIdentityidentifier- Returns:
ListofEventaccessible to user- Throws:
IllegalAccessException- when user is not allowed to access events
-
getParentRecurrentEvents
Retrieve parent recurrent events switch event filter. -
getEventById
Retrieves an event identified by its technical identifier.- Parameters:
eventId- technical identifier of eventtimeZone- used timezone to convert datesidentityId-Identitytechnical identifier- Returns:
- Corresponding
Eventor null if not found - Throws:
IllegalAccessException- when user is not allowed to access event
-
getEventById
Retrieves an event identified by its technical identifier.- Parameters:
eventId- technical identifier of event- Returns:
- Corresponding
Eventor null if not found
-
getEventOccurrence
Event getEventOccurrence(long parentEventId, ZonedDateTime occurrenceId, ZoneId userTimeZone, long identityId) throws IllegalAccessException Retrieves Event Occurrence identified by parent recurrence Event identifier and occurrence date- Parameters:
parentEventId-Eventtechnical identifieroccurrenceId- Date of occurrenceuserTimeZone- used user timezoneidentityId- userIdentityidentifier requesting event- Returns:
Eventrepresenting occurrence of parent recurrent event- Throws:
IllegalAccessException- when user is accessing not allowed event
-
getExceptionalOccurrenceEvents
List<Event> getExceptionalOccurrenceEvents(long eventId, ZoneId timeZone, long userIdentityId) throws IllegalAccessException Retrieves the list of exceptional occurrences of an event identified by its technical identifier.- Parameters:
eventId- technical identifier of parent recurrent eventtimeZone- used timezone to compute eventsuserIdentityId-- Returns:
- list of Exceptional
Events if found, else null - Throws:
IllegalAccessException- when user is not allowed to access event
-
getExceptionalOccurrenceEvent
Retrieves an event identified by its technical identifier.- Parameters:
eventId- technical identifier of parent recurrent eventoccurrenceId- technical occurrence event identifier- Returns:
- Exceptional
Eventif found, else null
-
createEventExceptionalOccurrence
Event createEventExceptionalOccurrence(long eventId, List<EventAttendee> attendees, List<EventConference> conferences, List<EventReminder> reminders, ZonedDateTime occurrenceId) throws AgendaException Create a new exceptional occurrence for a parent recurrent event- Parameters:
eventId- technical identifier of parent recurrent eventattendees-Listof attendeesconferences-Listof conferencesreminders-Listof remindersoccurrenceId- event occurent identifier- Returns:
- newly created
Event - Throws:
AgendaException- when the event attributes aren't valid
-
saveEventExceptionalOccurrence
Event saveEventExceptionalOccurrence(long eventId, ZonedDateTime occurrenceId) throws AgendaException Creates an exceptional occurrence for a recurrent event and occurrence ID- Parameters:
eventId- parent recurrent event identifieroccurrenceId- Occurrence identifier- Returns:
- created
Event - Throws:
AgendaException- when an error occurs hile creating event
-
createEvent
Event createEvent(Event event, List<EventAttendee> attendees, List<EventConference> conferences, List<EventReminder> reminders, List<EventDateOption> dateOptions, RemoteEvent remoteEvent, boolean sendInvitation, long userIdentityId) throws IllegalAccessException, AgendaException Creates an event in designated calendar or in user personal calendar if null- Parameters:
event-Eventto createattendees- event attendees of typeEventAttendeeconferences- event conferences of typeEventConferencereminders-Listof preferred user reminders of typeEventReminderdateOptions-ListofEventDateOptionof corresponding eventremoteEvent-RemoteEventof synchronized event by user to remote connectorsendInvitation- whether send invitation to attendees or notuserIdentityId- userIdentityidentifier- Returns:
- Created
Eventwith technichal identifier - Throws:
IllegalAccessException- when user is not allowed to create event on calendarAgendaException- when the event attributes aren't valid
-
updateEvent
Event updateEvent(Event event, List<EventAttendee> attendees, List<EventConference> conferences, List<EventReminder> reminders, List<EventDateOption> dateOptions, RemoteEvent remoteEvent, boolean sendInvitation, long userIdentityId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException, AgendaException Updates an existing event in-place when the user is owner of parentCalendar, else this will duplicate the event and add it into his personal calendar- Parameters:
event-Eventto createattendees- event attendees of typeEventAttendeeconferences- event conferences of typeEventConferencereminders-Listof preferred user reminders of typeEventReminderdateOptions-ListofEventDateOptionof corresponding eventremoteEvent-RemoteEventof synchronized event by user to remote connectorsendInvitation- whether re-send invitation to attendees or notuserIdentityId- userIdentityidentifier- Returns:
- Updated
Event - Throws:
IllegalAccessException- when user is not allowed to update eventorg.exoplatform.commons.exception.ObjectNotFoundException- when the event identified by its technical identifier is not foundAgendaException- when the event attributes aren't valid
-
updateEventFields
void updateEventFields(long eventId, Map<String, List<String>> fields, boolean updateAllOccurrences, boolean sendInvitation, long userIdentityId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException, AgendaExceptionUpdates a single field for a givenEventidentified by its technical identifier. When the event is of type 'recurrent', if parameter updateAllOccurrences is set to true, it will update the event field for all exceptional occurrences as well.- Parameters:
eventId- Event technical identifier to updatefields-Eventfields with field name as map key and field value as map valueupdateAllOccurrences- whether apply modification on all exceptional occurrences as well or notsendInvitation- whether re-send invitation to attendees or notuserIdentityId- userIdentityidentifier- Throws:
IllegalAccessException- when user is not allowed to update eventorg.exoplatform.commons.exception.ObjectNotFoundException- when the event identified by its technical identifier is not foundAgendaException- when the event attribute isn't valid
-
deleteEventById
Event deleteEventById(long eventId, long userIdentityId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException Deletes an existing event- Parameters:
eventId- Event technical identifier to deleteuserIdentityId- userIdentityidentifier- Returns:
- deleted
Event - Throws:
IllegalAccessException- when user is not authorized to delete the eventorg.exoplatform.commons.exception.ObjectNotFoundException- when the event identified by its technical identifier is not found
-
canAccessEvent
Check whether user can access event or not.- Parameters:
event-Eventto check its permissionidentityId-Identitytechnical identifier- Returns:
- true if the user is a member of
CalendarownerIdentityor is anEventAttendee, else return false.
-
canUpdateEvent
Check whether user can update or delete an event or not.- Parameters:
event-Eventto check its permissionuserIdentityId- userIdentityidentifier- Returns:
- true if the user is a manager of
CalendarownerIdentityor is anEventAttendee, else return false.
-
canCreateEvent
Check whether user can create an event in selected Calendar or not. -
search
List<EventSearchResult> search(long userIdentityId, ZoneId userTimeZone, String query, int offset, int limit) Search the list of events available with query for the currentUser- Parameters:
userIdentityId- userIdentityidentifieruserTimeZone- used user timezonequery- Term to searchoffset- offsetlimit- Limit of events to retrieve- Returns:
ListofEventSearchResult
-
getEventOccurrencesInPeriod
List<Event> getEventOccurrencesInPeriod(Event recurrentEvent, ZonedDateTime start, ZonedDateTime end, ZoneId timezone, int limit) Retrieves occurrences, without exceptional, of a recurrent event in a given period of time. -
selectEventDateOption
void selectEventDateOption(long eventId, long dateOptionId, long userIdentityId) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Choose a selectedEventDateOptionfor a givenEvent- Parameters:
eventId- technical identifier ofEventdateOptionId- Technical identifier ofEventDateOptionuserIdentityId- userIdentityidentifier- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- whenEventis not found using identifier orEventDateOptionis not found using technical identifierIllegalAccessException- when user is not an allowed participant of the event who can modifies it
-
getEventDatePolls
List<Event> getEventDatePolls(EventFilter eventFilter, ZoneId userTimeZone, long attendeeId) throws IllegalAccessException Retrieves the list of pending date polls where the current user is invited- Parameters:
eventFilter- a filter used to define criteria to get list of objectsuserTimeZone- used to compute events dates switch given time zoneattendeeId- userIdentityidentifier- Returns:
Listdate pollEventfor user- Throws:
IllegalAccessException- when user is not an allowed to access one of ownerIds events
-
countEventDatePolls
Count pending date polls where the current user is invited- Parameters:
ownerIds-ListofIdentitytechnical identifierattendeeId- userIdentityidentifier- Returns:
Listdate pollEventfor user- Throws:
IllegalAccessException- when user is not an allowed to access one of ownerIds events
-
getPendingEvents
List<Event> getPendingEvents(List<Long> ownerIds, long userIdentityId, ZoneId userTimeZone, int offset, int limit) throws Exception Retrieve pending events that the selected user didn't answered yet- Parameters:
ownerIds-ListofIdentitytechnical identifieruserIdentityId- userIdentityidentifieruserTimeZone- User time zoneoffset- offset of the events to retrievelimit- Limit of events to retrieve- Returns:
ListofEvent- Throws:
IllegalAccessException- when user is not an allowed to access one of ownerIds eventsException
-
countPendingEvents
Count pending events that the selected user didn't answered yet- Parameters:
ownerIds-ListofIdentitytechnical identifieruserIdentityId- userIdentityidentifier- Returns:
- pending events count
- Throws:
IllegalAccessException- when user is not an allowed to access one of ownerIds eventsException
-