<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[14794] CalendarServer/trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/14794">14794</a></dd>
<dt>Author</dt> <dd>cdaboo@apple.com</dd>
<dt>Date</dt> <dd>2015-05-18 05:19:17 -0700 (Mon, 18 May 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Enable standard timezone service by default (not in -apple.plist). Make sure CALDAV:timezone-service-set property is advertised.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkcalendarservertaputilpy">CalendarServer/trunk/calendarserver/tap/util.py</a></li>
<li><a href="#CalendarServertrunkconfcaldavdappleplist">CalendarServer/trunk/conf/caldavd-apple.plist</a></li>
<li><a href="#CalendarServertrunktwistedcaldavcaldavxmlpy">CalendarServer/trunk/twistedcaldav/caldavxml.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavresourcepy">CalendarServer/trunk/twistedcaldav/resource.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavstdconfigpy">CalendarServer/trunk/twistedcaldav/stdconfig.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtimezonestdservicepy">CalendarServer/trunk/twistedcaldav/timezonestdservice.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkcalendarservertaputilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tap/util.py (14793 => 14794)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tap/util.py        2015-05-18 12:15:13 UTC (rev 14793)
+++ CalendarServer/trunk/calendarserver/tap/util.py        2015-05-18 12:19:17 UTC (rev 14794)
</span><span class="lines">@@ -575,7 +575,7 @@
</span><span class="cx">         for enabled, wellknown_name, redirected_to in (
</span><span class="cx">             (config.EnableCalDAV, &quot;caldav&quot;, &quot;/principals/&quot;,),
</span><span class="cx">             (config.EnableCardDAV, &quot;carddav&quot;, &quot;/principals/&quot;,),
</span><del>-            (config.TimezoneService.Enabled, &quot;timezone&quot;, &quot;/stdtimezones&quot;,),
</del><ins>+            (config.TimezoneService.Enabled, &quot;timezone&quot;, config.TimezoneService.URI,),
</ins><span class="cx">             (config.Scheduling.iSchedule.Enabled, &quot;ischedule&quot;, &quot;/ischedule&quot;),
</span><span class="cx">         ):
</span><span class="cx">             if enabled:
</span></span></pre></div>
<a id="CalendarServertrunkconfcaldavdappleplist"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/conf/caldavd-apple.plist (14793 => 14794)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/conf/caldavd-apple.plist        2015-05-18 12:15:13 UTC (rev 14793)
+++ CalendarServer/trunk/conf/caldavd-apple.plist        2015-05-18 12:19:17 UTC (rev 14794)
</span><span class="lines">@@ -515,6 +515,13 @@
</span><span class="cx">     &lt;key&gt;EnableTimezoneService&lt;/key&gt;
</span><span class="cx">     &lt;true/&gt;
</span><span class="cx"> 
</span><ins>+    &lt;!-- Standard Timezone Service --&gt;
+    &lt;key&gt;TimezoneService&lt;/key&gt;
+    &lt;dict&gt;
+            &lt;key&gt;Enabled&lt;/key&gt;
+            &lt;false/&gt;
+    &lt;/dict&gt;
+
</ins><span class="cx">     &lt;!-- Shared Calendars &amp; Address Books --&gt;
</span><span class="cx">     &lt;key&gt;Sharing&lt;/key&gt;
</span><span class="cx">     &lt;dict&gt;
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavcaldavxmlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/caldavxml.py (14793 => 14794)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/caldavxml.py        2015-05-18 12:15:13 UTC (rev 14793)
+++ CalendarServer/trunk/twistedcaldav/caldavxml.py        2015-05-18 12:19:17 UTC (rev 14794)
</span><span class="lines">@@ -1445,7 +1445,27 @@
</span><span class="cx">     allowed_children = {(dav_namespace, &quot;href&quot;): (0, 1)}
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+#
+# draft-ietf-tzdist-caldav-timezone-ref
+#
</ins><span class="cx"> 
</span><ins>+caldav_timezone_service_set_compliance = (
+    &quot;timezone-service-set&quot;,
+)
+
+
+
+@registerElement
+class TimezoneServiceSet (CalDAVElement):
+    &quot;&quot;&quot;
+    Zero or one href elements defining the base scheme/host for attachments.
+    &quot;&quot;&quot;
+    name = &quot;timezone-service-set&quot;
+
+    allowed_children = {(dav_namespace, &quot;href&quot;): (0, 1)}
+
+
+
</ins><span class="cx"> #
</span><span class="cx"> # Extensions to ResourceType
</span><span class="cx"> #
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavresourcepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/resource.py (14793 => 14794)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/resource.py        2015-05-18 12:15:13 UTC (rev 14793)
+++ CalendarServer/trunk/twistedcaldav/resource.py        2015-05-18 12:19:17 UTC (rev 14794)
</span><span class="lines">@@ -2399,6 +2399,13 @@
</span><span class="cx">         returnValue((storeHome, created))
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+    def davComplianceClasses(self):
+        compliance = tuple(super(CalendarHomeResource, self).davComplianceClasses())
+        if config.EnableTimezonesByReference:
+            compliance += caldavxml.caldav_timezone_service_set_compliance
+        return compliance
+
+
</ins><span class="cx">     def liveProperties(self):
</span><span class="cx"> 
</span><span class="cx">         existing = super(CalendarHomeResource, self).liveProperties()
</span><span class="lines">@@ -2420,6 +2427,11 @@
</span><span class="cx">                 caldavxml.ManagedAttachmentsServerURL.qname(),
</span><span class="cx">             )
</span><span class="cx"> 
</span><ins>+        if config.EnableTimezonesByReference:
+            existing += (
+                caldavxml.TimezoneServiceSet.qname(),
+            )
+
</ins><span class="cx">         return existing
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -2471,6 +2483,13 @@
</span><span class="cx">             else:
</span><span class="cx">                 returnValue(None)
</span><span class="cx"> 
</span><ins>+        elif qname == caldavxml.TimezoneServiceSet.qname():
+            if config.EnableTimezonesByReference and config.TimezoneService.Enabled:
+                # Href points to standard timezone dist service.
+                returnValue(caldavxml.TimezoneServiceSet(element.HRef.fromString(config.TimezoneService.URI)))
+            else:
+                returnValue(None)
+
</ins><span class="cx">         elif qname in DefaultAlarmPropertyMixin.ALARM_PROPERTIES:
</span><span class="cx">             returnValue(self.getDefaultAlarmProperty(qname))
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavstdconfigpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py (14793 => 14794)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/stdconfig.py        2015-05-18 12:15:13 UTC (rev 14793)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py        2015-05-18 12:19:17 UTC (rev 14794)
</span><span class="lines">@@ -511,7 +511,8 @@
</span><span class="cx">     &quot;EnableTimezoneService&quot;   : False, # Old Timezone service
</span><span class="cx"> 
</span><span class="cx">     &quot;TimezoneService&quot;         : {    # New standard timezone service
</span><del>-        &quot;Enabled&quot;       : False, # Overall on/off switch
</del><ins>+        &quot;Enabled&quot;       : True,      # Overall on/off switch
+        &quot;URI&quot;           : &quot;/stdtimezones&quot;, # URI where service is hosted
</ins><span class="cx">         &quot;Mode&quot;          : &quot;primary&quot;, # Can be &quot;primary&quot; or &quot;secondary&quot;
</span><span class="cx">         &quot;BasePath&quot;      : &quot;&quot;,        # Path to directory containing a zoneinfo - if None use default package path
</span><span class="cx">                                      # secondary service MUST define its own writable path
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtimezonestdservicepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/timezonestdservice.py (14793 => 14794)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/timezonestdservice.py        2015-05-18 12:15:13 UTC (rev 14793)
+++ CalendarServer/trunk/twistedcaldav/timezonestdservice.py        2015-05-18 12:19:17 UTC (rev 14794)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> from txweb2 import responsecode
</span><span class="cx"> from txweb2.dav.method.propfind import http_PROPFIND
</span><span class="cx"> from txweb2.dav.noneprops import NonePropertyStore
</span><ins>+from txweb2.dav.util import joinURL
</ins><span class="cx"> from txweb2.http import HTTPError, JSONResponse, StatusResponse
</span><span class="cx"> from txweb2.http import Response
</span><span class="cx"> from txweb2.http_headers import MimeType
</span><span class="lines">@@ -291,6 +292,7 @@
</span><span class="cx">         if len(request.args) != 0:
</span><span class="cx">             self.problemReport(&quot;invalid-action&quot;, &quot;Invalid request-URI query parameters&quot;, responsecode.BAD_REQUEST)
</span><span class="cx"> 
</span><ins>+        urlbase = request.path.rsplit(&quot;/&quot;, 1)[0]
</ins><span class="cx">         result = {
</span><span class="cx">             &quot;version&quot;: &quot;1&quot;,
</span><span class="cx">             &quot;info&quot; : {
</span><span class="lines">@@ -301,16 +303,19 @@
</span><span class="cx">             &quot;actions&quot; : [
</span><span class="cx">                 {
</span><span class="cx">                     &quot;name&quot;: &quot;capabilities&quot;,
</span><ins>+                    &quot;uri-template&quot;: joinURL(urlbase, &quot;capabilities&quot;),
</ins><span class="cx">                     &quot;parameters&quot;: [],
</span><span class="cx">                 },
</span><span class="cx">                 {
</span><span class="cx">                     &quot;name&quot;: &quot;list&quot;,
</span><ins>+                    &quot;uri-template&quot;: joinURL(urlbase, &quot;zones{?changedsince}&quot;),
</ins><span class="cx">                     &quot;parameters&quot;: [
</span><span class="cx">                         {&quot;name&quot;: &quot;changedsince&quot;, &quot;required&quot;: False, &quot;multi&quot;: False, },
</span><span class="cx">                     ],
</span><span class="cx">                 },
</span><span class="cx">                 {
</span><span class="cx">                     &quot;name&quot;: &quot;get&quot;,
</span><ins>+                    &quot;uri-template&quot;: joinURL(urlbase, &quot;zones{/tzid}{?start,end}&quot;),
</ins><span class="cx">                     &quot;parameters&quot;: [
</span><span class="cx">                         {&quot;name&quot;: &quot;start&quot;, &quot;required&quot;: False, &quot;multi&quot;: False},
</span><span class="cx">                         {&quot;name&quot;: &quot;stop&quot;, &quot;required&quot;: False, &quot;multi&quot;: False, },
</span><span class="lines">@@ -318,14 +323,15 @@
</span><span class="cx">                 },
</span><span class="cx">                 {
</span><span class="cx">                     &quot;name&quot;: &quot;expand&quot;,
</span><ins>+                    &quot;uri-template&quot;: joinURL(urlbase, &quot;zones{/tzid}/observances{?start,end}&quot;),
</ins><span class="cx">                     &quot;parameters&quot;: [
</span><span class="cx">                         {&quot;name&quot;: &quot;start&quot;, &quot;required&quot;: True, &quot;multi&quot;: False, },
</span><span class="cx">                         {&quot;name&quot;: &quot;end&quot;, &quot;required&quot;: True, &quot;multi&quot;: False, },
</span><del>-                        {&quot;name&quot;: &quot;changedsince&quot;, &quot;required&quot;: False, &quot;multi&quot;: False, },
</del><span class="cx">                     ],
</span><span class="cx">                 },
</span><span class="cx">                 {
</span><span class="cx">                     &quot;name&quot;: &quot;find&quot;,
</span><ins>+                    &quot;uri-template&quot;: joinURL(urlbase, &quot;zones{?pattern}&quot;),
</ins><span class="cx">                     &quot;parameters&quot;: [
</span><span class="cx">                         {&quot;name&quot;: &quot;pattern&quot;, &quot;required&quot;: True, &quot;multi&quot;: False, },
</span><span class="cx">                     ],
</span><span class="lines">@@ -399,7 +405,7 @@
</span><span class="cx">         Expand a timezone within specified start/end dates.
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-        if set(request.args.keys()) - set((&quot;start&quot;, &quot;end&quot;, &quot;changedsince&quot;,)):
</del><ins>+        if set(request.args.keys()) - set((&quot;start&quot;, &quot;end&quot;,)):
</ins><span class="cx">             self.problemReport(&quot;invalid-action&quot;, &quot;Invalid request-URI query parameters&quot;, responsecode.BAD_REQUEST)
</span><span class="cx"> 
</span><span class="cx">         start = request.args.get(&quot;start&quot;, ())
</span></span></pre>
</div>
</div>

</body>
</html>