def _get_caldav_schedule_inbox_URL(self, uri):
dbname, dburi = self._get_dburi(uri)
if not dbname:
raise DAV_NotFound
pool = Pool(Transaction().cursor.database_name)
try:
Collection = pool.get('webdav.collection')
except KeyError:
raise DAV_NotFound
if not getattr(Collection, 'get_schedule_inbox_URL', None):
raise DAV_NotFound
try:
res = Collection.get_schedule_inbox_URL(dburi, cache=CACHE)
except DAV_Error, exception:
self._log_exception(exception)
raise
except Exception, exception:
self._log_exception(exception)
raise DAV_Error(500)
uparts = list(urlparse.urlsplit(uri))
uparts[2] = urllib.quote(dbname + res)
doc = domimpl.createDocument(None, 'href', None)
href = doc.documentElement
href.tagName = 'D:href'
huri = doc.createTextNode(urlparse.urlunsplit(uparts))
href.appendChild(huri)
return href
评论列表
文章目录