oacs_dav::impl::content_revision::propfind (private)

 oacs_dav::impl::content_revision::propfind

Defined in packages/oacs-dav/tcl/oacs-dav-procs.tcl

PROPFIND DAV method for generic content revision

Author:
Dave Bauer

Partial Call Graph (max 5 caller/called nodes):
%3 AcsSc.dav.propfind.content_revision AcsSc.dav.propfind.content_revision (private) oacs_dav::impl::content_revision::propfind oacs_dav::impl::content_revision::propfind AcsSc.dav.propfind.content_revision->oacs_dav::impl::content_revision::propfind db_1row db_1row (public) oacs_dav::impl::content_revision::propfind->db_1row oacs_dav::conn oacs_dav::conn (public) oacs_dav::impl::content_revision::propfind->oacs_dav::conn tdav::get_user_props tdav::get_user_props oacs_dav::impl::content_revision::propfind->tdav::get_user_props

Testcases:
No testcase defined.
Source code:
    set user_id [oacs_dav::conn user_id]
    set item_id [oacs_dav::conn item_id]
    set folder_id [oacs_dav::conn folder_id]
    set uri [oacs_dav::conn uri]

    set depth [oacs_dav::conn depth]
    set prop_req [oacs_dav::conn prop_req]

    set os_time_zone [clock format [clock seconds] -format %Z]

    # find the values
    db_1row get_properties ""
    set etag "1f9a-400-3948d0f5"
    set properties [list]
    # is "D" the namespace??
    lappend properties [list "D" "getcontentlength"$content_length
#    lappend properties [list "D" "uri"] $item_uri
    lappend properties [list "D" "getcontenttype"$mime_type
    # where do we get an etag from?
    lappend properties [list "D" "getetag"$etag
    lappend properties [list "D" "getlastmodified"$last_modified
    lappend properties [list "D" "creationdate"$creation_date
    lappend properties [list "D" "resourcetype"""

        foreach i [tdav::get_user_props ${uri} $depth $prop_req] {
            lappend properties $i
        }

    set response [list 207 [list [list $uri "" $properties]]]

    return $response
Generic XQL file:
packages/oacs-dav/tcl/oacs-dav-procs.xql

PostgreSQL XQL file:
<fullquery name="oacs_dav::impl::content_revision::propfind.get_properties">
    <querytext>
      select
	ci.item_id,
	ci.name,
	content_item__get_path(ci.item_id,:folder_id) as item_uri,
	coalesce(cr.mime_type,'*/*') as mime_type,
	coalesce(cr.content_length,0) as content_length,
	to_char(timezone('GMT',o.creation_date) :: timestamptz ,'YYYY-MM-DD"T"HH:MM:SS.MS"Z"') as creation_date,
	to_char(timezone('GMT',o.last_modified) :: timestamptz ,'Dy, DD Mon YYYY HH:MM:SS TZ') as last_modified
      from cr_items ci,
      acs_objects o,
      cr_revisions cr
      where 
      ci.item_id=:item_id
      and ci.item_id = o.object_id
      and cr.revision_id = ci.live_revision
      and acs_permission__permission_p(ci.item_id, :user_id, 'read')
    </querytext>
</fullquery>
packages/oacs-dav/tcl/oacs-dav-procs-postgresql.xql

Oracle XQL file:
<fullquery name="oacs_dav::impl::content_revision::propfind.get_properties">
    <querytext>
      select
	ci.item_id,
	ci.name,
	content_item.get_path(ci.item_id,:folder_id) as item_uri,
	nvl(cr.mime_type,'*/*') as mime_type,
	nvl(cr.content_length,0) as content_length,
	to_char(o.creation_date, 'YYYY-MM-DD"T"HH:MI:SS."000"') as creation_date,
	to_char(o.last_modified, 'Dy, Dd Mon YYYY HH:MI:SS "${os_time_zone}"') as last_modified

      from cr_items ci,
      acs_objects o,
      cr_revisions cr
      where 
      ci.item_id=:item_id
      and ci.item_id = o.object_id
      and cr.revision_id=ci.live_revision
    </querytext>
</fullquery>
packages/oacs-dav/tcl/oacs-dav-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: