Class AgendaEventIcsMapper

java.lang.Object
org.exoplatform.caldav.service.AgendaEventIcsMapper

@Component public class AgendaEventIcsMapper extends Object
Turns an agenda event into what the ICS engine takes.

This is the seam the engine was deliberately kept clean of. Agenda holds identities as numbers — a creator id, attendee identity ids — while an iCalendar object needs a display name and a mail address, and resolving one into the other means identity services and profile visibility. That resolution lives here, where the services are, so the engine stays a pure function of its argument and stays judgeable against the golden corpus.

An address is never invented. A person whose profile does not expose one is left off the copy entirely rather than given a plausible-looking address: RFC 5545 makes the value a CAL-ADDRESS, and a fabricated one would be forwarded as a reply-to by any client acting on the copy. The roster on the phone may therefore be shorter than the one in eXo, which the URL property links back to in full.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    addressOf(long identityId)
    The profile address a copy names one person by, or null when it names them not at all.
    org.exoplatform.caldav.model.IcsEvent
    toIcsEvent(org.exoplatform.agenda.model.Event event, String icsUid, long pusherIdentityId)
    Maps one agenda event, resolving the identities it references and the address the pushing user's own account answers to.

    Methods inherited from class java.lang.Object

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

    • AgendaEventIcsMapper

      public AgendaEventIcsMapper()
  • Method Details

    • toIcsEvent

      public org.exoplatform.caldav.model.IcsEvent toIcsEvent(org.exoplatform.agenda.model.Event event, String icsUid, long pusherIdentityId)
      Maps one agenda event, resolving the identities it references and the address the pushing user's own account answers to.

      A calendar client decides whether an event is an invitation TO ITS OWNER by matching the ATTENDEE addresses against the ones the account owns. The copy names everyone by their eXo profile address, which the account knows nothing about — so the owner's own line looked like somebody else's and no client offered to answer it. Their line carries the account's own address instead, and only theirs: the other attendees are described to them, not to their server.

      The description is composed here rather than in the writer, from agenda's shared builder, so the copy and the mailed document describe one meeting in one set of words (EXO-89732).

      Parameters:
      event - the agenda event to copy
      icsUid - the UID the copy is written under, which the caller owns — a series and its overrides share one, and it must survive an agenda id changing
      pusherIdentityId - identity of the user whose calendar receives the copy, which decides whether ORGANIZER carries SCHEDULE-AGENT and whose account address names them on the roster. Deliberately not consulted to decide whether there is an organizer at all: that is a property of the event (EXO-89805)
      Returns:
      the event as the ICS engine takes it
    • addressOf

      public String addressOf(long identityId)
      The profile address a copy names one person by, or null when it names them not at all.

      Public because propagating an answer outward has to find that person's ATTENDEE line in an object already on the server. It is deliberately named for what it is and not "the address of" that user, because it is not the only one a copy may carry: the account's own owner is named by the address their CalDAV account answers to, so that a client recognises the meeting as an invitation to itself. Treating this one as authoritative is how the propagation silently matched nothing on a live rig — the caller offers both and lets the object decide.

      The rule that a person with no visible address is left off the copy is the same rule read from the other end: no address here means this mapper wrote no ATTENDEE line for them to rewrite.

      Parameters:
      identityId - the social identity
      Returns:
      the profile mail address, or null when none is visible