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.16 -r1.17 --- openacs-4/packages/file-storage/file-storage.info 22 May 2002 16:42:31 -0000 1.16 +++ openacs-4/packages/file-storage/file-storage.info 17 Sep 2002 21:03:22 -0000 1.17 @@ -7,18 +7,18 @@ f f - + oracle postgresql Jowell S. Sabino This application allows users to collaboratively maintain documents on the web server 2000-12-29 - ArsDigita Corporation + OpenACS Now allows storage of files on the filesystem or database. - + @@ -94,6 +94,8 @@ + + @@ -109,6 +111,11 @@ + + + + + @@ -117,6 +124,7 @@ + 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.3 -r1.4 --- openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql 19 Jul 2002 23:17:15 -0000 1.3 +++ openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql 17 Sep 2002 21:03:24 -0000 1.4 @@ -86,6 +86,10 @@ item_id in cr_items.item_id%TYPE ) return varchar; + function get_parent_id( + item_id in cr_items.item_id%TYPE + ) return cr_items.item_id%TYPE; + function get_content_type( -- -- Wrapper for content_item. get_content_type @@ -496,6 +500,20 @@ return v_title; end get_title; + function get_parent_id( + item_id in cr_items.item_id%TYPE + ) return cr_items.item_id%TYPE + is + v_parent_id cr_items.item_id%TYPE; + begin + select parent_id + into v_parent_id + from cr_items + where item_id = get_parent_id.item_id; + + return v_parent_id; + end get_parent_id; + function get_content_type( -- -- Wrapper for content_item. get_content_type Index: openacs-4/packages/file-storage/sql/oracle/file-storage-views-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/oracle/file-storage-views-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/file-storage/sql/oracle/file-storage-views-create.sql 22 May 2002 08:50:52 -0000 1.4 +++ openacs-4/packages/file-storage/sql/oracle/file-storage-views-create.sql 17 Sep 2002 21:03:24 -0000 1.5 @@ -25,13 +25,11 @@ select cr_folders.folder_id, cr_folders.label as name, acs_objects.last_modified, - ((select count(*) - from cr_items ci - where ci.parent_id = cr_folders.folder_id) - + (select count(*) - from fs_simple_objects - where fs_simple_objects.folder_id = cr_folders.folder_id)) as content_size, + from cr_items ci + where ci.content_type <> 'content_folder' + connect by prior ci.item_id = ci.parent_id + start with ci.item_id = cr_folders.folder_id) as content_size, cr_items.parent_id, cr_items.name as key from cr_folders, @@ -45,6 +43,7 @@ select cr_revisions.item_id as file_id, cr_revisions.revision_id as live_revision, cr_revisions.mime_type as type, + cr_revisions.title as file_upload_name, cr_revisions.content_length as content_size, cr_items.name, acs_objects.last_modified, @@ -65,33 +64,39 @@ 'folder' as type, fs_folders.content_size, fs_folders.name, + '' as file_upload_name, fs_folders.last_modified, '' as url, fs_folders.parent_id, fs_folders.key, 0 as sort_key from fs_folders - union + union all select fs_files.file_id as object_id, fs_files.live_revision, fs_files.type, fs_files.content_size, fs_files.name, + fs_files.file_upload_name, fs_files.last_modified, '' as url, fs_files.parent_id, fs_files.key, 1 as sort_key from fs_files - union + union all select fs_urls_full.url_id as object_id, 0 as live_revision, 'url' as type, 0 as content_size, fs_urls_full.name, + fs_urls_full.name as file_upload_name, fs_urls_full.last_modified, fs_urls_full.url, fs_urls_full.folder_id as parent_id, fs_urls_full.url as key, 1 as sort_key from fs_urls_full; + + + 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.6 -r1.7 --- openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql 6 Aug 2002 00:41:35 -0000 1.6 +++ openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql 17 Sep 2002 21:03:25 -0000 1.7 @@ -437,8 +437,7 @@ where folder_id = get_title__item_id; else if v_content_type = ''content_symlink'' then - select label into v_title f - rom cr_symlinks + select label into v_title from cr_symlinks where symlink_id = get_title__item_id; else select name into v_title @@ -451,7 +450,24 @@ end;' language 'plpgsql'; +create function file_storage__get_parent_id ( + integer -- item_id in cr_items.item_id%TYPE + ) returns integer as ' -- cr_items.item_id%TYPE + declare + get_parent_id__item_id alias for $1; + v_parent_id cr_items.item_id%TYPE; + begin + select parent_id + into v_parent_id + from cr_items + where item_id = get_parent_id__item_id; + + return v_parent_id; + +end;'language 'plpgsql'; + + create function file_storage__get_content_type ( -- -- Wrapper for content_item__get_content_type Index: openacs-4/packages/file-storage/sql/postgresql/file-storage-simple-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/postgresql/Attic/file-storage-simple-package-create.sql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/file-storage/sql/postgresql/file-storage-simple-package-create.sql 13 Aug 2002 20:03:34 -0000 1.6 +++ openacs-4/packages/file-storage/sql/postgresql/file-storage-simple-package-create.sql 17 Sep 2002 21:03:25 -0000 1.7 @@ -10,7 +10,7 @@ -- @cvs-id $Id$ -- -select define_function_args('fs_simple_object__new','object_id,object_type;fs_simple_object,folder_id,name,description,creation_date,creation_user,creation_ip,context_id'); +select define_function_args('fs_simple_object__new','object_id,object_type,fs_simple_object,folder_id,name,description,creation_date,creation_user,creation_ip,context_id'); create function fs_simple_object__new(integer,varchar,integer,varchar,varchar,timestamp,integer,varchar,integer) returns integer as ' Index: openacs-4/packages/file-storage/sql/postgresql/file-storage-views-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/postgresql/file-storage-views-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/file-storage/sql/postgresql/file-storage-views-create.sql 22 May 2002 08:50:52 -0000 1.5 +++ openacs-4/packages/file-storage/sql/postgresql/file-storage-views-create.sql 17 Sep 2002 21:03:25 -0000 1.6 @@ -24,14 +24,10 @@ as select cr_folders.folder_id, cr_folders.label as name, - acs_objects.last_modified, - ((select count(*) - from cr_items ci - where ci.parent_id = cr_folders.folder_id) - + - (select count(*) + acs_objects.last_modified, -- JCD needs to walk tree as oracle ver + (select count(*) from fs_simple_objects - where fs_simple_objects.folder_id = cr_folders.folder_id)) as content_size, + where fs_simple_objects.folder_id = cr_folders.folder_id) as content_size, cr_items.parent_id, cr_items.name as key from cr_folders, @@ -46,6 +42,7 @@ select cr_revisions.item_id as file_id, cr_revisions.revision_id as live_revision, cr_revisions.mime_type as type, + cr_revisions.title as file_upload_name, cr_revisions.content_length as content_size, cr_items.name, acs_objects.last_modified, @@ -66,6 +63,7 @@ 'folder' as type, fs_folders.content_size, fs_folders.name, + '' as file_upload_name, fs_folders.last_modified, '' as url, fs_folders.parent_id, @@ -78,6 +76,7 @@ fs_files.type, fs_files.content_size, fs_files.name, + fs_files.file_upload_name, fs_files.last_modified, '' as url, fs_files.parent_id, @@ -90,6 +89,7 @@ 'url' as type, 0 as content_size, fs_urls_full.name, + fs_urls_full.name as file_upload_name, fs_urls_full.last_modified, fs_urls_full.url, fs_urls_full.folder_id as parent_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.18 -r1.19 --- openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql 2 Jul 2002 19:40:00 -0000 1.18 +++ openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql 17 Sep 2002 21:03:26 -0000 1.19 @@ -62,6 +62,7 @@ fs_objects.url, fs_objects.key, fs_objects.sort_key, + fs_objects.file_upload_name, case when fs_objects.last_modified >= (sysdate - :n_past_days) then 1 else 0 end as new_p, acs_permission.permission_p(fs_objects.object_id, :user_id, 'admin') as admin_p, acs_permission.permission_p(fs_objects.object_id, :user_id, 'delete') as delete_p, @@ -131,7 +132,7 @@ where item_id not in (select i2.item_id from cr_items i2 connect by prior i2.parent_id = i2.item_id - start with i2.item_id = :root_folder_id) + start with i2.item_id = file_storage.get_parent_id(:root_folder_id)) connect by prior i.parent_id = i.item_id start with item_id = :start_id order by level desc 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.28 -r1.29 --- openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 26 Jul 2002 01:01:21 -0000 1.28 +++ openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 17 Sep 2002 21:03:26 -0000 1.29 @@ -58,6 +58,7 @@ fs_objects.url, fs_objects.key, fs_objects.sort_key, + fs_objects.file_upload_name, case when fs_objects.last_modified >= (now() - $n_past_days) then 1 else 0 end as new_p, acs_permission__permission_p(fs_objects.object_id, :user_id, 'admin') as admin_p, acs_permission__permission_p(fs_objects.object_id, :user_id, 'delete') as delete_p, @@ -80,7 +81,7 @@ select count(*) from cr_items c1, cr_items c2 - where c2.item_id = :item_id + where c2.item_id = file_storage__get_parent_id(:item_id) and c1.tree_sortkey between c2.tree_sortkey and tree_right(c2.tree_sortkey) and not acs_permission__permission_p(c1.item_id, :user_id, :privilege) 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.24 -r1.25 --- openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 10 Sep 2002 22:22:55 -0000 1.24 +++ openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 17 Sep 2002 21:03:26 -0000 1.25 @@ -193,30 +193,42 @@ when we encounter something we haven't seen before. } { - set mime_type [ns_guesstype $file_name] - set extension [string trimleft [file extension $file_name] "."] + set file_extension [string trimleft [file extension $file_name] "."] - # don't know how to generate nice names like "JPEG Image" - # have to leave it blank for now + if {[empty_string_p $file_extension]} { + return "*/*" + } - #set pretty_mime_type ??? - - if { [db_string mime_type_exists { - select count(*) + if {![db_0or1row select_mime_type "select mime_type from cr_mime_types - where mime_type = :mime_type - }] == 0 } { + where file_extension = :file_extension"]} { + + # A mime type for this file extension does not exist + # in the database. Check to see AOLServer can + # generate a mime type. + + set mime_type [ns_guesstype $file_name] + + # Note: If AOLServer can't determine a mime type, + # ns_guesstype will return */*. We still record + # a mime type for this file extension. At a later + # date, the mime type for the file extension may be + # updated and, as a result, the files with that + # file extension will be associated with the + # proper mime types. + db_dml new_mime_type { insert into cr_mime_types (mime_type, file_extension) values - (:mime_type, :extension) + (:mime_type, :file_extension) } } - return $mime_type } + + namespace eval fs { ad_proc -public new_root_folder { @@ -357,12 +369,15 @@ {-user_id ""} {-n_past_days "99999"} } { + WARNING: This proc is not scalable because it does too many permission checks. + Retrieve the contents of the specified folder in the form of a list of ns_sets, one for each row returned. The keys for each row are as follows: object_id, name, live_revision, type, - last_modified, new_p, content_size, write_p, delete_p, admin_p + last_modified, new_p, content_size, file_upload_name + write_p, delete_p, admin_p, @param folder_id The folder for which to retrieve contents @param user_id The viewer of the contents (to make sure they have Index: openacs-4/packages/file-storage/tcl/file-storage-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs.xql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/file-storage/tcl/file-storage-procs.xql 22 May 2002 17:01:56 -0000 1.9 +++ openacs-4/packages/file-storage/tcl/file-storage-procs.xql 17 Sep 2002 21:03:26 -0000 1.10 @@ -17,15 +17,15 @@ - + - select count(*) + select mime_type from cr_mime_types - where mime_type = :mime_type + where file_extension = :file_extension - + insert into cr_mime_types (mime_type, file_extension) Index: openacs-4/packages/file-storage/www/file-add-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-add-2-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/file-storage/www/file-add-2-postgresql.xql 29 Jul 2002 03:53:15 -0000 1.4 +++ openacs-4/packages/file-storage/www/file-add-2-postgresql.xql 17 Sep 2002 21:03:27 -0000 1.5 @@ -5,7 +5,7 @@ - select file_storage__new_file ( + select file_storage__new_file ( :title, -- title :folder_id, -- parent_id :user_id, -- creation_user @@ -17,7 +17,7 @@ - select file_storage__new_file ( + select file_storage__new_file ( :title, -- title :folder_id, -- parent_id :user_id, -- creation_user Index: openacs-4/packages/file-storage/www/file-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-delete.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/file-storage/www/file-delete.tcl 5 Sep 2002 09:29:00 -0000 1.4 +++ openacs-4/packages/file-storage/www/file-delete.tcl 17 Sep 2002 21:03:27 -0000 1.5 @@ -47,6 +47,7 @@ ad_returnredirect "?folder_id=$parent_id" + ad_script_abort } else { # they need to confirm that they really want to delete the file @@ -57,5 +58,4 @@ set context [fs_context_bar_list -final "Delete" $file_id] - ad_return_template -} \ No newline at end of file +} Index: openacs-4/packages/file-storage/www/file-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-oracle.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/file-storage/www/file-oracle.xql 4 Dec 2001 04:59:48 -0000 1.5 +++ openacs-4/packages/file-storage/www/file-oracle.xql 17 Sep 2002 21:03:27 -0000 1.6 @@ -36,7 +36,7 @@ and acs_permission.permission_p(r.revision_id, :user_id, 'read') = 't' and r.item_id = i.item_id and r.item_id = :file_id - $show_versions + $show_versions order by last_modified desc Index: openacs-4/packages/file-storage/www/file-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/file-storage/www/file-postgresql.xql 4 Dec 2001 04:59:48 -0000 1.4 +++ openacs-4/packages/file-storage/www/file-postgresql.xql 17 Sep 2002 21:03:27 -0000 1.5 @@ -36,7 +36,7 @@ and acs_permission__permission_p(r.revision_id, :user_id, 'read') = 't' and r.item_id = i.item_id and r.item_id = :file_id - $show_versions + $show_versions by last_modified desc Index: openacs-4/packages/file-storage/www/file.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/file.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/file-storage/www/file.tcl 5 Sep 2002 09:29:00 -0000 1.7 +++ openacs-4/packages/file-storage/www/file.tcl 17 Sep 2002 21:03:27 -0000 1.8 @@ -6,7 +6,7 @@ @cvs-id $Id$ } { file_id:integer,notnull - {show_all_versions_p "f"} + {show_all_versions_p "t"} } -validate { valid_file -requires {file_id} { if ![fs_file_p $file_id] { Index: openacs-4/packages/file-storage/www/folder-chunk-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/folder-chunk-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/folder-chunk-oracle.xql 17 Sep 2002 21:03:27 -0000 1.1 @@ -0,0 +1,23 @@ + + + + oracle8.1.6 + + + select fs_objects.object_id, + fs_objects.name, + fs_objects.live_revision, + fs_objects.type, + to_char(fs_objects.last_modified, 'Month DD YYYY HH24:MI') as last_modified, + fs_objects.content_size, + fs_objects.url, + fs_objects.key, + fs_objects.sort_key, + fs_objects.file_upload_name, + case when fs_objects.last_modified >= (sysdate - :n_past_days) then 1 else 0 end as new_p + from fs_objects + where fs_objects.parent_id = :folder_id + order by sort_key, name + + + \ No newline at end of file Index: openacs-4/packages/file-storage/www/folder-chunk-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-chunk-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/folder-chunk-postgresql.xql 17 Sep 2002 21:03:27 -0000 1.1 @@ -0,0 +1,23 @@ + + + + postgresql7.1 + + + select fs_objects.object_id, + fs_objects.name, + fs_objects.live_revision, + fs_objects.type, + to_char(fs_objects.last_modified, 'Month DD YYYY HH24:MI') as last_modified, + fs_objects.content_size, + fs_objects.url, + fs_objects.key, + fs_objects.sort_key, + fs_objects.file_upload_name, + case when fs_objects.last_modified >= (now() - $n_past_days) then 1 else 0 end as new_p + from fs_objects + where fs_objects.parent_id = :folder_id + order by sort_key, name + + + \ No newline at end of file Index: openacs-4/packages/file-storage/www/folder-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-chunk.adp,v diff -u -r1.9 -r1.10 --- openacs-4/packages/file-storage/www/folder-chunk.adp 22 May 2002 08:50:52 -0000 1.9 +++ openacs-4/packages/file-storage/www/folder-chunk.adp 17 Sep 2002 21:03:27 -0000 1.10 @@ -1,6 +1,6 @@ - - +
+ @@ -9,12 +9,17 @@ - + + + + + + - + + - - + - - - - - - - -
  Name ActionLast Modified
folder - @contents.name@ -( new ) + @contents.name@ +new   @@ -25,21 +30,21 @@ - file - @contents.name@ -( new ) + @contents.name@ +new - [ + + - + [ edit | - + delete @@ -50,18 +55,18 @@ @contents.last_modified@ file - + @contents.name@ - ( new ) + new [ - + view details ] Index: openacs-4/packages/file-storage/www/folder-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-chunk.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/file-storage/www/folder-chunk.tcl 10 Sep 2002 22:22:56 -0000 1.7 +++ openacs-4/packages/file-storage/www/folder-chunk.tcl 17 Sep 2002 21:03:27 -0000 1.8 @@ -19,12 +19,44 @@ set viewing_user_id [acs_magic_object "the_public"] } +permission::require_permission -party_id $viewing_user_id -object_id $folder_id -privilege "read" + if {![exists_and_not_null n_past_days]} { set n_past_days 99999 } +if {![exists_and_not_null fs_url]} { + set fs_url "" +} + set folder_name [fs::get_object_name -object_id $folder_id] +db_multirow -extend { write_p delete_p admin_p read_p} contents select_folder_contents {} { + set file_upload_name [fs::remove_special_file_system_characters -string $file_upload_name] + if { $type == "url" } { + #url is the only type that uses this in the UI and permission checking is expensive. + set admin_p [permission::permission_p -party_id $viewing_user_id -object_id $object_id -privilege "admin"] + if { $admin_p } { + set write_p 1 + set delete_p 1 + set read_p 1 + } else { + set write_p [permission::permission_p -party_id $viewing_user_id -object_id $object_id -privilege "write"] + set delete_p [permission::permission_p -party_id $viewing_user_id -object_id $object_id -privilege "delete"] + if {!$write_p && !$delete_p} { + set read_p [permission::permission_p -party_id $viewing_user_id -object_id $object_id -privilege "read"] + } else { + set read_p 1 + } + } + } else { + set admin_p 0 + set write_p 0 + set delete_p 0 + set read_p 0 + } +} + set rows [fs::get_folder_contents \ -folder_id $folder_id \ -user_id $viewing_user_id \ Index: openacs-4/packages/file-storage/www/folder-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-delete.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/file-storage/www/folder-delete.tcl 5 Sep 2002 09:29:00 -0000 1.3 +++ openacs-4/packages/file-storage/www/folder-delete.tcl 17 Sep 2002 21:03:27 -0000 1.4 @@ -56,6 +56,8 @@ ad_returnredirect "index?folder_id=$parent_id" + ad_script_abort + } else { # they still need to confirm @@ -64,6 +66,4 @@ set context [fs_context_bar_list -final "Delete" $folder_id] - ad_return_template - } \ No newline at end of file Index: openacs-4/packages/file-storage/www/folder-edit-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/folder-edit-2-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/folder-edit-2-oracle.xql 17 Sep 2002 21:03:27 -0000 1.1 @@ -0,0 +1,17 @@ + + + + oracle8.1.6 + + + + begin + content_folder.rename ( + folder_id => :folder_id, + label => :folder_name + ); + end; + + + + Index: openacs-4/packages/file-storage/www/folder-edit-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/folder-edit-2-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/folder-edit-2-postgresql.xql 17 Sep 2002 21:03:27 -0000 1.1 @@ -0,0 +1,17 @@ + + + + postgresql7.1 + + + + select content_folder__rename ( + :folder_id, + null, -- name + :folder_name, -- label + null -- description + ); + + + + Index: openacs-4/packages/file-storage/www/folder-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/folder-edit-2.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/folder-edit-2.tcl 17 Sep 2002 21:03:27 -0000 1.1 @@ -0,0 +1,36 @@ +ad_page_contract { + Script to rename a folder. + + @author Andrew Grumet (aegrumet@alum.mit.edu) + @creation-date 24 Jun 2002 + @cvs-id $Id: folder-edit-2.tcl,v 1.1 2002/09/17 21:03:27 jeffd Exp $ +} { + folder_id:integer,notnull + folder_name:trim,notnull +} -validate { + valid_folder -requires {folder_id:integer} { + if ![fs_folder_p $folder_id] { + ad_complain "The specified folder does not exist." + } + } +} + +set user_id [ad_conn user_id] + +ad_require_permission $folder_id admin + +# get their IP + +set creation_ip [ad_conn peeraddr] + +# strip out spaces from the name + +#We can't rename the item because this breaks the syllabus +#portlet. aegrumet/2002-08-28 +#regsub -all { +} [string tolower $folder_name] {_} name + +db_exec_plsql folder_rename {} + +ad_returnredirect "?folder_id=$folder_id" + + Index: openacs-4/packages/file-storage/www/folder-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-edit.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/folder-edit.adp 17 Sep 2002 21:03:27 -0000 1.1 @@ -0,0 +1,20 @@ + +Edit Folder +@context_bar@ + + +
+ + + + + + + + + + + +
Folder Name:
 
+ +
\ No newline at end of file Index: openacs-4/packages/file-storage/www/folder-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-edit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/folder-edit.tcl 17 Sep 2002 21:03:27 -0000 1.1 @@ -0,0 +1,28 @@ +ad_page_contract { + form to edit a folder + + @author Andrew Grumet (aegrumet@alum.mit.edu) + @creation-date 24 Jun 2002 + @cvs-id $Id: folder-edit.tcl,v 1.1 2002/09/17 21:03:27 jeffd Exp $ +} { + folder_id:integer,notnull +} -validate { + valid_folder -requires {parent_id:integer} { + if ![fs_folder_p $folder_id] { + ad_complain "The specified folder does not exist." + } + } +} -properties { + folder_id:onevalue + context_bar:onevalue +} + +ad_require_permission $folder_id admin + +# set templating datasources + +set context_bar [fs_context_bar_list -final "Edit" $folder_id] + +set folder_name [fs_get_folder_name $folder_id] + +ad_return_template Index: openacs-4/packages/file-storage/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/index.adp,v diff -u -r1.16 -r1.17 --- openacs-4/packages/file-storage/www/index.adp 6 Sep 2002 21:50:38 -0000 1.16 +++ openacs-4/packages/file-storage/www/index.adp 17 Sep 2002 21:03:27 -0000 1.17 @@ -3,68 +3,55 @@ @folder_name@ @context@ - +
- - - - - - - +   |   + Create a new folder + +   |   + Rename this folder + +   |   + Delete this folder + + - - - + - - - - - - -
  • + Upload a file   |   Create a URL -
  • Create a new folder
    + + Show files modified in the past days as new. + + +

  • + Modify permissions on this folder

  • - Delete this folder

  • +
    + + + + +

    Download an archive of the contents of this folder
    Note: This may take a while, please be patient. -


  • - - Show files modified in the past days as new. - -
    -
    - Search file names for - -
    - Index: openacs-4/packages/file-storage/www/version-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/version-delete.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/file-storage/www/version-delete.tcl 5 Sep 2002 09:29:00 -0000 1.5 +++ openacs-4/packages/file-storage/www/version-delete.tcl 17 Sep 2002 21:03:27 -0000 1.6 @@ -50,11 +50,14 @@ # Redirect to the folder, instead of the latest revision (which does not exist anymore) ad_returnredirect "index?folder_id=$parent_id" + ad_script_abort + } else { # Ok, we don't have to do anything fancy, just redirect to th last revision ad_returnredirect "file?file_id=$item_id" - + + ad_script_abort } } else { @@ -67,5 +70,4 @@ and revision_id = :version_id" set context [fs_context_bar_list -final "Delete Version" $item_id] - ad_return_template } Index: openacs-4/packages/file-storage/www/graphics/new.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/graphics/new.gif,v diff -u Binary files differ