Commit eed0a321 authored by Aymane KHOUAJI's avatar Aymane KHOUAJI
Browse files

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
<!DOCTYPE html><html><head>
<title>recurringEvent</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.0-rc.1/dist/katex.min.css">
<style>
/**
* prism.js Github theme based on GitHub's theme.
* @author Sam Clarke
*/
code[class*="language-"],
pre[class*="language-"] {
color: #333;
background: none;
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.4;
-moz-tab-size: 8;
-o-tab-size: 8;
tab-size: 8;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
/* Code blocks */
pre[class*="language-"] {
padding: .8em;
overflow: auto;
/* border: 1px solid #ddd; */
border-radius: 3px;
/* background: #fff; */
background: #f5f5f5;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
background: #f5f5f5;
}
.token.comment,
.token.blockquote {
color: #969896;
}
.token.cdata {
color: #183691;
}
.token.doctype,
.token.punctuation,
.token.variable,
.token.macro.property {
color: #333;
}
.token.operator,
.token.important,
.token.keyword,
.token.rule,
.token.builtin {
color: #a71d5d;
}
.token.string,
.token.url,
.token.regex,
.token.attr-value {
color: #183691;
}
.token.property,
.token.number,
.token.boolean,
.token.entity,
.token.atrule,
.token.constant,
.token.symbol,
.token.command,
.token.code {
color: #0086b3;
}
.token.tag,
.token.selector,
.token.prolog {
color: #63a35c;
}
.token.function,
.token.namespace,
.token.pseudo-element,
.token.class,
.token.class-name,
.token.pseudo-class,
.token.id,
.token.url-reference .token.variable,
.token.attr-name {
color: #795da3;
}
.token.entity {
cursor: help;
}
.token.title,
.token.title .token.punctuation {
font-weight: bold;
color: #1d3e81;
}
.token.list {
color: #ed6a43;
}
.token.inserted {
background-color: #eaffea;
color: #55a532;
}
.token.deleted {
background-color: #ffecec;
color: #bd2c00;
}
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
/* JSON */
.language-json .token.property {
color: #183691;
}
.language-markup .token.tag .token.punctuation {
color: #333;
}
/* CSS */
code.language-css,
.language-css .token.function {
color: #0086b3;
}
/* YAML */
.language-yaml .token.atrule {
color: #63a35c;
}
code.language-yaml {
color: #183691;
}
/* Ruby */
.language-ruby .token.function {
color: #333;
}
/* Markdown */
.language-markdown .token.url {
color: #795da3;
}
/* Makefile */
.language-makefile .token.symbol {
color: #795da3;
}
.language-makefile .token.variable {
color: #183691;
}
.language-makefile .token.builtin {
color: #0086b3;
}
/* Bash */
.language-bash .token.keyword {
color: #0086b3;
}html body{font-family:"Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff;overflow:initial;box-sizing:border-box;word-wrap:break-word}html body>:first-child{margin-top:0}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{line-height:1.2;margin-top:1em;margin-bottom:16px;color:#000}html body h1{font-size:2.25em;font-weight:300;padding-bottom:.3em}html body h2{font-size:1.75em;font-weight:400;padding-bottom:.3em}html body h3{font-size:1.5em;font-weight:500}html body h4{font-size:1.25em;font-weight:600}html body h5{font-size:1.1em;font-weight:600}html body h6{font-size:1em;font-weight:600}html body h1,html body h2,html body h3,html body h4,html body h5{font-weight:600}html body h5{font-size:1em}html body h6{color:#5c5c5c}html body strong{color:#000}html body del{color:#5c5c5c}html body a:not([href]){color:inherit;text-decoration:none}html body a{color:#08c;text-decoration:none}html body a:hover{color:#00a3f5;text-decoration:none}html body img{max-width:100%}html body>p{margin-top:0;margin-bottom:16px;word-wrap:break-word}html body>ul,html body>ol{margin-bottom:16px}html body ul,html body ol{padding-left:2em}html body ul.no-list,html body ol.no-list{padding:0;list-style-type:none}html body ul ul,html body ul ol,html body ol ol,html body ol ul{margin-top:0;margin-bottom:0}html body li{margin-bottom:0}html body li.task-list-item{list-style:none}html body li>p{margin-top:0;margin-bottom:0}html body .task-list-item-checkbox{margin:0 .2em .25em -1.8em;vertical-align:middle}html body .task-list-item-checkbox:hover{cursor:pointer}html body blockquote{margin:16px 0;font-size:inherit;padding:0 15px;color:#5c5c5c;border-left:4px solid #d6d6d6}html body blockquote>:first-child{margin-top:0}html body blockquote>:last-child{margin-bottom:0}html body hr{height:4px;margin:32px 0;background-color:#d6d6d6;border:0 none}html body table{margin:10px 0 15px 0;border-collapse:collapse;border-spacing:0;display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}html body table th{font-weight:bold;color:#000}html body table td,html body table th{border:1px solid #d6d6d6;padding:6px 13px}html body dl{padding:0}html body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:bold}html body dl dd{padding:0 16px;margin-bottom:16px}html body code{font-family:Menlo,Monaco,Consolas,'Courier New',monospace;font-size:.85em !important;color:#000;background-color:#f0f0f0;border-radius:3px;padding:.2em 0}html body code::before,html body code::after{letter-spacing:-0.2em;content:"\00a0"}html body pre>code{padding:0;margin:0;font-size:.85em !important;word-break:normal;white-space:pre;background:transparent;border:0}html body .highlight{margin-bottom:16px}html body .highlight pre,html body pre{padding:1em;overflow:auto;font-size:.85em !important;line-height:1.45;border:#d6d6d6;border-radius:3px}html body .highlight pre{margin-bottom:0;word-break:normal}html body pre code,html body pre tt{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}html body pre code:before,html body pre tt:before,html body pre code:after,html body pre tt:after{content:normal}html body p,html body blockquote,html body ul,html body ol,html body dl,html body pre{margin-top:0;margin-bottom:16px}html body kbd{color:#000;border:1px solid #d6d6d6;border-bottom:2px solid #c7c7c7;padding:2px 4px;background-color:#f0f0f0;border-radius:3px}@media print{html body{background-color:#fff}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{color:#000;page-break-after:avoid}html body blockquote{color:#5c5c5c}html body pre{page-break-inside:avoid}html body table{display:table}html body img{display:block;max-width:100%;max-height:100%}html body pre,html body code{word-wrap:break-word;white-space:pre}}.markdown-preview{width:100%;height:100%;box-sizing:border-box}.markdown-preview .pagebreak,.markdown-preview .newpage{page-break-before:always}.markdown-preview pre.line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}.markdown-preview pre.line-numbers>code{position:relative}.markdown-preview pre.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:1em;font-size:100%;left:0;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.markdown-preview pre.line-numbers .line-numbers-rows>span{pointer-events:none;display:block;counter-increment:linenumber}.markdown-preview pre.line-numbers .line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}.markdown-preview .mathjax-exps .MathJax_Display{text-align:center !important}.markdown-preview:not([for="preview"]) .code-chunk .btn-group{display:none}.markdown-preview:not([for="preview"]) .code-chunk .status{display:none}.markdown-preview:not([for="preview"]) .code-chunk .output-div{margin-bottom:16px}.scrollbar-style::-webkit-scrollbar{width:8px}.scrollbar-style::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.scrollbar-style::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,0.66);border:4px solid rgba(150,150,150,0.66);background-clip:content-box}html body[for="html-export"]:not([data-presentation-mode]){position:relative;width:100%;height:100%;top:0;left:0;margin:0;padding:0;overflow:auto}html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{position:relative;top:0}@media screen and (min-width:914px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{padding:2em calc(50% - 457px)}}@media screen and (max-width:914px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{font-size:14px !important;padding:1em}}@media print{html body[for="html-export"]:not([data-presentation-mode]) #sidebar-toc-btn{display:none}}html body[for="html-export"]:not([data-presentation-mode]) #sidebar-toc-btn{position:fixed;bottom:8px;left:8px;font-size:28px;cursor:pointer;color:inherit;z-index:99;width:32px;text-align:center;opacity:.4}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] #sidebar-toc-btn{opacity:1}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc{position:fixed;top:0;left:0;width:300px;height:100%;padding:32px 0 48px 0;font-size:14px;box-shadow:0 0 4px rgba(150,150,150,0.33);box-sizing:border-box;overflow:auto;background-color:inherit}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar{width:8px}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,0.66);border:4px solid rgba(150,150,150,0.66);background-clip:content-box}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc a{text-decoration:none}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc ul{padding:0 1.6em;margin-top:.8em}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc li{margin-bottom:.8em}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc ul{list-style-type:none}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{left:300px;width:calc(100% - 300px);padding:2em calc(50% - 457px - 150px);margin:0;box-sizing:border-box}@media screen and (max-width:1274px){html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{width:100%}}html body[for="html-export"]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .markdown-preview{left:50%;transform:translateX(-50%)}html body[for="html-export"]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .md-sidebar-toc{display:none}
/* Please visit the URL below for more information: */
/* https://shd101wyy.github.io/markdown-preview-enhanced/#/customize-css */
</style>
</head>
<body for="html-export">
<div class="mume markdown-preview ">
<h1 class="mume-header" id="recurring-event">Recurring Event</h1>
<h2 class="mume-header" id="what-is-it"><em>What is it</em></h2>
<p>A recurring event is a simple ics where a recurring rule has been specified, the rule is written in the ics with the attribute <em><code>RRULE</code></em></p>
<pre data-role="codeBlock" data-info="" class="language-"><code>BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
SUMMARY:Recurring
DTSTART:20150227T010000
DTEND:20150227T020000
&#x1D5E5;&#x1D5E5;&#x1D5E8;&#x1D5DF;&#x1D5D8;:&#x1D5D9;&#x1D5E5;&#x1D5D8;&#x1D5E4;=&#x1D5D7;&#x1D5D4;&#x1D5DC;&#x1D5DF;&#x1D5EC;
END:VEVENT
END:VCALENDAR
</code></pre><p>Here for the example the RRULE say this event is every day.</p>
<h2 class="mume-header" id="but-if-i-have-a-exception"><em>But if i have a exception ?</em></h2>
<p><em>We take a example :</em></p>
<p>Here we have a recurring event on 5 days :</p>
<table>
<thead>
<tr>
<th>Event</th>
<th>Event</th>
<th>Event</th>
<th>Event</th>
<th>event</th>
</tr>
</thead>
<tbody></tbody>
</table>
<p>with the ics :</p>
<pre data-role="codeBlock" data-info="" class="language-"><code>BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
SUMMARY:Recurring
DTSTART:20150227T010000
DTEND:20150227T020000
&#x1D5D9;&#x1D5E5;&#x1D5D8;&#x1D5E4;=&#x1D5D7;&#x1D5D4;&#x1D5DC;&#x1D5DF;&#x1D5EC;;&#x1D5DC;&#x1D5E1;&#x1D5E7;&#x1D5D8;&#x1D5E5;&#x1D5E9;&#x1D5D4;&#x1D5DF;=&#x1D7ED;;&#x1D5D6;&#x1D5E2;&#x1D5E8;&#x1D5E1;&#x1D5E7;=&#x1D7F1; // DAILY=EVERY DAY ; INTERVAL: 1 DAY INTERVAL ; 5 TIMES
END:VEVENT
END:VCALENDAR
</code></pre><p>Now postpone the event number 3</p>
<table>
<thead>
<tr>
<th>Event</th>
<th>Event</th>
<th></th>
<th>Event</th>
<th>event</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td>Event</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>the ics gonna have 2 VEVENT one for the recurrence and one for the exception :</p>
<pre data-role="codeBlock" data-info="" class="language-"><code>BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
SUMMARY:Recurring
DTSTART:20150227T010000
DTEND:20150227T020000
&#x1D5D9;&#x1D5E5;&#x1D5D8;&#x1D5E4;=&#x1D5D7;&#x1D5D4;&#x1D5DC;&#x1D5DF;&#x1D5EC;;&#x1D5DC;&#x1D5E1;&#x1D5E7;&#x1D5D8;&#x1D5E5;&#x1D5E9;&#x1D5D4;&#x1D5DF;=&#x1D7ED;;&#x1D5D6;&#x1D5E2;&#x1D5E8;&#x1D5E1;&#x1D5E7;=&#x1D7F1;
END:VEVENT
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
&#x1D5E5;&#x1D5D8;&#x1D5D6;&#x1D5E8;&#x1D5E5;&#x1D5E5;&#x1D5D8;&#x1D5E1;&#x1D5D6;&#x1D5D8;-&#x1D5DC;&#x1D5D7;:&#x1D7EE;&#x1D7EC;&#x1D7ED;&#x1D7F1;&#x1D7EC;&#x1D7EE;&#x1D7EE;&#x1D7F4;&#x1D5E7;&#x1D7EC;&#x1D7ED;&#x1D7EC;&#x1D7EC;&#x1D7EC;&#x1D7EC;
SUMMARY:Recurring
DTSTART:20150228T030000
DTEND:20150228T040000
END:VEVENT
END:VCALENDAR
</code></pre><p>As you can see in the second VEVENT we have the <em>RECURRENCE-ID</em> who determine the exception, the <em>RECURRENCE-ID</em> have a date format (YYYYMMDDTHHmmss) where the value is the date of the event exception.</p>
<h2 class="mume-header" id="how-it-work-with-sabre"><em>How it work with sabre</em></h2>
<p>Event creation step :</p>
<p><img src="./schema.png" alt="Schema"></p>
<p><img src="./sequence.png" alt="Schema"></p>
<ol>
<li>
<p>Openpaas send a PUT request to the backend with the event on jcal format.</p>
</li>
<li>
<p>DAV proxy (<code>linagora.esn.dav.proxy</code>) is used as a proxy (thanks captain) to transform some of the request to specific method (REPORT, PROPFIND).</p>
</li>
</ol>
<p>Example of body :</p>
<pre data-role="codeBlock" data-info="json" class="language-json"><span class="token punctuation">[</span><span class="token string">&quot;vcalendar&quot;</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token string">&quot;vevent&quot;</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token string">&quot;uid&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;text&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;b1ad4904-dcef-4a19-9259-29b26f65ac56&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">&quot;transp&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;text&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;OPAQUE&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">&quot;dtstart&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token property">&quot;tzid&quot;</span><span class="token operator">:</span><span class="token string">&quot;Europe/Berlin&quot;</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;date-time&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;2019-02-19T17:30:00&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">&quot;dtend&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token property">&quot;tzid&quot;</span><span class="token operator">:</span><span class="token string">&quot;Europe/Berlin&quot;</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;date-time&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;2019-02-19T18:00:00&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">&quot;class&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;text&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;PUBLIC&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">&quot;summary&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;text&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;EVENT&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">&quot;organizer&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token property">&quot;cn&quot;</span><span class="token operator">:</span><span class="token string">&quot;toto tata&quot;</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;cal-address&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;mailto:toto@linagora.com&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">&quot;attendee&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token property">&quot;partstat&quot;</span><span class="token operator">:</span><span class="token string">&quot;ACCEPTED&quot;</span><span class="token punctuation">,</span><span class="token property">&quot;rsvp&quot;</span><span class="token operator">:</span><span class="token string">&quot;FALSE&quot;</span><span class="token punctuation">,</span><span class="token property">&quot;role&quot;</span><span class="token operator">:</span><span class="token string">&quot;CHAIR&quot;</span><span class="token punctuation">,</span><span class="token property">&quot;cutype&quot;</span><span class="token operator">:</span><span class="token string">&quot;INDIVIDUAL&quot;</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;cal-address&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;mailto:toto@linagora.com&quot;</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">&quot;vtimezone&quot;</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token string">&quot;tzid&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;text&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;Europe/Berlin&quot;</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token string">&quot;daylight&quot;</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token string">&quot;tzoffsetfrom&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;utc-offset&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;+01:00&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">&quot;tzoffsetto&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;utc-offset&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;+02:00&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">&quot;tzname&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;text&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;CEST&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">&quot;dtstart&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;date-time&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;1970-03-29T02:00:00&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">&quot;rrule&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;recur&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token property">&quot;freq&quot;</span><span class="token operator">:</span><span class="token string">&quot;YEARLY&quot;</span><span class="token punctuation">,</span><span class="token property">&quot;bymonth&quot;</span><span class="token operator">:</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token property">&quot;byday&quot;</span><span class="token operator">:</span><span class="token string">&quot;-1SU&quot;</span><span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">&quot;standard&quot;</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token string">&quot;tzoffsetfrom&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;utc-offset&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;+02:00&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">&quot;tzoffsetto&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;utc-offset&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;+01:00&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">&quot;tzname&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;text&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;CET&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">&quot;dtstart&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;date-time&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;1970-10-25T03:00:00&quot;</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">&quot;rrule&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token string">&quot;recur&quot;</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token property">&quot;freq&quot;</span><span class="token operator">:</span><span class="token string">&quot;YEARLY&quot;</span><span class="token punctuation">,</span><span class="token property">&quot;bymonth&quot;</span><span class="token operator">:</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token property">&quot;byday&quot;</span><span class="token operator">:</span><span class="token string">&quot;-1SU&quot;</span><span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
</pre><ol start="3">
<li>
<p>Sabre send a auth request to Openpaas on the <code>/api/login</code> to check if the user have the right <em>(cf. DAV/Auth/Backend/Esn.php::validateUserPass)</em>.</p>
</li>
<li>
<p>Openpaas respond with a token</p>
</li>
<li>
<p>Sabre generate the message to be published on rabbit before the write into Mongo,</p>
</li>
<li>
<p>Create/Update the event into mongoDB</p>
</li>
<li>
<p>Publish the message into rabbit</p>
</li>
<li>
<p>Via <a href="http://Socket.io">Socket.io</a> (websocket) publish the message to the frontend to apply the creation or modification for the organizer and the attendee (if it&apos;s a openpaas user)</p>
</li>
</ol>
<p>PS: it&apos;s a very simplified schema.</p>
<h2 class="mume-header" id="the-difference">The Difference</h2>
<p>Sabre handle a recurring event like a simple event, But diverge when a exception is created.<br>
For the example we re-take the ics :</p>
<pre data-role="codeBlock" data-info="" class="language-"><code>BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
SUMMARY:Recurring
DTSTART:20150227T010000
DTEND:20150227T020000
&#x1D5D9;&#x1D5E5;&#x1D5D8;&#x1D5E4;=&#x1D5D7;&#x1D5D4;&#x1D5DC;&#x1D5DF;&#x1D5EC;;&#x1D5DC;&#x1D5E1;&#x1D5E7;&#x1D5D8;&#x1D5E5;&#x1D5E9;&#x1D5D4;&#x1D5DF;=&#x1D7ED;;&#x1D5D6;&#x1D5E2;&#x1D5E8;&#x1D5E1;&#x1D5E7;=&#x1D7F1;
END:VEVENT
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
&#x1D5E5;&#x1D5D8;&#x1D5D6;&#x1D5E8;&#x1D5E5;&#x1D5E5;&#x1D5D8;&#x1D5E1;&#x1D5D6;&#x1D5D8;-&#x1D5DC;&#x1D5D7;:&#x1D7EE;&#x1D7EC;&#x1D7ED;&#x1D7F1;&#x1D7EC;&#x1D7EE;&#x1D7EE;&#x1D7F4;&#x1D5E7;&#x1D7EC;&#x1D7ED;&#x1D7EC;&#x1D7EC;&#x1D7EC;&#x1D7EC;
SUMMARY:Recurring
DTSTART:20150228T030000
DTEND:20150228T040000
END:VEVENT
END:VCALENDAR
</code></pre><p>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</p>
<p>Organizer :</p>
<pre data-role="codeBlock" data-info="" class="language-"><code>BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
SUMMARY:Recurring
DTSTART:20150227T010000
DTEND:20150227T020000
&#x1D5D9;&#x1D5E5;&#x1D5D8;&#x1D5E4;=&#x1D5D7;&#x1D5D4;&#x1D5DC;&#x1D5DF;&#x1D5EC;;&#x1D5DC;&#x1D5E1;&#x1D5E7;&#x1D5D8;&#x1D5E5;&#x1D5E9;&#x1D5D4;&#x1D5DF;=&#x1D7ED;;&#x1D5D6;&#x1D5E2;&#x1D5E8;&#x1D5E1;&#x1D5E7;=&#x1D7F1;
END:VEVENT
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
&#x1D5E5;&#x1D5D8;&#x1D5D6;&#x1D5E8;&#x1D5E5;&#x1D5E5;&#x1D5D8;&#x1D5E1;&#x1D5D6;&#x1D5D8;-&#x1D5DC;&#x1D5D7;:&#x1D7EE;&#x1D7EC;&#x1D7ED;&#x1D7F1;&#x1D7EC;&#x1D7EE;&#x1D7EE;&#x1D7F4;&#x1D5E7;&#x1D7EC;&#x1D7ED;&#x1D7EC;&#x1D7EC;&#x1D7EC;&#x1D7EC;
ATTENDEE;CN=Two:mailto:two@example.org
SUMMARY:Recurring
DTSTART:20150228T030000
DTEND:20150228T040000
END:VEVENT
END:VCALENDAR
</code></pre><p>here we just add a attendee in the exception, but now from the attendee :</p>
<pre data-role="codeBlock" data-info="" class="language-"><code>BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:75EE3C60-34AC-4A97-953D-56CC004D6705
&#x1D5E5;&#x1D5D8;&#x1D5D6;&#x1D5E8;&#x1D5E5;&#x1D5E5;&#x1D5D8;&#x1D5E1;&#x1D5D6;&#x1D5D8;-&#x1D5DC;&#x1D5D7;:&#x1D7EE;&#x1D7EC;&#x1D7ED;&#x1D7F1;&#x1D7EC;&#x1D7EE;&#x1D7EE;&#x1D7F4;&#x1D5E7;&#x1D7EC;&#x1D7ED;&#x1D7EC;&#x1D7EC;&#x1D7EC;&#x1D7EC;
ATTENDEE;CN=Two:mailto:two@example.org
SUMMARY:Recurring
DTSTART:20150228T030000
DTEND:20150228T040000
END:VEVENT
END:VCALENDAR
</code></pre><p>The attendee have a Event with the <em>RECURRENCE-ID</em> and it linked to the &apos;master event&apos; with the <em>UID</em>.</p>
</div>
</body></html>
\ No newline at end of file
# 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