Index: openacs-4/packages/acs-content-repository/sql/postgresql/content-item.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/content-item.sql,v diff -u -r1.27 -r1.28 --- openacs-4/packages/acs-content-repository/sql/postgresql/content-item.sql 28 Aug 2001 01:07:23 -0000 1.27 +++ openacs-4/packages/acs-content-repository/sql/postgresql/content-item.sql 30 Aug 2001 01:46:05 -0000 1.28 @@ -1043,14 +1043,16 @@ pos integer, name text, parent_id integer, - tree_level integer + tree_level integer, + primary key (sid,pos) ); create table get_path_rel_cursor ( sid integer, pos integer, parent_id integer, - tree_level integer + tree_level integer, + primary key (sid,pos) ); create function content_item__create_rel_cursor(integer,integer) @@ -1376,8 +1378,8 @@ -- register template if it is not already registered insert into cr_item_template_map select - register_template__template_id as template_id, register_template__item_id as item_id, + register_template__template_id as template_id, register_template__use_context as use_context from dual Index: openacs-4/packages/cms/tcl/form-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/form-procs-postgresql.xql,v diff -u -r1.13 -r1.14 --- openacs-4/packages/cms/tcl/form-procs-postgresql.xql 27 Aug 2001 03:59:17 -0000 1.13 +++ openacs-4/packages/cms/tcl/form-procs-postgresql.xql 30 Aug 2001 01:46:05 -0000 1.14 @@ -214,7 +214,8 @@ update cr_revisions - set content = [set __lob_id [db_string new_lob "select empty_lob()"]] + set lob = [set __lob_id [db_string new_lob "select empty_lob()"]], + content_length = [file size $tmpfile] where revision_id = :revision_id @@ -252,7 +253,8 @@ update cr_revisions - set content = [set __lob_id [db_string new_lob "select empty_lob()"]] + set lob = [set __lob_id [db_string new_lob "select empty_lob()"]], + content_length = [file size $tmpfile] where revision_id = :revision_id Index: openacs-4/packages/cms/tcl/form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/form-procs.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/cms/tcl/form-procs.tcl 27 Aug 2001 03:59:17 -0000 1.14 +++ openacs-4/packages/cms/tcl/form-procs.tcl 30 Aug 2001 01:46:05 -0000 1.15 @@ -911,13 +911,17 @@ } elseif {[string equal $storage_type text]} { # upload the file into the revision content db_dml upload_text_revision "update cr_revisions - set content = empty_blob() where revision_id = :revision_id + set content = empty_blob(), + content_length = '[file size $tmpfile]' + where revision_id = :revision_id returning content into :1" -blob_files [list $tmpfile] } else { # upload the file into the revision content db_dml upload_revision "update cr_revisions - set content = empty_blob() where revision_id = :revision_id + set content = empty_blob(), + content_length = '[file size $tmpfile]' + where revision_id = :revision_id returning content into :1" -blob_files [list $tmpfile] } @@ -2013,13 +2017,17 @@ } elseif {[string equal $storage_type text]} { # upload the file into the revision content db_dml upload_text_revision "update cr_revisions - set content = empty_blob() where revision_id = :revision_id + set content = empty_blob(), + content_length = '[file size $tmpfile]' where + revision_id = :revision_id returning content into :1" -blob_files [list $tmpfile] } else { # upload the file into the revision content db_dml upload_revision "update cr_revisions - set content = empty_blob() where revision_id = :revision_id + set content = empty_blob(), + content_length = '[file size $tmpfile]' + where revision_id = :revision_id returning content into :1" -blob_files [list $tmpfile] } Index: openacs-4/packages/cms/tcl/item-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/item-procs-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/tcl/item-procs-postgresql.xql 20 Aug 2001 04:35:41 -0000 1.2 +++ openacs-4/packages/cms/tcl/item-procs-postgresql.xql 30 Aug 2001 01:46:05 -0000 1.3 @@ -63,4 +63,15 @@ + + + + select 't' from cr_revisions r, cr_items i + where r.revision_id = :revision_id + and ((r.content is not null and i.storage_type in ('file','text')) or + (r.lob is not null and i.storage_type = 'lob')) + + + + Index: openacs-4/packages/cms/tcl/publish-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/publish-procs-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/tcl/publish-procs-postgresql.xql 28 Aug 2001 23:31:30 -0000 1.2 +++ openacs-4/packages/cms/tcl/publish-procs-postgresql.xql 30 Aug 2001 01:46:05 -0000 1.3 @@ -7,7 +7,9 @@ select case when i.storage_type = 'file' - then '[cr_fs_path]' || r.content + then '[cr_fs_path]' || r.content + when i.storage_type = 'lob' + then lob::text else r.content end as content, i.storage_type from cr_revisions r, cr_items i where r.item_id = i.item_id and r.revision_id = $revision_id Index: openacs-4/packages/cms/www/modules/items/content-download-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/content-download-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/www/modules/items/content-download-postgresql.xql 28 Aug 2001 23:31:30 -0000 1.3 +++ openacs-4/packages/cms/www/modules/items/content-download-postgresql.xql 30 Aug 2001 01:46:05 -0000 1.4 @@ -8,7 +8,9 @@ select case when i.storage_type = 'file' - then '[cr_fs_path]' || r.content + then '[cr_fs_path]' || r.content + when i.storage_type = 'lob' + then lob::text else r.content end as content, i.storage_type from cr_revisions r, cr_items i