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.7 -r1.8 --- openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql 30 Sep 2003 12:10:07 -0000 1.7 +++ openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql 1 Dec 2003 14:36:44 -0000 1.8 @@ -462,7 +462,7 @@ where cr_items.item_id = file_storage.new_version.item_id; acs_object.update_last_modified(v_folder_id,new_version.creation_user,new_version.creation_ip); - + acs_object.update_last_modified(new_version.item_id,new_version.creation_user,new_version.creation_ip); return v_revision_id; exception when NO_DATA_FOUND then Index: openacs-4/packages/file-storage/sql/oracle/upgrade/upgrade-4.6.2-4.7d3.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/oracle/upgrade/upgrade-4.6.2-4.7d3.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/file-storage/sql/oracle/upgrade/upgrade-4.6.2-4.7d3.sql 7 Jul 2003 12:37:39 -0000 1.1 +++ openacs-4/packages/file-storage/sql/oracle/upgrade/upgrade-4.6.2-4.7d3.sql 1 Dec 2003 14:36:44 -0000 1.2 @@ -31,3 +31,5 @@ end; / show errors; + +@ ../file-storage-package-create.sql \ No newline at end of file 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.12 -r1.13 --- openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql 16 Oct 2003 17:31:07 -0000 1.12 +++ openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql 1 Dec 2003 14:36:44 -0000 1.13 @@ -559,6 +559,7 @@ where cr_items.item_id = new_version__item_id; perform acs_object__update_last_modified(v_folder_id,new_version__creation_user,new_version__creation_ip); + perform acs_object__update_last_modified(new_version__item_id,new_version__creation_user,new_version__creation_ip); return v_revision_id; Index: openacs-4/packages/file-storage/sql/postgresql/upgrade/upgrade-4.6.2-4.7d3.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/postgresql/upgrade/Attic/upgrade-4.6.2-4.7d3.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/file-storage/sql/postgresql/upgrade/upgrade-4.6.2-4.7d3.sql 7 Jul 2003 12:37:39 -0000 1.1 +++ openacs-4/packages/file-storage/sql/postgresql/upgrade/upgrade-4.6.2-4.7d3.sql 1 Dec 2003 14:36:44 -0000 1.2 @@ -34,3 +34,55 @@ select inline_0(); drop function inline_0(); + +create function file_storage__new_version ( + -- + -- Create a new version of a file + -- Wrapper for content_revision__new + -- + varchar, -- cr_revisions.title%TYPE, + varchar, -- cr_revisions.description%TYPE, + varchar, -- cr_revisions.mime_type%TYPE, + integer, -- cr_items.item_id%TYPE, + integer, -- acs_objects.creation_user%TYPE, + varchar -- acs_objects.creation_ip%TYPE +) returns integer as ' -- cr_revisions.revision_id +declare + new_version__filename alias for $1; + new_version__description alias for $2; + new_version__mime_type alias for $3; + new_version__item_id alias for $4; + new_version__creation_user alias for $5; + new_version__creation_ip alias for $6; + v_revision_id cr_revisions.revision_id%TYPE; + v_folder_id cr_items.parent_id%TYPE; +begin + -- Create a revision + v_revision_id := content_revision__new ( + new_version__filename, -- title + new_version__description, -- description + now(), -- publish_date + new_version__mime_type, -- mime_type + null, -- nls_language + null, -- data (default) + new_version__item_id, -- item_id + null, -- revision_id + now(), -- creation_date + new_version__creation_user, -- creation_user + new_version__creation_ip -- creation_ip + ); + + -- Make live the newly created revision + perform content_item__set_live_revision(v_revision_id); + + select cr_items.parent_id + into v_folder_id + from cr_items + where cr_items.item_id = new_version__item_id; + + perform acs_object__update_last_modified(v_folder_id,new_version__creation_user,new_version__creation_ip); + perform acs_object__update_last_modified(new_version__item_id,new_version__creation_user,new_version__creation_ip); + + return v_revision_id; + +end;' language 'plpgsql';