caldav::CalDAV instproc calcCtag (public)

 <instance of caldav::CalDAV[i]> calcCtag user_id

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

Generate a ctag (collection entity tag). The calendar ctag is like a resource etag; it changes when anything in the (joint) calendar has changed. This implementation returns a md5 value from the sum of the cal_item_ids, which changes when an item is deleted or a new community is joined, and the latest modification date of the cal_item_ids.

Parameters:
user_id (required)

Testcases:
macOS_subscribe
Source code:
lappend clauses  {*}[calendars communityCalendarClause $user_id]  {*}[calendars alwaysQueriedClause $user_id]
#ns_log notice "calendar_clause [join $clauses { union }]"
return [::xo::dc get_value lastmod [subst {
    select md5(sum(cal_item_id)::text || max(last_modified)::text)
    from   cal_items ci
    join   acs_objects ao on (ao.object_id = ci.cal_item_id)
    where  ci.on_which_calendar in
    ([join $clauses " union "])
}]]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: