oacs_dav::handle_request (public)
oacs_dav::handle_request [ args... ]
Defined in packages/oacs-dav/tcl/oacs-dav-procs.tcl
dispatch request to the proper service contract implementation
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set uri [oacs_dav::conn uri] set method [string tolower [ns_conn method]] ns_log debug "\noacs_dav::handle_request method=$method uri=$uri" set item_id [oacs_dav::conn item_id] set folder_id [oacs_dav::conn folder_id] set package_id [oacs_dav::conn package_id] set node_id [oacs_dav::conn node_id] set package_key [apm_package_key_from_id $package_id] ns_log debug "\noacs_dav::handle_request item_id is $item_id" if {$item_id eq ""} { ns_log debug "\noacs_dav::handle_request item_id is empty" # set this to null if nothing exists, only valid on PUT or MKCOL # to create a new item, otherwise we bail # item for URI does not exist # ask package what content type to use switch -- $method { mkcol { if {![acs_sc_binding_exists_p dav_mkcol_type $package_key]} { set content_type "content_folder" } else { set content_type [acs_sc::invoke -contract dav_mkcol_type -operation get_type -call_args "" -impl $package_key] } } put { if {![acs_sc_binding_exists_p dav_put_type $package_key]} { set content_type "content_revision" } else { set content_type [acs_sc::invoke -contract dav_put_type -operation get_type -call_args "" -impl $package_key] } } lock { # assume resource on NULL LOCK set content_type "content_revision" } default { # return a 404 or other error ns_log debug "\noacs_dav::handle_request: 404 handle request Item not found method $method URI $uri" ns_return 404 text/html "File Not Found" return } } } else { # get content type of existing item set content_type [content::item::get_content_type -item_id $item_id] if {$content_type eq ""} { set content_type "content_revision" } set content_type [oacs_dav::conn -set content_type $content_type] } # use content type # i think we should walk up the object type hierarchy up to # content_revision if we don't find an implementation # implementation name is content_type set real_content_type [oacs_dav::conn -set real_content_type $content_type] while {![acs_sc_binding_exists_p dav $content_type]} { # go up content_type hierarchy # we do the query here to avoid running the query # when the implementation for the content_type does # exist set content_type [db_string supertype "select supertype from acs_object_types where object_type = :content_type" -default ""] if { $content_type eq "content_revision"} {break} if { $content_type eq ""} { error "no dav implementation found for content_type $real_content_type" } ns_log Notice "now looking for a dav implementation for content_type $content_type" } oacs_dav::conn -set content_type $content_type # probably should catch this ns_log debug "\noacs_dav::handle_request method $method uri $uri item_id $item_id folder_id $folder_id package_id $package_id node_id $node_id content_type $content_type args $args" set response [acs_sc::invoke -contract dav -operation $method -call_args "" -impl $content_type] # here the sc impl might return us some data, # then we would probably have to send that to tDAV for processing ns_log debug "\nDAV: response is \"$response\"" if {![string equal -nocase "get" $method] && ![string equal -nocase "head" $method]} { tdav::respond $response }Generic XQL file: packages/oacs-dav/tcl/oacs-dav-procs.xql
PostgreSQL XQL file: packages/oacs-dav/tcl/oacs-dav-procs-postgresql.xql
Oracle XQL file: packages/oacs-dav/tcl/oacs-dav-procs-oracle.xql