Index: openacs-4/packages/acs-content-repository/tcl/revision-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/revision-procs-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-content-repository/tcl/revision-procs-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.3 +++ openacs-4/packages/acs-content-repository/tcl/revision-procs-postgresql.xql 15 Nov 2001 01:47:13 -0000 1.4 @@ -53,4 +53,139 @@ + + + select content_type__register_mime_type('content_revision', :mime_type) + + + + + + select content_item__is_subclass(:image_type, 'image') + + + + + + select content_item__is_subclass(:other_type, 'content_revision') + + + + + + select image__new( + /* name => */ :object_name, + /* parent_id => */ :parent_id, + /* item_id => */ :item_id, + /* revision_id => */ :revision_id, + /* mime_type => */ :mime_type, + /* creation_user => */ :creation_user, + /* creation_ip => */ :creation_ip, + /* title => */ :title, + /* description => */ :description, + /* storage_type => */ :storage_type, + /* content_type => */ :image_type, + /* nls_language => */ null, + /* publish_date => */ current_timestamp, + /* height => */ :original_height, + /* width => */ :original_width + ); + + + + + + select image__new_revision ( + /* item_id => */ :item_id, + /* revision_id => */ :revision_id, + /* title => */ :title, + /* description => */ :description, + /* publish_date => */ current_timestamp, + /* mime_type => */ :mime_type, + /* nls_language => */ null, + /* creation_user => */ :creation_user, + /* creation_ip => */ :creation_ip, + /* height => */ :original_height, + /* width => */ :original_width + ); + + + + + + select content_item__new ( + /* name => */ varchar :object_name, + /* parent_id => */ :parent_id, + /* item_id => */ :item_id, + /* new_locale => */ null, + /* creation_date => */ current_timestamp, + /* creation_user => */ :creation_user, + /* context_id => */ :parent_id, + /* creation_ip => */ :creation_ip, + /* item_subtype => */ 'content_item', + /* content_type => */ :other_type, + /* title => */ null, + /* description => */ null, + /* mime_type => */ null, + /* nls_language => */ null, + /* text => */ null, + /* storage_type => */ :storage_type + ); + + + + + + select content_revision__new ( + /* title => */ :title, + /* description => */ :description, + /* publish_date => */ current_timestamp, + /* mime_type => */ :mime_type, + /* nls_language => */ null, + /* data => */ null, + /* item_id => */ :item_id, + /* revision_id => */ :revision_id, + /* creation_date => */ current_timestamp, + /* creation_user => */ :creation_user, + /* creation_ip => */ :creation_ip + ); + + + + + + update cr_revisions + set content = :filename, + content_length = :tmp_size + where revision_id = :revision_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 + + + + + + + select content_item__set_live_revision(:revision_id) + + +