Class Ical2BwEvent

java.lang.Object
org.bedework.convert.ical.IcalUtil
org.bedework.convert.ical.Ical2BwEvent

public class Ical2BwEvent extends IcalUtil
Class to provide utility methods for translating to BwEvent from ical4j classes
Author:
Mike Douglass douglm rpi.edu
  • Constructor Details

    • Ical2BwEvent

      public Ical2BwEvent()
  • Method Details

    • toEvent

      public static org.bedework.util.misc.response.GetEntityResponse<EventInfo> toEvent(IcalCallback cb, BwCalendar cal, Icalendar ical, net.fortuna.ical4j.model.Component val, boolean mergeAttendees)
      We are going to try to construct a BwEvent object from a VEvent. This may represent a new event or an update to a pre-existing event. In any case, the VEvent probably has insufficient information to completely reconstitute the event object so we'll get the uid first and retrieve the event if it exists.

      To put it another way we're doing a diff then update.

      If it doesn't exist, we'll first fill in the appropriate fields, (non-public, creator, created etc) then for both cases update the remaining fields from the VEvent.

      Recurring events present some challenges. If there is no recurrence id the vevent represents the master entity which defines the recurrence rules. If a recurrence id is present then the vevent represents a recurrence instance override and we should not attempt to retrieve the actual object but the referenced instance.

      Also, note that we sorted the components first so we get the master before any instances.

      If DTSTART, RRULE, EXRULE have changed (also RDATE, EXDATE?) then any existing overrides are unusable. We should delete all overrides and replace with new ones.

      For an update we have to keep track of which fields were present in the vevent and set all absent fields to null in the BwEvent.

      Parameters:
      cb - IcalCallback object
      cal - Needed so we can retrieve the event.
      ical - Icalendar we are converting into. We check its events for overrides.
      val - VEvent object
      mergeAttendees - True if we should only update our own attendee.
      Returns:
      Response with status and EventInfo object representing new entry or updated entry