-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpimp-my-calendar-part-3.html
More file actions
163 lines (151 loc) · 9.87 KB
/
Copy pathpimp-my-calendar-part-3.html
File metadata and controls
163 lines (151 loc) · 9.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html lang="en">
<head>
<title>meandering journey</title>
<meta charset="utf-8" />
<link href="./theme/css/main.css" type="text/css" rel="stylesheet" />
<link href="http://meandering.journey.sk/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="meandering journey Full Atom Feed" />
<link href="http://meandering.journey.sk/feeds/misc.atom.xml" type="application/atom+xml" rel="alternate" title="meandering journey Categories Atom Feed" />
</head>
<body id="index" class="home">
<div class="all">
<div class="extra-info">
<aside>
<h3>About the blog</h3>
A platform to practice my written communication skills.
The range of topics tends to surprise even myself.
</aside>
<aside>
<h3>About the author</h3>
My name is Ján Hušták. I live near
<a href="http://maps.google.com/maps?q=bratislava&z=6">Bratislava</a>.
I've been developing software professionally since 1998.
The Java platform has served me well but I don't dwell on it.
</aside>
<aside>
<h3>Links</h3>
<a href="http://www.journey.sk">Main site</a>,
<a href="http://coding.journey.sk">projects page</a>,
<a href="https://github.com/codingjourney">GitHub</a>.
Sorry, no social networks. I do read mail sent to
coding at journey.sk.
</aside>
<aside id="tags">
<h3>Tags</h3>
<a href="./tag/motivation.html">motivation</a>
- <a href="./tag/htpc.html">HTPC</a>
- <a href="./tag/openbsd.html">OpenBSD</a>
- <a href="./tag/qt.html">Qt</a>
- <a href="./tag/upsheet.html">upsheet</a>
- <a href="./tag/python.html">Python</a>
- <a href="./tag/kde.html">KDE</a>
- <a href="./tag/cloud-computing.html">cloud computing</a>
- <a href="./tag/caldav.html">CalDAV</a>
- <a href="./tag/howto.html">howto</a>
- <a href="./tag/jetty.html">Jetty</a>
- <a href="./tag/craftsmanship.html">craftsmanship</a>
- <a href="./tag/meta.html">meta</a>
- <a href="./tag/music.html">music</a>
- <a href="./tag/it-misadventures.html">IT misadventures</a>
- <a href="./tag/algorithms.html">algorithms</a>
- <a href="./tag/android.html">Android</a>
- <a href="./tag/cups.html">CUPS</a>
- <a href="./tag/security.html">security</a>
- <a href="./tag/html5.html">HTML5</a>
</aside>
<aside class="links">
<h3>Recent articles</h3>
<a href="./much-more-fun-with-planning-poker.html">Much more fun with Planning poker</a>
<a href="./the-child-that-grew-too-fast.html">The child that grew too fast</a>
<a href="./mare-nostrum-at-konzerthaus.html">Mare Nostrum at Konzerthaus</a>
<a href="./too-much-fun-with-planning-poker.html">Too much fun with Planning poker</a>
<a href="./long-time-no-blog.html">Long time no blog</a>
<a href="./what-i-did-last-summer.html">What I did last summer</a>
<a href="./october-2013-is-here.html">October 2013 is here</a>
<a href="./october-2013.html">October 2013</a>
</aside>
</div><!-- /.extra-info -->
<div class="main-column">
<header id="banner" class="body">
<h1><a href=".">meandering<img src="./theme/images/logo.png"/>journey</a></h1>
</header><!-- /#banner -->
<section id="content" class="body">
<header>
<h3>
<a href="pimp-my-calendar-part-3.html" rel="bookmark"
title="Permalink to PIMp my calendar, part 3">PIMp my calendar, part 3</a></h2>
</header>
<footer class="post-info">
Published on <abbr class="published" title="2013-04-17T05:45:00"> Wed 17 April 2013 </abbr> under
<a href="./tag/it-misadventures.html">IT misadventures</a>, <a href="./tag/android.html">Android</a>, <a href="./tag/caldav.html">CalDAV</a> </footer><!-- /.post-info -->
<div class="entry-content">
<p>My <a href="./pimp-my-calendar-part-1.html">efforts</a> to put a <a href="./pimp-my-calendar-part-2.html">server-backed</a> calendar on my Android phone entered a new phase. I had <a href="http://www.radicale.org/">Radicale</a> on the server and the <a href="https://github.com/gggard/AndroidCaldavSyncAdapater">CalDAV adapater</a> on the phone but they seemed to talk past each other. My phone would set up a CalDAV account successfully but then tell me "You have no calendar" when I tried to create events.</p>
<p>Radicale documentation says calendars are created automagically based on a URL convention, i.e. simply accessing a non-existent calendar should bring it into existence. I tried it with the Mozilla Lightning client and it worked as advertised. The Android adapter, however, still wouldn't see the new calendar nor its events.</p>
<p><a href="http://www.wireshark.org">WireShark</a> revealed that a CalDAV client apparently enjoys a lot of freedom when formulating requests. A PROPFIND request from Lightning looked like this:</p>
<div class="codehilite"><pre><span class="nt"><D:propfind</span> <span class="na">xmlns:D=</span><span class="s">"DAV:"</span>
<span class="na">xmlns:CS=</span><span class="s">"http://calendarserver.org/ns/"</span>
<span class="na">xmlns:C=</span><span class="s">"urn:ietf:params:xml:ns:caldav"</span><span class="nt">></span>
<span class="nt"><D:prop></span>
<span class="nt"><D:resourcetype/></span>
<span class="nt"><D:owner/></span>
<span class="nt"><D:supported-report-set/></span>
<span class="nt"><C:supported-calendar-component-set/></span>
<span class="nt"><CS:getctag/></span>
<span class="nt"></D:prop></span>
<span class="nt"></D:propfind></span>
</pre></div>
<p>whereas the Android adapter was sending</p>
<div class="codehilite"><pre><span class="nt"><d:propfind</span> <span class="na">xmlns:d=</span><span class="s">"DAV:"</span>
<span class="na">xmlns:c=</span><span class="s">"urn:ietf:params:xml:ns:caldav"</span>
<span class="na">xmlns:cs=</span><span class="s">"http://calendarserver.org/ns/"</span>
<span class="na">xmlns:ic=</span><span class="s">"http://apple.com/ns/ical/"</span><span class="nt">></span>
<span class="nt"><d:prop></span>
<span class="nt"><d:displayname</span> <span class="nt">/></span>
<span class="nt"><d:resourcetype</span> <span class="nt">/></span>
<span class="nt"><cs:getctag</span> <span class="nt">/></span>
<span class="nt"></d:prop></span>
<span class="nt"></d:propfind></span>
</pre></div>
<p>and it seemed Radicale was not happy with the <em>displayname</em> bit:</p>
<div class="codehilite"><pre><span class="nx">...</span>
<span class="o"><</span><span class="nx">propstat</span><span class="o">></span>
<span class="o"><</span><span class="nx">prop</span><span class="o">></span>
<span class="o"><</span><span class="nb">displayname</span> <span class="o">/></span>
<span class="o"></</span><span class="nx">prop</span><span class="o">></span>
<span class="o"><</span><span class="nb">status</span><span class="o">></span><span class="nx">HTTP</span><span class="p">/</span><span class="nx">1.1</span> <span class="mi">404</span> <span class="ow">Not</span> <span class="nx">Found</span><span class="o"></</span><span class="nb">status</span><span class="o">></span>
<span class="o"></</span><span class="nx">propstat</span><span class="o">></span>
<span class="nx">...</span>
</pre></div>
<p>Server-side source code revealed that Radicale returns 404 for properties which it does not recognize (see the final <em>else</em> in the long <em>if-elif</em> chain in <em>_propfind_response()</em> in <em>xmlutils.py</em>). My installed version of Radicale was 0.7. I downloaded the most recent stable release (0.7.1) from the project site and tried that instead. Lo and behold, it finally said</p>
<div class="codehilite"><pre><span class="nt"><multistatus</span> <span class="na">xmlns=</span><span class="s">"DAV:"</span>
<span class="na">xmlns:C=</span><span class="s">"urn:ietf:params:xml:ns:caldav"</span>
<span class="na">xmlns:CS=</span><span class="s">"http://calendarserver.org/ns/"</span><span class="nt">></span>
<span class="nt"><response></span>
<span class="nt"><href></span>/jh/calendar/<span class="nt"></href></span>
<span class="nt"><propstat></span>
<span class="nt"><prop></span>
<span class="nt"><displayname></span>calendar<span class="nt"></displayname></span>
<span class="nt"><resourcetype></span>
<span class="nt"><C:calendar</span> <span class="nt">/></span>
<span class="nt"><collection</span> <span class="nt">/></span>
<span class="nt"></resourcetype></span>
<span class="nt"><CS:getctag></span>"0"<span class="nt"></CS:getctag></span>
<span class="nt"></prop></span>
<span class="nt"><status></span>HTTP/1.1 200 OK<span class="nt"></status></span>
<span class="nt"></propstat></span>
<span class="nt"></response></span>
<span class="nt"></multistatus></span>
</pre></div>
<p>The Calendar app on my phone, however, <em>still</em> insisted I had no calendar. <em>Continued in <a href="./pimp-my-calendar-part-4.html">part 4</a>.</em></p>
</div><!-- /.entry-content -->
</section>
<footer id="contentinfo" class="body">
<address id="about" class="vcard body">
Proudly powered by <a href="http://getpelican.com/">Pelican</a>,
which takes great advantage of <a href="http://python.org">Python</a>.
</address><!-- /#about -->
</footer><!-- /#contentinfo -->
</div><!-- /.main-column -->
</div><!-- /.all -->
</body>
</html>