Class Ical2BwEvent
- Author:
- Mike Douglass douglm rpi.edu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.Methods inherited from class org.bedework.convert.ical.IcalUtil
addParameter, addProperty, addXproperty, getAltRep, getAttachment, getAttendee, getDurationRepeat, getLang, getOptStr, getOptStr, getOrganizer, getParameter, getParameterVal, getProperties, getProperty, getReqStr, getReqStrs, getTrigger, getVlocations, getVoter, getXcomp, initAttendeeVoter, makeDateTime, makeDateTimes, makeDtEnd, makeDtEnd, makeDue, makeXparlist, parseParticipants, parseVpollCandidates, parseVpollVoters, setAttachment, setAttendee, setDates, setOrganizer, setVoter, toVlocation, xpropertiesToIcal
-
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 objectcal- Needed so we can retrieve the event.ical- Icalendar we are converting into. We check its events for overrides.val- VEvent objectmergeAttendees- True if we should only update our own attendee.- Returns:
- Response with status and EventInfo object representing new entry or updated entry
-