An Event in Bedework. The event class is actually used to represent most of
the calendaring components as they all require the same sort of searching
capabilities.
Proxies and annotations are used to create an overridden instance or an
annotated event. Pictorially...
*
| Proxy | ref | |
*
|
|
+-->| Annnotation | target | |
*
|
|
+-->| Event |
*
The proxy class checks the annotation for a value and if absent, uses the
target - or event - value.
Immutable values cannot be overridden and need to be set in the annotation
object. An example is the entity type. These are usually primitive types.
Still incomplete but getting there... annotations are used to describe
certain aspects of events to allow the automatic generation of proxy and
annotation classes and of conversion classes, to and from ical and xml.
From RFC2445
A "VEVENT" calendar component is defined by the
following notation:
eventc = "BEGIN" ":" "VEVENT" CRLF
eventprop *alarmc
"END" ":" "VEVENT" CRLF
eventprop = *(
; the following are optional,
; but MUST NOT occur more than once
class / created / description / dtstart / geo /
last-mod / location / organizer / priority /
dtstamp / seq / status / summary / transp /
uid / url / recurid /
; either 'dtend' or 'duration' may appear in
; a 'eventprop', but 'dtend' and 'duration'
; MUST NOT occur in the same 'eventprop'
dtend / duration /
; the following are optional,
; and MAY occur more than once
attach / attendee / categories / comment /
contact / exdate / exrule / rstatus / related /
resources / rdate / rrule / x-prop
)
A "VTODO" calendar component is defined by the
following notation:
todoc = "BEGIN" ":" "VTODO" CRLF
todoprop *alarmc
"END" ":" "VTODO" CRLF
todoprop = *(
; the following are optional,
; but MUST NOT occur more than once
class / completed / created / description / dtstamp /
dtstart / geo / last-mod / location / organizer /
percent / priority / recurid / seq / status /
summary / uid / url /
; either 'due' or 'duration' may appear in
; a 'todoprop', but 'due' and 'duration'
; MUST NOT occur in the same 'todoprop'
due / duration /
; the following are optional,
; and MAY occur more than once
attach / attendee / categories / comment / contact /
exdate / exrule / rstatus / related / resources /
rdate / rrule / x-prop
)
A "VJOURNAL" calendar component is defined by the
following notation:
journalc = "BEGIN" ":" "VJOURNAL" CRLF
jourprop
"END" ":" "VJOURNAL" CRLF
jourprop = *(
; the following are optional,
; but MUST NOT occur more than once
class / created / description / dtstart / dtstamp /
last-mod / organizer / recurid / seq / status /
summary / uid / url /
; the following are optional,
; and MAY occur more than once
attach / attendee / categories / comment /
contact / exdate / exrule / related / rdate /
rrule / rstatus / x-prop
)
Properties common to event, todo and journal
attach VEVENT VTODO VJOURNAL n/a n/a VALARM
attendee VEVENT VTODO VJOURNAL VFREEBUSY n/a VALARM
categories VEVENT VTODO VJOURNAL
class VEVENT VTODO VJOURNAL
comment VEVENT VTODO VJOURNAL VFREEBUSY VTIMEZONE
contact VEVENT VTODO VJOURNAL VFREEBUSY
created VEVENT VTODO VJOURNAL
description VEVENT VTODO VJOURNAL n/a n/a VALARM
dtstamp VEVENT VTODO VJOURNAL VFREEBUSY
dtstart VEVENT VTODO VJOURNAL VFREEBUSY VTIMEZONE
exdate VEVENT VTODO VJOURNAL
exrule VEVENT VTODO VJOURNAL
lastModified VEVENT VTODO VJOURNAL n/a VTIMEZONE
organizer VEVENT VTODO VJOURNAL VFREEBUSY
rdate VEVENT VTODO VJOURNAL n/a VTIMEZONE
recurrenceId VEVENT VTODO VJOURNAL n/a VTIMEZONE
relatedTo VEVENT VTODO VJOURNAL
requestStatus VEVENT VTODO VJOURNAL VFREEBUSY
rrule VEVENT VTODO VJOURNAL n/a VTIMEZONE
sequence VEVENT VTODO VJOURNAL
status VEVENT VTODO VJOURNAL
summary VEVENT VTODO VJOURNAL n/a n/a VALARM
uid VEVENT VTODO VJOURNAL VFREEBUSY
url VEVENT VTODO VJOURNAL VFREEBUSY
Properties in one or more of event, todo (all journal fields are in common set)
completed n/a VTODO
dtend VEVENT n/a n/a VFREEBUSY
due n/a VTODO (same as dtend)
duration VEVENT VTODO n/a VFREEBUSY n/a VALARM
geo VEVENT VTODO
location VEVENT VTODO
percentComplete n/a VTODO
priority VEVENT VTODO
resources VEVENT VTODO
transp VEVENT
Alarm only:
action n/a n/a n/a n/a n/a VALARM
repeat n/a n/a n/a n/a n/a VALARM
trigger n/a n/a n/a n/a n/a VALARM
Freebusy only:
freebusy n/a n/a n/a VFREEBUSY
Timezone only:
tzid n/a n/a n/a n/a VTIMEZONE
tzname n/a n/a n/a n/a VTIMEZONE
tzoffsetfrom n/a n/a n/a n/a VTIMEZONE
tzoffsetto n/a n/a n/a n/a VTIMEZONE
tzurl n/a n/a n/a n/a VTIMEZONE
In addition, events and todos may contain alarms.
Optional:
class classification
created created
description description
dtstart dtstart
geo geo
last-mod lastmod
location location
organizer organizerId
priority priority
dtstamp dtstamp
seq sequence
status status
summary summary
transp transparency
uid uid
url link
recurid recurrenceId
One of or neither
dtend dtend
duration duration
Optional and repeatable
alarmc alarms
attach
attendee attendees
categories categories
comment comments
contact sponsor
exdate exdates
exrule exrules
rstatus requestStatus
related
resources resources
rdate rdates
rrule rrules
x-prop
Extra non-rfc fields:
private String cost;
private UserVO creator;
private boolean isPublic;
private CalendarVO calendar;
private RecurrenceVO recurrence;
private char recurrenceStatus = 'N'; // Derived from above
--------------------------------------------------------------------
Peruser data and overrides.
When events are in a shared collection some properties are private to each
user with access. These are transparency and alarms. Retrieving transparency
is done ona peruser basis. An x-property holds the peruser values. Alarms
have an owner so we only return alarms owned by the current user. We also need
to be careful not to delete other users alarms on update.
Where it gets really complex is handling recurrences. If a user adds an
alarm to an instance, this creates an override specifically for that user.
On update a user will only send the instances they know about. We should
preserve all other instances for which they have no peruser data.
The owner peruser data is stored directly in the instance. If the instance
only differs in that respect then it is not delivered to others. Rather than
attempt to compare it every time, we flag it on creation with a peruser
x-property. If any other property is changed then we remove the peruser flag.