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.39.2.4 -r1.39.2.5
--- openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql 6 Apr 2021 19:16:16 -0000 1.39.2.4
+++ openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql 7 Apr 2021 19:54:44 -0000 1.39.2.5
@@ -118,15 +118,6 @@
-
-
- begin
- acs_object.update_last_modified(:parent_id,:creation_user,:creation_ip);
- acs_object.update_last_modified(:item_id,:creation_user,:creation_ip);
- end;
-
-
-
select r.package_id,
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.51.2.4 -r1.51.2.5
--- openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 6 Apr 2021 19:16:16 -0000 1.51.2.4
+++ openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 7 Apr 2021 19:54:44 -0000 1.51.2.5
@@ -98,18 +98,6 @@
-
-
- begin
- perform acs_object__update_last_modified
- (:parent_id,:creation_user,:creation_ip);
- perform
- acs_object__update_last_modified(:item_id,:creation_user,:creation_ip);
- return null;
- end;
-
-
-
With RECURSIVE items AS (
@@ -123,60 +111,6 @@
-
-
- select content_revision__new (
- :title, -- title
- :description, -- description
- now(), -- publish_date
- :mime_type, -- mime_type
- null, -- ns_language
- :content_body, -- text
- :item_id, -- item_id
- null,
- now(), -- creation_date
- :creation_user, -- creation_user
- :creation_ip, -- creation_ip
- null,
- :package_id -- package_id
- )
-
-
-
-
-
-
- update cr_revisions
- set mime_type = :mime_type,
- lob = [set __lob_id [db_string get_lob_id "select empty_lob()"]]
- where revision_id = :revision_id
-
-
-
-
-
-
-
- update cr_revisions
- set content_length = lob_length(lob)
- where revision_id = :revision_id
-
-
-
-
-
-
-
- begin
- perform acs_object__update_last_modified
- (:parent_id,:creation_user,:creation_ip);
- perform
- acs_object__update_last_modified(:item_id,:creation_user,:creation_ip);
- return null;
- end;
-
-
-
select file_storage__new_file (
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.90.2.16 -r1.90.2.17
--- openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 6 Apr 2021 19:16:16 -0000 1.90.2.16
+++ openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 7 Apr 2021 19:54:44 -0000 1.90.2.17
@@ -688,7 +688,7 @@
-storage_type $storage_type \
-revision_id $live_revision \
-filename $full_filename
-
+
return $full_filename
}
@@ -956,75 +956,44 @@
set package_id [ad_conn package_id]
}
if {$storage_type eq ""} {
- set storage_type [db_string get_storage_type {}]
+ set storage_type [db_string get_storage_type {
+ select storage_type from cr_items where item_id = :item_id
+ }]
}
if {$creation_user eq ""} {
set creation_user [ad_conn user_id]
}
if {$creation_ip eq ""} {
set creation_ip [ns_conn peeraddr]
}
- set parent_id [fs::get_parent -item_id $item_id]
- if {$storage_type eq ""} {
- set storage_type [db_string get_storage_type {
- select storage_type from cr_items where item_id=:item_id
- }]
- }
- switch -- $storage_type {
- file {
- set revision_id [db_exec_plsql new_file_revision {}]
- set cr_file [cr_create_content_file_from_string $item_id $revision_id $content_body]
-
- # get the size
- set file_size [cr_file_size $cr_file]
-
- # update the file path in the CR and the size on cr_revisions
- db_dml update_revision {}
- }
- lob {
- # if someone stored file storage content in the database
- # we need to use lob. The only way to get a lob into the
- # database is to pass it as a file
- set revision_id [cr_import_content \
+ set revision_id [content::revision::new \
-item_id $item_id \
- -storage_type \
- -creation_user $creation_user \
- -creation_ip $creation_ip \
- -other_type "file_storage_object" \
- -image_type "file_storage_object" \
-title $title \
-description $description \
+ -content $content_body \
+ -mime_type $mime_type \
+ -creation_user $creation_user \
+ -creation_ip $creation_ip \
-package_id $package_id \
- $parent_id \
- $tmp_filename \
- $tmp_size \
- $mime_type \
- $name]
- db_dml set_lob_content "" -blobs [list $content_body]
- db_dml set_lob_size ""
- }
- text {
- set revision_id [content::revision::new \
- -item_id $item_id \
- -title $title \
- -description $description \
- -content $content_body \
- -mime_type $mime_type \
- -creation_user $creation_user \
- -creation_ip $creation_ip \
- -package_id $package_id]
- }
- }
+ -is_live "t" \
+ -storage_type $storage_type]
- db_dml set_live_revision ""
- db_exec_plsql update_last_modified ""
+ set parent_id [fs::get_parent -item_id $item_id]
if {[string is false $suppress_notify_p]} {
- fs::do_notifications -folder_id $parent_id -filename $title -item_id $revision_id -action "new_version" -package_id $package_id
+ fs::do_notifications \
+ -folder_id $parent_id \
+ -filename $title \
+ -item_id $revision_id \
+ -action "new_version" \
+ -package_id $package_id
}
- #It's safe to rebuild RSS repeatedly, assuming it's not too expensive.
+ #
+ # It is safe to rebuild RSS repeatedly, assuming it's not too
+ # expensive.
+ #
set folder_info [fs::get_folder_package_and_root $parent_id]
set db_package_id [lindex $folder_info 0]
if { [parameter::get -package_id $db_package_id -parameter ExposeRssP -default 0] } {
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.22 -r1.22.2.1
--- openacs-4/packages/file-storage/tcl/file-storage-procs.xql 21 Nov 2017 11:31:29 -0000 1.22
+++ openacs-4/packages/file-storage/tcl/file-storage-procs.xql 7 Apr 2021 19:54:44 -0000 1.22.2.1
@@ -147,27 +147,6 @@
-
-
- select storage_type from cr_items where item_id=:item_id
-
-
-
-
-
- update cr_items set live_revision=:revision_id
- where item_id=:item_id
-
-
-
-
-
- update cr_revisions
- set content = :cr_file, content_length = :file_size
- where revision_id = :revision_id
-
-
-
select count(*) from cr_items