Index: openacs-4/packages/file-storage/sql/oracle/file-storage-simple-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/oracle/Attic/file-storage-simple-package-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/file-storage/sql/oracle/file-storage-simple-package-create.sql 25 May 2002 14:27:49 -0000 1.3 +++ openacs-4/packages/file-storage/sql/oracle/file-storage-simple-package-create.sql 29 May 2002 23:02:19 -0000 1.4 @@ -95,6 +95,12 @@ procedure delete ( url_id in fs_urls.url_id%TYPE ); + + function copy ( + url_id in fs_urls.url_id%TYPE, + target_folder_id in fs_simple_objects.folder_id%TYPE + ) return fs_urls.url_id%TYPE; + end fs_url; / show errors @@ -145,6 +151,47 @@ fs_simple_object.delete(url_id); end delete; + function copy ( + url_id in fs_urls.url_id%TYPE, + target_folder_id in fs_simple_objects.folder_id%TYPE + ) return fs_urls.url_id%TYPE + is + v_new_url_id fs_urls.url_id%TYPE; + v_url fs_urls.url%TYPE; + v_name fs_simple_objects.name%TYPE; + v_description fs_simple_objects.description%TYPE; + v_creation_user acs_objects.creation_user%TYPE; + v_creation_ip acs_objects.creation_ip%TYPE; + begin + + select url + into v_url + from fs_urls + where url_id = copy.url_id; + + select name, description + into v_name, v_description + from fs_simple_objects + where object_id = copy.url_id; + + select creation_user, creation_ip + into v_creation_user, v_creation_ip + from acs_objects + where object_id = copy.url_id; + + v_new_url_id := fs_url.new( + url => v_url, + folder_id => copy.target_folder_id, + name => v_name, + description => v_description, + creation_user => v_creation_user, + creation_ip => v_creation_ip, + context_id => copy.target_folder_id + ); + + return v_new_url_id; + end copy; + end fs_url; / show errors 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.3 -r1.4 --- openacs-4/packages/file-storage/sql/postgresql/file-storage-simple-package-create.sql 25 May 2002 14:27:49 -0000 1.3 +++ openacs-4/packages/file-storage/sql/postgresql/file-storage-simple-package-create.sql 29 May 2002 23:02:19 -0000 1.4 @@ -69,7 +69,9 @@ select define_function_args('fs_url__delete','url_id'); +select define_function_args('fs_url__copy','url_id;target_object_id'); + create function fs_url__new(integer,varchar,varchar,integer,varchar,varchar,timestamp,integer,varchar,integer) returns integer as ' DECLARE @@ -118,3 +120,58 @@ return 0; END; ' language 'plpgsql'; + + +create function fs_url__copy(integer,integer) +returns integer as ' +DECLARE + p_url_id alias for $1; + p_target_folder_id alias for $2; + v_new_url_id integer; + v_url varchar; + v_name varchar; + v_description varchar; + v_creation_user integer; + v_creation_ip varchar; +BEGIN + select url + into v_url + from fs_urls + where url_id = p_url_id; + + select name + into v_name + from fs_simple_objects + where object_id = p_url_id; + + select description + into v_description + from fs_simple_objects + where object_id = p_url_id; + + select creation_user + into v_creation_user + from acs_objects + where object_id = p_url_id; + + select creation_ip + into v_creation_ip + from acs_objects + where object_id = p_url_id; + + v_new_url_id:= fs_url__new ( + NULL, + ''fs_url'', + v_url, + p_target_folder_id, + v_name, + v_description, + NULL, + v_creation_user, + v_creation_ip, + p_target_folder_id + ); + + return v_new_url_id; +END; +' language 'plpgsql'; Index: openacs-4/packages/file-storage/tcl/fs-simple-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/Attic/fs-simple-procs-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/file-storage/tcl/fs-simple-procs-oracle.xql 2 Apr 2002 07:00:53 -0000 1.1 +++ openacs-4/packages/file-storage/tcl/fs-simple-procs-oracle.xql 29 May 2002 23:02:19 -0000 1.2 @@ -4,12 +4,24 @@ oracle8.1.6 - -declare -begin -fs_simple_object.delete(:object_id); -end; - + + declare + begin + fs_simple_object.delete(:object_id); + end; + + + + + declare + begin + :1 := fs_url.copy( + url_id => :url_id, + target_folder_id => :target_folder_id + ); + end; + + Index: openacs-4/packages/file-storage/tcl/fs-simple-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/Attic/fs-simple-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/file-storage/tcl/fs-simple-procs-postgresql.xql 2 Apr 2002 07:00:53 -0000 1.1 +++ openacs-4/packages/file-storage/tcl/fs-simple-procs-postgresql.xql 29 May 2002 23:02:19 -0000 1.2 @@ -4,9 +4,14 @@ postgresql7.1 - -select fs_simple_object__delete(:object_id); - + + select fs_simple_object__delete(:object_id); + + + + + + Index: openacs-4/packages/file-storage/tcl/fs-simple-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/Attic/fs-simple-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/file-storage/tcl/fs-simple-procs.tcl 22 May 2002 08:50:52 -0000 1.2 +++ openacs-4/packages/file-storage/tcl/fs-simple-procs.tcl 29 May 2002 23:02:19 -0000 1.3 @@ -75,4 +75,19 @@ # delete the item db_exec_plsql delete_item {} } + + ad_proc -public simple_p { + {-object_id:required} + } { + # is this thing a simple fs object? + return [db_string simple_check {}] + } + ad_proc -public url_copy { + {-url_id:required} + {-target_folder_id:required} + } { + # is this thing a simple fs object? + return [db_exec_plsql copy {}] + } + } Index: openacs-4/packages/file-storage/tcl/fs-simple-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/Attic/fs-simple-procs.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/file-storage/tcl/fs-simple-procs.xql 2 Apr 2002 07:00:53 -0000 1.1 +++ openacs-4/packages/file-storage/tcl/fs-simple-procs.xql 29 May 2002 23:02:19 -0000 1.2 @@ -26,4 +26,12 @@ + + +select case when count(*) = 0 then 0 else 1 end +from fs_simple_objects +where object_id = :object_id + + + 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.13 -r1.14 --- openacs-4/packages/file-storage/www/index.adp 29 May 2002 21:37:24 -0000 1.13 +++ openacs-4/packages/file-storage/www/index.adp 29 May 2002 23:02:19 -0000 1.14 @@ -47,7 +47,7 @@ Download an archive of the contents of this folder
- Note: This may take a while, so please be patient. + Note: This may take a while, please be patient.