Index: openacs-4/packages/acs-mail/tcl/acs-mail-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail/tcl/acs-mail-procs-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-mail/tcl/acs-mail-procs-postgresql.xql 8 Jul 2001 18:40:49 -0000 1.4 +++ openacs-4/packages/acs-mail/tcl/acs-mail-procs-postgresql.xql 13 Aug 2001 18:01:10 -0000 1.5 @@ -4,60 +4,151 @@ postgresql7.1 - - FIX ME LOB + - insert into acs_contents - (content_id, content, searchable_p, nls_language, mime_type) - values - (:object_id,empty_blob(),:searchable_p,:nls_language,:content_type) +begin + return content_item__new( + 'acs-mail message $body_id', -- new__name + null, -- new__parent_id + null, -- new__item_id + null, -- new__locale + now(), -- new__creation_date + :creation_user, -- new__creation_user + null, -- new__context_id + :creation_ip, -- new__creation_ip + 'content_item', -- new__item_subtype + 'content_revision', -- new__content_type + :header_subject, -- new__title + null, -- new__description + :content_type, -- new__mime_type + :nls_language, -- new__nls_language + :content, -- new__text + 'text' -- new__storage_type + ); +end; - + - - - FIX ME LOB - update acs_contents - set content = empty_blob() - where content_id = :object_id - returning content into :1 - - + + + +begin + return content_item__get_latest_revision ( :item_id ); +end; + + - - - - FIX ME LOB - insert into acs_contents - (content_id, content, searchable_p, nls_language, mime_type) - values - (:object_id,empty_blob(),:searchable_p,:nls_language,:content_type) - - + + + + +select content_item__set_live_revision(:revision_id); + + - - - - FIX ME LOB - update acs_contents - set content = empty_blob() - where content_id = :object_id - returning content into :1 - - + + + + +begin + return content_item__new( + 'acs-mail message $body_id', -- new__name + null, -- new__parent_id + null, -- new__item_id + null, -- new__locale + now(), -- new__creation_date + :creation_user, -- new__creation_user + null, -- new__context_id + :creation_ip, -- new__creation_ip + 'content_item', -- new__item_subtype + 'content_revision', -- new__content_type + :header_subject, -- new__title + null, -- new__description + :content_type, -- new__mime_type + :nls_language, -- new__nls_language + null, -- new__text + 'file' -- new__storage_type + ); +end; + + - + + + + +begin + return content_item__get_latest_revision ( :item_id ); +end; + + + + + + + + + +select content_item__set_live_revision(:revision_id) + + + + + + + + + +update cr_revisions + set content = '[cr_create_content_file $item_id $revision_id $content_file]' + where revision_id = :revision_id + + + + + + + + +begin + return content_item__get_latest_revision ( :content_item_id ); +end; + + + + + + + + + +select r.lob as content, i.storage_type +from cr_revisions r, cr_items i +where r.revision_id = $revision_id and + r.item_id = i.item_id + + + + + + + + + + + + select acs_mail_gc_object__new ( :object_id, -- gc_object_id 'acs_mail_gc_object', -- object_type @@ -85,21 +176,29 @@ :header_subject, -- header_subject :header_from, -- header_from :header_to, -- header_to - :content_object_id, -- content_object_id + :content_item_id, -- content_item_id + 'acs_mail_body', -- object_type + now(), -- creation_date :creation_user, -- creation_user - :creation_ip -- creation_ip + :creation_ip, -- creation_ip + null -- context_id ); + + - - select acs_mail_body__body_p (:object_id); - + + +select acs_mail_body__body_p (:object_id); + + + @@ -116,14 +215,14 @@ - - + + select acs_mail_body__set_content_object ( :body_id, -- body_id - :content_object_id -- content_object_id + :content_item_id -- content_item_id ); @@ -136,37 +235,48 @@ select acs_mail_multipart__new ( - :multipart_id, -- multipart_id - :multipart_kind, -- multipart_kind - :creation_user, -- creation_user - :creation_ip -- creation_ip + :multipart_id, -- multipart_id + :multipart_kind, -- multipart_kind + 'acs_mail_multipart', -- object_type + now(), -- creation_date + :creation_user, -- creation_user + :creation_ip, -- creation_ip + null -- context_id ); + - - select acs_mail_multipart__multipart_p (:object_id); - + + +select acs_mail_multipart__multipart_p (:object_id); + + + - + + + select acs_mail_multipart__add_content ( :multipart_id, -- multipart_id - :content_object_id -- content_object_id + :content_item_id -- content_item_id ); + + @@ -182,11 +292,14 @@ + - - select acs_mail_link__link_p (:object_id); - + + +select acs_mail_link__link_p (:object_id); + +