Index: openacs-4/packages/file-storage/file-storage.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/file-storage.info,v diff -u -r1.29.2.15 -r1.29.2.16 --- openacs-4/packages/file-storage/file-storage.info 13 Oct 2004 15:12:20 -0000 1.29.2.15 +++ openacs-4/packages/file-storage/file-storage.info 30 Nov 2004 20:34:11 -0000 1.29.2.16 @@ -7,17 +7,17 @@ f f - + OpenACS Collaborative document storage 2004-07-21 OpenACS Provides a versioned document store with storage in the filesystem or database (depending on configuration). Documents and folders can be permissioned and folders downloaded. - + - + Index: openacs-4/packages/file-storage/tcl/file-storage-dav-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-dav-procs.tcl,v diff -u -r1.3.2.7 -r1.3.2.8 --- openacs-4/packages/file-storage/tcl/file-storage-dav-procs.tcl 25 Oct 2004 16:28:04 -0000 1.3.2.7 +++ openacs-4/packages/file-storage/tcl/file-storage-dav-procs.tcl 30 Nov 2004 20:34:11 -0000 1.3.2.8 @@ -1,5 +1,3 @@ -# - ad_library { Procedures for DAV service contract implementations @@ -96,9 +94,32 @@ ad_proc fs::impl::fs_object::mkcol {} { MKCOL method - not valid for resource } { - return [list 409] + set uri [oacs_dav::conn uri] + set user_id [oacs_dav::conn user_id] + set peer_addr [oacs_dav::conn peeraddr] + set item_id [oacs_dav::conn item_id] + set fname [oacs_dav::conn item_name] + set parent_id [oacs_dav::item_parent_folder_id $uri] + if {[empty_string_p $parent_id]} { + return [list 409] + } + if { ![empty_string_p $item_id]} { + return [list 405] + } + + if { [catch { + fs::new_folder \ + -name $fname \ + -pretty_name $fname \ + -parent_id $parent_id \ + -creation_user $user_id \ + -creation_ip $peer_addr \ + } ]} { + return [list 500] + } + + return [list 201] } ad_proc fs::impl::fs_object::proppatch {} { @@ -137,4 +158,13 @@ } { return "file_storage_object" -} \ No newline at end of file +} + +namespace eval fs::impl::dav_mkcol_type {} + +ad_proc fs::impl::dav_mkcol_type::get_type {} { + +} { + return "file_storage_object" +} + Index: openacs-4/packages/file-storage/tcl/file-storage-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-install-procs.tcl,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/file-storage/tcl/file-storage-install-procs.tcl 26 May 2004 18:54:04 -0000 1.1.2.2 +++ openacs-4/packages/file-storage/tcl/file-storage-install-procs.tcl 30 Nov 2004 20:34:12 -0000 1.1.2.3 @@ -1,5 +1,3 @@ -# - ad_library { Sets up WebDAV support service contracts @@ -35,8 +33,11 @@ add file-storage repository service contract implementation } { - - set spec { + ns_log Notice "registering fs dav implementations." + + ### dav contract + + set spec { name "file_storage_object" aliases { get fs::impl::fs_object::get @@ -57,20 +58,44 @@ acs_sc::impl::new_from_spec -spec $spec - set spec { - name "file-storage" - aliases { - get_type fs::impl::dav_put_type::get_type - } - contract_name {dav_put_type} - owner "file-storage" - } + ### dav_put_type - acs_sc::impl::new_from_spec -spec $spec - -} + set spec { + name "file-storage" + aliases { + get_type fs::impl::dav_put_type::get_type + } + contract_name {dav_put_type} + owner "file-storage" + } + acs_sc::impl::new_from_spec -spec $spec + ### dav_mkcol_type + + set spec { + name "file-storage" + aliases { + get_type fs::impl::dav_mkcol_type::get_type + } + contract_name {dav_mkcol_type} + owner "file-storage" + } + + acs_sc::impl::new_from_spec -spec $spec + + set spec { + name "file-storage" + aliases { + get_type fs::impl::dav_mkcol_type::get_type + } + contract_name {dav_mkcol_type} + owner "file-storage" + } + + acs_sc::impl::new_from_spec -spec $spec +} + ad_proc -private fs::install::unregister_implementation { } { remove file-storage service contract implementation @@ -94,7 +119,17 @@ # by content::init so it can be recreated file delete [file join [acs_root_dir] templates "file-storage-default.tcl"] } - + 5.1.0a10 5.1.0a11 { + set spec { + name "file-storage" + aliases { + get_type fs::impl::dav_mkcol_type::get_type + } + contract_name {dav_mkcol_type} + owner "file-storage" + } + acs_sc::impl::new_from_spec -spec $spec + } } } \ No newline at end of file