Index: openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql 15 Feb 2004 01:41:14 -0000 1.9 +++ openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql 19 Feb 2004 16:44:44 -0000 1.10 @@ -27,7 +27,8 @@ -- package_id in apm_packages.package_id%TYPE, folder_name in cr_folders.label%TYPE default null, - folder_url in cr_items.name%TYPE default null + folder_url in cr_items.name%TYPE default null, + description in cr_folders.description%TYPE default null ) return fs_root_folders.folder_id%TYPE; function new_file( @@ -194,7 +195,8 @@ -- package_id in apm_packages.package_id%TYPE, folder_name in cr_folders.label%TYPE, - folder_url in cr_items.name%TYPE + folder_url in cr_items.name%TYPE, + description in cr_folders.description%TYPE default null ) return fs_root_folders.folder_id%TYPE is v_folder_id fs_root_folders.folder_id%TYPE; @@ -204,6 +206,7 @@ name => file_storage.new_root_folder.folder_url, label => file_storage.new_root_folder.folder_name, context_id => file_storage.new_root_folder.package_id + description => file_storage.new_root_folder.description ); insert Index: openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql,v diff -u -r1.17 -r1.18 --- openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql 15 Feb 2004 01:41:16 -0000 1.17 +++ openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql 19 Feb 2004 16:44:45 -0000 1.18 @@ -63,21 +63,23 @@ -- integer, -- apm_packages.package_id%TYPE varchar, -- cr_folders.label%TYPE - varchar -- cr_items.name%TYPE + varchar, -- cr_items.name%TYPE + description ) returns integer as ' -- fs_root_folders.folder_id%TYPE declare new_root_folder__package_id alias for $1; new_root_folder__folder_name alias for $2; new_root_folder__url alias for $3; + new_root_folder__description alias for $4; v_folder_id fs_root_folders.folder_id%TYPE; begin v_folder_id := content_folder__new ( new_root_folder__url, -- name new_root_folder__folder_name, -- label - null, -- description + new_root_folder__description, -- description null, -- parent_id (default) new_root_folder__package_id, --context_id null, --folder_id Index: openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql,v diff -u -r1.23 -r1.24 --- openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql 15 Feb 2004 01:41:16 -0000 1.23 +++ openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql 19 Feb 2004 16:44:45 -0000 1.24 @@ -9,7 +9,8 @@ :1 := file_storage.new_root_folder( url => :name, package_id => :package_id, - label => :label + label => :pretty_name, + description => :description ); end; Index: openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql,v diff -u -r1.37 -r1.38 --- openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 16 Feb 2004 19:07:57 -0000 1.37 +++ openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 19 Feb 2004 16:44:45 -0000 1.38 @@ -3,12 +3,13 @@ postgresql7.1 - + select file_storage__new_root_folder ( :package_id, - :label, -- label - :name -- name + :pretty_name, -- label + :name, -- name + :description ) Index: openacs-4/packages/file-storage/tcl/file-storage-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs.tcl,v diff -u -r1.41 -r1.42 --- openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 16 Feb 2004 19:07:57 -0000 1.41 +++ openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 19 Feb 2004 16:44:45 -0000 1.42 @@ -205,12 +205,46 @@ # root folder is associated with a site_node/package_id set label $sn(instance_name) - set name "file-storage_${package_id}" - set folder_id [db_exec_plsql new_root_folder {}] + + set folder_id [fs::new_root_folder \ + -package_id $package_id \ + -pretty_name $label + ] + oacs_dav::register_folder -enabled_p "t" $folder_id $sn(node_id) } +ad_proc -public fs::new_root_folder { + {-package_id ""} + {-pretty_name ""} + {-description ""} + {-name ""} +} { + Create a root folder for a package instance. + + @param package_id Package instance associated with this root folder + + @return folder_id of the new root folder +} { + + if {[empty_string_p $package_id]} { + set package_id [ad_conn package_id] + } + + if {[empty_string_p $pretty_name]} { + set pretty_name [apm_instance_name_from_id $package_id] + } + + if {[empty_string_p $name]} { + set name "file-storage_${package_id}" + } + + return [db_exec_plsql new_root_folder {}] + +} + + ad_proc -public fs::get_root_folder { {-package_id ""} } {