Class AgendaEventMcpTool

java.lang.Object
org.exoplatform.agenda.mcp.AgendaEventMcpTool
All Implemented Interfaces:
io.meeds.mcp.server.plugin.McpToolPlugin

@Service @Profile("mcp-server") public class AgendaEventMcpTool extends Object implements io.meeds.mcp.server.plugin.McpToolPlugin
  • 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.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
      Throws:
      IllegalAccessException
    • getAgendaEventById

      public AgendaEventModel getAgendaEventById(long eventId) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • 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. When failOnConflict is true and at least one attendee is busy or tentative in the window, creation is aborted.

      The event goes to the space calendar that spaceId or space names, 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 null
      summary - the event's title
      description - the event's description
      location - the event's location
      start - the start date-time (ISO)
      end - the end date-time (ISO)
      attendeeUsernames - the attendees' usernames
      recurrenceFrequency - the recurrence frequency, or null for a single event
      recurrenceInterval - the recurrence interval
      recurrenceUntil - the recurrence end date
      recurrenceCount - the number of occurrences
      failOnConflict - whether an attendee's conflict aborts the creation
      space - the name of the space whose calendar receives the event, or null
      Returns:
      the created event, with its conflict report
      Throws:
      IllegalAccessException - when the caller may not write in the named space
      org.exoplatform.commons.exception.ObjectNotFoundException - when the named space does not exist
      org.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:
      IllegalAccessException
      org.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:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
      org.exoplatform.agenda.exception.AgendaException
    • acceptAgendaEventInvitation

      public void acceptAgendaEventInvitation(Long eventId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • inviteUsersToAgendaEvent

      public AgendaEventModel inviteUsersToAgendaEvent(Long eventId, List<String> attendeeUsernames) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • inviteSpaceToAgendaEvent

      public AgendaEventModel inviteSpaceToAgendaEvent(Long eventId, Long spaceId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • 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
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
      org.exoplatform.agenda.exception.AgendaException
    • deleteAgendaEvent

      public void deleteAgendaEvent(Long eventId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.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:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
      org.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.ObjectNotFoundException
      IllegalAccessException
    • getDatePollResults

      public DatePollModel getDatePollResults(long eventId) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • confirmDatePoll

      public AgendaEventModel confirmDatePoll(Long dateOptionId) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • getAvailability

      public List<AvailabilityModel> getAvailability(List<String> usernames, String start, String end) 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.

      Parameters:
      usernames - the users to report on
      start - window start, RFC3339
      end - window end, RFC3339
      Returns:
      one entry per username that resolved to an identity
      Throws:
      IllegalAccessException - when the caller may not read one of them
    • suggestMeetingTime

      public List<TimeBlockModel> suggestMeetingTime(List<String> attendees, Integer durationMinutes, String windowStart, String windowEnd, String constraints) throws IllegalAccessException
      Suggests candidate slots of at least duration_minutes over 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 free
      durationMinutes - the wanted slot length, in minutes
      windowStart - earliest acceptable start, RFC3339
      windowEnd - latest acceptable end, RFC3339
      constraints - optional free text; "mornings" and "afternoons" are honoured
      Returns:
      the candidate slots, earliest first
      Throws:
      IllegalAccessException - when the caller may not read one attendee
    • getEventAttendees

      public List<AgendaEventAttendeeModel> getEventAttendees(long eventId) throws IllegalAccessException
      Throws:
      IllegalAccessException
    • respondToAgendaEvent

      public AgendaEventModel respondToAgendaEvent(Long eventId, String response, String comment) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • setEventReminders

      public List<String> setEventReminders(Long eventId, List<String> reminders) throws IllegalAccessException, org.exoplatform.agenda.exception.AgendaException
      Throws:
      IllegalAccessException
      org.exoplatform.agenda.exception.AgendaException
    • getEventConference

      public ConferenceModel getEventConference(long eventId) throws IllegalAccessException
      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)
    • getScheduleConflicts

      public ScheduleConflictsModel getScheduleConflicts(String start, String end) throws IllegalAccessException
      Throws:
      IllegalAccessException