Index: openacs-4/packages/file-storage/www/file-add-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-add-2-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-add-2-oracle.xql 16 Aug 2001 20:25:34 -0000 1.1 @@ -0,0 +1,64 @@ + + + + oracle8.1.6 + + + + + begin + :1 := content_item.new ( + name => :filename, + parent_id => :folder_id, + context_id => :folder_id, + creation_user => :user_id, + creation_ip => :creation_ip + ); + end; + + + + + + + + + begin + :1 := content_revision.new ( + title => :title, + description => :description, + mime_type => :mime_type, + item_id => :item_id, + creation_user => :user_id, + creation_ip => :creation_ip + ); + + end; + + + + + + + + + update cr_revisions + set content = empty_blob() + where revision_id = :revision_id + returning content into :1 + + + + + + + + +begin + content_item.set_live_revision(:revision_id); +end; + + + + + Index: openacs-4/packages/file-storage/www/file-add-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-add-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-add-2.xql 16 Aug 2001 20:27:37 -0000 1.1 @@ -0,0 +1,17 @@ + + + + + + + select count(*) + from cr_items + where name = :filename + and parent_id = :folder_id + + + + + + + Index: openacs-4/packages/file-storage/www/file-copy-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-copy-2-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-copy-2-oracle.xql 16 Aug 2001 20:28:12 -0000 1.1 @@ -0,0 +1,56 @@ + + + + oracle8.1.6 + + + + + begin + :1 := content_item.new ( + parent_id => :parent_id, + context_id => :parent_id, + name => :name, + content_type => :content_type, + creation_user => :user_id, + creation_ip => :ip_address + ); + end; + + + + + + + + + begin + select acs_object_id_seq.nextval into :1 from dual; + + insert into acs_objects + (object_id, object_type, context_id, security_inherit_p, + creation_user, creation_ip, last_modified, modifying_user, + modifying_ip) + (select :1, object_type, :new_file_id, security_inherit_p, + creation_user, creation_ip, last_modified, modifying_user, + modifying_ip + from acs_objects + where object_id = content_item.get_live_revision(:file_id)); + + insert into cr_revisions + (revision_id, title, description, publish_date, mime_type, + nls_language, content, item_id) + (select :1, title, description, publish_date, mime_type, + nls_language, content, :new_file_id + from cr_revisions + where revision_id = content_item.get_live_revision(:file_id)); + + content_item.set_live_revision(:1); + + end; + + + + + + Index: openacs-4/packages/file-storage/www/file-copy-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-copy-2-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-copy-2-postgresql.xql 16 Aug 2001 20:28:45 -0000 1.1 @@ -0,0 +1,70 @@ + + + + postgresql7.1 + + + + + select content_item__new ( + :name, -- name + :parent_id, -- parent_id + null, -- item_id (default) + null, -- locale (default) + now(), -- creation_date (default) + :user_id, -- creation_user + :parent_id, -- context_id + :ip_address, -- creation_ip + 'content_item', -- item_subtype (default) + :content_type, -- content_type + null, -- title (default) + null, -- description + 'text/plain', -- mime_type (default) + null, -- nls_language (default) + null -- data (default) + ); + + + + + + + + + declare + v_object_id acs_object.object_id%TYPE; + begin + + select acs_object_id_seq.nextval into v_object_id ; + + insert into acs_objects + (object_id, object_type, context_id, security_inherit_p, + creation_user, creation_ip, last_modified, modifying_user, + modifying_ip) + (select v_object_id, object_type, :new_file_id, security_inherit_p, + creation_user, creation_ip, last_modified, modifying_user, + modifying_ip + from acs_objects + where object_id = content_item__get_live_revision(:file_id)); + + insert into cr_revisions + (revision_id, title, description, publish_date, mime_type, + nls_language, content, item_id) + (select v_object_id, title, description, publish_date, mime_type, + nls_language, content, :new_file_id + from cr_revisions + where revision_id = content_item__get_live_revision(:file_id)); + + PERFORM content_item__set_live_revision(v_object_id); + + return v_object_id; + + end; + + + + + + + + Index: openacs-4/packages/file-storage/www/file-copy.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-copy.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-copy.xql 16 Aug 2001 20:29:20 -0000 1.1 @@ -0,0 +1,17 @@ + + + + + + + select title + from cr_revisions + where revision_id = (select live_revision + from cr_items + where item_id = :file_id) + + + + + + Index: openacs-4/packages/file-storage/www/file-delete-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-delete-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-delete-oracle.xql 16 Aug 2001 20:29:36 -0000 1.1 @@ -0,0 +1,38 @@ + + + + oracle8.1.6 + + + + + select count(*) + from cr_revisions + where item_id = :file_id + and acs_permission.permission_p(revision_id,:user_id,'delete') = 'f' + + + + + + + + begin + content_item.delete(:file_id); + end; + + + + + + + + select title as file_name + from cr_revisions + where revision_id = content_item.get_live_revision(:file_id) + + + + + + Index: openacs-4/packages/file-storage/www/file-delete-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-delete-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-delete-postgresql.xql 16 Aug 2001 20:29:57 -0000 1.1 @@ -0,0 +1,36 @@ + + + + postgresql7.1 + + + + + select count(*) + from cr_revisions + where item_id = :file_id + and acs_permission__permission_p(revision_id,:user_id,'delete') = 'f' + + + + + + + + select content_item__delete(:file_id); + + + + + + + + select title as file_name + from cr_revisions + where revision_id = content_item__get_live_revision(:file_id) + + + + + + Index: openacs-4/packages/file-storage/www/file-delete.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-delete.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-delete.xql 16 Aug 2001 20:30:11 -0000 1.1 @@ -0,0 +1,13 @@ + + + + + + + select parent_id from cr_items where item_id = :file_id + + + + + + Index: openacs-4/packages/file-storage/www/file-edit-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-edit-2-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-edit-2-oracle.xql 16 Aug 2001 20:30:28 -0000 1.1 @@ -0,0 +1,32 @@ + + + + oracle8.1.6 + + + + + begin + content_item.rename ( + item_id => :file_id, + name => :name + ); + end; + + + + + + + + + select count(*) + from cr_items + where name = :name + and parent_id = content_item.get_parent_folder(:file_id) + + + + + + Index: openacs-4/packages/file-storage/www/file-edit-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-edit-2-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-edit-2-postgresql.xql 16 Aug 2001 20:30:42 -0000 1.1 @@ -0,0 +1,30 @@ + + + + postgresql7.1 + + + + + select content_item__rename ( + :file_id, -- item_id + :name -- name + ); + + + + + + + + + select count(*) + from cr_items + where name = :name + and parent_id = content_item__get_parent_folder(:file_id) + + + + + + Index: openacs-4/packages/file-storage/www/file-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/file-edit-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-edit-postgresql.xql 16 Aug 2001 20:31:14 -0000 1.1 @@ -0,0 +1,17 @@ + + + + postgresql7.1 + + + + + select content_item__get_title(:file_id) as title,name + from cr_items + where item_id = :file_id + + + + + + Index: openacs-4/packages/file-storage/www/file-move-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-move-2-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-move-2-oracle.xql 16 Aug 2001 20:31:36 -0000 1.1 @@ -0,0 +1,20 @@ + + + + oracle8.1.6 + + + + + begin + content_item.move ( + item_id => :file_id, + target_folder_id => :parent_id + ); + end; + + + + + + Index: openacs-4/packages/file-storage/www/file-move-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-move-2-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-move-2-postgresql.xql 16 Aug 2001 20:31:52 -0000 1.1 @@ -0,0 +1,18 @@ + + + + postgresql7.1 + + + + + select content_item__move ( + :file_id, -- item_id + :parent_id -- target_folder_id + ); + + + + + + Index: openacs-4/packages/file-storage/www/file-move-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-move-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-move-2.xql 16 Aug 2001 20:32:07 -0000 1.1 @@ -0,0 +1,36 @@ + + + + + + + update acs_objects + set context_id = :parent_id + where object_id = :file_id + + + + + + + + + select name from cr_items where item_id = :file_id + + + + + + + + + select count(*) + from cr_items + where name = :filename + and parent_id = :folder_id + + + + + + Index: openacs-4/packages/file-storage/www/file-move-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-move-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-move-oracle.xql 16 Aug 2001 20:32:20 -0000 1.1 @@ -0,0 +1,17 @@ + + + + oracle8.1.6 + + + + + begin + :1 := content_item.get_title(:file_id); + end; + + + + + + Index: openacs-4/packages/file-storage/www/file-move-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-move-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-move-postgresql.xql 16 Aug 2001 20:32:33 -0000 1.1 @@ -0,0 +1,15 @@ + + + + postgresql7.1 + + + + + select content_item__get_title(:file_id); + + + + + + 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-oracle.xql 16 Aug 2001 20:32:59 -0000 1.1 @@ -0,0 +1,24 @@ + + + + oracle8.1.6 + + + + + select person.name(o.creation_user) as owner, + i.name, + r.title, + content_item.get_path(i.item_id,file_storage.get_root_folder([ad_conn package_id])) as file_path, + acs_permission.permission_p(:file_id,:user_id,'write') as write_p, + acs_permission.permission_p(:file_id,:user_id,'delete') as delete_p, + acs_permission.permission_p(:file_id,:user_id,'admin') as admin_p + from acs_objects o, cr_revisions r, cr_items i + where o.object_id = :file_id + and i.item_id = o.object_id + and r.revision_id = i.live_revision + + + + + 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/file-postgresql.xql 16 Aug 2001 20:33:11 -0000 1.1 @@ -0,0 +1,60 @@ + + + + postgresql7.1 + + + + + select person__name(o.creation_user) as owner, + i.name, + r.title, + content_item__get_path(i.item_id,file_storage__get_root_folder([ad_conn package_id])) as file_path, + acs_permission__permission_p(:file_id,:user_id,'write') as write_p, + acs_permission__permission_p(:file_id,:user_id,'delete') as delete_p, + acs_permission__permission_p(:file_id,:user_id,'admin') as admin_p + from acs_objects o, cr_revisions r, cr_items i + where o.object_id = :file_id + and i.item_id = o.object_id + and r.revision_id = i.live_revision + + + + + + + select r.title, + r.revision_id as version_id, + person__name(o.creation_user) as author, + r.mime_type as type, + to_char(o.last_modified,'YYYY-MM-DD HH24:MI') as last_modified, + r.description, + acs_permission__permission_p(r.revision_id,:user_id,'admin') as admin_p, + acs_permission__permission_p(r.revision_id,:user_id,'delete') as delete_p, + -- dbms_lob.getlength(r.content) as content_size + r.content_length as content_size + from acs_objects o, cr_revisions r + where o.object_id = r.revision_id + and acs_permission__permission_p(r.revision_id, :user_id, 'read') = 't' + $show_versions + + + + + + + + and r.item_id = :file_id + + + + + + + + and r.revision_id = (select live_revision from cr_items where item_id = :file_id) + + + + +