caldav::CalDAV instproc PROPPATCH (public)

 <instance of caldav::CalDAV[i]> PROPPATCH

Defined in /var/www/openacs/packages/caldav/tcl/caldav-procs.tcl

Handle a WebDAV property update request. Valid set requests receive a multistatus response marking each requested property as forbidden.

Testcases:
Thunderbird_subscribe, macOS_subscribe
Source code:

set content [:getcontent]
set doc [:parseRequest $content]

# TODO: we assume, we are working on the aggregated calendar
:calendar_ids ""

if {$doc eq ""} {
    return [:request_error "request document invalid:\n$content"]
}
set reply ""
set innerresponse ""

set root [$doc documentElement]
set props [$root selectNodes -namespaces ${:namespaces} /d:propertyupdate/d:set/d:prop]
if {[llength $props] == 0} {
    ns_log Warning "PROPPATCH: invalid request: no property /d:propertyupdate/d:set/d:prop in\n$content"
    set statusCode 400
} else {
    #
    # Return a multistatus with all properties forbidden.
    #
    foreach n [$props childNodes] {
        append innerresponse [subst {<d:propstat>
            <d:prop><Z:[$n localName] xmlns:Z="[$n name]"/></d:prop>
            <d:status>HTTP/1.1 403 Forbidden</d:status>
            </d:propstat>}]
    }
    set resp [subst {<?xml version="1.0" encoding="utf-8" ?>
        <d:multistatus xmlns:d="DAV:">
        <d:response>
        <d:href>[string trimright [ns_conn url] "/"]</d:href>
        $innerresponse
        </d:response>
        </d:multistatus>}]
    set statusCode 207
}
:response $statusCode text/xml $resp
$doc delete
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: