Index: openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl,v diff -u -r1.90.2.3 -r1.90.2.4 --- openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 4 Apr 2006 15:22:02 -0000 1.90.2.3 +++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 19 Apr 2006 21:52:58 -0000 1.90.2.4 @@ -278,7 +278,7 @@ where person_id = :user_id }] - # get the root folder of this package instance + # get the root folder of dotlrn file storage instance set package_id [site_node_apm_integration::get_child_package_id \ -package_id [dotlrn::get_package_id] \ -package_key [package_key] \ @@ -287,10 +287,8 @@ set root_folder_id [fs::get_root_folder -package_id $package_id] # does this user already have a root folder? - set user_root_folder_id [fs::get_folder \ - -name [get_user_root_folder_name -user_id $user_id] \ - -parent_id $root_folder_id \ - ] + set user_root_folder_id [get_user_root_folder_not_cached \ + -user_id $user_id] set node_id [site_node::get_node_id_from_object_id -object_id $package_id] @@ -315,10 +313,8 @@ } # does this user already have a shared folder? - set user_shared_folder_id [fs::get_folder \ - -name [get_user_shared_folder_name -user_id $user_id] \ - -parent_id $user_root_folder_id \ - ] + set user_shared_folder_id [get_user_shared_folder \ + -user_id $user_id] if {[empty_string_p $user_shared_folder_id]} { @@ -865,11 +861,12 @@ Get the folder_id of a user's root folder. } { set name [get_user_root_folder_name -user_id $user_id] - + set parent_id [get_dotlrn_root_folder_id] return [db_string get_user_root_folder { select folder_id from fs_folders where key = :name + and parent_id = :parent_id } -default ""] } @@ -887,11 +884,12 @@ Get the folder_id of a user's shared folder. } { set name [get_user_shared_folder_name -user_id $user_id] - + set parent_id [get_user_root_folder -user_id $user_id] return [db_string get_user_root_folder { select folder_id from fs_folders where key = :name + and parent_id = :parent_id } -default ""] } @@ -917,4 +915,18 @@ return [db_string select_community_shared_folder {} -default ""] } + + ad_proc -public get_dotlrn_root_folder_id { + } { + get the root file storage folder for dotlrn + } { + # get the root folder of the main dotlrn file storage instance + set package_id [site_node_apm_integration::get_child_package_id \ + -package_id [dotlrn::get_package_id] \ + -package_key [package_key] \ + ] + + return [fs::get_root_folder -package_id $package_id] + + } }