Class AgendaInvitationCalendarPlugin

java.lang.Object
org.exoplatform.agenda.plugin.AgendaInvitationCalendarPlugin
All Implemented Interfaces:
org.exoplatform.emailConnector.plugin.InvitationCalendarPlugin

@Service("agendaInvitationCalendarPlugin") @ConditionalOnClass(org.exoplatform.emailConnector.plugin.InvitationCalendarPlugin.class) public class AgendaInvitationCalendarPlugin extends Object implements org.exoplatform.emailConnector.plugin.InvitationCalendarPlugin
Lands, for the mail reader, an invitation the user received by mail in their personal eXo calendar, when no calendar server holds that user's calendar (EXO-90866).

The mail reader finds this bean by type across add-ons and asks the first that holds the user's calendar, alone. So agenda holds it only when no other add-on does: a user whose calendar caldav-integration holds is that add-on's, and landing the invitation here as well would put the meeting twice in eXo. Agenda does not read the other add-on's settings to predict its answer — two predicates drift (EXO-90247) — it asks it, through the same SPI, at the moment the reader asks.

The bean is not created at all on a server without the mail reader (@ConditionalOnClass, read from the class metadata, never loading the class). A @Service with a name of its own, because that is what the bridge exports to the reader's context. The only class of agenda that names a type of the reader's: Spring introspects every method of every bean it creates, so the landing service speaks agenda's own MailInvitation and LandedMailInvitation, and this bean translates both ways. It carries no landing logic: AgendaInvitationLandingService decides and acts.

  • Constructor Summary

    Constructors
    Constructor
    Description
    AgendaInvitationCalendarPlugin(AgendaInvitationLandingService agendaInvitationLandingService, org.springframework.context.ApplicationContext applicationContext)
    Builds the plugin over the landing service and the context the other add-ons' plugins are found in.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.exoplatform.emailConnector.model.HeldInvitation
    held(org.exoplatform.emailConnector.model.InvitationProbe probe)
    The event the user's personal calendar holds for the invitation, when agenda holds that calendar (EXO-90873): the answer as agenda holds it, NEEDS_ACTION told as none.
    boolean
    Whether agenda holds the user's calendar: an enabled user of the platform who connected no remote calendar account to agenda, and whose calendar no other add-on holds.
    org.exoplatform.emailConnector.model.LandedInvitation
    land(org.exoplatform.emailConnector.model.InvitationLanding landing)
    Lands the invitation in the user's personal eXo calendar.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AgendaInvitationCalendarPlugin

      @Autowired public AgendaInvitationCalendarPlugin(AgendaInvitationLandingService agendaInvitationLandingService, org.springframework.context.ApplicationContext applicationContext)
      Builds the plugin over the landing service and the context the other add-ons' plugins are found in.
      Parameters:
      agendaInvitationLandingService - decides and acts
      applicationContext - the Spring context of this WAR, into which the bridge publishes every other WAR's exported beans
  • Method Details

    • holdsCalendarFor

      public boolean holdsCalendarFor(String username)
      Whether agenda holds the user's calendar: an enabled user of the platform who connected no remote calendar account to agenda, and whose calendar no other add-on holds.
      Specified by:
      holdsCalendarFor in interface org.exoplatform.emailConnector.plugin.InvitationCalendarPlugin
      Parameters:
      username - the user's login
      Returns:
      true when the invitation is agenda's to land
    • land

      public org.exoplatform.emailConnector.model.LandedInvitation land(org.exoplatform.emailConnector.model.InvitationLanding landing)
      Lands the invitation in the user's personal eXo calendar.
      Specified by:
      land in interface org.exoplatform.emailConnector.plugin.InvitationCalendarPlugin
      Parameters:
      landing - the invitation, the user and what they asked
      Returns:
      what was done, null when agenda does not hold the user's calendar or there was nothing to do
      Throws:
      IllegalArgumentException - when the invitation cannot be landed as it is
      RuntimeException - when the landing was attempted and failed
    • held

      public org.exoplatform.emailConnector.model.HeldInvitation held(org.exoplatform.emailConnector.model.InvitationProbe probe)
      The event the user's personal calendar holds for the invitation, when agenda holds that calendar (EXO-90873): the answer as agenda holds it, NEEDS_ACTION told as none.
      Specified by:
      held in interface org.exoplatform.emailConnector.plugin.InvitationCalendarPlugin
      Parameters:
      probe - the user and the event's UID
      Returns:
      the event held, null when agenda does not hold the user's calendar or holds no event for the invitation