Class AgendaEventMcpTool
- All Implemented Interfaces:
io.meeds.mcp.server.plugin.McpToolPlugin
-
Field Summary
Fields inherited from interface io.meeds.mcp.server.plugin.McpToolPlugin
DEFAULT_LIMIT, DEFAULT_OFFSET -
Constructor Summary
ConstructorsConstructorDescriptionAgendaEventMcpTool(org.exoplatform.agenda.service.AgendaCalendarService agendaCalendarService, org.exoplatform.agenda.service.AgendaEventService agendaEventService, org.exoplatform.agenda.service.AgendaAvailabilityService agendaAvailabilityService, org.exoplatform.agenda.service.AgendaScheduleConflictService agendaScheduleConflictService, org.exoplatform.agenda.service.AgendaEventConferenceService agendaEventConferenceService, org.exoplatform.agenda.service.AgendaEventAttendeeService agendaEventAttendeeService, org.exoplatform.agenda.service.AgendaEventDatePollService agendaEventDatePollService, org.exoplatform.agenda.service.AgendaEventReminderService agendaEventReminderService, org.exoplatform.agenda.service.AgendaRemoteEventService agendaRemoteEventService, org.exoplatform.agenda.service.AgendaUserSettingsService agendaUserSettingsService, org.exoplatform.portal.config.UserPortalConfigService portalConfigService, org.exoplatform.social.core.profileproperty.ProfilePropertyService profilePropertyService, io.meeds.portal.permlink.service.PermanentLinkService permanentLinkService, io.meeds.social.translation.service.TranslationService translationService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.portal.config.UserACL userAcl) -
Method Summary
Modifier and TypeMethodDescriptionacceptAgendaEventInvitation(Long eventId) Answers Yes to an event as the current user, and reads the event back, asrespondToAgendaEvent(Long, String, String)does: on a date whose seats are all taken, the Yes joins the waiting list, which the answer read back says.voidcancelAgendaEvent(Long eventId, String occurrenceId) confirmDatePoll(Long dateOptionId) Confirms a date poll on one of its proposed dates, which turns it into a confirmed event on that date, and reports the attendees' busy times in that window.createAgendaEvent(Long spaceId, String summary, String description, String location, String start, String end, List<String> attendeeUsernames, String recurrenceFrequency, Integer recurrenceInterval, String recurrenceUntil, Integer recurrenceCount, Boolean failOnConflict, String space) Creates an agenda event, optionally recurrent, with a server-side conflict report over its attendees.createDatePoll(Long spaceId, String title, List<String> proposedSlots, List<String> attendeeUsernames, String description, Boolean rankSlotsByAvailability, String space) Create a date poll: a TENTATIVE event carrying several proposed slots that attendees can vote on.voiddeclineAgendaEventInvitation(Long eventId, String occurrenceId) voiddeleteAgendaEvent(Long eventId) getAgendaEventById(long eventId) getAgendaEvents(String start, String end, Long spaceId, Integer limit) Lists the current user's events from a start date, up to an end date or a limit.Returns each named user's busy and free time blocks over a window.getDatePollResults(long eventId) getEventAttendees(long eventId) getEventConference(long eventId) getScheduleConflicts(String start, String end) protected LonginviteSpaceToAgendaEvent(Long eventId, Long spaceId) Invites a space the current user can access to an event the current user can edit, and sends the invitation to its members; a space already invited is neither added again nor notified again.inviteUsersToAgendaEvent(Long eventId, List<String> attendeeUsernames) Invites users to an event the current user can edit, and sends the invitation to the newly invited ones only; users already invited are neither added again nor notified again.protected booleanrespondToAgendaEvent(Long eventId, String response, String comment) searchAgendaEvents(String query, String start, String end, Long spaceId) Keyword search over the agenda events the current user can access, optionally restricted to a space.setEventConference(Long eventId, String url, String type) setEventReminders(Long eventId, List<String> reminders) suggestMeetingTime(List<String> attendees, Integer durationMinutes, String windowStart, String windowEnd, String constraints, Long spaceId) Suggests candidate slots of at leastduration_minutesover which every attendee is free.updateAgendaEvent(Long eventId, String summary, String description, String location, String start, String end, String recurrenceFrequency, Integer recurrenceInterval, String recurrenceUntil, Integer recurrenceCount, Boolean failOnConflict) Updates an agenda event: only the provided fields change, and its recurrence may be set again.voteDatePoll(Long eventId, List<Long> acceptedSlotIds) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.meeds.mcp.server.plugin.McpToolPlugin
getCurrentUserAclIdentity, getCurrentUserLocale, getCurrentUserLocale, getCurrentUserName, getLocale
-
Constructor Details
-
AgendaEventMcpTool
@Autowired public AgendaEventMcpTool(org.exoplatform.agenda.service.AgendaCalendarService agendaCalendarService, org.exoplatform.agenda.service.AgendaEventService agendaEventService, org.exoplatform.agenda.service.AgendaAvailabilityService agendaAvailabilityService, org.exoplatform.agenda.service.AgendaScheduleConflictService agendaScheduleConflictService, org.exoplatform.agenda.service.AgendaEventConferenceService agendaEventConferenceService, org.exoplatform.agenda.service.AgendaEventAttendeeService agendaEventAttendeeService, org.exoplatform.agenda.service.AgendaEventDatePollService agendaEventDatePollService, org.exoplatform.agenda.service.AgendaEventReminderService agendaEventReminderService, org.exoplatform.agenda.service.AgendaRemoteEventService agendaRemoteEventService, org.exoplatform.agenda.service.AgendaUserSettingsService agendaUserSettingsService, org.exoplatform.portal.config.UserPortalConfigService portalConfigService, org.exoplatform.social.core.profileproperty.ProfilePropertyService profilePropertyService, io.meeds.portal.permlink.service.PermanentLinkService permanentLinkService, io.meeds.social.translation.service.TranslationService translationService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.portal.config.UserACL userAcl)
-
-
Method Details
-
getAgendaEvents
public AgendaEventCollectionModel getAgendaEvents(String start, String end, Long spaceId, Integer limit) throws IllegalAccessException Lists the current user's events from a start date, up to an end date or a limit. With aspaceId, only the events of that space's calendar are listed, and none when the space is missing or the user can't view it.- Parameters:
start- the window start, now when blankend- the window end, or blank to use the limitspaceId- the space to restrict to, or null or 0 for nonelimit- the maximum number of events- Returns:
- the events of the window
- Throws:
IllegalAccessException- when the user may not read the events
-
getAgendaEventById
public AgendaEventModel getAgendaEventById(long eventId) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-
createAgendaEvent
public AgendaEventModel createAgendaEvent(Long spaceId, String summary, String description, String location, String start, String end, List<String> attendeeUsernames, String recurrenceFrequency, Integer recurrenceInterval, String recurrenceUntil, Integer recurrenceCount, Boolean failOnConflict, String space) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException, org.exoplatform.agenda.exception.AgendaException Creates an agenda event, optionally recurrent, with a server-side conflict report over its attendees. WhenfailOnConflictis true and at least one attendee is busy or tentative in the window, creation is aborted.The event goes to the space calendar that
spaceIdorspacenames, which requires the right to write in that space; with neither, it goes to the caller's own personal calendar.- Parameters:
spaceId- the space whose calendar receives the event, or nullsummary- the event's titledescription- the event's descriptionlocation- the event's locationstart- the start date-time (ISO)end- the end date-time (ISO)attendeeUsernames- the attendees' usernamesrecurrenceFrequency- the recurrence frequency, or null for a single eventrecurrenceInterval- the recurrence intervalrecurrenceUntil- the recurrence end daterecurrenceCount- the number of occurrencesfailOnConflict- whether an attendee's conflict aborts the creationspace- the name of the space whose calendar receives the event, or null- Returns:
- the created event, with its conflict report unless the call is limited to a space
- Throws:
IllegalAccessException- when the caller may not write in the named spaceorg.exoplatform.commons.exception.ObjectNotFoundException- when the named space does not existorg.exoplatform.agenda.exception.AgendaException- when the event is invalid
-
declineAgendaEventInvitation
public void declineAgendaEventInvitation(Long eventId, String occurrenceId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException - Throws:
IllegalAccessExceptionorg.exoplatform.commons.exception.ObjectNotFoundException
-
cancelAgendaEvent
public void cancelAgendaEvent(Long eventId, String occurrenceId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException, org.exoplatform.agenda.exception.AgendaException - Throws:
IllegalAccessExceptionorg.exoplatform.commons.exception.ObjectNotFoundExceptionorg.exoplatform.agenda.exception.AgendaException
-
acceptAgendaEventInvitation
public AgendaEventModel acceptAgendaEventInvitation(Long eventId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException Answers Yes to an event as the current user, and reads the event back, asrespondToAgendaEvent(Long, String, String)does: on a date whose seats are all taken, the Yes joins the waiting list, which the answer read back says.- Parameters:
eventId- the event's identifier- Returns:
- the event as the user now reads it
- Throws:
IllegalAccessException- when the user may not access the event, or may not answer it: not invited, and the event isn't open to themorg.exoplatform.commons.exception.ObjectNotFoundException- when the event does not exist
-
inviteUsersToAgendaEvent
public AgendaEventModel inviteUsersToAgendaEvent(Long eventId, List<String> attendeeUsernames) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException Invites users to an event the current user can edit, and sends the invitation to the newly invited ones only; users already invited are neither added again nor notified again. In a call limited to a space, every invited user must be a member of that space.- Parameters:
eventId- the eventattendeeUsernames- the logins to invite- Returns:
- the event
- Throws:
IllegalAccessException- when the current user can't edit the event, or, in a call limited to a space, a user isn't a member of it or the call's space can't be readorg.exoplatform.commons.exception.ObjectNotFoundException- when the event doesn't exist
-
inviteSpaceToAgendaEvent
public AgendaEventModel inviteSpaceToAgendaEvent(Long eventId, Long spaceId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException Invites a space the current user can access to an event the current user can edit, and sends the invitation to its members; a space already invited is neither added again nor notified again. In a call limited to a space, only that space can be invited.- Parameters:
eventId- the eventspaceId- the space to invite- Returns:
- the event
- Throws:
IllegalAccessException- when the current user can't edit the event or access the space, or, in a call limited to a space, the space is another one or the call's space can't be readorg.exoplatform.commons.exception.ObjectNotFoundException- when the event doesn't exist
-
updateAgendaEvent
public AgendaEventModel updateAgendaEvent(Long eventId, String summary, String description, String location, String start, String end, String recurrenceFrequency, Integer recurrenceInterval, String recurrenceUntil, Integer recurrenceCount, Boolean failOnConflict) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException, org.exoplatform.agenda.exception.AgendaException Updates an agenda event: only the provided fields change, and its recurrence may be set again. It reports the attendees' busy times in the event's window, unless the call is limited to a space: the report reads the attendees' own agendas, beyond the space. When fail_on_conflict is true and an attendee is busy or tentative in the window, the update is aborted; a call limited to a space can't ask for that.- Parameters:
eventId- the eventsummary- its new title, unchanged when blankdescription- its new description, unchanged when nulllocation- its new location, unchanged when nullstart- its new start, unchanged when blankend- its new end, unchanged when blankrecurrenceFrequency- its recurrence frequency, none to keep itrecurrenceInterval- its recurrence intervalrecurrenceUntil- the end of its recurrencerecurrenceCount- its number of occurrencesfailOnConflict- true to abort the update when an attendee is busy- Returns:
- the updated event, with its conflicts report unless the call is limited to a space
- Throws:
IllegalAccessException- when the current user can't edit the eventorg.exoplatform.commons.exception.ObjectNotFoundException- when the event doesn't existorg.exoplatform.agenda.exception.AgendaException- when the event can't be saved
-
deleteAgendaEvent
public void deleteAgendaEvent(Long eventId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException - Throws:
IllegalAccessExceptionorg.exoplatform.commons.exception.ObjectNotFoundException
-
createDatePoll
public DatePollModel createDatePoll(Long spaceId, String title, List<String> proposedSlots, List<String> attendeeUsernames, String description, Boolean rankSlotsByAvailability, String space) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException, org.exoplatform.agenda.exception.AgendaException Create a date poll: a TENTATIVE event carrying several proposed slots that attendees can vote on. Each proposed slot is a "<startRFC3339>|<endRFC3339>" string. When rank_slots_by_availability is true, slots are ordered so the ones with the most available internal attendees come first. Every poll must belong to a space: pass either space_id or a space name via the 'space' parameter (resolved to resolvedSpaceId).- Throws:
IllegalAccessExceptionorg.exoplatform.commons.exception.ObjectNotFoundExceptionorg.exoplatform.agenda.exception.AgendaException
-
voteDatePoll
public DatePollModel voteDatePoll(Long eventId, List<Long> acceptedSlotIds) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-
getDatePollResults
public DatePollModel getDatePollResults(long eventId) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-
confirmDatePoll
public AgendaEventModel confirmDatePoll(Long dateOptionId) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Confirms a date poll on one of its proposed dates, which turns it into a confirmed event on that date, and reports the attendees' busy times in that window. In a call limited to a space, the report is left out: it reads the attendees' own agendas, beyond the space.- Parameters:
dateOptionId- the chosen date option- Returns:
- the confirmed event, with its conflicts report unless the call is limited to a space
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the date option doesn't existIllegalAccessException- when the current user can't edit the event
-
getScopeSpaceId
- Returns:
- the space the current call is limited to, null when it isn't
- Throws:
IllegalStateException- when the call's identity can't be read
-
isSpaceScoped
protected boolean isSpaceScoped()- Returns:
- true when the current call is limited to a space; also true when its identity can't be read, which a limited call must never be taken for the opposite of
-
getAvailability
public List<AvailabilityModel> getAvailability(List<String> usernames, String start, String end, Long spaceId) throws IllegalAccessException Returns each named user's busy and free time blocks over a window.Glue only: usernames and RFC3339 bounds are resolved here, the ACL, the sharing setting and the free/busy algebra all belong to
AgendaAvailabilityService. Asking about a user who does not disclose their busy time to the caller is refused, not silently omitted: an omitted user would read as one with nothing in their calendar. With a space, every user must be one of its members (checkSpaceMembers(Long, List)).- Parameters:
usernames- the users to report onstart- window start, RFC3339end- window end, RFC3339spaceId- the space whose members the users must all be, null for none; a call limited to a space always has that space- Returns:
- one entry per username that resolved to an identity
- Throws:
IllegalAccessException- when the caller may not read one of them, one of them isn't a member of the space, the caller can't reach the space, or the call is limited to another space or its identity can't be readIllegalArgumentException- when a mandatory argument is missing or invalid, or the space doesn't exist
-
suggestMeetingTime
public List<TimeBlockModel> suggestMeetingTime(List<String> attendees, Integer durationMinutes, String windowStart, String windowEnd, String constraints, Long spaceId) throws IllegalAccessException Suggests candidate slots of at leastduration_minutesover which every attendee is free.Glue only. Note that this refuses outright when one attendee's availability is not disclosed to the caller — whether because the calendar ACL says so or because that attendee shares their busy time more narrowly: a suggestion computed from a subset of the attendees would read as a whole answer.
- Parameters:
attendees- the users who must all be freedurationMinutes- the wanted slot length, in minuteswindowStart- earliest acceptable start, RFC3339windowEnd- latest acceptable end, RFC3339constraints- optional free text; "mornings" and "afternoons" are honouredspaceId- the space whose members the attendees must all be, null for none; a call limited to a space always has that space- Returns:
- the candidate slots, earliest first
- Throws:
IllegalAccessException- when the caller may not read one of them, one of them isn't a member of the space, the caller can't reach the space, or the call is limited to another space or its identity can't be readIllegalArgumentException- when a mandatory argument is missing or invalid, or the space doesn't exist
-
getEventAttendees
- Throws:
IllegalAccessException
-
respondToAgendaEvent
public AgendaEventModel respondToAgendaEvent(Long eventId, String response, String comment) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-
setEventReminders
public List<String> setEventReminders(Long eventId, List<String> reminders) throws IllegalAccessException, org.exoplatform.agenda.exception.AgendaException - Throws:
IllegalAccessExceptionorg.exoplatform.agenda.exception.AgendaException
-
getEventConference
- Throws:
IllegalAccessException
-
setEventConference
public ConferenceModel setEventConference(Long eventId, String url, String type) throws IllegalAccessException - Throws:
IllegalAccessException
-
searchAgendaEvents
public List<AgendaEventModel> searchAgendaEvents(String query, String start, String end, Long spaceId) Keyword search over the agenda events the current user can access, optionally restricted to a space. The search index has no date-range filter, so start and end are applied as a post-filter here. With aspaceId, only the events of that space's own calendar are kept: the index matches an event that merely invites the space too, and that one belongs to the owner of its calendar. None when the space is missing or the user can't view it.- Parameters:
query- the keywords, mandatorystart- the window start, or blank for noneend- the window end, or blank for nonespaceId- the space to restrict to, or null or 0 for none- Returns:
- the matching events
-
getScheduleConflicts
public ScheduleConflictsModel getScheduleConflicts(String start, String end) throws IllegalAccessException - Throws:
IllegalAccessException
-