<!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>[13540] CalendarServer/trunk/calendarserver/webadmin</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/13540">13540</a></dd>
<dt>Author</dt> <dd>cdaboo@apple.com</dd>
<dt>Date</dt> <dd>2014-05-27 14:11:51 -0700 (Tue, 27 May 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Admin resources all need to be DAV resources since they are under / which is also DAV. Clean-up some related bits.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkcalendarserverwebadminconfigpy">CalendarServer/trunk/calendarserver/webadmin/config.py</a></li>
<li><a href="#CalendarServertrunkcalendarserverwebadmineventsourcepy">CalendarServer/trunk/calendarserver/webadmin/eventsource.py</a></li>
<li><a href="#CalendarServertrunkcalendarserverwebadminlandingpy">CalendarServer/trunk/calendarserver/webadmin/landing.py</a></li>
<li><a href="#CalendarServertrunkcalendarserverwebadminlogspy">CalendarServer/trunk/calendarserver/webadmin/logs.py</a></li>
<li><a href="#CalendarServertrunkcalendarserverwebadminprincipalspy">CalendarServer/trunk/calendarserver/webadmin/principals.py</a></li>
<li><a href="#CalendarServertrunkcalendarserverwebadminresourcepy">CalendarServer/trunk/calendarserver/webadmin/resource.py</a></li>
<li><a href="#CalendarServertrunkcalendarserverwebadmintesttest_eventsourcepy">CalendarServer/trunk/calendarserver/webadmin/test/test_eventsource.py</a></li>
<li><a href="#CalendarServertrunkcalendarserverwebadminworkpy">CalendarServer/trunk/calendarserver/webadmin/work.py</a></li>
<li><a href="#CalendarServertrunkcalendarserverwebadminworkxhtml">CalendarServer/trunk/calendarserver/webadmin/work.xhtml</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkcalendarserverwebadminconfigpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/webadmin/config.py (13539 => 13540)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/webadmin/config.py        2014-05-27 20:18:54 UTC (rev 13539)
+++ CalendarServer/trunk/calendarserver/webadmin/config.py        2014-05-27 21:11:51 UTC (rev 13540)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> """
</span><span class="cx">
</span><span class="cx"> def __init__(self, configuration):
</span><del>- PageElement.__init__(self, u"config")
</del><ins>+ super(ConfigurationPageElement, self).__init__(u"config")
</ins><span class="cx">
</span><span class="cx"> self.configuration = configuration
</span><span class="cx">
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx"> addSlash = False
</span><span class="cx">
</span><span class="cx">
</span><del>- def __init__(self, configuration):
- TemplateResource.__init__(
- self, lambda: ConfigurationPageElement(configuration)
</del><ins>+ def __init__(self, configuration, principalCollections):
+ super(ConfigurationResource, self).__init__(
+ lambda: ConfigurationPageElement(configuration), principalCollections, isdir=False
</ins><span class="cx"> )
</span></span></pre></div>
<a id="CalendarServertrunkcalendarserverwebadmineventsourcepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/webadmin/eventsource.py (13539 => 13540)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/webadmin/eventsource.py        2014-05-27 20:18:54 UTC (rev 13539)
+++ CalendarServer/trunk/calendarserver/webadmin/eventsource.py        2014-05-27 21:11:51 UTC (rev 13540)
</span><span class="lines">@@ -30,10 +30,11 @@
</span><span class="cx">
</span><span class="cx"> from zope.interface import implementer, Interface
</span><span class="cx">
</span><ins>+from twistedcaldav.simpleresource import SimpleResource
+
</ins><span class="cx"> from twisted.internet.defer import Deferred, succeed
</span><span class="cx">
</span><span class="cx"> from txweb2.stream import IByteStream, fallbackSplit
</span><del>-from txweb2.resource import Resource
</del><span class="cx"> from txweb2.http_headers import MimeType
</span><span class="cx"> from txweb2.http import Response
</span><span class="cx">
</span><span class="lines">@@ -122,7 +123,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-class EventSourceResource(Resource):
</del><ins>+class EventSourceResource(SimpleResource):
</ins><span class="cx"> """
</span><span class="cx"> Resource that vends HTML5 EventSource events.
</span><span class="cx">
</span><span class="lines">@@ -132,7 +133,7 @@
</span><span class="cx"> addSlash = False
</span><span class="cx">
</span><span class="cx">
</span><del>- def __init__(self, eventDecoder, bufferSize=400):
</del><ins>+ def __init__(self, eventDecoder, principalCollections, bufferSize=400):
</ins><span class="cx"> """
</span><span class="cx"> @param eventDecoder: An object that can be used to extract data from
</span><span class="cx"> an event for encoding into an EventSource data stream.
</span><span class="lines">@@ -142,7 +143,7 @@
</span><span class="cx"> buffer.
</span><span class="cx"> @type bufferSize: L{int}
</span><span class="cx"> """
</span><del>- Resource.__init__(self)
</del><ins>+ super(EventSourceResource, self).__init__(principalCollections, isdir=False)
</ins><span class="cx">
</span><span class="cx"> self._eventDecoder = eventDecoder
</span><span class="cx"> self._events = deque(maxlen=bufferSize)
</span><span class="lines">@@ -200,7 +201,7 @@
</span><span class="cx"> C{events}. Vending will resume starting from the following event.
</span><span class="cx"> @type lastID: L{int}
</span><span class="cx"> """
</span><del>- object.__init__(self)
</del><ins>+ super(EventStream, self).__init__()
</ins><span class="cx">
</span><span class="cx"> self._eventDecoder = eventDecoder
</span><span class="cx"> self._events = events
</span></span></pre></div>
<a id="CalendarServertrunkcalendarserverwebadminlandingpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/webadmin/landing.py (13539 => 13540)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/webadmin/landing.py        2014-05-27 20:18:54 UTC (rev 13539)
+++ CalendarServer/trunk/calendarserver/webadmin/landing.py        2014-05-27 21:11:51 UTC (rev 13540)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> """
</span><span class="cx">
</span><span class="cx"> def __init__(self):
</span><del>- PageElement.__init__(self, u"landing")
</del><ins>+ super(WebAdminLandingPageElement, self).__init__(u"landing")
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def pageSlots(self):
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def __init__(self, path, root, directory, store, principalCollections=()):
</span><del>- TemplateResource.__init__(self, WebAdminLandingPageElement)
</del><ins>+ super(WebAdminLandingResource, self).__init__(WebAdminLandingPageElement, principalCollections, True)
</ins><span class="cx">
</span><span class="cx"> from twistedcaldav.config import config as configuration
</span><span class="cx">
</span><span class="lines">@@ -65,11 +65,11 @@
</span><span class="cx"> # self._root = root
</span><span class="cx"> # self._principalCollections = principalCollections
</span><span class="cx">
</span><del>- from .config import ConfigurationResource
- self.putChild(u"config", ConfigurationResource(configuration))
</del><ins>+ #from .config import ConfigurationResource
+ #self.putChild(u"config", ConfigurationResource(configuration, principalCollections))
</ins><span class="cx">
</span><del>- from .principals import PrincipalsResource
- self.putChild(u"principals", PrincipalsResource(directory, store))
</del><ins>+ #from .principals import PrincipalsResource
+ #self.putChild(u"principals", PrincipalsResource(directory, store, principalCollections))
</ins><span class="cx">
</span><span class="cx"> # from .logs import LogsResource
</span><span class="cx"> # self.putChild(u"logs", LogsResource())
</span><span class="lines">@@ -95,18 +95,18 @@
</span><span class="cx">
</span><span class="cx"> if name == u"config":
</span><span class="cx"> reload(config)
</span><del>- return config.ConfigurationResource(self.configuration)
</del><ins>+ return config.ConfigurationResource(self.configuration, self._principalCollections)
</ins><span class="cx">
</span><span class="cx"> elif name == u"principals":
</span><span class="cx"> reload(principals)
</span><del>- return principals.PrincipalsResource(self.directory, self.store)
</del><ins>+ return principals.PrincipalsResource(self.directory, self.store, self._principalCollections)
</ins><span class="cx">
</span><span class="cx"> elif name == u"logs":
</span><span class="cx"> reload(logs)
</span><del>- return logs.LogsResource()
</del><ins>+ return logs.LogsResource(self._principalCollections)
</ins><span class="cx">
</span><span class="cx"> elif name == u"work":
</span><span class="cx"> reload(work)
</span><del>- return work.WorkMonitorResource(self.store)
</del><ins>+ return work.WorkMonitorResource(self.store, self._principalCollections)
</ins><span class="cx">
</span><span class="cx"> return None
</span></span></pre></div>
<a id="CalendarServertrunkcalendarserverwebadminlogspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/webadmin/logs.py (13539 => 13540)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/webadmin/logs.py        2014-05-27 20:18:54 UTC (rev 13539)
+++ CalendarServer/trunk/calendarserver/webadmin/logs.py        2014-05-27 21:11:51 UTC (rev 13540)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> """
</span><span class="cx">
</span><span class="cx"> def __init__(self):
</span><del>- PageElement.__init__(self, u"logs")
</del><ins>+ super(LogsPageElement, self).__init__(u"logs")
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def pageSlots(self):
</span><span class="lines">@@ -61,10 +61,10 @@
</span><span class="cx"> addSlash = True
</span><span class="cx">
</span><span class="cx">
</span><del>- def __init__(self):
- TemplateResource.__init__(self, LogsPageElement)
</del><ins>+ def __init__(self, principalCollections):
+ super(LogsResource, self).__init__(LogsPageElement, principalCollections, isdir=False)
</ins><span class="cx">
</span><del>- self.putChild(u"events", LogEventsResource())
</del><ins>+ self.putChild(u"events", LogEventsResource(principalCollections))
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -73,8 +73,8 @@
</span><span class="cx"> Log event vending resource.
</span><span class="cx"> """
</span><span class="cx">
</span><del>- def __init__(self):
- EventSourceResource.__init__(self, EventDecoder)
</del><ins>+ def __init__(self, principalCollections):
+ super(LogEventsResource, self).__init__(EventDecoder, principalCollections)
</ins><span class="cx">
</span><span class="cx"> self.observers = (
</span><span class="cx"> AccessLogObserver(self),
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx"> """
</span><span class="cx">
</span><span class="cx"> def __init__(self, resource):
</span><del>- CommonAccessLoggingObserverExtensions.__init__(self)
</del><ins>+ super(AccessLogObserver, self).__init__()
</ins><span class="cx">
</span><span class="cx"> self._resource = resource
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunkcalendarserverwebadminprincipalspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/webadmin/principals.py (13539 => 13540)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/webadmin/principals.py        2014-05-27 20:18:54 UTC (rev 13539)
+++ CalendarServer/trunk/calendarserver/webadmin/principals.py        2014-05-27 21:11:51 UTC (rev 13540)
</span><span class="lines">@@ -28,11 +28,12 @@
</span><span class="cx"> from cStringIO import StringIO
</span><span class="cx"> from zipfile import ZipFile
</span><span class="cx">
</span><ins>+from twistedcaldav.simpleresource import SimpleResource
+
</ins><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue
</span><span class="cx"> from twisted.web.template import tags as html, renderer
</span><span class="cx">
</span><span class="cx"> from txweb2.stream import MemoryStream
</span><del>-from txweb2.resource import Resource
</del><span class="cx"> from txweb2.http import Response
</span><span class="cx"> from txweb2.http_headers import MimeType
</span><span class="cx">
</span><span class="lines">@@ -46,7 +47,7 @@
</span><span class="cx"> """
</span><span class="cx">
</span><span class="cx"> def __init__(self, directory):
</span><del>- PageElement.__init__(self, u"principals")
</del><ins>+ super(PrincipalsPageElement, self).__init__(u"principals")
</ins><span class="cx">
</span><span class="cx"> self._directory = directory
</span><span class="cx">
</span><span class="lines">@@ -112,9 +113,9 @@
</span><span class="cx"> addSlash = True
</span><span class="cx">
</span><span class="cx">
</span><del>- def __init__(self, directory, store):
- TemplateResource.__init__(
- self, lambda: PrincipalsPageElement(directory)
</del><ins>+ def __init__(self, directory, store, principalCollections):
+ super(PrincipalsResource, self).__init__(
+ lambda: PrincipalsPageElement(directory), principalCollections, isdir=False
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> self._directory = directory
</span><span class="lines">@@ -129,7 +130,7 @@
</span><span class="cx"> record = yield self._directory.recordWithUID(name)
</span><span class="cx">
</span><span class="cx"> if record:
</span><del>- returnValue(PrincipalResource(record, self._store))
</del><ins>+ returnValue(PrincipalResource(record, self._store, self._principalCollections))
</ins><span class="cx"> else:
</span><span class="cx"> returnValue(None)
</span><span class="cx">
</span><span class="lines">@@ -141,7 +142,7 @@
</span><span class="cx"> """
</span><span class="cx">
</span><span class="cx"> def __init__(self, record):
</span><del>- PageElement.__init__(self, u"principals_edit")
</del><ins>+ super(PrincipalPageElement, self).__init__(u"principals_edit")
</ins><span class="cx">
</span><span class="cx"> self._record = record
</span><span class="cx">
</span><span class="lines">@@ -168,9 +169,9 @@
</span><span class="cx"> addSlash = True
</span><span class="cx">
</span><span class="cx">
</span><del>- def __init__(self, record, store):
- TemplateResource.__init__(
- self, lambda: PrincipalPageElement(record)
</del><ins>+ def __init__(self, record, store, principalCollections):
+ super(PrincipalResource, self).__init__(
+ lambda: PrincipalPageElement(record), principalCollections, isdir=False
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> self._record = record
</span><span class="lines">@@ -182,11 +183,11 @@
</span><span class="cx"> return self
</span><span class="cx">
</span><span class="cx"> if name == "calendars_combined":
</span><del>- return PrincipalCalendarsExportResource(self._record, self._store)
</del><ins>+ return PrincipalCalendarsExportResource(self._record, self._store, self._principalCollections)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-class PrincipalCalendarsExportResource(Resource):
</del><ins>+class PrincipalCalendarsExportResource(SimpleResource):
</ins><span class="cx"> """
</span><span class="cx"> Resource that vends a principal's calendars as iCalendar text.
</span><span class="cx"> """
</span><span class="lines">@@ -194,8 +195,8 @@
</span><span class="cx"> addSlash = False
</span><span class="cx">
</span><span class="cx">
</span><del>- def __init__(self, record, store):
- Resource.__init__(self)
</del><ins>+ def __init__(self, record, store, principalCollections):
+ super(PrincipalCalendarsExportResource, self).__init__(principalCollections, isdir=False)
</ins><span class="cx">
</span><span class="cx"> self._record = record
</span><span class="cx"> self._store = store
</span></span></pre></div>
<a id="CalendarServertrunkcalendarserverwebadminresourcepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/webadmin/resource.py (13539 => 13540)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/webadmin/resource.py        2014-05-27 20:18:54 UTC (rev 13539)
+++ CalendarServer/trunk/calendarserver/webadmin/resource.py        2014-05-27 21:11:51 UTC (rev 13540)
</span><span class="lines">@@ -24,6 +24,8 @@
</span><span class="cx"> "TemplateResource",
</span><span class="cx"> ]
</span><span class="cx">
</span><ins>+from twistedcaldav.simpleresource import SimpleResource
+
</ins><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue
</span><span class="cx"> from twisted.python.modules import getModule
</span><span class="cx"> from twisted.web.template import (
</span><span class="lines">@@ -31,7 +33,6 @@
</span><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> from txweb2.stream import MemoryStream
</span><del>-from txweb2.resource import Resource
</del><span class="cx"> from txweb2.http import Response
</span><span class="cx"> from txweb2.http_headers import MimeType
</span><span class="cx">
</span><span class="lines">@@ -43,7 +44,7 @@
</span><span class="cx"> """
</span><span class="cx">
</span><span class="cx"> def __init__(self, templateName):
</span><del>- Element.__init__(self)
</del><ins>+ super(PageElement, self).__init__()
</ins><span class="cx">
</span><span class="cx"> self.loader = XMLFile(
</span><span class="cx"> getModule(__name__).filePath.sibling(
</span><span class="lines">@@ -76,7 +77,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-class TemplateResource(Resource):
</del><ins>+class TemplateResource(SimpleResource):
</ins><span class="cx"> """
</span><span class="cx"> Resource that renders a template.
</span><span class="cx"> """
</span><span class="lines">@@ -92,8 +93,8 @@
</span><span class="cx"> # def queryValues(request, arguments):
</span><span class="cx"> # return request.args.get(arguments, [])
</span><span class="cx">
</span><del>- def __init__(self, elementClass):
- Resource.__init__(self)
</del><ins>+ def __init__(self, elementClass, pc, isdir):
+ super(TemplateResource, self).__init__(pc, isdir=isdir)
</ins><span class="cx">
</span><span class="cx"> self.elementClass = elementClass
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunkcalendarserverwebadmintesttest_eventsourcepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/webadmin/test/test_eventsource.py (13539 => 13540)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/webadmin/test/test_eventsource.py        2014-05-27 20:18:54 UTC (rev 13539)
+++ CalendarServer/trunk/calendarserver/webadmin/test/test_eventsource.py        2014-05-27 21:11:51 UTC (rev 13540)
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx"> """
</span><span class="cx">
</span><span class="cx"> def eventSourceResource(self):
</span><del>- return EventSourceResource(DictionaryEventDecoder)
</del><ins>+ return EventSourceResource(DictionaryEventDecoder, None)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def render(self, resource):
</span></span></pre></div>
<a id="CalendarServertrunkcalendarserverwebadminworkpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/webadmin/work.py (13539 => 13540)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/webadmin/work.py        2014-05-27 20:18:54 UTC (rev 13539)
+++ CalendarServer/trunk/calendarserver/webadmin/work.py        2014-05-27 21:11:51 UTC (rev 13540)
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx"> """
</span><span class="cx">
</span><span class="cx"> def __init__(self):
</span><del>- PageElement.__init__(self, u"work")
</del><ins>+ super(WorkMonitorPageElement, self).__init__(u"work")
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def pageSlots(self):
</span><span class="lines">@@ -76,12 +76,12 @@
</span><span class="cx"> addSlash = True
</span><span class="cx">
</span><span class="cx">
</span><del>- def __init__(self, store):
- TemplateResource.__init__(
- self, lambda: WorkMonitorPageElement()
</del><ins>+ def __init__(self, store, principalCollections):
+ super(WorkMonitorResource, self).__init__(
+ lambda: WorkMonitorPageElement(), principalCollections, isdir=False
</ins><span class="cx"> )
</span><span class="cx">
</span><del>- self.putChild(u"events", WorkEventsResource(store))
</del><ins>+ self.putChild(u"events", WorkEventsResource(store, principalCollections))
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -93,8 +93,8 @@
</span><span class="cx"> log = Logger()
</span><span class="cx">
</span><span class="cx">
</span><del>- def __init__(self, store, pollInterval=1000):
- EventSourceResource.__init__(self, EventDecoder, bufferSize=100)
</del><ins>+ def __init__(self, store, principalCollections, pollInterval=1000):
+ super(WorkEventsResource, self).__init__(EventDecoder, principalCollections, bufferSize=100)
</ins><span class="cx">
</span><span class="cx"> self._store = store
</span><span class="cx"> self._pollInterval = pollInterval
</span><span class="lines">@@ -114,8 +114,8 @@
</span><span class="cx">
</span><span class="cx"> self._polling = True
</span><span class="cx">
</span><ins>+ txn = self._store.newTransaction()
</ins><span class="cx"> try:
</span><del>- txn = self._store.newTransaction()
</del><span class="cx">
</span><span class="cx"> # Look up all of the jobs
</span><span class="cx">
</span><span class="lines">@@ -146,8 +146,8 @@
</span><span class="cx"> jobDict = dict(
</span><span class="cx"> job_jobID=job.jobID,
</span><span class="cx"> job_priority=job.priority,
</span><ins>+ job_weight=job.weight,
</ins><span class="cx"> job_notBefore=formatTime(job.notBefore),
</span><del>- job_notAfter=formatTime(job.notAfter),
</del><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> work = yield job.workItem()
</span><span class="lines">@@ -214,7 +214,10 @@
</span><span class="cx">
</span><span class="cx"> except:
</span><span class="cx"> self._polling = False
</span><ins>+ yield txn.abort()
</ins><span class="cx"> raise
</span><ins>+ else:
+ yield txn.commit()
</ins><span class="cx">
</span><span class="cx"> # Schedule the next poll
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunkcalendarserverwebadminworkxhtml"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/webadmin/work.xhtml (13539 => 13540)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/webadmin/work.xhtml        2014-05-27 20:18:54 UTC (rev 13539)
+++ CalendarServer/trunk/calendarserver/webadmin/work.xhtml        2014-05-27 21:11:51 UTC (rev 13540)
</span><span class="lines">@@ -96,8 +96,8 @@
</span><span class="cx"> // Job management
</span><span class="cx"> "job_jobID": "Job ID",
</span><span class="cx"> "job_priority": "Job Priority",
</span><ins>+ "job_weight": "Job Weight",
</ins><span class="cx"> "job_notBefore": "Not Before",
</span><del>- "job_notAfter": "Not After",
</del><span class="cx">
</span><span class="cx"> // Work item management
</span><span class="cx"> "work_workID": "Work ID",
</span><span class="lines">@@ -465,8 +465,8 @@
</span><span class="cx"> <tr>
</span><span class="cx"> <th>Job ID</th>
</span><span class="cx"> <th>Priority</th>
</span><ins>+ <th>Weight</th>
</ins><span class="cx"> <th>Not Before</th>
</span><del>- <th>Not After</th>
</del><span class="cx"> </tr>
</span><span class="cx"> </thead>
</span><span class="cx"> <tbody id="work_item_details_body" />
</span></span></pre>
</div>
</div>
</body>
</html>