Interface AgendaEventAttendeeService
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanRespondToEvent(Event event, long identityId) Checks whether the user may write their own answer on the event, which is the one right that opening an event widens (eXIP 7.3.0.20).org.exoplatform.social.core.identity.model.IdentitydecryptUserIdentity(long eventId, String token, EventAttendeeResponse response) Reads token content and retrieves user Social Identity from email or username contained in token.exportEventAttendees(long eventId, ZonedDateTime occurrenceId, long identityId, Locale locale, ZoneId zoneId) Exports the participant list of one date of an event as a CSV file, the rows the participants drawer shows for that date, in its order.generateEncryptedToken(long eventId, String email) Generates a token that will be used to authenticate user when requesting REST API in anonymous mode.generateEncryptedToken(long eventId, String emailOrUsername, EventAttendeeResponse response) Generates a token that will be used to authenticate user when requesting REST API in anonymous mode.getEventAttendees(long eventId) Return the list of attendees of an eventgetEventAttendees(long eventId, ZonedDateTime occurrenceId, EventAttendeeResponse... responses) Return the list of attendees of an event having a specific responses.getEventAttendees(long eventId, EventAttendeeResponse... responses) Return the list of attendees of an event having a specific responses.getEventResponse(long eventId, ZonedDateTime occurrenceId, long identityId) Retrieves the event response of a user.getSeatCounts(long eventId, ZonedDateTime occurrenceId, long identityId) Counts the seats of one date of an event: on a date with its own row, or on an event of no series, every row of it; on a date of a series with no row of its own, the series' rows valid at that date.getSeriesAttendee(long seriesId, long identityId) Reads the user's rowgetSeriesResponse(long, long)reads the answer of: on a series, the row valid at the date its answer is read at, else, when the user's rows all lie elsewhere, a copy of their first row answeringEventAttendeeResponse.NEEDS_ACTIONwith no answer date; on an event of no series, the user's row.getSeriesAttendees(long seriesId) Reads the attendees of an event as a whole, each once: on a series, every attendee's row asgetSeriesAttendee(long, long)reads it, an attendee with no row valid at the date its answers are read at being listed as answeringEventAttendeeResponse.NEEDS_ACTION; on an event of no series, its rows.getSeriesResponse(long seriesId, long identityId) Reads a user's answer to an event as a whole.org.exoplatform.social.core.identity.model.IdentitygetUserIdentityByEmail(String email, long callerIdentityId) Resolves an e-mail address typed to invite someone to the platform user whose address it is: such a person is invited as themselves, never as a guest from outside the platform (eXIP 7.3.0.21, US06).booleanisEventAttendee(long eventId, long identityId) Checks whether the user is an attendee of the event or notvoidresetEventResponses(long eventId, Set<Long> keptIdentityIds) Starts every answer of an event over, as a change of its dates does: each attendee's answer becomesEventAttendeeResponse.NEEDS_ACTION, a place on the waiting list included, on the event and, for a series, on the rows of its dates.saveEventAttendees(Event event, List<EventAttendee> attendees, long creatorIdentityId, boolean sendInvitations, boolean resetResponses, AgendaEventModification eventModifications) voidsendEventResponse(long eventId, long identityId, EventAttendeeResponse response) voidsendEventResponse(long eventId, long identityId, EventAttendeeResponse response, boolean broadcast) sendEventResponse(long eventId, ZonedDateTime occurrenceId, long identityId, EventAttendeeResponse response, boolean broadcast) Sends an event response for one date of a series, or for the whole event when no date is given.voidsendInvitations(Event event, List<EventAttendee> eventAttendees, AgendaEventModification eventModifications) Sends an invitation to event attendees of type: user, space or external user.voidsendUpcomingEventResponse(long eventId, ZonedDateTime occurrenceId, long identityId, EventAttendeeResponse response) Sends an event response for a recurrent event starting from a specific occurrencesendUpcomingEventResponse(long eventId, ZonedDateTime occurrenceId, long identityId, EventAttendeeResponse response, boolean broadcast) Sends an event response for a recurrent event starting from a specific occurrence, and returns what it stored.
-
Method Details
-
getEventAttendees
Return the list of attendees of an event- Parameters:
eventId- agendaEventidentifier- Returns:
EventAttendeeList
-
getEventAttendees
List<EventAttendee> getEventAttendees(long eventId, ZonedDateTime occurrenceId, EventAttendeeResponse... responses) Return the list of attendees of an event having a specific responses.- Parameters:
eventId- agendaEventidentifieroccurrenceId- event occurrence idresponses- Array of answers of attendees to retrieve- Returns:
ListofEventAttendee
-
getEventAttendees
Return the list of attendees of an event having a specific responses.- Parameters:
eventId- agendaEventidentifierresponses- Array of answers of attendees to retrieve- Returns:
EventAttendeeList
-
sendInvitations
void sendInvitations(Event event, List<EventAttendee> eventAttendees, AgendaEventModification eventModifications) Sends an invitation to event attendees of type: user, space or external user.- Parameters:
event-EventeventAttendees-ListofEventAttendeeof the eventeventModifications-AgendaEventModificationcontains aSetofAgendaEventModificationTypeto indicate event modification types: fields modifications, creation or deletion
-
saveEventAttendees
Set<AgendaEventModificationType> saveEventAttendees(Event event, List<EventAttendee> attendees, long creatorIdentityId, boolean sendInvitations, boolean resetResponses, AgendaEventModification eventModifications) - Parameters:
event-Eventto attach attendeesattendees-ListofEventAttendeeto save for eventcreatorIdentityId- technical identifier ifIdentityupdating eventsendInvitations- whether send invitations to other attendees or notresetResponses- whether reset attendees responses or not to defaultEventAttendeeResponse.NEEDS_ACTION. Whatever the value of this parameter, the response of a newly added attendee is forced toEventAttendeeResponse.NEEDS_ACTIONwhen it isn't the attendee designated by creatorIdentityId, since a user can only answer an invitation for himselfeventModifications-AgendaEventModificationcontains aSetofAgendaEventModificationTypeto indicate event modification types: fields modifications, creation or deletion- Returns:
SetofAgendaEventModificationTypecontaining modifications made on event attendees
-
generateEncryptedToken
Generates a token that will be used to authenticate user when requesting REST API in anonymous mode.- Parameters:
eventId-Eventtechnical identifieremail- User email- Returns:
- encrypted token containing "EVENT_ID|EMAIL||EXPIRY", or null when the event carries no date to bound the token by
-
generateEncryptedToken
Generates a token that will be used to authenticate user when requesting REST API in anonymous mode.The token expires with the meeting it answers. The expiry is the last field of the payload, an epoch second derived from the event by
Utils.invitationTokenExpiry; it is a pure function of the event, so the same event and answer always yield the same token, which is what lets the calendar copy carry these links in a DESCRIPTION without being rewritten on every sweep (EXO-89752, EXO-89753).- Parameters:
eventId-Eventtechnical identifieremailOrUsername- User name or emailresponse-EventAttendeeResponsevalue for chosen answer, null for a token that authenticates without carrying an answer- Returns:
- encrypted token containing "EVENT_ID|EMAIL|ATTENDEE_RESPONSE|EXPIRY", the answer field being empty when there is none; null when the event carries no date to bound the token by, in which case no link should be offered
-
decryptUserIdentity
org.exoplatform.social.core.identity.model.Identity decryptUserIdentity(long eventId, String token, EventAttendeeResponse response) throws IllegalAccessException Reads token content and retrieves user Social Identity from email or username contained in token. An internal attendee is retrieved from the organization identity provider, an external attendee - a guest invited by mail address only - is retrieved among the guest attendees of the event. No identity is ever created by this lookup, so a token carrying a mail address which attends nothing resolves to null.A token whose meeting is over is refused, with
EventInvitationExpiredExceptionso that a caller can tell a lapsed link apart from a forged one. A token minted before EXO-89752 carries no expiry of its own and is bounded by asking the event for the same bound at this point, so no invitation already delivered stops working and none of them stays replayable either.- Parameters:
eventId-Eventtechnical identifiertoken- encrypted tokenresponse-EventAttendeeResponsevalue for chosen answer- Returns:
Identityof user, or null when the token designates neither an existing internal user nor a guest attendee of the event- Throws:
IllegalAccessException- when the token has bad format, designates another event or another answer, or - asEventInvitationExpiredException- when the meeting it answers is over
-
getEventResponse
EventAttendeeResponse getEventResponse(long eventId, ZonedDateTime occurrenceId, long identityId) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Retrieves the event response of a user. If the user didn't responded to the event, the default valueEventAttendeeResponse.NEEDS_ACTIONwill be retrieved. Read with no occurrence id on a series, it is the user's answer to the series as a whole, asgetSeriesResponse(long, long)reads it.- Parameters:
eventId- Technical identifier ofEventoccurrenceId- event occurrence id, or nullidentityId-Identitytechnical identifier of user- Returns:
EventAttendeeResponse, no null value is returned- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when event with provided identifier doesn't existsIllegalAccessException- when the user may not answer the event: not an attendee, and the event isn't open to them (seecanRespondToEvent(Event, long))
-
sendEventResponse
void sendEventResponse(long eventId, long identityId, EventAttendeeResponse response) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Parameters:
eventId- Technical identifier ofEventidentityId-Identitytechnical identifier of userresponse- User response of typeEventAttendeeResponseto the event. The valueEventAttendeeResponse.NEEDS_ACTIONisn't allowed.- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when event with provided identifier doesn't existsIllegalAccessException- when the user may not answer the event: not an attendee, and the event isn't open to them (seecanRespondToEvent(Event, long))
-
sendUpcomingEventResponse
void sendUpcomingEventResponse(long eventId, ZonedDateTime occurrenceId, long identityId, EventAttendeeResponse response) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Sends an event response for a recurrent event starting from a specific occurrence- Parameters:
eventId- Technical identifier ofEventoccurrenceId- event occurrence ididentityId-Identitytechnical identifier of userresponse- User response of typeEventAttendeeResponseto the event. The valueEventAttendeeResponse.NEEDS_ACTIONisn't allowed.- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when event with provided identifier doesn't existsIllegalAccessException- when the user may not answer the event: not an attendee, and the event isn't open to them (seecanRespondToEvent(Event, long))
-
sendUpcomingEventResponse
EventResponseOutcome sendUpcomingEventResponse(long eventId, ZonedDateTime occurrenceId, long identityId, EventAttendeeResponse response, boolean broadcast) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Sends an event response for a recurrent event starting from a specific occurrence, and returns what it stored.On a series with a capacity limit, a Yes, or
EventAttendeeResponse.WAITINGwhich asks for the same, is decided date by date: stored as a Yes over the dates with a seat free or already held, and asEventAttendeeResponse.WAITINGover the others, one attendee row per run of dates with the same outcome. The answer reaches the row of each date individually modified the user attends, from the date answered from; on the row of one that is over, it is stored as with no limit, aEventAttendeeResponse.WAITINGasked becoming a Yes: no seat is decided there.- Parameters:
eventId- Technical identifier of the seriesoccurrenceId- occurrence id of the date the answer starts fromidentityId-Identitytechnical identifier of userresponse- User response of typeEventAttendeeResponseto the event. The valueEventAttendeeResponse.NEEDS_ACTIONisn't allowed.broadcast- whether the answer is reported as sent by the user- Returns:
- the answer stored at the date answered, and the first date it left waiting
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when event with provided identifier doesn't existsIllegalAccessException- when the user may not answer the event: not an attendee, and the event isn't open to them (seecanRespondToEvent(Event, long))
-
getSeriesResponse
EventAttendeeResponse getSeriesResponse(long seriesId, long identityId) throws org.exoplatform.commons.exception.ObjectNotFoundException Reads a user's answer to an event as a whole. On a series, where a user may hold several rows, each over a range of its dates, it is the answer valid at the next date the series carries, the first that is neither cancelled nor over; when none remains, at the last date it carries; when every date is cancelled, at the last date its rule produces. Validity is judged on the date's occurrence id. On an event of no series, it is the user's row.It reads the stored answer and checks no right: the caller checks the right to read the event.
- Parameters:
seriesId- Technical identifier of the series, or of the eventidentityId-Identitytechnical identifier of user- Returns:
- the answer,
EventAttendeeResponse.NEEDS_ACTIONwhen the user holds none at that date - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when event with provided identifier doesn't exists
-
getSeriesAttendee
EventAttendee getSeriesAttendee(long seriesId, long identityId) throws org.exoplatform.commons.exception.ObjectNotFoundException Reads the user's rowgetSeriesResponse(long, long)reads the answer of: on a series, the row valid at the date its answer is read at, else, when the user's rows all lie elsewhere, a copy of their first row answeringEventAttendeeResponse.NEEDS_ACTIONwith no answer date; on an event of no series, the user's row. It checks no right.- Parameters:
seriesId- Technical identifier of the series, or of the eventidentityId-Identitytechnical identifier of user- Returns:
- the row, null when the user holds none on the event
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when event with provided identifier doesn't exists
-
getSeriesAttendees
List<EventAttendee> getSeriesAttendees(long seriesId) throws org.exoplatform.commons.exception.ObjectNotFoundException Reads the attendees of an event as a whole, each once: on a series, every attendee's row asgetSeriesAttendee(long, long)reads it, an attendee with no row valid at the date its answers are read at being listed as answeringEventAttendeeResponse.NEEDS_ACTION; on an event of no series, its rows. It checks no right.- Parameters:
seriesId- Technical identifier of the series, or of the event- Returns:
- the rows, in the order the attendees' rows are stored
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when event with provided identifier doesn't exists
-
getSeatCounts
EventSeatCounts getSeatCounts(long eventId, ZonedDateTime occurrenceId, long identityId) throws org.exoplatform.commons.exception.ObjectNotFoundException Counts the seats of one date of an event: on a date with its own row, or on an event of no series, every row of it; on a date of a series with no row of its own, the series' rows valid at that date. With no date on a series, the date its answers are read at (seegetSeriesResponse(long, long)). It checks no right.- Parameters:
eventId- Technical identifier of the event, of a series, or of the row of one of its datesoccurrenceId- the occurrence id of a date of the series, or nullidentityId-Identitytechnical identifier of the user whose rank on the waiting list is read, 0 for none- Returns:
- the counts at the date, with the user's rank when they wait there
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when event with provided identifier doesn't exists
-
exportEventAttendees
EventAttendeesExport exportEventAttendees(long eventId, ZonedDateTime occurrenceId, long identityId, Locale locale, ZoneId zoneId) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Exports the participant list of one date of an event as a CSV file, the rows the participants drawer shows for that date, in its order.- The date's list: on a date with its own row, that row's attendees; on
a date of a series with no row of its own, the series' attendees valid at
that date; with no date on a series, its attendees as a whole (see
getSeriesAttendees(long)); on an event of no series, its attendees. - The order: the event's creator first, then by name in the collation of the locale, the waiting list last in the order its people asked.
- One row per attendee, with their name, their email and their answer. A space invited as a whole is named after the space, has no email and answers No answer; an external guest is named after their address. The email column exists only while the platform displays the email profile property, and a user who hid theirs reads Hidden there.
- The header and the answers are labelled in the locale; every cell is quoted, and a cell starting with a character a spreadsheet would read as a formula is neutralised.
- The file is named after the day of the export in the zone and the event's title.
- Parameters:
eventId- Technical identifier of the event, of a series, or of the row of one of its datesoccurrenceId- the occurrence id of a date of the series, or nullidentityId-Identitytechnical identifier of the user who exports, who must be allowed to update the date served (seeAgendaEventService#canUpdateEvent)locale- the user's locale, labelling the header and the answerszoneId- the user's time zone, dating the file name- Returns:
- the file
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the event doesn't exist, or the date was cancelledIllegalAccessException- when the user may not update the date servedIllegalArgumentException- with the messageagenda.export.datePollwhen the event is a date poll
- The date's list: on a date with its own row, that row's attendees; on
a date of a series with no row of its own, the series' attendees valid at
that date; with no date on a series, its attendees as a whole (see
-
sendEventResponse
void sendEventResponse(long eventId, long identityId, EventAttendeeResponse response, boolean broadcast) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Parameters:
eventId- Technical identifier ofEventidentityId-Identitytechnical identifier of userresponse- User response of typeEventAttendeeResponseto the event. The valueEventAttendeeResponse.NEEDS_ACTIONisn't allowed.broadcast- whether broadcast event about this change or not- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when event with provided identifier doesn't existsIllegalAccessException- when the user may not answer the event: not an attendee, and the event isn't open to them (seecanRespondToEvent(Event, long))
-
sendEventResponse
EventResponseOutcome sendEventResponse(long eventId, ZonedDateTime occurrenceId, long identityId, EventAttendeeResponse response, boolean broadcast) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Sends an event response for one date of a series, or for the whole event when no date is given. The date's own row is found, or created as a copy of the series when the date has none, under the lock of the series, then answered: a caller never creates the row itself before answering.On an event with a capacity limit, a Yes, or
EventAttendeeResponse.WAITINGwhich asks for the same, is stored as a Yes when a seat is free at the date or the attendee already holds one, and asEventAttendeeResponse.WAITINGotherwise. An answer to every date of a series reaches the row of each date individually modified the user attends; on the row of one that is over, it is stored as with no limit, aEventAttendeeResponse.WAITINGasked becoming a Yes: no seat is decided there.- Parameters:
eventId- Technical identifier of the series, or of the event when no date is givenoccurrenceId- occurrence id of the date answered, null to answer every date of the eventidentityId-Identitytechnical identifier of userresponse- User response of typeEventAttendeeResponseto the event. The valueEventAttendeeResponse.NEEDS_ACTIONisn't allowed.broadcast- whether the answer is reported as sent by the user- Returns:
- the answer stored, and the first date it left waiting
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when event with provided identifier doesn't existsIllegalAccessException- when the user may not answer the event: not an attendee, and the event isn't open to them (seecanRespondToEvent(Event, long))
-
resetEventResponses
void resetEventResponses(long eventId, Set<Long> keptIdentityIds) throws org.exoplatform.commons.exception.ObjectNotFoundException Starts every answer of an event over, as a change of its dates does: each attendee's answer becomesEventAttendeeResponse.NEEDS_ACTION, a place on the waiting list included, on the event and, for a series, on the rows of its dates. A reset frees no seat: nobody is promoted, and no answer is reported as sent by its attendee. The pools forget that they reached their capacity, and so does the series through which a date holding the series' limit reports.- Parameters:
eventId- Technical identifier ofEventkeptIdentityIds- identities whose answer is kept, typically the user who made the change- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when event with provided identifier doesn't exists
-
isEventAttendee
boolean isEventAttendee(long eventId, long identityId) Checks whether the user is an attendee of the event or not- Parameters:
eventId- Technical identifier ofEventidentityId- user name- Returns:
- true if user is an attendee of the event, else return false
-
canRespondToEvent
Checks whether the user may write their own answer on the event, which is the one right that opening an event widens (eXIP 7.3.0.20). Two halves:- the attendee half is exactly
isEventAttendee(long, long)on the event itself, so an exceptional occurrence is checked against its own attendee list, as today; - the open half: the event is open and the user can access its calendar (a member of the owning space). The flag is the event's own: a date individually modified answers with its own value.
- Parameters:
event-Eventto answer, as storedidentityId-Identitytechnical identifier of user- Returns:
- true when the user may send or read an answer on the event, else false
- the attendee half is exactly
-
getUserIdentityByEmail
org.exoplatform.social.core.identity.model.Identity getUserIdentityByEmail(String email, long callerIdentityId) Resolves an e-mail address typed to invite someone to the platform user whose address it is: such a person is invited as themselves, never as a guest from outside the platform (eXIP 7.3.0.21, US06). Only an address the platform displays resolves: none when the platform displays no e-mail address, or when that user hid theirs, so that the lookup never tells who owns an address the platform keeps private. Nor for a caller who is an external user, whom the platform's people search tells no user beyond their connections.- Parameters:
email- an e-mail address, looked up as given and in lower case, each compared as the database collation compares, ignoring case or not; one holding a star never resolvescallerIdentityId- theIdentitytechnical identifier of the user who typed the address- Returns:
- the
Identityof the enabled user whose e-mail address it is, or null when there is none, or when the caller is an external user or no known identity - Throws:
IllegalStateException- when the user directory cannot be read: the address is then neither a user nor a person from outside the platform. The platform's directory also answers so for an address two of its accounts hold, which its lookup by a unique attribute refuses
-