Commit eed0a321 authored by Aymane KHOUAJI's avatar Aymane KHOUAJI

Add documentation about sabre recurrent event

parents
graph TD
subgraph OP
E[Openpaas frontend] --> |1.PUT| A
end
A[Openpaas backend] -->|2.PUT| B
subgraph Sabre
B[Sabre] --> |3.Auth| A
subgraph Plugin
G[EventRealTime]
H[IMIPPlugin]
end
end
A --> |4.Auth response|B
B .->|5. Create RabbitMQ Message |G
B .->|5. Create Mail Message |H
H -->|7' Trigger the mail | A
subgraph Mongo
B --> |6.Write| C(mongoDB)
end
subgraph RabbitMQ
G --> |7.Publish| D(RabbitMQ)
end
D-->|7.Publish|A
A.-> |8.Publish|E
\ No newline at end of file
This diff is collapsed.
# Recurring Event
##*What is it*
A recurring event is a simple ics where a recurring rule has been specified, the rule is written in the ics with the attribute *```RRULE```*
```
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
SUMMARY:Recurring
DTSTART:20150227T010000
DTEND:20150227T020000
𝗥𝗥𝗨𝗟𝗘:𝗙𝗥𝗘𝗤=𝗗𝗔𝗜𝗟𝗬
END:VEVENT
END:VCALENDAR
```
Here for the example the RRULE say this event is every day.
##*But if i have a exception ?*
*We take a example :*
Here we have a recurring event on 5 days :
| Event | Event | Event | Event | event |
|---|---|---|---|---|
with the ics :
```
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
SUMMARY:Recurring
DTSTART:20150227T010000
DTEND:20150227T020000
𝗙𝗥𝗘𝗤=𝗗𝗔𝗜𝗟𝗬;𝗜𝗡𝗧𝗘𝗥𝗩𝗔𝗟=𝟭;𝗖𝗢𝗨𝗡𝗧=𝟱 // DAILY=EVERY DAY ; INTERVAL: 1 DAY INTERVAL ; 5 TIMES
END:VEVENT
END:VCALENDAR
```
Now postpone the event number 3
| Event | Event | | Event | event |
|---|---|---|---|---|
| | | Event | | |
the ics gonna have 2 VEVENT one for the recurrence and one for the exception :
```
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
SUMMARY:Recurring
DTSTART:20150227T010000
DTEND:20150227T020000
𝗙𝗥𝗘𝗤=𝗗𝗔𝗜𝗟𝗬;𝗜𝗡𝗧𝗘𝗥𝗩𝗔𝗟=𝟭;𝗖𝗢𝗨𝗡𝗧=𝟱
END:VEVENT
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
𝗥𝗘𝗖𝗨𝗥𝗥𝗘𝗡𝗖𝗘-𝗜𝗗:𝟮𝟬𝟭𝟱𝟬𝟮𝟮𝟴𝗧𝟬𝟭𝟬𝟬𝟬𝟬
SUMMARY:Recurring
DTSTART:20150228T030000
DTEND:20150228T040000
END:VEVENT
END:VCALENDAR
```
As you can see in the second VEVENT we have the *RECURRENCE-ID* who determine the exception, the *RECURRENCE-ID* have a date format (YYYYMMDDTHHmmss) where the value is the date of the event exception.
##*How it work with sabre*
Event creation step :
![Schema](./schema.png)
![Schema](./sequence.png)
1. Openpaas send a PUT request to the backend with the event on jcal format.
2. DAV proxy (`linagora.esn.dav.proxy`) is used as a proxy (thanks captain) to transform some of the request to specific method (REPORT, PROPFIND).
Example of body :
```json
["vcalendar",[],[["vevent",[["uid",{},"text","b1ad4904-dcef-4a19-9259-29b26f65ac56"],["transp",{},"text","OPAQUE"],["dtstart",{"tzid":"Europe/Berlin"},"date-time","2019-02-19T17:30:00"],["dtend",{"tzid":"Europe/Berlin"},"date-time","2019-02-19T18:00:00"],["class",{},"text","PUBLIC"],["summary",{},"text","EVENT"],["organizer",{"cn":"toto tata"},"cal-address","mailto:toto@linagora.com"],["attendee",{"partstat":"ACCEPTED","rsvp":"FALSE","role":"CHAIR","cutype":"INDIVIDUAL"},"cal-address","mailto:toto@linagora.com"]],[]],["vtimezone",[["tzid",{},"text","Europe/Berlin"]],[["daylight",[["tzoffsetfrom",{},"utc-offset","+01:00"],["tzoffsetto",{},"utc-offset","+02:00"],["tzname",{},"text","CEST"],["dtstart",{},"date-time","1970-03-29T02:00:00"],["rrule",{},"recur",{"freq":"YEARLY","bymonth":3,"byday":"-1SU"}]],[]],["standard",[["tzoffsetfrom",{},"utc-offset","+02:00"],["tzoffsetto",{},"utc-offset","+01:00"],["tzname",{},"text","CET"],["dtstart",{},"date-time","1970-10-25T03:00:00"],["rrule",{},"recur",{"freq":"YEARLY","bymonth":10,"byday":"-1SU"}]],[]]]]]]
```
3. Sabre send a auth request to Openpaas on the `/api/login` to check if the user have the right *(cf. DAV/Auth/Backend/Esn.php::validateUserPass)*.
4. Openpaas respond with a token
5. Sabre generate the message to be published on rabbit before the write into Mongo,
6. Create/Update the event into mongoDB
7. Publish the message into rabbit
8. Via Socket.io (websocket) publish the message to the frontend to apply the creation or modification for the organizer and the attendee (if it's a openpaas user)
PS: it's a very simplified schema.
##The Difference
Sabre handle a recurring event like a simple event, But diverge when a exception is created.
For the example we re-take the ics :
```
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
SUMMARY:Recurring
DTSTART:20150227T010000
DTEND:20150227T020000
𝗙𝗥𝗘𝗤=𝗗𝗔𝗜𝗟𝗬;𝗜𝗡𝗧𝗘𝗥𝗩𝗔𝗟=𝟭;𝗖𝗢𝗨𝗡𝗧=𝟱
END:VEVENT
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
𝗥𝗘𝗖𝗨𝗥𝗥𝗘𝗡𝗖𝗘-𝗜𝗗:𝟮𝟬𝟭𝟱𝟬𝟮𝟮𝟴𝗧𝟬𝟭𝟬𝟬𝟬𝟬
SUMMARY:Recurring
DTSTART:20150228T030000
DTEND:20150228T040000
END:VEVENT
END:VCALENDAR
```
When the organizer modify one of this recurrent event, it appear like that on the Database, but if we add a attendee in the exception
Organizer :
```
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
SUMMARY:Recurring
DTSTART:20150227T010000
DTEND:20150227T020000
𝗙𝗥𝗘𝗤=𝗗𝗔𝗜𝗟𝗬;𝗜𝗡𝗧𝗘𝗥𝗩𝗔𝗟=𝟭;𝗖𝗢𝗨𝗡𝗧=𝟱
END:VEVENT
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
𝗥𝗘𝗖𝗨𝗥𝗥𝗘𝗡𝗖𝗘-𝗜𝗗:𝟮𝟬𝟭𝟱𝟬𝟮𝟮𝟴𝗧𝟬𝟭𝟬𝟬𝟬𝟬
ATTENDEE;CN=Two:mailto:two@example.org
SUMMARY:Recurring
DTSTART:20150228T030000
DTEND:20150228T040000
END:VEVENT
END:VCALENDAR
```
here we just add a attendee in the exception, but now from the attendee :
```
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
𝗥𝗘𝗖𝗨𝗥𝗥𝗘𝗡𝗖𝗘-𝗜𝗗:𝟮𝟬𝟭𝟱𝟬𝟮𝟮𝟴𝗧𝟬𝟭𝟬𝟬𝟬𝟬
ATTENDEE;CN=Two:mailto:two@example.org
SUMMARY:Recurring
DTSTART:20150228T030000
DTEND:20150228T040000
END:VEVENT
END:VCALENDAR
```
The attendee have a Event with the *RECURRENCE-ID* and it linked to the 'master event' with the *UID*.
schema.png

78.7 KB

sequenceDiagram
OP Frontend->>OP Backend: PUT
OP Backend->>Sabre: PUT
Sabre->>OP Backend: Auth api/login
OP Backend->>Sabre: Auth response
Sabre-->>Sabre: Create RabbitMQ message
Sabre-->>Sabre: Create Mail message
Sabre->>MongoDB: Create/Update
Sabre-->>RabbitMQ: Publish message
RabbitMQ-->>OP Backend: Publish message
OP Backend-->>OP Frontend: Publish message via WS
Sabre->>OP Backend: POST /calendars/inviteattendees
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment